-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
th05_maine.asm
7951 lines (7079 loc) · 163 KB
/
th05_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, <support@hex-rays.com> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : 57F21130457B229B7ED74E30D2B6E6E5
; File Name : th05/MAINE.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-1C6F0h Loaded length: 128A6h
; Entry Point : 0:0
; OS type : MS DOS
; Application type: Executable 16bit
.386
.model use16 large
BINARY = 'E'
include ReC98.inc
include th05/th05.inc
include th01/math/subpixel.inc
include th04/hardware/grppsafx.inc
extern _execl:proc
extern _tolower:proc
extern __ctype:byte
maine_01 group maine_01_TEXT, maine_01__TEXT, maine_01___TEXT
g_SHARED group SHARED, SHARED_
; ===========================================================================
; 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_filesize.asm
include libs/master.lib/dos_keyclear.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_size.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_boxfill.asm
include libs/master.lib/grcg_byteboxfill_x.asm
include libs/master.lib/grcg_circlefill.asm
include libs/master.lib/grc_setclip.asm
include libs/master.lib/grcg_hline.asm
include libs/master.lib/grcg_pset.asm
include libs/master.lib/grcg_setcolor.asm
include libs/master.lib/grcg_vline.asm
include libs/master.lib/gdc_outpw.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/gaiji_putca.asm
include libs/master.lib/gaiji_putsa.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_hide.asm
include libs/master.lib/graph_pi_free.asm
include libs/master.lib/graph_pi_load_pack.asm
include libs/master.lib/graph_scrollup.asm
include libs/master.lib/graph_show.asm
include libs/master.lib/iatan2.asm
include libs/master.lib/isqrt.asm
include libs/master.lib/js_end.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/text_putsa.asm
include libs/master.lib/vsync.asm
include libs/master.lib/vsync_wait.asm
include libs/master.lib/palette_white_in.asm
include libs/master.lib/palette_white_out.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/super_convert_tiny.asm
include libs/master.lib/super_put_tiny_small.asm
include libs/master.lib/js_start.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
maine_01_TEXT segment byte public 'CODE' use16
assume cs:maine_01
;org 5
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
include th03/formats/cfg_lres.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; int __stdcall sub_A576(char *arg0)
sub_A576 proc near
_arg0 = dword ptr 4
push bp
mov bp, sp
call cdg_free_all
call graph_hide
call text_clear
call _game_exit
pushd 0
pushd [bp+_arg0] ; arg0
pushd [bp+_arg0] ; path
call _execl
add sp, 0Ch
pop bp
retn 4
sub_A576 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A5A4 proc near
push bp
mov bp, sp
les bx, _resident
cmp es:[bx+resident_t.end_sequence], ES_CONTINUED
jnz short loc_A5BD
les bx, off_10190
mov byte ptr es:[bx+3], '0'
jmp short loc_A5DC
; ---------------------------------------------------------------------------
loc_A5BD:
les bx, _resident
cmp es:[bx+resident_t.end_sequence], ES_EXTRA
jnz short loc_A5D3
les bx, off_10190
mov byte ptr es:[bx+3], '2'
jmp short loc_A5DC
; ---------------------------------------------------------------------------
loc_A5D3:
les bx, off_10190
mov byte ptr es:[bx+3], '1'
loc_A5DC:
les bx, _resident
mov al, es:[bx+resident_t.playchar]
add al, '0'
les bx, off_10190
mov es:[bx+4], al
push word ptr off_10190+2
push bx
call sub_A695
call sub_AFD6
pop bp
retn
sub_A5A4 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; int __cdecl main(int argc, const char **argv, const char **envp)
public _main
_main proc far
_argc = word ptr 6
_argv = dword ptr 8
_envp = dword ptr 0Ch
push bp
mov bp, sp
call cfg_load_resident
or ax, ax
jz loc_A693
mov _mem_assign_paras, MEM_ASSIGN_PARAS_MAINE
call game_init_main pascal, ds, offset aKaikidan1_dat
les bx, _resident
mov al, es:[bx+resident_t.bgm_mode]
mov ah, 0
push ax
mov al, es:[bx+resident_t.se_mode]
mov ah, 0
push ax
call snd_determine_modes
call snd_load pascal, ds, offset aMiko, SND_LOAD_SE
call graph_show
les bx, _resident
mov eax, es:[bx+resident_t.rand]
mov random_seed, eax
call frame_delay pascal, 100
les bx, _resident
cmp es:[bx+resident_t.end_sequence], ES_CONTINUED
jb short loc_A665
call sub_A5A4
call sub_E41D
jmp short loc_A679
; ---------------------------------------------------------------------------
loc_A665:
les bx, _resident
cmp es:[bx+resident_t.end_sequence], ES_EXTRA
jnz short loc_A67E
call sub_A5A4
call sub_B3CB
call sub_D1B1
loc_A679:
call sub_C1DD
jmp short loc_A684
; ---------------------------------------------------------------------------
loc_A67E:
call sub_C1DD
call sub_D1B1
loc_A684:
kajacall KAJA_SONG_FADE, 4
push ds
push offset arg0 ; "op"
call sub_A576
loc_A693:
pop bp
retf
_main endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A695 proc near
var_2 = word ptr -2
arg_0 = dword ptr 4
enter 2, 0
pushd [bp+arg_0]
call file_ropen
or ax, ax
jnz short loc_A6AD
mov ax, 1
leave
retn 4
; ---------------------------------------------------------------------------
loc_A6AD:
call file_size
mov [bp+var_2], ax
mov _cutscene_script_ptr, offset _cutscene_script
push ds
push _cutscene_script_ptr
push ax
call file_read
call file_close
xor ax, ax
leave
retn 4
sub_A695 endp
EGC_START_COPY_DEF 1, near
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A705 proc near
arg_0 = word ptr 4
arg_2 = word ptr 6
arg_4 = word ptr 8
arg_6 = word ptr 0Ah
push bp
mov bp, sp
push si
push di
mov si, [bp+arg_6]
mov di, [bp+arg_4]
graph_accesspage 1
push si
push di
push 0
push [bp+arg_2]
push [bp+arg_0]
call pi_put_quarter_masked_8
call egc_copy_rect_1_to_0_16 pascal, si, di, (320 shl 16) or 200
pop di
pop si
pop bp
retn 8
sub_A705 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A738 proc near
var_2 = byte ptr -2
var_1 = byte ptr -1
arg_0 = dword ptr 4
enter 2, 0
mov bx, _cutscene_script_ptr
mov cl, [bx]
inc _cutscene_script_ptr
mov bx, _cutscene_script_ptr
mov al, [bx]
mov [bp+var_1], al
inc _cutscene_script_ptr
mov bx, _cutscene_script_ptr
mov al, [bx]
mov [bp+var_2], al
inc _cutscene_script_ptr
mov al, cl
mov ah, 0
mov bx, ax
test (__ctype + 1)[bx], _IS_DIG
jnz short loc_A77F
les bx, [bp+arg_0]
mov ax, word_1500C
mov es:[bx], ax
sub _cutscene_script_ptr, 3
leave
retn 4
; ---------------------------------------------------------------------------
loc_A77F:
mov al, [bp+var_1]
mov ah, 0
mov bx, ax
test (__ctype + 1)[bx], _IS_DIG
jnz short loc_A7A3
mov al, cl
mov ah, 0
add ax, 0FFD0h
les bx, [bp+arg_0]
mov es:[bx], ax
sub _cutscene_script_ptr, 2
leave
retn 4
; ---------------------------------------------------------------------------
loc_A7A3:
mov al, [bp+var_2]
mov ah, 0
mov bx, ax
test (__ctype + 1)[bx], _IS_DIG
jnz short loc_A7D3
mov al, cl
mov ah, 0
add ax, 0FFD0h
imul ax, 0Ah
mov dl, [bp+var_1]
mov dh, 0
add ax, dx
add ax, 0FFD0h
les bx, [bp+arg_0]
mov es:[bx], ax
dec _cutscene_script_ptr
leave
retn 4
; ---------------------------------------------------------------------------
loc_A7D3:
mov al, cl
mov ah, 0
add ax, 0FFD0h
imul ax, 64h
mov dl, [bp+var_1]
mov dh, 0
add dx, 0FFD0h
imul dx, 0Ah
add ax, dx
mov dl, [bp+var_2]
mov dh, 0
add ax, dx
add ax, 0FFD0h
les bx, [bp+arg_0]
mov es:[bx], ax
leave
retn 4
sub_A738 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A7FE proc near
arg_0 = dword ptr 4
push bp
mov bp, sp
mov bx, _cutscene_script_ptr
cmp byte ptr [bx], ','
loc_A808:
jnz short loc_A819
inc _cutscene_script_ptr
pushd [bp+arg_0]
call sub_A738
pop bp
retn 4
; ---------------------------------------------------------------------------
loc_A819:
les bx, [bp+arg_0]
mov ax, word_1500C
mov es:[bx], ax
pop bp
retn 4
sub_A7FE endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A826 proc near
push bp
mov bp, sp
add point_15004.x, 16
cmp point_15004.x, 560
jl short loc_A864
add point_15004.y, 16
mov point_15004.x, 144
cmp point_15004.y, 384
jl short loc_A864
call sub_A8EC
cmp byte_14F8E, 0
jnz short loc_A858
push 0
call sub_A92B
loc_A858:
mov point_15004.x, 80
mov point_15004.y, 320
loc_A864:
pop bp
retn
sub_A826 endp
maine_01_TEXT ends
maine_01__TEXT segment byte public 'CODE' use16
BOX_1_TO_0_MASKED procdesc pascal near \
mask:word
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A8EC proc near
push bp
mov bp, sp
push si
graph_accesspage 0
call egc_start_copy_1
cmp byte_14F8E, 0
jnz short loc_A917
xor si, si
jmp short loc_A912
; ---------------------------------------------------------------------------
loc_A904:
call box_1_to_0_masked pascal, si
push word_15008
call frame_delay
inc si
loc_A912:
cmp si, 4
jl short loc_A904
loc_A917:
call box_1_to_0_masked pascal, 4
call egc_off
push 1
call frame_delay
pop si
pop bp
retn
sub_A8EC endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_A92B proc near
var_2 = word ptr -2
arg_0 = word ptr 4
enter 2, 0
push si
push di
mov si, [bp+arg_0]
xor di, di
mov [bp+var_2], 0
loc_A93B:
call _input_reset_sense_held
cmp _key_det, INPUT_NONE
jz short loc_A950
push 1
call frame_delay
jmp short loc_A93B
; ---------------------------------------------------------------------------
loc_A950:
or si, si
jnz short loc_A95C
mov si, 999
mov [bp+var_2], 1
loc_A95C:
graph_accesspage 0
loc_A962:
call _input_reset_sense_held
call bgimage_put_rect pascal, 576, point_15004.y, (16 shl 16) or 16
or si, si
jle short loc_A9BD
test _key_det.hi, high INPUT_OK
jnz short loc_A9BD
test _key_det.lo, low INPUT_SHOT
jnz short loc_A9BD
test _key_det.hi, high INPUT_CANCEL
jnz short loc_A9BD
push 576
push point_15004.y
mov ax, di
shr ax, 3
and ax, ga_RETURN_KEY_CELS - 1
add ax, ga_RETURN_KEY
push ax
push 15
call graph_gaiji_putc
inc di
cmp [bp+var_2], 0
jnz short loc_A9B4
dec si
loc_A9B4:
push 1
call frame_delay
jmp short loc_A962
; ---------------------------------------------------------------------------
loc_A9BD:
pop di
pop si
leave
retn 2
sub_A92B endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
COLMAP_COUNT = 8
colmap_key_t struc
CMK_kanji dw ?
db 4 dup (?)
colmap_key_t ends
colmap_t struc
CM_values db COLMAP_COUNT dup (?)
CM_keys colmap_key_t COLMAP_COUNT dup (<?>)
colmap_t ends
sub_A9C3 proc near
var_16 = byte ptr -16h
var_6 = word ptr -6
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = byte ptr 4
enter 16h, 0
push si
mov al, [bp+arg_0]
mov ah, 0
push ax ; ch
call _tolower
pop cx
mov [bp+arg_0], al
mov ah, 0
mov [bp+var_6], ax
mov cx, 10h ; switch 16 cases
mov bx, offset word_AF96
loc_A9E2:
mov ax, cs:[bx]
cmp ax, [bp+var_6]
jz short loc_A9F2
add bx, 2
loop loc_A9E2
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_A9F2:
jmp word ptr cs:[bx+20h] ; switch jump
loc_A9F6:
add point_15004.y, 16 ; jumptable 0000A9F2 case 110
mov point_15004.x, 80
cmp point_15004.y, 384
jl loc_AF8F ; default
loc_AA0B:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 115
mov al, [bx]
mov [bp+arg_0], al
call sub_A8EC
cmp [bp+arg_0], '-'
jz short loc_AA3A
mov word_1500C, 0
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp byte_14F8E, 0
jnz short loc_AA3E
push [bp+var_2]
call sub_A92B
jmp short loc_AA3E
; ---------------------------------------------------------------------------
loc_AA3A:
inc _cutscene_script_ptr
loc_AA3E:
mov point_15004.x, 80
mov point_15004.y, 320
graph_accesspage 1
call bgimage_put_rect pascal, (80 shl 16) or 320, (480 shl 16) or 64
mov dx, 166 ; Port 00A6h: Page access register
mov al, 0
loc_AA66:
out dx, al
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AA6A:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 99
mov al, [bx]
mov ah, 0
push ax ; ch
call _tolower
pop cx
mov [bp+arg_0], al
cmp [bp+arg_0], '='
jz @@colmap_add
mov word_1500C, 0Fh
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov al, byte ptr [bp+var_2]
mov _text_col, al
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AA9B:
mov word_1500C, 2 ; jumptable 0000A9F2 case 98
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov ax, [bp+var_2]
mov _graph_putsa_fx_func, ax
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AAB2:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 119
mov al, [bx]
mov ah, 0
push ax ; ch
call _tolower
pop cx
mov [bp+arg_0], al
cmp [bp+arg_0], 'o'
jz short loc_AAD0
cmp [bp+arg_0], 'i'
jnz short loc_AAFE
loc_AAD0:
inc _cutscene_script_ptr
mov word_1500C, 1
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp [bp+arg_0], 'i'
jnz short loc_AAF3
push [bp+var_2]
call palette_white_in
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AAF3:
push [bp+var_2]
call palette_white_out
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AAFE:
call sub_A8EC
mov word_1500C, 40h
cmp [bp+arg_0], 'm'
jz short loc_AB33
cmp [bp+arg_0], 'k'
jnz short loc_AB17
inc _cutscene_script_ptr
loc_AB17:
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp byte_14F8E, 0
jnz loc_AF8F ; default
push [bp+var_2]
call frame_delay
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AB33:
inc _cutscene_script_ptr
mov bx, _cutscene_script_ptr
mov al, [bx]
mov [bp+arg_0], al
cmp [bp+arg_0], 'k'
jnz short loc_AB4A
inc _cutscene_script_ptr
loc_AB4A:
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
push ss
lea ax, [bp+var_4]
push ax
call sub_A7FE
cmp byte_14F8E, 0
jnz loc_AF8F ; default
call snd_delay_until_measure pascal, [bp+var_2], [bp+var_4]
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AB71:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 118
cmp byte ptr [bx], 'p'
jz short loc_AB91
mov word_1500C, 2
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov ax, [bp+var_2]
mov word_15008, ax
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AB91:
inc _cutscene_script_ptr
mov word_1500C, 0
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov dx, 164 ; Port 00A4h: Page display register
mov al, byte ptr [bp+var_2]
jmp loc_AA66
; ---------------------------------------------------------------------------
loc_ABAC:
mov word_1500C, 64h ; 'd' ; jumptable 0000A9F2 case 116
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp byte_14F8E, 0
jnz short loc_ABC8
push 1
call frame_delay
loc_ABC8:
mov ax, [bp+var_2]
mov PaletteTone, ax
call far ptr palette_show
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_ABD6:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 102
mov al, [bx]
mov [bp+arg_0], al
cmp [bp+arg_0], 'm'
jz short loc_AC21
cmp [bp+arg_0], 'i'
jz short loc_ABF3
cmp [bp+arg_0], 'o'
jnz loc_AF8F ; default
loc_ABF3:
inc _cutscene_script_ptr
mov word_1500C, 1
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp [bp+arg_0], 'i'
jnz short loc_AC16
push [bp+var_2]
call palette_black_in
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AC16:
push [bp+var_2]
call palette_black_out
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AC21:
inc _cutscene_script_ptr
mov word_1500C, 1
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov ax, [bp+var_2]
add ax, (KAJA_SONG_FADE shl 8)
push ax
jmp loc_AF11
; ---------------------------------------------------------------------------
loc_AC3D:
mov word_1500C, 8 ; jumptable 0000A9F2 case 103
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
mov [bp+var_4], 0
jmp short loc_AC75
; ---------------------------------------------------------------------------
loc_AC52:
test byte ptr [bp+var_4], 1
jz short loc_AC5C
push 4
jmp short loc_AC5F
; ---------------------------------------------------------------------------
loc_AC5C:
push RES_Y - 4
loc_AC5F:
call graph_scrollup
cmp byte_14F8E, 0
jnz short loc_AC72
push 1
call frame_delay
loc_AC72:
inc [bp+var_4]
loc_AC75:
mov ax, [bp+var_4]
cmp ax, [bp+var_2]
jle short loc_AC52
call graph_scrollup pascal, 0
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_AC87:
call sub_A8EC ; jumptable 0000A9F2 case 107
mov word_1500C, 0
push ss
lea ax, [bp+var_2]
push ax
call sub_A738
cmp byte_14F8E, 0
jnz loc_AF8F ; default
push [bp+var_2]
call sub_A92B
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_ACAA:
graph_accesspage 1 ; jumptable 0000A9F2 case 64
call graph_clear
graph_accesspage 0
call graph_clear
call _bgimage_snap
jmp loc_AF8F ; default
; ---------------------------------------------------------------------------
loc_ACC8:
mov bx, _cutscene_script_ptr ; jumptable 0000A9F2 case 112
mov al, [bx]
mov [bp+arg_0], al
inc _cutscene_script_ptr
cmp [bp+arg_0], '='
jz short loc_ACE1
cmp [bp+arg_0], 40h
jnz short loc_AD13
loc_ACE1:
graph_accesspage 1
cmp [bp+arg_0], '='
jnz short loc_ACF4
call pi_palette_apply pascal, 0