Commit Graph

1776 Commits

Author SHA1 Message Date
nmlgc d452fc0f3d [Decompilation] [th03] High score menu: Rendering a single row
Oh, so the high score name is only stored backwards for aesthetic
reasons, to make both the name and score blitting loops look identical.

Part of P0173, funded by [Anonymous].
2021-12-27 18:38:32 +01:00
nmlgc a823bec801 [Decompilation] [th03] High score menu: REGI*.BFT glyph blitting
Part of P0173, funded by [Anonymous].
2021-12-27 18:38:32 +01:00
nmlgc ace067fd07 [Decompilation] [th03] High score menu: REGI*.BFT glyph unblitting
What's a EGC?

Part of P0173, funded by [Anonymous].
2021-12-27 03:59:33 +01:00
nmlgc bb4a9d7301 [Decompilation] [th03] High score menu: Alphabet ID → screen space transform
Nice, ZUN learned something from TH01's terrible high score menu code!

Part of P0173, funded by [Anonymous].
2021-12-27 03:59:33 +01:00
nmlgc 1658c0acd3 [Decompilation] [th03] High score menu: Initial alphabet rendering
Part of P0173, funded by [Anonymous].
2021-12-27 03:59:33 +01:00
nmlgc 8750e9e079 [Decompilation] [th03] High score menu: Making room for a new high score
Yup, that 10th score digit stored for every place is in fact unused.

Part of P0173, funded by [Anonymous].
2021-12-27 03:59:33 +01:00
nmlgc da3617a219 [Decompilation] [th03] High score menu: Loading and background blitting
Part of P0173, funded by [Anonymous].
2021-12-27 03:59:33 +01:00
nmlgc 2d5491e4a9 [Decompilation] [th03] YUME.NEM: Loading
"I don't need the return value in MAINL.EXE? Let's copy-paste the
function and remove all of its `return` statements then!" :zunpet:

Completes P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 03:59:33 +01:00
nmlgc 4b7028c9d3 [Decompilation] [th03] YUME.NEM: Checksum verification
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 03:59:33 +01:00
nmlgc b20bf944be [Decompilation] [th03] YUME.NEM: Default data
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 03:59:33 +01:00
nmlgc 6d5918881f [Decompilation] [th03] YUME.NEM: Encryption and saving
Also "intransparently setting the clear flag, but only in the MAINL.EXE
version".

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 03:59:30 +01:00
nmlgc 79aeb8dccc [Decompilation] [th03] YUME.NEM: Decryption
Featuring inline assembly for a single ROR instruction. Turbo C++ 4.0J
unfortunately only offers intrinsics for 16-bit rotations.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 03:59:02 +01:00
nmlgc 3361cd6991 [Reverse-engineering] [th03] YUME.NEM: Structure
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:16:03 +01:00
nmlgc 53ccdca29a [Reverse-engineering] [th03] YUME.NEM: File name
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:16:03 +01:00
nmlgc e3d611fa42 [Reverse-engineering] [th03] REGI1.BFT / REGI2.BFT sprite IDs
A score format that stores all its data in terms of the internal sprite
IDs…

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:16:03 +01:00
nmlgc 38f9db0592 [Maintenance] [th03] Assign segment #1 in OP and MAINL to a common group name
The YUME.NEM functions won't be decompilable in their natural order
otherwise.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:15:59 +01:00
nmlgc efff8d61bb [Maintenance] Change line endings in old C/C++ files to LF
Yup, even a DOS compiler from 1994 considered CRLF line endings as
stupid.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:06:32 +01:00
nmlgc b95450b026 [Maintenance] Remove the .ALPHA segment ordering workaround
We could have just abused the _TEXT segment all this time?!

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:06:26 +01:00
nmlgc 4d8392ce9c [Maintenance] [th03/th04/th05] Rename `playchars_t` to `playchar_t`
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 00:52:20 +01:00
nmlgc 5fac2006ff [Maintenance] Consistently use "score" instead of "points"
Or at least in addition.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 00:50:39 +01:00
nmlgc e95ff108e3 [Maintenance] [th01] Remove no longer used score declarations in ASM land
Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 00:47:56 +01:00
nmlgc 49e67893cf [Badges] Add the new set of finalization badges
Part of P0171, funded by [Anonymous].
2021-12-16 00:30:12 +01:00
nmlgc 479b76609a [Decompilation] [th05] EMS / Dialog: Exit function
Only reloads the bomb background image from either the EMS area or disk
in this game. Plain and simple.

Completes P0169, funded by Blue Bolt.
2021-11-29 02:01:10 +01:00
nmlgc 9ae4f7726e [Decompilation] [th05] EMS / Dialog: Face loading and rendering
Aha! TH05 actually loads every single rendered dialog image
individually before rendering it, either from the EMS area or disk.
That's one way to save memory, I guess?

Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:10 +01:00
nmlgc 90a2e367bc [Decompilation] [th04] EMS / Dialog: Exit function
That's where TH04 crashes in Stage 5 without an EMS driver, but the
code is fine?! (Well, apart from its silly behavior in the Extra
Stage.)

Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:10 +01:00
nmlgc 7673456ab3 [Decompilation] [th04] EMS / Dialog: Loading the remaining images
What the hell is TH05 doing there…?

Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:10 +01:00
nmlgc d48479ce1b [Reverse-engineering] [th04/th05] Dialog: Face unblitting
TH01-style unblitting from the back page of VRAM, in my TH04/TH05?!
It does make sense to suspend double buffering during dialog though,
and you probably don't want to call any custom stage rendering
functions just to effectively unblit a 128×128 pixel area.

Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:10 +01:00
nmlgc a1ebba2fae [Reverse-engineering] [th04/th05] Dialog: Currently speaking side
Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:09 +01:00
nmlgc 1b3755c592 [Maintenance] [th04/th05] Dialog: Move UI code to a subdirectory under main/
Why did I put all that under formats/?! This doesn't even contain
anything about the format yet.

Part of P0169, funded by Blue Bolt.
2021-11-29 02:01:09 +01:00
nmlgc 8b046dad0f [Decompilation] [th04/th05] EMS: Rendering the eyecatch image
Copied in from EMS memory if available.

Completes P0168, funded by Blue Bolt and rosenrose.
2021-11-29 02:01:01 +01:00
nmlgc bd77463f59 [Decompilation] [th05] EMS: Preloading boss facesets
Oh, an EMS function that does one single thing, and is not potentially
bugged within TH05's original sprite limits?! (Although that last part
might have just been a happy accident.)

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-29 02:00:58 +01:00
nmlgc 3e99a30c17 [Decompilation] [th04/th05] EMS: Preloading player character .CDG images
Stupid one-off functions deserve stupid names, Part 3. This time also
coming with an unnecessary precondition.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-29 02:00:03 +01:00
nmlgc fe33d49e0a [Decompilation] [th04/th05] EMS: Allocation + Preloading the eyecatch image
No, I'm not copying exactly what was on ZUN's monitor during the 2010
MAG・ネット documentary. Also, this one was very lucky not to receive
a stupid function name.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-29 01:53:43 +01:00
nmlgc ccca7bf6ee [Reverse-engineering] [th04/th05] EMS: Cache area layout
Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-29 01:53:13 +01:00
nmlgc 9c99bc0eb1 [Contributing] Don't enforce preservation of symbol names from leaked ZUN code
We can do much better ourselves.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 21:51:28 +01:00
nmlgc 488115513c [Maintenance] master.hpp transition: EMS functions
Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 19:15:22 +01:00
nmlgc dbd9e23bf9 [Maintenance] [th04/th05] Split segment #1 before the EMS functions
Well, except for GameCore(), which has nothing of interest.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 19:15:22 +01:00
nmlgc 99aee2bdbe [Maintenance] Consistently use singular for entity structure and file names
Not too sure about "chars" yet, with TH03 and all.

Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 19:14:02 +01:00
nmlgc 15b4011ff2 [Maintenance] Remove inconsistent newlines before `extern "C"` braces
Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 18:53:09 +01:00
nmlgc c2de6ab23b [Decompilation] [th01] Boss defeat sequence: Generic version
Copy-pasted from the SinGyoku version, and the differences can be fully
parametrized. Awesome to have a series of pushes end like this!

Completes P0167, funded by Ember2528.
2021-11-07 23:33:18 +01:00
nmlgc 021cbc8e9d [Decompilation] [th01] Boss defeat sequence: SinGyoku version + route selection
Part of P0167, funded by Ember2528.
2021-11-07 23:32:21 +01:00
nmlgc d5ec2220ec [Decompilation] [th01] Boss defeat sequence: Drawing white lines
Part of P0167, funded by Ember2528.
2021-11-07 23:32:04 +01:00
nmlgc 61091c31cc [Decompilation] [th01] Stage opening animation
Macro-free, compile-time conversion from Shift-JIS to JIS is entirely
possible in this 1994 C++ compiler, even when using an inlined
function! Awesome.

Really though, how often can you needlessly re-blit the same thing?

Part of P0167, funded by Ember2528.
2021-11-07 23:29:37 +01:00
nmlgc 692e8d1c42 [Naming] [th01] Remove "back/front" terminology from inter-page copy functions
TH01 doesn't use "back" and "front" pages in the way the later games
do, after all. Indicating that the source page of this parameter-less
function is the one that was previously set via graph_accesspage_func()
is going to make pretty much all its call sites way clearer, and stops
implying any further state.

Part of P0167, funded by Ember2528.
2021-11-07 23:27:30 +01:00
nmlgc e612d9a653 [Maintenance] [th01] Stage objects: Fix inconsistent function declarations
Part of P0167, funded by Ember2528.
2021-11-07 23:25:21 +01:00
nmlgc 5ed7f7150a [Maintenance] [th01] Start a new header file for text layer functions
What's most ridiculous about this is that ZUN had already reimplemented
master.lib text mode functions (th01/hardware/ztext.c). He simply never
used anything from there.

Part of P0167, funded by Ember2528.
2021-11-07 23:25:06 +01:00
nmlgc 6e7ab07659 [Decompilation] [th01] Loading and initializing common data used in all stages
Stupid one-off functions deserve stupid names, Part 2. If it only
loaded sprites, I might have given it a somewhat better name.

Part of P0167, funded by Ember2528.
2021-11-07 23:22:10 +01:00
nmlgc 6e0f9e568a [Decompilation] [th01] Sariel: Wand sprite unblitting and background snapping
Mission accomplished, Sariel unblocked… but what do we now do with the
remaining ¾ of this push? I'd really like to focus on Sariel in her own
dedicated push series…

Part of P0167, funded by Ember2528.
2021-11-07 23:20:46 +01:00
nmlgc 920274f3d6 [Decompilation] [th01] Mima: Sprite loading
Part of P0167, funded by Ember2528.
2021-11-07 23:18:47 +01:00
nmlgc 61005a6deb [Decompilation] [th01] Mima: Sprite blitting
Part of P0167, funded by Ember2528.
2021-11-07 23:17:01 +01:00