ReC98/th02/th02.asm

42 lines
673 B
NASM
Raw Normal View History

GAME = 2
include defconv_c.inc
include th02/hardware/input.inc
include th02/math/randring_next.inc
kajacall macro func, param := <0>
call _snd_kaja_interrupt pascal, (func shl 8) or (param and 0ffh)
endm
mikoconfig_t struc
id db 10 dup(?) ; = "MIKOConfig"
db ?
stage db ?
debug_flag db ?
db ?
score dd ?
continues_used dw ?
rem_bombs db ?
rem_lives db ?
rank db ?
start_power db ?
bgm_mode db ?
start_bombs db ?
start_lives db ?
db ?
frame dd ?
unused_1 dw ?
unused_2 db ?
main_retval db ?
perf db ?
unused_3 db ?
shottype db ?
demo_num db ?
skill dw ?
unused_4 dw ?
score_highest dd ?
mikoconfig_t ends
[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.
2017-01-04 19:52:21 +00:00
END_LINE_LEN = 46
MAP_SIZE = 0C00h