-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
th04_op.asm
856 lines (763 loc) · 17.5 KB
/
th04_op.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2009 by Hex-Rays, <[email protected]> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : 492DA6ACEE8714C252630BCE0D3C12FD
; File Name : th04/OP.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-133E0h Loaded length: 11A40h
; Entry Point : 0:0
; OS type : MS DOS
; Application type: Executable 16bit
.386
.model use16 large _TEXT
BINARY = 'O'
include ReC98.inc
include th04/th04.inc
include th04/sprites/op_cdg.inc
op_01 group OP_SETUP_TEXT, op_01_TEXT
; ===========================================================================
_TEXT segment word public 'CODE' use16
extern PALETTE_BLACK_IN:proc
extern PALETTE_BLACK_OUT:proc
extern FILE_CLOSE:proc
extern FILE_CREATE:proc
extern FILE_EXIST:proc
extern FILE_READ:proc
extern FILE_ROPEN:proc
extern FILE_SEEK:proc
extern FILE_WRITE:proc
extern GRCG_BYTEBOXFILL_X:proc
extern GRCG_SETCOLOR:proc
extern GRAPH_CLEAR:proc
extern GRAPH_COPY_PAGE:proc
extern GRAPH_PI_FREE:proc
extern PALETTE_SHOW:proc
extern IRAND:proc
extern SUPER_FREE:proc
extern SUPER_ENTRY_BFNT:proc
extern SUPER_PUT_RECT:proc
extern SUPER_PUT:proc
extern GRAPH_GAIJI_PUTS:proc
extern GRAPH_GAIJI_PUTC:proc
_TEXT ends
; ===========================================================================
; Segment type: Pure code
OP_SETUP_TEXT segment byte public 'CODE' use16
assume cs:op_01
;org 0Ch
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
include th04/zunsoft.asm
OP_SETUP_TEXT ends
op_01_TEXT segment byte public 'CODE' use16
include th04/formats/scoredat_decode_both.asm
include th04/formats/scoredat_encode.asm
include th04/formats/scoredat_recreate.asm
include th04/formats/scoredat_load_both.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_C79E proc near
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = word ptr 4
arg_2 = word ptr 6
enter 4, 0
push si
push di
mov di, [bp+arg_2]
mov si, [bp+arg_0]
mov [bp+var_4], 16
mov bx, si
shl bx, 3
mov al, _hi_reimu.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
cmp ax, 10
jl short loc_C7E0
push 140
push di
mov bx, si
shl bx, 3
mov al, _hi_reimu.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
mov bx, 10
cwd
idiv bx
push ax
call super_put
loc_C7E0:
mov bx, si
shl bx, 3
mov al, _hi_marisa.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
cmp ax, 10
jl short loc_C811
push 448
push di
mov bx, si
shl bx, 3
mov al, _hi_marisa.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
mov bx, 10
cwd
idiv bx
push ax
call super_put
loc_C811:
push 156
push di
mov bx, si
shl bx, 3
mov al, _hi_reimu.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
mov bx, 10
cwd
idiv bx
push dx
call super_put
push 464
push di
mov bx, si
shl bx, 3
mov al, _hi_marisa.score.g_score[bx][SCORE_DIGITS - 1]
mov ah, 0
add ax, -gb_0_
mov bx, 10
cwd
idiv bx
push dx
call super_put
mov [bp+var_2], 6
jmp short loc_C899
; ---------------------------------------------------------------------------
loc_C854:
mov ax, [bp+var_4]
add ax, 156
push ax
push di
mov bx, si
shl bx, 3
add bx, [bp+var_2]
mov al, _hi_reimu.score.g_score[bx]
mov ah, 0
add ax, -gb_0_
push ax
call super_put
mov ax, [bp+var_4]
add ax, 464
push ax
push di
mov bx, si
shl bx, 3
add bx, [bp+var_2]
mov al, _hi_marisa.score.g_score[bx]
mov ah, 0
add ax, -gb_0_
push ax
call super_put
dec [bp+var_2]
add [bp+var_4], 16
loc_C899:
cmp [bp+var_2], 0
jge short loc_C854
pop di
pop si
leave
retn 4
sub_C79E endp
include th04/hiscore/hiscore_stage_put.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_C8F5 proc near
arg_0 = word ptr 4
push bp
mov bp, sp
push si
push di
mov si, [bp+arg_0]
or si, si
jnz loc_C989
push (10 shl 16) or 98
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_reimu.score.g_name
push ds
push ax
push 14
call graph_gaiji_puts
push (8 shl 16) or 96
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_reimu.score.g_name
push ds
push ax
push 7
call graph_gaiji_puts
push (322 shl 16) or 98
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_marisa.score.g_name
push ds
push ax
push 14
call graph_gaiji_puts
push (320 shl 16) or 96
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_marisa.score.g_name
push ds
push ax
push 7
call graph_gaiji_puts
push 600000h
call sub_C79E
push (292 shl 16) or 96
mov al, _hi_reimu.score.g_stage[si]
mov ah, 0
push ax
call hiscore_stage_put
push (600 shl 16) or 96
; Hack (jmp loc_CA0A)
; No idea why TASM can't assemble this properly after
; dropdown() was decompiled.
db 0E9h, 81h, 00h
; ---------------------------------------------------------------------------
loc_C989:
mov ax, si
shl ax, 4
add ax, 112
mov di, ax
push 10
add ax, 2
push ax
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_reimu.score.g_name
push ds
push ax
push 14
call graph_gaiji_puts
push 8
push di
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_reimu.score.g_name
push ds
push ax
push 2
call graph_gaiji_puts
push 322
lea ax, [di+2]
push ax
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_marisa.score.g_name
push ds
push ax
push 14
call graph_gaiji_puts
push 320
push di
push GAIJI_W
mov ax, si
imul ax, (SCOREDAT_NAME_LEN + 1)
add ax, offset _hi_marisa.score.g_name
push ds
push ax
push 2
call graph_gaiji_puts
push di
push si
call sub_C79E
push 292
push di
mov al, _hi_reimu.score.g_stage[si]
mov ah, 0
push ax
call hiscore_stage_put
push 600
push di
loc_CA0A:
mov al, _hi_marisa.score.g_stage[si]
mov ah, 0
push ax
call hiscore_stage_put
pop di
pop si
pop bp
retn 2
sub_C8F5 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public _score_render
_score_render proc near
push bp
mov bp, sp
push si
graph_accesspage 1
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
graph_accesspage 0
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
push 0
call sub_C8F5
mov si, 1
jmp short loc_CA5B
; ---------------------------------------------------------------------------
loc_CA56:
push si
call sub_C8F5
inc si
loc_CA5B:
cmp si, 9
jl short loc_CA56
push 9
call sub_C8F5
push (496 shl 16) or 376
mov al, _rank
mov ah, 0
add ax, ax
add ax, 10
push ax
call super_put
push (560 shl 16) or 376
mov al, _rank
mov ah, 0
add ax, ax
add ax, 11
push ax
call super_put
pop si
pop bp
retn
_score_render endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @regist_view_menu$qv
@regist_view_menu$qv proc near
push bp
mov bp, sp
kajacall KAJA_SONG_STOP
call snd_load pascal, ds, offset aName, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
kajacall KAJA_SONG_FADE, -128
push 1
call palette_black_out
les bx, _resident
assume es:nothing
mov al, es:[bx+resident_t.rank]
mov _rank, al
call _scoredat_load_both
call @pi_load$qinxc pascal, 0, ds, offset aHi01_pi
loc_CADA:
call _score_render
push 1
call palette_black_in
loc_CAE4:
call @input_reset_sense$qv
call @frame_delay$qi pascal, 1
test _key_det.hi, high INPUT_OK
jnz short loc_CB58
test _key_det.lo, low INPUT_SHOT
jnz short loc_CB58
test _key_det.hi, high INPUT_CANCEL
jnz short loc_CB58
test _key_det.hi, high INPUT_OK
jnz short loc_CB58
test _key_det.lo, low INPUT_LEFT
jz short loc_CB36
cmp _rank, RANK_EASY
jz short loc_CB36
dec _rank
mov PaletteTone, 0
call far ptr palette_show
call _scoredat_load_both
call _score_render
push 1
call palette_black_in
loc_CB36:
test _key_det.lo, low INPUT_RIGHT
jz short loc_CAE4
cmp _rank, RANK_EXTRA
jnb short loc_CAE4
inc _rank
mov PaletteTone, 0
call far ptr palette_show
call _scoredat_load_both
jmp short loc_CADA
; ---------------------------------------------------------------------------
loc_CB58:
kajacall KAJA_SONG_FADE, 1
push 1
call palette_black_out
freePISlotLarge 0
graph_accesspage 1
call @pi_load$qinxc pascal, 0, ds, offset aOp1_pi_0
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
freePISlotLarge 0
call graph_copy_page pascal, 0
push 1
call palette_black_in
loc_CBB3:
call @input_reset_sense$qv
call @frame_delay$qi pascal, 1
cmp _key_det, INPUT_NONE
jnz short loc_CBB3
kajacall KAJA_SONG_STOP
call snd_load pascal, ds, offset aOp_0, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
pop bp
retn
@regist_view_menu$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @cleardata_and_regist_view_sprite$qv
@cleardata_and_regist_view_sprite$qv proc near
push bp
mov bp, sp
mov _rank, RANK_EASY
jmp loc_CC6F
; ---------------------------------------------------------------------------
loc_CBEE:
call _scoredat_load_both
or al, al
jnz loc_CC78
mov al, _rank
mov ah, 0
mov dl, _hi_reimu.score.cleared
mov bx, ax
mov _cleared_with_reimu[bx], dl
mov al, _rank
mov ah, 0
mov dl, _hi_marisa.score.cleared
mov bx, ax
mov _cleared_with_marisa[bx], dl
mov al, _rank
mov ah, 0
mov bx, ax
cmp _cleared_with_reimu[bx], SCOREDAT_CLEARED_BOTH
jbe short loc_CC2F
mov al, _rank
mov ah, 0
mov bx, ax
mov _cleared_with_reimu[bx], 0
loc_CC2F:
mov al, _rank
mov ah, 0
mov bx, ax
cmp _cleared_with_marisa[bx], SCOREDAT_CLEARED_BOTH
jbe short loc_CC49
mov al, _rank
mov ah, 0
mov bx, ax
mov _cleared_with_marisa[bx], 0
loc_CC49:
cmp _rank, RANK_EASY
jz short loc_CC6B
mov al, _rank
mov ah, 0
mov bx, ax
mov al, _cleared_with_reimu[bx]
mov dl, _rank
mov dh, 0
mov bx, dx
or al, _cleared_with_marisa[bx]
or _extra_unlocked, al
loc_CC6B:
inc _rank
loc_CC6F:
cmp _rank, RANK_COUNT
jb loc_CBEE
loc_CC78:
les bx, _resident
mov al, es:[bx+resident_t.rank]
mov _rank, al
call super_entry_bfnt pascal, ds, offset aScnum_bft ; "scnum.bft"
call super_entry_bfnt pascal, ds, offset aHi_m_bft ; "hi_m.bft"
pop bp
retn
@cleardata_and_regist_view_sprite$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @main_cdg_load$qv
@main_cdg_load$qv proc near
push bp
mov bp, sp
call cdg_load_all pascal, CDG_NUMERAL, ds, offset aSft1_cd2
call cdg_load_all pascal, CDG_MAIN, ds, offset aSft2_cd2
call cdg_load_all pascal, CDG_CURSOR, ds, offset aCar_cd2
call cdg_load_all_noalpha pascal, 40, ds, offset aSl_cd2
pop bp
retn
@main_cdg_load$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @main_cdg_free$qv
@main_cdg_free$qv proc near
push bp
mov bp, sp
call cdg_free_all
pop bp
retn
@main_cdg_free$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @op_animate$qv
@op_animate$qv proc near
@@page = byte ptr -4
var_3 = byte ptr -3
@@component = word ptr -2
enter 4, 0
push si
push di
mov PaletteTone, 0
call far ptr palette_show
graph_accesspage 1
call grcg_setcolor pascal, (GC_RMW shl 16) + V_WHITE
call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1)
GRCG_OFF_CLOBBERING dx
call graph_copy_page pascal, 0
call @pi_load$qinxc pascal, 0, ds, offset aOp5b_pi
call @pi_load$qinxc pascal, 1, ds, offset aOp4b_pi
call @pi_load$qinxc pascal, 2, ds, offset aOp3b_pi
call @pi_load$qinxc pascal, 3, ds, offset aOp2b_pi
call @pi_load$qinxc pascal, 4, ds, offset aOp1b_pi
call @pi_load$qinxc pascal, 5, ds, offset aOp0b_pi
call @pi_palette_apply$qi pascal, 0
push 4
call palette_black_in
graph_showpage 0
graph_accesspage 1
xor si, si
mov [bp+var_3], 0
mov di, 100
mov [bp+@@page], 0
jmp short loc_CDC4
; ---------------------------------------------------------------------------
loc_CD7A:
mov ax, si
mov bx, 4
cwd
idiv bx
or dx, dx
jnz short loc_CDB0
cmp [bp+var_3], 6
jnb short loc_CDB0
pushd 38
mov al, [bp+var_3]
mov ah, 0
push ax
call @pi_put_8$qiii
inc [bp+var_3]
graph_accesspage [bp+@@page]
mov al, 1
sub al, [bp+@@page]
mov [bp+@@page], al
graph_showpage al
loc_CDB0:
mov PaletteTone, di
call far ptr palette_show
add di, 2
call @frame_delay$qi pascal, 1
inc si
loc_CDC4:
cmp si, 1Ch
jl short loc_CD7A
mov PaletteTone, 200
call far ptr palette_show
graph_showpage 0
graph_accesspage al
freePISlotLarge 0
freePISlotLarge 1
freePISlotLarge 2
freePISlotLarge 3
freePISlotLarge 4
freePISlotLarge 5
les bx, _resident
cmp es:[bx+resident_t.demo_num], 0
jnz short loc_CE50
call snd_load pascal, ds, offset aOp_1, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
loc_CE50:
graph_accesspage 1
call @pi_load$qinxc pascal, 0, ds, offset aOp1_pi_1
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
freePISlotLarge 0
call graph_copy_page pascal, 0
xor si, si
jmp short loc_CEAA
; ---------------------------------------------------------------------------
loc_CE8B:
mov bx, si
imul bx, size rgb_t
mov Palettes[bx].r, 255
mov bx, si
imul bx, size rgb_t
mov Palettes[bx].g, 255
mov bx, si
imul bx, size rgb_t
mov Palettes[bx].b, 255
inc si
loc_CEAA:
cmp si, COLOR_COUNT
jl short loc_CE8B
call far ptr palette_show
mov PaletteTone, 100
call far ptr palette_show
xor si, si
mov [bp+var_3], 240
jmp short loc_CEE8
; ---------------------------------------------------------------------------
loc_CEC7:
mov al, [bp+var_3]
mov Palettes[0 * size rgb_t].r, al
mov Palettes[0 * size rgb_t].g, al
mov Palettes[0 * size rgb_t].b, al
call far ptr palette_show
call @frame_delay$qi pascal, 1
inc si
mov al, [bp+var_3]
add al, -16
mov [bp+var_3], al
loc_CEE8:
cmp si, 15
jl short loc_CEC7
xor si, si
mov [bp+var_3], 252
jmp short loc_CF4E
; ---------------------------------------------------------------------------
loc_CEF5:
mov di, 1
jmp short loc_CF34
; ---------------------------------------------------------------------------
loc_CEFA:
mov [bp+@@component], 0
jmp short loc_CF2D
; ---------------------------------------------------------------------------
loc_CF01:
mov bx, di
imul bx, size rgb_t
add bx, [bp+@@component]
mov al, _pi_headers._palette[bx]
mov bx, di
imul bx, size rgb_t
add bx, [bp+@@component]
cmp al, Palettes[bx].r
jnb short loc_CF2A
mov bx, di
imul bx, size rgb_t
add bx, [bp+@@component]
mov al, [bp+var_3]
mov Palettes[bx].r, al
loc_CF2A:
inc [bp+@@component]
loc_CF2D:
cmp [bp+@@component], size rgb_t
jl short loc_CF01
inc di
loc_CF34:
cmp di, COLOR_COUNT
jl short loc_CEFA
call far ptr palette_show
call @frame_delay$qi pascal, 1
inc si
mov al, [bp+var_3]
add al, -4
mov [bp+var_3], al
loc_CF4E:
cmp si, 63
jl short loc_CEF5
call @pi_palette_apply$qi pascal, 0
pop di
pop si
leave
retn
@op_animate$qv endp
_playchar_menu procdesc near
op_01_TEXT ends
; ===========================================================================
SHARED segment byte public 'CODE' use16
include th02/snd/snd.inc
extern @FRAME_DELAY$QI:proc
extern @PI_PALETTE_APPLY$QI:proc
extern @PI_PUT_8$QIII:proc
extern @PI_LOAD$QINXC:proc
extern @POLAR$QIII:proc
extern SND_KAJA_INTERRUPT:proc
extern SND_DELAY_UNTIL_MEASURE:proc
extern SND_LOAD:proc
extern @input_reset_sense$qv:proc
extern @input_sense$qv:proc
extern SND_SE_PLAY:proc
extern _snd_se_update:proc
extern _bgimage_snap:proc
extern _bgimage_put:proc
extern _bgimage_free:proc
extern CDG_LOAD_ALL_NOALPHA:proc
extern CDG_LOAD_ALL:proc
extern CDG_FREE_ALL:proc
SHARED ends
.data
; libs/master.lib/pal[data].asm
extern PaletteTone:word
; libs/master.lib/sin8[data].asm
extern _SinTable8:word:256
extern _CosTable8:word:256
include th04/zunsoft[data].asm
aGensou_scr db 'GENSOU.SCR',0
aName db 'name',0
aHi01_pi db 'hi01.pi',0
aOp1_pi_0 db 'op1.pi',0
aOp_0 db 'op',0
aScnum_bft db 'scnum.bft',0
aHi_m_bft db 'hi_m.bft',0
db 0
aSft1_cd2 db 'sft1.cd2',0
aSft2_cd2 db 'sft2.cd2',0
aCar_cd2 db 'car.cd2',0
aSl_cd2 db 'sl.cd2',0
aOp5b_pi db 'op5b.pi',0
aOp4b_pi db 'op4b.pi',0
aOp3b_pi db 'op3b.pi',0
aOp2b_pi db 'op2b.pi',0
aOp1b_pi db 'op1b.pi',0
aOp0b_pi db 'op0b.pi',0
aOp_1 db 'op',0
aOp1_pi_1 db 'op1.pi',0
.data?
extern _resident:dword
; libs/master.lib/pal[bss].asm
extern Palettes:byte:48
; libs/master.lib/vs[bss].asm
extern vsync_Count1:word
; th02/formats/pi_slots[bss].asm
extern _pi_buffers:dword
extern _pi_headers:PiHeader
; th02/hardware/input_sense[bss].asm
extern _key_det:word
include th04/zunsoft[bss].asm
include th04/formats/scoredat_op[bss].asm
_rank db ?
public _cleared_with, _extra_unlocked
_cleared_with label byte
_cleared_with_reimu db RANK_COUNT dup (?)
_cleared_with_marisa db RANK_COUNT dup (?)
_extra_unlocked db ?
db 49 dup(?)
end