2014-07-02 17:43:15 +00:00
|
|
|
|
;
|
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
|
; | This file has been generated by The Interactive Disassembler (IDA) |
|
|
|
|
|
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
|
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
|
;
|
|
|
|
|
; Input MD5 : E6F971B37336C0F9FCE53F895780031E
|
|
|
|
|
|
|
|
|
|
; File Name : th02/MAINE.EXE
|
|
|
|
|
; Format : MS-DOS executable (EXE)
|
|
|
|
|
; Base Address: 0h Range: 0h-FCF0h Loaded length: DE32h
|
|
|
|
|
; Entry Point : 0:0
|
|
|
|
|
; OS type : MS DOS
|
|
|
|
|
; Application type: Executable 16bit
|
|
|
|
|
|
2014-10-31 06:17:05 +00:00
|
|
|
|
.286 ; Force the .model directive to create 16-bit default segments...
|
2015-02-21 11:47:24 +00:00
|
|
|
|
.model large maine_02_TEXT
|
2014-10-31 06:17:05 +00:00
|
|
|
|
__LARGE__ equ 1
|
|
|
|
|
.386 ; ... then switch to what we actually need.
|
|
|
|
|
; And yes, we can't move this to an include file for some reason.
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-22 15:06:33 +00:00
|
|
|
|
include ReC98.inc
|
2019-09-20 19:02:20 +00:00
|
|
|
|
include th02/th02.inc
|
2015-09-07 13:44:02 +00:00
|
|
|
|
|
2015-02-19 06:46:36 +00:00
|
|
|
|
extern SCOPY@:proc
|
|
|
|
|
extern _execl:proc
|
Include RULES.ASI from every executable's dump file.
Having thought this over for a while, I've decided to stay with the "include
slice" model for now, due to various bugs and other reasons.
We need to compile for the 386 CPU, but this causes TASM to automatically
default every segment to 32-bit mode, which of course is not what we want (and
no, .MODEL USE16 sadly does not help either). Appending USE16 to every segment
declaration in all included files seems to work, but for some reason, this
messes up certain jump instructions. WTF? And even if it did work, we would
still have to do this for every single file we include.
The alternative would be to build proper libraries and let the linker merge
all the code. This would add a lot of unwarranted complexity to the build
process. Not to mention all the EXTERN statements we'd have to maintain.
Ultimately, all of the C runtime ASM code is going to vanish anyway once we've
completed the reduction step. Once we're there, we can simply link to the
original version of the library. These initial dumps are not pretty, and I see
no point in wasting time on making intermediary stages of development look
pretty.
Since including RULES.ASI from every slice seems a bit inefficient (and even
potentiall harmful, considering the age of the development tools we have to
work with), we'll only include it once at the top of every main dump file.
[Binary change] Relocations in TH01's REIIDEN.EXE, again.
2014-08-14 06:01:36 +00:00
|
|
|
|
|
2014-07-02 17:43:15 +00:00
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
|
|
|
|
; Segment type: Pure code
|
2015-02-18 11:07:37 +00:00
|
|
|
|
_TEXT segment word public 'CODE' use16
|
|
|
|
|
assume cs:_TEXT
|
2015-02-19 06:46:36 +00:00
|
|
|
|
assume es:nothing, ds:_DATA, fs:nothing, gs:nothing
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-23 09:51:14 +00:00
|
|
|
|
include libs/master.lib/bfnt_entry_pat.asm
|
2014-08-23 10:23:03 +00:00
|
|
|
|
include libs/master.lib/bfnt_extend_header_skip.asm
|
2014-08-23 10:08:48 +00:00
|
|
|
|
include libs/master.lib/bfnt_header_read.asm
|
2014-08-23 11:18:32 +00:00
|
|
|
|
include libs/master.lib/bfnt_header_analysis.asm
|
2014-08-26 18:54:57 +00:00
|
|
|
|
include libs/master.lib/bcloser.asm
|
2014-08-10 09:47:36 +00:00
|
|
|
|
include libs/master.lib/bfill.asm
|
2014-08-23 14:56:01 +00:00
|
|
|
|
include libs/master.lib/bfnt_palette_set.asm
|
2014-08-26 19:23:54 +00:00
|
|
|
|
include libs/master.lib/bgetc.asm
|
2014-08-26 22:21:45 +00:00
|
|
|
|
include libs/master.lib/palette_black_in.asm
|
2014-08-26 22:33:43 +00:00
|
|
|
|
include libs/master.lib/palette_black_out.asm
|
2014-08-27 00:54:57 +00:00
|
|
|
|
include libs/master.lib/bopenr.asm
|
2014-08-26 19:34:06 +00:00
|
|
|
|
include libs/master.lib/bread.asm
|
2014-08-26 20:04:11 +00:00
|
|
|
|
include libs/master.lib/bseek.asm
|
2014-08-26 20:15:00 +00:00
|
|
|
|
include libs/master.lib/bseek_.asm
|
2014-08-28 01:42:26 +00:00
|
|
|
|
include libs/master.lib/cutline.asm
|
2014-08-23 01:03:17 +00:00
|
|
|
|
include libs/master.lib/dos_axdx.asm
|
2014-08-28 03:13:35 +00:00
|
|
|
|
include libs/master.lib/dos_filesize.asm
|
2014-08-22 23:38:22 +00:00
|
|
|
|
include libs/master.lib/dos_setvect.asm
|
2014-08-20 20:24:05 +00:00
|
|
|
|
include libs/master.lib/egc.asm
|
2014-08-28 02:20:59 +00:00
|
|
|
|
include libs/master.lib/egc_shift_down.asm
|
2014-08-28 02:45:41 +00:00
|
|
|
|
include libs/master.lib/egc_shift_left.asm
|
2014-08-30 05:58:36 +00:00
|
|
|
|
include libs/master.lib/file_append.asm
|
2014-08-30 06:15:42 +00:00
|
|
|
|
include libs/master.lib/file_close.asm
|
2014-08-30 06:46:38 +00:00
|
|
|
|
include libs/master.lib/file_exist.asm
|
2014-08-30 07:00:31 +00:00
|
|
|
|
include libs/master.lib/file_read.asm
|
2014-08-30 07:12:17 +00:00
|
|
|
|
include libs/master.lib/file_ropen.asm
|
2014-08-30 07:21:44 +00:00
|
|
|
|
include libs/master.lib/file_seek.asm
|
2014-08-30 08:06:10 +00:00
|
|
|
|
include libs/master.lib/file_size.asm
|
2014-08-30 07:38:09 +00:00
|
|
|
|
include libs/master.lib/file_write.asm
|
2014-08-22 22:46:33 +00:00
|
|
|
|
include libs/master.lib/dos_close.asm
|
2014-08-21 20:07:58 +00:00
|
|
|
|
include libs/master.lib/dos_ropen.asm
|
2014-08-28 03:31:57 +00:00
|
|
|
|
include libs/master.lib/grcg_boxfill.asm
|
2014-08-31 09:30:26 +00:00
|
|
|
|
include libs/master.lib/grcg_line.asm
|
2014-08-27 04:52:58 +00:00
|
|
|
|
include libs/master.lib/grcg_setcolor.asm
|
2014-08-31 08:23:41 +00:00
|
|
|
|
include libs/master.lib/gaiji_backup.asm
|
2014-08-31 08:08:09 +00:00
|
|
|
|
include libs/master.lib/gaiji_entry_bfnt.asm
|
2014-08-31 02:56:17 +00:00
|
|
|
|
include libs/master.lib/gaiji_putca.asm
|
2014-08-31 03:05:48 +00:00
|
|
|
|
include libs/master.lib/gaiji_putsa.asm
|
2014-08-31 07:40:28 +00:00
|
|
|
|
include libs/master.lib/gaiji_read.asm
|
2014-08-31 07:50:38 +00:00
|
|
|
|
include libs/master.lib/gaiji_write.asm
|
2014-08-27 22:58:40 +00:00
|
|
|
|
include libs/master.lib/graph_400line.asm
|
2014-08-27 04:03:08 +00:00
|
|
|
|
include libs/master.lib/graph_clear.asm
|
2014-08-27 04:13:48 +00:00
|
|
|
|
include libs/master.lib/graph_copy_page.asm
|
2014-08-15 14:11:51 +00:00
|
|
|
|
include libs/master.lib/graph_extmode.asm
|
2014-09-14 15:39:30 +00:00
|
|
|
|
include libs/master.lib/graph_gaiji_putc.asm
|
2014-09-15 01:03:52 +00:00
|
|
|
|
include libs/master.lib/graph_gaiji_puts.asm
|
2014-08-21 23:39:42 +00:00
|
|
|
|
include libs/master.lib/graph_pi_free.asm
|
2014-08-22 19:15:44 +00:00
|
|
|
|
include libs/master.lib/graph_pi_load_pack.asm
|
2014-08-31 05:26:45 +00:00
|
|
|
|
include libs/master.lib/graph_pack_put_8.asm
|
2014-08-30 07:56:49 +00:00
|
|
|
|
include libs/master.lib/key_sense.asm
|
2014-09-09 03:54:40 +00:00
|
|
|
|
include libs/master.lib/over_put_8.asm
|
2014-08-23 14:11:16 +00:00
|
|
|
|
include libs/master.lib/palette_show.asm
|
2014-08-27 01:11:13 +00:00
|
|
|
|
include libs/master.lib/pfclose.asm
|
2014-09-07 13:07:36 +00:00
|
|
|
|
include libs/master.lib/pfgetc.asm
|
2014-08-30 10:50:48 +00:00
|
|
|
|
include libs/master.lib/pfread.asm
|
2014-08-30 10:33:48 +00:00
|
|
|
|
include libs/master.lib/pfrewind.asm
|
2014-08-30 10:26:02 +00:00
|
|
|
|
include libs/master.lib/pfseek.asm
|
2014-08-31 03:14:54 +00:00
|
|
|
|
include libs/master.lib/palette_entry_rgb.asm
|
2014-08-23 01:15:17 +00:00
|
|
|
|
include libs/master.lib/rottbl.asm
|
2014-08-21 22:59:18 +00:00
|
|
|
|
include libs/master.lib/smem_release.asm
|
2014-08-21 23:04:46 +00:00
|
|
|
|
include libs/master.lib/smem_wget.asm
|
2014-10-20 15:20:04 +00:00
|
|
|
|
include libs/master.lib/text_clear.asm
|
2014-08-26 21:58:08 +00:00
|
|
|
|
include libs/master.lib/vsync.asm
|
2014-08-26 22:11:29 +00:00
|
|
|
|
include libs/master.lib/vsync_wait.asm
|
2014-08-26 22:52:29 +00:00
|
|
|
|
include libs/master.lib/palette_white_in.asm
|
2014-08-26 22:57:45 +00:00
|
|
|
|
include libs/master.lib/palette_white_out.asm
|
2014-08-21 23:19:52 +00:00
|
|
|
|
include libs/master.lib/hmem_lallocate.asm
|
2014-08-21 21:30:20 +00:00
|
|
|
|
include libs/master.lib/mem_assign_dos.asm
|
2014-08-21 21:05:54 +00:00
|
|
|
|
include libs/master.lib/mem_assign.asm
|
2014-08-21 22:17:53 +00:00
|
|
|
|
include libs/master.lib/memheap.asm
|
2014-09-08 18:30:15 +00:00
|
|
|
|
include libs/master.lib/mem_unassign.asm
|
2014-08-22 22:17:59 +00:00
|
|
|
|
include libs/master.lib/super_entry_pat.asm
|
2014-08-22 21:56:33 +00:00
|
|
|
|
include libs/master.lib/super_entry_at.asm
|
2014-08-23 16:07:02 +00:00
|
|
|
|
include libs/master.lib/super_entry_bfnt.asm
|
2014-11-16 03:00:41 +00:00
|
|
|
|
include libs/master.lib/pfint21.asm
|
2014-07-02 17:43:15 +00:00
|
|
|
|
db 0
|
2014-11-17 03:54:40 +00:00
|
|
|
|
include th02/formats/pfopen.asm
|
|
|
|
|
include libs/master.lib/pf_str_ieq.asm
|
2015-02-18 11:07:37 +00:00
|
|
|
|
_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
|
|
|
|
; Segment type: Pure code
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_01_TEXT segment byte public 'CODE' use16
|
|
|
|
|
assume cs:maine_01_TEXT
|
2014-07-02 17:43:15 +00:00
|
|
|
|
;org 3
|
2015-02-18 11:07:37 +00:00
|
|
|
|
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_95A3 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = dword ptr 4
|
|
|
|
|
|
|
|
|
|
enter 2, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
pushd [bp+arg_0]
|
2014-08-30 07:12:17 +00:00
|
|
|
|
call file_ropen
|
2014-08-30 08:06:10 +00:00
|
|
|
|
call file_size
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_2], ax
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ax
|
2014-08-30 07:00:31 +00:00
|
|
|
|
call file_read
|
2014-08-30 06:15:42 +00:00
|
|
|
|
call file_close
|
2014-07-02 17:43:15 +00:00
|
|
|
|
leave
|
|
|
|
|
retn 4
|
|
|
|
|
sub_95A3 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_95CB proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_9 = byte ptr -9
|
|
|
|
|
var_8 = dword ptr -8
|
|
|
|
|
var_4 = dword ptr -4
|
|
|
|
|
arg_0 = dword ptr 4
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
arg_6 = word ptr 0Ah
|
|
|
|
|
|
|
|
|
|
enter 0Ah, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov di, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_4], 989680h
|
|
|
|
|
mov [bp+var_9], 0
|
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_9638
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_95E4:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov eax, [bp+arg_0]
|
|
|
|
|
cdq
|
|
|
|
|
idiv [bp+var_4]
|
|
|
|
|
mov ebx, 0Ah
|
|
|
|
|
cdq
|
|
|
|
|
idiv ebx
|
|
|
|
|
mov [bp+var_8], edx
|
|
|
|
|
mov eax, [bp+var_4]
|
|
|
|
|
cdq
|
|
|
|
|
idiv ebx
|
|
|
|
|
mov [bp+var_4], eax
|
|
|
|
|
mov ax, word ptr [bp+var_8]
|
2014-09-18 15:20:12 +00:00
|
|
|
|
add ax, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov di, ax
|
|
|
|
|
cmp [bp+var_8], 0
|
|
|
|
|
jz short loc_961D
|
|
|
|
|
mov [bp+var_9], 1
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_961D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_9], 0
|
|
|
|
|
jz short loc_9637
|
|
|
|
|
mov ax, si
|
|
|
|
|
shl ax, 4
|
|
|
|
|
add ax, [bp+arg_6]
|
|
|
|
|
push ax
|
|
|
|
|
push [bp+arg_4]
|
|
|
|
|
push di
|
|
|
|
|
push 0Fh
|
2014-09-14 15:39:30 +00:00
|
|
|
|
call graph_gaiji_putc
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9637:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9638:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 8
|
|
|
|
|
jl short loc_95E4
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 8
|
|
|
|
|
sub_95CB endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9643 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_50 = byte ptr -50h
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
arg_2 = dword ptr 6
|
|
|
|
|
arg_6 = word ptr 0Ah
|
|
|
|
|
arg_8 = word ptr 0Ch
|
|
|
|
|
arg_A = word ptr 0Eh
|
|
|
|
|
|
|
|
|
|
enter 50h, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
lea ax, [bp+var_50]
|
|
|
|
|
push ss
|
|
|
|
|
push ax
|
|
|
|
|
push ds
|
|
|
|
|
push offset unk_D030
|
|
|
|
|
mov cx, 50h ; 'P'
|
|
|
|
|
call SCOPY@
|
|
|
|
|
xor si, si
|
|
|
|
|
xor di, di
|
|
|
|
|
jmp short loc_96C4
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9660:
|
2015-02-22 21:33:07 +00:00
|
|
|
|
call _input_sense
|
2014-07-02 17:43:15 +00:00
|
|
|
|
les bx, [bp+arg_2]
|
|
|
|
|
add bx, si
|
|
|
|
|
mov al, es:[bx]
|
|
|
|
|
mov [bp+si+var_50], al
|
|
|
|
|
inc si
|
|
|
|
|
mov bx, word ptr [bp+arg_2]
|
|
|
|
|
add bx, si
|
|
|
|
|
mov al, es:[bx]
|
|
|
|
|
mov [bp+si+var_50], al
|
|
|
|
|
inc si
|
|
|
|
|
mov [bp+si+var_50], 0
|
|
|
|
|
push ss
|
|
|
|
|
lea ax, [bp+var_50]
|
|
|
|
|
push ax
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
|
|
|
|
push [bp+arg_8]
|
|
|
|
|
push [bp+arg_A]
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
cmp byte_F02B, 0
|
|
|
|
|
jz short loc_96B9
|
2015-02-22 21:33:07 +00:00
|
|
|
|
cmp _input, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jz short loc_96B9
|
|
|
|
|
test di, 3
|
|
|
|
|
jz short loc_96C1
|
|
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
|
mov bx, 3
|
|
|
|
|
cwd
|
|
|
|
|
idiv bx
|
|
|
|
|
push ax
|
|
|
|
|
jmp short loc_96BC
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96B9:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push [bp+arg_0]
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96BC:
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96C1:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add di, 2
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96C4:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, [bp+arg_6]
|
|
|
|
|
jl short loc_9660
|
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_96EC
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96CD:
|
2015-02-22 21:33:07 +00:00
|
|
|
|
call _input_sense
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp byte_F02B, 0
|
|
|
|
|
jz short loc_96E4
|
2015-02-22 21:33:07 +00:00
|
|
|
|
cmp _input, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jz short loc_96E4
|
|
|
|
|
push 0
|
|
|
|
|
jmp short loc_96E6
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96E4:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96E6:
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96EC:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 14h
|
|
|
|
|
jl short loc_96CD
|
|
|
|
|
cmp byte_F02B, 0
|
|
|
|
|
jz short loc_96FB
|
|
|
|
|
call sub_9A7E
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_96FB:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 0Ch
|
|
|
|
|
sub_9643 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9701 proc far
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_8 = word ptr -8
|
|
|
|
|
var_6 = word ptr -6
|
|
|
|
|
var_4 = word ptr -4
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = word ptr 6
|
|
|
|
|
arg_2 = word ptr 8
|
|
|
|
|
arg_4 = dword ptr 0Ah
|
|
|
|
|
|
|
|
|
|
enter 8, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
|
sar ax, 3
|
|
|
|
|
mov dx, [bp+arg_2]
|
|
|
|
|
shl dx, 6
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov dx, [bp+arg_2]
|
|
|
|
|
shl dx, 4
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov si, ax
|
|
|
|
|
xor di, di
|
|
|
|
|
jmp loc_97E6
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9724:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_8], ax
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_R
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_6], ax
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_G
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_4], ax
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_E
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_2], ax
|
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
out dx, al
|
2015-01-12 21:48:13 +00:00
|
|
|
|
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, di
|
|
|
|
|
add ax, ax
|
|
|
|
|
les bx, [bp+arg_4]
|
|
|
|
|
add bx, ax
|
|
|
|
|
mov ax, es:[bx]
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov es:[bx], ax
|
2014-08-27 04:52:58 +00:00
|
|
|
|
call grcg_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, di
|
|
|
|
|
add ax, ax
|
|
|
|
|
les bx, [bp+arg_4]
|
|
|
|
|
add bx, ax
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
and ax, [bp+var_8]
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
or es:[bx], ax
|
|
|
|
|
mov ax, di
|
|
|
|
|
add ax, ax
|
|
|
|
|
les bx, [bp+arg_4]
|
|
|
|
|
add bx, ax
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
and ax, [bp+var_6]
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_R
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
or es:[bx], ax
|
|
|
|
|
mov ax, di
|
|
|
|
|
add ax, ax
|
|
|
|
|
les bx, [bp+arg_4]
|
|
|
|
|
add bx, ax
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
and ax, [bp+var_4]
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_G
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
or es:[bx], ax
|
|
|
|
|
mov ax, di
|
|
|
|
|
add ax, ax
|
|
|
|
|
les bx, [bp+arg_4]
|
|
|
|
|
add bx, ax
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
and ax, [bp+var_2]
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_E
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
or es:[bx], ax
|
|
|
|
|
add si, 50h ; 'P'
|
|
|
|
|
inc di
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_97E6:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 10h
|
|
|
|
|
jl loc_9724
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retf
|
|
|
|
|
sub_9701 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_97F1 proc far
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_60 = byte ptr -60h
|
|
|
|
|
arg_0 = word ptr 6
|
|
|
|
|
arg_2 = word ptr 8
|
|
|
|
|
arg_4 = word ptr 0Ah
|
|
|
|
|
|
|
|
|
|
enter 60h, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
lea ax, [bp+var_60]
|
|
|
|
|
push ss
|
|
|
|
|
push ax
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset byte_D080
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov cx, 60h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call SCOPY@
|
|
|
|
|
xor di, di
|
|
|
|
|
jmp short loc_983D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_980C:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_9830
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9810:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, di
|
|
|
|
|
shl ax, 5
|
|
|
|
|
lea dx, [bp+var_60]
|
|
|
|
|
add ax, dx
|
|
|
|
|
push ss
|
|
|
|
|
push ax
|
|
|
|
|
push [bp+arg_2]
|
|
|
|
|
mov ax, si
|
|
|
|
|
shl ax, 4
|
|
|
|
|
add ax, [bp+arg_0]
|
|
|
|
|
push ax
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_9701
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 8
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9830:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, [bp+arg_4]
|
|
|
|
|
jl short loc_9810
|
|
|
|
|
push 0Ah
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
inc di
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_983D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 3
|
|
|
|
|
jl short loc_980C
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retf
|
|
|
|
|
sub_97F1 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9846 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_2 = byte ptr -2
|
|
|
|
|
var_1 = byte ptr -1
|
|
|
|
|
arg_0 = dword ptr 4
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
|
|
|
|
|
enter 2, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
mov di, [bp+arg_4]
|
|
|
|
|
mov si, 64h ; 'd'
|
|
|
|
|
mov [bp+var_2], 0
|
|
|
|
|
xor cx, cx
|
|
|
|
|
jmp short loc_98A1
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_985A:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, di
|
|
|
|
|
cwd
|
|
|
|
|
idiv si
|
|
|
|
|
mov [bp+var_1], al
|
|
|
|
|
cmp [bp+var_2], 0
|
|
|
|
|
jnz short loc_986B
|
|
|
|
|
mov [bp+var_2], al
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_986B:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_2], 0
|
|
|
|
|
jnz short loc_9876
|
|
|
|
|
cmp cx, 2
|
|
|
|
|
jnz short loc_9885
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9876:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
les bx, [bp+arg_0]
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov al, [bp+var_1]
|
2014-09-18 15:20:12 +00:00
|
|
|
|
add al, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov es:[bx], al
|
|
|
|
|
jmp short loc_988E
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9885:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
les bx, [bp+arg_0]
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov byte ptr es:[bx], 0CFh ; '<27>'
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_988E:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov al, [bp+var_1]
|
|
|
|
|
cbw
|
|
|
|
|
imul si
|
|
|
|
|
sub di, ax
|
|
|
|
|
inc cx
|
|
|
|
|
mov bx, 0Ah
|
|
|
|
|
mov ax, si
|
|
|
|
|
cwd
|
|
|
|
|
idiv bx
|
|
|
|
|
mov si, ax
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98A1:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp cx, 3
|
|
|
|
|
jl short loc_985A
|
|
|
|
|
les bx, [bp+arg_0]
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov byte ptr es:[bx], 0
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 6
|
|
|
|
|
sub_9846 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_98B5 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_6 = word ptr -6
|
|
|
|
|
var_4 = word ptr -4
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
|
|
|
|
|
enter 6, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
cmp [bp+arg_0], 0
|
|
|
|
|
jnz short loc_98C5
|
|
|
|
|
xor ax, ax
|
|
|
|
|
jmp short loc_98DE
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98C5:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_0], 1
|
|
|
|
|
jnz short loc_98D0
|
|
|
|
|
mov ax, 28h ; '('
|
|
|
|
|
jmp short loc_98DE
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98D0:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_0], 2
|
|
|
|
|
jnz short loc_98DB
|
|
|
|
|
mov ax, 3E80h
|
|
|
|
|
jmp short loc_98DE
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98DB:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, 3EA8h
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98DE:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, ax
|
|
|
|
|
mov di, 1F54h
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call egc_start_copy
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_2], 0
|
|
|
|
|
jmp short loc_9930
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98EF:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_4], 0
|
|
|
|
|
jmp short loc_9921
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_98F6:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_6], ax
|
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
out dx, al
|
2015-02-24 15:17:50 +00:00
|
|
|
|
mov bx, word ptr _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, di
|
|
|
|
|
mov ax, [bp+var_6]
|
|
|
|
|
mov es:[bx], ax
|
|
|
|
|
add [bp+var_4], 2
|
|
|
|
|
add si, 2
|
|
|
|
|
add di, 2
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9921:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_4], 28h ; '('
|
|
|
|
|
jl short loc_98F6
|
|
|
|
|
inc [bp+var_2]
|
|
|
|
|
add di, 28h ; '('
|
|
|
|
|
add si, 28h ; '('
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9930:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_2], 0C8h ; '<27>'
|
|
|
|
|
jl short loc_98EF
|
2014-08-20 20:24:05 +00:00
|
|
|
|
call egc_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 2
|
|
|
|
|
sub_98B5 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9942 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_6 = word ptr -6
|
|
|
|
|
var_4 = word ptr -4
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
arg_2 = word ptr 6
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
|
|
|
|
|
enter 6, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
cmp [bp+arg_0], 0
|
|
|
|
|
jnz short loc_9952
|
|
|
|
|
xor ax, ax
|
|
|
|
|
jmp short loc_996B
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9952:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_0], 1
|
|
|
|
|
jnz short loc_995D
|
|
|
|
|
mov ax, 28h ; '('
|
|
|
|
|
jmp short loc_996B
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_995D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_0], 2
|
|
|
|
|
jnz short loc_9968
|
|
|
|
|
mov ax, 3E80h
|
|
|
|
|
jmp short loc_996B
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9968:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, 3EA8h
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_996B:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, ax
|
|
|
|
|
mov ax, [bp+arg_4]
|
|
|
|
|
sar ax, 3
|
|
|
|
|
mov dx, [bp+arg_2]
|
|
|
|
|
shl dx, 6
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov dx, [bp+arg_2]
|
|
|
|
|
shl dx, 4
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov di, ax
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call egc_start_copy
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_2], 0
|
|
|
|
|
jmp short loc_99D2
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9991:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_4], 0
|
|
|
|
|
jmp short loc_99C3
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9998:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_6], ax
|
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
out dx, al
|
2015-02-24 15:17:50 +00:00
|
|
|
|
mov bx, word ptr _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, di
|
|
|
|
|
mov ax, [bp+var_6]
|
|
|
|
|
mov es:[bx], ax
|
|
|
|
|
add [bp+var_4], 2
|
|
|
|
|
add si, 2
|
|
|
|
|
add di, 2
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_99C3:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_4], 28h ; '('
|
|
|
|
|
jl short loc_9998
|
|
|
|
|
inc [bp+var_2]
|
|
|
|
|
add di, 28h ; '('
|
|
|
|
|
add si, 28h ; '('
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_99D2:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_2], 0C8h ; '<27>'
|
|
|
|
|
jl short loc_9991
|
2014-08-20 20:24:05 +00:00
|
|
|
|
call egc_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 6
|
|
|
|
|
sub_9942 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_99E4 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_6 = word ptr -6
|
|
|
|
|
var_4 = word ptr -4
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
arg_2 = word ptr 6
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
|
|
|
|
|
enter 6, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
cmp [bp+arg_4], 0
|
|
|
|
|
jnz short loc_99F4
|
|
|
|
|
xor ax, ax
|
|
|
|
|
jmp short loc_9A0D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_99F4:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_4], 1
|
|
|
|
|
jnz short loc_99FF
|
|
|
|
|
mov ax, 28h ; '('
|
|
|
|
|
jmp short loc_9A0D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_99FF:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+arg_4], 2
|
|
|
|
|
jnz short loc_9A0A
|
|
|
|
|
mov ax, 3E80h
|
|
|
|
|
jmp short loc_9A0D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A0A:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, 3EA8h
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A0D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, ax
|
|
|
|
|
mov di, 1F54h
|
|
|
|
|
mov ax, [bp+arg_2]
|
|
|
|
|
imul ax, 50h
|
|
|
|
|
add si, ax
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call egc_start_copy
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, [bp+arg_2]
|
|
|
|
|
mov [bp+var_2], ax
|
|
|
|
|
jmp short loc_9A68
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A27:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov [bp+var_4], 0
|
|
|
|
|
jmp short loc_9A59
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A2E:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, si
|
|
|
|
|
mov ax, es:[bx]
|
|
|
|
|
mov [bp+var_6], ax
|
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
out dx, al
|
2015-02-24 15:17:50 +00:00
|
|
|
|
mov bx, word ptr _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, di
|
|
|
|
|
mov ax, [bp+var_6]
|
|
|
|
|
mov es:[bx], ax
|
|
|
|
|
add [bp+var_4], 2
|
|
|
|
|
add si, 2
|
|
|
|
|
add di, 2
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A59:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_4], 28h ; '('
|
|
|
|
|
jl short loc_9A2E
|
|
|
|
|
inc [bp+var_2]
|
|
|
|
|
add di, 28h ; '('
|
|
|
|
|
add si, 28h ; '('
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A68:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
|
add ax, [bp+arg_2]
|
|
|
|
|
cmp ax, [bp+var_2]
|
|
|
|
|
jg short loc_9A27
|
2014-08-20 20:24:05 +00:00
|
|
|
|
call egc_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 6
|
|
|
|
|
sub_99E4 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9A7E proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
|
|
|
|
|
enter 2, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
2015-01-12 21:48:13 +00:00
|
|
|
|
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 14Ch
|
|
|
|
|
jmp short loc_9AC5
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A94:
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov di, 90h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp short loc_9ABE
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9A99:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, di
|
|
|
|
|
sar ax, 3
|
|
|
|
|
mov dx, si
|
|
|
|
|
shl dx, 6
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov dx, si
|
|
|
|
|
shl dx, 4
|
|
|
|
|
add ax, dx
|
|
|
|
|
mov [bp+var_2], ax
|
2015-02-24 15:17:50 +00:00
|
|
|
|
les bx, _VRAM_PLANE_B
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add bx, [bp+var_2]
|
|
|
|
|
mov word ptr es:[bx], 0FFFFh
|
|
|
|
|
add di, 10h
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9ABE:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 1F0h
|
|
|
|
|
jl short loc_9A99
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9AC5:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 15Ch
|
|
|
|
|
jl short loc_9A94
|
2014-08-27 04:52:58 +00:00
|
|
|
|
call grcg_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn
|
|
|
|
|
sub_9A7E endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9AD4 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
|
|
|
|
push si
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset aEnd3_txt ; "end3.txt"
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_95A3
|
|
|
|
|
push 1Eh
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
2014-08-26 22:57:45 +00:00
|
|
|
|
call palette_white_out
|
2015-02-23 10:47:22 +00:00
|
|
|
|
call _snd_load c, offset aEnding_m, ds, SND_LOAD_SONG
|
2014-11-27 18:35:54 +00:00
|
|
|
|
kajacall KAJA_SONG_PLAY
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
call sub_9A7E
|
|
|
|
|
push 4
|
2014-08-26 22:52:29 +00:00
|
|
|
|
call palette_white_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 5
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov si, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp short loc_9B5C
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9B1B:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push si
|
|
|
|
|
push 64h ; 'd'
|
|
|
|
|
lea ax, [si+13Fh]
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 12B0004h
|
2014-08-28 02:45:41 +00:00
|
|
|
|
call egc_shift_left
|
2015-01-12 21:48:13 +00:00
|
|
|
|
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
lea ax, [si+138h]
|
|
|
|
|
push ax
|
|
|
|
|
push 64h ; 'd'
|
|
|
|
|
lea ax, [si+13Fh]
|
|
|
|
|
push ax
|
|
|
|
|
push 12Bh
|
2014-08-28 03:31:57 +00:00
|
|
|
|
call grcg_boxfill
|
2014-08-27 04:52:58 +00:00
|
|
|
|
call grcg_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
sub si, 4
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9B5C:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 24h ; '$'
|
|
|
|
|
jg short loc_9B1B
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
retn
|
|
|
|
|
sub_9AD4 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_9B64 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
|
|
|
|
push si
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEnd1_txt ; "end1.txt"
|
|
|
|
|
call sub_95A3
|
2015-02-23 10:47:22 +00:00
|
|
|
|
call _snd_load c, offset aEnd1_m, ds, SND_LOAD_SONG
|
2014-11-27 18:35:54 +00:00
|
|
|
|
kajacall KAJA_SONG_PLAY
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd01_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 28h ; '('
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov byte_F02B, 1
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 14h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 1
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 1
|
|
|
|
|
jmp short loc_9C2D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C15:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C2D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 3
|
|
|
|
|
jle short loc_9C15
|
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov si, 4
|
|
|
|
|
jmp short loc_9C54
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C3C:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C54:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 5
|
|
|
|
|
jle short loc_9C3C
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 6)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 7
|
|
|
|
|
jmp short loc_9C91
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C79:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9C91:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 9
|
|
|
|
|
jle short loc_9C79
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 10)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 11)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 14h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 12)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_9D10
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9CDE:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0A00064h
|
|
|
|
|
push 1DF0129h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-28 02:20:59 +00:00
|
|
|
|
call egc_shift_down
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 3
|
|
|
|
|
mov ax, si
|
|
|
|
|
add ax, ax
|
|
|
|
|
mov dx, 0C6h ; '<27>'
|
|
|
|
|
sub dx, ax
|
|
|
|
|
push dx
|
|
|
|
|
push 2
|
|
|
|
|
call sub_99E4
|
|
|
|
|
push 1
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D10:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 64h ; 'd'
|
|
|
|
|
jl short loc_9CDE
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 13)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
|
|
|
|
mov si, 0Eh
|
|
|
|
|
jmp short loc_9D48
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D30:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D48:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 0Fh
|
|
|
|
|
jle short loc_9D30
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 10h
|
|
|
|
|
jmp short loc_9D6F
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D57:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D6F:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 11h
|
|
|
|
|
jle short loc_9D57
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
|
|
|
|
mov si, 12h
|
|
|
|
|
jmp short loc_9D96
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D7E:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9D96:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 14h
|
|
|
|
|
jle short loc_9D7E
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 21)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 22)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 23)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd02_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_9E2A
|
|
|
|
|
push 0
|
|
|
|
|
jmp short loc_9E3B
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E2A:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_9E39
|
|
|
|
|
push 2
|
|
|
|
|
jmp short loc_9E3B
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E39:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 3
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E3B:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_98B5
|
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 24)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 19h
|
|
|
|
|
jmp short loc_9E7D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E65:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E7D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 1Ah
|
|
|
|
|
jle short loc_9E65
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_9F22
|
|
|
|
|
mov si, 1Bh
|
|
|
|
|
jmp short loc_9EB1
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9E99:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9EB1:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 1Ch
|
|
|
|
|
jle short loc_9E99
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 1Dh
|
|
|
|
|
jmp short loc_9ED8
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9EC0:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9ED8:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 1Eh
|
|
|
|
|
jle short loc_9EC0
|
|
|
|
|
push 1
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 31)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 32)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 33)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp loc_A092
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9F22:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_9FD3
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 34)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 35)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 36)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 25h ; '%'
|
|
|
|
|
jmp short loc_9F8E
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9F76:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9F8E:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 26h ; '&'
|
|
|
|
|
jle short loc_9F76
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 39)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 40)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 41)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp loc_A092
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_9FD3:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 2
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_A097
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 42)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 43)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
|
|
|
|
mov si, 2Ch ; ','
|
|
|
|
|
jmp short loc_A029
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A011:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A029:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 2Dh ; '-'
|
|
|
|
|
jle short loc_A011
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 2Eh ; '.'
|
|
|
|
|
jmp short loc_A050
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A038:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A050:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 2Fh ; '/'
|
|
|
|
|
jle short loc_A038
|
|
|
|
|
mov byte_F02A, 26h ; '&'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 48)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 49)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 50)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A092:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 9
|
|
|
|
|
call sub_9643
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A097:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_9AD4
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
retn
|
|
|
|
|
sub_9B64 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_A09D proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
|
|
|
|
push si
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEnd2_txt ; "end2.txt"
|
|
|
|
|
call sub_95A3
|
2015-02-23 10:47:22 +00:00
|
|
|
|
call _snd_load c, offset aEnd1_m, ds, SND_LOAD_SONG
|
2014-11-27 18:35:54 +00:00
|
|
|
|
kajacall KAJA_SONG_PLAY
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd01_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 28h ; '('
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov byte_F02B, 1
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 14h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd03_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 1
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 1
|
|
|
|
|
jmp short loc_A19D
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A185:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A19D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 3
|
|
|
|
|
jle short loc_A185
|
|
|
|
|
push 1
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov si, 4
|
|
|
|
|
jmp short loc_A1C4
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A1AC:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A1C4:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 9
|
|
|
|
|
jle short loc_A1AC
|
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov si, 0Ah
|
|
|
|
|
jmp short loc_A1EB
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A1D3:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A1EB:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 0Bh
|
|
|
|
|
jle short loc_A1D3
|
|
|
|
|
push 3
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov si, 0Ch
|
|
|
|
|
jmp short loc_A212
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A1FA:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A212:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 0Dh
|
|
|
|
|
jle short loc_A1FA
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd03a_rgb ; "ed03a.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 0Eh
|
|
|
|
|
jmp short loc_A247
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A22F:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A247:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 0Fh
|
|
|
|
|
jle short loc_A22F
|
|
|
|
|
push 2
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd04_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 16)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 17)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 12h
|
|
|
|
|
jmp short loc_A2EA
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A2D2:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A2EA:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 13h
|
|
|
|
|
jle short loc_A2D2
|
|
|
|
|
push 1
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 14h
|
|
|
|
|
jmp short loc_A316
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A2FE:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A316:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 15h
|
|
|
|
|
jle short loc_A2FE
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 22)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 17h
|
|
|
|
|
jmp short loc_A353
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A33B:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A353:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 18h
|
|
|
|
|
jle short loc_A33B
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 25)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 26)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 0Ah
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_A4EC
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 27)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 1Eh
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 28)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 3
|
|
|
|
|
call sub_98B5
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 29)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 1Eh
|
|
|
|
|
jmp short loc_A403
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A3EB:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A403:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 1Fh
|
|
|
|
|
jle short loc_A3EB
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 20h ; ' '
|
|
|
|
|
jmp short loc_A42A
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A412:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A42A:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 24h ; '$'
|
|
|
|
|
jle short loc_A412
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 25h ; '%'
|
|
|
|
|
jmp short loc_A451
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A439:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A451:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 26h ; '&'
|
|
|
|
|
jle short loc_A439
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 39)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 2
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd05_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 28h ; '('
|
|
|
|
|
jmp short loc_A4D3
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A4BB:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A4D3:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 2Eh ; '.'
|
|
|
|
|
jle short loc_A4BB
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 47)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp loc_A869
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A4EC:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.shottype], 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_A6B6
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 48)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 49)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 50)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 51)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 1Eh
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 52)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 3
|
|
|
|
|
call sub_98B5
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 53)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 54)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 55)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 56)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 57)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
|
|
|
|
mov si, 3Ah ; ':'
|
|
|
|
|
jmp short loc_A5F9
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A5E1:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A5F9:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 3Dh ; '='
|
|
|
|
|
jle short loc_A5E1
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
|
|
|
|
mov si, 3Eh ; '>'
|
|
|
|
|
jmp short loc_A620
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A608:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A620:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 42h ; 'B'
|
|
|
|
|
jle short loc_A608
|
|
|
|
|
push 2
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd05_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 43h ; 'C'
|
|
|
|
|
jmp short loc_A68C
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A674:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A68C:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 44h ; 'D'
|
|
|
|
|
jle short loc_A674
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 69)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 70)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp loc_A869
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A6B6:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 71)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 72)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 73)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 1Eh
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 74)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 3
|
|
|
|
|
call sub_98B5
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 75)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 76)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 77)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 78)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 79)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 80)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 81)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 29h ; ')'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 82)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 83)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 2
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd05_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
call sub_98B5
|
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 54h ; 'T'
|
|
|
|
|
jmp short loc_A842
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A82A:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
inc si
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A842:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 5Bh ; '['
|
|
|
|
|
jle short loc_A82A
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 92)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 6
|
|
|
|
|
call sub_9643
|
|
|
|
|
mov byte_F02B, 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 90014Ch
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Ch ; ','
|
|
|
|
|
push ds
|
[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
|
|
|
|
push offset end_buf + (END_LINE_LEN * 93)
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A869:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
call sub_9AD4
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
retn
|
|
|
|
|
sub_A09D endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_A874 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
arg_2 = word ptr 6
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
|
|
|
|
|
enter 2, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
mov si, [bp+arg_4]
|
|
|
|
|
mov di, [bp+arg_0]
|
|
|
|
|
mov [bp+var_2], 0
|
|
|
|
|
jmp short loc_A898
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A887:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push si
|
|
|
|
|
push [bp+arg_2]
|
|
|
|
|
push di
|
2014-09-09 03:54:40 +00:00
|
|
|
|
call over_put_8
|
2014-07-02 17:43:15 +00:00
|
|
|
|
inc [bp+var_2]
|
|
|
|
|
inc di
|
|
|
|
|
add si, 10h
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A898:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp [bp+var_2], 5
|
|
|
|
|
jl short loc_A887
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn 6
|
|
|
|
|
sub_A874 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_A8A4 proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
2015-01-12 21:48:13 +00:00
|
|
|
|
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1A000C0h
|
|
|
|
|
push 27F010Fh
|
2014-08-28 03:31:57 +00:00
|
|
|
|
call grcg_boxfill
|
2014-08-27 04:52:58 +00:00
|
|
|
|
call grcg_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop bp
|
|
|
|
|
retn
|
|
|
|
|
sub_A8A4 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2015-02-28 21:37:40 +00:00
|
|
|
|
rotrect proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
|
arg_2 = word ptr 6
|
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
|
|
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
|
|
|
|
push [bp+arg_4]
|
|
|
|
|
push [bp+arg_0]
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect_animate
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 200064h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push [bp+arg_2]
|
|
|
|
|
call sub_9942
|
|
|
|
|
push 4
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 64h ; 'd'
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop bp
|
|
|
|
|
retn 6
|
2015-02-28 21:37:40 +00:00
|
|
|
|
rotrect endp
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_A8FA proc near
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
var_4 = byte ptr -4
|
|
|
|
|
|
|
|
|
|
enter 4, 0
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
push 6
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_A920
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A90C:
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1B000B8h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push si
|
|
|
|
|
call sub_A874
|
|
|
|
|
push 4
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add si, 5
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A920:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 37h ; '7'
|
|
|
|
|
jl short loc_A90C
|
|
|
|
|
push ds
|
|
|
|
|
push offset aVer1_00 ; "ver 1.00"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 210h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push 8
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov si, 0B8h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp short loc_A992
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A947:
|
2015-01-12 21:48:13 +00:00
|
|
|
|
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 210h
|
|
|
|
|
lea ax, [si+4]
|
|
|
|
|
push ax
|
|
|
|
|
push 24Fh
|
|
|
|
|
lea ax, [si+13h]
|
|
|
|
|
push ax
|
2014-08-28 03:31:57 +00:00
|
|
|
|
call grcg_boxfill
|
2014-08-27 04:52:58 +00:00
|
|
|
|
call grcg_off
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1B0h
|
|
|
|
|
push si
|
|
|
|
|
push 32h ; '2'
|
|
|
|
|
call sub_A874
|
|
|
|
|
push ds
|
|
|
|
|
push offset aVer1_00 ; "ver 1.00"
|
|
|
|
|
push 2Fh ; '/'
|
|
|
|
|
lea ax, [si+8]
|
|
|
|
|
push ax
|
|
|
|
|
push 210h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push 1
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add si, 4
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_A992:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp si, 170h
|
|
|
|
|
jl short loc_A947
|
|
|
|
|
push 9
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
mov byte_F02A, 2Fh ; '/'
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1B000C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 14h
|
|
|
|
|
push ds
|
|
|
|
|
push offset aXxcvsB@b@vrvsv ; "<22><><EFBFBD><EFBFBD><EFBFBD>^<5E>@<40>@<40>r<EFBFBD>s<EFBFBD>`<60>e<EFBFBD>e"
|
|
|
|
|
push 0Ch
|
|
|
|
|
call sub_9643
|
|
|
|
|
push 0Dh
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd06_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 4
|
|
|
|
|
push 0
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_A8A4
|
|
|
|
|
push ds
|
|
|
|
|
push offset aGvgngogigab@b@ ; "<22>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>@<40>@<40>@<40>y<EFBFBD>t<EFBFBD>m"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push 11h
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd06b_rgb ; "ed06b.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0FCh
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 15h
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 200064h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 3
|
|
|
|
|
call sub_9942
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd06c_rgb ; "ed06c.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 4
|
|
|
|
|
push 3
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd07_pi, ds
|
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 19h
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
call sub_A8A4
|
|
|
|
|
push ds
|
|
|
|
|
push offset aGogigtgbgbgnb@ ; "<22>O<EFBFBD><4F><EFBFBD>t<EFBFBD>B<EFBFBD>b<EFBFBD>N<EFBFBD>@<40>y<EFBFBD>t<EFBFBD>m"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aB@b@b@b@b@b@b@ ; "<22>@<40>@<40>@<40>@<40>@<40>@<40>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00E0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aB@b@b@b@bigibG ; "<22>@<40>@<40>@<40>@<40>i<EFBFBD>I<EFBFBD>[<5B><><EFBFBD>N<EFBFBD><4E><EFBFBD>A<EFBFBD><41><EFBFBD>j"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00F0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd07a_rgb ; "ed07a.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0FCh
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1Dh
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd07b_rgb ; "ed07b.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 8
|
|
|
|
|
push 1
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0E9h
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 21h ; '!'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 200064h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
call sub_9942
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0F8h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0E9h
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 25h ; '%'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
call sub_A8A4
|
|
|
|
|
push ds
|
|
|
|
|
push offset aVlvtvrvhvbb@b@ ; "<22>l<EFBFBD>t<EFBFBD>r<EFBFBD>h<EFBFBD>b<EFBFBD>@<40>@<40>y<EFBFBD>t<EFBFBD>m"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1B0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd07b_rgb ; "ed07b.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 8
|
|
|
|
|
push 3
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0E9h
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd08_pi, ds
|
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 29h ; ')'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0F8h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0E9h
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2Dh ; '-'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd08a_rgb ; "ed08a.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
push 1
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 31h ; '1'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
call sub_A8A4
|
|
|
|
|
push ds
|
|
|
|
|
push offset aVsvdvrvsb@vovk ; "<22>s<EFBFBD>d<EFBFBD>r<EFBFBD>s<EFBFBD>@<40>o<EFBFBD>k<EFBFBD>`<60>x<EFBFBD>d<EFBFBD>q"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aB@b@b@b@vivivs ; "<22>@<40>@<40>@<40>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00E0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aB@b@b@b@vbbVv ; "<22>@<40>@<40>@<40>@<40>b<EFBFBD>|<7C>v"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F00F8h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aB@b@Orucb@mbiS ; "<22>@<40>@ <20>R<EFBFBD>c<EFBFBD>@<40>b<EFBFBD><62><EFBFBD>Y"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F0110h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aVVSSxrivVVVV ; " <20><><EFBFBD>̑<EFBFBD><CC91>吨<EFBFBD>݂̂Ȃ<DD82><C882><EFBFBD>"
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 2F0128h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 1A0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd08b_rgb ; "ed08b.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0F4h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 35h ; '5'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
push ds
|
|
|
|
|
push offset aEd08c_rgb ; "ed08c.rgb"
|
2014-08-31 03:14:54 +00:00
|
|
|
|
call palette_entry_rgb
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0Ch
|
|
|
|
|
push 3
|
|
|
|
|
push 29h ; ')'
|
2015-02-28 21:37:40 +00:00
|
|
|
|
call rotrect
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 39h ; '9'
|
2015-03-04 01:39:36 +00:00
|
|
|
|
call _snd_delay_until_measure
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
|
|
|
|
push 4
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aEd09_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 0
|
2014-08-27 04:13:48 +00:00
|
|
|
|
call graph_copy_page
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 4
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push offset aVsvivbvovlb@vs
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 600018h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 150060h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 18h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 0C8h ; '<27>'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aB@nPiuU_ ; "<22>@<40>ŏI<C58F><49><EFBFBD>_"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 800040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0C00080h
|
2015-03-02 05:20:28 +00:00
|
|
|
|
pushd [_score]
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_95CB
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 100080h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aGrgugegbgjgeb ; "<22>R<EFBFBD><52><EFBFBD>e<EFBFBD>B<EFBFBD>j<EFBFBD><6A><EFBFBD>["
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0A00040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 10000A0h
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
mov ax, es:[bx+mikoconfig_t.continues_used]
|
2014-09-18 15:20:12 +00:00
|
|
|
|
add ax, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ax
|
|
|
|
|
push 0Fh
|
2014-09-14 15:39:30 +00:00
|
|
|
|
call graph_gaiji_putc
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1000A0h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aB@Gigugn ; "<22>@ <20><><EFBFBD><EFBFBD><EFBFBD>N"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0C00040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0D000C0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 10h
|
|
|
|
|
push ds
|
2015-03-02 05:20:28 +00:00
|
|
|
|
mov al, _rank
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cbw
|
|
|
|
|
shl ax, 3
|
2014-09-18 15:20:12 +00:00
|
|
|
|
add ax, 90h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ax
|
|
|
|
|
push 0Fh
|
2014-09-15 01:03:52 +00:00
|
|
|
|
call graph_gaiji_puts
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1000C0h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aGvgmgcgdbPik ; "<22>v<EFBFBD><76><EFBFBD>C<EFBFBD><43><EFBFBD>[<5B><><EFBFBD><EFBFBD>"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0E00040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 10000E0h
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
mov al, es:[bx+mikoconfig_t.start_lives]
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ah, 0
|
|
|
|
|
add ax, 0A1h ; '<27>'
|
|
|
|
|
push ax
|
|
|
|
|
push 0Fh
|
2014-09-14 15:39:30 +00:00
|
|
|
|
call graph_gaiji_putc
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1000E0h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aCMvpik ; " <20>쌂<EFBFBD><EC8C82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1000040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1000100h
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
mov al, es:[bx+mikoconfig_t.start_bombs]
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ah, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
add ax, 0A0h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ax
|
|
|
|
|
push 0Fh
|
2014-09-14 15:39:30 +00:00
|
|
|
|
call graph_gaiji_putc
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 100100h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 96h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
mov di, es:[bx+mikoconfig_t.skill]
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 64h ; 'd'
|
|
|
|
|
jle short loc_AEAC
|
|
|
|
|
mov di, 64h ; 'd'
|
|
|
|
|
jmp short loc_AEB2
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AEAC:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
or di, di
|
|
|
|
|
jge short loc_AEB2
|
|
|
|
|
xor di, di
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AEB2:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aVavVVSrso ; "<22><><EFBFBD>Ȃ<EFBFBD><C882>̘r<CC98>O"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1200040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
|
|
|
|
push di
|
|
|
|
|
push ss
|
|
|
|
|
lea ax, [bp+var_4]
|
|
|
|
|
push ax
|
|
|
|
|
call sub_9846
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 0C00120h
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 10h
|
|
|
|
|
push ss
|
|
|
|
|
lea ax, [bp+var_4]
|
|
|
|
|
push ax
|
|
|
|
|
push 0Fh
|
2014-09-15 01:03:52 +00:00
|
|
|
|
call graph_gaiji_puts
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 64h ; 'd'
|
|
|
|
|
jnz short loc_AEEF
|
|
|
|
|
xor si, si
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AEEF:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 5Ah ; 'Z'
|
|
|
|
|
jl short loc_AEF9
|
|
|
|
|
mov si, 1
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AEF9:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 50h ; 'P'
|
|
|
|
|
jl short loc_AF03
|
|
|
|
|
mov si, 2
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF03:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 46h ; 'F'
|
|
|
|
|
jl short loc_AF17
|
|
|
|
|
cmp di, 4Dh ; 'M'
|
|
|
|
|
jnz short loc_AF12
|
|
|
|
|
mov si, 3
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF12:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 4
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF17:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 3Ch ; '<'
|
|
|
|
|
jl short loc_AF21
|
|
|
|
|
mov si, 5
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF21:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 32h ; '2'
|
|
|
|
|
jl short loc_AF2B
|
|
|
|
|
mov si, 6
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF2B:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 28h ; '('
|
|
|
|
|
jl short loc_AF35
|
|
|
|
|
mov si, 7
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF35:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 1Eh
|
|
|
|
|
jl short loc_AF3F
|
|
|
|
|
mov si, 8
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF3F:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 14h
|
|
|
|
|
jl short loc_AF49
|
|
|
|
|
mov si, 9
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF49:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
cmp di, 0Ah
|
|
|
|
|
jl short loc_AF53
|
|
|
|
|
mov si, 0Ah
|
|
|
|
|
jmp short loc_AF56
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF53:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov si, 0Bh
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_AF56:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
mov ax, si
|
2017-01-05 22:54:17 +00:00
|
|
|
|
imul ax, END_LINE_LEN
|
|
|
|
|
add ax, offset end_buf
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push ax
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 12000F0h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 60120h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 78h ; 'x'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 180120h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 0C0h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
|
|
|
|
push 0C8h ; '<27>'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aVpvxvxvvb@vyvt ; "<22>P<EFBFBD>X<EFBFBD>X<EFBFBD>V<EFBFBD>@<40>y<EFBFBD>t<EFBFBD>m (Amusement Makers)"
|
|
|
|
|
mov al, byte_F02A
|
|
|
|
|
cbw
|
|
|
|
|
push ax
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 1600040h
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _graph_putsa_fx
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 0Ah
|
2014-11-19 11:09:22 +00:00
|
|
|
|
push 120160h
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 40h
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_97F1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
add sp, 6
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _key_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 5
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2014-10-07 04:32:20 +00:00
|
|
|
|
nopcall sub_AFE7
|
2014-08-27 04:03:08 +00:00
|
|
|
|
call graph_clear
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
leave
|
|
|
|
|
retn
|
|
|
|
|
sub_A8FA endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_AFE7 proc far
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
2015-03-02 05:20:28 +00:00
|
|
|
|
call score_extra_unlocked
|
2014-07-02 17:43:15 +00:00
|
|
|
|
or ax, ax
|
|
|
|
|
jz loc_B07D
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.continues_used], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_B07D
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aAll_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 96h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aBut_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _key_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 5
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B07D:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop bp
|
|
|
|
|
retf
|
|
|
|
|
sub_AFE7 endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
sub_B07F proc far
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
2015-03-02 05:20:28 +00:00
|
|
|
|
call score_extra_unlocked
|
2014-07-02 17:43:15 +00:00
|
|
|
|
or ax, ax
|
|
|
|
|
jz loc_B115
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aAll_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 2
|
2014-08-26 22:21:45 +00:00
|
|
|
|
call palette_black_in
|
2014-09-18 15:20:12 +00:00
|
|
|
|
push 96h
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_load c, 0, offset aExtra_pi, ds
|
|
|
|
|
call _pi_slot_palette_apply stdcall, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop cx
|
2015-02-21 13:12:22 +00:00
|
|
|
|
call _pi_slot_put c, 0, large 0
|
2014-11-18 16:56:13 +00:00
|
|
|
|
freePISlotLarge 0
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _key_delay
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 5
|
2014-08-26 22:33:43 +00:00
|
|
|
|
call palette_black_out
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B115:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop bp
|
|
|
|
|
retf
|
|
|
|
|
sub_B07F endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
|
|
|
|
; int __cdecl main(int _argc, const char **_argv, const char **_envp)
|
2015-02-19 06:46:36 +00:00
|
|
|
|
public _main
|
2014-08-10 01:44:54 +00:00
|
|
|
|
_main proc far
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
_argc = word ptr 6
|
|
|
|
|
_argv = dword ptr 8
|
|
|
|
|
_envp = dword ptr 0Ch
|
|
|
|
|
|
|
|
|
|
push bp
|
|
|
|
|
mov bp, sp
|
2015-03-03 06:40:29 +00:00
|
|
|
|
call cfg_load
|
2014-07-02 17:43:15 +00:00
|
|
|
|
or ax, ax
|
|
|
|
|
jz loc_B1FE
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.stage], 7Fh
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz loc_B1FE
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _game_init_main
|
2014-08-31 08:23:41 +00:00
|
|
|
|
call gaiji_backup
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aMikoft_bft ; "MIKOFT.bft"
|
2014-08-31 08:08:09 +00:00
|
|
|
|
call gaiji_entry_bfnt
|
2015-02-23 10:47:22 +00:00
|
|
|
|
call _snd_pmd_resident
|
|
|
|
|
call _snd_mmd_resident
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.bgm_mode], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_B161
|
2015-02-23 10:47:22 +00:00
|
|
|
|
mov _snd_midi_active, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp short loc_B189
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B161:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.bgm_mode], 1
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_B173
|
2015-02-23 10:47:22 +00:00
|
|
|
|
mov _snd_midi_active, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jmp short loc_B184
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B173:
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.bgm_mode], 2
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jnz short loc_B189
|
2015-02-23 10:47:22 +00:00
|
|
|
|
mov al, _snd_midi_possible
|
|
|
|
|
mov _snd_midi_active, al
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B184:
|
2015-02-23 10:47:22 +00:00
|
|
|
|
call _snd_determine_mode
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B189:
|
2018-12-29 19:08:52 +00:00
|
|
|
|
graph_accesspage 0
|
2014-09-18 15:20:12 +00:00
|
|
|
|
mov dx, 0A4h
|
|
|
|
|
out dx, al
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset aEndft_bft ; "endft.bft"
|
2014-08-23 16:07:02 +00:00
|
|
|
|
call super_entry_bfnt
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push 64h ; 'd'
|
2014-11-23 21:25:22 +00:00
|
|
|
|
call frame_delay
|
2015-03-02 05:20:28 +00:00
|
|
|
|
les bx, _mikoconfig
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.rank], 4
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jz short loc_B1C2
|
2015-02-23 22:45:30 +00:00
|
|
|
|
cmp es:[bx+mikoconfig_t.continues_used], 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
jz short loc_B1BA
|
|
|
|
|
call sub_9B64
|
|
|
|
|
jmp short loc_B1BD
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B1BA:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_A09D
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B1BD:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
call sub_A8FA
|
|
|
|
|
jmp short loc_B1C6
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B1C2:
|
2014-10-07 04:32:20 +00:00
|
|
|
|
call sub_B07F
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B1C6:
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 32h ; '2'
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2015-03-02 05:20:28 +00:00
|
|
|
|
call score_enter
|
2014-08-23 13:47:05 +00:00
|
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
|
call far ptr palette_show
|
2014-08-31 08:23:41 +00:00
|
|
|
|
call gaiji_restore
|
2015-03-14 22:25:50 +00:00
|
|
|
|
call _game_exit
|
2014-11-19 11:09:22 +00:00
|
|
|
|
pushd 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
push ds
|
|
|
|
|
push offset path ; "op"
|
|
|
|
|
push ds
|
|
|
|
|
push offset path ; "op"
|
|
|
|
|
call _execl
|
|
|
|
|
add sp, 0Ch
|
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
|
loc_B1FE:
|
2014-07-02 17:43:15 +00:00
|
|
|
|
pop bp
|
|
|
|
|
retf
|
|
|
|
|
_main endp
|
|
|
|
|
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_01_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_02_TEXT segment word public 'CODE' use16
|
2015-03-14 22:25:50 +00:00
|
|
|
|
extern _graph_putsa_fx:proc
|
|
|
|
|
extern _key_delay:proc
|
|
|
|
|
extern _vram_planes_set:proc
|
|
|
|
|
extern _pi_slot_load:proc
|
|
|
|
|
extern FRAME_DELAY:proc
|
|
|
|
|
extern _input_sense:proc
|
|
|
|
|
extern _game_exit:proc
|
|
|
|
|
extern _snd_mmd_resident:proc
|
|
|
|
|
extern _snd_determine_mode:proc
|
|
|
|
|
extern _snd_pmd_resident:proc
|
|
|
|
|
extern _snd_load:proc
|
|
|
|
|
extern _game_init_main:proc
|
2015-03-04 03:28:16 +00:00
|
|
|
|
extern _pi_slot_palette_apply:proc
|
|
|
|
|
extern _pi_slot_put:proc
|
2015-03-15 22:26:44 +00:00
|
|
|
|
extern _snd_kaja_interrupt:proc
|
2015-03-04 01:39:36 +00:00
|
|
|
|
extern _snd_delay_until_measure:proc
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_02_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_03_TEXT segment byte public 'CODE' use16
|
2015-03-03 06:40:29 +00:00
|
|
|
|
extern CFG_LOAD:proc
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_03_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_04_TEXT segment byte public 'CODE' use16
|
2015-03-02 05:20:28 +00:00
|
|
|
|
extern SCORE_EXTRA_UNLOCKED:proc
|
|
|
|
|
extern SCORE_ENTER:proc
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_04_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_05_TEXT segment byte public 'CODE' use16
|
2015-02-28 21:37:40 +00:00
|
|
|
|
extern EGC_START_COPY:proc
|
|
|
|
|
extern ROTRECT_ANIMATE:proc
|
2015-02-21 11:47:24 +00:00
|
|
|
|
maine_05_TEXT ends
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2015-02-18 11:07:37 +00:00
|
|
|
|
.data
|
2014-08-19 20:33:43 +00:00
|
|
|
|
|
2014-09-13 10:24:35 +00:00
|
|
|
|
include th02/strings/ranks_center[data].asm
|
[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
|
|
|
|
unk_D030 db 50h dup(0)
|
|
|
|
|
label byte_D080 byte
|
|
|
|
|
db 0AAh, 0AAh, 55h, 55h, 0AAh, 0AAh, 55h, 55h
|
|
|
|
|
db 0AAh, 0AAh, 55h, 55h, 0AAh, 0AAh, 55h, 55h
|
|
|
|
|
db 0AAh, 0AAh, 55h, 55h, 0AAh, 0AAh, 55h, 55h
|
|
|
|
|
db 0AAh, 0AAh, 55h, 55h, 0AAh, 0AAh, 55h, 55h
|
|
|
|
|
db 33h, 33h, 33h, 33h, 0CCh, 0CCh, 0CCh, 0CCh
|
|
|
|
|
db 33h, 33h, 33h, 33h, 0CCh, 0CCh, 0CCh, 0CCh
|
|
|
|
|
db 33h, 33h, 33h, 33h, 0CCh, 0CCh, 0CCh, 0CCh
|
|
|
|
|
db 33h, 33h, 33h, 33h, 0CCh, 0CCh, 0CCh, 0CCh
|
|
|
|
|
db 0CCh, 0CCh, 0CCh, 0CCh, 33h, 33h, 33h, 33h
|
|
|
|
|
db 0CCh, 0CCh, 0CCh, 0CCh, 33h, 33h, 33h, 33h
|
|
|
|
|
db 0CCh, 0CCh, 0CCh, 0CCh, 33h, 33h, 33h, 33h
|
|
|
|
|
db 0CCh, 0CCh, 0CCh, 0CCh, 33h, 33h, 33h, 33h
|
|
|
|
|
aEnd3_txt db 'end3.txt',0
|
2014-08-10 01:44:54 +00:00
|
|
|
|
aEnding_m db 'ending.m',0
|
|
|
|
|
aEnd1_txt db 'end1.txt',0
|
|
|
|
|
aEnd1_m db 'end1.m',0
|
|
|
|
|
aEd01_pi db 'ed01.pi',0
|
|
|
|
|
aEd02_pi db 'ed02.pi',0
|
|
|
|
|
aEnd2_txt db 'end2.txt',0
|
|
|
|
|
aEd03_pi db 'ed03.pi',0
|
|
|
|
|
aEd03a_rgb db 'ed03a.rgb',0
|
|
|
|
|
aEd04_pi db 'ed04.pi',0
|
|
|
|
|
aEd05_pi db 'ed05.pi',0
|
|
|
|
|
aVer1_00 db 'ver 1.00',0
|
|
|
|
|
aXxcvsB@b@vrvsv db '<27><><EFBFBD><EFBFBD><EFBFBD>^<5E>@<40>@<40>r<EFBFBD>s<EFBFBD>`<60>e<EFBFBD>e',0
|
|
|
|
|
aEd06_pi db 'ed06.pi',0
|
|
|
|
|
aGvgngogigab@b@ db '<27>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>@<40>@<40>@<40>y<EFBFBD>t<EFBFBD>m',0
|
|
|
|
|
aEd06b_rgb db 'ed06b.rgb',0
|
|
|
|
|
aEd06c_rgb db 'ed06c.rgb',0
|
|
|
|
|
aEd07_pi db 'ed07.pi',0
|
|
|
|
|
aGogigtgbgbgnb@ db '<27>O<EFBFBD><4F><EFBFBD>t<EFBFBD>B<EFBFBD>b<EFBFBD>N<EFBFBD>@<40>y<EFBFBD>t<EFBFBD>m',0
|
|
|
|
|
aB@b@b@b@b@b@b@ db '<27>@<40>@<40>@<40>@<40>@<40>@<40>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
|
|
|
|
aB@b@b@b@bigibG db '<27>@<40>@<40>@<40>@<40>i<EFBFBD>I<EFBFBD>[<5B><><EFBFBD>N<EFBFBD><4E><EFBFBD>A<EFBFBD><41><EFBFBD>j',0
|
|
|
|
|
aEd07a_rgb db 'ed07a.rgb',0
|
|
|
|
|
aEd07b_rgb db 'ed07b.rgb',0
|
|
|
|
|
aVlvtvrvhvbb@b@ db '<27>l<EFBFBD>t<EFBFBD>r<EFBFBD>h<EFBFBD>b<EFBFBD>@<40>@<40>y<EFBFBD>t<EFBFBD>m',0
|
|
|
|
|
aEd08_pi db 'ed08.pi',0
|
|
|
|
|
aEd08a_rgb db 'ed08a.rgb',0
|
|
|
|
|
aVsvdvrvsb@vovk db '<27>s<EFBFBD>d<EFBFBD>r<EFBFBD>s<EFBFBD>@<40>o<EFBFBD>k<EFBFBD>`<60>x<EFBFBD>d<EFBFBD>q',0
|
|
|
|
|
aB@b@b@b@vivivs db '<27>@<40>@<40>@<40>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
|
|
|
|
aB@b@b@b@vbbVv db '<27>@<40>@<40>@<40>@<40>b<EFBFBD>|<7C>v',0
|
|
|
|
|
aB@b@Orucb@mbiS db '<27>@<40>@ <20>R<EFBFBD>c<EFBFBD>@<40>b<EFBFBD><62><EFBFBD>Y',0
|
|
|
|
|
aVVSSxrivVVVV db ' <20><><EFBFBD>̑<EFBFBD><CC91>吨<EFBFBD>݂̂Ȃ<DD82><C882><EFBFBD>',0
|
|
|
|
|
aEd08b_rgb db 'ed08b.rgb',0
|
|
|
|
|
aEd08c_rgb db 'ed08c.rgb',0
|
|
|
|
|
aEd09_pi db 'ED09.pi',0
|
|
|
|
|
aVsvivbvovlb@vs db '<27>s<EFBFBD><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
|
|
|
|
aB@nPiuU_ db '<27>@<40>ŏI<C58F><49><EFBFBD>_',0
|
|
|
|
|
aGrgugegbgjgeb db '<27>R<EFBFBD><52><EFBFBD>e<EFBFBD>B<EFBFBD>j<EFBFBD><6A><EFBFBD>[',0
|
|
|
|
|
aB@Gigugn db '<27>@ <20><><EFBFBD><EFBFBD><EFBFBD>N',0
|
|
|
|
|
aGvgmgcgdbPik db '<27>v<EFBFBD><76><EFBFBD>C<EFBFBD><43><EFBFBD>[<5B><><EFBFBD><EFBFBD>',0
|
|
|
|
|
aCMvpik db ' <20>쌂<EFBFBD><EC8C82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
|
|
|
|
aVavVVSrso db '<27><><EFBFBD>Ȃ<EFBFBD><C882>̘r<CC98>O',0
|
|
|
|
|
aVpvxvxvvb@vyvt db '<27>P<EFBFBD>X<EFBFBD>X<EFBFBD>V<EFBFBD>@<40>y<EFBFBD>t<EFBFBD>m (Amusement Makers)',0
|
|
|
|
|
aAll_pi db 'all.pi',0
|
|
|
|
|
aBut_pi db 'but.pi',0
|
|
|
|
|
aExtra_pi db 'extra.pi',0
|
|
|
|
|
aMikoft_bft db 'MIKOFT.bft',0
|
|
|
|
|
aEndft_bft db 'endft.bft',0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
; char path[]
|
2014-08-10 01:44:54 +00:00
|
|
|
|
path db 'op',0
|
2014-08-23 10:08:48 +00:00
|
|
|
|
include libs/master.lib/bfnt_id[data].asm
|
2014-08-27 20:57:18 +00:00
|
|
|
|
include libs/master.lib/clip[data].asm
|
2014-08-27 22:05:06 +00:00
|
|
|
|
include libs/master.lib/edges[data].asm
|
2014-08-30 05:49:51 +00:00
|
|
|
|
include libs/master.lib/fil[data].asm
|
2014-08-21 20:07:58 +00:00
|
|
|
|
include libs/master.lib/dos_ropen[data].asm
|
2014-08-31 08:23:41 +00:00
|
|
|
|
include libs/master.lib/gaiji_backup[data].asm
|
2014-08-31 08:08:09 +00:00
|
|
|
|
include libs/master.lib/gaiji_entry_bfnt[data].asm
|
2014-08-27 03:42:48 +00:00
|
|
|
|
include libs/master.lib/grp[data].asm
|
2014-08-23 13:47:05 +00:00
|
|
|
|
include libs/master.lib/pal[data].asm
|
2014-08-27 00:40:09 +00:00
|
|
|
|
include libs/master.lib/pf[data].asm
|
2014-08-28 05:54:38 +00:00
|
|
|
|
include libs/master.lib/sin8[data].asm
|
2014-08-15 12:26:44 +00:00
|
|
|
|
include libs/master.lib/tx[data].asm
|
2014-09-16 02:11:09 +00:00
|
|
|
|
include libs/master.lib/version[data].asm
|
2014-08-26 20:52:26 +00:00
|
|
|
|
include libs/master.lib/vs[data].asm
|
2014-08-21 20:53:12 +00:00
|
|
|
|
include libs/master.lib/mem[data].asm
|
2014-08-23 16:07:02 +00:00
|
|
|
|
include libs/master.lib/super_entry_bfnt[data].asm
|
2014-08-22 20:31:44 +00:00
|
|
|
|
include libs/master.lib/superpa[data].asm
|
2015-03-14 22:25:50 +00:00
|
|
|
|
public _key_delay_groups
|
|
|
|
|
_key_delay_groups db 5, 3, 0
|
2014-07-02 17:43:15 +00:00
|
|
|
|
db 0
|
2014-11-17 03:54:40 +00:00
|
|
|
|
include th02/formats/pfopen[data].asm
|
2015-03-03 06:40:29 +00:00
|
|
|
|
extern _rank:byte
|
2014-08-17 21:55:59 +00:00
|
|
|
|
|
2015-02-18 11:07:37 +00:00
|
|
|
|
.data?
|
|
|
|
|
|
[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_buf db 100 dup(END_LINE_LEN dup(?))
|
2014-08-10 01:44:54 +00:00
|
|
|
|
byte_F02A db ?
|
|
|
|
|
byte_F02B db ?
|
[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
|
|
|
|
include libs/master.lib/clip[bss].asm
|
2014-08-30 05:49:51 +00:00
|
|
|
|
include libs/master.lib/fil[bss].asm
|
2014-08-23 13:47:05 +00:00
|
|
|
|
include libs/master.lib/pal[bss].asm
|
2014-08-26 20:52:26 +00:00
|
|
|
|
include libs/master.lib/vs[bss].asm
|
2014-08-26 21:58:08 +00:00
|
|
|
|
include libs/master.lib/vsync[bss].asm
|
2014-08-21 20:53:12 +00:00
|
|
|
|
include libs/master.lib/mem[bss].asm
|
2014-08-22 20:31:44 +00:00
|
|
|
|
include libs/master.lib/superpa[bss].asm
|
[Reverse-engineering] 32-bit VRAM plane pointers
I've looked at every openly available piece of PC-98 documentation, and there
don't seem to be any official names for the individual planes. The closest
thing I could find was the description at
http://island.geocities.jp/cklouch/column/pc98bas/pc98disphw2.htm
explaining that they represent the blue, red, green, and brightness component
when using the default PC-98 palette. However, these planes correspond to
nothing else but the 4 individual bits of the final index into the color
palette, and you can assign any color to every single palette slot. Therefore,
it's merely a convention that your own palettes don't have to follow (and in
Touhou, they don't).
Nevertheless, there doesn't seem to be an alternative, and the Neko Project II
source code uses the same B/R/G/E convention, so I'll go with that as well.
2015-02-10 22:43:34 +00:00
|
|
|
|
include th01/hardware/vram_planes[bss].asm
|
2014-11-18 16:56:13 +00:00
|
|
|
|
include th02/formats/pi_slots[bss].asm
|
2014-11-16 03:00:41 +00:00
|
|
|
|
include libs/master.lib/pfint21[bss].asm
|
2015-02-22 21:33:07 +00:00
|
|
|
|
include th02/hardware/input_sense[bss].asm
|
2015-03-15 21:54:15 +00:00
|
|
|
|
include th02/snd/snd[bss].asm
|
|
|
|
|
include th02/snd/load[bss].asm
|
2015-03-03 06:40:29 +00:00
|
|
|
|
extern _mikoconfig:dword
|
|
|
|
|
extern _score:dword
|
2014-07-02 17:43:15 +00:00
|
|
|
|
|
2015-02-19 06:46:36 +00:00
|
|
|
|
end
|