Skip to content

Commit

Permalink
[Reverse-engineering] [th03] Demo frame counter
Browse files Browse the repository at this point in the history
My dumb parser identified this as a reference to the PI header slots,
which is why it's here now!

Completes P0060, funded by Touhou Patch Center.
  • Loading branch information
nmlgc committed Nov 28, 2019
1 parent 5bffab4 commit 73f5ae7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions th03/demo.h
@@ -0,0 +1,4 @@
// Not in mem.h because it doesn't define a file size in TH03
#define DEMO_N 7000 /* ZUN symbol [MAGNet2010] */

extern unsigned int demo_frame;
4 changes: 4 additions & 0 deletions th03/demo[bss].asm
@@ -0,0 +1,4 @@
DEMO_N = 7000 ; ZUN symbol [MAGNet2010]

public _demo_frame
_demo_frame dw ?
10 changes: 5 additions & 5 deletions th03_main.asm
Expand Up @@ -554,14 +554,14 @@ sub_9778 endp
sub_9AD6 proc near
push bp
mov bp, sp
cmp word_1E6E6, 1B58h
cmp _demo_frame, DEMO_N
jnb short loc_9AE7
inc word_1E6E6
inc _demo_frame
jmp short loc_9AF5
; ---------------------------------------------------------------------------

loc_9AE7:
cmp word_1E6E6, 1B58h
cmp _demo_frame, DEMO_N
jnz short loc_9AF5
mov fp_1FBC0, offset sub_B4A8

Expand Down Expand Up @@ -771,7 +771,7 @@ loc_9C93:
; ---------------------------------------------------------------------------

loc_9CAB:
mov word_1E6E6, 0
mov _demo_frame, 0
mov fp_1E6EA, offset sub_9AD6
mov byte_23AF8, 40h
mov byte_23E3C, 0
Expand Down Expand Up @@ -36897,7 +36897,7 @@ byte_1E14C db 0
.data?

_input_mode_func dd ?
word_1E6E6 dw ?
include th03/demo[bss].asm
word_1E6E8 dw ?
fp_1E6EA dw ?
include libs/master.lib/clip[bss].asm
Expand Down

0 comments on commit 73f5ae7

Please sign in to comment.