Commit Graph

23 Commits

Author SHA1 Message Date
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 a10fe95b31 [Maintenance] Fix comment↔code associations
• Comments that describe all lines of code until a blank one are placed
  into the lines immediately above
• Comments that describe an entire demarcated block are placed
  immediately below the dash row at the top
• In any case, there should be a blank line after the top comment of
  a demarcated block, to keep IntelliSense-style systems from applying
  the block comment to the first actual line of code…
• …but there shouldn't be one before the dash row at the bottom, where
  it'd be redundant.

Part of P0207, funded by GhostPhanom.
2022-08-08 20:10:53 +02:00
nmlgc 456768a4ff [Contributing] Define `struct`, `class` and `template` naming conventions
Again, these are what I've been mostly following, apart from a few
inconsistencies which this commit also fixes.

Part of P0207, funded by GhostPhanom.
2022-08-08 20:10:38 +02:00
nmlgc 0c682b5bc0 [Maintenance] Declare the optimization_barrier() a single time
And put that single instance into the compiler optimization workaround
section of `decomp.hpp`.

Part of P0204, funded by [Anonymous].
2022-07-10 13:45:18 +02:00
nmlgc 08488e2594 [Maintenance] [th03/th04/th05] Drop the `_lebcd` suffix from score variables
What is this, reversed Hungarian notation? For gaiji strings, it makes
sense because there's no difference in the access code to regular
strings, but you can't really do anything with a union itself.
(Besides passing it to a function in a type-safe way, but that's cool.)

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-27 01:29:03 +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 c1d8e210f6 [Reverse-engineering] [th03] Player: Useless ID / attack sprite offset variable
And doubly so, with both of the values being redundant.

Part of P0183, funded by Yanga and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc 9b28791c7f [Maintenance] [th03] Add a separate type for SPRITE16 sprite area offsets
Part of P0182, funded by Lmocinemod and [Anonymous].
2022-02-18 09:36:34 +01:00
nmlgc 49b898b6fb [Reverse-engineering] [th03] Player: Pointer to currently updated instance
Function pointers with more than 0 parameters are hard and annoying,
am I right? 😛

Part of 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
nmlgc 70cbf4bbe1 [Maintenance] [th03] Adopt the PlayfieldPoint subpixel type from TH02/TH04/TH05
Makes sense for this game as well, even if it can only serve
documentary purpose due to it not knowing which playfield it's on.

Part of P0182, funded by Lmocinemod and [Anonymous].
2022-02-14 07:03:34 +01:00
nmlgc 5fac2006ff [Maintenance] Consistently use "score" instead of "points"
Or at least in addition.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 00:50:39 +01:00
nmlgc 99aee2bdbe [Maintenance] Consistently use singular for entity structure and file names
Not too sure about "chars" yet, with TH03 and all.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 19:14:02 +01:00
nmlgc fb67d4d054 [Maintenance] Rename all old *_X and *_Y constants to *_LEFT and *_TOP
Part of P0112, funded by [Anonymous] and Blue Bolt.
2020-08-28 15:14:22 +02:00
nmlgc c5b5dc0201 [Reverse-engineering] General bomb-related globals
Yup, function pointers, frame counters, and general state variables for
all 5 games.

Part of P0111, funded by [Anonymous] and Blue Bolt.
2020-08-28 15:03:03 +02:00
nmlgc 368f151759 [Maintenance] Declare distinct types for screen, VRAM, and TRAM coordinates
Whew, time to look at every `int` variable we ever declared! The best
moment to do this would have been a year ago, but well, better late
than never. No need to communicate that in comments anymore.

These shouldn't be used for widths, heights, or sprite-space
coordinates. Maybe we'll cover that another time, this commit is
already large enough.

Part of P0111, funded by [Anonymous] and Blue Bolt.
2020-08-28 14:53:30 +02:00
nmlgc bd1c2ee7de [Maintenance] #define the number of dots in a byte
One fewer magic number. And one more deliberate dependency on a
PC-98-specific hardware constant, to further drive home just how
unportable these games are, even once decompilation will be complete.

Part of P0105, funded by Yanga.
2020-08-12 16:16:58 +02:00
nmlgc 8f8940801d [Maintenance] Move the Subpixel class to TH01
At least pellets are moved at a decent precision in this game.

Part of P0099, funded by Ember2528.
2020-07-12 15:16:03 +02:00
nmlgc 97dce75446 [Maintenance] Proofread all comments in C land 2020-06-21 22:14:08 +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