-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6502Racing.asm
1141 lines (969 loc) · 39 KB
/
6502Racing.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
; --6502 Racing--
;
; Created by Bryan McClain
;=========================Variables=======================
*=$0000
ScreenIndirect: ;2 Bytes - Used for loading a full screen (32x32 pixels)
ScreenIndirectL: ;Low byte of indirect screen access
*=$0001
ScreenIndirectH: ;High byte of indirect screen access
*=$0002
ScreenData: ;2 Bytes - Where the screen data is stored in memory
ScreenDataL: ;Low byte of indirect screen data access
*=$0003
ScreenDataH: ;High byte of indirect screen data access
*=$0004
ScreenIdx: ;Index in ScreenIndirect
HorseIdx: ;Index of the current horse in the main loop
*=$0005
ScreenDataIdx: ;Index in ScreenData
*=$0006
PlayerHorse: ;What color horse did the player choose to win (0 to 6)
*=$0007
WinningHorse: ;What color horse actually won the race? (0 to 6)
*=$0008
HorseIndirect: ;14 Bytes - Stores indirect pointers to all of the horses on the screen
HorseIndirectL: ;Low byte for indirect horse access
*=$0009
HorseIndirectH: ;High byte for indirect horse access
*=$0016
HorseSpotColor: ;7 Bytes - Color of the current spot for the horse
;=========================Registers=======================
*=$00fe
Random: ;$FE = Random number generator (special memory address)
*=$00ff
Keyboard: ;$FF = Keyboard input (special memory address)
;======================Main Function======================
*=$0600 ;Code starts at $0600
Reset:
JSR ComprosoftIntro ;Program always starts with the Comprosoft Intro
__replay:
JSR TitleScreen ;Show the Title Screen for the race
JSR ChooseHorseColor ;Let the player bet on a horse
JSR ResetRaceData ;Reset everything needed to run the race
JSR RaceIntro ;Cool animation where the horses come out to play
JSR DoRace ;Moves the horses along the track
JSR RaceEnd ;Displays the "You Win" or "You Lose" signs
JMP __replay
;=======================Comprosoft Intro======================
ComprosoftIntro:
LDY #$A9 ;First underscore starts at $03A9
JSR ComShowUnderscore
LDA #$05 ;Draw the "C"
STA $0329 ; .XXX
STA $032A ; X...
STA $032B ; X...
STA $0348 ; X...
STA $0368 ; .XXX
STA $0388
STA $03A9
STA $03AA
STA $03AB
LDY #$AD ;Second underscore starts at $03AD
JSR ComShowUnderscore
LDA #$05 ;Draw the ":"
STA $034D ; ...
STA $038D ; .X.
; ...
; .X.
; ...
LDY #$B0 ;Third underscore starts at $03B0
JSR ComShowUnderscore
LDA #$05 ;Draw the "\"
STA $032F ; X..
STA $034F ; X..
STA $0370 ; .X.
STA $0391 ; ..X
STA $03B1 ; ..X
LDY #$B3 ;Fourth underscore starts at $03B3
JSR ComShowUnderscore
LDA #$05 ;Draw the ">"
STA $0333 ; X..
STA $0354 ; .X.
STA $0375 ; ..X
STA $0394 ; .X.
STA $03B3 ; X..
LDY #$B7 ;Final underscore starts at $03B7
JSR ComShowUnderscore
;Draw the text for "Presents"
LDX #$00
LDY #$00
ComPresents:
LDA ComPresentsText,X ;Load a color from the data
LSR ;Extract the left color by shifting right 4 bits
LSR
LSR
LSR
STA $0420,Y ;Store the color to the screen
LDA ComPresentsText,X ;Load a color from the data
AND #$0F ;Extract the right color using a bitwise AND with 0x0F
INY
STA $0420,Y ;Store the color to the screen
INX
INY
CPX #$50 ;We repeat this loop 80 times
BNE ComPresents
LDX #$00 ;Wait two more times before starting the main code
LDY #$00
JSR ComWait
LDX #$00
LDY #$00
JSR ComWait
RTS ;Return out of this subroutine (and back to the main program)
;Temporarily flash the underscore
; Y = Starting coordinate in $0300
ComShowUnderscore:
LDA #$05 ;Set color to light green
STA $0300, Y ;Draw "_" symbol
STA $0301, Y
STA $0302, Y
STY $00 ;Store Y in a temporary spot
LDX #$00
LDY #$00
JSR ComWait ;Do a short delay
LDY $00 ;Restore Y from the temporary spot
LDA #$00 ;Set color to black
STA $0300, Y ;Draw "_" symbol
STA $0301, Y
STA $0302, Y
RTS
;Short delay function for the Comprosoft intro
ComWait:
INX
CPX #$00
BNE ComWait
INY
CPY #$20
BNE ComWait
RTS
;Byte code data for the text "Presents"
; Each byte stores two colors
ComPresentsText:
DCB $05,$50,$05,$50,$05,$55,$00,$55,$05,$50,$55,$00,$55,$50,$05,$50
DCB $05,$05,$05,$05,$05,$00,$05,$00,$05,$00,$50,$50,$05,$00,$50,$00
DCB $05,$50,$05,$50,$05,$50,$00,$50,$05,$50,$50,$50,$05,$00,$05,$00
DCB $05,$00,$05,$05,$05,$00,$00,$05,$05,$00,$50,$50,$05,$00,$00,$50
DCB $05,$00,$05,$05,$05,$55,$05,$50,$05,$50,$50,$50,$05,$00,$55,$00
;======================Show Title Screen======================
TitleScreen:
;Load the Title Screen image
LDA #<Screen_Title
STA ScreenDataL
LDA #>Screen_Title
STA ScreenDataH
JSR DrawScreen
;Wait for the user to push the "S" key on the keyboard
LDA #$00
STA Keyboard ;Reset the user input
__tinput:
LDA Keyboard
CMP #$73 ; "S" key = 115
BNE __tinput
RTS
;===================Color Select Screen======================
ChooseHorseColor:
;Load the color select screen image
LDA #<Screen_ChooseColor
STA ScreenDataL
LDA #>Screen_ChooseColor
STA ScreenDataH
JSR DrawScreen
;Wait for user to input a number
LDA #$00
STA Keyboard ;Reset the keyboard input
__ninput:
;Somehow, there is a glitch on 6502asm.com with the Carry Flag
; Therefore, I have to write an ugly work around :(
;
;Old Code: (Very elegant and *should* work)
; LDA Keyboard ;Load a key from the keyboard
; CMP #$31 ;Test keyboard against "1" key ($31)
; BCC __ninput ;If Acc < $31, then carry flag is clear
; CMP #$38 ;Test keyboard against "8" key ($37)
; BCS __ninput ;If Acc >= $38, then carry flag is set
LDA Keyboard
CMP #$31 ; Case "1"
BEQ __nvalid
CMP #$32 ; Case "2"
BEQ __nvalid
CMP #$33 ; Case "3"
BEQ __nvalid
CMP #$34 ; Case "4"
BEQ __nvalid
CMP #$35 ; Case "5"
BEQ __nvalid
CMP #$36 ; Case "6"
BEQ __nvalid
CMP #$37 ; Case "7"
BEQ __nvalid
JMP __ninput
__nvalid:
;We know that this is a valid horse (1 to 7)
SEC
SBC #$31 ;Subtract $31 ("1") to make the horse a number from 0 to 6
STA PlayerHorse
RTS
;=======================Reset all Race Data======================
ResetRaceData:
LDA #$00
TAX ;X = Counter that increases by 1 each time
TAY ;Y = Counter that increases by 2 each time
__reset_loop:
LDA #$07 ;$07 = Color of the race track
STA HorseSpotColor, X ;Reset the color of the current spot where the horse is
LDA HorseOffsetL, X
STA HorseIndirectL, Y ;Reset low indirect offset
LDA HorseOffsetH, X
STA HorseIndirectH, Y ;Reset the high indirect offset
INY ;Add 2 to the Y counter
INY
INX ;Add 1 to the X counter
CPX #7 ;Loop through all 7 horses
BNE __reset_loop
RTS
;=======================Race Intro Animation=====================
;Cute little animation to start the race
RaceIntro:
;Draw the track screen
LDA #<Screen_Track
STA ScreenDataL
LDA #>Screen_Track
STA ScreenDataH
JSR DrawScreen
;Place the racers one by one
LDX #$00 ;X = Counter that increases by 2
LDY #$00 ;Y = Counter that increases by 1
__place_horse_loop:
LDA HorseColors, Y
STA ($08, X) ;$08 = Horse Indirect (won't assembly otherwise)
TXA ;Store X temporarily in A
JSR LongWait ;Add some delay for the animation to work
TAX ;Restore X from A
INX ;Add 2 to X
INX
INY ;Add 1 to Y
CPY #7 ;Loop through all 7 horses
BNE __place_horse_loop
;Now, get rid of the walls in front of the horses
LDA #$07 ;$07 = Color of the floor under the track
STA $03E3 ;First wall is at $03E3
LDX #$00
__wall_loop1:
LDA #$07 ;Next walls are at $0403, $0423, $0443, etc.
STA $0403,X
TXA
CLC
ADC #$20
TAX
CPX #$00
BNE __wall_loop1
__wall_loop2: ;Final walls are at $0503, 0523, 0543, etc.
LDA #$07
STA $0503, X
TXA
CLC
ADC #$20
TAX
CPX #$C0
BNE __wall_loop2
RTS
;=======================Run the Race=====================
DoRace:
;Run a loop for all 7 horses
LDX #$00
__horse_loop:
LDA Random ;Get a random number from 0x00 to 0xFF
AND #$01 ;Bitwise AND to get a number from 0 to 1
BEQ __horse_nomove ;0 (False) = Do not move this horse
;Update the horse by modifying the colors on the screen
; Old Space = Stored Color
; Stored Color = New Space
; New Space = Horse Color
STX HorseIdx ;Store the horse index (Register X) in a temporary variable
LDA HorseSpotColor, X ;Load the current color of this spot
TAY ;Y = Temporary place to store the current spot color
TXA
ASL ;Multiply X by 2
TAX
TYA ;Restore A from Y
STA ($08, X) ;Draw the previous color back ($08 = HorseIndirect)
INC HorseIndirectL, X ;Add 1 to the Low indirect address to move horse to the next spot
LDA ($08, X) ;Load the color of the new spot for the horse ($08 = HorseIndirect)
LDY HorseIdx ;Y = Current Horse
STA HorseSpotColor, Y ;Store this new color into the spot color for the current horse
LDA HorseColors, Y ;Get the color for this horse
STA ($08, X) ;Store the horse color into this spot ($08 = HorseIndirect)
;Figure out if the horse has won
LDA HorseIndirectL, X ;Grab the low position
LDX HorseIdx ;Reset X from the temporary variable
AND #$1F ;Bitwise AND with first 5 bits (X coordinate of horse)
CMP #29 ;The horse wins if it gets past the finish line (X coordinate 29)
BNE __horse_nomove
STX WinningHorse
JSR LongWait ;Wait for awhile
RTS
__horse_nomove:
TXA ;Temporarily store X in the Accumulator
JSR Wait ;Add a bit of delay between horses (nice animation)
JSR Wait ;Restore X from the accumulator
TAX
INX ;Go to the next horse
CPX #$07 ;Loop through all 7 horses
BNE __horse_loop
LDX #$00 ;Reset the horse counter
JMP __horse_loop ;Run the loop again
;=======================End of the Race=====================
RaceEnd:
JSR DrawHorseWin ;Display a popup to tell us which horse won the race
JSR SuperLongWait ;Delay before showing what horse you bet on
JSR SuperLongWait
JSR DrawYouBet
JSR SuperLongWait ;Delay before showing the win or lose screen
JSR SuperLongWait
;Find out if your horse won
LDA PlayerHorse
CMP WinningHorse
BNE __load_loss
__load_win:
;Load the win screen
LDA #<Screen_YouWin
STA ScreenDataL
LDA #>Screen_YouWin
STA ScreenDataH
JSR DrawScreen
JMP __end_wait
__load_loss:
;Load the lose screen
LDA #<Screen_YouLose
STA ScreenDataL
LDA #>Screen_YouLose
STA ScreenDataH
JSR DrawScreen
__end_wait:
JSR SuperLongWait ;Delay before returning to the title screen
JSR SuperLongWait
RTS
;=======================Wait Routine======================
;Subroutine to wait some cycles
; Modifies X, but not Y
Wait:
LDX #$00
_wait_loop:
INX
CPX #$00
BNE _wait_loop
RTS
;Wait for a longer time than a single call to "Wait"
LongWait:
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
JSR Wait
RTS
;Extremely long delay
SuperLongWait:
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
JSR LongWait
RTS
;Wait for the user to press a key
WaitKeyPress:
LDA #$00
STA Keyboard ;Reset the keyboard
__wait_key_loop:
LDA Keyboard
BEQ __wait_key_loop ;Keep looping until the keyboard isn't NULL
RTS
;=======================Draw Full Screen======================
;Subroutine to draw a full page screen
; Store the address of the data to load in ScreenData
DrawScreen:
LDA #$00 ;Screen starts at $0200
STA ScreenIndirectL ;Low Byte: $00
LDA #$02
STA ScreenIndirectH ;High Byte: $02
;Reset all of the counters
LDA #$00
STA ScreenIdx
STA ScreenDataIdx
__screen_loop:
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
LSR ;Extract the left color by shifting right 4 bits
LSR
LSR
LSR
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
AND #$0F ;Extract the right color using a bitwise AND with 0x0F
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
BNE __screen_noinc ;If there is no overflow, then skip the next step
INC ScreenIndirectH ;Add 1 to the high byte of screen indirect access
__screen_noinc:
INC ScreenDataIdx ;Move to the next data byte
BNE __screen_nodinc ;If there is no overflow, then skip the next step
INC ScreenDataH ;Add 1 to the high byte of the screen data indirect access
__screen_nodinc:
LDA ScreenIndirectH
CMP #$06 ;Screen ends at $0600
BNE __screen_loop
RTS
;=======================Draw Top Win Scren=====================
DrawHorseWin:
LDA #$20 ;"Horse Win" popup starts at $0220
STA ScreenIndirectL ;Low Byte: $20
LDA #$02
STA ScreenIndirectH ;High Byte: $02
;Figure out the horse screen to load:
; Normally I would do this with a lookup table, but unfortunately
; 6502asm.com doesn't support the syntax
;
; So, instead I will use a massive if statement (*sorry*)
LDX WinningHorse
BEQ __swin1 ;Case "Horse 1"
DEX
BEQ __swin2 ;Case "Horse 2"
DEX
BEQ __swin3 ;Case "Horse 3"
DEX
BEQ __swin4 ;Case "Horse 4"
DEX
BEQ __swin5 ;Case "Horse 5"
DEX
BEQ __swin6 ;Case "Horse 6"
JMP __swin7 ;Case Default ("Horse 7")
__swin1:
LDA #<Screen_Horse1Win ;Horse 1 Win screen
STA ScreenDataL
LDA #>Screen_Horse1Win
STA ScreenDataH
JMP __swin_start
__swin2:
LDA #<Screen_Horse2Win ;Horse 2 Win screen
STA ScreenDataL
LDA #>Screen_Horse2Win
STA ScreenDataH
JMP __swin_start
__swin3:
LDA #<Screen_Horse3Win ;Horse 3 Win screen
STA ScreenDataL
LDA #>Screen_Horse3Win
STA ScreenDataH
JMP __swin_start
__swin4:
LDA #<Screen_Horse4Win ;Horse 4 Win screen
STA ScreenDataL
LDA #>Screen_Horse4Win
STA ScreenDataH
JMP __swin_start
__swin5:
LDA #<Screen_Horse5Win ;Horse 5 Win screen
STA ScreenDataL
LDA #>Screen_Horse5Win
STA ScreenDataH
JMP __swin_start
__swin6:
LDA #<Screen_Horse6Win ;Horse 6 Win screen
STA ScreenDataL
LDA #>Screen_Horse6Win
STA ScreenDataH
JMP __swin_start
__swin7:
LDA #<Screen_Horse7Win ;Horse 7 Win screen
STA ScreenDataL
LDA #>Screen_Horse7Win
STA ScreenDataH
__swin_start:
;Reset all of the counters
LDA #$00
STA ScreenIdx
STA ScreenDataIdx
__swin_loop:
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
LSR ;Extract the left color by shifting right 4 bits
LSR
LSR
LSR
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
AND #$0F ;Extract the right color using a bitwise AND with 0x0F
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
BNE __swin_noinc ;If there is no overflow, then skip the next step
INC ScreenIndirectH ;Add 1 to the high byte of screen indirect access
__swin_noinc:
INC ScreenDataIdx ;Move to the next data byte
BNE __swin_nodinc ;If there is no overflow, then skip the next step
INC ScreenDataH ;Add 1 to the high byte of the screen data indirect access
__swin_nodinc:
LDA ScreenIndirectH
CMP #$03 ;Screen ends on data $0300
BNE __swin_loop
LDA ScreenIdx
CMP #$20 ;Screen ends when the index is past 32 bytes (final line)
BNE __swin_loop
RTS
;=======================Draw Bottom "You Bet" Scren=====================
DrawYouBet:
LDA #$A0 ;Screen starts at _________
STA ScreenIndirectL ;Low Byte:
LDA #$03
STA ScreenIndirectH ;High Byte:
;Load the "You Bet" screen (same for all horses)
LDA #<Screen_YouBet
STA ScreenDataL
LDA #>Screen_YouBet
STA ScreenDataH
;Reset all of the counters
LDA #$00
STA ScreenIdx
STA ScreenDataIdx
__syb_loop:
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
LSR ;Extract the left color by shifting right 4 bits
LSR
LSR
LSR
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
LDY ScreenDataIdx
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
AND #$0F ;Extract the right color using a bitwise AND with 0x0F
LDY ScreenIdx
STA ($00), Y ;Store to the screen ($00 = ScreenIndirect)
INC ScreenIdx ;Move to the next position in the screen
BNE __syb_noinc ;If there is no overflow, then skip the next step
INC ScreenIndirectH ;Add 1 to the high byte of screen indirect access
__syb_noinc:
INC ScreenDataIdx ;Move to the next data byte
BNE __syb_nodinc ;If there is no overflow, then skip the next step
INC ScreenDataH ;Add 1 to the high byte of the screen data indirect access
__syb_nodinc:
LDA ScreenIndirectH
CMP #$04 ;Screen ends within $0400 range
BNE __syb_loop
LDA ScreenIdx
CMP #96 ;Ends after three more lines (32*3 = 96 Bytes)
BNE __syb_loop
;Now draw the actual horse that won
; Once again, use an ugly "If" statement
; *Because 6502asm.com doesn't support lookup tables*
LDX PlayerHorse
BEQ __syb1 ;Case "Horse 1"
DEX
BEQ __syb2 ;Case "Horse 2"
DEX
BEQ __syb3 ;Case "Horse 3"
DEX
BEQ __syb4 ;Case "Horse 4"
DEX
BEQ __syb5 ;Case "Horse 5"
DEX
BEQ __syb6 ;Case "Horse 6"
JMP __syb7 ;Case Default ("Horse 7")
__syb1:
LDA #<Screen_BetHorse1 ;Bet Horse 1 screen
STA ScreenDataL
LDA #>Screen_BetHorse1
STA ScreenDataH
JMP __syb_hloop
__syb2:
LDA #<Screen_BetHorse2 ;Bet Horse 2 screen
STA ScreenDataL
LDA #>Screen_BetHorse2
STA ScreenDataH
JMP __syb_hloop
__syb3:
LDA #<Screen_BetHorse3 ;Bet Horse 3 screen
STA ScreenDataL
LDA #>Screen_BetHorse3
STA ScreenDataH
JMP __syb_hloop
__syb4:
LDA #<Screen_BetHorse4 ;Bet Horse 4 screen
STA ScreenDataL
LDA #>Screen_BetHorse4
STA ScreenDataH
JMP __syb_hloop
__syb5:
LDA #<Screen_BetHorse5 ;Bet Horse 5 screen
STA ScreenDataL
LDA #>Screen_BetHorse5
STA ScreenDataH
JMP __syb_hloop
__syb6:
LDA #<Screen_BetHorse6 ;Bet Horse 6 screen
STA ScreenDataL
LDA #>Screen_BetHorse6
STA ScreenDataH
JMP __syb_hloop
__syb7:
LDA #<Screen_BetHorse7 ;Bet Horse 7 screen
STA ScreenDataL
LDA #>Screen_BetHorse7
STA ScreenDataH
__syb_hloop:
LDX #$00 ;X = Counter on the screen
LDY #$00 ;Y = Counter in ScreenData
__syb_hlp:
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
LSR ;Extract the left color by shifting right 4 bits
LSR
LSR
LSR
STA $0500, X ;We can use indexed indexing because we are copying less than 256 bytes
INX ;Move to the next position in the screen
LDA ($02), Y ;Grab the data byte from ScreenData ($02 = ScreenData)
AND #$0F ;Extract the right color using a bitwise AND with 0x0F
STA $0500, X
INX ;Move to next position in the screen
INY ;Move to next byte in the screen
CPY #$70 ;We copy 7 rows of 16 bytes (or 32*7 = 224 pixels)
BNE __syb_hlp
RTS
;=======================Full Screens======================
;Maybe in a future project, I could write an algorithm to compress all
; of the screen data. It takes up quite a few bytes right now :)
;
; Each byte of data holds two pixels on the screen (one color per nibble)
Screen_Title:
DCB $EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE,$EE
DCB $EE,$EB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BE,$EE
DCB $EE,$B3,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$00,$03,$00,$03,$00,$03,$00,$03,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$03,$33,$03,$33,$03,$03,$33,$03,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$00,$03,$00,$03,$03,$03,$00,$03,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$03,$03,$33,$03,$03,$03,$03,$33,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$00,$03,$00,$03,$00,$03,$00,$03,$33,$33,$3B,$EE
DCB $EE,$B3,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$33,$3B,$EE
DCB $EE,$B3,$00,$03,$00,$03,$00,$03,$00,$03,$00,$03,$00,$03,$3B,$EE
DCB $EF,$B3,$03,$03,$03,$03,$03,$33,$30,$33,$03,$03,$03,$33,$3B,$FE
DCB $5F,$B3,$00,$33,$00,$03,$03,$33,$30,$33,$03,$03,$03,$03,$3B,$F5
DCB $55,$B3,$03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$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$F5
DCB $55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55
DCB $55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55
DCB $5D,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$DD,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$71,$07,$D5
DCB $5D,$70,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$70,$17,$D5
DCB $5D,$DD,$DD,$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