Storing bomb and point items not just in separate arrays, but also
using separate *functions* for both?! At least it's only a single
structure for both.
Part of P0158, funded by Yanga.
Most notably from `th01/core/str_val`, where it's really in the way.
That mistake will haunt me until this all is done, probably…
Part of P0158, funded by Yanga.
Used for the 東方★靈異伝 effect at the beginning of each scene. Good
that there's this second TRAM page, that's how we can be lazy and just
write into the 26th row :tannedcirno:
Part of P0157, funded by Yanga.
A small function that prompted lots of research into whether it's
actually correct… which then revealed that every single widely used
PC-98 emulator is broken in this regard. More about that in two
upcoming pushes…
Part of P0157, funded by Yanga.
Third longest function in all of PC-98 Touhou, and it's even more of a
copy-pasta than the patterns we've seen earlier. Certainly didn't feel
that long.
Part of P0156, funded by Ember2528.
The one where Konngara swings their sword and fires fast aimed pellets
towards the player.
The third time we've seen the exact same basic function layout…
Part of P0155, funded by Ember2528.
The one with lasers fired from the sword across the whole playfield,
either from left to right or from right to left, together with aimed
3-way spreads, every 10 frames.
Part of P0155, funded by Ember2528.
Similarly to cb6367a, you also can't tell from a function's ASM whether
a parameter that's assigned to an 8-bit destination is actually an 8-bit
parameter, or a narrowed 16-bit parameter. That can really only be
gleaned from looking at all call sites…
Part of P0155, funded by Ember2528.
The one where Konngara swings their sword and spawns triangle-shaped
subpatterns along the slash path.
At least no randomness in that one.
Part of P0155, funded by Ember2528.
The one where Konngara swings their sword and lets pellets rain along
the (surprisingly triangular) slash path.
Yeah… not worth expressing these coordinates in playfield space when
they clearly correspond to specific locations in the background image.
Completes P0154, funded by Ember2528.
The one where Konngara shoots rays in a semicircle motion from their
sword to the edge of the playfield, with pellets raining down from the
ray's end point.
Insert "if… else if… else if…" joke. And hey, I've finally had the idea
to use function-local enums in place of #define!
Part of P0154, funded by Ember2528.
The one where a gray diamond first flies from Konngara's left sleeve to
the top of the playfield, and then moves downwards in rows from left to
right and back, shooting aimed pellets along the way.
Completes P0153, funded by Ember2528.
The one with two homing snakes, and pellets fired in a semicircle
spread. And yes, Reimu really has a 30×30-pixel hitbox against the
snakes.
Much simpler than its instruction count might suggest. Recalculating
array element addresses over and over is certainly a way to add bloat…
And yes, we're going to see all of this exact same code again in the
four-snake pattern.
Part of P0153, funded by Ember2528.
Also not worth decompiling, because:
• It would break return value semantics
• The algorithm is identical to TH04 (except for that one divisor)
• Small function
• Next to a bunch of more critical, undecompiled functions
• Decompilation would be messy anyway
Part of P0152, funded by -Tom- and [Anonymous].
And that's it! Finally RE'd every bullet spawning function in TH04 and
TH05! 🎉
These really aren't worth adding a translation unit for either, in the
end. Not least because they decide to keep bullet_template.speed from
being mutated via PUSH and POP, which we can only express via inline
assembly in C land.
Part of P0152, funded by -Tom- and [Anonymous].
Reason: That switch statement. How should we even?
Well, the code *is* fairly good. After looking very deep into it, and
spending 35% of that function on blank lines (for logical grouping) and
explanatory comments, that is…
Part of P0152, funded by -Tom- and [Anonymous].
Deciding whether to decompile this one or not seemed to be a tough
choice. Should we *really* introduce two more translation units just
for the sake of decompiling another function that's identical to its
TH04 counterpart anyway?
Well, turns out it actually isn't: TH05 does in fact *not* immediately
clip bullets that are spawned on top of the player. Which might sound
like it has a notably different effect on gameplay… except that it
doesn't.
So yeah, good we've decompiled it, and got to show that more clearly.
Part of P0152, funded by -Tom- and [Anonymous].
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].