Commit Graph

21 Commits

Author SHA1 Message Date
nmlgc 1bc91fd93b [Maintenance] Move the `grcg_off` macro override into an explicit header
Not only would the `(GAME != 2)` need to include TH03 in the future,
but this `#undef` trickery will blow up once we start reorganizing the
`#include`s in the next few commits.
Sadly, a few source files use master.lib's grcg_off() function in one
game and the macro in the other, which makes it infeasible to assign a
distinct name for every function.

Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-07-09 08:40:14 +02:00
nmlgc 8943b52167 [Maintenance] Introduce types for VRAM colors and their components
Finally differentiating between colors and columns at least at the type
level.

Part of P0245, funded by [Anonymous], Blue Bolt, Ember2528, and Yanga.
2023-06-30 19:59:11 +02: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 c22299e0c8 [Contributing] Introduce a new "ZUN landmine" label for invisible bugs
Thanks to Clerish for the naming inspiration:

	https://twitter.com/Clerish/status/1623990678937034752

Part of P0231, funded by [Anonymous].
2023-02-28 08:08:10 +01:00
nmlgc bfb15c7afe [Decompilation] [th01] High score menu: Move BSS data in REIIDEN.EXE to C land
Work around inconsistency now, save catch-up work later.

Part of P0213, funded by Ember2528 and GhostRiderCog.
2022-08-11 23:21:22 +02:00
nmlgc 5fa0cd5a86 [Decompilation] [th01] .GRC / 8×8 shapes: Move all data to C land
Part of P0211, funded by Lmocinemod and Arandui.
2022-08-08 20:16:05 +02:00
nmlgc 001033d15a [Maintenance] [th01] Remove `extern "C"` from more areas of code
The .GRC and .GRP functions, to be specific.

Part of P0203, funded by [Anonymous] and GhostRiderCog.
2022-07-10 13:09:12 +02: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 183d7a2b57 [Decompilation] [th01] Elis: Pattern 3/13
The one where Elis, on Lunatic, runs past the pellet cap of 100 by
spawning 160 slow aimed pellets along a circle in a single frame, and
that's not the only janky quirk in there.

Completes P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 091f19f69b [Decompilation] [th01] Sariel: Pattern 16/16
The one where Sariel's second form shoots sparks towards the top of the
playfield, which then turn into leaf-like sprites that sway towards the
bottom, killing Reimu on contact.

And wow, what a finish! A weird "decimal subpixel" type, hardcoded
sprites, and effectively unused non-hardcoded sprites. Too bad that it
also ruins the nice `dot_rect_t(w, h)` parameter abstraction for
grcg_put_8x8_mono()…

Completes P0180, funded by Yanga.
2022-01-31 08:31:18 +01:00
nmlgc 244136c42b [Naming] [th01] Rename grcg_setcolor_tdw() to grcg_setcolor_tcr()
TDW and TCR modes share the same bit in the GRCG mode register and are
thus indistinguishable when looking at a disassembly, but only apply to
writing (TDW) or reading (TCR), respectively. TH01 only performs read
operations in this mode, so it's unambiguously TCR.

Part of P0176, funded by Ember2528.
2022-01-31 07:18:42 +01:00
nmlgc e1de05288b [Maintenance] [th01] Move one-off GRCG macros to planar.h
We're going to see them again after all.

Part of P0174, funded by Ember2528.
2022-01-31 05:15:00 +01:00
nmlgc cf356bbf5e [Maintenance] [th01] Start a new header for commonly used VRAM color indices
Part of P0158, funded by Yanga.
2021-09-28 18:05:24 +02:00
nmlgc 308b73524d [Maintenance] [th01] Merge invincibility sprites into the regular 8×8 shapes
They have the same size, their hardcoded sprites are stored next to
each other in the code, and…

Part of P0153, funded by Ember2528.
2021-08-22 14:55:54 +02:00
nmlgc 9739f69729 [Maintenance] Add a 1bpp rectangle template, for custom per-row types
This gets rid of a couple of per-entity sprite bitplane types, makes
sprite declarations easier to read by putting width and height next to
each other… and points out a number of array dimension mistakes -.-
Even in places where we can't use it.

Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-21 18:01:57 +02:00
nmlgc 668b9033ab [Decompilation] [th01] Line loop unblitting
Same here.

Part of P0121, funded by Yanga.
2020-09-28 13:01:07 +02:00
nmlgc 60389473aa [Decompilation] [th01] Line loop blitting
Wait, so if this is only used for the rotating white squares around
Mima, that must mean that the white star in the YuugenMagan fight got a
completely redundant reimplementation…

Part of P0121, funded by Yanga.
2020-09-28 12:56:52 +02:00
nmlgc 3c008b6a4f [Decompilation] [th01] Invincibility sprite blitting
In which ZUN accidentally the GRCG rather than the EGC in what should
have been (?) the unblitting function. Which then ends up actually
blitting yet another randomly background-masked version of the same
sprite on top of the old one. And after just a few frames, you get
those fully filled red diamonds you don't see in the sprite sheet.

Then again, if the 16w×h rectangle unblitting function is all you
have, and you can't be bothered to actually learn the EGC, this *is*
the better option 🎺

Completes P0120, funded by Yanga.
2020-09-28 12:56:05 +02:00
nmlgc b974c1a915 [Maintenance] Add separate macros for GRCG/EGC-accelerated reads and writes
Not only getting rid of the "useless" (and thankfully, consistent)
bitplane parameter, but also allowing those shortened macros to be
redefined for the upcoming little ZUN inconsistency.

Part of P0120, funded by Yanga.
2020-09-28 12:51:01 +02:00
nmlgc c12cddfe47 [Decompilation] [th01] Sloppy ellipse arc unblitting
The usual case where ZUN should have just written a custom EGC-powered
unblitter, instead of resorting to the word-aligned rectangle one…

Part of P0120, funded by Yanga.
2020-09-28 12:50:16 +02:00
nmlgc 23f5645be5 [Decompilation] [th01] Ellipse arc blitting
Most frequently used for complete circles, though… but who cares, as
of this commit, ReC98, as a whole, is ⅓ done!

Part of P0120, funded by Yanga.
2020-09-28 12:46:29 +02:00