2014-11-15 01:03:41 +00:00
|
|
|
GAME = 2
|
2019-12-14 19:34:55 +00:00
|
|
|
include defconv.inc
|
2019-11-23 20:28:21 +00:00
|
|
|
include th02/mem.inc
|
2019-09-20 19:56:31 +00:00
|
|
|
|
2015-02-22 21:33:07 +00:00
|
|
|
include th02/hardware/input.inc
|
2019-09-23 15:52:53 +00:00
|
|
|
include th02/math/randring.inc
|
2019-09-18 16:33:38 +00:00
|
|
|
include th02/gaiji/boldfont.inc
|
2019-09-20 19:56:31 +00:00
|
|
|
include th02/score.inc
|
2015-02-23 22:45:30 +00:00
|
|
|
|
2015-02-24 14:45:38 +00:00
|
|
|
kajacall macro func, param := <0>
|
2015-03-15 22:26:44 +00:00
|
|
|
call _snd_kaja_interrupt pascal, (func shl 8) or (param and 0ffh)
|
2015-02-24 14:45:38 +00:00
|
|
|
endm
|
|
|
|
|
2015-02-23 22:45:30 +00:00
|
|
|
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
|
2018-03-16 06:43:20 +00:00
|
|
|
|
|
|
|
MAP_SIZE = 0C00h
|
2019-09-23 10:49:25 +00:00
|
|
|
|
|
|
|
; Player
|
|
|
|
; ------
|
|
|
|
MISS_INVINCIBILITY_FRAMES = 220
|
|
|
|
CONTINUE_INVINCIBILITY_FRAMES = 200
|
|
|
|
; ------
|
|
|
|
|
|
|
|
; Bombs
|
|
|
|
; -----
|
|
|
|
BOMB_INVINCIBILITY_FRAMES_AFTER = 70
|
|
|
|
; -----
|
|
|
|
|
|
|
|
; Bosses
|
|
|
|
; ------
|
|
|
|
BOSS_DEFEAT_INVINCIBILITY_FRAMES = 200
|
|
|
|
; ------
|