Commit Graph

12 Commits

Author SHA1 Message Date
nmlgc c85c0e2483 [Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
  player_pos_update_and_clamp(), score_update_and_render(), and
  slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
  stage2_invalidate(), stage2_update(), and space_window_set()

Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-07-09 08:40:43 +02:00
nmlgc 1f962c865e [Maintenance] Introduce a generic entity flag enum
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc d9427b0761 [Maintenance] [th02/th04/th05] Remove `extern "C"` from more areas of code
The TH04/TH05 gather functions, as well as the TH02 vector functions.

Part of P0227, funded by nrook.
2023-01-16 10:16:12 +01:00
nmlgc 04de2fddd9 [Decompilation] [th05] Bullets: Sprite selection by angle
And we're right back to dumb micro-optimizations.

Part of P0192, funded by [Anonymous], nrook, and -Tom-.
2022-05-01 00:22:04 +02:00
nmlgc 07b956b3ad [Maintenance] [th04/th05] Move bullet code into dedicated segments
Too bad that alignment constraints do in fact force us to compile
th04/bullet_u.cpp and th04/bullet_a.cpp separately. 😕

Part of P0184, funded by -Tom-.
2022-03-05 15:31:50 +01:00
nmlgc 24219dc897 [Reverse-engineering] [th04/th05] Bullets: Parameters for special motion types
Not just the maximum bounce count. Unsurprisingly, I also did a rather
shallow job in this part of the bullet code back in 2020…

Part of P0184, funded by -Tom-.
2022-02-28 22:13:06 +01:00
nmlgc f005eb023b [Maintenance] Remove all unused externs in ASM land
Part of P0158, funded by Yanga.
2021-09-28 18:05:24 +02:00
nmlgc b0a2621296 [Reverse-engineering] [th05] Bullets: Spawn function (undecompilable)
Reason: Self-modifying. -.- And saving SI and DI on the stack way too
late.
Luckily, it's mostly identical to TH04's version I decompiled earlier,
only (thankfully) combining regular and special bullets into one
function, and integrating TH05-specific improvements.

Part of P0152, funded by -Tom- and [Anonymous].
2021-07-31 20:19:33 +02:00
nmlgc 9ff0033a0c [Reverse-engineering] [th05] Bullets: Far wrapper for regular bullet spawning
Only used for the revenge bullets fired from Stage 3 Alice's barrier.
Not worth creating a separate translation unit, especially since the
function above is undecompilable as well…

Part of P0152, funded by -Tom- and [Anonymous].
2021-07-31 20:19:33 +02:00
nmlgc f3d59bc324 [Decompilation] [th04/th05] Applying VRAM scrolling to Y coordinates (segment 3)
… Wait, we *can* decompile functions with both parameters, no stack
frame, and a Pascal calling convention?! Good that I already forgot how
impossible it was to decompile the first function I looked at that fell
into this category!

Part of P0148, funded by [Anonymous].
2021-07-21 00:35:02 +02:00
nmlgc 8a5a9accd6 [Maintenance] Rename pellet/bullet "patterns" to "groups"
We're going to need some name for the longer, boss-specific danmaku
animations. Turns out that these are exactly called "patterns" in
Sparen's glossary:

	https://sparen.github.io/ph3tutorials/ddsg0.html#sub4

So what we called a "pattern" is actually called a "group". Whoops!

Part of P0142, funded by Yanga.
2021-05-27 20:21:09 +02:00
nmlgc 4f7a3a28c3 [Reverse-engineering] [th05] Difficulty- and rank-based bullet pattern tuning
If C allowed labels of other functions as `goto` targets, this *might*
have been decompilable into something useful to modders. But like this,
there's no point in even trying.

Yeah, you *really* don't want to base your fangame mod on TH05.

Part of P0109, funded by [Anonymous] and Blue Bolt.
2020-08-16 21:40:33 +02:00