-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFile1.asm
1769 lines (1583 loc) · 20.2 KB
/
File1.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
.include "File0.exp" ; include exports from File0.asm
;#DEFINE CHEAT_NODEATH
V_ENEMIES = 4
LIVES_INIT = 10
.ORG $20FD
START0:
JMP START1
;----------------------------------------------------------------------------
;NOTE: Should be started with $XX00 address
ImagesStart:
.include "Images.asm"
.ECHO "Images size: " \ .ECHO ($-ImagesStart) \ .ECHO " bytes.\n"
enemies_msk:
.ds 960
;C_START_VARS:
.ds 64
SpriteStart:
.include "Sprites.asm"
.ECHO "Sprites size: " \ .ECHO ($-SpriteStart) \ .ECHO " bytes.\n"
MapStart:
.include "Map.asm"
.ECHO "Level maps size: " \ .ECHO ($-MapStart) \ .ECHO " bytes.\n"
MapDataStart:
.include "MapData.asm"
.ECHO "Maps data size: " \ .ECHO ($-MapDataStart) \ .ECHO " bytes.\n"
MusicStart:
.include "Music.asm"
.ECHO "Music size: " \ .ECHO ($-MusicStart) \ .ECHO " bytes.\n"
.include "Common.asm"
;----------------------------------------------------------------------------
; Returns: A=key code, $00 no key; Z=0 for key, Z=1 for no key
; Key codes: Fire=$01, Left=$40, Right=$10, Up=$20, Down=$80, VK/PS=$02
ReadKeyboard:
xra a
sta ReadKeyboard_3+1
lxi h,ReadKeyboard_map ; Point HL at the keyboard list
mvi b,3 ; number of rows to check
ReadKeyboard_0:
mov e,m ; get address low
inx h
mov d,m ; get address high
inx h
ldax d ; get bits for keys
mvi c,8 ; number of keys in a row
ReadKeyboard_1:
ral ; shift A left; bit 0 sets carry bit
jc ReadKeyboard_2 ; if the bit is 1, the key's not pressed
mov e,a ; save A
lda ReadKeyboard_3+1
ora m ; set bit for the key pressed
sta ReadKeyboard_3+1
mov a,e ; restore A
ReadKeyboard_2:
inx h ; next table address
dcr c
jnz ReadKeyboard_1 ; continue the loop by bits
dcr b
jnz ReadKeyboard_0 ; continue the loop by lines
ReadKeyboard_3:
mvi a,0 ; set the result; mutable parameter!
ora a ; set/reset Z flag
ret
; Mapping: Left/Right/Down - move, Up - Jump,
; US/SS/RusLat/ZB - fire
ReadKeyboard_map: ; 7 6 5 4 3 2 1 0
.DW KeyLineEx
.DB $01,$01,$01,$00,$00,$00,$00,$00 ; R/L SS US -- -- -- -- --
.DW KeyLine0
.DB $80,$10,$20,$40,$01,$02,$02,$00 ; Dn Rt Up Lt ZB VK PS Tab
.DW JoystickP
.DB $01,$01,$00,$00,$80,$20,$40,$10 ; Fr Fr -- -- Dn Up Lt Rt
;----------------------------------------------------------------------------
START1:
LXI H,V_BOSS_LIVES
MVI A,0
STA V_SOUND
LXI SP,0C000h ;NZ
START:
call SetIntroPalette
MVI A,LIVES_INIT
STA V_LIVES
MVI A,128+32
STA V_CUR_MAP
CALL show_intro
MVI A,0
STA V_CUR_MAP
STA V_CUR_SCR
START_LEV:
CALL show_intro
LXI H,level_maps
LDA V_CUR_MAP
CPI 128
JZ START
RRC
RRC
RRC
RRC
ADD L
MOV L,A
MOV E,M
INX H
MOV D,M ; now DE = addr of packed level
lxi h,0
LXI b,0000h ; BC = addr unpack to ;NZ (was 0)
di ;NZ
call unmlz
mvi a,0C3h ;NZ
sta 38h ;NZ
lxi h,KEYINT ;NZ
shld 38h+1
ei ;NZ
MVI A,C_START_POS_X
STA V_START_X
MVI A,C_START_POS_Y
STA V_START_Y
LDA V_CUR_MAP
RRC
RRC
RRC
RRC
lxi H, level_music
MVI D,0
MOV E,A
DAD D
MOV A,M
INX H
MOV H,M
MOV L,A
SHLD cur_curmusic
CALL INIT_MUSIC
LXI H,note_size_const ;mvi d,8
SHLD FineBeep-3
;COPY SPRITES
LXI D, enemies_img
LXI H, S_Enemy1_1_1
LDA V_CUR_MAP
RRC
RRC
RRC
RRC
RRC
LXI B, 2880 ;3840 - gulman?
strt2: CPI 0
JZ cpy_main
DAD B
DCR A
JMP strt2
cpy_main:
MVI C,10
cpy_sprt2:
MVI B,192
cpy_sprt:
MOV A,M
STAX D
INX H
INX D
DCR B
JNZ cpy_sprt
DCR C
JNZ cpy_sprt2
LXI D, enemies_msk
MVI C,10
cpy_sprt3:
MVI B,96
cpy_sprt4:
MOV A,M
STAX D
INX H
INX D
DCR B
JNZ cpy_sprt4
DCR C
JNZ cpy_sprt3
START_SCR:
MVI a,0
STA V_ICE_DIR
MVI A,C_BOSS_LIVES
STA V_BOSS_LIVES
MVI A,0
STA V_ANI_CYC
LHLD V_START_X
SHLD V_YOU_X
MVI A,0
STA V_TYPE
STA V_YOU_VERT
MVI A,1
STA V_YOU_DIR
CALL SHOW_LIV
JMP INI_2
INI_3: ;new level
LDA V_CUR_MAP
ADI 32
STA V_CUR_MAP
MVI A,0
STA V_CUR_SCR
LDA V_LIVES
INR A
STA V_LIVES
CALL CLR
JMP START_LEV
INI_2:
CALL light_button
LHLD V_YOU_X
SHLD V_START_X
MVI H, 30 ; max rows
MAP_2: MVI L, 31 ; right column number
MAP_1:
PUSH H
LDA V_CUR_SCR
ADD L
MOV L,A
CALL PUT_TILE
POP H
DCR L
JP MAP_1
DCR H
MOV A,H
JP MAP_2
MVI A,5
STA V_SHT_TYP
LXI H,MapData
LDA V_CUR_MAP
RRC
RRC
RRC
RRC
RRC
ADD H
MOV H,A
LDA V_CUR_SCR
ADD L
MOV L,A
MVI A,0
ADC H
MOV H,A
LXI D,C_ENEMY_START
MAP_4:
MOV A,M
STAX D
INX H
INX D
MOV A,E
CPI 32
JNZ MAP_4
LDA V_CUR_SCR
MOV B,A
MVI C,4
LXI H,C_ENEMY_START
MAP_3:
MOV A,M
ADD B ;X += CUR_SRC
MOV M,A
MOV A,L
ADI 5
MOV L,A
DCR C
JNZ MAP_3
MVI L,31
MOV A,M
CPI 254
JNZ MAIN_LOOP
MVI A,C_DARK_SCR
;TODO OUT 193
MVI A,11h ;LXI D
STA V_VISIBILITY
MAIN_LOOP:
hlt ;NZ
LDA V_TIMER
INR A
STA V_TIMER
;LDA V_SHT_TYP
;CPI 5
;CZ play_note
;call play_note
LDA V_ANI_CYC
XRI 00000001b
STA V_ANI_CYC
LDA V_YOU_X
ANI 00011111b
CPI 30
JZ SCREEN_RIGHT
CPI 1
JZ SCREEN_LEFT
LDA V_YOU_Y
CPI 29
JZ SCREEN_DOWN
CPI 0
JZ SCREEN_UP
LXI H, C_ENEMY_START
SHLD V_CUR_ENEMY
CALL CHECK_FALL
LDA V_TYPE
CPI 255
#IFNDEF CHEAT_NODEATH
JZ YOU_DEAD
#ENDIF
CALL readkey
MVI A,0
STA V_YOU_VERT
MAIN_DRAW:
LDA V_TYPE
MOV B,A
LDA V_YOU_DIR
CALL TYPE_TO_DE
LHLD V_YOU_X
MVI C,3 ; number of sprite rows
CALL PUT_SPRITE
LDA V_SHT_TYP
CPI 5
CNZ SHOT_MOV
;CALL do_sound
LDA V_VISIBILITY
STA visibility
LHLD V_CUR_ENEMY
MVI A,V_ENEMIES
ENEMY_LOOP:
MOV B,A
PUSH PSW
MOV A,M
STA V_ENE_X
INX H
MOV A,M
STA V_ENE_Y
INX H
MOV A,M
STA V_ENE_DIR
INX H
MOV A,M
STA V_ENE_MOV_TYP
INX H
MOV A,M
STA V_ENE_TYP
MVI A,18 ;LDA V_CUR_SCR
;ADI 18
ADD B
ADD B
MOV L,A
MVI H,31
MOV A,M
CPI 255
CNZ REDRAW
LDA V_ENE_MOV_TYP
CPI 255
JZ EN_pause
;LDA V_ENE_MOV_TYP
;CPI 1
CALL ENEMY_MOVE
LDA V_TYPE
CPI 255
#IFNDEF CHEAT_NODEATH
JZ YOU_DEAD
#ENDIF
CALL ENEMY_DRAW
EN_L1:
LHLD V_CUR_ENEMY
LDA V_ENE_X
MOV M,A
INX H
LDA V_ENE_Y
MOV M,A
INX H
LDA V_ENE_DIR
MOV M,A
INX H
LDA V_ENE_MOV_TYP
MOV M,A
INX H
LDA V_ENE_TYP
MOV M,A
INX H
SHLD V_CUR_ENEMY
POP PSW
DCR A
JNZ ENEMY_LOOP
MVI A,0 ;LXI D
STA visibility
LDA V_SHT_TYP
CPI 5
CNZ SHOT_DRAW
CALL play_note;do_sound
JMP MAIN_LOOP
SHOW_LIV:
MVI H, 31
MVI L, 31
S_L1:
PUSH H
LDA V_LIVES
DCR A
CMP L
MVI A, C_FACE
JNC S_L2
MVI A,C_EMPTY
S_L2:
CALL PUT_TILE2
POP H
DCR L
JP S_L1
RET
EN_pause:
LXI H, 1800
e_p1:
DCX H
;MOV A,L
;ANI 00111111b
;CPI 00111111b
;JNZ e_p2
;LDA V_SHT_TYP
;CPI 5
;JZ e_p2
;LDA V_SOUND
;XRI 1
;STA V_SOUND
;ORI 10b
;OUT 0C2h
;e_p2:
MOV A,H
CPI 255
JNZ e_p1
jmp EN_L1
YOU_DEAD:
LXI H, G_YOU9
SHLD V_SPRITE
LHLD V_YOU_X
MVI c,3 ; number of sprite rows
CALL PUT_SPRITE
;lxi H, music_dead
;call play_music
LDA V_LIVES
DCR A
STA V_LIVES
CPI 0
JZ START
JMP START_SCR
SCREEN_RIGHT:
LDA V_CUR_SCR
ADI 32
JC INI_3
STA V_CUR_SCR
ADI 2
STA V_YOU_X
JMP INI_2
SCREEN_LEFT:
LDA V_CUR_SCR
SUI 32
JC INI_3
STA V_CUR_SCR
ADI 29
STA V_YOU_X
JMP INI_2
SCREEN_DOWN:
MVI A,2
STA V_YOU_Y
LDA V_CUR_SCR
ADI 128
JC INI_3
STA V_CUR_SCR
LDA V_YOU_X
ADI 128
STA V_YOU_X
JMP INI_2
SCREEN_UP:
MVI A,28
STA V_YOU_Y
LDA V_CUR_SCR
SUI 128
JC INI_3
STA V_CUR_SCR
LDA V_YOU_X
SUI 128
STA V_YOU_X
JMP INI_2
SHOT_DRAW:
LHLD V_SHT_X
CALL PUT_TILE
LDA V_SHT_TYP
CPI 6
JZ DR_M1
ADI 128
STA V_SHT_TYP
ORA A
RAR
ORA A
RAR
ORA A
RAR
LXI H, G_SHT1
ADD L
MOV L,A
SHLD V_SPRITE ; set sprite addr
LHLD V_SHT_X
LDA V_SHT_DIR
ADD L
MOV L,A
SHLD V_SHT_X
LDA V_SHT_DIR
INR A
ORA A
RAR
DCR A
ADD L
MOV L,A
CALL PUT_SPRITE9
INR L
CALL PUT_SPRITE9
RET
DR_M1:
LHLD V_SHT_X
LDA V_SHT_DIR
ADD L
MOV L,A
CALL PUT_TILE
MVI A,5
STA V_SHT_TYP
RET
SHOT_MOV:
LDA V_TIMER
ANI 11b
RLC
RLC
RLC
RLC
ADI 50
STA V_SOUND
LHLD V_SHT_X
LDA V_SHT_DIR
ORA A
RAL
ADD L
MOV L,A
ANI 00011111b
CPI 31
JNC SHOT_END
CPI 0
JZ SHOT_END
MOV A,M
CPI C_BUTTON
JZ SHOT_BUTTON
CPI V_CAN_SHOOT
RC
JMP SHOT_END
SHOT_BUTTON:
CALL PUSH_BUTTON
SHOT_END:
MVI A,6
STA V_SHT_TYP
RET
ENEMY_DEAD:
MVI A,255
STA V_ENE_MOV_TYP
RET
ENEMY_MOVE:
LDA V_ENE_MOV_TYP
CPI 254
JZ ENEMY_DEAD
CPI 0
JZ EN_MOV2
DCR A
STA V_ENE_MOV_TYP
CALL CHECK_ENE_DEAD
RET
DO_SOUND:
MVI C,20
LDA V_SOUND
MOV L,A
MOV H,A
CPI 1
MVI A,0
ACI 0
XRI 1
STA LASER2+1
XRA A
STA V_SOUND
LASER2:
XRI 1
OUT 000h
MOV B,H
LSR3:
DCR B
JNZ LSR3
INR H ; DEC H
DCR C
JNZ LASER2
MOV H,L
RET
EN_MOV2:
CALL CHECK_ENE_DEAD
MOV A,B
CPI 1
JZ EN_MOV1
LHLD V_ENE_X
LDA V_ENE_DIR
MOV C,A
ADD L
MOV L,A
LDA V_ENE_TYP
MOV B,A
CALL CAN_GO
MOV A,B
CPI 0
JZ EN_MOV3
LDA V_ENE_TYP
CPI 2
JZ EN_MOV1
INR H
INR H
MOV A,M
CPI V_CAN_GO
JNC EN_MOV1
CPI V_CAN_UP
JC EN_MOV1
EN_MOV3:
LDA V_ENE_DIR
CALL ROTATE
STA V_ENE_DIR
EN_MOV1:
LHLD V_ENE_X
LDA V_ENE_DIR
MOV C,A
ADD L
MOV L,A
SHLD V_ENE_X
CALL CHECK_ENE_DEAD
LHLD V_ENE_X
MOV A,L
SUB C
SUB C
MOV L,A
SHLD V_TEMP_16
LDA V_ENE_TYP
CPI 2
CZ DRAW_EMPTY2
LDA V_ENE_TYP
CPI 2
CNZ DRAW_EMPTY
RET
REDRAW:
INX H
MOV H,M
MOV L,A
LDA V_CUR_SCR
ADD L
MOV L,A
LDA V_ANI_CYC
MOV B,A
MOV A,M
ADD B
CALL PUT_TILE2
RET
ENEMY_DRAW:
LDA V_ENE_TYP
;type five
CPI 5
ACI 255
DCR A
ANI 10b
RRC
ADI 2
MOV C,A ;2 - small 3- big
LXI H,enemies_msk-Masks_start
LXI D,432
LDA V_ENE_TYP
;type five
CPI 5
ACI 255
;old map format
SUI 3
ANI 11b
INR A
XRI 1
RRC
ANI 11b
INR A
;end old map format
EN_DR_3:
DCR A
JZ EN_DR_2
DAD D
JMP EN_DR_3
EN_DR_2:
MOV A,C
CPI 2
JZ EN_DR_M
LDA V_ENE_MOV_TYP
CPI 254
JZ DRAW_BOOM
CPI 255
JZ DRAW_CLEAR
CPI 0
JZ EN_DR_4
LXI D,288
DAD D
JMP EN_DR_M
EN_DR_4:
LDA V_ENE_DIR
CPI 1
JZ EN_DR_M
LXI D,144
DAD D
JMP EN_DR_M
EN_DR_M:
LDA V_ENE_TYP
CPI 4
JNZ EN_DR_M3
LDA V_ENE_MOV_TYP
CPI 0
JZ EN_DR_M3
CPI 128
JNC EN_DR_M2
JMP EN_DR_M4
EN_DR_M3:
LDA V_TIMER
ANI 1b
CPI 0
JNZ EN_DR_M2
EN_DR_M4:
MOV A,C
RLC
RLC
RLC
MOV D,A
RLC
ADD D
ADD L
MOV L,A
MVI A,0
ADC H
MOV H,A
EN_DR_M2:
SHLD V_SPRITE
LHLD V_ENE_X
CALL PUT_SPRITE
RET
DRAW_BOOM:
MVI A,0 ; LXI D,0
STA visibility
LXI H, M_boom-Masks_start
MVI C,3 ; number of sprite rows
SHLD V_SPRITE
LHLD V_ENE_X
CALL PUT_SPRITE
LDA V_VISIBILITY
STA visibility ; LXI D,V_VISIBILITY
RET
DRAW_CLEAR:
LXI H,000Eh ; MVI C,0
SHLD draw_empty_workaround
LXI H, M_boom-Masks_start
MVI C,3 ; number of sprite rows
SHLD V_SPRITE
LHLD V_ENE_X
CALL PUT_SPRITE
LXI H,4E19h ; DAD D / MOV C,M
SHLD draw_empty_workaround
RET
CHECK_YOU_DEAD:
LHLD V_YOU_X
XCHG
LHLD V_ENE_X
LDA V_ENE_TYP
CPI 2
JNZ CHK_D_Y
MOV A,H
SUB D
CPI 3
JC CHK_D_X
CPI 255
JNC CHK_D_X
RET
CHK_D_Y:
MOV A,H
SUB D
ADI 2
CPI 5
RNC
CHK_D_X:
MOV A,E
SUB L
ADI 2
CPI 5
RNC
MVI A,255
STA V_TYPE
RET
CHECK_ENE_DEAD:
MVI B,0
CALL CHECK_YOU_DEAD
LDA V_SHT_TYP
CPI 5
RZ
LHLD V_SHT_X
XCHG
LDA V_SHT_DIR
ORA A
RAL
ADD E
MOV E,A
LHLD V_ENE_X
MOV A,L
SUB E
INR A
CPI 3
RNC
MOV A,H
SUB D
INR A
CPI 3
RNC
MVI A,5
STA V_SHT_TYP
LHLD V_SHT_X
CALL PUT_TILE
LHLD V_SHT_X
LDA V_SHT_DIR
ADD L
MOV L,A
CALL PUT_TILE
LDA V_ENE_TYP
CPI 2
RZ
MVI B,1
CPI 4
JZ ced4
CPI 5
JZ ced5
MVI A,254
STA V_ENE_MOV_TYP
MVI A,200
STA V_SOUND
RET
ced4:
MVI A,253
STA V_ENE_MOV_TYP
RET
ced5:
LDA V_BOSS_LIVES
DCR A
STA V_BOSS_LIVES
CPI 0
JNZ ced51
MVI A,254
STA V_ENE_MOV_TYP
RET
ced51:
MVI A,C_FREEZE_TIME
STA V_ENE_MOV_TYP
LXI H,C_ENEMY_START+3
repiar_1:
MOV A,M
CPI 254
JC repiar_2
MVI M,0
repiar_2:
MOV A,L
ADI 5
MOV L,A
CPI 19
JC repiar_1
RET
ROTATE:
CPI 1
JZ ROT1
MVI A,1
RET
ROT1:
MVI A,255
RET
do_ice:
MOV C,A
LDA V_YOU_VERT
CPI 0
RNZ
JMP do_mov2
readkey:
call ReadKeyboard
jnz keypressed
;
LDA V_TYPE
ANI 01111111b
CPI 2
RZ
MVI A,0
STA V_TYPE
LDA V_ICE_DIR
CPI 0
JNZ do_ice
ret
keypressed:
mov c,a ;NZ
ani 1 ;NZ