Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reverse-engineering] [th02/maine] Identify all remaining global arrays
Which is the last step on the way to completely position-independent code, with no random hex numbers that should have been data pointers, but weren't automatically turned into data pointers by IDA because they're only ever addressed in the indirect fashion of mov bx, [bp-array_index] mov ax, [bx+0D00h] ; 0D00h is obviously an array of some sort Removing all of these makes it practicable to add or delete code without breaking the game in the process. Basic "modding", so to speak. Automatically catching all possible cases where this happens actually amounts to emulating the entire game, and *even then*, we're not guaranteed that the *size* of the array just falls out as a byproduct of this emulation and the tons of heuristics I would have thrown on top of that. ZUN hates proper bounds checking and the correct size of each array may simply never be implied anywhere. So, rather than going through all that trouble of that (and hell, I haven't even finished *parsing* this nasty MASM assembly format), and since nothing really has happened in this project for almost two years, I chose to just turn this into a text manipulation issue and figure out the rest manually. Yeah, quick and dirty, and it probably won't scale if I ever end up doing the same for PC-98 Policenauts, but it'd better work at least for the rest of PC-98 Touhou. Trying to do one of those per day from now on. Probably won't make it due to the reverse-engineering effort required for the big main executables of each game, but it'd sure be cool if I did.
- Loading branch information