-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
th04_maine.asm
3058 lines (2698 loc) · 62.7 KB
/
th04_maine.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
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2009 by Hex-Rays, <[email protected]> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : 50C37C4BDDEC04B753524F5D3B030A96
; File Name : th04/MAINE.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-126D0h Loaded length: 10062h
; Entry Point : 0:0
; OS type : MS DOS
; Application type: Executable 16bit
.386
.model use16 large _TEXT
BINARY = 'E'
include ReC98.inc
include th04/th04.inc
include th04/hardware/grppsafx.inc
extern _tolower:proc
extern __ctype:byte
group_01 group maine_01_TEXT
; ===========================================================================
; Segment type: Pure code
_TEXT segment word public 'CODE' use16
extern PALETTE_BLACK_IN:proc
extern PALETTE_BLACK_OUT:proc
extern EGC_OFF:proc
extern FILE_APPEND: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_SETCOLOR:proc
extern GAIJI_PUTCA:proc
extern GAIJI_PUTSA:proc
extern GRAPH_COPY_PAGE:proc
extern GRAPH_PI_FREE:proc
extern PALETTE_SHOW:proc
extern IRAND:proc
extern TEXT_CLEAR:proc
extern SUPER_FREE:proc
extern SUPER_ENTRY_BFNT:proc
extern SUPER_PUT:proc
extern GRAPH_GAIJI_PUTS:proc
extern GRAPH_GAIJI_PUTC:proc
_TEXT ends
; ===========================================================================
maine_01_TEXT segment byte public 'CODE' use16
assume cs:group_01
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_AED0 proc near
var_2 = word ptr -2
arg_0 = word ptr 4
@@top = word ptr 6
@@left = word ptr 8
enter 2, 0
push si
push di
mov si, [bp+arg_0]
or si, si
jnz short loc_AEF1
push [bp+@@left]
push [bp+@@top]
mov al, _cdg_slot
mov ah, 0
push ax
call cdg_put_8
jmp loc_B027
; ---------------------------------------------------------------------------
loc_AEF1:
call grcg_setcolor pascal, (GC_RMW shl 16) + V_WHITE
mov bx, 4
mov ax, si
cwd
idiv bx
mov si, ax
push [bp+@@left]
push ax
mov al, _radial_angle
mov ah, 0
add ax, ax
mov bx, ax
push _CosTable8[bx]
call @polar$qiii
mov di, ax
push [bp+@@top]
push si
mov al, _radial_angle
mov ah, 0
add ax, ax
mov bx, ax
push _SinTable8[bx]
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 0
call cdg_put_plane
mov al, _radial_angle
add al, 40h
mov _radial_angle, al
push [bp+@@left]
push si
mov ah, 0
add ax, ax
mov bx, ax
push _CosTable8[bx]
call @polar$qiii
mov di, ax
push [bp+@@top]
push si
mov al, _radial_angle
mov ah, 0
add ax, ax
mov bx, ax
push _SinTable8[bx]
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 1
call cdg_put_plane
mov al, _radial_angle
add al, 40h
mov _radial_angle, al
push [bp+@@left]
push si
mov ah, 0
add ax, ax
mov bx, ax
push _CosTable8[bx]
call @polar$qiii
mov di, ax
push [bp+@@top]
push si
mov al, _radial_angle
mov ah, 0
add ax, ax
mov bx, ax
push _SinTable8[bx]
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 2
call cdg_put_plane
mov al, _radial_angle
add al, 40h
mov _radial_angle, al
push [bp+@@left]
push si
mov ah, 0
add ax, ax
mov bx, ax
push _CosTable8[bx]
call @polar$qiii
mov di, ax
push [bp+@@top]
push si
mov al, _radial_angle
mov ah, 0
add ax, ax
mov bx, ax
push _SinTable8[bx]
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 3
call cdg_put_plane
mov al, _radial_angle
add al, 40h
mov _radial_angle, al
GRCG_OFF_CLOBBERING dx
loc_B027:
pop di
pop si
leave
retn 6
sub_AED0 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B02D proc near
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_0]
or si, si
jnz short loc_B04E
push [bp+arg_4]
push [bp+arg_2]
mov al, _cdg_slot
mov ah, 0
push ax
call cdg_put_8
jmp loc_B13E
; ---------------------------------------------------------------------------
loc_B04E:
call grcg_setcolor pascal, (GC_RMW shl 16) + V_WHITE
mov ax, si
cwd
sub ax, dx
sar ax, 1
mov si, ax
push [bp+arg_4]
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+192
call @polar$qiii
mov di, ax
push [bp+arg_2]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+64
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 0
call cdg_put_plane
call @polar$qiii pascal, [bp+arg_4], si, _CosTable8+128
mov di, ax
call @polar$qiii pascal, [bp+arg_2], si, _CosTable8
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 1
call cdg_put_plane
push [bp+arg_4]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+448
call @polar$qiii
mov di, ax
push [bp+arg_2]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+320
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 2
call cdg_put_plane
call @polar$qiii pascal, [bp+arg_4], si, _CosTable8+384
mov di, ax
call @polar$qiii pascal, [bp+arg_2], si, _CosTable8+256
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 3
call cdg_put_plane
GRCG_OFF_CLOBBERING dx
loc_B13E:
pop di
pop si
leave
retn 6
sub_B02D endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B144 proc near
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_0]
or si, si
jnz short loc_B165
push [bp+arg_4]
push [bp+arg_2]
mov al, _cdg_slot
mov ah, 0
push ax
call cdg_put_8
jmp loc_B255
; ---------------------------------------------------------------------------
loc_B165:
call grcg_setcolor pascal, (GC_RMW shl 16) + V_WHITE
mov ax, si
cwd
sub ax, dx
sar ax, 1
mov si, ax
push [bp+arg_4]
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8
call @polar$qiii
mov di, ax
push [bp+arg_2]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _SinTable8
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 0
call cdg_put_plane
call @polar$qiii pascal, [bp+arg_4], si, _CosTable8
mov di, ax
call @polar$qiii pascal, [bp+arg_2], si, _SinTable8
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 1
call cdg_put_plane
push [bp+arg_4]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+256
call @polar$qiii
mov di, ax
push [bp+arg_2]
mov ax, si
cwd
sub ax, dx
sar ax, 1
push ax
push _CosTable8+128
call @polar$qiii
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 2
call cdg_put_plane
call @polar$qiii pascal, [bp+arg_4], si, _CosTable8+256
mov di, ax
call @polar$qiii pascal, [bp+arg_2], si, _CosTable8+128
mov [bp+var_2], ax
push di
push ax
mov al, _cdg_slot
mov ah, 0
inc ax
push ax
push 3
call cdg_put_plane
GRCG_OFF_CLOBBERING dx
loc_B255:
pop di
pop si
leave
retn 6
sub_B144 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B25B proc near
arg_0 = word ptr 4
arg_2 = word ptr 6
arg_4 = word ptr 8
arg_6 = word ptr 0Ah
arg_8 = word ptr 0Ch
push bp
mov bp, sp
push si
mov si, [bp+arg_0]
mov ax, si
cwd
sub ax, dx
sar ax, 1
mov si, ax
mov ax, [bp+arg_8]
sub ax, si
push ax
mov ax, [bp+arg_6]
sub ax, si
push ax
mov ax, si
add ax, ax
add ax, [bp+arg_4]
push ax
mov ax, si
add ax, ax
add ax, [bp+arg_2]
push ax
call bgimage_put_rect_16
pop si
pop bp
retn 0Ah
sub_B25B endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B291 proc near
@@page = word ptr -2
@@base_top = word ptr 4
@@base_left = word ptr 6
enter 2, 0
push si
push di
mov di, [bp+@@base_left]
mov si, 3Fh ; '?'
mov [bp+@@page], 0
graph_accesspage 0
mov dx, 164 ; Port 00A4h: Page display register
mov al, 1
jmp short loc_B30B
; ---------------------------------------------------------------------------
loc_B2AF:
push di
push [bp+@@base_top]
mov al, _cdg_slot
mov ah, 0
shl ax, 4
mov bx, ax
push _cdg_slots.pixel_w[bx]
mov al, _cdg_slot
mov ah, 0
shl ax, 4
mov bx, ax
push _cdg_slots.pixel_h[bx]
lea ax, [si+1]
push ax
call sub_B25B
dec si
mov al, _radial_angle
add al, 8
mov _radial_angle, al
call _dissolve_put_func pascal, di, [bp+@@base_top], si
loc_B2E8:
cmp vsync_Count1, 2
jb short loc_B2E8
mov vsync_Count1, 0
graph_showpage byte ptr [bp+@@page]
mov ax, 1
sub ax, [bp+@@page]
mov [bp+@@page], ax
mov dx, 166 ; Port 00A6h: Page access register
mov al, byte ptr [bp+@@page]
loc_B30B:
out dx, al
or si, si
jg short loc_B2AF
call graph_copy_page pascal, [bp+@@page]
pop di
pop si
leave
retn 4
sub_B291 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B31E proc near
@@page = word ptr -2
@@base_top = word ptr 4
@@base_left = word ptr 6
enter 2, 0
push si
push di
mov di, [bp+@@base_left]
xor si, si
mov [bp+@@page], 0
graph_accesspage 0
mov dx, 164 ; Port 00A4h: Page display register
mov al, 1
loc_B339:
out dx, al
push di
push [bp+@@base_top]
mov al, _cdg_slot
mov ah, 0
shl ax, 4
mov bx, ax
push _cdg_slots.pixel_w[bx]
mov al, _cdg_slot
mov ah, 0
shl ax, 4
mov bx, ax
push _cdg_slots.pixel_h[bx]
push si
call sub_B25B
inc si
mov al, _radial_angle
add al, 8
mov _radial_angle, al
cmp si, 40h
jge short loc_B39A
call _dissolve_put_func pascal, di, [bp+@@base_top], si
loc_B375:
cmp vsync_Count1, 2
jb short loc_B375
mov vsync_Count1, 0
graph_showpage byte ptr [bp+@@page]
mov ax, 1
sub ax, [bp+@@page]
mov [bp+@@page], ax
mov dx, 166 ; Port 00A6h: Page access register
mov al, byte ptr [bp+@@page]
jmp short loc_B339
; ---------------------------------------------------------------------------
loc_B39A:
mov ax, 1
sub ax, [bp+@@page]
call graph_copy_page pascal, ax
pop di
pop si
leave
retn 4
sub_B31E endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B3AC proc near
@@page = word ptr -2
@@base_top_2 = word ptr 4
@@base_left_2 = word ptr 6
@@base_top_1 = word ptr 8
@@base_left_1 = word ptr 0Ah
enter 2, 0
push si
push di
mov di, [bp+@@base_left_1]
xor si, si
mov [bp+@@page], 0
graph_accesspage 0
mov dx, 164 ; Port 00A4h: Page display register
mov al, 1
loc_B3C7:
out dx, al
push di
push [bp+@@base_top_1]
push _cdg_slots.pixel_w + (size cdg_t * 2)
push _cdg_slots.pixel_h + (size cdg_t * 2)
push si
call sub_B25B
push [bp+@@base_left_2]
push [bp+@@base_top_2]
push _cdg_slots.pixel_w + (size cdg_t * 0)
push _cdg_slots.pixel_h + (size cdg_t * 0)
push si
call sub_B25B
inc si
mov al, _radial_angle
add al, -8
mov _radial_angle, al
cmp si, 40h
jge short loc_B43B
mov _cdg_slot, 2
call _dissolve_put_func pascal, di, [bp+@@base_top_1], si
mov _cdg_slot, 0
call _dissolve_put_func pascal, [bp+@@base_left_2], [bp+@@base_top_2], si
loc_B416:
cmp vsync_Count1, 2
jb short loc_B416
mov vsync_Count1, 0
graph_showpage byte ptr [bp+@@page]
mov ax, 1
sub ax, [bp+@@page]
mov [bp+@@page], ax
mov dx, 166 ; Port 00A6h: Page access register
mov al, byte ptr [bp+@@page]
jmp short loc_B3C7
; ---------------------------------------------------------------------------
loc_B43B:
mov ax, 1
sub ax, [bp+@@page]
call graph_copy_page pascal, ax
pop di
pop si
leave
retn 8
sub_B3AC endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @staffroll_animate$qv
@staffroll_animate$qv proc near
push bp
mov bp, sp
mov PaletteTone, 0
call far ptr palette_show
graph_accesspage 1
call @pi_load$qinxc pascal, 0, ds, offset aSff1_pi
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
freePISlotLarge 0
call graph_copy_page pascal, 0
call _bgimage_snap
kajacall KAJA_SONG_STOP
call snd_load pascal, ds, offset aStaff, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
push 0Ch
call palette_black_in
call cdg_load_single pascal, 0, ds, offset aSff1_cdg, 0
call cdg_load_single_noalpha pascal, 1, ds, offset aSff1b_cdg, 0
call snd_delay_until_measure pascal, (3 shl 16) or 64
mov _cdg_slot, 0
mov _dissolve_put_func, offset sub_AED0
call sub_B291 pascal, (352 shl 16) or 160
call cdg_load_single pascal, 2, ds, offset aSff2_cdg, 0
call cdg_load_single_noalpha pascal, 3, ds, offset aSff2b_cdg, 0
call snd_delay_until_measure pascal, (7 shl 16) or 160
mov _dissolve_put_func, offset sub_B02D
call sub_B31E pascal, (352 shl 16) or 160
mov _cdg_slot, 2
mov _dissolve_put_func, offset sub_B144
call sub_B291 pascal, (192 shl 16) or 128
graph_accesspage 0
mov _cdg_slot, 0
call cdg_load_single pascal, 0, ds, offset aSff3_cdg, 0
call cdg_load_single_noalpha pascal, 1, ds, offset aSff3b_cdg, 0
call snd_delay_until_measure pascal, (11 shl 16) or 160
call sub_B291 pascal, (288 shl 16) or 200
call snd_delay_until_measure pascal, (19 shl 16) or 160
mov _dissolve_put_func, offset sub_B02D
call sub_B3AC pascal, (192 shl 16) or 128, (288 shl 16) or 200
push 4
call palette_black_out
call cdg_free_all
graph_accesspage 1
call @pi_load$qinxc pascal, 0, ds, offset aSff2_pi
call @pi_palette_apply$qi pascal, 0
call @pi_put_8$qiii pascal, large 0, 0
freePISlotLarge 0
call graph_copy_page pascal, 0
call _bgimage_snap
push 4
call palette_black_in
call cdg_load_single pascal, 2, ds, offset aSff4_cdg, 0
call cdg_load_single_noalpha pascal, 3, ds, offset aSff4b_cdg, 0
call snd_delay_until_measure pascal, (23 shl 16) or 160
mov _cdg_slot, 2
mov _dissolve_put_func, offset sub_B144
call sub_B291 pascal, (32 shl 16) or 112
call cdg_free pascal, 2
call cdg_load_single pascal, 4, ds, offset aSff5_cdg, 0
call cdg_load_single_noalpha pascal, 5, ds, offset aSff5b_cdg, 0
call snd_delay_until_measure pascal, (27 shl 16) or 160
mov _cdg_slot, 4
mov _dissolve_put_func, offset sub_B02D
call sub_B291 pascal, (32 shl 16) or 184
call cdg_load_single pascal, 0, ds, offset aSff8_cdg, 0
call cdg_load_single_noalpha pascal, 1, ds, offset aSff8b_cdg, 0
call snd_delay_until_measure pascal, (31 shl 16) or 160
mov _dissolve_put_func, offset sub_B144
call sub_B31E pascal, (32 shl 16) or 184
mov _cdg_slot, 0
call sub_B291 pascal, (64 shl 16) or 184
call cdg_load_single pascal, 4, ds, offset aSff9_cdg, 0
call cdg_load_single_noalpha pascal, 5, ds, offset aSff9b_cdg, 0
call snd_delay_until_measure pascal, (35 shl 16) or 160
mov _dissolve_put_func, offset sub_AED0
call sub_B31E pascal, (64 shl 16) or 184
mov _cdg_slot, 4
call sub_B291 pascal, (64 shl 16) or 184
call cdg_load_single pascal, 0, ds, offset aSff6_cdg, 0
call cdg_load_single_noalpha pascal, 1, ds, offset aSff6b_cdg, 0
call snd_delay_until_measure pascal, (39 shl 16) or 160
mov _dissolve_put_func, offset sub_B02D
call sub_B31E pascal, (64 shl 16) or 184
mov _cdg_slot, 0
call sub_B291 pascal, (32 shl 16) or 184
call snd_delay_until_measure pascal, (43 shl 16) or 160
mov _dissolve_put_func, offset sub_B144
call sub_B3AC pascal, (32 shl 16) or 112, (32 shl 16) or 184
call cdg_load_single pascal, 0, ds, offset aSff7_cdg, 0
call cdg_load_single_noalpha pascal, 1, ds, offset aSff7b_cdg, 0
mov _cdg_slot, 0
call sub_B291 pascal, (32 shl 16) or 336
call snd_delay_until_measure pascal, (48 shl 16) or 160
call _bgimage_free
call cdg_free_all
push 4
call palette_black_out
pop bp
retn
@staffroll_animate$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @GRAPH_3_DIGIT_PUT$QIIU
@graph_3_digit_put$qiiu proc near
@@digit = word ptr -6
@@g_str = byte ptr -4
@@val = word ptr 4
@@top = word ptr 6
@@left = word ptr 8
enter 6, 0
push si
xor si, si
mov [bp+@@g_str], g_EMPTY
mov ax, [bp+@@val]
mov bx, 100
xor dx, dx
div bx
mov [bp+@@digit], ax
mov ax, [bp+@@val]
xor dx, dx
div bx
mov [bp+@@val], dx
cmp _graph_3_digit_put_as_fixed_2_dig, 0
jnz short loc_B7C5
or si, [bp+@@digit]
or si, si
jz short loc_B7C1
mov al, byte ptr [bp+@@digit]
add al, gb_0_
mov [bp+@@g_str], al
jmp short loc_B7C5
; ---------------------------------------------------------------------------
loc_B7C1:
mov [bp+@@g_str], g_EMPTY
loc_B7C5:
mov ax, [bp+@@val]
mov bx, 10
xor dx, dx
div bx
mov [bp+@@digit], ax
mov ax, [bp+@@val]
xor dx, dx
div bx
mov [bp+@@val], dx
or si, [bp+@@digit]
mov al, _graph_3_digit_put_as_fixed_2_dig
mov ah, 0
or si, ax
or si, si
jz short loc_B7F4
mov al, byte ptr [bp+@@digit]
add al, gb_0_
mov [bp+@@g_str+1], al
jmp short loc_B7F8
; ---------------------------------------------------------------------------
loc_B7F4:
mov [bp+@@g_str+1], g_EMPTY
loc_B7F8:
mov al, byte ptr [bp+@@val]
add al, gb_0_
mov [bp+@@g_str+2], al
mov [bp+@@g_str+3], 0
push [bp+@@left]
push [bp+@@top]
push GAIJI_W
push ss
lea ax, [bp+@@g_str]
push ax
push 14
call graph_gaiji_puts
pop si
leave
retn 6
@graph_3_digit_put$qiiu endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B81D proc near
@@g_str = byte ptr -0Ch
var_2 = byte ptr -2
var_1 = byte ptr -1
enter 0Ch, 0
push si
mov [bp+var_2], 0
xor si, si
jmp short loc_B851
; ---------------------------------------------------------------------------
loc_B82A:
mov ax, 7
sub ax, si
les bx, _resident
add bx, ax
mov al, es:[bx+resident_t.score_last]
mov [bp+var_1], al
or [bp+var_2], al
cmp [bp+var_2], 0
jz short loc_B84C
add al, gb_0_
mov [bp+si+@@g_str], al
jmp short loc_B850
; ---------------------------------------------------------------------------
loc_B84C:
mov [bp+si+@@g_str], g_EMPTY
loc_B850:
inc si
loc_B851:
cmp si, 8
jl short loc_B82A
mov [bp+@@g_str+8], 0
push (160 shl 16) or 96
push GAIJI_W
push ss
lea ax, [bp+@@g_str]
push ax
push 14
call graph_gaiji_puts
mov [bp+var_2], 1
call graph_putsa_fx pascal, (288 shl 16) or 96, 14, ds, offset aU_ ; "点"
pop si
leave
retn
sub_B81D endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
public @SKILL_APPLY_AND_GRAPH_PERCENTAGE$QIIUIUI
@skill_apply_and_graph_percentage$qiiuiui proc near
@@fraction = dword ptr -6
@@digits = word ptr -2
@@share = word ptr 4
@@total = word ptr 6
@@top = word ptr 8
@@left = word ptr 0Ah
enter 6, 0
push si
push di
mov si, [bp+@@left]
mov di, [bp+@@top]
cmp [bp+@@total], 0
jz short loc_B8A2
mov [bp+@@fraction], 1000000
jmp short loc_B8AA
; ---------------------------------------------------------------------------
loc_B8A2:
mov [bp+@@fraction], 0
loc_B8AA:
mov ax, [bp+@@total]
cmp ax, [bp+@@share]
jz short loc_B8E3
cmp [bp+@@total], 0
jz short loc_B8CD
movzx ebx, [bp+@@total]
mov eax, [bp+@@fraction]
xor edx, edx
div ebx
mov [bp+@@fraction], eax
jmp short loc_B8D5
; ---------------------------------------------------------------------------
loc_B8CD:
mov [bp+@@fraction], 0
loc_B8D5:
movzx eax, [bp+@@share]
imul eax, [bp+@@fraction]
mov [bp+@@fraction], eax