Commit Graph

11 Commits

Author SHA1 Message Date
nmlgc 9e676ce3ef [Decompilation] [th01] .PTN snap functions
Which repurpose the .PTN image slots to store the background of
frequently updated VRAM sections, like all the numbers in the HUD.
Future games would simply use the text RAM and gaiji for numbers. Which
would have worked just fine for TH01 as well (especially since all the
functions we've seen so far are aligned to the 8-pixel byte grid), but
it looks as if ZUN simply wasn't aware of gaiji during the development
of TH01.

Part of P0083, funded by Yanga.
2020-03-18 20:33:58 +01:00
nmlgc a184413f27 [Decompilation] [th01] .PTN file loading and non-transparent display
What is this, error checking in a ZUN game?! And surprisingly good code
for deriving the alpha plane?!

Part of P0083, funded by Yanga.
2020-03-18 20:33:58 +01:00
nmlgc d79f4c1171 [Maintenance] [th01] Correctly declare the packfile functions in C land
Mangled C++ function names would *not* have been a mistake if I hadn't
made the other mistake of restricting parts of the code to C…

Part of P0083, funded by Yanga.
2020-03-18 20:33:53 +01:00
nmlgc 2546c5dfcb [Reverse-engineering] [th01] .PTN slot structure
Part of P0083, funded by Yanga.
2020-03-18 20:09:57 +01:00
nmlgc f6cbff0bf9 [Decompilation] [th01] .GRP file loading and display
All the weird double returns in FUUIN.EXE just magically appear with
-O-! 😮

And yeah, it's a bowl of global state spaghetti once again. 🍝 Named
the functions in a way that would make sense to a user of the API, who
should be aware of typical side effects, like, y'know, a changed
hardware palette… That's how you end up with the supposed "main"
function getting a "_palette_show" suffix.

Completes P0082, funded by Ember2528.
2020-03-13 19:48:38 +01:00
nmlgc 70176537e6 [Maintenance] Add include guards to ReC98.h
They do make everything so much simpler, after all. Especially now that
th01/formats/grz.cpp should compile as a freestanding translation unit,
as part of the .GRZ viewer.

Part of P0082, funded by Ember2528.
2020-03-13 19:16:02 +01:00
nmlgc 76634342f1 [Reverse-engineering] [th01] Global .GRP and .PTN variables
Since we not only have the .PTN sub-image count array in the middle of
all those .GRP flags, but the .PTN loading code also reusing the
palette set flag…

Part of P0082, funded by Ember2528.
2020-03-13 19:14:45 +01:00
nmlgc 8adbeb76b6 [Decompilation] [th01] .GRP palette fades
It's optimization barrier time again \o/

Part of P0082, funded by Ember2528.
2020-03-13 19:14:32 +01:00
nmlgc 63ed22ba67 [Reverse-engineering] [th01] .GRP palette
Part of P0082, funded by Ember2528.
2020-03-13 19:09:24 +01:00
nmlgc ac0cbb6dc9 [Reverse-engineering] [th01] Identify the end of grx_header_t as a palette
Unfortunately, none of the images in BOSS8.GRZ actually set it to their
intended palette, which means we…

Part of P0081, funded by Ember2528.
2020-03-07 21:43:07 +01:00
nmlgc fd6a8bae81 [Decompilation] [th01] .GRZ file loading and display
Yet another run-length encoded graphics format, this one being
exclusively used to wastefully store Konngara's sword slash and kuji-in
kill "animation".

But for once, the terrible code generated by inline functions with
non-literal parameters perfectly matches what ZUN wrote here.

Part of P0081, funded by Ember2528.
2020-03-07 21:43:00 +01:00