-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathALPHA_E.asm
3773 lines (3421 loc) · 105 KB
/
ALPHA_E.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
; ---------------------------------------------------------------------------
ptr16 struc ; (sizeof=0x4) ; XREF: seg000:executeable_bufferr
; seg000:some_game_ptrr ...
ofs dw ? ; XREF: EXE_HEADER_sub_2:do_relocater
; GAME_START_sub_6+13w ...
segm dw ? ; XREF: EXE_HEADER_sub_2+CBr
; GAME_START_sub_6+63r ...
ptr16 ends
; ---------------------------------------------------------------------------
gfx_block_t struc ; (sizeof=0x18)
filename db 18 dup(?) ; XREF: start_0+30Ao start_0+324o ...
byte_12h db ? ; XREF: read_some_file_sub_4+54r
byte_13h db ? ; XREF: GAME_START_sub_7+1Dr
; start_0+2FBr ...
byte_14h db ? ; XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+5r
byte_15h db ?
word_16h dw ? ; XREF: START_GAME_FEATURE_FLAG_STUFF_sub_21r
gfx_block_t ends
; ---------------------------------------------------------------------------
CommandTail struc ; (sizeof=0x80) ; XREF: sPSPr
count db ?
buffer db 127 dup(?)
CommandTail ends
; ---------------------------------------------------------------------------
; Program segment prefix from dosbox source
sPSP struc ; (sizeof=0x100)
exit_instructions db 2 dup(?) ; XREF: EXE_HEADER_sub_2+140o
; GAME_START_sub_6+13o
next_seg dw ?
fill_1 db ?
far_call db ?
cpm_entry ptr16 ?
int_22 ptr16 ?
int_23 ptr16 ?
int_24 ptr16 ?
psp_parent dw ?
files db 20 dup(?)
environment dw ?
stack dd ?
max_files dw ?
file_table ptr16 ?
prev_psp ptr16 ?
interim_flag db ?
truename_flag db ?
nn_flags dw ?
version_dos dw ?
fill_2 db 14 dup(?)
service db 3 dup(?)
fill_3 db 9 dup(?)
fcb1 db 16 dup(?)
fcb2 db 16 dup(?)
fill_4 db 4 dup(?)
cmdtail_or_dta CommandTail ? ; XREF: GAME_START_sub_6+2Eo ; or DTA
sPSP ends
; ---------------------------------------------------------------------------
; exe header from dosbox source
EXE_Header struc ; (sizeof=0x1C)
signature dw ? ; XREF: EXE_HEADER_sub_2:loc_560r
extrabytes dw ?
pages dw ?
relocations dw ? ; XREF: EXE_HEADER_sub_2+BCr
headersize dw ? ; XREF: EXE_HEADER_sub_2:loc_562r
minmemory dw ?
maxmemory dw ?
initSS dw ? ; XREF: EXE_HEADER_sub_2+E7r
initSP dw ? ; XREF: EXE_HEADER_sub_2+DFr
checksum dw ?
initIP dw ? ; XREF: EXE_HEADER_sub_2+FBr
initCS dw ? ; XREF: EXE_HEADER_sub_2+F1r
reloctable dw ? ; XREF: EXE_HEADER_sub_2+C2r
overlay dw ?
EXE_Header ends
;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2013 Hex-Rays, <[email protected]> |
; | Licensed to: Freeware version |
; +-------------------------------------------------------------------------+
;
; Input MD5 : 7E165FC5FD1AEC1482BC915AB4053D36
; Input CRC32 : E357F62E
; File Name : D:\projects\fun\dos_games_rev\002297_alpha_waves\disk1\ALPHA_E.COM
; Format : MS-DOS COM-file
; Base Address: 1000h Range: 10100h-11BC0h Loaded length: 1AC0h
.286
.model tiny
; ===========================================================================
; Segment type: Pure code
seg000 segment byte public 'CODE'
assume cs:seg000
org 100h
assume es:nothing, ss:nothing, ds:seg000
; =============== S U B R O U T I N E =======================================
; Attributes: noreturn thunk
public start
start proc near
jmp start_0
start endp
; ---------------------------------------------------------------------------
CGA_string db 'CGA' ; DATA XREF: seg000:gfx_string_offset_tableo
db 5 dup(1) ; 0
EGA_string db 'EGA' ; DATA XREF: seg000:gfx_string_offset_tableo
db 5 dup(1) ; 0
TANDY_string db 'TANDY' ; DATA XREF: seg000:gfx_string_offset_tableo
db 5 dup(1) ; 0
HERCULES_string db 48h ; H ; DATA XREF: seg000:gfx_string_offset_tableo
db 45h ; E
db 52h ; R
db 43h ; C
db 55h ; U
db 4Ch ; L
db 45h ; E
db 53h ; S
VGA_string db 'VGA' ; DATA XREF: seg000:gfx_string_offset_tableo
db 5 dup(1) ; 0
gfx_string_offset_table dw offset CGA_string, offset EGA_string, offset TANDY_string; 0
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+3Br
dw offset HERCULES_string, offset VGA_string; 3 ; "CGA"
gfx_type_array db 2, 3, 40h, 80h, 5 ; 0
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+Er
gfx_type_array2 db 2, 3, 2, 1, 5 ; 0
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+2Cr
; __int16 someway_cs_registe_value1
someway_cs_registe_value1 dw 0 ; DATA XREF: GAME_START_sub_7+79w
; GAME_START_sub_7+8Do
db 80h, 0
someway_cs_registe_value2 dw 0 ; DATA XREF: GAME_START_sub_7+7Ew
db 5Ch, 0
someway_cs_registe_value3 dw 0 ; DATA XREF: GAME_START_sub_7+83w
db 6Ch, 0
someway_cs_registe_value4 dw 0 ; DATA XREF: GAME_START_sub_7+88w
; __int16 executeable_buffer
executeable_buffer ptr16 <0> ; DATA XREF: read_some_file_sub_4+20r
; read_some_file_sub_4+3Er ...
;
;
;
; --------------
;
;
; for 4 executables (in this order)
;
; 1. adlib tsr
; 2. tandy tsr
; 3. pc buz tsr
; 4. game
;
;
; --------------
; __int16 some_game_ptr
some_game_ptr ptr16 <0> ; DATA XREF: read_some_file_sub_4+D7w
; read_some_file_sub_4+1B5r ...
word_44 dw 0 ; DATA XREF: read_some_file_sub_4+25w
; read_some_file_sub_4+C2w ...
word_45 dw 0 ; DATA XREF: read_some_file_sub_4+2Cw
; read_some_file_sub_4+C7w ...
far_ptr3 ptr16 <0> ; DATA XREF: GAME_START_sub_5+4Br
; GAME_START_sub_6+3w ...
another_far_ptr ptr16 <0> ; DATA XREF: read_some_file_sub_4:loc_580w
; read_some_file_sub_4+145r ...
somway_exe_buffer_seg dw 0 ; DATA XREF: GAME_START_sub_5+Dr
; GAME_START_sub_5+63r ...
some_register_ss_value dw 0 ; DATA XREF: GAME_START_sub_7+96w
; GAME_START_sub_7+A9r
some_register_sp_value dw 0 ; DATA XREF: GAME_START_sub_7+91w
; GAME_START_sub_7+A4r
maybe_10_ptr ptr16 0Ah dup(<0>) ; DATA XREF: GAME_START_sub_6+5Do
; start_0+35o ...
; ----
;
; https://wiki.osdev.org/MZ is sizeof 28h
;
;
; seems do be always 0???
;
;
; ----
also_a_pointer ptr16 <0> ; DATA XREF: read_some_file_sub_4+137w
; read_some_file_sub_4:loc_584w ...
byte_55 db 0 ; DATA XREF: EXE_HEADER_sub_2+1r
; EXE_HEADER_sub_2+5Cr ...
byte_56 db 0 ; DATA XREF: JOYSTICK_STUFF2_sub_30+7w
; CALIBRATE_JOYSTICK_STUFF_sub_31+Cr ...
byte_57 db 0 ; DATA XREF: GAME_START_sub_3+42o
; GAME_START_sub_3+7Cr ...
byte_569 db 0 ; DATA XREF: GAME_START_sub_3:loc_577r
word_60 dw 0 ; DATA XREF: GAME_START_sub_3+76r
; GAME_START_sub_3+EDr ...
db 4 dup(0)
another_pointer2 ptr16 <0> ; DATA XREF: GAME_START_sub_3+49r
; GAME_START_sub_3+61w ...
word_62 dw 0 ; DATA XREF: EXE_HEADER_sub_2+17w
; EXE_HEADER_sub_2+9Ar ...
some_game_pointer_seg dw 0 ; DATA XREF: EXE_HEADER_sub_2+1Cw
; EXE_HEADER_sub_2+95r ...
new_psp_seg dw 0 ; DATA XREF: EXE_HEADER_sub_2+2Dr
; EXE_HEADER_sub_2+103r ...
; ----
;
; 4x set with int 21h/ah=26h
;
; 1. adlib tsr
; 2. tandy tsr
; 3. pc buz tsr
; 4. game
;
;
; ----
word_558 dw 0 ; DATA XREF: EXE_HEADER_sub_2:loc_557w
some_register_cs_value dw 0 ; DATA XREF: EXE_HEADER_sub_2+12w
register_sp_value dw 0 ; DATA XREF: EXE_HEADER_sub_2+E3w
; EXE_HEADER_sub_2+10Br
register_ss_value dw 0 ; DATA XREF: EXE_HEADER_sub_2+EDw
; EXE_HEADER_sub_2+10Fr
exe_cs_ip_ptr ptr16 <0> ; DATA XREF: EXE_HEADER_sub_2+FFw
; EXE_HEADER_sub_2+129r ...
; __int16 exe_pointer
exe_pointer ptr16 <0> ; DATA XREF: EXE_HEADER_sub_2+21w
; EXE_HEADER_sub_2+57r ...
; __int16 exe_header_pointer
exe_header_pointer ptr16 <0> ; DATA XREF: EXE_HEADER_sub_2+4Dw
; EXE_HEADER_sub_2+85r ...
start_psp dw 0 ; DATA XREF: start_0+11w start_0+8Fr
saved_int1_ptr ptr16 <0> ; DATA XREF: EXE_HEADER_sub_2+3Br
; start_0+9Er ...
saved_5_interrupt_pointers ptr16 5 dup(<0>) ; DATA XREF: start_0+B9o
; INIT_PART_init_stuff_sub_26+4Ao
main_menu_jump_table dw offset start_game ; DATA XREF: start_0+82r
dw offset select_gfx
dw offset shutdown_cleanup
config_tat_gfx_table_offset dw 0 ; DATA XREF: GFX_SELECT_MENU_sub_9+27r
; read_config_and_resize_memory+4Aw ...
; -------------------------------------------
;
;
;
; its a pointer to a uint16_t[5] table of offsets
;
; uint16_t* gfx_related_table
;
;
; contains (i think) the code offsets for each grafic card type in the progs.cc
;
;
;
;
;
; -------------------------------------------
config_tat_game_name_string dw 0 ; DATA XREF: MAIN_MENU_sub_8+1Cr
; MAIN_MENU_sub_8+35r ...
config_tat_publisher_string dw 0 ; DATA XREF: read_config_and_resize_memory+64w
; START_GAME_DOES_FILE_EXIST_sub_19+6Dr
config_tat_content_end dw 0 ; DATA XREF: read_config_and_resize_memory+7Ew
config_tat_filename db 'Config.tat',0 ; DATA XREF: read_config_and_resize_memory+5o
config_tat_disk_name_string dw 0 ; DATA XREF: read_config_and_resize_memory+71w
; SOME_PRINTING_TWO_sub_17+1Cr
config_tat_size dw 0 ; DATA XREF: read_config_and_resize_memory:loc_817w
some_feature_flags dw 1 ; DATA XREF: read_config_and_resize_memory+BCr
; read_config_and_resize_memory+C5w ...
;
;
;
; --------------------------
; bit[ 0] = ??? [active on startup]
; bit[ 1]
; bit[ 2]
; bit[ 3]
; bit[ 4]
; bit[ 5]
; bit[ 6]
; bit[ 7]
; bit[ 8]
; bit[ 9]
; bit[ 10]
; bit[ 11]
; bit[ 12] = joystick detected
; bit[ 13] = currency = franc
; bit[14+15] = mem size type?
; = 00 = 0 (< 0x4000 free paragraphs)
; = 01 = 1 (>= 0x4000 free paragraphs)
; = 10 = 2 (>= 0x6000 free paragraphs)
; = 11 = 3 (>= 0x8000 free paragraphs)
; -------------------------
text_video_seg dw 0B800h ; DATA XREF: SOME_PRINTING_TWO_sub_17+4r
; SOME_PRINTING_sub_18+Dr ...
text_x_offset db 0 ; DATA XREF: MAIN_MENU_sub_8+Bw
; GFX_SELECT_MENU_sub_9+Bw ...
text_y_offset db 0 ; DATA XREF: MAIN_MENU_sub_8+5w
; GFX_SELECT_MENU_sub_9+5w ...
subprogram_exit_code db 0 ; DATA XREF: GAME_START_sub_7+B3w
; start_0+32Fr
dos_version db 0 ; DATA XREF: start_0+1Aw
; interrupt_0x24r
grafic_type_supported_table db 5 dup(0) ; DATA XREF: GFX_SELECT_MENU_sub_9+18o
; GFX_SELECT_MENU_sub_9+23o ...
; ----------------------------
;
;
;
; 5 bytes for the 5 gfx cards in the gfx select menu
;
; gets filled first with 0xFF (not supported)
; and then with the corresponding grafic type nr
; only for checking if the pressed F-Key in SELEC_GFX_MENU
; is valid
;
;
;
;
;
; ---------------------------
word_752 dw 2 dup(0) ; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+1r
; START_GAME_IS_GFX_SUPPORTED_sub_12:loc_92r ...
; [0] = active display
; [1] = alternate display
current_dos_drive db 0 ; DATA XREF: START_GAME_DOES_FILE_EXIST_sub_19+14w
; START_GAME_DOES_FILE_EXIST_sub_19+5Ar
saved_video_mode db 0 ; DATA XREF: start_0+89r
; INIT_PART_init_stuff_sub_26+5w
; __int16 text_not_enough_memory
text_not_enough_memory db 2 dup(0Dh), 3, 10h, 4, 87h, 50h, 72h, 6Fh, 62h, 6Ch
; DATA XREF: START_GAME_FEATURE_FLAG_STUFF_sub_21-21o
db 65h, 6Dh, 5, 2 dup(0Dh), 4 dup(20h), 53h, 6Fh, 2 dup(72h)
db 79h, 2Ch, 6Eh, 6Fh, 74h, 20h, 65h, 6Eh, 6Fh, 75h, 67h
db 68h, 20h, 6Dh, 65h, 6Dh, 6Fh, 72h, 79h, 24h, 0C9h, 16h dup(0CDh)
db 0BBh, 0Dh, 0BAh, 4 dup(20h), 4, 87h, 4Ch, 6Fh, 61h
db 64h, 69h, 6Eh, 67h, 20h, 6 dup(2Eh), 5, 4 dup(20h)
db 0BAh, 0Dh, 0C8h, 16h dup(0CDh), 0BCh, 24h
; __int16 program_load_problem_msg_info
program_load_problem_msg_info db 2 dup(0Dh), 3, 10h, 4, 87h
; DATA XREF: read_config_and_resize_memory:loc_816o
; start_0:some_loading_msg_some_PPI_action_and_back_to_main_menuo
aProblem db 'Problem'
db 5, 2 dup(0Dh), 54h, 68h, 65h, 72h, 65h, 20h, 69h, 73h
db 20h, 61h, 20h, 70h, 72h, 6Fh, 62h, 6Ch, 65h, 6Dh, 20h
db 77h, 69h, 74h, 68h, 20h, 6Ch, 6Fh, 61h, 64h, 69h, 6Eh
db 67h, 20h, 74h, 68h, 65h, 0Dh, 70h, 72h, 6Fh, 67h, 72h
db 61h, 6Dh, 2Eh, 20h, 4Dh, 61h, 6Bh, 65h, 20h, 73h, 75h
db 72h, 65h, 20h, 74h, 68h, 61h, 74h, 20h, 74h, 68h, 65h
db 20h, 70h, 72h, 6Fh, 70h, 65h, 72h, 0Dh, 64h, 69h, 73h
db 6Bh, 20h, 69h, 73h, 20h, 69h, 6Eh, 20h, 74h, 68h, 65h
db 20h, 64h, 72h, 69h, 76h, 65h, 2Eh, 24h
; __int16 text_problem
text_problem db 2 dup(0Dh), 3, 10h, 4, 87h, 50h, 72h, 6Fh, 62h, 6Ch
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+72o
db 65h, 6Dh, 5, 2 dup(0Dh), 59h, 6Fh, 75h, 20h
text_problem4 db 64h, 6Fh, 20h, 6Eh, 6Fh, 74h, 20h, 68h, 61h, 76h, 65h
db 0Dh, 61h
text_problem3 db 6Eh ; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12:loc_624w
db 20h
text_gfx_not_supported db 8 dup(53h), 20h, 63h, 61h, 72h, 64h, 20h, 69h, 6Eh
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+58o
db 73h, 74h, 61h, 2 dup(6Ch), 65h, 64h, 0Dh, 6Fh, 72h
db 20h, 79h, 6Fh, 75h, 72h, 20h, 6Dh, 6Fh, 6Eh, 69h, 74h
db 6Fh, 72h, 20h, 0Dh, 64h, 6Fh, 65h, 73h, 20h, 6Eh, 6Fh
db 74h, 20h, 73h, 75h, 2 dup(70h), 6Fh, 72h, 74h, 20h
text_esc_or_space_message db 8 dup(53h), 2Eh, 0Dh, 50h, 72h, 65h, 2 dup(73h), 20h
; DATA XREF: START_GAME_IS_GFX_SUPPORTED_sub_12+60o
db 45h, 53h, 43h, 20h, 74h, 6Fh, 20h, 63h, 61h, 6Eh, 63h
db 65h, 6Ch, 2Ch, 20h, 53h, 50h, 41h, 43h, 45h, 20h, 74h
db 6Fh, 20h, 63h, 6Fh, 6Eh, 74h, 69h, 6Eh, 75h, 65h, 2Eh
db 2 dup(24h)
; __int16 text_main_menu2
text_main_menu2 db 0Dh, 20h, 0C9h, 0CDh, 2, 23h, 0BBh, 20h, 0Dh, 20h, 0BAh
; DATA XREF: MAIN_MENU_sub_8+44o
text_main_menu db 0Dh dup(20h), 48h, 4Fh, 53h, 54h, 41h, 47h, 45h, 10h dup(20h)
; DATA XREF: MAIN_MENU_sub_8+11o
db 0BAh, 20h, 0Dh, 20h, 0CCh, 0CDh, 2, 23h, 0B9h, 20h
db 0Dh, 20h, 0BAh, 20h, 2, 23h, 0BAh, 20h, 0Dh, 20h, 0BAh
db 0Ch dup(20h), 4Dh, 61h, 69h, 6Eh, 20h, 4Dh, 65h, 6Eh
db 75h, 0Fh dup(20h), 0BAh, 20h, 0Dh, 20h, 0BAh, 20h, 2
db 23h, 0BAh, 20h, 0Dh, 20h, 0BAh, 2 dup(20h), 46h, 31h
db 3 dup(20h), 47h, 61h, 6Dh, 65h, 19h dup(20h), 0BAh
db 20h, 0Dh, 20h, 0BAh, 2 dup(20h), 46h, 32h, 3 dup(20h)
db 53h, 65h, 6Ch, 65h, 63h, 74h, 20h, 76h, 69h, 64h, 65h
db 6Fh, 20h, 63h, 61h, 72h, 64h, 0Ch dup(20h), 0BAh, 20h
db 0Dh, 20h, 0BAh, 2 dup(20h), 46h, 33h, 3 dup(20h), 52h
db 65h, 74h, 75h, 72h, 6Eh, 20h, 74h, 6Fh, 20h, 44h, 4Fh
db 53h, 10h dup(20h), 0BAh, 20h, 0Dh
; __int16 press_a_function_key_text
press_a_function_key_text db 20h, 0BAh, 20h, 2, 23h, 0BAh, 20h, 0Dh, 20h, 0C8h, 0CDh
; DATA XREF: GFX_SELECT_MENU_sub_9+66o
db 2, 23h, 0BCh, 20h, 3 dup(0Dh), 3, 8, 0C9h, 16h dup(0CDh)
db 0BBh, 0Dh, 3, 8, 0BAh, 20h, 50h, 72h, 65h, 2 dup(73h)
db 20h, 61h, 20h, 46h, 75h, 6Eh, 63h, 74h, 69h, 6Fh, 6Eh
db 20h, 4Bh, 65h, 79h, 20h, 0BAh, 0Dh, 3, 8, 0C8h, 16h dup(0CDh)
db 0BCh, 24h
; __int16 select_video_card_text
select_video_card_text db 0Dh, 20h, 0C9h, 0CDh, 2, 23h, 0BBh, 20h, 0Dh, 20h, 0BAh
; DATA XREF: GFX_SELECT_MENU_sub_9+11o
db 8 dup(20h), 53h, 65h, 6Ch, 65h, 63h, 74h, 20h, 56h
db 69h, 64h, 65h, 6Fh, 20h, 43h, 61h, 72h, 64h, 0Bh dup(20h)
db 0BAh, 20h, 0Dh, 20h, 0CCh, 0CDh, 2, 23h, 0B9h, 20h
db 0Dh, 20h, 0BAh, 20h, 2, 23h, 0BAh, 20h, 24h
; __int16 byte_631
byte_631 db 0Dh, 20h, 0C9h, 0CDh, 2, 2Ah, 0BBh, 20h, 0Dh, 20h, 0BAh
; DATA XREF: SOME_PRINTING_THREE_sub_14+17o
db 20h, 2, 2Ah, 0BAh, 20h, 0Dh, 20h, 0CCh, 0CDh, 2, 2Ah
db 0B9h, 20h, 24h
; __int16 byte_632
byte_632 db 20h, 0BAh, 20h, 2, 2Ah, 0BAh, 20h, 24h
; DATA XREF: SOME_PRINTING_THREE_sub_14+21o
; __int16 byte_634
byte_634 db 20h, 0C8h, 0CDh, 2, 2Ah, 0BCh, 20h, 24h
; DATA XREF: SOME_PRINTING_THREE_sub_14+2Co
; __int16 press_a_key_text
press_a_key_text db 0C9h, 0CDh, 2, 14h, 0BBh, 0Dh, 0BAh, 5 dup(20h), 50h
; DATA XREF: SOME_PRINTING_show_msg_box_sub_13+7o
db 72h, 65h, 2 dup(73h), 20h, 61h, 20h, 4Bh, 65h, 79h ;
db 5 dup(20h), 0BAh, 0Dh, 0C8h, 0CDh, 2, 14h, 0BCh, 24h ;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
; byte_630 = grafic card selection
; ---------
; § F1 CGA 4 colors
; § F2 EGA 16 colors
; § F3 Tandy 16 colors
; § F4 VGA 16 colors
; § F5 HERCULES 2 colors
; ---------
grafic_card_types_text_offset dw 568h ; DATA XREF: GFX_SELECT_MENU_sub_9+3Dr
; the offsets at end are the switch HERCULES and VGA offsets
;
; cs:grafic_card_types_text_offset[n] is the offset to the grafic card text line
;
; CGA
dw 591h ; EGA
dw 5BAh ; TANDY
dw 60Ch ; HERCULES
dw 5E3h ; VGA
text_gfx_menu db 20h, 0BAh, 2 dup(20h), 46h, 31h, 3 dup(20h), 43h, 47h ;
db 41h, 6 dup(20h), 34h, 3 dup(20h), 63h, 6Fh, 6Ch, 6Fh ;
db 72h, 73h, 0Ah dup(20h), 0BAh, 20h, 24h, 20h, 0BAh, 2 dup(20h) ;
db 46h, 32h, 3 dup(20h), 45h, 47h, 41h, 6 dup(20h), 31h ;
db 36h, 2 dup(20h), 63h, 6Fh, 6Ch, 6Fh, 72h, 73h, 0Ah dup(20h) ;
db 0BAh, 20h, 24h, 20h, 0BAh, 2 dup(20h), 46h, 33h, 3 dup(20h) ;
db 54h, 61h, 6Eh, 64h, 79h, 4 dup(20h), 31h, 36h, 2 dup(20h) ;
db 63h, 6Fh, 6Ch, 6Fh, 72h, 73h, 0Ah dup(20h), 0BAh, 20h ;
db 24h, 20h, 0BAh, 2 dup(20h), 46h, 34h, 3 dup(20h), 56h ;
db 47h, 41h, 6 dup(20h), 31h, 36h, 2 dup(20h), 63h, 6Fh ;
db 6Ch, 6Fh, 72h, 73h, 0Ah dup(20h), 0BAh, 20h, 24h, 20h ;
db 0BAh, 2 dup(20h), 46h, 35h, 3 dup(20h), 48h, 45h, 52h ;
db 43h, 55h, 4Ch, 45h, 53h, 20h, 32h, 20h, 63h, 6Fh, 6Ch ;
db 6Fh, 72h, 73h, 0Ch dup(20h), 0BAh, 20h, 24h ;
;
; 5 (16bit offset) table in front
; each line is 41 bytes
; line-start+5 is the nr behind the F-Char
; § F1 CGA 4 colors § $
; § F2 EGA 16 colors § $
; § F3 Tandy 16 colors § $
; § F4 VGA 16 colors § $
; § F5 HERCULES 2 colors § $
; __int16 change_insert_disk_text
change_insert_disk_text db 2 dup(0Dh), 3, 0Bh, 4, 87h, 43h, 68h, 61h, 6Eh, 67h
; DATA XREF: START_GAME_DOES_FILE_EXIST_sub_19+9Bo
db 65h, 20h, 44h, 69h, 73h, 6Bh, 5, 2 dup(0Dh), 50h, 6Ch
db 65h, 61h, 73h, 65h, 20h, 69h, 6Eh, 73h, 65h, 72h, 74h
db 20h, 74h, 68h, 65h, 20h, 64h, 69h, 73h, 6Bh, 20h, 6Ch
db 61h, 62h, 65h, 6Ch, 65h, 64h, 0Dh
text_drive_name_placeholder db 20h dup(31h), 0Dh, 69h, 6Eh, 20h, 74h, 68h, 65h, 20h
; DATA XREF: START_GAME_DOES_FILE_EXIST_sub_19+7Fo
; START_GAME_DOES_FILE_EXIST_sub_19+8Ao
db 63h, 75h, 2 dup(72h), 65h, 6Eh, 74h, 20h, 64h, 72h
db 69h, 76h, 65h, 2Eh, 24h
; __int16 text_no_joystick_card_detected
text_no_joystick_card_detected db 2 dup(0Dh), 3, 10h, 4, 87h, 50h, 72h, 6Fh, 62h, 6Ch
; DATA XREF: JOYSTICK_STUFF_sub_29+1Bo
db 65h, 6Dh, 5, 2 dup(0Dh), 8 dup(20h), 4Eh, 4Fh, 20h
db 4Ah, 4Fh, 59h, 53h, 54h, 49h, 43h, 4Bh, 20h, 43h, 41h
db 52h, 44h, 20h, 44h, 45h, 54h, 45h, 43h, 54h, 45h, 44h
db 2Eh, 24h
text_joystick_calibration db 2 dup(0Dh), 3, 0Ah, 4Ah, 6Fh, 79h, 73h, 74h, 69h, 63h
; DATA XREF: JOYSTICK_STUFF2_sub_30+1Eo
db 6Bh, 20h, 43h, 61h, 6Ch, 69h, 62h, 72h, 61h, 74h, 69h
db 6Fh, 6Eh, 2 dup(0Dh), 50h, 6Ch, 65h, 61h, 73h, 65h
db 20h, 68h, 6Fh, 6Ch, 64h, 20h, 73h, 74h, 69h, 63h, 6Bh
db 20h, 61h, 74h, 20h, 70h, 6Fh, 73h, 69h, 74h, 69h, 6Fh
db 6Eh, 20h, 73h, 68h, 6Fh, 77h, 6Eh, 2Eh, 0Dh, 50h, 75h
db 73h, 68h, 20h, 61h, 63h, 74h, 69h, 6Fh, 6Eh, 20h, 62h
db 75h, 2 dup(74h), 6Fh, 6Eh, 20h, 61h, 6Eh, 64h, 20h
db 74h, 68h, 65h, 6Eh, 20h, 72h, 65h, 6Ch, 65h, 61h, 73h
db 65h, 2Eh, 0Dh, 48h, 6Fh, 6Ch, 64h, 20h, 73h, 74h, 69h
db 63h, 6Bh, 20h, 61h, 74h, 20h, 74h, 68h, 69h, 73h, 20h
db 70h, 6Fh, 73h, 69h, 74h, 69h, 6Fh, 6Eh, 20h, 75h, 6Eh
db 74h, 69h, 6Ch, 0Dh, 70h, 6Fh, 73h, 69h, 74h, 69h, 6Fh
db 6Eh, 20h, 72h, 65h, 71h, 75h, 65h, 73h, 74h, 20h, 63h
db 68h, 61h, 6Eh, 67h, 65h, 73h, 2Eh, 24h
; __int16 text_joystick_calibrate_success
text_joystick_calibrate_success db 20h, 0C9h, 3 dup(0CDh), 0BBh, 20h, 0Dh, 20h, 0BAh
; DATA XREF: JOYSTICK_STUFF2_sub_30+47o
; JOYSTICK_STUFF2_sub_30+7Bo ...
byte_378 db 20h ; DATA XREF: JOYSTICK_STUFF2_sub_30+39w
; JOYSTICK_STUFF2_sub_30+77w ...
db 2 dup(20h), 0BAh, 20h, 0Dh, 20h, 0BAh, 20h
byte_376 db 20h ; DATA XREF: JOYSTICK_STUFF2_sub_30+43w
; JOYSTICK_STUFF2_sub_30+6Dw ...
db 20h, 0BAh, 20h, 0Dh, 20h, 0BAh, 2 dup(20h)
byte_377 db 20h ; DATA XREF: JOYSTICK_STUFF2_sub_30+3Fw
; JOYSTICK_STUFF2_sub_30+73w ...
db 0BAh, 20h, 0Dh, 20h, 0C8h, 3 dup(0CDh), 0BCh, 20h, 24h
text_joystick_calibrated_success2 db 2 dup(0Dh), 3, 10h, 47h, 2 dup(4Fh), 44h, 20h, 4Ah
; DATA XREF: JOYSTICK_STUFF2_sub_30+115o
db 4Fh, 42h, 20h, 2 dup(0Dh), 3, 8, 4Ah, 6Fh, 79h, 73h
db 74h, 69h, 63h, 6Bh, 20h, 6Eh, 6Fh, 77h, 20h, 43h, 41h
db 4Ch, 49h, 42h, 52h, 41h, 54h, 45h, 44h, 20h, 21h, 0Dh
db 3, 8, 50h, 72h, 65h, 2 dup(73h), 20h, 61h, 20h, 4Bh
db 65h, 79h, 20h, 6Fh, 72h, 20h, 74h, 68h, 65h, 20h, 42h
db 75h, 2 dup(74h), 6Fh, 6Eh, 24h
; __int16 text_joystick_calibration_error
text_joystick_calibration_error db 2 dup(0Dh), 3, 10h, 4, 87h, 50h, 72h, 6Fh, 62h, 6Ch
; DATA XREF: JOYSTICK_STUFF2_sub_30+104o
db 65h, 6Dh, 5, 2 dup(0Dh), 3, 0Ah, 43h, 61h, 6Ch, 69h
db 62h, 72h, 61h, 74h, 69h, 6Fh, 6Eh, 20h, 45h, 2 dup(52h)
db 4Fh, 52h, 20h, 21h, 0Dh, 3, 7, 50h, 6Ch, 65h, 61h, 73h
db 65h, 2Ch, 63h, 68h, 65h, 63h, 6Bh, 20h, 79h, 6Fh, 75h
db 72h, 20h, 6Ah, 6Fh, 79h, 73h, 74h, 69h, 63h, 6Bh, 2Eh
db 24h
; =============== S U B R O U T I N E =======================================
; void __usercall offset_overflow_safe_block_copy(__int16 dest_seg_@<es>, __int16 dest_ofs_@<di>, __int16 src_seg_@<ds>, __int16 src_ofs_@<si>, __int16 lo_size_@<cx>, __int16 hi_size_@<bx>)
offset_overflow_safe_block_copy proc near ; CODE XREF: EXE_HEADER_sub_2+8Ep
; EXE_HEADER_sub_2+B2p
push ds
push es
push si
push di
push bx
push cx
cld
loc_556: ; CODE XREF: offset_overflow_safe_block_copy+47j
mov ax, si
shr ax, 1
shr ax, 1
shr ax, 1
shr ax, 1
mov dx, ds
add dx, ax
mov ds, dx
and si, 0Fh
mov ax, di
shr ax, 1
shr ax, 1
shr ax, 1
shr ax, 1
mov dx, es
add dx, ax
mov es, dx
and di, 0Fh
mov ax, 512
sub cx, ax
sbb bx, 0
jnb short loc_555
add ax, cx
xor bx, bx
xor cx, cx
loc_555: ; CODE XREF: offset_overflow_safe_block_copy+35j
push cx
mov cx, ax
rep movsb
pop cx
mov ax, cx
or ax, bx
jnz short loc_556
pop cx
pop bx
pop di
pop si
pop es
pop ds
retn
offset_overflow_safe_block_copy endp
; =============== S U B R O U T I N E =======================================
; __int16 __usercall __far EXE_HEADER_sub_2<ax>(__int16 unknown1_@<ax>, __int16 unknown2_@<dx>, __int16 unknown3_@<cx>, __int16 unknown4_@<bx>, __int16 unknown5_@<ds>, __int16 unknown6_@<si>, __int16 unknown6_@<es>, __int16 unknown7_@<di>)
EXE_HEADER_sub_2 proc far ; CODE XREF: GAME_START_sub_7+9Bp
push bx
test cs:byte_55, 0C0h
jnz short loc_557
xor ax, ax
clc
pop bx
retn ; near ret from far proc - manually fixed stack?
; ---------------------------------------------------------------------------
loc_557: ; CODE XREF: EXE_HEADER_sub_2+7j
mov cs:word_558, ax ; something with someway_cs_registe_value1 - lea instruction
mov cs:some_register_cs_value, dx ; = cs
mov cs:word_62, cx ; = some_game_ptr.ofs
mov cs:some_game_pointer_seg, bx ; = some_game_ptr.segm
mov cs:exe_pointer.ofs, si ; = 0
mov cs:exe_pointer.segm, ds ; = somway_exe_buffer_seg + 10h
mov ah, 50h
mov bx, cs:new_psp_seg
int 21h ; DOS - 2+ internal - SET PSP SEGMENT
; BX = segment address of new PSP
push es
push ax
push ds
xor ax, ax
mov es, ax
assume es:nothing
lds ax, dword ptr cs:saved_int1_ptr.ofs ; restore interrupt 1 vector
mov es:4, ax
mov word ptr es:6, ds
pop ds ; src_seg_@
pop ax
pop es ; dest_seg_@
assume es:nothing
cld
mov cs:exe_header_pointer.ofs, di
mov cs:exe_header_pointer.segm, es
lds si, dword ptr cs:exe_pointer.ofs ; unknown_@
test cs:byte_55, 40h
jz short loc_560
jmp loc_561
; ---------------------------------------------------------------------------
loc_560: ; CODE XREF: EXE_HEADER_sub_2+62j
cmp [si+EXE_Header.signature], 'ZM' ; 'MZ' or 'ZM' exe header signature??
jz short loc_562
stc ; no exe header found
pop bx
retn ; near ret from far proc - manually fixed stack?
; ---------------------------------------------------------------------------
loc_562: ; CODE XREF: EXE_HEADER_sub_2+6Bj
mov bx, [si+EXE_Header.headersize] ; exe Header size
xor ax, ax
shl bx, 1 ; bx *= 2;
rcl ax, 1
shl bx, 1 ; bx *= 2;
rcl ax, 1
shl bx, 1 ; bx *= 2;
rcl ax, 1
shl bx, 1 ; bx *= 2;
rcl ax, 1 ;
;
; ==> bx *= 16
; ==> ax contains the hi word
;
; results in a 32bit numbers in ax:bx
;
; uint32_t result = header_paragraphs * 16;
; ax == (result >> 16)); HI
; bx == (result & 0xFFFF)); LO
les di, dword ptr cs:exe_header_pointer.ofs ; dest_ofs_@
mov cx, bx ; lo_size_@
mov bx, ax ; hi_size_@
call offset_overflow_safe_block_copy
mov dx, bx
mov si, cx ; src_ofs_@
mov bx, cs:some_game_pointer_seg
mov cx, cs:word_62
sub cx, si ; lo_size_@
sbb bx, dx ; hi_size_@
mov cs:some_game_pointer_seg, bx
mov cs:word_62, cx
les di, dword ptr cs:exe_pointer.ofs ; dest_ofs_@ -> here is the full exe image
call offset_overflow_safe_block_copy
mov bp, es ; bp = es = load segment = exe_pointer.segm
les bx, dword ptr cs:exe_header_pointer.ofs ; relocate exe segments starts here
mov cx, es:[bx+EXE_Header.relocations]
jcxz short loc_563
mov di, es:[bx+EXE_Header.reloctable]
add di, bx
do_relocate: ; CODE XREF: EXE_HEADER_sub_2+D8j
mov si, es:[di+ptr16.ofs]
mov ax, es:[di+ptr16.segm]
add ax, bp
mov ds, ax
add [si], bp ; bp = load_segment
add di, 4
loop do_relocate
loc_563: ; CODE XREF: EXE_HEADER_sub_2+C0j
les si, dword ptr cs:exe_header_pointer.ofs
mov ax, es:[si+EXE_Header.initSP]
mov cs:register_sp_value, ax
mov ax, es:[si+EXE_Header.initSS]
add ax, bp
mov cs:register_ss_value, ax
mov ax, es:[si+EXE_Header.initCS]
add ax, bp
mov cs:exe_cs_ip_ptr.segm, ax
mov ax, es:[si+EXE_Header.initIP]
mov cs:exe_cs_ip_ptr.ofs, ax
mov es, cs:new_psp_seg
cld
mov di, es
mov ax, cs:register_sp_value
mov dx, cs:register_ss_value
mov cx, cs:word_62
mov bx, cs:some_game_pointer_seg
cli
mov ss, dx ;
;
; --
;
; prepare registers for exe start
;
;
; --
mov sp, ax
mov ds, di
xor ax, ax
push ax
sti
jmp dword ptr cs:exe_cs_ip_ptr.ofs ; jump into game code
; ---------------------------------------------------------------------------
loc_561: ; CODE XREF: EXE_HEADER_sub_2+64j
cli
mov ax, cs:new_psp_seg
mov es, ax
mov ds, ax
mov ss, ax
mov sp, 0FFFFh
xor bx, bx
push bx ; push 0
push ax ; push CS value for retf-jmp
;
; installes the sound TSRs to Interrupt-0xF0
; i think only one is active at a time
;
; 3 retf-jumps are triggered
;
; <-- ax:100h
; 1. Adlib 'IFGM ADLIB'
; 2. Tandy 'IFGM TANDY PSG'
; 3. ADLIB 'IFGM BUZER PC'
;
; then starts the game with the jump above
mov ax, size sPSP ; maybe PSP size
push ax ; push IP value for retf-jmp
mov ax, bx
mov cx, bx
mov dx, bx
mov bp, bx
mov si, bx
mov di, bx
sti
retf ; <----------- RETF-JUMP!!!!
EXE_HEADER_sub_2 endp ;
; returns using old-school-interrupt 22h
;
; target setted in:
;
; GAME_START_sub_6, seg000:0E0A
; mov word ptr ds:sPSP.int_22.segm, cs
; mov word ptr ds:sPSP.int_22, offset subprogram_exit
;
; back into subprogram_exit:
;
; https://wiki.osdev.org/Far_Call_Trick
;
; --------
; =============== S U B R O U T I N E =======================================
; __int16 __usercall GAME_START_sub_3<ax>(__int16 maybe_dest_seg_@<es>, __int16 maybe_dest_ofs1_@<di>, __int16 maybe_src_seg_@<ds>, __int16 maybe_src_ofs_@<si>)
GAME_START_sub_3 proc near ; CODE XREF: GAME_START_sub_3+101j
; read_some_file_sub_4+1EDp
push es
push di
mov cx, 128
mov ax, ds
mov es, ax
assume es:seg000
mov di, 301h ; its not in seg000!!!
xor ax, ax
rep stosw
pop di
pop es
assume es:nothing
push es
xor ax, ax
mov es, ax
assume es:nothing
sub di, es:4
pop es
assume es:nothing
mov ax, di
shr ax, 1
shr ax, 1
shr ax, 1
shr ax, 1
mov cx, es
add cx, ax
mov es, cx
and di, 0Fh
push es
xor ax, ax
mov es, ax
assume es:nothing
add di, es:4
pop es
assume es:nothing
push ds
push es
push si
push di
mov cx, 4
mov di, offset byte_57 ; byte_57 holds 4 bytes - see rep movsb
mov ax, cs
mov es, ax
assume es:seg000
lds si, dword ptr cs:another_pointer2.ofs
mov ax, si
shr ax, 1
shr ax, 1
shr ax, 1
shr ax, 1
mov dx, ds
add ax, dx
mov ds, ax
and si, 0Fh
mov cs:another_pointer2.ofs, si
mov cs:another_pointer2.segm, ds
add cs:another_pointer2.ofs, cx
rep movsb
pop di
pop si
pop es
assume es:nothing
pop ds
mov dx, cs:word_60
inc dx
cmp cs:byte_57, 0
jnz short loc_565
jmp loc_566
; ---------------------------------------------------------------------------
loc_565: ; CODE XREF: GAME_START_sub_3+82j
push ds
push es
push di
xor ch, ch
mov cl, cs:byte_57
mov di, 201h
mov ax, ds
mov es, ax
assume es:seg000
mov ds, cs:another_pointer2.segm
mov si, cs:another_pointer2.ofs
add cs:another_pointer2.ofs, cx
rep movsb
mov cl, cs:byte_57
xor ch, ch
mov di, 1
add cs:another_pointer2.ofs, cx
rep movsb
mov cl, cs:byte_57
mov di, 101h
add cs:another_pointer2.ofs, cx
rep movsb
pop di ; maybe_dest_ofs1_@
pop es ; maybe_dest_seg_@
assume es:nothing
pop ds ; maybe_src_seg_@
xor ch, ch
mov cl, cs:byte_57
xor ah, ah
mov bx, 1
loc_567: ; CODE XREF: GAME_START_sub_3+EBj
mov al, [bx+200h]
mov si, ax ; maybe_src_ofs_@
mov dl, [si+301h]
mov [bx+402h], dl
mov [si+301h], bl
inc bx
loop loc_567
mov dx, cs:word_60
inc dx
mov cx, 1
loc_124: ; CODE XREF: GAME_START_sub_3+123j
; GAME_START_sub_3+16Ej
dec dx
jnz short loc_568
loc_577: ; CODE XREF: GAME_START_sub_3+192j
cmp cs:byte_569, 0
jz short locret_570
jmp GAME_START_sub_3
; ---------------------------------------------------------------------------
locret_570: ; CODE XREF: GAME_START_sub_3+FFj
retn
; ---------------------------------------------------------------------------
loc_568: ; CODE XREF: GAME_START_sub_3+F7j
push ds
mov si, cs:another_pointer2.segm
mov ds, si
mov si, cs:another_pointer2.ofs
lodsb
mov cs:another_pointer2.ofs, si
pop ds
mov bx, ax
cmp byte ptr [bx+301h], 0
jnz short loc_571
stosb
jmp short loc_124
; ---------------------------------------------------------------------------
loc_571: ; CODE XREF: GAME_START_sub_3+120j
mov bl, [bx+301h]
xor ax, ax
push ax
jmp short loc_128
; ---------------------------------------------------------------------------
loc_129: ; CODE XREF: GAME_START_sub_3+164j
; GAME_START_sub_3+174j
mov bp, ax
cmp byte ptr ds:[bp+301h], 0
jz short loc_572
cmp bl, ds:[bp+301h]
ja short loc_573
mov al, bl
mov bl, ds:[bp+301h]
loc_575: ; CODE XREF: GAME_START_sub_3+152j
mov bl, [bx+402h]
or bl, bl
jz short loc_574
cmp bl, al
jb short loc_128
jmp short loc_575
; ---------------------------------------------------------------------------
loc_573: ; CODE XREF: GAME_START_sub_3+13Dj
mov bl, ds:[bp+301h]
loc_128: ; CODE XREF: GAME_START_sub_3+12Cj
; GAME_START_sub_3+150j
mov al, [bx+100h]
mov ah, bl
push ax
xor ah, ah
mov al, [bx]
jmp short loc_129
; ---------------------------------------------------------------------------
loc_574: ; CODE XREF: GAME_START_sub_3+14Cj
mov ax, bp
loc_572: ; CODE XREF: GAME_START_sub_3+136j
stosb
pop ax
or ax, ax
jnz short loc_576
jmp short loc_124
; ---------------------------------------------------------------------------
loc_576: ; CODE XREF: GAME_START_sub_3+16Cj
mov bl, ah
xor ah, ah