Commit Graph

14 Commits

Author SHA1 Message Date
nmlgc 50c498a549 [Reverse-engineering] [th01] Shootout lasers: Hardcoded sprites
First ZUN bug in sprite preshifting! One wrongly shifted pixel means
that we can't use the auto-preshift feature of our sprite converter -.-

Also, why did these even have to be hardcoded sprites to begin with.
These dot patterns could have been easily generated procedurally… but
even *that* wouldn't have been necessary, given that there's this nice
function called, uh, graph_r_line_patterned()? Which could have
rendered all of the lasers in the upcoming class and more?

Part of P0122, funded by Yanga.
2020-10-06 13:52:22 +02:00
nmlgc 1184f6c671 [Decompilation] [th01] Interleaving both VRAM pages in an 8×8 square
Some of the unused interleave masks are not that straightforward, so it
makes sense to have all of them as a bitmap. I'm positive that this
sort of thing could have been EGC-accelerated… although, simply
writing better C would probably already go a long way.

Part of P0121, funded by Yanga.
2020-09-28 13:09:49 +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 79e8e41d02 [Build] [th05] gjinit: Include the gaiji compiled from th05/sprites/gaiji.bmp
Which means that edits to that image will now be immediately visible in
TH05 after recompilation!

Part of P0117, funded by [Anonymous].
2020-09-16 22:30:50 +02:00
nmlgc c5852610f6 [th05/gjinit] Initial state
And with that, we finally dumped every single PC-98 Touhou binary!
Since it'd be overkill to merge bmp2arr into the re-baseline branch
though, we also have to start out with the raw image bytes here.

Part of P0117, funded by [Anonymous].
2020-09-16 22:29:55 +02:00
nmlgc 9695c8d277 [th05/memchk] Initial state
No libc anymore, yet still no memory freeing…?

Part of P0117, funded by [Anonymous].
2020-09-16 22:29:35 +02:00
nmlgc 90b7ace180 [th04/memchk] Initial state
Needlessly linked with TCC rather than TLINK, adding almost 4 KB of
completely unnecessary libc startup code.

Or maybe not, since ZUN doesn't free the allocated memory himself, but
relies on libc to do that?

Part of P0117, funded by [Anonymous].
2020-09-16 22:20:34 +02:00
nmlgc 197202d8ee [th05/zuninit] Initial state
On the surface, Version1.02 of the `INTvector set program` seems to
be largely the same as Version1.01, just with fancier instructions,
some redundancy removed, and some slightly different wording in the
playful messages… or is there more to it? Stay tuned!

Part of P0117, funded by [Anonymous].
2020-09-16 22:17:18 +02:00
nmlgc f54cd0fe95 [th04/zuninit] Initial state
Yup, it's finally the right time to properly rebuild ZUN.COM. While
all of these small binaries would still need some RE attention, putting
in the few minutes to make them position-independent right now is
definitely worth it. Adding them to the PI calculation on the website
would take much longer 😅

Part of P0117, funded by [Anonymous].
2020-09-16 22:16:49 +02:00
nmlgc 5a6ac29f50 [Separate translation units] [th03] CDG: Non-alpha display (undecompilable)
Reason: Self-modifying. -.-

Part of P0114, funded by Lmocinemod.
2020-09-07 21:18:39 +02:00
nmlgc 23bf61b773 [Pipeline] bmp2arr: Add -q for silencing debug output on stderr
Part of P0113, funded by Lmocinemod.
2020-09-07 17:32:04 +02:00
nmlgc 1f1847de48 [Build] Assemble all .ASM files in the 32-bit build part
Yeah, why *were* we assembling them in the 16-bit part before?!
Possible reasons:
• In a time before Tup, it made no actual difference whether these
  little files were assembled in the 32-bit or 16-bit part. Now it sort
  of does, since we've temporarily given up on minimal rebuilds in the
  16-bit part.
• Emphasizing the temporary nature of the 32-bit part by deliberately
  moving everything to the 16-bit part as early as possible?
• It all started with the ZUN.COM ASM code, which doesn't include any
  other files, and can therefore be perfectly tracked by a Makefile.
  Which *was* superior than the exclusive dumb batch file we had in the
  past. And then I've simply cargo-culted all new .ASM translation
  units into the 16-bit part well.

Oh, and another positive side effect of temporarily not using 16-bit
TASM: The build process now also runs on Windows 95.

Part of P0113, funded by Lmocinemod.
2020-09-07 17:25:56 +02:00
nmlgc b18866232b [Build] 32-bit: Fall back on a dumb full .bat rebuild if Tup can't run
And that's how we can still have a reliable 32-bit build part that runs
on XP or earlier.

Completes P0001, funded by GhostPhanom.
2020-09-03 19:04:20 +02:00
nmlgc e31d232584 [Build] 32-bit: Use Tup as a proper build system for the 32-bit part
This Tupfile does in fact date back to January 2017, and I've been
using it myself ever since. Time to finally deliver it on master!

Part of P0001, funded by GhostPhanom.
2020-09-03 19:04:17 +02:00