-
Notifications
You must be signed in to change notification settings - Fork 0
/
TRAXX_Kick.asm
3353 lines (2980 loc) · 68.2 KB
/
TRAXX_Kick.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
* = $1200
#import "GameConstants.asm"
#import "Vic20MemoryMap.asm"
#import "TraxxCSKick.asm"
* =$2000 "Program"
cld
// set Screen Map and Character map
// screen = $1000
// colour = $9400
// Character Map = $1400
lda #%11001101
sta VIC. VICCR5
// set up screen colours
// bits 7-4 = background colour
// 0000xxxx black background
// xxxx1xxx inverse text colour on/off (1=text inverse colour off)
// bits 2-0 Boarder colour
// xxxxx000 Black Boarder
lda #%00001000
sta VIC. VICCRF
// set number of character lines
// bits 6 - 1 number of character lines on screen ( x2)
// bit 0 normal hight chars (8x8) if set to 1 (8x16)
lda #%10111100
sta VIC. VICCR3
// set top of screen position
lda #%00011010
sta VIC. VICCR1
// set number of columns for the screen
// bits 6-0 screen width in chars default is 22
lda #%00011001
sta VIC. VICCR2
// set left side position of screen
// bit 7 interlaced mode on/off
// bit 6-0 left edge position default 5
lda #%00001001
sta VIC. VICCR0
jsr DrawScreenHeader
jmp RunTitleScreen //jump 1
Memory1:
// 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18
// --------------------------------------------------------------------------
// 1000 | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// 1019 | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// 1032 | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// 104b | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// 1064 | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// 107d | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
// | | | | | | | | | | | | | | | | | | | | | | | | | |
// --------------------------------------------------------------------------
{
ScreenHeader: // 100 bytes data showing high score
P1_Lives: //2025
.byte $4b,$4b,$4b
//Spaces 2028
.byte $20,$20,$20,$20,$20
.byte $20,$20,$20
Traxx_logo_top: //2049
.byte $41,$42,$43,$44,$45
//Spaces
.byte $20,$20,$20,$20,$20
P2_Lives: //203a
.byte $4b,$4b,$4b
//Spaces (upto Traxx logo bottom)
.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20
Traxx_logo_bottom: //2049
.byte $46,$47,$48,$49,$4a
//Spaces (upto end of line 2)
.byte $20,$20,$20,$20,$20,$20,$20,$20,$20
//pl1
.byte $5a,$31,$20
Player1_score: //205a
.byte $30,$30,$30,$30,$30
//Spaces between scores
.byte $20,$20,$20,$20,$20,$20,$20,$20,$20
//pl2
.byte $5a,$32,$20
Player2_score: //206b
.byte $30,$30,$30,$30,$30
// spaces upto high score
.byte $20,$20,$20,$20,$20,$20,$20,$20,$20
//hi
.byte $6e,$20
High_score: // 207b
.byte $0c,$0c,$01,$0d,$01
//spaces to end line 4
.byte $20,$20,$20,$20,$20,$20,$20,$20,$20
ScreenHeaderColour: // 100bytes data colours
.byte $05,$05,$05
.byte $00,$00,$00,$00,$00,$00,$00,$00,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00
.byte $04,$04,$04
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$03
.byte $03,$03,$03
.byte $03,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$03,$03,$00,$01,$01,$01
.byte $01,$01,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$03,$03,$00,$01,$01
.byte $01,$01,$01,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$01,$00,$03,$03
.byte $03,$03,$03,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00
}
DrawScreenHeader:
// draw first 100 bytes (top 4 lines) to form screen headder
ldy #GAMESETTINGS. ScreenRow * 4
// loop round untill all 100 chars are on screen
!DrawLoop:
lda Memory1.ScreenHeader-1,Y
sta GAMESETTINGS. Screen-1,Y
lda Memory1.ScreenHeaderColour-1,Y
sta GAMESETTINGS. ScreenColour -1,Y
dey
bne !DrawLoop-
rts
nop
DrawGrid:
lda #>GAMESETTINGS. GridStart
sta PAGEZERO. ZP_POINTER_02 + 1
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
lda #<GAMESETTINGS. GridStart
sta PAGEZERO. ZP_POINTER_02
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
ldx #GAMESETTINGS. GridRows
!Col_Loop:
ldy #GAMESETTINGS. GridWidth-1
lda #CHAR.grid_hori
!Row_loop:
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
dey
bne !Row_loop-
lda #CHAR.grid_T_right
ldy #$00 // left start of grid
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
lda #CHAR.grid_T_left
ldy #GAMESETTINGS. GridWidth // right end of grid in chars
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
// skip down 4 rows to draw rest of side T-Pieces
clc
lda PAGEZERO. ZP_GRID_SCREEN_POINTER
adc #GAMESETTINGS. ScreenRow * 4 //4 screen lines
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
lda PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
adc #GAMESETTINGS. CARRY // null for add carry
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
// loop back for next row in grid
dex
bne !Col_Loop-
lda PAGEZERO. ZP_POINTER_02
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
lda PAGEZERO. ZP_POINTER_02 + 1
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
ldy #$00 // reset loop counter
!Col_Loop:
lda #CHAR.grid_T_down
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
ldx #GAMESETTINGS. GridHeight // Height of grid in chars
!Row_loop:
lda PAGEZERO. ZP_GRID_SCREEN_POINTER
clc
adc #GAMESETTINGS. MOVE_POSITION_UP_OR_DOWN
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
lda PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
adc #GAMESETTINGS. CARRY
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
lda #CHAR.grid_vert
sta PAGEZERO. ZP_06
jsr DrawCrossJunctions
nop
nop
nop
nop
nop
nop
nop
lda PAGEZERO. ZP_06
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
dex
bne !Row_loop-
lda #CHAR.grid_T_up
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
lda PAGEZERO. ZP_POINTER_02
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
lda PAGEZERO. ZP_POINTER_02 + 1
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
//Move over 4 chars
iny
iny
iny
iny
nop
cpy #$1C
bne !Col_Loop-
// now lets put in the four corners
lda #CHAR.grid_trc
//set to top right of grid
ldy #$00
sta (PAGEZERO. ZP_POINTER_02),Y
//move to top left of grid
ldy #GAMESETTINGS. GridWidth
lda #CHAR.grid_tlc
sta (PAGEZERO. ZP_POINTER_02),Y
lda #CHAR.grid_blc
ldy #$00
sta GAMESETTINGS. GridStart + (GAMESETTINGS. GridWidth * (GAMESETTINGS. GridHeight+1)),y
ldy #$18
lda #CHAR.grid_brc
sta GAMESETTINGS. GridStart + (GAMESETTINGS. GridWidth * (GAMESETTINGS. GridHeight+1)),Y
rts
DrawCrossJunctions:
lda (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
cmp #CHAR.grid_hori // are we crossing a row?
bne NotCrossingRow
lda #CHAR.grid_cross
sta PAGEZERO. ZP_06
rts
NotCrossingRow:
cmp #CHAR.grid_T_right // are we starting next horizontal row?
bne NotNextGridRow
sta PAGEZERO. ZP_06
rts
NotNextGridRow:
cmp #CHAR.grid_T_left // are we at end of grid row
bne NotEndGridRow
sta PAGEZERO. ZP_06
NotEndGridRow:
rts
ClearPlayScreen:
lda #$10
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
lda #$64
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
ldx #$1A
NotAtEndOfScreen:
ldy #$00
CLR_PlayScreenLoop:
lda #$20
jsr Set_PlayScreenColour
cpy #$1A
bne CLR_PlayScreenLoop
lda PAGEZERO. ZP_GRID_SCREEN_POINTER
clc
adc #$19
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
lda PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
adc #GAMESETTINGS. CARRY
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
dex
bne NotAtEndOfScreen
rts
Set_PlayScreenColour:
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
lda PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
pha
clc
adc #$84
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
lda #$07 //colour yellow
sta (PAGEZERO. ZP_GRID_SCREEN_POINTER),Y
pla
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
iny
rts
// $21E7
.byte $F5,$F5,$F5,$F5,$F5,$F5
.byte $F5,$F5,$F5,$F5,$F5,$F5
.byte $F5,$F5,$F5,$F5,$F5,$F5
.byte $F5,$F5,$F5,$F5,$F5,$F5
.byte $F5
StartGamePlay:
jsr ClearPlayScreen
jsr DrawGrid
lda PAGEZERO. ZP_Pursures
sta PAGEZERO. ZP_Pursures
lda #$0F // Set Max Volume
sta VIC. VICCRE
jsr SUBROUTINE__2E0E_220F_OK
jsr SUBROUTINE__2C1C_2212_OK
jsr SUBROUTINE__2DDD_2215_OK
nop
lda #$03
sta PAGEZERO. ZP_0E
sta PAGEZERO. ZP_0F
lda PAGEZERO. ZP_GameSpeed
sta PAGEZERO. ZP_GameSpeed
sta PAGEZERO. ZP_08
jsr SUBROUTINE__2920_2225_OK
lda #$03
sta PAGEZERO. ZP_14
sta PAGEZERO. ZP_13
lda PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
sta $2A
lda #$10
sta PAGEZERO. ZP_1A + 1
lda PAGEZERO. ZP_Pursures
sta PAGEZERO. ZP_Pursures
lda #$00
sta PAGEZERO. ZP_completedBlk
sta $18
lda #$03
sta PAGEZERO. ZP_20
lda #$1F
sta PAGEZERO. ZP_21
lda PAGEZERO. ZP_Pursures
sta PAGEZERO. ZP_00
nop
nop
nop
nop
MainGameLoop:
// update positions of players and pursuers
jsr SUBROUTINE__28C8_2250_OK
// Get player input
jsr ReadJoystickPort
// play ingame music
jsr PlayInGameMusic
// some sounds messed up when disabled
jsr SUBROUTINE__2A0E_2259_OK
//reset sounds after clompleation of grid block
jsr SUBROUTINE__2A3B_225C_OK
//No noticeably chanhe to gameplay when disabled!!
jsr SUBROUTINE__2B11_225F_OK
//No noticeably chanhe to gameplay when disabled!!
jsr SUBROUTINE__2E9B_2262_OK
//3 nop's added to be able to disable each subroutine above
//nop
//nop
//nop
jmp MainGameLoop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
//Has Stop key been pressed?
jsr KERNAL.ISCNTC
bne MainGameLoop
rts
// $2297
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$ea,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5,$f5,$f5,$f5,$f5,$f5,$f5,$f5
.byte $f5
PursuerData: //2300 - 238f
.byte $96,$10,$00,$07,$50,$39,$11,$01
.byte $b7,$51,$f8,$11,$01,$87,$4f,$06
.byte $12,$01,$b7,$51,$a2,$10,$00,$07
.byte $50,$a6,$10,$00,$b7,$50,$aa,$10
.byte $00,$27,$50,$ae,$10,$00,$27,$50
.byte $af,$10,$02,$b7,$50,$c7,$10,$02
.byte $07,$50,$00,$00,$00,$e3,$00,$00
.byte $5b,$5c,$5d,$5e,$5f,$60,$61,$e4
.byte $01,$19,$00,$00,$00,$00,$00,$00
.byte $56,$01,$02,$03,$00,$58,$00,$02
.byte $03,$04,$4f,$01,$02,$03,$04,$63
.byte $01,$02,$03,$04,$64,$01,$02,$03
.byte $04,$6f,$01,$02,$03,$04,$59,$01
.byte $02,$00,$04,$57,$01,$00,$03,$04
.byte $52,$00,$02,$03,$00,$53,$00,$00
.byte $03,$04,$54,$01,$00,$00,$04,$55
.byte $01,$02,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
InitilizePursuer:
lda PAGEZERO. ZP_00
sta $FD
LoopNumberOfPursuers:
ldx #$00
ldy $FD
LoopPursuerSettings:
inx
inx
inx
inx
inx
dey
bne LoopPursuerSettings
lda PursuerData,X
sta PAGEZERO. ZP_01
lda PursuerData + 1,X
sta PAGEZERO. ZP_POINTER_02
jsr PlacePursuerOnScreen
jsr PlacePursuerSound
dec $FD
bne LoopNumberOfPursuers
rts
PlacePursuerOnScreen:
txa
pha
lda PursuerData + 2,X
tax
lda PursuerData + $38,X
sta ($01),Y
lda PAGEZERO. ZP_POINTER_02
clc
adc #$84
sta PAGEZERO. ZP_POINTER_02
lda #$03
sta ($01),Y
pla
tax
rts
PlacePursuerSound:
txa
pha
tya
pha
ldx #$80
BRANCH_LOOP__23D4_23D8_OK:
BRANCH_LOOP__23D4_23DB_OK:
stx VIC. VICCRD
dey
bne BRANCH_LOOP__23D4_23D8_OK //if y = 0
inx //else
bne BRANCH_LOOP__23D4_23DB_OK //if x = 0
BRANCH_LOOP__23DD_23E1_OK:
BRANCH_LOOP__23DD_23E6_OK:
stx VIC. VICCRD
dey
bne BRANCH_LOOP__23DD_23E1_OK
dex
cpx #$7E
bne BRANCH_LOOP__23DD_23E6_OK
pla
tay
pla
tax
rts
//23ed -23ef
.byte $00,$00,$00
SUBROUTINE__23F0_251E_OK: // ???Move persuer???
lda PursuerData,X
sta PAGEZERO. ZP_01
lda PursuerData + 1,X
sta PAGEZERO. ZP_POINTER_02
lda #$00
sta PAGEZERO. ZP_POINTER_02 + 1
clc
lda ($01),Y
and #$04
bne BRANCH_LOOP__2409_2403_OK
lda #$04
sta PAGEZERO. ZP_POINTER_02 + 1
BRANCH_LOOP__2409_2403_OK:
lda PursuerData + 4,X
sta ($01),Y
lda PAGEZERO. ZP_POINTER_02
clc
adc #$84
sta PAGEZERO. ZP_POINTER_02
lda PursuerData + 3,X
sta ($01),Y
JUMP_BRANCH_241A_2559_OK:
lda PursuerData + 2,X
cmp #$00
beq BRANCH_LOOP__243F_241F_OK
cmp #$02
beq BRANCH_LOOP__243F_2423_OK
cmp #$01
bne BRANCH_LOOP__2434_2427_OK
inc PursuerData + 0,X
bne BRANCH_LOOP__2431_242C_OK
inc PursuerData + 1,X
BRANCH_LOOP__2431_242C_OK:
jmp JUMP_BRANCH_2468_2431_OK
BRANCH_LOOP__2434_2427_OK:
ldy #$01
jsr SUBROUTINE__2532_2436_OK
nop
nop
nop
jmp JUMP_BRANCH_2468_243C_OK
BRANCH_LOOP__243F_241F_OK:
BRANCH_LOOP__243F_2423_OK:
cmp #$02
beq BRANCH_LOOP__2457_2441_OK
nop
nop
nop
jsr SUBROUTINE__2530_2446_OK
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
jmp JUMP_BRANCH_2468_2454_OK
BRANCH_LOOP__2457_2441_OK:
lda PursuerData + 0,X
clc
adc #$19
sta PursuerData + 0,X
lda PursuerData + 1,X
adc #GAMESETTINGS. CARRY
sta PursuerData + 1,X
JUMP_BRANCH_2468_2431_OK:
JUMP_BRANCH_2468_243C_OK:
JUMP_BRANCH_2468_2454_OK:
lda PursuerData + 0,X
sta PAGEZERO. ZP_01
lda PursuerData + 1,X
sta PAGEZERO. ZP_POINTER_02
lda ($01),Y
cmp #$50
beq BRANCH_LOOP__24D8_2476_OK
cmp #$51
beq BRANCH_LOOP__24D8_247A_OK
sta PAGEZERO. ZP_GRID_SCREEN_POINTER
txa
pha
ldy #$0C
ldx #$00
BRANCH_LOOP__2484_2491_OK:
lda PursuerData + $48,X
cmp PAGEZERO. ZP_GRID_SCREEN_POINTER
beq BRANCH_LOOP__2495_2489_OK
inx
inx
inx
inx
inx
dey
bne BRANCH_LOOP__2484_2491_OK
beq BRANCH_LOOP__2508_2493_OK
BRANCH_LOOP__2495_2489_OK:
stx PAGEZERO. ZP_06
pla
tax
lda #$03
jsr SUBROUTINE__28DB_249B_OK
nop
and #$01
beq BRANCH_LOOP__24A7_24A1_OK
lda #$01
sta PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
BRANCH_LOOP__24A7_24A1_OK:
ldy PAGEZERO. ZP_GRID_SCREEN_POINTER + 1
BRANCH_LOOP__24A9_24B9_OK:
JUMP_BRANCH_24A9_24D3_OK:
inc PursuerData + 2,X
lda PursuerData + 2,X
cmp #$04
bne BRANCH_LOOP__24B8_24B1_OK
lda #$00
sta PursuerData + 2,X
BRANCH_LOOP__24B8_24B1_OK:
dey
bne BRANCH_LOOP__24A9_24B9_OK
txa
pha
lda PursuerData + 2,X
sta PAGEZERO. ZP_06 + 1
lda PAGEZERO. ZP_06
clc
adc PAGEZERO. ZP_06 + 1
tax
lda PursuerData + $49,X
cmp #$00
bne BRANCH_LOOP__24D6_24CD_OK
pla
tax
ldy #$02
jmp JUMP_BRANCH_24A9_24D3_OK
BRANCH_LOOP__24D6_24CD_OK:
pla
tax
BRANCH_LOOP__24D8_2476_OK:
BRANCH_LOOP__24D8_247A_OK:
lda PursuerData + 0,X
sta PAGEZERO. ZP_01
lda PursuerData + 1,X
sta PAGEZERO. ZP_POINTER_02
lda ($01),Y
sta PursuerData + 4,X
txa
pha
lda PursuerData + 2,X
clc
adc PAGEZERO. ZP_POINTER_02 + 1
tax
lda PursuerData + $38,X
sta ($01),Y
pla
tax
lda PAGEZERO. ZP_POINTER_02
clc
adc #$84
sta PAGEZERO. ZP_POINTER_02
SUBROUTINE__24FF_3384_BAD:
lda ($01),Y
sta PursuerData + 3,X
lda PAGEZERO. ZP_20
sta ($01),Y
rts
BRANCH_LOOP__2508_2493_OK:
jmp JUMP_BRANCH_2BF8_2508_OK
.byte $00,$00,$00,$00,$00
SUBROUTINE__2510_25E0_OK:
ldy #$00
lda PAGEZERO. ZP_00
sta $FD
BRANCH_LOOP__2516_2523_OK:
lda $FD
asl
asl
clc
adc $FD
tax
jsr SUBROUTINE__23F0_251E_OK
dec $FD
bne BRANCH_LOOP__2516_2523_OK
rts
JUMP_BRANCH_2526_28D1_OK:
dec PAGEZERO. ZP_08
beq BRANCH_LOOP__252B_2528_OK
rts
BRANCH_LOOP__252B_2528_OK:
jmp JUMP_BRANCH_28D4_252B_OK
.byte $00,$00
SUBROUTINE__2530_2446_OK:
ldy #$19
SUBROUTINE__2532_2436_OK:
BRANCH_LOOP__2532_2540_OK:
dec PursuerData + 0,X
lda PursuerData + 0,X
cmp #$FF
bne BRANCH_LOOP__253F_253A_OK
dec PursuerData + 1,X
BRANCH_LOOP__253F_253A_OK:
dey
bne BRANCH_LOOP__2532_2540_OK
rts
JUMP_BRANCH_2543_2C04_OK:
pla
tax
ldy #$02
BRANCH_LOOP__2547_2557_OK:
inc PursuerData + 2,X
lda PursuerData + 2,X
cmp #$04
bne BRANCH_LOOP__2556_254F_OK
lda #$00
sta PursuerData + 2,X
BRANCH_LOOP__2556_254F_OK:
dey
bne BRANCH_LOOP__2547_2557_OK
jmp JUMP_BRANCH_241A_2559_OK
.byte $00,$00,$00,$00
// read Keyboard?
ReadJoystickPort:
sei
ldx #$7F // %0111 1111
stx VIA. VIA2DDRB
!loop:
ldy VIA. VIA2PB
cpy VIA. VIA2PB
bne !loop-
ldx #$FF // %1111 1111
stx VIA. VIA2DDRB
ldx #$F7 // %1111 0111
stx VIA. VIA2PB
cli
!loop:
lda VIA. VIA1PA2
cmp VIA. VIA1PA2
bne !loop-
pha
// L DU
and #$1C // %0001 1100
lsr // %0000 1110
cpy #$80 // $1000 0000
bcc SkipNoFire
// R LDU
ora #$10 // %0001 1110
SkipNoFire:
tay
pla
and #$20 // %00100000
cmp #$20
tya
ror
eor #$8F // %10001111
sta PAGEZERO. JOYSTICK_DIR
rts
.byte $00,$00,$00,$00,$00,$00,$00,$00
JUMP_BRANCH_25A0_2BA6_OK:
SUBROUTINE__25A0_2D5E_OK:
SUBROUTINE__25A0_2D61_OK:
JUMP_BRANCH_25A0_2E20_OK:
SUBROUTINE__25A0_2E8F_OK:
lda #$C7
sta PAGEZERO. ZP_01
lda #$96
sta PAGEZERO. ZP_POINTER_02
ldy #$05
lda #$02
BRANCH_LOOP__25AC_25AF_OK:
sta ($01),Y
dey
bne BRANCH_LOOP__25AC_25AF_OK
inc PAGEZERO. ZP_01
inc PAGEZERO. ZP_01
lda PAGEZERO. ZP_01
sta $2600
lda #$12
sta $2601
lda #$51
sta $2602
lda #$01
sta $2603
lda #$00
sta $2604
lda #$12
sta PAGEZERO. ZP_POINTER_02
lda #$4C
sta ($01),Y
lda #$02
sta $2608
rts
//25dc
.byte $00,$00,$00,$00
JUMP_BRANCH_25E0_28D8_OK:
jsr SUBROUTINE__2510_25E0_OK
jmp JUMP_BRANCH_2620_25E3_OK
//25e6
.byte $00,$00,$00,$00,$00,$00,$00,$00
//25ee
.byte $00,$00,$00,$00,$00,$00,$00,$00
//25f6
.byte $00,$00,$00,$00,$00,$00,$00,$00
//25fe
.byte $00,$04,$A6,$10,$50,$00
//2604
.byte $00,$00,$00,$00,$07
//2609
.byte $4B,$4C,$4D,$4E
//260d
.byte $00,$00,$00,$00,$00,$00,$00,$00
//2615
.byte $00,$00,$00,$00,$00,$00,$00,$00
//26d1
.byte $00,$00,$00
JUMP_BRANCH_2620_25E3_OK:
JUMP_BRANCH_2620_2BB4_OK:
lda $2600
sta PAGEZERO. ZP_01
lda $2601
sta PAGEZERO. ZP_POINTER_02
ldy #$00
lda ($01),Y
ldx $2603
cmp $2609,X
beq BRANCH_LOOP__2639_2634_OK
jmp JUMP_BRANCH_2B91_2636_OK
BRANCH_LOOP__2639_2634_OK:
lda #$00
sta PAGEZERO. ZP_0B
lda $2602
sta ($01),Y
lda PAGEZERO. ZP_POINTER_02
clc
adc #$84
sta PAGEZERO. ZP_POINTER_02
lda $2608
sta ($01),Y
lda $2602
cmp #$50
bne BRANCH_LOOP__265C_2653_OK
lda #$03
sta PAGEZERO. ZP_0B
jmp JUMP_BRANCH_26A7_2659_OK
BRANCH_LOOP__265C_2653_OK:
cmp #$51
bne BRANCH_LOOP__2667_265E_OK
lda #$0C
sta PAGEZERO. ZP_0B
jmp JUMP_BRANCH_26A7_2664_OK
BRANCH_LOOP__2667_265E_OK:
ldx #$00
ldy #$0C
lda $2602
BRANCH_LOOP__266E_2679_OK:
cmp PursuerData + $48,X
beq BRANCH_LOOP__267B_2671_OK
inx
inx
inx
inx
inx
dey
bne BRANCH_LOOP__266E_2679_OK
BRANCH_LOOP__267B_2671_OK:
lda PursuerData + $49,X
beq BRANCH_LOOP__2686_267E_OK
lda #$01
ora PAGEZERO. ZP_0B
sta PAGEZERO. ZP_0B
BRANCH_LOOP__2686_267E_OK:
lda PursuerData + $4A,X
beq BRANCH_LOOP__2691_2689_OK
lda #$08