Biggest decompilation breakthrough of the year already? Completely
removes the need for the "set near pointer to far function" hack, and
solves quite a few upcoming issues.
The TASM manuals did have a few pages on the topic of segments and
groups, but there's absolutely nothing about it in the TCC ones beyond
the three-sentence description of `#pragma codeseg` and that completely
unhelpful "🤷" of an explanation for the `Fixup overflow` error…
Part of P0227, funded by nrook.
3rd PC-98 Touhou boss completely decompiled, 28 to go… and the code
quality is taking a nosedive again, especially with that unnecessary
"relative phase" variable that collides with the laser activation flag
in the Devil pattern.
(The nearfunc_t_near workarounds are our fault, though!)
Completes P0191, funded by nrook.
There's the meaning I was looking for in 6ff427a! Far from everything
that's done with this "mode change" variable though – and as we've seen
in 426a531, it's mostly a waste of time to immediately RE all meanings
of this variable across all bosses. So, let's keep using the raw
"phase_state" variable in ASM land.
Part of P0191, funded by nrook.
Oh *come on*. TH05 not only reuses this bad idea from TH04, it also
uses them 4× as often as TH04, even for midbosses. Unfortunately, even
the first two bytes that are only (properly) used for a single thing in
the Yumeko fight make more sense as part of this array – then, it's a
consistent 16 bytes for both games. The fact that I didn't look further
in b02147b probably also contributed to me missing them in 426a531 last
month.
But yeah, no sense in researching the TH05 ones deeper this time.
b4876b6 has already proven that to be a waste of time.
Part of P0190, funded by nrook.
Awesome! The last of the shared TH04/TH05 boss functions, completed
just as the money for that sort of thing ran out. Time to decompile
some actual bosses!
Part of P0188, funded by [Anonymous] and nrook.
With TH04's version hardcoding not only Gengetsu's dialog and
initialization, but also the Bad Ending after having clearing Stage 5
with continues or on Easy difficulty.
Part of P0188, funded by [Anonymous] and nrook.
With a different meaning (and sometimes, even type) every time they are
used, forcing me to look at details of boss fights way before I wanted…
wonderful. Not sure yet whether they're involved in Kurumi's and
Marisa's division-by-0 crashes, but that kind of wildly shared state is
exactly what causes bugs like these to happen. I did manage to
reproduce the Marisa crash during this research!
Temporarily breaking the rule of immediately reflecting ASM land
declarations in C land, because it makes more sense to render these as
macros, local to their respective pattern functions, and it's way too
early for declaring these. Or late, given that I've now got to add a
third push to this stretch…
Completes P0187, funded by [Anonymous] and Blue Bolt.
motion_t is also used for certain animations in MAINE.EXE, so not all
instances refer to entities in playfield space. Explicitly specifying
the latter now allows us to gain…
Part of P0149, funded by Blue Bolt, Ember2528, and -Tom-.
Palette hacks not included yet. Yup, that's how all phases can use
hardware color #0 as their background color.
Completes P0147, funded by -Tom- and Ember2528.
That could have easily been architected without forcing every boss to
manually set the "background to be drawn while bombing" function
pointer.
And without the laziness of just redrawing all tiles during the blocky
opening animation of certain bombs…
Part of P0147, funded by -Tom- and Ember2528.