-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIZIZ.ASM
6509 lines (5359 loc) · 120 KB
/
IZIZ.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
;=====================================================================
; subject : IZMIR 3D texture mapped SHOOTING game in protected mode
;
; file name : iziz.ASM
;
; coding : Kim Seong-Wan
;
; make : tasm /ml iziz.asm
; wcl386 /fm=izmir /fe=izmir start.obj iziz.obj....
;
; Copyright (C) 1994, 1995 MIRINAE SOFTWARE, Inc.
; License : Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
;
; Under DOS4GW DOS extender
;
; TEXTURE ENGIN developing
; 1994. 10. 28 PM keyboard interrupt handler corrected
; ES segment overriding
; 1994. 11. 3 convert to 13h plane mode routine
; 11. 4 bp vs ebp Bug fixed in procdure hline
; .....
; GAME ENGIN developing
; 1994. 11. 3D collision check routine
; 3D sprite routine
; 12. PM SFX lib
; 3D course script
; 1995. 1. convert to 13h plane mode (X mode) routine
; 2. convert to 13h plane mode (X mode) routine
;================================================================
LOCALS
.386
include keyscan.inc
SC_INDEX equ 03c4h ;Sequence Controller Index
CRTC_INDEX equ 03d4h ;CRT Controller Index
GRP_INDEX equ 03ceh ;Graphic Controller Index
MISC_OUTPUT equ 03c2h ;Miscellaneous Output register
SCREEN_OFF equ 0a0000h ;segment of display memory in Xmode
MAP_MASK equ 02h ;Map Mask register index in SC
START_ADDRESS_HIGH equ 0ch ;start address high db
START_ADDRESS_LOW equ 0dh ;start address low db
COPX equ 1024
LBOUND equ 0
RBOUND equ 319
ABOUND equ 0
BBOUND equ 149
SCROL equ 16
OBJNO equ 40 ;(10 + 20 + 5 + 5 + 2)
BEAMNO equ 10 ; numbers of beam
ENEMYNO equ 20 ; numbers of enemy
BULLETNO equ 5 ; numbers of bullet
FLAMENO equ 5 ; numbers of flame
BEAMTYPENO equ 5 ; numbers of beam type
_GOTO equ 230
TEXMAPLEN equ 102492 ; stage 3
ENMAPLEN equ 8192 ; stage 1
OBJDATLEN equ 618000 ; stage 3
BACKDATLEN equ 27204 ; stage 2
DEAD equ 0 ; stage flag
CLEAR equ 1 ;
ESCAPE equ 2 ;
ON equ 1
OFF equ 0
COPSON equ 30 ;
DELAY equ 50 ; stage clear delay loop counter
BSPEED equ 35 ; enemy bullet speed
BOSSCREA equ 250 ;250 boss creation time
JAX equ 1 ; joystick mask
JAY equ 2 ;
JBX equ 4 ;
JBY equ 5 ;
JABTN1 equ 10h ;
JABTN2 equ 20h ;
JBBTN1 equ 40h ;
JBBTN2 equ 50h ;
DETECTA equ 03h ;
DETECTB equ 0Ch ;
object struc
obj_no dd ? ; 0
x dw ? ; coordinate
y dw ? ;
z dw ? ;
dlx dw ? ; delta x
dly dw ? ; delta y
dlz dw ? ; delta z
ix dw ? ; interaction
iy dw ? ;
iz dw ? ;
interaction dw ? ;
z_clip dw ? ;
sco dw ? ;
stat dd ? ; status
spr_no dd ? ; sprite number
sfactor dd ? ; scale
spr_data dd ? ; pointer of sprite image data
course dd ? ; pointer of course
crea_rt dd ? ; object creation routine
spr_rt dd ? ; sprite routine
course_rt dd ? ; course routine
course_off dd ? ; course offset
object ends
cfgstru struc ; 27 bytes
sound db ?
game_speed db ?
control1 db ?
jaxl dw ?
jaxc dw ?
jaxr dw ?
jayu dw ?
jayc dw ?
jayd dw ?
jbxl dw ?
jbxc dw ?
jbxr dw ?
jbyu dw ?
jbyc dw ?
jbyd dw ?
cfgstru ends
DGROUP group _DATA,_BSS
_DATA segment use32 dword public 'DATA'
;extrn _soundpar: dword
extrn _stagepar: dword
extrn SAVE_CONT: dword
extrn cops_spr_data: dword
extrn beam_spr_data: dword
extrn beam_spr_data2: dword
extrn beam_spr_data3: dword
extrn gcl_spr_data: dword
extrn valk_spr_data: dword
extrn bigf_spr_data: dword
extrn bullet_spr_data1: dword
extrn bullet_spr_data2: dword
extrn flm_spr_data: dword
extrn flm_spr_data2: dword
extrn flm_spr_data3: dword
extrn ship_spr_data: dword
extrn item_spr_data1 : dword
extrn item_spr_data2 : dword
extrn item_spr_data3 : dword
extrn item_spr_data4 : dword
extrn item_spr_data5 : dword
extrn item_spr_data6 : dword
extrn ien_spr_data : dword
extrn isld_spr_data : dword
extrn panback
extrn wnumback
extrn wnumber_spr : dword
extrn snumback
extrn snumber_spr : dword
extrn player_no_spr
eye_x dw COPX ;1024 observer's coordinates
eye_y dw -100 ;
eye_z dw 0 ;
eye_th dw 0 ;observer's viewing direction
d_th dw 64 ;observer's moving direction
dif dw 0 ;forward moving
pers dw 128 ;word perspective factor
th dw 0
xxx dw 0
yyy dw 0
zzz dw 0
align 4
persd dd 128 ;dword perspective factor
;
;----------------------------------------------
XD dd 32
YD dd 25
xxxx dd 0
yyyy dd 0
zzzz dd 0
dii dd 80*25
xl dd 0 ; for cliping
xr dd 0 ;
ya dd 0 ;
yb dd 0 ;
;
sx_start dd 0 ;
sy_start dd 0 ;
put_sprRT dd 0 ;
;----------------------------------------------------
sx dd 0
sy dd 0
sxsy dd 0
sxq dd 0
sy80 dd 0
sxy dd 0
ex1 dw 0
ex2 dw 0
zz dw 0
rx dw 0
ry dw 0
rz dw 0
x1 dw 0
y1 dw 0
z1 dw 0
x2 dw 0
y2 dw 0
z2 dw 0
align 4
xx_ dd 0
yy_ dd 0
zz_ dd 0
xa_ dd 0
ya_ dd 0
za_ dd 0
xa1_ dd 0
za1_ dd 0
xs_ dd 0
zs_ dd 0
lstart dd 0
hdia dd 0
xdd_ dd 0
ydd_ dd 0
ydd dw 0
ydu dw 0
y_d dw 0
yinc dw 0
plane dd 11111111h
maps db 0
align 2
sine dw 0
cosine dw 0
SIN label word
include sintable.inc
PANNEL label word
include pannel.inc
SYSPAL label byte
include syspal.inc
passtry dd 3
passinput dd 0,0,0
passinputX dd 0
passinputY dd 0
passon dd 0
passtable label byte
include pass.inc
align 4
Menu dd 0
oMenu dd 1
_menu0 label dword
dd offset start0, offset help0, offset quit0
_menu1 label dword
dd offset start1, offset help1, offset quit1
start0 label word
dw 88,24
db 88*24 dup(0)
; include start0.spr
start1 label word
dw 88,24
db 88*24 dup(0)
; include start1.spr
help0 label word
dw 88,24
db 88*24 dup(0)
; include help0.spr
help1 label word
dw 88,24
db 88*24 dup(0)
; include help1.spr
quit0 label word
dw 88,24
db 88*24 dup(0)
; include quit0.spr
quit1 label word
dw 88,24
db 88*24 dup(0)
; include quit1.spr
enbar0 label word
include enbar0.spr
enbar label word
include enbar.spr
sldbar0 label word
include sldbar0.spr
sldbar label word
include sldbar.spr
align 4
GAMMA label dword
dd offset GAMMA1, offset GAMMA2, offset GAMMA3, offset GAMMA4
dd offset GAMMA5
gammano dd 0
GAMMA1 label byte
include gamma11.dat
GAMMA2 label byte
include gamma12.dat
GAMMA3 label byte
include gamma13.dat
GAMMA4 label byte
include gamma14.dat
GAMMA5 label byte
include gamma15.dat
maxobj dd 10
maxobjdata dd 10,10,9,12,10,7,10
boss_on dd 0
obj_counter dd 0
file_name00 db "izmir.cfg", 0
file_name01 db "config.dat", 0
PCX_name00 db "menu.pcx",0
PCX_name01 db "helpe.pcx",0
PCX_name02 db "menuitem.pcx",0
file_name dd offset file_name11, offset file_name12
dd offset file_name13, offset file_name14
dd offset file_name15
dd offset file_name21, offset file_name22
dd offset file_name23, offset file_name24
dd offset file_name25
dd offset file_name31, offset file_name32
dd offset file_name33, offset file_name34
dd offset file_name35
dd offset file_name41, offset file_name42
dd offset file_name43, offset file_name44
dd offset file_name45
dd offset file_name51, offset file_name52
dd offset file_name53, offset file_name54
dd offset file_name55
dd offset file_name61, offset file_name62
dd offset file_name63, offset file_name64
dd offset file_name65
dd offset file_name71, offset file_name72
dd offset file_name73, offset file_name74
dd offset file_name75
file_name11 db "texmap1.bod", 0
file_name12 db "enmap1.bod", 0
file_name13 db "object1.bod", 0
file_name14 db "st1.pal", 0
file_name15 db "back1.bod", 0
file_name21 db "texmap2.bod", 0
file_name22 db "enmap2.bod", 0
file_name23 db "object2.bod", 0
file_name24 db "st2.pal", 0
file_name25 db "back2.bod", 0
file_name31 db "texmap3.bod", 0
file_name32 db "enmap3.bod", 0
file_name33 db "object3.bod", 0
file_name34 db "st3.pal", 0
file_name35 db "back3.bod", 0
file_name41 db "texmap4.bod", 0
file_name42 db "enmap4.bod", 0
file_name43 db "object4.bod", 0
file_name44 db "st4.pal", 0
file_name45 db "back4.bod", 0
file_name51 db "texmap5.bod", 0
file_name52 db "enmap5.bod", 0
file_name53 db "object5.bod", 0
file_name54 db "st5.pal", 0
file_name55 db "back5.bod", 0
file_name61 db "texmap6.bod", 0
file_name62 db "enmap6.bod", 0
file_name63 db "object6.bod", 0
file_name64 db "st6.pal", 0
file_name65 db "back6.bod", 0
file_name71 db "endmap.bod", 0
file_name72 db "enmap7.bod", 0
file_name73 db "nameobj.bod", 0
file_name74 db "end.pal", 0
file_name75 db "back7.bod", 0
message00 db "Press any key to start..$"
message01 db "File loading error..$"
align 4
cops_x dw 160 - 20
cops_y dw 104
cops_dx dw 0
cops_dy dw 0
copstat dd 0
Ocops_energy dd 0
cops_energy dd 15
cops_wepon dd 0
wepon_energy dd 999,200, 0, 0, 0, 0, 0, 0
energy_add dd 999,200,150,100, 30, 0, 0, 0
cops_spr_no dd 0
Oshield dd 0
shield dd 0
wnumber dd 0,0,0
score dd 0
snumber dd 0,0,0,0, 0,0,0,0
cops_on dd COPSON
enddelay dd DELAY
godmode dd OFF
RedOut db 0
BlueOut db 0
align 4
;-----------------------------------------------------------------------
beam_type object <100, 0, 0, 0,,,,,,, 0, 800, 0, 1, 0, 0, offset beam_spr_data3, offset beam_course, 0, 1,0,0>
object <101, 0, 0, 0,,,,,,, 0, 800, 0, 2, 0, 0, offset beam_spr_data2, offset beam_course, 0, 1,0,0>
object <102, 0, 0, 0,,,,,,, 0, 800, 0, 3, 0, 64, offset gcl_spr_data, offset gcl_course, 0, 0,0,0>
object <103, 0, 0, 0,,,,,,, 0, 700, 0, 2, 0, 64, offset valk_spr_data, offset valk_course, 0, 0,0,0>
object <104, 0, 0, 0,,,,,,, 0, 800, 0, 4, 0, 64, offset bigf_spr_data, offset bigf_course, 0, 1,0,0>
flm_type object <200, 0, 0, 0,,,,,,, 0, 2500, 0, 0, 0, 128, offset flm_spr_data, 0, 0, 1, 0, 0>
object <201, 0, 0, 0,,,,,,, 0, 2500, 0, 0, 0, 128, offset flm_spr_data2, 0, 0, 1, 0, 0>
object <202, 0, 0, 0,,,,,,, 0, 2500, 0, 0, 0, 128, offset flm_spr_data3, 0, 0, 1, 0, 0>
bullet_type object <300, 0, 0, 0,,,,,,, 0, 1000, 0, 1, 0, 64, offset bullet_spr_data1, 0, 0, 1,0,0>
object <301, 0, 0, 0,,,,,,, 0, 1000, 0, 2, 0, 64, offset bullet_spr_data2, 0, 0, 1,0,0>
ship object <400, 0, -400, 150,,,,,,, 0, 2500, 0, 2, 0, 128, offset ship_spr_data, offset ship_course, 0, 1, 0, 0>
item_type object <500, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data1, offset item_course, 0, 0, 0, 0>
object <501, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data2, offset item_course, 0, 0, 0, 0>
object <502, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data4, offset item_course, 0, 0, 0, 0>
object <503, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data3, offset item_course, 0, 0, 0, 0>
object <504, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data5, offset item_course, 0, 0, 0, 0>
object <505, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset item_spr_data6, offset item_course, 0, 0, 0, 0>
object <506, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset ien_spr_data, offset item_course, 0, 0, 0, 0>
object <507, 0, 0, 0,,,,,,, 0, 2500, 0, 1, 0, 64, offset isld_spr_data, offset item_course, 0, 0, 0, 0>
beam_course label word
dw 202,1+256, 202,3+256, 202,4+256, 202,5+256, 202,6+256
dw _GOTO
dd beam_course
valk_course label word
dw 0,0,0,50, 1,5,5,50, 2,10,10,50, 3,5,5,50
dw 0,0,0,50, 1,-5,-5,50, 2,-10,-10,50, 3,-5,-5,50
dw _GOTO
dd valk_course
gcl_course label word
dw 0,0,0,45, 1,0,5,40, 2,0,10,35, 1,0,15,30
ddown: dw 2,0,20,20
dw 231,0
dd ddown, conti2, conti1
conti1: dw 203,0 ; Y set 0
conti2: dw 1,0,0,30
dw 202,3, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8
dw 3,0,0,45, 202,4, 202,5, 202,6, 202,7, 202,8, -1
bigf_course label word
dw 0,0,0,50
dw 202,1, 202,2, 202,3, 202,4
dw 232,500
dd bigf_course,bigf_course,bloom
bloom:
dw 202,5, 202,6, 202,7, 202,8, 202,9, 202,10
dw 202,11, 202,12, 202,13, 202,14, 202,15, 202,16, -1
ship_course label word
dw 0,0,0,60
dw 0,0,0,60
dw 200,6
dw 0,0,0,60
dw 0,0,0,60
dw 0,0,0,60
dw 1,0,5,60
dw 1,0,5,60
dw 1,0,10,60
dw 1,0,10,60
dw 1,0,10,60
dw 2,0,10,60
rept:
dw 2,0,0,60
dw 232,1200
dd rept,itemgo,itemgo
itemgo:
dw 2,0,0,60
dw 206,6
dw 2,0,0,60
dw 2,0,0,60
dw 2,0,0,60
dw 206,7
dw 2,0,0,60
dw 2,0,0,60
dw 2,0,0,60, -1
item_course label word
dw 0,0,15,0
dw 202,1, 202,2
dw 231,0
dd item_course,icont2,icont1
icont1: dw 203,0
icont2: dw 0,0,0,0, 202,1, 202,2
dw _GOTO
dd icont2
;-----------------------------------------------------------------------
;--------------------------------------------------------------------
align 4
hline dd hline1
hlrtno dd 0
hline_routine dd hline1, hline2, hline3
iix dw 40
iiy dw 40
CourseRoutine label dword
dd cos200, cos201, cos202, cos203, cos204, cos205, cos206, cos207, cos208, cos209
dd cos210, cos211, cos212, cos213, cos214, cos215, cos216, cos217, cos218, cos219
dd cos220, cos221, cos222, cos223, cos224, cos225, cos226, cos227, cos228, cos229
dd cos230, cos231, cos232, cos233, cos234, cos235, cos236, cos237, cos238, cos239
item_routine label dword
dd item505, item506, item507
_DATA ends
;-----------------------------------------------------------------------
_BSS segment dword public use32 'BSS'
public pcx_buffer0
public _vptr
public _l
public keyboard
_vptr dd 0,0,0,0,0,0,0,0,0,0,0,0,0
_l dw 0,0,0,0,0,0,0,0,0,0,0,0,0
Jxmask db ? ; joystick mask
Jymask db ?
Jbtn1 db ?
Jbtn2 db ?
JLTH dw ? ; joystick theres
JRTH dw ?
JUTH dw ?
JDTH dw ?
Pal label byte
db 768 dup(?)
Paltmp label byte
db 768 dup(?)
Paltmp2 label byte
db 768 dup(?)
Tstart dw ?, ? ;clock ticks of start time
Tend dw ?, ? ;clock ticks of end time
frames dd ? ;
fps db ?, ? ;frames per second
esc_on db ?
pass_ok db ?
player_no db ?
align 4
VertRetrace dd ?
DelayTime dd ?
stage_no dd ? ;
stage_flag dd ? ;DEAD
StartOffset dd ? ;visual page
PageOffset dd ? ;active page
tangent dd 200 dup(?)
int09seg dw ?
int09off dd ?
key_hit db ?
keyboard db 128 dup (?)
key_edge db 128 dup (?)
config cfgstru < >
;--------------------------------------------------------------
align 4
obj_ptr dd OBJNO dup(?)
; 64 offset
obj_table label
beam object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
enemy object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
object < >
blt object < >
object < >
object < >
object < >
object < >
flm object < >
object < >
object < >
object < >
object < >
SqrTable dd 10000 dup(?)
sqr1 dd ?
sqr2 dd ?
sqr3 dd ?
aimx dd ?
aimy dd ?
aimz dd ?
seed dd ?
_blx dw ?
_bly dw ?
_flmx dw ?
_flmy dw ?
TEXTBL label dword
dd 23 dup(?)
TEXMAP label dword
dd 16*128 dup(?)
TEX1 label byte
SKY label byte
db TEXMAPLEN - ((16*128)+23)*4 dup (?)
ENMAP label dword
db ENMAPLEN dup(?)
ENMAPOFF dd ENMAPLEN
OldENMAP dd ?
OBJ_DATA label
enemy_type label word
db OBJDATLEN dup(?)
back_spr_data label
db BACKDATLEN dup(?)
pcx_buffer0:
db 65536 dup(?)
pcx_buffer1:
dw ?,?
db 65536 dup(?)
_BSS ends
;-----------------------------------------------------------
;-----------------------------------------------------------
; Code segment
;
;-----------------------------------------------------------
_TEXT segment use32 dword public 'CODE'
assume cs:_TEXT,ds:DGROUP,es:DGROUP
public xmode
extrn sayPCM_ :near
extrn SBLAutoDetect_ :near
extrn initVoice_ :near
extrn setSampleRate_ :near
extrn waitmSec_ :near
extrn SET_SYX :near
extrn STAGE_MUSIC :near
extrn MENU_MUSIC :near
extrn OVER_MUSIC :near
extrn END_MUSIC :near
extrn OPENING :near
extrn PLAY_MUSIC :near
extrn STOP_MUSIC :near
extrn SETTIME :near
extrn INTTIME :near
extrn INTERVIZ :near
;------------------------------------------
; esi : filemame
; edi : pointer
; ecx : file length
;------------------------------------------
load_file proc
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,esi
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov edx,edi
int 21h
jc @@error
mov ah,3eh ; close
int 21h
ret
@@error:
mov ah,09h
mov edx,offset message01 ; "file loading error.."
int 21h
ret
load_file endp
;------------------------------------------
; load map
;------------------------------------------
load_map proc
mov esi,stage_no
imul esi,20
;PAL--------------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,file_name[esi + 12] ; palette
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,768
mov edx,offset Pal ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
;ENMAP--------------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,file_name[esi + 4]
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,ENMAPLEN
mov edx,offset ENMAP ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
;; cmp stage_no,2 ; password chk
;; jl @@skipchk
;; cmp pass_ok,1
;; jne @@error
@@skipchk:
;OBJ----------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,file_name[esi + 8]
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,OBJDATLEN
mov edx,offset OBJ_DATA ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
;BACK----------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,file_name[esi + 16]
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,BACKDATLEN
mov edx,offset back_spr_data ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
;TEXMAP---------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,file_name[esi]
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,TEXMAPLEN
mov edx,offset TEXTBL ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
; texture map table init.
mov ebx,offset TEXTBL
mov edi,offset TEXTBL
mov ecx,23
@@next1:
add dword ptr[edi],ebx
add edi,4
loop @@next1
mov ebx,offset TEXTBL
mov edi,offset TEXMAP
mov ecx,16*128
@@next2:
mov edx,dword ptr[edi]
mov eax,dword ptr[ebx][edx*4]
mov dword ptr[edi],eax
add edi,4
loop @@next2
mov esi,offset SYSPAL
mov edi,offset Pal
mov ecx,76*3
rep movsb
@@error:
ret
load_map endp
;------------------------------------------
;
;------------------------------------------
load_cfg proc
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,OFFSET file_name00 ; "izmir.cfg"
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,4
mov edx,offset gammano ; read file
int 21h
jc @@error
mov ah,3fh
mov ecx,4
mov edx,offset DelayTime ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
;------------------
mov ah,3dh ; open file
mov al,0 ; read only
mov edx,OFFSET file_name01 ; "config.dat"
int 21h
jc @@error
mov bx,ax ; file handle
mov ah,3fh
mov ecx,27 ; 27 bytes
mov edx,offset config ; read file
int 21h
jc @@error
mov ah,3eh ; close
int 21h
@@error:
ret
load_cfg endp
;------------------------------------------
; save izmir.cfg file
;------------------------------------------
save_cfg proc
@@open:
mov ah,3dh ; open file
mov al,1 ; write only
mov edx,OFFSET file_name00
int 21h
jc @@openerror
mov bx,ax ; file handle
mov ah,40h
mov ecx,4
mov edx,offset gammano ; write file
int 21h
jc @@writeerror