-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzaxxon8_9_AB.asm
9139 lines (7645 loc) · 120 KB
/
zaxxon8_9_AB.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
// disassembly of the ZAXXON.CRT for Commodore64. By Mike Loewen (mikroman)
* = $8000 "8000 cartridge slot"
.word coldstart
.word warmstart
.byte $C3,$C2,$CD,$38,$30 // crt signature bytes
L_JMP_8009_800A:
L_JMP_8009_900A:
sei
jmp L_JMP_8009_800A
coldstart: // cold start area
sei
lda #$00
sta $D016 // Control Register 2
jsr $FDA3 // Initialise I/O
jsr $FD15 // Restore Kernal Vectors
ldx #$0B
lda #$00
sta $3427
L_BRS_8020_8024:
sta $3400,X
dex
bpl L_BRS_8020_8024
jsr L_JSR_81BA_8026
warmstart:
L_JMP_8029_A956:
L_JMP_8029_AA77:
L_JMP_8029_B7B8:
sei
cld
lda #$00
sta $D011 // Control Register 1
jsr L_JSR_B668_8030
L_JMP_8033_A953:
sei
ldx #$FF
txs
jsr L_JSR_8B7E_8037
L_JMP_803A_805E:
L_JMP_803A_8B51:
L_JMP_803A_905E:
L_JMP_803A_9B51:
L_JMP_803A_A5E4:
jsr L_JSR_A961_803A
jsr L_JSR_B47E_803D
jsr L_JSR_B102_8040
jsr L_JSR_B16D_8043
jsr L_JSR_A000_8046
jsr L_JSR_B016_8049
jsr L_JSR_AF16_804C
jsr L_JSR_8061_804F
jsr L_JSR_8AA8_8052
jsr L_JSR_AD71_8055
jsr L_JSR_AB6D_8058
jsr L_JSR_A740_805B
jmp L_JMP_803A_805E
L_JSR_8061_804F:
L_JSR_8061_904F:
lda $2269
bmi L_BRS_8079_8064
dec $342D
bne L_BRS_8079_8069
lda $3426
sta $342D
dec $3420
bne L_BRS_8079_8074
jmp L_JMP_A85B_8076
L_BRS_8079_8064:
L_BRS_8079_8069:
L_BRS_8079_8074:
rts
L_JSR_807A_B020:
lda $10
cmp #$05
bcc L_BRS_80B7_807E
lda $341B
cmp #$01
beq L_BRS_80B7_8085
lda $12
and #$10
lsr
lsr
ora #$50
sta $03
lda $E4
and #$03
ora $03
sta $E4
ldy #$00
L_BRS_809B_80A9:
L_BRS_809B_80B3:
lda ($E3),Y
beq L_BRS_80A7_809D
cmp #$1F
beq L_BRS_80A7_80A1
cmp #$22
bne L_BRS_80BA_80A5
L_BRS_80A7_809D:
L_BRS_80A7_80A1:
L_BRS_80A7_80D0:
inc $E3
bne L_BRS_809B_80A9
inc $E4
lda $E4
and #$03
cmp #$03
bne L_BRS_809B_80B3
inc $E4
L_BRS_80B7_807E:
L_BRS_80B7_8085:
lda #$00
rts
L_BRS_80BA_80A5:
cmp #$3F
beq L_BRS_80D2_80BC
cmp #$A1
beq L_BRS_80D2_80C0
cmp #$53
beq L_BRS_80D2_80C4
cmp #$61
beq L_BRS_80D2_80C8
cmp #$5F
beq L_BRS_80D2_80CC
cmp #$A6
bne L_BRS_80A7_80D0
L_BRS_80D2_80BC:
L_BRS_80D2_80C0:
L_BRS_80D2_80C4:
L_BRS_80D2_80C8:
L_BRS_80D2_80CC:
pha
lda $E3
sta $02
lda $E4
sta $03
jsr L_JSR_80F4_80DB
inc $E3
bne L_BRS_80F0_80E0
inc $E4
lda $E4
and #$03
cmp #$03
bne L_BRS_80F0_80EA
lda #$00
sta $E4
L_BRS_80F0_80E0:
L_BRS_80F0_80EA:
pla
ora #$00
rts
L_JSR_80F4_80DB:
L_JSR_80F4_90DB:
L_JSR_80F4_A3E8:
L_JSR_80F4_A4F2:
lda $02
sta $06
lda $03
and #$03
sec
ldx #$FF
L_BRS_80FF_810C:
inx
sta $07
lda $06
sbc #$28
sta $06
lda $07
sbc #$00
bcs L_BRS_80FF_810C
lda $06
adc #$28
sta $06
lda #$00
asl $06
rol
asl $06
rol
asl $06
rol
sta $07
lda $10
adc #$19
adc $06
sta $06
lda $07
adc #$00
sta $07
lda $11
adc #$04
and #$07
adc #$2E
sta $05
txa
asl
asl
asl
adc $05
sta $05
rts
L_JSR_8142_8C67:
L_JSR_8142_9C67:
L_JSR_8142_B79E:
ldx #$00
ldy #$FE
jmp L_JMP_8162_8146
L_BRS_8149_8167:
cpx $341E
bcs L_BRS_8169_814C
lda #$1B
sta $5371,Y
lda #$1C
sta $5372,Y
lda #$1D
sta $5399,Y
lda #$1E
sta $539A,Y
L_JMP_8162_8146:
L_JMP_8162_9146:
iny
iny
inx
cpx #$06
bne L_BRS_8149_8167
L_BRS_8169_814C:
rts
L_JSR_816A_85C8:
L_JSR_816A_95C8:
ldx #$07
lda #$80
sta $02
lda #$B8
sta $03
lda #$00
sta $04
lda #$40
sta $05
ldy #$00
lda ($02),Y
sta $06
L_BRS_8182_81AD:
inc $02
bne L_BRS_8188_8184
inc $03
L_BRS_8188_8184:
lda ($02),Y
and #$F0
cmp $06
bne L_BRS_81A7_818E
lda ($02),Y
and #$0F
sta $07
inc $02
bne L_BRS_819C_8198
inc $03
L_BRS_819C_8198:
lda ($02),Y
L_BRS_819E_81A3:
jsr L_JSR_81B0_819E
dec $07
bne L_BRS_819E_81A3
beq L_BRS_81AC_81A5
L_BRS_81A7_818E:
lda ($02),Y
jsr L_JSR_81B0_81A9
L_BRS_81AC_81A5:
txa
bpl L_BRS_8182_81AD
rts
L_JSR_81B0_819E:
L_JSR_81B0_81A9:
L_JSR_81B0_919E:
L_JSR_81B0_91A9:
sta ($04),Y
inc $04
bne L_BRS_81B9_81B4
inc $05
dex
L_BRS_81B9_81B4:
rts
L_JSR_81BA_8026:
L_JSR_81BA_9026:
lda #$80
sta $3439
jsr L_JSR_820A_81BF
lda #$08
jsr L_JSR_8246_81C4
L_BRS_81C7_81DC:
lda #$05
jsr L_JSR_829B_81C9
lda $14
and #$10
beq L_BRS_81E0_81D0
lda $14
and #$04
beq L_BRS_81E0_81D6
lda $14
and #$08
bne L_BRS_81C7_81DC
lda #$FF
L_BRS_81E0_81D0:
L_BRS_81E0_81D6:
sta $3439
rts
L_JSR_81E4_8220:
L_JSR_81E4_822B:
L_JSR_81E4_8442:
L_JSR_81E4_844B:
L_JSR_81E4_8456:
L_JSR_81E4_845D:
L_JSR_81E4_9220:
L_JSR_81E4_922B:
L_JSR_81E4_9442:
L_JSR_81E4_944B:
L_JSR_81E4_9456:
L_JSR_81E4_945D:
L_JSR_81E4_A890:
L_JSR_81E4_A89F:
ldy #$00
L_BRS_81E6_81E9:
L_BRS_81E6_81EE:
sta ($02),Y
iny
bne L_BRS_81E6_81E9
inc $03
dex
bne L_BRS_81E6_81EE
rts
L_JSR_81F1_89E1:
L_JSR_81F1_89F0:
L_JSR_81F1_8A20:
L_JSR_81F1_99E1:
L_JSR_81F1_99F0:
L_JSR_81F1_9A20:
sta ($15),Y
lsr
tay
lda $B800,Y
bcs L_BRS_81FE_81F8
lsr
lsr
lsr
lsr
L_BRS_81FE_81F8:
rts
L_JSR_81FF_8B55:
L_JSR_81FF_8C6A:
L_JSR_81FF_9B55:
L_JSR_81FF_9C6A:
ldx #$0F
lda #$00
L_BRS_8203_8207:
sta $2000,X
dex
bpl L_BRS_8203_8207
rts
L_JSR_820A_81BF:
L_JSR_820A_8AC6:
L_JSR_820A_8B0A:
L_JSR_820A_91BF:
L_JSR_820A_9AC6:
L_JSR_820A_9B0A:
L_JSR_820A_A5C7:
L_JSR_820A_A91C:
L_JSR_820A_B675:
L_JSR_820A_B7CD:
sei
lda #$00
sta $D011 // Control Register 1
sta $D020 // Border Color
sta $D418 // Select Filter Mode and Volume
sta $02
lda #$04
sta $03
ldx #$04
lda #$A0
jsr L_JSR_81E4_8220
lda #$D8
sta $03
lda #$00
ldx #$04
jsr L_JSR_81E4_822B
sta $D015 // Sprite display Enable
lda #$00
sta $D016 // Control Register 2
lda #$10
sta $D011 // Control Register 1
lda #$14
sta $D018 // Memory Control Register
lda #$03
sta $DD00 // Data Port A (Serial Bus, RS232, VIC Base Mem.)
rts
L_JSR_8246_81C4:
L_JSR_8246_8ACB:
L_JSR_8246_8B21:
L_JSR_8246_91C4:
L_JSR_8246_9ACB:
L_JSR_8246_9B21:
L_JSR_8246_A5CC:
L_JSR_8246_A921:
L_JSR_8246_B67A:
L_JSR_8246_B67F:
L_JSR_8246_B684:
L_JSR_8246_B689:
L_JSR_8246_B7D2:
asl
tax
lda $8325,X
sta $04
lda $8326,X
sta $05
ldy #$00
lda ($04),Y
sta $02
jsr L_JSR_8294_8258
lda ($04),Y
sta $03
L_JMP_825F_828A:
L_JMP_825F_928A:
jsr L_JSR_8294_825F
L_JMP_8262_8276:
L_JMP_8262_9276:
lda ($04),Y
beq L_BRS_827A_8264
cmp #$FF
beq L_BRS_8279_8268
and #$3F
ora #$80
sta ($02),Y
jsr L_JSR_828D_8270
jsr L_JSR_8294_8273
jmp L_JMP_8262_8276
L_BRS_8279_8268:
rts
L_BRS_827A_8264:
jsr L_JSR_8294_827A
clc
lda ($04),Y
adc $02
sta $02
lda #$00
adc $03
sta $03
jmp L_JMP_825F_828A
L_JSR_828D_8270:
L_JSR_828D_9270:
inc $02
bne L_BRS_829A_828F
inc $03
rts
L_JSR_8294_8258:
L_JSR_8294_825F:
L_JSR_8294_8273:
L_JSR_8294_827A:
L_JSR_8294_9258:
L_JSR_8294_925F:
L_JSR_8294_9273:
L_JSR_8294_927A:
inc $04
bne L_BRS_829A_8296
inc $05
L_BRS_829A_828F:
L_BRS_829A_8296:
rts
L_JSR_829B_81C9:
L_JSR_829B_8AD0:
L_JSR_829B_8B36:
L_JSR_829B_91C9:
L_JSR_829B_9AD0:
L_JSR_829B_9B36:
L_JSR_829B_A5D1:
L_JSR_829B_A92F:
L_JSR_829B_B6C5:
L_JSR_829B_B7E0:
sta $04
lda #$00
sta $EB
lda #$06
sta $06
L_BRS_82A5_8321:
lda #$3C
sta $05
L_BRS_82A9_82AE:
L_BRS_82A9_831B:
lda $D012 // Raster Position
cmp #$36
bne L_BRS_82A9_82AE
lda $02
sta $03
L_BRS_82B4_82CF:
ldy $03
lda $D012 // Raster Position
beq L_BRS_82D1_82B9
L_BRS_82BB_82BE:
cmp $D012 // Raster Position
beq L_BRS_82BB_82BE
sty $D021 // Background Color 0
inc $03
lda $03
and #$0F
bne L_BRS_82CD_82C9
lda #$01
L_BRS_82CD_82C9:
sta $03
bne L_BRS_82B4_82CF
L_BRS_82D1_82B9:
dec $06
bne L_BRS_82E5_82D3
lda #$06
sta $06
inc $02
lda $02
and #$0F
bne L_BRS_82E3_82DF
lda #$01
L_BRS_82E3_82DF:
sta $02
L_BRS_82E5_82D3:
lda $EB
cmp #$02
bcc L_BRS_8319_82E9
jsr L_JSR_8308_82EB
beq L_BRS_8319_82EE
pha
lda $3439
cmp #$80
beq L_BRS_8305_82F6
L_BRS_82F8_82FF:
lda #$00
sta $03
L_BRS_82FC_8303:
jsr L_JSR_8308_82FC
bne L_BRS_82F8_82FF
dec $03
bne L_BRS_82FC_8303
L_BRS_8305_82F6:
pla
sec
rts
L_JSR_8308_82EB:
L_JSR_8308_82FC:
L_JSR_8308_92EB:
L_JSR_8308_92FC:
jsr L_JSR_A961_8308
lda $14
ldx $3439
cpx #$80
beq L_BRS_8316_8312
ora #$0F
L_BRS_8316_8312:
cmp #$FF
rts
L_BRS_8319_82E9:
L_BRS_8319_82EE:
dec $05
bne L_BRS_82A9_831B
inc $EB
dec $04
bne L_BRS_82A5_8321
clc
rts
.byte $39,$83,$4E,$83,$5C,$83,$97,$83
.byte $97,$83,$C9,$83,$DC,$83,$EF,$83
.byte $02,$84,$20,$84,$9A,$05,$50,$4C
.byte $41,$59,$45,$52,$20,$20,$20,$47
.byte $41,$4D,$45,$20,$4F,$56,$45,$52
.byte $FF,$17,$06,$50,$4C,$41,$59,$45
.byte $52,$20,$20,$20,$55,$50,$FF,$94
.byte $05,$53,$55,$50,$45,$52,$20,$5A
.byte $41,$58,$58,$4F,$4E,$20,$20,$43
.byte $4F,$50,$59,$52,$49,$47,$48,$54
.byte $20,$53,$45,$47,$41,$20,$31,$39
.byte $38,$34,$00,$0F,$53,$45,$4C,$45
.byte $43,$54,$20,$31,$20,$4F,$52,$20
.byte $32,$20,$50,$4C,$41,$59,$45,$52
.byte $53,$FF,$9A,$05,$43,$4F,$4E,$47
.byte $52,$41,$54,$55,$4C,$41,$54,$49
.byte $4F,$4E,$53,$21,$21,$21,$20,$59
.byte $4F,$55,$20,$47,$45,$54,$00,$11
.byte $2D,$2D,$2D,$20,$31,$30,$30,$30
.byte $20,$50,$4F,$49,$4E,$54,$53,$20
.byte $2D,$2D,$2D,$FF,$7C,$04,$50,$4C
.byte $41,$59,$45,$52,$20,$31,$20,$53
.byte $43,$4F,$52,$45,$20,$3D,$FF,$A4
.byte $04,$50,$4C,$41,$59,$45,$52,$20
.byte $32,$20,$53,$43,$4F,$52,$45,$20
.byte $3D,$FF,$F4,$04,$48,$49,$47,$48
.byte $45,$53,$54,$20,$20,$53,$43,$4F
.byte $52,$45,$20,$3D,$FF,$97,$05,$4A
.byte $4F,$59,$53,$54,$49,$43,$4B,$20
.byte $4F,$52,$20,$4B,$45,$59,$42,$4F
.byte $41,$52,$44,$20,$28,$4A,$2F,$4B
.byte $29,$3F,$FF,$A0,$05,$54,$55,$4E
.byte $4E,$45,$4C,$20,$49,$4E,$21,$21
.byte $FF
L_JSR_842E_8AD3:
L_JSR_842E_8B46:
L_JSR_842E_8B81:
L_JSR_842E_9AD3:
L_JSR_842E_9B46:
L_JSR_842E_9B81:
L_JSR_842E_A5DE:
lda #$00
sta $D011 // Control Register 1
ldx #$02
lda #$00
L_BRS_8437_843A:
sta $00,X
inx
bne L_BRS_8437_843A
ldy #$02
sty $03
ldx #$32
jsr L_JSR_81E4_8442
ldy #$C0
sty $03
ldx #$20
jsr L_JSR_81E4_844B
lda #$1F
ldy #$50
sty $03
ldx #$08
jsr L_JSR_81E4_8456
lda #$00
ldx #$18
jsr L_JSR_81E4_845D
ldy #$68
lda #$FF
L_BRS_8464_8468:
sta $219F,Y
dey
bne L_BRS_8464_8468
ldy #$00
L_JMP_846C_849E:
L_JMP_846C_949E:
txa
clc
adc $8CFC,Y
tax
iny
lda $8CFC,Y
beq L_BRS_84A1_8476
sta $03
iny
lda $8CFC,Y
sta $04
lsr
lsr
lsr
lsr
sta $05
iny
L_BRS_8487_849C:
lda $05
beq L_BRS_8494_8489
lda $8CFC,Y
sta $5348,X
dec $05
iny
L_BRS_8494_8489:
lda $04
sta $DB48,X
inx
dec $03
bne L_BRS_8487_849C
jmp L_JMP_846C_849E
L_BRS_84A1_8476:
lda $3427
cmp #$01
beq L_BRS_84BA_84A6
ldx #$5D
lda #$08
sta $02
L_BRS_84AE_84B8:
iny
lda $8CFC,Y
sta $5348,X
inx
dec $02
bne L_BRS_84AE_84B8
L_BRS_84BA_84A6:
ldx #$18
L_BRS_84BC_84D0:
lda #$07
sta $DB4E,X
lda #$00
sta $534E,X
sta $534D,X
dex
lda #$02
sta $DB4E,X
dex
bne L_BRS_84BC_84D0
ldx #$0C
L_BRS_84D4_84E5:
lda #$01
sta $DB70,X
sta $DB98,X
lda #$00
sta $5370,X
sta $5398,X
dex
bne L_BRS_84D4_84E5
lda #$02
sta $02
lda #$A0
sta $03
lda #$00
sta $04
sta $06
lda #$58
sta $05
jsr L_JSR_9F25_84F9
jsr L_JSR_9F25_84FC
ldx #$C0
L_JMP_8501_850F:
L_JMP_8501_950F:
ldy #$40
L_BRS_8503_850D:
lda $583F,Y
sta $587F,X
dex
beq L_BRS_8512_850A
dey
bne L_BRS_8503_850D
jmp L_JMP_8501_850F
L_BRS_8512_850A:
lda #$40
sta $04
lda #$59
sta $05
jsr L_JSR_9F25_851A
jsr L_JSR_9F25_851D
lda #$12
sta $07
L_BRS_8524_855F:
lda $07
sta $08
ldx #$00
lda #$15
sta $09
L_BRS_852E_854F:
lda #$03
sta $0A
dec $08
L_BRS_8534_854B:
lda $08
bpl L_BRS_853D_8536
lda #$00
jmp L_JMP_8540_853A
L_BRS_853D_8536:
lda $5980,X
L_JMP_8540_853A:
L_JMP_8540_953A:
inx
sta ($04),Y
inc $04
bne L_BRS_8549_8545
inc $05
L_BRS_8549_8545:
dec $0A
bne L_BRS_8534_854B
dec $09
bne L_BRS_852E_854F
lda $07
sta ($04),Y
inc $04
bne L_BRS_855B_8557
inc $05
L_BRS_855B_8557:
dec $07
dec $07
bne L_BRS_8524_855F
lda #$1C
sta $0D
L_BRS_8565_856A:
jsr L_JSR_9F25_8565
dec $0D
bne L_BRS_8565_856A
lda #$00
sta $07
sta $08
sta $09
lda #$00
sta $0A
lda #$63
sta $0B
L_BRS_857C_85AC:
ldy #$00
lda #$15
sta $0C
L_BRS_8582_8593:
ldx #$00
L_BRS_8584_858F:
lda $5EC0,Y
and $07,X
sta ($0A),Y
iny
inx
cpx #$03
bne L_BRS_8584_858F
dec $0C
bne L_BRS_8582_8593
lda #$15
sta ($0A),Y
lda $0A
clc
adc #$40
sta $0A
bcc L_BRS_85A4_85A0
inc $0B
L_BRS_85A4_85A0:
ldx #$00
L_BRS_85A6_85B1:
sec
ror $07,X
sec
ror $07,X
bcc L_BRS_857C_85AC
inx
cpx #$03