Commit Graph

7 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 7e89d76751 [Maintenance] [th03] Define a player ID type
Luckily, C has nothing against `typedef`s being repeatedly defined to
the same value.

Part of P0261, funded by [Anonymous] and Yanga.
2023-11-01 23:17:52 +01:00
nmlgc f9d983e0c0 [Decompilation] [th03] Player: Collision detection
8×8-pixel* player hitbox confirmed.

(* 8×4 in VRAM terms)

Completes P0183, funded by Yanga and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc 1e2c7ad37e [Reverse-engineering] [th03] Collision bitmap: Rectangles (undecompilable)
Reason: Self-modifying. -.-

The main shape used for drawing into this bitmap. "Stripes" would have
been a better name, with only the top 2 (screen) / 1 (VRAM) out of
every 8 (screen) / 4 (VRAM) pixels inside these rectangles being
actually set as collidable inside this bitmap. If a player's hitbox
happens to be smaller than 8 (screen) / 4 (VRAM) pixels, this would
mean that a player could dodge right through two of these stripes. Same
for the CPU, which would make it obvious how it could cheat.

But are player hitboxes actually small enough for that to be possible?
Gotta add another push to find out…

(Also, wow, that's some ingenious bit twiddling right there… and it's
all completely correct. 🤯 Whether all that complexity and especially
all that register overloading would have been *necessary*, on the other
hand…)

Completes P0182, funded by Lmocinemod and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc 07561f4824 [Reverse-engineering] [th03] Collision bitmap: Drawing vertical lines
Ironically only used for pellets, which are now confirmed to have a 2×2
(screen) / 2×1 (VRAM) hitbox. Might have been "decompilable", but it's
sandwiched between undecompilable functions.

Part of P0182, funded by Lmocinemod and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc c04ca8da91 [Reverse-engineering] [th03] Collision bitmap: Drawing slopes (undecompilable)
Reason: Self-modifying. -.-

Only used in Chiyuri's EX Attack (the one with the diagonal lasers).

Part of P0182, funded by Lmocinemod and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc 3072208336 [Reverse-engineering] [th03] Collision bitmap: Variables and constants
Oh wow, it's exactly how I always naively imagined collision detection
to be implemented in a fixed-resolution 2D bullet hell game with small
hitboxes.

Part of P0182, funded by Lmocinemod and [Anonymous].
2022-02-18 09:36:34 +01:00