Commit Graph

11 Commits

Author SHA1 Message Date
nmlgc ba29539fc7 [Maintenance] Declare a distinct type for VRAM offsets
… and this one, while I'm at it. I've been using pretty much every
possible type for VRAM offset variables, depending on my mood that day,
since signedness apparently never matters for those.
Except that it does. And so, just like with most of our high-level
types, we also have to account for ZUN's little signedness
inconsistencies here. Oh well, at least it's now only one of two types,
and there's no need to choose between `int` or `unsigned int` or
`short` or `unsigned short` or `int16_t` or `uint16_t` or `size_t` or…

Part of P0111, funded by [Anonymous] and Blue Bolt.
2020-08-28 14:53:33 +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 9ce0034934 [Decompilation] [th01] Boss entities: 16×8 section unblitting + blitting
Yet another unused function. No idea what it could have been intended
for – no boss sprite has animated sections that small.

But come on, out of all places that could have required the macro form
of a VRAM offset function, it had to be a unused one…

Anyway, that completes the low-level blitting functions for boss
entities!

Part of P0108, funded by Yanga.
2020-08-12 18:02:17 +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 67d35115e6 [Maintenance] Use inline functions for all VRAM offset calculations
At least those can all be moved to a single place.

Part of P0105, funded by Yanga.
2020-08-12 16:16:18 +02:00
nmlgc f3093a802c [Decompilation] [th01] HUD: Inter-page row-sized rectangle blitting
Both inlined and non-inlined page switching within the same function,
together with an approach that doesn't correspond to our other planar
access macros? That code must have been written during a very
experimental phase very early in the development of this game.

Part of P0104, funded by Ember2528.
2020-07-27 17:19:12 +02:00
nmlgc 57a2294f7a [Maintenance] Add a Planar<> template for any type of 4-plane value
Part of P0103, funded by Ember2528.
2020-07-27 17:10:00 +02:00
nmlgc 3e3129567c [Decompilation] [th01] Pellet delay cloud blitting and unblitting
And immediately, we discover another two hardcoded sprites, with, of
course, another set of functions for blitting and unblitting them…

Part of P0099, funded by Ember2528.
2020-07-12 15:15:05 +02:00
nmlgc f612c40dce [Maintenance] Move generic VRAM macros from REIIDEN.EXE's PTN code to planar.h
C++ templates would be *so nice* here, but code generation… 😢

Part of P0099, funded by Ember2528.
2020-07-12 15:08:38 +02:00
nmlgc 97dce75446 [Maintenance] Proofread all comments in C land 2020-06-21 22:14:08 +02:00
nmlgc f453625e30 [Maintenance] Move the declarations for planar graphics to their own file
Increasing build times by unnecessarily #including <master.h> has
finally become too annoying.

Part of P0098, funded by Yanga.
2020-06-13 21:15:31 +02:00