Commit Graph

21 Commits

Author SHA1 Message Date
nmlgc 24b96cd9da [Reverse-engineering] [th05] Curve bullet rendering
TH04's z_super_roll_put_tiny_32x32(), which this is based on, had
checks for not writing empty rows to VRAM. Why would ZUN remove them
here?

Completes P0086, funded by [Anonymous] and Blue Bolt.
2020-04-15 21:34:20 +02:00
nmlgc f99d7a571c [Maintenance] Remove all dependencies on Borland C++ run-time source headers
And with all possible .COM executables decompiled, this set of changes
reaches an acceptable scope, allowing us to *finally*…

Part of P0077, funded by Splashman and -Tom-.
2020-02-23 17:53:18 +01:00
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 52864172a4 [Reverse-engineering] [th05] Micro-optimized monochrome 16×16 sprite display
Might as well cover this one while I've got this type of function in my
head. This one is used for the animated star backgrounds during Stage 2
and the Shinki battle.

Completes P0073, funded by [Anonymous] and -Tom-.
2020-02-16 21:39:27 +01:00
nmlgc 0f3359e1b3 [Maintenance] Use @@locals for self-modifying code in bfnt_entry_pat()
Which finally allows us to use the PLANE_SIZE macro in ASM land. Yeah,
(ROW_SIZE * RES_Y) has finally got old.

Part of P0073, funded by [Anonymous] and -Tom-.
2020-02-16 21:35:16 +01:00
nmlgc 8dbb45050f [Reverse-engineering] [th04/th05] GENSOU.SCR decoding, encoding, and defaults
WTF. Fine, let's have separate, micro-optimized ASM implementations for
decoding and encoding inr MAIN.EXE, but still, all those minute
difference between OP.EXE and MAINE.EXE…
This is as far as anyone should reasonably go before decompilation;
things will get really ugly with the loading functions once the file
name is involved as well…

Completes P0063, funded by -Tom-.
2019-12-28 12:27:52 +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 a5e714b165 [Maintenance] [th05] Clarify pi_slot_put() a bit
Can't blame WindowsTiger for writing hard-to-review code when he just
adapted what I wrote in 2014…
2019-12-17 23:27:01 +01:00
nmlgc 75a779e82a [Maintenance] Clean up PI function declarations and comments 2019-12-17 23:27:01 +01:00
nmlgc 50c36f5551 [Reverse-engineering] Player character constants 2019-12-17 23:26:59 +01:00
nmlgc 5bffab4f43 [Position independence] [th04/th05] Remaining references to PI slots
Part of P0060, funded by Touhou Patch Center.
2019-11-28 23:23:30 +01: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 062e775f41 [Reverse-engineering] [th04/th05] .BB file loading boilerplate
Yup, nothing interesting in here.
Except for maybe the confirmation that LS00.BB is used for the curved
bullets used by Shinki and EX-Alice?

Funded by -Tom-.
2019-03-01 16:17:52 +01:00
nmlgc 612beb815b [Maintenance] Clean up the confusion between "tiles" and .STD tile sections
Funded by -Tom-.
2018-12-30 02:30:16 +01:00
nmlgc 4fe4c8eed1 [Reverse-engineering] [th04/th05] Scrolling-related variables
Funded by -Tom-.
2018-12-29 18:34:51 +01:00
nmlgc 261d5037ed [Reverse-engineering] [th04/th05] .STD file loading
… because TH04's version of this takes the ASCII stage ID directly from
the resident structure.

So boss battles are simply triggered by setting the background tile
scroll speed to 0? That means…

Funded by zorg.
2018-12-26 17:59:03 +01: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 bead27b781 Use TASM calling convention syntax for previously identified ZUN functions
With TH03 changing the calling convention for most of the code from __cdecl to
__pascal, I've been getting more and more confused about this myself. So,
let's settle on the following consistent syntax for function calls:

* C where the calling convention is actually __cdecl and where TASM's emitted
  __cdecl code matches the original binary
* PASCAL where the calling convention is actually __pascal
* STDCALL where the calling convention is actually __cdecl, but where
  the caller either defers stack cleanup (summing up the stack size of
  multiple functions, then cleaning it all in a single "add sp" instruction)
  or where the stack is cleared in a different way (e.g. "pop cx").

Unfortunately though, when using the ARG directive to automatically generate
an appropriate RET instruction for the given calling convention, TASM always
emits ENTER and LEAVE instructions even when no local variables are declared,
which greatly limits the number of functions where we can use that syntax. -.-
2014-12-16 05:53:56 +01:00
nmlgc 510a3a5070 [Reverse-engineering] pi_slot_palette_apply 2014-11-22 09:29:09 +01:00
nmlgc f54b85577d [Reverse-engineering] Slot-based PI file loading and freeing 2014-11-18 17:56:13 +01:00