Commit Graph

25 Commits

Author SHA1 Message Date
nmlgc b9402be979 [Maintenance] Simplify two-state entity flags
Changing the type to `bool` highlights that these have only two states.
No `switch` required.

Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc a6ba9d88ff [Reverse-engineering] [th05] Sara: Sprite IDs
Part of P0227, funded by nrook.
2023-01-17 10:40:26 +01:00
nmlgc 990588a4ea [Research] Finally figure out relativity of near references
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.
2023-01-16 12:05:29 +01:00
nmlgc 650c1e3364 [Maintenance] Review any redundancies and label them as ZUN bloat
Or quirk, in the case of the slow TH01 ending picture blitting.

Part of P0216, funded by JonathKane.
2022-08-16 01:43:14 +02:00
nmlgc fb924f7f9a [Decompilation] [th04/th05] Bosses: Backdrop rendering
Part of P0192, funded by [Anonymous], nrook, and -Tom-.
2022-05-01 00:22:03 +02:00
nmlgc bcf19490f0 [Decompilation] [th05] Stage 1 midboss: Main function
Part of P0192, funded by [Anonymous], nrook, and -Tom-.
2022-05-01 00:22:03 +02:00
nmlgc 71cb7b5e93 [Decompilation] [th05] Shinki: Main function
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.
2022-05-01 00:22:03 +02:00
nmlgc 4bd8e01c3d [Decompilation] [th05] Shinki: Gather circle intro for patterns in phases 2/3
Featuring something that looks like part of an unused pattern, but was
actually just copy-pasted from Yumeko. Some evidence for Shinki having
been coded after Yumeko, at least.

Part of P0190, funded by nrook.
2022-05-01 00:22:02 +02:00
nmlgc 63091686e2 [Maintenance] [th04/th05] Remove `extern "C"` from more areas of code
hud_hp_put(), hud_hp_update_and_render(), player_angle_from(),
select_for_playchar(), and the midboss functions.

Part of P0190, funded by nrook.
2022-04-30 14:37:28 +02:00
nmlgc 5dca74a77c [Naming] [th04/th05] Boss-specific names for backdrop colorfill functions
Once we decompile whatever can be decompiled of those, we're going to
use the same coordinate constants for both these and the backdrop
image. Ideally, we can even macro (or inline-function) away the entire
implementation, so that the redundancy between TH04's and TH05's Stage
4 bosses won't matter as much.

Part of P0189, funded by Arandui and Lmocinemod.
2022-04-16 23:53:46 +02:00
nmlgc 6db32b92fe [Maintenance] [th04/th05] Remove `extern "C"` from boss functions
Part of P0189, funded by Arandui and Lmocinemod.
2022-04-16 23:53:46 +02:00
nmlgc 5206311da3 [Naming] [th04/th05] Rename `bb_stage*` to "bb_boss*"
They are boss entrance animations first and foremost, and not really
related to the stage part.

Part of P0188, funded by [Anonymous] and nrook.
2022-03-27 01:28:46 +01:00
nmlgc 718590908f [Maintenance] [th04/th05] Remove `extern "C"` from more areas of code
Mostly centered around the HUD, popup, overlay, boss, and player shot
functions we're about to reference in the upcoming decompilations.

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:54 +01:00
nmlgc 6058395372 [Maintenance] Change the inline assembly keyword to `_asm`
The single underscore version is actually slightly more supported among
the compilers I've seen so far. Also added the exact list now.

Part of P0183, funded by Yanga and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc db05bffca3 [Maintenance] Turn motion_t into a template
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-.
2021-07-31 09:33:50 +02:00
nmlgc a157739665 [Reverse-engineering] [th04/th05] .CDG slot IDs for MAIN.EXE
64 slots reserved, 16 slots actually used, another 768 bytes of
conventional RAM wasted…

(And yes, that naming convention is indeed meant as a shoutout to all
the RPG Maker veterans out there.)

Part of P0147, funded by -Tom- and Ember2528.
2021-06-21 15:48:41 +02:00
nmlgc 23c46c6654 [Maintenance] [th05] Get rid of th05.hpp
That was surprisingly painless!

Part of P0147, funded by -Tom- and Ember2528.
2021-06-21 15:48:39 +02:00
nmlgc 11b5febc5a [Maintenance] [th04/th05] Move midboss declarations to their own header file
Part of P0147, funded by -Tom- and Ember2528.
2021-06-20 19:36:14 +02:00
nmlgc 164591f9fe [Maintenance] Consistently express angle literals in signed hex format
Originally just a workaround to remove angles from the PI counter, but
having the sign indicate the Y direction also makes them a lot nicer to
read in C land.

(Maintenance mode commit)
2020-10-02 14:48:54 +02:00
nmlgc 2ef3db3052 [Maintenance] Remove the `operator =` overloads for Subpixels
At least we've now documented their negative effects.

Part of P0110, funded by [Anonymous] and Blue Bolt.
2020-08-19 20:10:08 +02:00
nmlgc 8cf1e74565 [Maintenance] [th05] Split segment #1 before the line set render function
Why does this suddenly break select_for_rank() in C land?!

Part of P0110, funded by [Anonymous] and Blue Bolt.
2020-08-19 20:10:07 +02:00
nmlgc 3821333a7f [Reverse-engineering] [th05] Bosses: Background particle structure
Straightforward even without looking at the functions more closely.

Part of P0110, funded by [Anonymous] and Blue Bolt.
2020-08-19 20:10:04 +02:00
nmlgc 40aea2d171 [Maintenance] [th05] Declare the particle sprite size in a single place
Because it's used by more than one entity type.

Part of P0110, funded by [Anonymous] and Blue Bolt.
2020-08-19 19:33:32 +02:00
nmlgc e1f3af547f [Maintenance] [th04/th05] Declare null callbacks in a single place in C land
Part of P0089, funded by [Anonymous] and Blue Bolt.
2020-05-04 16:14:18 +02:00
nmlgc d1f3dcd620 [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory
Adding op/, main/, and end/ directories does nicely cover a great
majority of the "not really further classifiable slices" implied in
d56bd45.

Part of P0086, funded by [Anonymous] and Blue Bolt.
2020-04-15 20:58:01 +02:00