-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathth02_maine.asm
2145 lines (1921 loc) · 57 KB
/
th02_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 : E6F971B37336C0F9FCE53F895780031E
; File Name : th02/MAINE.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-FCF0h Loaded length: DE32h
; 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 maine_02_TEXT
__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 th02/th02.inc
extern SCOPY@:proc
extern _execl: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_extend_header_skip.asm
include libs/master.lib/bfnt_header_read.asm
include libs/master.lib/bfnt_header_analysis.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/cutline.asm
include libs/master.lib/dos_axdx.asm
include libs/master.lib/dos_filesize.asm
include libs/master.lib/dos_setvect.asm
include libs/master.lib/egc.asm
include libs/master.lib/egc_shift_down.asm
include libs/master.lib/egc_shift_left.asm
include libs/master.lib/file_append.asm
include libs/master.lib/file_close.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_line.asm
include libs/master.lib/grcg_setcolor.asm
include libs/master.lib/gaiji_backup.asm
include libs/master.lib/gaiji_entry_bfnt.asm
include libs/master.lib/gaiji_putca.asm
include libs/master.lib/gaiji_putsa.asm
include libs/master.lib/gaiji_read.asm
include libs/master.lib/gaiji_write.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_gaiji_putc.asm
include libs/master.lib/graph_gaiji_puts.asm
include libs/master.lib/graph_pi_free.asm
include libs/master.lib/graph_pi_load_pack.asm
include libs/master.lib/graph_pack_put_8.asm
include libs/master.lib/key_sense.asm
include libs/master.lib/over_put_8.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/palette_entry_rgb.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/text_clear.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_entry_pat.asm
include libs/master.lib/super_entry_at.asm
include libs/master.lib/super_entry_bfnt.asm
include libs/master.lib/pfint21.asm
db 0
include th02/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_TEXT
;org 3
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
;void pascal load_end_txt (char* fn)
load_end_txt proc near
@@size = word ptr -2
@@fn = dword ptr 4
enter 2, 0
pushd [bp+@@fn]
call file_ropen
call file_size
mov [bp+@@size], ax
push ds
push offset end_buf
push ax
call file_read
call file_close
leave
retn 4
load_end_txt endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
;void pascal gaiji_score_put (int x, int y, long? value)
gaiji_score_put proc near
var_9 = byte ptr -9
var_8 = dword ptr -8
var_4 = dword ptr -4
@@value = dword ptr 4
@@y = word ptr 8
@@x = word ptr 0Ah
enter 0Ah, 0
push si
push di
mov di, gb_0_
mov [bp+var_4], 10000000
mov [bp+var_9], 0
xor si, si
jmp short loc_9638
; ---------------------------------------------------------------------------
loc_95E4:
mov eax, [bp+@@value]
cdq
idiv [bp+var_4]
mov ebx, 10
cdq
idiv ebx
mov [bp+var_8], edx
mov eax, [bp+var_4]
cdq
idiv ebx
mov [bp+var_4], eax
mov ax, word ptr [bp+var_8]
add ax, gb_0_
mov di, ax
cmp [bp+var_8], 0
jz short loc_961D
mov [bp+var_9], 1
loc_961D:
cmp [bp+var_9], 0
jz short loc_9637
mov ax, si
shl ax, 4
add ax, [bp+@@x]
call graph_gaiji_putc pascal, ax, [bp+@@y], di, 15
loc_9637:
inc si
loc_9638:
cmp si, 8
jl short loc_95E4
pop di
pop si
leave
retn 8
gaiji_score_put endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
;void pascal graph_putsa_fx_with_typing(int x, int y. int len, char* str, int delay)
graph_putsa_fx_with_typing proc near
@@buf = byte ptr -50h
@@delay = word ptr 4
@@str = dword ptr 6
@@len = word ptr 0Ah
@@y = word ptr 0Ch
@@x = word ptr 0Eh
enter 50h, 0
push si
push di
lea ax, [bp+@@buf]
push ss
push ax
push ds
push offset unk_D030
mov cx, size unk_D030
call SCOPY@
xor si, si
xor di, di
jmp short loc_96C4
; ---------------------------------------------------------------------------
loc_9660:
call _input_sense
les bx, [bp+@@str]
add bx, si
mov al, es:[bx]
mov [bp+si+@@buf], al
inc si
mov bx, word ptr [bp+@@str]
add bx, si
mov al, es:[bx]
mov [bp+si+@@buf], al
inc si
mov [bp+si+@@buf], 0
push ss
lea ax, [bp+@@buf]
push ax
mov al, text_default_fx
cbw
push ax
push [bp+@@y]
push [bp+@@x]
call _graph_putsa_fx
add sp, 0Ah
cmp text_force_type_fast, 0
jz short @@type_nomal_speed
cmp _key_det, 0
jz short @@type_nomal_speed
test di, 3
jz short loc_96C1
mov ax, [bp+@@delay]
mov bx, 3
cwd
idiv bx
push ax
jmp short @@type_faster
; ---------------------------------------------------------------------------
@@type_nomal_speed:
push [bp+@@delay]
@@type_faster:
call frame_delay
loc_96C1:
add di, 2
loc_96C4:
cmp di, [bp+@@len]
jl short loc_9660
xor si, si
jmp short loc_96EC
; ---------------------------------------------------------------------------
loc_96CD:
call _input_sense
cmp text_force_type_fast, 0
jz short @@type_text_faster
cmp _key_det, 0
jz short @@type_text_faster
push 0
jmp short @@no_delay
; ---------------------------------------------------------------------------
@@type_text_faster:
push 2
@@no_delay:
call frame_delay
inc si
loc_96EC:
cmp si, 20
jl short loc_96CD
cmp text_force_type_fast, 0
jz short loc_96FB
call sub_9A7E
loc_96FB:
pop di
pop si
leave
retn 0Ch
graph_putsa_fx_with_typing endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9701 proc far
var_8 = word ptr -8
var_6 = word ptr -6
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = dword ptr 0Ah
enter 8, 0
push si
push di
mov ax, [bp+arg_0]
sar ax, 3
mov dx, [bp+arg_2]
shl dx, 6
add ax, dx
mov dx, [bp+arg_2]
shl dx, 4
add ax, dx
mov si, ax
xor di, di
jmp loc_97E6
; ---------------------------------------------------------------------------
loc_9724:
graph_accesspage 1
les bx, _VRAM_PLANE_B
add bx, si
mov ax, es:[bx]
mov [bp+var_8], ax
les bx, _VRAM_PLANE_R
add bx, si
mov ax, es:[bx]
mov [bp+var_6], ax
les bx, _VRAM_PLANE_G
add bx, si
mov ax, es:[bx]
mov [bp+var_4], ax
les bx, _VRAM_PLANE_E
add bx, si
mov ax, es:[bx]
mov [bp+var_2], ax
mov al, 0
out dx, al
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
mov ax, di
add ax, ax
les bx, [bp+arg_4]
add bx, ax
mov ax, es:[bx]
les bx, _VRAM_PLANE_B
add bx, si
mov es:[bx], ax
call grcg_off
mov ax, di
add ax, ax
les bx, [bp+arg_4]
add bx, ax
mov ax, es:[bx]
and ax, [bp+var_8]
les bx, _VRAM_PLANE_B
add bx, si
or es:[bx], ax
mov ax, di
add ax, ax
les bx, [bp+arg_4]
add bx, ax
mov ax, es:[bx]
and ax, [bp+var_6]
les bx, _VRAM_PLANE_R
add bx, si
or es:[bx], ax
mov ax, di
add ax, ax
les bx, [bp+arg_4]
add bx, ax
mov ax, es:[bx]
and ax, [bp+var_4]
les bx, _VRAM_PLANE_G
add bx, si
or es:[bx], ax
mov ax, di
add ax, ax
les bx, [bp+arg_4]
add bx, ax
mov ax, es:[bx]
and ax, [bp+var_2]
les bx, _VRAM_PLANE_E
add bx, si
or es:[bx], ax
add si, 80
inc di
loc_97E6:
cmp di, 16
jl loc_9724
pop di
pop si
leave
retf
sub_9701 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
text_fadein_effect proc far
var_60 = byte ptr -60h
arg_0 = word ptr 6
arg_2 = word ptr 8
arg_4 = word ptr 0Ah
enter 60h, 0
push si
push di
lea ax, [bp+var_60]
push ss
push ax
push ds
push offset byte_D080
mov cx, 8*12
call SCOPY@
xor di, di
jmp short loc_983D
; ---------------------------------------------------------------------------
loc_980C:
xor si, si
jmp short loc_9830
; ---------------------------------------------------------------------------
loc_9810:
mov ax, di
shl ax, 5
lea dx, [bp+var_60]
add ax, dx
push ss
push ax
push [bp+arg_2]
mov ax, si
shl ax, 4
add ax, [bp+arg_0]
push ax
call sub_9701
add sp, 8
inc si
loc_9830:
cmp si, [bp+arg_4]
jl short loc_9810
call frame_delay pascal, 10
inc di
loc_983D:
cmp di, 3
jl short loc_980C
pop di
pop si
leave
retf
text_fadein_effect endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9846 proc near
var_2 = byte ptr -2
var_1 = byte ptr -1
arg_0 = dword ptr 4
arg_4 = word ptr 8
enter 2, 0
push si
push di
mov di, [bp+arg_4]
mov si, 100
mov [bp+var_2], 0
xor cx, cx
jmp short loc_98A1
; ---------------------------------------------------------------------------
loc_985A:
mov ax, di
cwd
idiv si
mov [bp+var_1], al
cmp [bp+var_2], 0
jnz short loc_986B
mov [bp+var_2], al
loc_986B:
cmp [bp+var_2], 0
jnz short loc_9876
cmp cx, 2
jnz short loc_9885
loc_9876:
les bx, [bp+arg_0]
add bx, cx
mov al, [bp+var_1]
add al, 160
mov es:[bx], al
jmp short loc_988E
; ---------------------------------------------------------------------------
loc_9885:
les bx, [bp+arg_0]
add bx, cx
mov byte ptr es:[bx], 0CFh
loc_988E:
mov al, [bp+var_1]
cbw
imul si
sub di, ax
inc cx
mov bx, 10
mov ax, si
cwd
idiv bx
mov si, ax
loc_98A1:
cmp cx, 3
jl short loc_985A
les bx, [bp+arg_0]
add bx, cx
mov byte ptr es:[bx], 0
pop di
pop si
leave
retn 6
sub_9846 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; egc_quarter_put(int slot)
egc_quarter_put proc near
var_6 = word ptr -6
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = word ptr 4
enter 6, 0
push si
push di
cmp [bp+arg_0], 0
jnz short loc_98C5
xor ax, ax
jmp short loc_98DE
; ---------------------------------------------------------------------------
loc_98C5:
cmp [bp+arg_0], 1
jnz short loc_98D0
mov ax, (320 / 8)
jmp short loc_98DE
; ---------------------------------------------------------------------------
loc_98D0:
cmp [bp+arg_0], 2
jnz short loc_98DB
mov ax, (640 * 200) / 8
jmp short loc_98DE
; ---------------------------------------------------------------------------
loc_98DB:
mov ax, ((640 * 200) + 320) / 8
loc_98DE:
mov si, ax
mov di, 1F54h;someone please conver to xy cord....
call egc_start_copy
mov [bp+var_2], 0
jmp short loc_9930
; ---------------------------------------------------------------------------
loc_98EF:
mov [bp+var_4], 0
jmp short loc_9921
; ---------------------------------------------------------------------------
loc_98F6:
graph_accesspage 1
les bx, _VRAM_PLANE_B
add bx, si
mov ax, es:[bx]
mov [bp+var_6], ax
mov al, 0
out dx, al
mov bx, word ptr _VRAM_PLANE_B
add bx, di
mov ax, [bp+var_6]
mov es:[bx], ax
add [bp+var_4], 2
add si, 2
add di, 2
loc_9921:
cmp [bp+var_4], (320 / 8)
jl short loc_98F6
inc [bp+var_2]
add di, (320 / 8)
add si, (320 / 8)
loc_9930:
cmp [bp+var_2], 200
jl short loc_98EF
call egc_off
pop di
pop si
leave
retn 2
egc_quarter_put endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
; egc_quarter_put_x_y(int x, int y, int slot)
egc_quarter_put_x_y proc near
var_6 = word ptr -6
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = word ptr 4
arg_2 = word ptr 6
arg_4 = word ptr 8
enter 6, 0
push si
push di
cmp [bp+arg_0], 0
jnz short loc_9952
xor ax, ax
jmp short loc_996B
; ---------------------------------------------------------------------------
loc_9952:
cmp [bp+arg_0], 1
jnz short loc_995D
mov ax, (320 / 8)
jmp short loc_996B
; ---------------------------------------------------------------------------
loc_995D:
cmp [bp+arg_0], 2
jnz short loc_9968
mov ax, (640 * 200) / 8
jmp short loc_996B
; ---------------------------------------------------------------------------
loc_9968:
mov ax, ((640 * 200) + 320) / 8
loc_996B:
mov si, ax
mov ax, [bp+arg_4]
sar ax, 3
mov dx, [bp+arg_2]
shl dx, 6
add ax, dx
mov dx, [bp+arg_2]
shl dx, 4
add ax, dx
mov di, ax
call egc_start_copy
mov [bp+var_2], 0
jmp short loc_99D2
; ---------------------------------------------------------------------------
loc_9991:
mov [bp+var_4], 0
jmp short loc_99C3
; ---------------------------------------------------------------------------
loc_9998:
graph_accesspage 1
les bx, _VRAM_PLANE_B
add bx, si
mov ax, es:[bx]
mov [bp+var_6], ax
mov al, 0
out dx, al
mov bx, word ptr _VRAM_PLANE_B
add bx, di
mov ax, [bp+var_6]
mov es:[bx], ax
add [bp+var_4], 2
add si, 2
add di, 2
loc_99C3:
cmp [bp+var_4], (320 / 8)
jl short loc_9998
inc [bp+var_2]
add di, (320 / 8)
add si, (320 / 8)
loc_99D2:
cmp [bp+var_2], 200
jl short loc_9991
call egc_off
pop di
pop si
leave
retn 6
egc_quarter_put_x_y endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_99E4 proc near
var_6 = word ptr -6
var_4 = word ptr -4
var_2 = word ptr -2
arg_0 = word ptr 4
arg_2 = word ptr 6
arg_4 = word ptr 8
enter 6, 0
push si
push di
cmp [bp+arg_4], 0
jnz short loc_99F4
xor ax, ax
jmp short loc_9A0D
; ---------------------------------------------------------------------------
loc_99F4:
cmp [bp+arg_4], 1
jnz short loc_99FF
mov ax, (320 / 8)
jmp short loc_9A0D
; ---------------------------------------------------------------------------
loc_99FF:
cmp [bp+arg_4], 2
jnz short loc_9A0A
mov ax, (640 * 200) / 8
jmp short loc_9A0D
; ---------------------------------------------------------------------------
loc_9A0A:
mov ax, ((640 * 200) + 320) / 8
loc_9A0D:
mov si, ax
mov di, 1F54h
mov ax, [bp+arg_2]
imul ax, 80
add si, ax
call egc_start_copy
mov ax, [bp+arg_2]
mov [bp+var_2], ax
jmp short loc_9A68
; ---------------------------------------------------------------------------
loc_9A27:
mov [bp+var_4], 0
jmp short loc_9A59
; ---------------------------------------------------------------------------
loc_9A2E:
graph_accesspage 1
les bx, _VRAM_PLANE_B
add bx, si
mov ax, es:[bx]
mov [bp+var_6], ax
mov al, 0
out dx, al
mov bx, word ptr _VRAM_PLANE_B
add bx, di
mov ax, [bp+var_6]
mov es:[bx], ax
add [bp+var_4], 2
add si, 2
add di, 2
loc_9A59:
cmp [bp+var_4], (320 / 8)
jl short loc_9A2E
inc [bp+var_2]
add di, (320 / 8)
add si, (320 / 8)
loc_9A68:
mov ax, [bp+arg_0]
add ax, [bp+arg_2]
cmp ax, [bp+var_2]
jg short loc_9A27
call egc_off
pop di
pop si
leave
retn 6
sub_99E4 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9A7E proc near
var_2 = word ptr -2
enter 2, 0
push si
push di
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
mov si, 14Ch
jmp short loc_9AC5
; ---------------------------------------------------------------------------
loc_9A94:
mov di, 90h
jmp short loc_9ABE
; ---------------------------------------------------------------------------
loc_9A99:
mov ax, di
sar ax, 3
mov dx, si
shl dx, 6
add ax, dx
mov dx, si
shl dx, 4
add ax, dx
mov [bp+var_2], ax
les bx, _VRAM_PLANE_B
add bx, [bp+var_2]
mov word ptr es:[bx], -1
add di, 10h
loc_9ABE:
cmp di, 1F0h
jl short loc_9A99
inc si
loc_9AC5:
cmp si, 15Ch
jl short loc_9A94
call grcg_off
pop di
pop si
leave
retn
sub_9A7E endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9AD4 proc near
push bp
mov bp, sp
push si
call load_end_txt pascal, ds, offset aEnd3_txt
call frame_delay pascal, 30
call palette_white_out pascal, 1
call _snd_load c, offset aEnding_m, ds, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
pop cx
call sub_9A7E
call palette_white_in pascal, 4
call _snd_delay_until_measure stdcall, 5
pop cx
mov si, 0A0h
jmp short loc_9B5C
; ---------------------------------------------------------------------------
loc_9B1B:
push si
push 100
lea ax, [si+319]
push ax
push (299 shl 16) or 4
call egc_shift_left
call grcg_setcolor pascal, (GC_RMW shl 16) + 0
lea ax, [si+312]
push ax
push 100
lea ax, [si+319]
push ax
push 299
call grcg_boxfill
call grcg_off
call frame_delay pascal, 1
sub si, 4
loc_9B5C:
cmp si, 36
jg short loc_9B1B
pop si
pop bp
retn
sub_9AD4 endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_9B64 proc near
push bp
mov bp, sp
push si
call load_end_txt pascal, ds, offset aEnd1_txt
call _snd_load c, offset aEnd1_m, ds, SND_LOAD_SONG
kajacall KAJA_SONG_PLAY
pop cx
mov PaletteTone, 0
call far ptr palette_show
graph_accesspage 1
call _pi_slot_load c, 0, offset aEd01_pi, ds
call _pi_slot_palette_apply stdcall, 0
pop cx
call _pi_slot_put c, 0, large 0
freePISlotLarge 0
call palette_black_in pascal, 2
call frame_delay pascal, 40
call egc_quarter_put pascal, 0
mov text_default_fx, (15 or 2 shl 4)
mov text_force_type_fast, 1
call graph_putsa_fx_with_typing pascal, LARGE (144 shl 16 or 332), 44, ds, offset end_buf, 6
call frame_delay pascal, 20
call palette_black_out pascal, 1
call egc_quarter_put pascal, 1
call palette_black_in pascal, 1
ENDTEXT_PRINT_MUTIPLE_LINE 1, 3, 6
call egc_quarter_put pascal, 2
ENDTEXT_PRINT_MUTIPLE_LINE 4, 2, 6
mov text_default_fx, (6 or 2 shl 4)
call graph_putsa_fx_with_typing pascal, LARGE (144 shl 16 or 332), 44, ds, offset end_buf + (END_LINE_LEN * 6), 6
mov text_default_fx, (15 or 2 shl 4)
ENDTEXT_PRINT_MUTIPLE_LINE 7, 3, 6
mov text_default_fx, (6 or 2 shl 4)
call graph_putsa_fx_with_typing pascal, LARGE (144 shl 16 or 332), 44, ds, offset end_buf + (END_LINE_LEN * 10), 6
mov text_default_fx, (15 or 2 shl 4)
call graph_putsa_fx_with_typing pascal, LARGE (144 shl 16 or 332), 44, ds, offset end_buf + (END_LINE_LEN * 11), 6
call frame_delay pascal, 20
call graph_putsa_fx_with_typing pascal, LARGE (144 shl 16 or 332), 44, ds, offset end_buf + (END_LINE_LEN * 12), 6
xor si, si
jmp short loc_9D10
; ---------------------------------------------------------------------------
loc_9CDE:
graph_accesspage 0
call egc_shift_down pascal, (160 shl 16) or 100, (479 shl 16) or 297, 2
push 3
mov ax, si
add ax, ax
mov dx, 198
sub dx, ax
push dx
push 2
call sub_99E4
call frame_delay pascal, 1
inc si