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.
Oh, an EMS function that does one single thing, and is not potentially
bugged within TH05's original sprite limits?! (Although that last part
might have just been a happy accident.)
Part of P0168, funded by Blue Bolt and rosenrose.
Stupid one-off functions deserve stupid names, Part 3. This time also
coming with an unnecessary precondition.
Part of P0168, funded by Blue Bolt and rosenrose.
No, I'm not copying exactly what was on ZUN's monitor during the 2010
MAG・ネット documentary. Also, this one was very lucky not to receive
a stupid function name.
Part of P0168, funded by Blue Bolt and rosenrose.
Copy-pasted from the SinGyoku version, and the differences can be fully
parametrized. Awesome to have a series of pushes end like this!
Completes P0167, funded by Ember2528.
Macro-free, compile-time conversion from Shift-JIS to JIS is entirely
possible in this 1994 C++ compiler, even when using an inlined
function! Awesome.
Really though, how often can you needlessly re-blit the same thing?
Part of P0167, funded by Ember2528.
TH01 doesn't use "back" and "front" pages in the way the later games
do, after all. Indicating that the source page of this parameter-less
function is the one that was previously set via graph_accesspage_func()
is going to make pretty much all its call sites way clearer, and stops
implying any further state.
Part of P0167, funded by Ember2528.
What's most ridiculous about this is that ZUN had already reimplemented
master.lib text mode functions (th01/hardware/ztext.c). He simply never
used anything from there.
Part of P0167, funded by Ember2528.
Stupid one-off functions deserve stupid names, Part 2. If it only
loaded sprites, I might have given it a somewhat better name.
Part of P0167, funded by Ember2528.
Mission accomplished, Sariel unblocked… but what do we now do with the
remaining ¾ of this push? I'd really like to focus on Sariel in her own
dedicated push series…
Part of P0167, funded by Ember2528.
In which all the declarations expand the C++ code to take up more lines
than the previous compressed ASM representation.
Part of P0166, funded by Ember2528.
The one with the yellow random stars on top of Elis.
And you know what, I'm just going to accept these incorrect 4 bytes
temporarily. The easy workaround for the three calls in the first
conditional branch inverts the order of that branch and the next one
in the generated ASM, and working around *that* will cause a
disproportionately greater mess. The code generation here is
semantically equivalent to the original ASM, doesn't add or remove a
single byte, and the issue is going to fix itself 5 commits from now.
Part of P0166, funded by Ember2528.
In which ZUN wanted to use a parameter to distinguish between taking
the position from Stationary-Or-Wavy-Elis and Attacking-Elis, but then
sets the latter's position to the former's before doing anything with
that parameter.
Part of P0166, funded by Ember2528.
Due to mixed float/double arithmetic in both of the two remaining
functions, this is all missile code we can meaningfully decompile
right now.
Part of P0165, funded by Ember2528.
And that's why these feel so awful in-game: Interlaced rendering, and
an unfair 46×46 hitbox around Reimu's center point.
Part of P0165, funded by Ember2528.
Another 150 bytes wasted on unused structure members… and if you
already use a SoA layout, you could have also squeezed the flags into 2
bits per entity rather than 8, which would have saved another 37 bytes.
Part of P0165, funded by Ember2528.