Commit Graph

2379 Commits

Author SHA1 Message Date
nmlgc f5313d14cb [Decompilation] [th02] Items: Semi-random spawn function
Featuring a 1-in-512 chance for a bomb drop… among every 4th call to
this function.

Part of P0243, funded by Yanga.
2023-06-07 18:32:38 +02:00
nmlgc 2a059e2206 [Decompilation] [th02] Items: Spawn function
Hitting exactly 30% RE for TH02.

Part of P0243, funded by Yanga.
2023-06-07 18:32:38 +02:00
nmlgc 310ff3d7df [Decompilation] [th02] Items: Spawning the 5 items when losing a life
Part of P0243, funded by Yanga.
2023-06-07 17:00:35 +02:00
nmlgc 1099383256 [Decompilation] [th02] Items: Tile invalidation
Part of P0243, funded by Yanga.
2023-06-07 16:58:10 +02:00
nmlgc 943da08767 [Decompilation] [th02] Items: Collision detection and collection
Part of P0243, funded by Yanga.
2023-06-07 16:57:41 +02:00
nmlgc 8f7478b108 [Decompilation] [th02] Items: Update and render function
Part of P0243, funded by Yanga.
2023-06-07 16:49:05 +02:00
nmlgc 916992e5d1 [Reverse-engineering] [th02] Items: Shared state
Part of P0243, funded by Yanga.
2023-06-07 15:38:32 +02:00
nmlgc 6ff396f96a [Reverse-engineering] [th02] Items: Structure
Part of P0243, funded by Yanga.
2023-06-07 15:34:49 +02:00
nmlgc 720fd575b1 [Reverse-engineering] [th02] Player: Current position
Part of P0243, funded by Yanga.
2023-06-07 15:34:44 +02:00
nmlgc dfa758da89 [Decompilation] [th02] Gaiji loading and freeing
Completes P0242, funded by Yanga.
2023-06-07 15:34:37 +02:00
nmlgc fefeb1859d [Decompilation] [th02] HUD: Full rendering
Part of P0242, funded by Yanga.
2023-06-07 01:32:45 +02:00
nmlgc b38db78441 [Decompilation] [th02] HUD: Score rendering
Part of P0242, funded by Yanga.
2023-06-07 01:18:32 +02:00
nmlgc ef7162195a [Decompilation] [th02] Score: Initialization, reset, and consistency functions
Part of P0242, funded by Yanga.
2023-06-07 00:40:27 +02:00
nmlgc 617815b745 [Decompilation] [th02] Score: Regular update and render function
Part of P0242, funded by Yanga.
2023-06-07 00:40:27 +02:00
nmlgc 6763b44dd0 [Decompilation] [th02] Score: Turning the current delta into a bonus
By leaving out just the one `score_delta = 0;` assignment, ZUN created
a function with semantics so complex that it already required naming
all other score-related functions just to make sense of it.

Part of P0242, funded by Yanga.
2023-06-07 00:40:27 +02:00
nmlgc 7e64c1cc06 [Decompilation] [th02] HUD: Life and bomb display
Part of P0242, funded by Yanga.
2023-06-06 21:38:27 +02:00
nmlgc 0d28c116c0 [Decompilation] [th02] HUD: Power bar rendering
Which also commits power changes to the shot level…

Part of P0242, funded by Yanga.
2023-06-06 21:37:07 +02:00
nmlgc 7bd0ac3f17 [Reverse-engineering] [th02] Score deltas
Part of P0242, funded by Yanga.
2023-06-06 21:20:57 +02:00
nmlgc dcec17fb42 [Reverse-engineering] [th02] Score extend globals
First feature commit, and it already raises the big questions.

Part of P0242, funded by Yanga.
2023-06-06 21:20:16 +02:00
nmlgc 000bac9190 [Maintenance] Random number ring buffer: Fix inconsistencies between & and %
Bracketing is hard!

Part of P0242, funded by Yanga.
2023-06-06 21:11:58 +02:00
nmlgc 2c52cc83b1 [Maintenance] Random number ring buffer: Remove `extern "C"`
Didn't expect to cover it this soon, but I'd really like to have a "is
range a power of two" template.

Part of P0242, funded by Yanga.
2023-06-06 21:07:08 +02:00
nmlgc 9aad9ad114 [Maintenance] Declare 8-bit pixel delta and length types
Part of P0242, funded by Yanga.
2023-06-06 21:02:47 +02:00
nmlgc 08352a5a81 [Decompilation] [th04] Stage tiles: Setting single tiles / .STD: Load function
Word alignment forces us to decompile these two barely related things
in a single commit. The former is at least much better and saner than
its TH02 counterpart.

Completes P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 5f030461e7 [Decompilation] [th04/th05] .STD: Declare functions and data in C land
And slightly improve the 2018 names, matching TH02's from earlier in
2023.

Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 4ca024317d [Position independence] [th04] False positives: Frame-based calculations
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 3862e989c7 [Position independence] [th03/th04] False positives: snd_delay_until_measure()
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc d84602d810 [Position independence] [th04] False positives: Upward angles
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc a98ed32b10 [Position independence] [th04] False positives: Q12.4 subpixel calculations
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 4eea7cdd8b [Reverse-engineering] [th04] Thick lasers: Structure
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 61a90297c3 [Reverse-engineering] [th04] Stage 6 Yuuka: 16×16 background shape structure
Procrastinating the separate flag and state variables for now, as they
don't get us any closer to 100% PI.

Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:31:46 +02:00
nmlgc 53292a1f7b [Reverse-engineering] [th04] 1-plane blitting of regular 16×16 `super_` sprites
Yet another master.lib-inspired function that accesses `super_patdata`,
found in 2023. Only used for the star shapes during bomb animations,
and the various shapes in Stage 6 Yuuka's background.

Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:26:02 +02:00
nmlgc 863794d1d6 [Reverse-engineering] [th04] Gengetsu: Wave animation target
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:26:02 +02:00
nmlgc d0d48b79dd [Reverse-engineering] [th04] Custom entity structure 6: Gengetsu's column lines
Ending on the simplest one.

Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:26:02 +02:00
nmlgc 8d44a773f2 [Reverse-engineering] [th04] Custom entity structure 5: Stage 6 Yuuka's circle
Part of P0241, funded by [Anonymous] and Blue Bolt.
2023-05-30 01:26:02 +02:00
nmlgc 40c900ffdc [Reverse-engineering] [th04] Custom entity structure 4: Stage 6 Yuuka's crosses
Completes P0240, funded by JonathKane.
2023-05-30 01:26:02 +02:00
nmlgc 6b58ba359b [Reverse-engineering] [th04] Custom entity structure 3: Stage 4 Reimu's orbs
Part of P0240, funded by JonathKane.
2023-05-30 01:26:02 +02:00
nmlgc 6e93bb2a52 [Reverse-engineering] [th04] Custom entity structure 2: Stage 4 Marisa's bits
Part of P0240, funded by JonathKane.
2023-05-30 01:26:02 +02:00
nmlgc 2d4d61f977 [Reverse-engineering] [th04] Custom entity structure 1: Kurumi's spawn rays
Part of P0240, funded by JonathKane.
2023-05-30 01:26:02 +02:00
nmlgc 8f78fa497d [Reverse-engineering] [th04] Custom entities: Structure
Part of P0240, funded by JonathKane.
2023-05-30 01:26:02 +02:00
nmlgc 45df9ec0c6 [Decompilation] [th04] Scrolling checkerboard background
Used during the Stage 6 Yuuka fight, and, fortunately, decompilable
without ASM.

Part of P0240, funded by JonathKane.
2023-05-30 01:25:20 +02:00
nmlgc 9da909467c [Decompilation] [th04] Stages: Stage 5 background star rendering
Part of P0240, funded by JonathKane.
2023-05-29 21:23:08 +02:00
nmlgc d93e3ab85b [Maintenance] [th04] Split segment #1 before the Stage 5 render function
That's it, no more letters left in the front… Gotta clean this up soon.

Part of P0240, funded by JonathKane.
2023-05-29 21:23:08 +02:00
nmlgc df539f13da [Maintenance] [th02/th04/th05] Stage tiles: Separate ID → VRAM offset function
Perfectly inlines in the one place in TH02 that uses it, and will be
constant-folded away for the few calls in TH04 where ZUN originally
hardcoded VRAM offsets.

Part of P0240, funded by JonathKane.
2023-05-29 21:23:00 +02:00
nmlgc 9a8e0fc0fd [Maintenance] Move the point structures into `pc98.h`
Unfortunately, it's still premature to start a separate header file for
display-space coordinates like I'm doing with Shuusou Gyoku. What does
make sense, though, is moving the display-space vector types next to
the display-space scalar types in `pc98.h`. This makes much more sense
than keeping them in `master.hpp` just because master.lib also has a
Point type. Would have thought that this lets us remove more than two
`master.hpp` inclusions, though…

Part of P0240, funded by JonathKane.
2023-05-25 15:17:01 +02:00
nmlgc 5303c37de2 [Maintenance] [th04/th05] Custom entities: Move declarations to TH04
Part of P0240, funded by JonathKane.
2023-05-25 15:11:50 +02:00
nmlgc be69ab6265 [Research] [th01] Document the bug that causes `game s` to work
Because it shouldn't. Thanks to mu021 for bringing this to my
attention!

Part of P0239, funded by Ember2528.
2023-04-30 17:12:57 +02:00
nmlgc 308b6bcd2c [Maintenance] [th01] Endings: Reclassify the ドカーン image tearing issue as a bug
And explicitly define observability in terms of an infinitely fast
PC-98. That's the only reasonable assumption to make when considering
ports to faster architectures that aren't bottlenecked by disappointing
blitter chips.

Part of P0239, funded by Ember2528.
2023-04-30 17:12:47 +02:00
nmlgc 0b13967de3 [Maintenance] [th01] Add some missing detail to existing comments
Part of P0239, funded by Ember2528.
2023-04-28 22:21:26 +02:00
nmlgc 45c9e71533 [Maintenance] Fix another bunch of accumulated typos and dead code
Part of P0239, funded by Ember2528.
2023-04-28 22:21:21 +02:00
nmlgc ea8c4b85a4 [Hooks] pre-commit: Preserve CRLF line endings
Part of P0239, funded by Ember2528.
2023-04-28 22:21:00 +02:00