Commit Graph

651 Commits

Author SHA1 Message Date
nmlgc fc8d51c7d7 [Reverse-engineering] [th04/th05] Non-color CDG display 2018-10-16 01:04:46 +02:00
nmlgc aa47bb33d9 [Reverse-engineering] [th04/th05] Non-alpha CDG display 2018-10-16 01:04:46 +02:00
nmlgc bfef793805 [Reverse-engineering] [th04/th05] Normal CDG display
In which the th05 difference is the lack of self-modifying code.
2018-10-16 01:04:46 +02:00
nmlgc 286c6431d8 [Reverse-engineering] [th04/th05] CDG loading 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 79cc3ed71c [Reverse-engineering] [th03/th04/th05] Input change delay function
With TH05 definitely being the Galaxy Brain version of this function.
You'll see once I get to push the C decompilation for that one…

Anyway, that covers all shared input functions of TH02-TH05!

Funded by zorg.
2018-09-17 22:10:42 +02:00
nmlgc 8dfc2cd535 [Research] Find out why ≥TH03 checks input twice per frame, with a 0.6ms delay
Thanks to @joncampbell123 for the tip!

Funded by zorg.
2018-09-13 18:32:24 +02:00
nmlgc cbe8a37c53 [Reverse-engineering] [th03] Single-/multi-player/CPU input modes
Funded by zorg.
2018-09-12 15:53:12 +02:00
nmlgc c592464121 [Reverse-engineering] [th03/th04/th05] Basic keyboard input functions
Funded by zorg.
2018-09-11 19:34:19 +02:00
nmlgc 178d589408 [Reverse-engineering] [th04/th05] Player position
Funded by zorg.
2018-09-02 21:10:26 +02:00
nmlgc 5a5c347e82 [Reverse-engineering] [th04/th05] Generic motion structure and its step method
Seemingly included in every other larger structure describing anything
remotely sprite-like. Couldn't find this in the earlier games,
unfortunately…

Funded by zorg.
2018-09-02 21:06:48 +02:00
nmlgc b29894b4e5 [Reverse-engineering] [th05] Dream value
Funded by zorg.
2018-09-02 21:06:48 +02:00
nmlgc 0052606563 [Reverse-engineering] [th04] Dream item number and score
The score table is also still present in TH05.

Funded by zorg.
2018-09-02 21:06:47 +02:00
nmlgc b487d6fc20 [Reverse-engineering] [th02/th04/th05] Power overflow bonus
Funded by zorg.
2018-09-02 20:48:31 +02:00
nmlgc 746681db22 [Reverse-engineering] [th04/th05] Enemy drop table
TH02 just seems to use a sequence of branches in sub_D6CA.
I thought about keeping variable and function names consistent with
uth05win (on which most upcoming reverse-engineering commits will be
based). But as it will turn out, it ignored a certain very important
substructure, so I don't think it's worth introducing this naming style
clash.

Funded by zorg.
2018-09-02 20:42:17 +02:00
wintiger0222 2f00af8756 [Reverse-engineering] [th05] Rename some labels
Comparing with uth05win, I renamed some
label so that easy to see.
I should not test whether there is grammer error.
So if you find some grammer error, please notice me.
2018-09-02 16:34:01 +02:00
nmlgc 2881d8736c [Readme] Rewrite a bunch of sentences
• Mention the existence of DOSBox-X
• Add more reasons why this project is a good idea
• PyTouhou is actually quite the opposite of what we are doing
• JynX's Re:Mystic Square wasn't actually written in Danmakufu, thanks
  to Ryann1908#9434 for reporting this oversight
• Move details about our planned remakes down to the Moddability section
  of the roadmap (yeah, I no longer believe we're ever gonna see those)
• Who needs this entire "we are not a wholesome FOSS project" sentence
  anyway
2018-06-23 23:54:07 +02:00
nmlgc d62dd06ddf [Reverse-engineering] [th02/th04/th05] Shot type control functions
Now you can mix and match characters and shot types any way you want.

TH02 and TH05 simply use the regular shot sprites associated with the
character/shot type no matter which function is used, which quite
surprisingly works without glitches for the few combinations I've tried.
TH04, however, always uses the sprites that were originally intended to
be used with that shot function, regardless of the character you assign
the function to, meaning that it always loads all 4 shot sprite sheets
into memory. Not doing that would have been one way to reduce the game's
memory footprint so that it doesn't require an extender…

Funded by -Tom-.
2018-04-21 15:32:33 +02:00
nmlgc 82bacbf01d [Reverse-engineering] [th04/th05] Current player character ID
TH03, again, uses structures for this.

Funded by -Tom-.
2018-04-20 21:37:41 +02:00
nmlgc 755a0564ae [Reverse-engineering] [th02/th04/th05] Shot power levels
Funded by -Tom-.
2018-04-20 19:33:40 +02:00
nmlgc a67a55dc20 [Reverse-engineering] [th02/th04/th05] Current shot power
Funded by -Tom-.
2018-04-18 17:51:58 +02:00
nmlgc 26d5747d71 [Reverse-engineering] [th02/th05] Current live and bomb counts
TH01 was done in 3b175c8, TH03 obviously has two of those and uses a
structure for it, TH04 doesn't move it out of the resident structure.

Funded by -Tom-.
2018-04-17 19:30:14 +02:00
nmlgc 47e5601613 [Reverse-engineering] [th03/th04/th05] Frame-count-mod-2/4/8/16 globals
Mostly used for animations, but NOPping out the assignments causes
Ultra-like behavior in some (mid)bosses, at least in TH04 and TH05?

Funded by -Tom-.
2018-04-16 13:18:54 +02:00
nmlgc a4308d6c09 [Reduction] #712: js_sense
In which ZUN actively refuses help from master.lib and rips out
everything that isn't immediately related to reading the one joystick
port of the PC-9801-86 sound board.

Maybe there actually was a good reason for that?

Funded by -Tom-.
2018-04-15 23:51:49 +02:00
nmlgc 6c35094bea [Reduction] #711: master.lib joystick globals
Funded by -Tom-.
2018-04-15 23:51:49 +02:00
nmlgc 371fa21610 [Reduction] #710: js_start
Might be interesting to research why ZUN explicitly removed support for
the SAJ-98 there.

Funded by -Tom-.
2018-04-15 23:51:49 +02:00
Egor 8ec888f30a [zuncom] Get rid of moveup.asm
one less invokation of tasm+tlink == one less headache
2018-04-15 20:22:41 +03:00
Egor 16766e28ac [zuncom] Simplified build of zun.com
Now it uses a single utility (zungen) to generate the header and
concatenate all the files
2018-04-15 20:07:40 +03:00
Egor 3eaa16a0fd [th04/th05] Rebuild ZUN.COM 2018-04-15 17:37:06 +03:00
Egor a1effa1c42 [th02/th03] Rebuild ZUN.COM
Two DOS utilities were made for this:
- gensize: generates TASM macro definitions with filesizes.
- copycat: similar to copy/b a+b+c d, except a+b+c is specified in a
separate file to avoid command line length limitations.

th02/zun.com is bit-perfect
th03/zun.com is almost there, with insignificant differences in
zunsp.com and res_yume.com.
2018-04-14 20:21:27 +03:00
Egor 88fdde46b1 [Readme] Recommend dynamic core and max cycles for faster compilation in DOSBox 2018-04-10 19:51:16 +02:00
nmlgc 843905ecea [Reverse-engineering] [th04/th05] ZUN Soft logo explosions
Which seemed a nicer and more debuggable intro to how ZUN implements
sprites than starting with a random structure from MAIN.EXE.

Funded by -Tom-.
2018-03-21 23:20:04 +01:00
nmlgc 6b0d0c6940 [Maintenance] Rename master.lib's speed parameter to avoid an upcoming conflict
TASM crashes if you try to define a structure member with the same name
as an existing numeric equate.

And yes, we should have solved this by finally librarifying master.lib,
but that'll be a rather involved subtask as well.
2018-03-20 19:26:44 +01:00
nmlgc dca8770533 [Build] Use Borland's real-mode MAKER.EXE
DOSBox-X seems to have some problems with it, or maybe that's just me
having configured something wrong. In any case, it's not like we need
that extra memory, so removing the need for the DPMI driver removes
one more potential source of problems.

Oh, and it has always been part of the devkit. :P
2018-03-19 23:52:42 +01:00
nmlgc 0fe6416a77 [Reverse-engineering] [th04/th05] Midboss timer
word_20616 in TH02's MAIN.EXE does the same, but uses a weird unit.
Half-seconds, maybe?

thcrap-like Skipgame functionality is still out of reach, unfortunately.
But eh, now you can practice midbosses while being underpowered, if you
want to.

Funded by -Tom-.
2018-03-18 21:27:20 +01:00
nmlgc 134804d0e5 [Readme] Add 16-bit TASM to the list of build requirements 2018-03-17 05:30:49 +01:00
nmlgc 4b8baf1413 [Reverse-engineering] [th02/th03/th04/th05] Random number ring buffer
Yes, you're reading that correctly. If the cursor is at 255, reading a
16-bit value will fill the upper 8 bits with the neighboring cursor
value, which always is 0xFF.

Funded by -Tom-.
2018-03-16 18:12:21 +01:00
nmlgc f98fba3c9d [Reverse-engineering] [th02/th04/th05] .map file loading
Funded by -Tom-.
2018-03-16 08:02:14 +01:00
nmlgc 13a6a1d64c [Reverse-engineering] [th04/th05] Stage number globals
TH03 is still rather confusing with apparently three of those, TH02 was
done in 17f6ac7d, TH01 doesn't even copy it out of the resident
structure.

Funded by -Tom-.
2018-03-15 07:44:32 +01:00
nmlgc 1f752d739d [Build] Keep TLINK from accidentally creating 1.MAP on every build 2018-03-10 20:46:00 +01:00
nmlgc 4ddd9e1377 [Maintenance] readme.md → README.md
Because there will be a CONTRIBUTING.md as well.
2017-10-26 22:56:29 +02:00
Egor 7b0ebbbb86 .gitignore target binaries 2017-10-24 21:33:59 +03:00
nmlgc cae1be46a4 [Arrays] Remaining references to the sine and cosine tables 2017-01-10 20:23:57 +01:00
nmlgc f8d8d56cd1 [Reduction] Bouncing Music Room polygons 2017-01-09 21:10:33 +01:00
nmlgc 39c169c30d [Reduction] Separate functions for 1D and 2D vector construction
Look at that TH05 vector2_at_opt function. What the hell, the caller is
supposed to set up the stack frame for the function? How do you even get
a compiler to do this (and no, I haven't found a compiler switch)? No
way around writing a separate "optimizer" as part of the compilation
pipeline, it seems.
2017-01-08 21:01:13 +01: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 7a309919aa [Reverse-engineering] [th02/maine] *Actually* identify all array references -.-
And already, the script begins to crumble, reminding me of what a
terrible idea it actually was. Like, if you did it for real, you'd get
so many false positives that the script stops being useful, since
every raw number above 0x90 (the size of the _DATA segment of the
Borland C++ DOS startup code) can potentially be a memory reference.

I do think that the script now covers the sweet spot between full-blown
emulation and shallow parsing though, so going to do at least a few
more files.
2017-01-05 23:54:17 +01:00