One of the hardest decompilations in a long while:
• Required new research into code generation for pointer arithmetic
• ZUN needlessly calculating intermediate results over and over again,
making the function tedious to read
• GRCG reads in TCR mode, which I haven't seen so far either
Part of P0176, funded by Ember2528.
TDW and TCR modes share the same bit in the GRCG mode register and are
thus indistinguishable when looking at a disassembly, but only apply to
writing (TDW) or reading (TCR), respectively. TH01 only performs read
operations in this mode, so it's unambiguously TCR.
Part of P0176, funded by Ember2528.
The one where red birds hatch on an ellipse arc, then fly away while
shooting a randomly selected pellet group type. Containing Sariel's
first ZUN bug, resulting in unused sprite movement.
Completes P0175, funded by Ember2528.
The one where two vortex sprites wall Reimu inside a continuously fired
static 3-spread stack.
Whose per-difficulty density is only controlled by the amount of
frames they have moved towards each other, interestingly.
(And yes, second pattern in the fight, first one in the code.)
Part of P0175, funded by Ember2528.
Surprise, this .PTN sprite isn't actually just the background, but a
complete opaque copy of the 128×128 pixels in the .GRP image that
contain the initial position of the wand. This is what allows Sariel
to lower it again after blitting the raised sprites from BOSS6_2.BOS.
Part of P0175, funded by Ember2528.
In which the black part in BOSS6_2.BOS's second cel is indeed meant to
unblit the purple part in the first cel, leaving a hole in both the
seal and the red HUD border. Shouldn't it rather contain the original
pixels, including the part of the seal that is covered by the sphere on
top of the wand even in the .GRP?
Part of P0175, funded by Ember2528.
I appreciate that this design allows all bird state to be scoped to
this function, but *come on*, one function doing 6 different jobs?
Also, maximum floating-point decadence… but perhaps the worst part is
that the initial bird eggs are a *different* entity.
Completes P0174, funded by Ember2528.
Very helpful at this small scale, as it allows us to directly decompile
floating-point literals. These will be added to Sariel's regular
translation unit in the same order, so we merely have to remove them
from this temporary translation unit then.
Part of P0174, funded by Ember2528.
So if Sariel's version of this function is worse than Konngara's, can
we conclude that Sariel's code was written first?
(Edit, after having decompiled more of the fight: Sariel's functions
are predominantly `near` in contrast to Konngara's 100% `far` ones,
which is just as much of an indicator for the opposite.)
Part of P0174, funded by Ember2528.
Every other motion type requires the other parameters to make sense.
If none of those are given, PM_NORMAL is redundant as well.
Part of P0174, funded by Ember2528.
Oh, so the high score name is only stored backwards for aesthetic
reasons, to make both the name and score blitting loops look identical.
Part of P0173, funded by [Anonymous].
"I don't need the return value in MAINL.EXE? Let's copy-paste the
function and remove all of its `return` statements then!" :zunpet:
Completes P0172, funded by [Anonymous] and Blue Bolt.
Featuring inline assembly for a single ROR instruction. Turbo C++ 4.0J
unfortunately only offers intrinsics for 16-bit rotations.
Part of P0172, funded by [Anonymous] and Blue Bolt.
Aha! TH05 actually loads every single rendered dialog image
individually before rendering it, either from the EMS area or disk.
That's one way to save memory, I guess?
Part of P0169, funded by Blue Bolt.
That's where TH04 crashes in Stage 5 without an EMS driver, but the
code is fine?! (Well, apart from its silly behavior in the Extra
Stage.)
Part of P0169, funded by Blue Bolt.
TH01-style unblitting from the back page of VRAM, in my TH04/TH05?!
It does make sense to suspend double buffering during dialog though,
and you probably don't want to call any custom stage rendering
functions just to effectively unblit a 128×128 pixel area.
Part of P0169, funded by Blue Bolt.