forked from nmlgc/ReC98
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathth05_op.asm
7317 lines (6476 loc) · 142 KB
/
th05_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
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 : F97D1B72F01476639E9D33E361F57330
; File Name : th05/OP.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-14240h Loaded length: 1280Ah
; Entry Point : 0:0
; OS type : MS DOS
; Application type: Executable 16bit
.286 ; Force the .model directive to create 16-bit default segments...
.model large
__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.
include ReC98.inc
include th05/th05.asm
include th05/music/music.inc
extern SCOPY@:proc
extern _execl:proc
extern _getch:proc
extern _strlen:proc
; ===========================================================================
; Segment type: Pure code
_TEXT segment word public 'CODE' use16
assume cs:_TEXT
assume es:nothing, ds:_DATA, fs:nothing, gs:nothing
include libs/master.lib/bfnt_entry_pat.asm
include libs/master.lib/bfnt_header_read.asm
include libs/master.lib/bfnt_header_analysis.asm
include libs/master.lib/atrtcmod.asm
include libs/master.lib/bcloser.asm
include libs/master.lib/bfill.asm
include libs/master.lib/bfnt_palette_set.asm
include libs/master.lib/bgetc.asm
include libs/master.lib/palette_black_in.asm
include libs/master.lib/palette_black_out.asm
include libs/master.lib/bopenr.asm
include libs/master.lib/bread.asm
include libs/master.lib/bseek.asm
include libs/master.lib/bseek_.asm
include libs/master.lib/dos_axdx.asm
include libs/master.lib/dos_keyclear.asm
include libs/master.lib/dos_puts2.asm
include libs/master.lib/dos_read.asm
include libs/master.lib/dos_seek.asm
include libs/master.lib/dos_setvect.asm
include libs/master.lib/egc.asm
include libs/master.lib/file_append.asm
include libs/master.lib/file_close.asm
include libs/master.lib/file_create.asm
include libs/master.lib/file_exist.asm
include libs/master.lib/file_read.asm
include libs/master.lib/file_ropen.asm
include libs/master.lib/file_seek.asm
include libs/master.lib/file_write.asm
include libs/master.lib/dos_close.asm
include libs/master.lib/dos_ropen.asm
include libs/master.lib/grcg_byteboxfill_x.asm
include libs/master.lib/grcg_hline.asm
include libs/master.lib/grcg_polygon_c.asm
include libs/master.lib/grcg_setcolor.asm
include libs/master.lib/grcg_vline.asm
include libs/master.lib/get_machine_98.asm
include libs/master.lib/get_machine_at.asm
include libs/master.lib/get_machine_dosbox.asm
include libs/master.lib/check_machine_fmr.asm
include libs/master.lib/get_machine.asm
include libs/master.lib/graph_400line.asm
include libs/master.lib/graph_clear.asm
include libs/master.lib/graph_copy_page.asm
include libs/master.lib/graph_extmode.asm
include libs/master.lib/graph_pi_free.asm
include libs/master.lib/graph_pi_load_pack.asm
include libs/master.lib/graph_show.asm
include libs/master.lib/graph_start.asm
include libs/master.lib/js_end.asm
include libs/master.lib/keybeep.asm
include libs/master.lib/make_linework.asm
include libs/master.lib/palette_init.asm
include libs/master.lib/palette_show.asm
include libs/master.lib/pfclose.asm
include libs/master.lib/pfgetc.asm
include libs/master.lib/pfread.asm
include libs/master.lib/pfrewind.asm
include libs/master.lib/pfseek.asm
include libs/master.lib/random.asm
include libs/master.lib/rottbl.asm
include libs/master.lib/smem_release.asm
include libs/master.lib/smem_wget.asm
include libs/master.lib/soundio.asm
include libs/master.lib/text_clear.asm
include libs/master.lib/txesc.asm
include libs/master.lib/vsync.asm
include libs/master.lib/vsync_wait.asm
include libs/master.lib/hmem_lallocate.asm
include libs/master.lib/mem_assign_dos.asm
include libs/master.lib/mem_assign.asm
include libs/master.lib/memheap.asm
include libs/master.lib/mem_unassign.asm
include libs/master.lib/super_free.asm
include libs/master.lib/super_entry_pat.asm
include libs/master.lib/super_entry_at.asm
include libs/master.lib/super_entry_bfnt.asm
include libs/master.lib/super_cancel_pat.asm
include libs/master.lib/super_put_rect.asm
include libs/master.lib/super_put.asm
include libs/master.lib/respal_exist.asm
include libs/master.lib/respal_free.asm
include libs/master.lib/js_start.asm
include libs/master.lib/draw_trapezoid.asm
include libs/master.lib/js_sense.asm
include libs/master.lib/bgm_bell_org.asm
include libs/master.lib/bgm_mget.asm
include libs/master.lib/bgm_read_sdata.asm
include libs/master.lib/bgm_timer.asm
include libs/master.lib/bgm_pinit.asm
include libs/master.lib/bgm_timerhook.asm
include libs/master.lib/bgm_play.asm
include libs/master.lib/bgm_sound.asm
include libs/master.lib/bgm_effect_sound.asm
include libs/master.lib/bgm_stop_play.asm
include libs/master.lib/bgm_set_tempo.asm
include libs/master.lib/bgm_init_finish.asm
include libs/master.lib/bgm_stop_sound.asm
include libs/master.lib/graph_pack_put_8_noclip.asm
include libs/master.lib/graph_gaiji_puts.asm
include libs/master.lib/graph_gaiji_putc.asm
include libs/master.lib/pfint21.asm
db 0
include th03/formats/pfopen.asm
include libs/master.lib/pf_str_ieq.asm
_TEXT ends
; ===========================================================================
; Segment type: Pure code
op_01_TEXT segment byte public 'CODE' use16
assume cs:op_01_TEXT
; org 0Ch
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_A39C proc near
push bp
mov bp, sp
push si
push di
les bx, _ksoconfig
mov byte ptr es:[bx+1Ah], 0
mov byte ptr es:[bx+1Fh], 0
mov byte ptr es:[bx+13h], 0
mov al, es:[bx+0Fh]
mov es:[bx+0Dh], al
mov al, es:[bx+10h]
mov es:[bx+0Eh], al
call sub_D12D
or ax, ax
jnz short loc_A443
xor si, si
jmp short loc_A400
; ---------------------------------------------------------------------------
loc_A3CF:
les bx, _ksoconfig
add bx, si
mov byte ptr es:[bx+20h], 0
mov bx, word ptr _ksoconfig
add bx, si
mov byte ptr es:[bx+44h], 0
xor di, di
jmp short loc_A3FA
; ---------------------------------------------------------------------------
loc_A3E9:
mov ax, di
shl ax, 3
les bx, _ksoconfig
add bx, ax
mov byte ptr es:[bx+si+4Ch], 0
inc di
loc_A3FA:
cmp di, 6
jl short loc_A3E9
inc si
loc_A400:
cmp si, 8
jl short loc_A3CF
call sub_BC83
call sub_BB0E
kajacall KAJA_SONG_FADE, 10
call sub_D7EC
les bx, _ksoconfig
cmp byte ptr es:[bx+17h], 0
jnz short loc_A430
pushd 0
push ds
push offset aMain ; "main"
push ds
push offset aMain ; "main"
jmp short loc_A43B
; ---------------------------------------------------------------------------
loc_A430:
pushd 0
push ds
push offset path ; "deb"
push ds
push offset path ; "deb"
loc_A43B:
call _execl
add sp, 0Ch
loc_A443:
pop di
pop si
pop bp
retn
sub_A39C endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A447 proc near
push bp
mov bp, sp
push si
push di
les bx, _ksoconfig
mov byte ptr es:[bx+1Fh], 0
mov byte ptr es:[bx+13h], 6
mov byte ptr es:[bx+0Dh], 3
mov byte ptr es:[bx+0Eh], 3
call sub_D12D
or ax, ax
jnz short loc_A4CB
xor si, si
jmp short loc_A4A0
; ---------------------------------------------------------------------------
loc_A46F:
les bx, _ksoconfig
add bx, si
mov byte ptr es:[bx+20h], 0
mov bx, word ptr _ksoconfig
add bx, si
mov byte ptr es:[bx+44h], 0
xor di, di
jmp short loc_A49A
; ---------------------------------------------------------------------------
loc_A489:
mov ax, di
shl ax, 3
les bx, _ksoconfig
add bx, ax
mov byte ptr es:[bx+si+4Ch], 0
inc di
loc_A49A:
cmp di, 6
jl short loc_A489
inc si
loc_A4A0:
cmp si, 8
jl short loc_A46F
call sub_BC83
call sub_BB0E
kajacall KAJA_SONG_FADE, 10
call sub_D7EC
pushd 0
push ds
push offset aMain ; "main"
push ds
push offset aMain ; "main"
call _execl
add sp, 0Ch
loc_A4CB:
pop di
pop si
pop bp
retn
sub_A447 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A4CF proc near
push bp
mov bp, sp
push si
les bx, _ksoconfig
mov byte ptr es:[bx+1Ah], 0
mov byte ptr es:[bx+13h], 0
mov byte ptr es:[bx+0Dh], 3
mov byte ptr es:[bx+0Eh], 3
inc byte ptr es:[bx+1Fh]
cmp byte ptr es:[bx+1Fh], 4
jbe short loc_A4FB
mov byte ptr es:[bx+1Fh], 1
loc_A4FB:
cmp _input, INPUT_LEFT or INPUT_RIGHT
jnz short loc_A535
cmp byte_1411F, 0
jz short loc_A529
cmp byte_14120, 0
jz short loc_A529
cmp byte_14121, 0
jz short loc_A529
cmp byte_14122, 0
jz short loc_A529
les bx, _ksoconfig
mov byte ptr es:[bx+1Fh], 5
jmp short loc_A535
; ---------------------------------------------------------------------------
loc_A529:
les bx, _ksoconfig
mov byte ptr es:[bx+1Fh], 0
jmp loc_A5E9
; ---------------------------------------------------------------------------
loc_A535:
les bx, _ksoconfig
mov al, es:[bx+1Fh]
mov ah, 0
dec ax
mov bx, ax
cmp bx, 4
ja short loc_A5A4
add bx, bx
jmp cs:off_A5EC[bx]
loc_A54E:
les bx, _ksoconfig
mov byte ptr es:[bx+14h], 0
mov byte ptr es:[bx+1Dh], 3
jmp short loc_A5A4
; ---------------------------------------------------------------------------
loc_A55E:
les bx, _ksoconfig
mov byte ptr es:[bx+14h], 1
mov byte ptr es:[bx+1Dh], 1
jmp short loc_A5A4
; ---------------------------------------------------------------------------
loc_A56E:
les bx, _ksoconfig
mov byte ptr es:[bx+14h], 2
mov byte ptr es:[bx+1Dh], 2
jmp short loc_A5A4
; ---------------------------------------------------------------------------
loc_A57E:
les bx, _ksoconfig
mov byte ptr es:[bx+14h], 3
mov byte ptr es:[bx+1Dh], 4
jmp short loc_A5A4
; ---------------------------------------------------------------------------
loc_A58E:
les bx, _ksoconfig
mov byte ptr es:[bx+14h], 2
mov byte ptr es:[bx+1Dh], 6
kajacall KAJA_SONG_FADE, 8
loc_A5A4:
xor si, si
jmp short loc_A5BF
; ---------------------------------------------------------------------------
loc_A5A8:
les bx, _ksoconfig
add bx, si
mov byte ptr es:[bx+20h], 0
mov bx, word ptr _ksoconfig
add bx, si
mov byte ptr es:[bx+44h], 0
inc si
loc_A5BF:
cmp si, 8
jl short loc_A5A8
call sub_BC83
call sub_BB0E
push 1
call palette_black_out
call sub_D7EC
pushd 0
push ds
push offset aMain ; "main"
push ds
push offset aMain ; "main"
call _execl
add sp, 0Ch
loc_A5E9:
pop si
pop bp
retn
sub_A4CF endp
; ---------------------------------------------------------------------------
off_A5EC dw offset loc_A54E
dw offset loc_A55E
dw offset loc_A56E
dw offset loc_A57E
dw offset loc_A58E
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A5F6 proc near
var_2 = word ptr -2
arg_0 = word ptr 4
arg_2 = word ptr 6
enter 2, 0
push si
push di
mov si, [bp+arg_2]
mov ax, si
imul ax, 14h
add ax, 0FAh
mov di, ax
push 100h
push ax
push 800010h
call sub_E2D8
call grcg_setcolor pascal, GC_RMW, [bp+arg_0]
mov [bp+var_2], si
mov bx, si
cmp bx, 5
ja short loc_A69A
add bx, bx
jmp cs:off_A70B[bx]
loc_A634:
push (272 shl 16) or 250
push 10
call _cdg_put_nocolors
les bx, _ksoconfig
mov al, es:[bx+11h]
mov ah, 0
add ax, 16h
mov [bp+var_2], ax
jmp short loc_A69A
; ---------------------------------------------------------------------------
loc_A653:
cmp byte_14116, 0
loc_A658:
jnz short loc_A665
call grcg_setcolor pascal, (GC_RMW shl 16) + 2
loc_A665:
push (272 shl 16) or 270
push 11
jmp short loc_A695
; ---------------------------------------------------------------------------
loc_A66F:
push (272 shl 16) or 290
push 12
jmp short loc_A695
; ---------------------------------------------------------------------------
loc_A679:
push (272 shl 16) or 310
push 13
jmp short loc_A695
; ---------------------------------------------------------------------------
loc_A683:
push (272 shl 16) or 330
push 14
jmp short loc_A695
; ---------------------------------------------------------------------------
loc_A68D:
push (272 shl 16) or 350
push 15
loc_A695:
call _cdg_put_nocolors
loc_A69A:
GRCG_OFF_CLOBBERING dx
cmp [bp+arg_0], 0Eh
jnz short loc_A705
call _cdg_put pascal, 256, di, 35
call _cdg_put pascal, 352, di, 36
pushd 180h
push 2800010h
call sub_E2D8
mov word_F9BE, 2
mov bx, [bp+var_2]
shl bx, 2
pushd dword ptr MENU_DESC[bx] ; s
call _strlen
add sp, 4
shl ax, 3
mov dx, 270h
sub dx, ax
push dx
push 1800009h
mov bx, [bp+var_2]
shl bx, 2
pushd dword ptr MENU_DESC[bx]
call sub_D436
loc_A705:
pop di
pop si
leave
retn 4
sub_A5F6 endp
; ---------------------------------------------------------------------------
off_A70B dw offset loc_A634
dw offset loc_A653
dw offset loc_A66F
dw offset loc_A679
dw offset loc_A683
dw offset loc_A68D
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A717 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, 0E0h
mov ax, [bp+arg_2]
shl ax, 4
add ax, 0FAh
mov [bp+var_4], ax
cmp [bp+arg_2], 7
jnz short loc_A737
mov [bp+var_4], 16Eh
loc_A737:
push 0E0h
push [bp+var_4]
push 0C00010h
call sub_E2D8
call grcg_setcolor pascal, GC_RMW, [bp+arg_0]
mov bx, [bp+arg_2]
cmp bx, 7
ja loc_A8DA
add bx, bx
jmp cs:off_A958[bx]
loc_A764:
push (224 shl 16) or 250
push 16
call _cdg_put_nocolors
push 14000FAh
les bx, _ksoconfig
mov al, es:[bx+11h]
mov ah, 0
add ax, 21
push ax
call _cdg_put_nocolors
les bx, _ksoconfig
mov al, es:[bx+11h]
mov ah, 0
add ax, 6
loc_A797:
mov si, ax
jmp loc_A8DA
; ---------------------------------------------------------------------------
loc_A79C:
push (224 shl 16) or 266
push 17
call _cdg_put_nocolors
push 140010Ah
les bx, _ksoconfig
mov al, es:[bx+0Fh]
mov ah, 0
push ax
call _cdg_put_nocolors
mov si, 0Ah
jmp loc_A8DA
; ---------------------------------------------------------------------------
loc_A7C5:
push (224 shl 16) or 282
push 18
call _cdg_put_nocolors
push 140011Ah
les bx, _ksoconfig
mov al, es:[bx+10h]
mov ah, 0
push ax
call _cdg_put_nocolors
mov si, 0Bh
jmp loc_A8DA
; ---------------------------------------------------------------------------
loc_A7EE:
push (224 shl 16) or 298
push 19
call _cdg_put_nocolors
les bx, _ksoconfig
cmp byte ptr es:[bx+12h], 0
jnz short loc_A80B
mov ax, 1Ch
jmp short loc_A818
; ---------------------------------------------------------------------------
loc_A80B:
les bx, _ksoconfig
mov al, es:[bx+12h]
mov ah, 0
add ax, 18h
loc_A818:
mov [bp+var_2], ax
push (320 shl 16) or 298
push ax
call _cdg_put_nocolors
les bx, _ksoconfig
mov al, es:[bx+12h]
mov ah, 0
add ax, 0Ch
jmp loc_A797
; ---------------------------------------------------------------------------
loc_A837:
push (224 shl 16) or 314
push 20
call _cdg_put_nocolors
les bx, _ksoconfig
cmp byte ptr es:[bx+15h], 0
jnz short loc_A854
mov ax, 1Ch
jmp short loc_A865
; ---------------------------------------------------------------------------
loc_A854:
les bx, _ksoconfig
loc_A858:
mov al, es:[bx+15h]
mov ah, 0
push ax
mov ax, 1Fh
pop dx
sub ax, dx
loc_A865:
mov [bp+var_2], ax
push (320 shl 16) or 314
push ax
call _cdg_put_nocolors
les bx, _ksoconfig
mov al, es:[bx+15h]
mov ah, 0
add ax, 0Fh
jmp loc_A797
; ---------------------------------------------------------------------------
loc_A884:
push (272 shl 16) or 330
les bx, _ksoconfig
mov al, es:[bx+16h]
mov ah, 0
mov dx, 33
sub dx, ax
push dx
call _cdg_put_nocolors
mov di, 100h
les bx, _ksoconfig
mov al, es:[bx+16h]
mov ah, 0
add ax, 12h
jmp loc_A797
; ---------------------------------------------------------------------------
loc_A8B2:
push (272 shl 16) or 346
push 31
call _cdg_put_nocolors
mov di, 100h
mov si, 14h
jmp short loc_A8DA
; ---------------------------------------------------------------------------
loc_A8C7:
push (272 shl 16) or 366
push 15
call _cdg_put_nocolors
mov di, 256
mov si, 15h
loc_A8DA:
GRCG_OFF_CLOBBERING dx
cmp [bp+arg_0], 0Eh
jnz short loc_A951
call _cdg_put pascal, di, [bp+var_4], 35
cmp di, 256
jnz short loc_A8FD
lea ax, [di+96]
push ax
jmp short loc_A900
; ---------------------------------------------------------------------------
loc_A8FD:
push 384
loc_A900:
push [bp+var_4]
push 36
call _cdg_put
pushd 180h
push 2800010h
call sub_E2D8
mov word_F9BE, 2
mov bx, si
shl bx, 2
pushd dword ptr MENU_DESC[bx] ; s
call _strlen
add sp, 4
shl ax, 3
mov dx, 270h
sub dx, ax
push dx
push 1800009h
mov bx, si
shl bx, 2
pushd dword ptr MENU_DESC[bx]
call sub_D436
loc_A951:
pop di
pop si
leave
retn 4
sub_A717 endp
; ---------------------------------------------------------------------------
db 0
off_A958 dw offset loc_A764
dw offset loc_A79C
dw offset loc_A7C5
dw offset loc_A7EE
dw offset loc_A837
dw offset loc_A884
dw offset loc_A8B2
dw offset loc_A8C7
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A968 proc near
arg_0 = byte ptr 4
arg_2 = byte ptr 6
push bp
mov bp, sp
mov al, byte_F071
cbw
push ax
push 8
call fp_11DD2
mov al, [bp+arg_0]
add byte_F071, al
mov al, byte_F071
cbw
or ax, ax
jge short loc_A98B
mov al, [bp+arg_2]
mov byte_F071, al
loc_A98B:
mov al, byte_F071
cmp al, [bp+arg_2]
jle short loc_A998
mov byte_F071, 0
loc_A998:
cmp byte_14116, 0
jnz short loc_A9B6
mov al, byte_F071
cbw
cmp ax, 1
jnz short loc_A9B6
cmp byte_11DD0, 0
jnz short loc_A9B6
mov al, [bp+arg_0]
add byte_F071, al
loc_A9B6:
mov al, byte_F071
cbw
push ax
push 0Eh
call fp_11DD2
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
pop bp
retn 4
sub_A968 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A9D6 proc near
push bp
mov bp, sp
push si
cmp byte_F0DC, 0
jnz short loc_AA2B
mov byte_F073, 0
mov byte_11DD4, 0
push 0C000FAh
push 12000A0h
call sub_E2D8
xor si, si
jmp short loc_AA16
; ---------------------------------------------------------------------------
loc_AA00:
push si
mov al, byte_F071
cbw
cmp ax, si
jnz short loc_AA0E
mov ax, 0Eh
jmp short loc_AA11
; ---------------------------------------------------------------------------
loc_AA0E:
mov ax, 8
loc_AA11:
push ax
call sub_A5F6
inc si
loc_AA16:
cmp si, 6
jl short loc_AA00
mov fp_11DD2, offset sub_A5F6
mov byte_F0DC, 1
mov byte_11DD4, 0
loc_AA2B:
cmp _input, INPUT_NONE
jnz short loc_AA37
mov byte_11DD4, 1
loc_AA37:
cmp byte_11DD4, 0
jz loc_ABC0
test _input.lo, low INPUT_UP
jz short loc_AA4E
push 5
push 0FFFFh
call sub_A968
loc_AA4E:
test _input.lo, low INPUT_DOWN
jz short loc_AA5C
push 5
push 1
call sub_A968
loc_AA5C:
test _input.hi, high INPUT_OK
jnz short loc_AA6C
test _input.lo, low INPUT_SHOT
jz loc_ABA8
loc_AA6C:
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov al, byte_F071
cbw
mov bx, ax
cmp bx, 5
ja loc_ABA8
add bx, bx
jmp cs:off_ABC3[bx]
loc_AA91:
call sub_A39C
graph_accesspage 1
call pi_slot_load pascal, 0, ds, offset aOp1_pi
call pi_slot_palette_apply pascal, 0
call pi_slot_put pascal, large 0, 0
call pi_slot_free pascal, 0
push 0
call graph_copy_page
mov PaletteTone, 64h ; 'd'
call far ptr palette_show
mov byte_F0DC, 0
mov byte_11DD0, 0
mov byte_F071, 0
jmp loc_ABC0
; ---------------------------------------------------------------------------
loc_AAE1:
call sub_A447
graph_accesspage 1
call pi_slot_load pascal, 0, ds, offset aOp1_pi
call pi_slot_palette_apply pascal, 0
call pi_slot_put pascal, large 0, 0
call pi_slot_free pascal, 0
push 0
call graph_copy_page
mov PaletteTone, 64h ; 'd'
call far ptr palette_show
mov byte_F0DC, 0
mov byte_11DD0, 0
mov byte_F071, 1
jmp loc_ABC0
; ---------------------------------------------------------------------------
loc_AB31:
call sub_CC5C
mov byte_F0DC, 0
jmp short loc_ABA8
; ---------------------------------------------------------------------------
loc_AB3B:
call sub_C490
call load_char_select_sprite_function
graph_accesspage 1
call pi_slot_load pascal, 0, ds, offset aOp1_pi
call pi_slot_palette_apply pascal, 0
call pi_slot_put pascal, large 0, 0
call pi_slot_free pascal, 0
push 0
call graph_copy_page
mov PaletteTone, 64h ; 'd'
call far ptr palette_show
mov byte_F0DC, 0
mov byte_11DD0, 0
mov byte_F071, 3
jmp short loc_ABC0
; ---------------------------------------------------------------------------
loc_AB8D:
mov byte_F0DC, 0
mov byte_11DD0, 1
mov byte_F071, 0
jmp short loc_ABA8
; ---------------------------------------------------------------------------
loc_AB9E:
mov byte_F0DC, 0
mov byte_F072, 1
loc_ABA8:
test _input.hi, high INPUT_CANCEL