Commit Graph

85 Commits

Author SHA1 Message Date
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 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 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 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 71c010855d [Maintenance] [th02/th04/th05] Properly declare shot power-related variables
Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc 152bbd6a0f [Decompilation] [th02] Bombs: High-level update and render function
Containing no actual update and render code. (Which is also why we can
already cover it right now.)

Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc fe93bc8218 [Decompilation] [th02] Bombs: Rendering bytes from BOMBS.BFT
Why keep it all in one function when you can split it up into three?
:onricdennat:

Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc 3afa60fbd0 [Decompilation] [th02] Bombs: Smear column rendering
Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc e56fb33f71 [Decompilation] [th02] Bombs: Particle rendering
One of the few cases where byte alignment doesn't matter.

Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc 522976d668 [Decompilation] [th02] Bombs: Circle point rendering
An entire function that will just vanish in this game's Anniversary
Edition.

Part of P0237, funded by Yanga.
2023-03-29 18:03:05 +02:00
nmlgc 1766178a0a [Decompilation] [th02] Point number popups: Update/render function
Part of P0237, funded by Yanga.
2023-03-29 17:13:28 +02:00
nmlgc 19d5ebf4f9 [Decompilation] [th02] Point number popups: Rendering a single number
Part of P0237, funded by Yanga.
2023-03-29 17:13:28 +02:00
nmlgc e708eadeab [Decompilation] [th02] Point number popups: Tile invalidation
Part of P0237, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc 71094af6a0 [Decompilation] [th02] Point number popups: Spawn function
Someone liked the `register` keyword way too much.

Part of P0237, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc eb52af752b [Decompilation] [th02] Point number popups: Initialization/reset function
Part of P0237, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc cffa0a0ede [Reverse-engineering] [th02] Point number popups: Structure
Could it be? A sanely implemented feature with no quirks or bugs? Looks
like it!

Part of P0237, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc 3c0c6c7343 [Reverse-engineering] [th02] Sparks: Structure
First taste of how sprites are managed in this game. Expressing the
current and previous position in terms of the VRAM page is kind of
quirky, but not as bad as expected.

What *is* bad, however, is that the most natural next function is
undecompilable thanks to an inconsistent `LEAVE` instruction in its
epilog 🙄 And `codegen.hpp` has almost none of the instructions we
would need to hide the SI and DI registers from the compiler, and I'm
*really* not in the mood for another such mess anyway. I'd really like
to try patching these mistakes in a separate build step instead, but
unfortunately I'm out of research money as well. So let's go for
something else next.

Part of P0237, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc 7fa9038a5f [Reverse-engineering] [th02] Slowdown factor
Completes P0236, funded by Yanga.
2023-03-29 12:36:56 +02:00
nmlgc 1f962c865e [Maintenance] Introduce a generic entity flag enum
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 679553fb4d [Decompilation] [th02] Stage tiles: Resetting an incomplete bunch of state
And that's all we can do for now. Almost done with stage tiles!

Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc caa4b6747b [Decompilation] [th02] Stage tiles: .MAP file loading
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 366cd1bf95 [Decompilation] [th02] Stage tiles: VRAM source area initialization
So silly.

Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 1778006684 [Decompilation] [th02] Stage tiles: Low-level EGC-accelerated blitting
Batched this time around!

Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc fdee90a499 [Decompilation] [th02] Stage tiles: Regular scroll and render function
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 29cde9b5de [Decompilation] [th02] Stage tiles: Initial screen of a stage
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 6acb385a5a [Decompilation] [th02] Stage tiles: Rectangular invalidation
Part of P0236, funded by Yanga.
2023-03-29 12:36:55 +02:00
nmlgc 62c4b7f1c2 [Decompilation] [th02] Stage tiles: Regular rendering
Completes P0235, funded by Ember2528.
2023-03-29 12:36:55 +02:00
nmlgc 59564b3ecf [Decompilation] [th02] Stage tiles: Re-rendering the entire playfield
Part of P0235, funded by Ember2528.
2023-03-29 12:36:55 +02:00
nmlgc 9c95ddace3 [Decompilation] [th02] Stage tiles: Setting and blitting single tiles
Used e.g. for the track marks that the Stage 1 midboss leaves on the
bridge. Nice detail… if it weren't for the wrong rendering order 🎺

Part of P0235, funded by Ember2528.
2023-03-29 12:36:55 +02:00
nmlgc e1ccf2d67d [Decompilation] [th02] Stage tiles: EGC-accelerated single-tile blitting
From the tile source area to the right of the HUD, obviously. So glad
that vram_offset_shift_fast() is possible without inline ASM, we're
definitely going to see that one more often.

Part of P0235, funded by Ember2528.
2023-03-29 12:36:55 +02:00
nmlgc ca0a076e92 [Naming] [th02] Stage tiles: Rendering helper functions
Part of P0235, funded by Ember2528.
2023-03-29 12:36:55 +02:00
nmlgc 7cbaf4a123 [Reverse-engineering] [th02] Stage tiles: Public state
Part of P0235, funded by Ember2528.
2023-03-29 12:36:54 +02:00
nmlgc 54e72475c6 [Reverse-engineering] [th02] Stage tiles: Internal state
Part of P0235, funded by Ember2528.
2023-03-29 12:36:54 +02:00
nmlgc 0a71be2188 [Reverse-engineering] [th02/th04/th05] Stage tiles: VRAM source area offsets
Part of P0235, funded by Ember2528.
2023-03-29 12:36:54 +02:00
nmlgc a5a1967367 [Reverse-engineering] [th02] Scrolling: Speed and interval
Part of P0235, funded by Ember2528.
2023-03-29 12:36:54 +02:00
nmlgc f062e4b84e [Decompilation] Add a macro for faster VRAM offset calculation with bit shifts
Part of P0235, funded by Ember2528.
2023-03-25 21:28:15 +01:00
nmlgc 0e103c6f88 [Maintenance] Add a VRAM offset roll macro
Part of P0235, funded by Ember2528.
2023-03-25 21:24:57 +01:00
nmlgc bff375d99d [Maintenance] Introduce a VRAM byte bit constant
log₂(BYTE_DOTS), just like SUBPIXEL_FACTOR and SUBPIXEL_BITS.

Part of P0232, funded by [Anonymous].
2023-02-28 08:08:17 +01:00
nmlgc 4f853261fa [Decompilation] [th05] Stage 5 midboss: Rendering
15 lines of code, and still not quirk-free.

Completes P0225, funded by Enderwolf, Blue Bolt, 32th System, and Yanga.
2022-11-30 22:46:22 +01:00
nmlgc 68aa320982 [Decompilation] [th02/th04/th05] Text overlay: Fill functions
Part of P0225, funded by Enderwolf, Blue Bolt, 32th System, and Yanga.
2022-11-30 22:46:22 +01:00
nmlgc afbca78e6c [Decompilation] [th02] Text overlay: Right-aligned 8-digit number display
Oh look, a small TH02-only commit! Might as well decompile the small
function in front of TH02's overlay_wipe(), so that I can include it
in the next commit.

Part of P0225, funded by Enderwolf, Blue Bolt, 32th System, and Yanga.
2022-11-30 22:46:22 +01:00
nmlgc 00d4b4ab30 [Maintenance] Define a VRAM byte mask constant
Less visual noise.

Part of P0198, funded by Lmocinemod and Ember2528.
2022-06-16 22:50:43 +02:00
nmlgc 0e26210d2b [Naming] [th02/th03/th04/th05] Rename GameCore() to GameExecl()
Looking back at the MAG.Net footage, that out-of-focus block of pixels
is clearly separated from the opening parenthesis with an `l`, with the
second word alone making up four monospaced ASCII characters. `Execl`
is also a much more descriptive name, given what the function does.

Part of P0192, funded by [Anonymous], nrook, and -Tom-.
2022-05-01 00:22:04 +02:00