[Reverse-engineering] [th04/th05] Stage display in the High Score menu

Part of P0064, funded by Touhou Patch Center.
This commit is contained in:
nmlgc 2019-12-29 17:47:23 +01:00
parent d3c24b5438
commit 9e8fa66a7a
5 changed files with 60 additions and 113 deletions

View File

@ -7,4 +7,5 @@ include th03/gaiji/bar.inc
include th02/gaiji/boldfont.inc
gs_DOT = 0C4h
gs_ALL = 0E9h
g_HISCORE_EMPTY = 0EFh
g_HISCORE_STAGE_EMPTY = 0EFh
g_NONE = 0FFh

1
th04/hiscore/hiscore.h Normal file
View File

@ -0,0 +1 @@
void pascal near score_stage_put(int x, int y, unsigned int g_stage);

View File

@ -0,0 +1,47 @@
public HISCORE_STAGE_PUT
hiscore_stage_put proc near
@@g_stage = word ptr 4
@@y = word ptr 6
@@x = word ptr 8
push bp
mov bp, sp
push si
push di
mov si, [bp+@@x]
mov di, [bp+@@y]
cmp [bp+@@g_stage], g_NONE
jz short @@put_empty
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push [bp+@@g_stage]
push 14
call graph_gaiji_putc
push si
push di
push [bp+@@g_stage]
jmp short @@put_main
; ---------------------------------------------------------------------------
@@put_empty:
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push (g_HISCORE_STAGE_EMPTY shl 16) or 14
call graph_gaiji_putc
push si
push di
push g_HISCORE_STAGE_EMPTY
@@put_main:
push 7
call graph_gaiji_putc
pop di
pop si
pop bp
retn 6
hiscore_stage_put endp

View File

@ -2304,58 +2304,7 @@ loc_C899:
retn 4
sub_C79E endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_C8A5 proc near
@@gaiji = word ptr 4
@@y = word ptr 6
@@x = word ptr 8
push bp
mov bp, sp
push si
push di
mov si, [bp+@@x]
mov di, [bp+@@y]
cmp [bp+@@gaiji], 0FFh
jz short loc_C8D0
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push [bp+@@gaiji]
push 14
call graph_gaiji_putc
push si
push di
push [bp+@@gaiji]
jmp short loc_C8E8
; ---------------------------------------------------------------------------
loc_C8D0:
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push (g_HISCORE_EMPTY shl 16) or 14
call graph_gaiji_putc
push si
push di
push g_HISCORE_EMPTY
loc_C8E8:
push 7
call graph_gaiji_putc
pop di
pop si
pop bp
retn 6
sub_C8A5 endp
include th04/hiscore/hiscore_stage_put.asm
; =============== S U B R O U T I N E =======================================
@ -2410,12 +2359,12 @@ arg_0 = word ptr 4
call graph_gaiji_puts
push 600000h
call sub_C79E
push 1240060h
push (292 shl 16) or 96
mov al, _hi_reimu.score.g_stage[si]
mov ah, 0
push ax
call sub_C8A5
push 2580060h
call hiscore_stage_put
push (600 shl 16) or 96
jmp loc_CA0A
; ---------------------------------------------------------------------------
@ -2469,20 +2418,20 @@ loc_C989:
push di
push si
call sub_C79E
push 124h
push 292
push di
mov al, _hi_reimu.score.g_stage[si]
mov ah, 0
push ax
call sub_C8A5
push 258h
call hiscore_stage_put
push 600
push di
loc_CA0A:
mov al, _hi_marisa.score.g_stage[si]
mov ah, 0
push ax
call sub_C8A5
call hiscore_stage_put
pop di
pop si
pop bp

View File

@ -2751,58 +2751,7 @@ loc_CAA4:
retn 6
sub_CA1B endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_CAB0 proc near
@@gaiji = word ptr 4
@@y = word ptr 6
@@x = word ptr 8
push bp
mov bp, sp
push si
push di
mov si, [bp+@@x]
mov di, [bp+@@y]
cmp [bp+@@gaiji], 0FFh
jz short loc_CADB
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push [bp+@@gaiji]
push 14
call graph_gaiji_putc
push si
push di
push [bp+@@gaiji]
jmp short loc_CAF3
; ---------------------------------------------------------------------------
loc_CADB:
lea ax, [si+2]
push ax
lea ax, [di+2]
push ax
push (g_HISCORE_EMPTY shl 16) or 14
call graph_gaiji_putc
push si
push di
push g_HISCORE_EMPTY
loc_CAF3:
push 7
call graph_gaiji_putc
pop di
pop si
pop bp
retn 6
sub_CAB0 endp
include th04/hiscore/hiscore_stage_put.asm
; =============== S U B R O U T I N E =======================================
@ -2930,7 +2879,7 @@ loc_CB74:
mov al, _hi.score.g_stage[bx]
mov ah, 0
push ax
call sub_CAB0
call hiscore_stage_put
pop di
pop si
leave