Commit Graph

22 Commits

Author SHA1 Message Date
nmlgc a2961b02da [Reverse-engineering] [th03/th04/th05] Configuration file
The supposedly low-hanging fruit that almost every outside contributor
wanted to grab a lot earlier, but (of course) always just for a single
game… Comprehensively covering all of them has only started to make
sense recently 😛

Also, yes, the variable with the uppercase .CFG filename has itself a
lowercase name and vice versa…

Part of P0077, funded by Splashman and -Tom-.
2020-02-23 17:24:17 +01:00
nmlgc f8d83eefa3 [Maintenance] [th03] Move cfg.h to the formats/ directory
Part of P0076, funded by [Anonymous] and -Tom-.
2020-02-23 17:13:03 +01:00
wintiger0222 1d6fbb8108 [Reverse-engineering] [th05] Masked PI display
As used for the title screen fade-in effect. Another function that
apparently was deliberately written to run not that fast, by blitting
each row individually to the 400th VRAM row just so that it can then
turn on the EGC, perform the *actual* masked blit to the VRAM
destination, and then turn the EGC off before moving to the next now.
The same effect could have entirely been accomplished by copying
graph_pack_put_8() and applying the mask there; it's not like ZUN
didn't know how to modify master.lib…

(See also 44ad3eb4) --Nmlgc
2019-12-17 23:27:02 +01:00
nmlgc 75a779e82a [Maintenance] Clean up PI function declarations and comments 2019-12-17 23:27:01 +01:00
nmlgc dea40ad770 [Decompilation] [th05] Stage setup
"Yeah, let's do this real quick, how can this possibly be hard, it's
just MOVs and a few function calls"…

…except that these MOVs access quite a lot of data, which we now all
have to declare in the C world, hooray.
Once it came to midbosses and bosses, I just turned them into C structs
after all. Despite what I said in 260edd8… after all, the ASM world
doesn't care about the representation in the C world, so they don't
necessarily have to be the same.

Since these structs can't contain everything related to midbosses and
bosses (really, why did all those variables have to be spread out like
this, ZUN?), it also made for a nice occasion to continue the "stuff"
naming scheme, describing "an obviously incomplete collection of
variables related to a thing", first seen in 160d4eb.

Also, PROCDESC apparently is the only syntactically correct option to
declare an extern near proc?

Also, that `boss_phase_timed_out` variable only needs to be here
already because TCC enforces word alignment for the .data segment…
yeah, it's technically not related to this commit, but why waste time
working around it if we can just include that one variable.

Completes P0030, funded by zorg.
2019-09-15 20:35:15 +02:00
nmlgc 0abf84f450 [Maintenance] Add a few missing exports
Part of P0030, funded by zorg.
2019-09-15 20:29:52 +02:00
nmlgc 3b7561a711 [Maintenance] Export all pascal functions with their proper uppercase names
Yup, that was one massive screw-up.

Part of P0030, funded by zorg.
2019-09-15 20:29:47 +02:00
nmlgc e10502bfe6 [Maintenance] Fix the function name format of CDG/CD2 functions
No leading underscore for functions with Pascal calling convention, but
we do have one for all variables, because it's not worth it to put
keywords in front of everything for no reason.
Seemed to have forgotten this rule in 2017?

Part of P0030, funded by zorg.
2019-09-15 20:29:40 +02:00
nmlgc d7483c09cc [Maintenance] Fix the TASM32 crash when assembling th03_mainl.asm
Right, the last path component in an INCLUDE file name is "limited" to 28
bytes. Turns out it only crashes on every system that *isn't* the main one I
develop on, though…
2018-12-04 19:55:18 +01:00
nmlgc 01a430d027 [Reverse-engineering] [th03/mainl] CDG line removal for upwards motion
Not *really* CDG-related, but it does use CDG slot data, and is easy
enough to be covered right now…

Funded by DTM.
2018-10-16 01:04:46 +02:00
nmlgc 4bc6da4858 [Reverse-engineering] [th03/mainl] Dissolved CDG display
Depending on two variables that… uh, aren't exactly related to this
function? Let's wait with those until we get there.

Funded by DTM.
2018-10-16 01:04:46 +02:00
nmlgc 850b8d783c [Reverse-engineering] [th03/mainl] CDG freeing
Funded by DTM.
2018-10-16 01:04:46 +02:00
nmlgc 18ae3e5cca [Reverse-engineering] [th03] Horizontally flipped CDG display 2018-10-16 01:04:46 +02:00
nmlgc 4b8d0931b9 [Reverse-engineering] [th03] Non-alpha CDG display 2018-10-16 01:04:46 +02:00
nmlgc df768ebea6 [Reverse-engineering] [th03] Normal CDG display 2018-10-16 01:04:43 +02:00
nmlgc fa39c23fad [Reverse-engineering] [th03] CDG loading 2018-10-16 00:47:58 +02:00
nmlgc 6759d346d5 [Reduction] Lookup table for horizontally flipping planar pixels
OK, let's not identify the arrays in a file-based fashion just yet, and
first reduce all shared ZUN code that uses arrays. Less stressful, we'll
have to do this anyway, and I just can't resist the urge to immediately
reverse-engineer everything I find.
2017-01-07 22:30:46 +01:00
nmlgc 43001161e3 [Maintenance] Fix any whitespace issues in our own code 2015-09-07 15:44:48 +02:00
nmlgc 6d8ff6b72e Make previously reduced ZUN functions available to C 2015-02-21 14:12:22 +01:00
nmlgc a07e5fad42 [Reverse-engineering] Slot-based PI display
Also covering the two variations for blitting only every second row or
blitting only a 320x200 quarter, as seen in the endings.

So yeah, there's indeed nothing wrong with piread.cpp. TH03 just uses that
separate function that only blits every second row of an image, and indeed
always loads the entire image as it would appear in a PNG conversion. Here's
what happens if you display these images using the non-interlacing function:
https://www.dropbox.com/s/885krj09d9l0890/th03%20PI%20no%20interlace.png
2014-12-18 14:36:43 +01:00
nmlgc b532a96c7e [JWasm move] Avoid "push large"
For 32-bit immediate values, PUSH by itself is enough. For everything else,
PUSHD works in both TASM and JWasm.

Also, could it be...? Could we actually move to JWasm without breaking the
build in TASM at all?
2014-11-19 12:09:22 +01:00
nmlgc b4361e8487 [Reduction] #700-704: pfopen
... and then I end up copying modified versions into the individual game
subdirectories after all, because the changes between games were simply too
drastic. (That's also why I'm counting pfopen() itself twice.)

Only one slice left now, and then we're done with reduction!
2014-11-17 04:54:40 +01:00