Commit Graph

30 Commits

Author SHA1 Message Date
nmlgc b61e612fdf [Maintenance] #include each header's dependencies within the header itself
OK, this is the big one. We still keep using `#include` guards only
where we absolutely need to, but with each header now being valid in
isolation, this can now actually help *minimize* the length of each
translation unit's `#include` list. Turns out that after removing all
the duplicates, we only *actually* need to guard 29 headers across all
5 games.

Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:46:42 +02:00
nmlgc ab7dbf0462 [Decompilation] [th01] OP.EXE: Move the final pieces of data to C land
100%.

Part of P0216, funded by JonathKane.
2022-08-16 01:54:03 +02:00
nmlgc c714c53310 [Decompilation] [th01] Main menu, part 1 (reviewed)
5.

Part of P0216, funded by JonathKane.
2022-08-16 01:45:46 +02:00
nmlgc 08e064fce0 [Decompilation] [th01] REIIDEN.EXE: main()
Three nested infinite loops, and negative glitch stages in debug mode.
What a fitting end, indeed.

Part of P0215, funded by Ember2528 and Yanga.
2022-08-15 00:44:05 +02:00
nmlgc 07ea484425 [Decompilation] [th01] In-game debug variable display
Part of P0215, funded by Ember2528 and Yanga.
2022-08-14 23:25:33 +02:00
nmlgc 414770c717 [Decompilation] [th01] Memory info screen
Hiding a lot of dynamic .PTN buffer size information behind misleading
labels. Nothing there to tell ZUN that he could have just easily saved
20% of all this memory by using a structure without an unneeded alpha
plane.

Completes P0214, funded by Ember2528.
2022-08-14 23:24:53 +02:00
nmlgc ea8e2a2f9f [Decompilation] [th01] REIIDEN.EXE: Out-of-memory handler
Part of P0214, funded by Ember2528.
2022-08-14 23:24:29 +02:00
nmlgc a981007b7a [Decompilation] [th01] Continue menu
Part of P0214, funded by Ember2528.
2022-08-14 23:22:47 +02:00
nmlgc 191a3497d8 [Decompilation] [th01] Pause menu
Part of P0214, funded by Ember2528.
2022-08-14 23:21:16 +02:00
nmlgc b60a23e737 [Naming] [th01] Rename `done` to `player_is_hit`
One disgusting abuse of this flag shouldn't ruin a perfectly adequate
variable name, and force a dependency on input variables on every
gameplay-related translation unit. Especially since the "ZUN bloat"
convention allows us to clearly highlight it.

Part of P0214, funded by Ember2528.
2022-08-14 23:16:40 +02:00
nmlgc d79f06b66a [Decompilation] [th01] Bonus screens: Move all data to C land
Part of P0213, funded by Ember2528 and GhostRiderCog.
2022-08-11 23:21:22 +02:00
nmlgc 363fd54e6a [Decompilation] [th01] Stage bonus: Main function
Completes P0212, funded by GhostRiderCog, Lmocinemod, and LeyDud.
2022-08-11 23:18:29 +02:00
nmlgc 60a7e44b53 [Maintenance] Introduce proper Shift-JIS and JIS X 0208 types
Much more semantic than that twobyte_t abomination.

Part of P0212, funded by GhostRiderCog, Lmocinemod, and LeyDud.
2022-08-11 15:53:13 +02:00
nmlgc d398a949fc [Decompilation] High score menu: Move all data to C land
Completes P0211, funded by Lmocinemod and Arandui.
2022-08-08 20:16:29 +02:00
nmlgc 6e36dfd93b [Decompilation] [th01] Verdict screen: Move all data to C land
Part of P0211, funded by Lmocinemod and Arandui.
2022-08-08 20:16:25 +02:00
nmlgc 459f3db4bd [Decompilation] [th01] HUD: Move all data to C land
Part of P0211, funded by Lmocinemod and Arandui.
2022-08-08 20:15:57 +02:00
nmlgc 515b4c6315 [Decompilation] [th01] YuugenMagan: Move all data to C land
And that's it! All TH01 bosses fully decompiled, which makes 8 PC-98
Touhou bosses in total with 23 to go! And now, time to move a whole lot
of other data…

Completes P0210, funded by Arandui and Yanga.
2022-08-08 20:15:10 +02:00
nmlgc bfdb1e33f4 [Decompilation] [th01] Endings: Bad
Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc cfb0b5f21b [Decompilation] [th01] Endings: Good
100 functions remaining in all of TH01!

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc f1dbf5f13f [Decompilation] [th01] Endings: Boss slideshow
Alignment hacks! Alignment hacks everywhere.
(The translation unit layout workarounds are temporary, at least.)

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc 48db0b7a72 [Decompilation] [th01] Verdict screen: Title calculation
You can definitely make an argument that these if/else if branches are
easier to read than their implied formula, especially with all
variables being signed here.

Completes P0197, funded by Yanga and Ember2528.
2022-06-01 02:27:52 +02:00
nmlgc 2863a69836 [Decompilation] [th01] Verdict screen: Main function
Part of P0197, funded by Yanga and Ember2528.
2022-06-01 02:27:52 +02:00
nmlgc 021cbc8e9d [Decompilation] [th01] Boss defeat sequence: SinGyoku version + route selection
Part of P0167, funded by Ember2528.
2021-11-07 23:32:21 +01:00
nmlgc 61091c31cc [Decompilation] [th01] Stage opening animation
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.
2021-11-07 23:29:37 +01:00
nmlgc 6e7ab07659 [Decompilation] [th01] Loading and initializing common data used in all stages
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.
2021-11-07 23:22:10 +01:00
nmlgc aeb7fb48aa [Decompilation] [th01] Elis: Sprite loading
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.
2021-11-07 23:14:13 +01:00
nmlgc c0c0ebc3cd [Decompilation] [th01] Bomb items: Collection and drop callbacks
Second instance of min/max clamping macros being nested into each
other…

Completes P0158, funded by Yanga.
2021-09-28 18:05:24 +02:00
nmlgc e1fcd75cb4 [Decompilation] [th01] Konngara: Move all data to C land
And that's it! No Konngara-related code left in ASM land, first boss
complete! 30 to go :P

Part of P0156, funded by Ember2528.
2021-08-22 23:56:59 +02:00
nmlgc 6ffe87f35b [Decompilation] [th01] Konngara: Main function
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.
2021-08-22 23:56:58 +02:00
nmlgc 5afee78f33 [Decompilation] [th01] Konngara: Loading and entrance animation
It's script-like code, what can you say. Maybe minimally sloppy in some
places, but ultimately harmless.

Oh, the Siddhaṃ seed syllables are supposed to show up immediately, with
no delay between them? Good to know – clocking your emulator too low
tends to roll them down from the top of the screen, and does add a
noticeable delay between the individual images.

… Wait, but this means that ZUN could have *intended* this "effect".
Why else would he not only put those syllables into four individual
images, but also show them on the foreground VRAM page?

Completes P0141, funded by [Anonymous] and rosenrose.
2021-05-27 19:36:03 +02:00