-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpix.dasm16
1034 lines (898 loc) · 36 KB
/
pix.dasm16
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
; Pix.
; A Canabalt-inspired game in DCPU-16 assembly.
;
; https://github.com/ryla/pix
;
; Alyssa Bawgus, Jazmin Gonzalez-Rivero, Julian Ceipek, Riley Butler
;
JSR detectHW ; Find the addresses of HW we care about
JSR setupMonitor ; Configure and initialize the monitor
JSR setupClock ; Set up the clock to tick at 1/60s
SET [isfirstGame],1
:newGame ; Stuff that needs to happen to make a new game
JSR fillScrollBuffer ; Fill the scroll buffer for the start of the game
JSR setupBlockGenerator ; Setup the block generator
SET [isOnSplash], 1
JSR splashScreen ; Display splash screen and wait for spacebar
SET [isOnSplash], 0
JSR setRandomSeed ; Set the random seed from the clock
JSR drawBackdrop
JSR startMainLoop ; Configure mainLoop to be triggered every 1/60s
:runGame
IFN [gameOver], 1 ; Loop if the game's not over.
SET PC, runGame
; Hang here, if everything is golden, we're waiting
; for an interrupt from the clock
SET [isfirstGame], 0
JSR startFallLoop
:runFall
IFL [fallLoopCounter], 15 ; End fallLoop after enough loops
SET PC, runFall ; Loop while fallLoop runs
JSR stopLooping ; Stop clock interrupts
SET [gameOver], 0 ; New game isn't over!
SET [randomMax], 8
JSR random
SET [blockGeneratorCounter] , X
SET PC, newGame ; Make a new game
; Main loop. Triggered every 1/60s by an interrupt from the clock
:mainLoop
JSR keyboardRead
ADD [mainLoopCounter], 1
JSR scroll
JSR thiefUpdate
JSR calcScore
IFE [thiefState], 0
JSR running
IFN [thiefState], 0
JSR jumping
; Collision detection
IFE [thiefState], 0
IFE [0x8206], gapMiddle
IFE [0x8205], gapMiddle
SET [gameOver], 1
RFI 0 ; Since mainLoop is technically an interrupt
; service routine, return to where we came from
; Displays the falling animation at the end of the game.
:fallLoop
SET A, [fallLoopCounter]
SET B, A
MOD A, 3
SET [thiefAnimIndex], 3
SUB [thiefAnimIndex], A
DIV B, 3
SHL B, 5
SET [fallingOrigin], 0x80a0
ADD [fallingOrigin], B
JSR falling
ADD [fallLoopCounter], 1
RFI 0
:fallLoopCounter
DAT 0
:thiefUpdate
IFE [thiefState], 3
SET PC, thiefUpdate3
IFE [thiefState], 2
SET PC, thiefUpdate2
IFE [thiefState], 1
SET PC, thiefUpdate1 ; Select a state or fall to state 0
:thiefUpdate0
IFE [keyboardState], 1
IFE [thiefJumpTimer], 20
SET [thiefState], 1 ; Move to state 1 if spacebar is down and was up or
; still a lot of time left on the jump timer
IFE [keyboardState], 1
IFE [thiefJumpTimer], 20
SET [thiefAnimIndex], 0 ; Reset anim index if moving to state 1. Couldn't
; think of a better way to write this IF
IFE [keyboardState], 0
SET [thiefJumpTimer], 20 ; Reset the jump timer if on the ground (this
; state) and spacebar is up
MOD [mainLoopCounter], 10
IFN [mainLoopCounter], 0
SET PC, POP ; Return if we're still waiting for the next frame
ADD [thiefAnimIndex], 1 ; Move to the next running animation
MOD [thiefAnimIndex], 3 ; Loop animations
SET PC, POP
:thiefUpdate1
MOD [mainLoopCounter], 2
IFN [mainLoopCounter], 0
SET PC, POP ; Return if we're still waiting for the next frame
ADD [thiefAnimIndex], 1
IFE [thiefAnimIndex], 5
SET [thiefState], 2
SET PC, POP
:thiefUpdate2
IFE [keyboardState], 0
SET [thiefState], 3 ; Fall if space released
SUB [thiefJumpTimer], 1 ; Take time off the jump timer
IFE [thiefJumpTimer], 0
SET [thiefState], 3 ; Fall if timer expired
SET [mainLoopCounter], 0 ; Keep main counter reset
SET [thiefAnimIndex], 5 ; Stay at frame 5
SET PC, POP
:thiefUpdate3
MOD [mainLoopCounter], 1
IFN [mainLoopCounter], 0
SET PC, POP ; Return if we're still waiting for the next frame
SUB [thiefAnimIndex], 1
IFE [thiefAnimIndex], 0
SET [thiefState], 0
SET PC, POP
:running
SET A, [thiefAnimIndex]
SET [0x80c5], [0x1100]
SET [0x80a6], [0x2200]
SET [0x80a7], [0x2200]
SET [0x80a5], [0x2200]
SET [0x80c7], [0x3300]
SET [0x8086], [0x3300]
SET [0x8085], [0x3300]
SET [0x8087], [0x3300]
SET [0x80c6], [walking_2+A]
; Display on 0th frame defined by literal
SET [0x80e5], [walking_1+A]
; Display on one row down
SET [0x80e6], [walking_3+A]
SET [0x80e7], [pixelWalking+A]
SET PC, POP
:falling
SET B, [fallingOrigin]
SET PC, jumpingMain
:jumping
SET B, 0x8080
:jumpingMain
SET A, [thiefAnimIndex] ;0-6 for 6 frames
SET [0x65+B], [0x1100]
SET [0x66+B], [0x1100]
SET [0x67+B], [0x1100]
IFG [thiefAnimIndex], 2
SUB A, 3
IFL [thiefAnimIndex], 4
SET [0x26+B], [jumping_2+A] ;head
IFG [thiefAnimIndex], 3
SET [0x06+B], [jumping_2+A] ;head
IFL [thiefAnimIndex], 4
SET [0x06+B], [0x1100]
IFL [thiefAnimIndex], 4
SET [0x25+B], [jumping_0+A] ;left hand
IFG [thiefAnimIndex], 3
SET [0x05+B], [jumping_0+A] ;left hand
IFL [thiefAnimIndex], 4
SET [0x05+B], [0x1100]
IFG [thiefAnimIndex], 3
SET [0x25+B], [0x1100]
IFL [thiefAnimIndex], 4
SET [0x45+B], [jumping_1+A] ;left body
IFG [thiefAnimIndex], 3
SET [0x25+B], [jumping_1+A] ;left body
IFL [thiefAnimIndex], 4
SET [0x25+B], [0x1100] ;left body
IFG [thiefAnimIndex], 3
SET [0x45+B], [0x1100] ;left body
IFL [thiefAnimIndex], 4
SET [0x46+B], [jumping_3+A] ;right body
IFG [thiefAnimIndex], 3
SET [0x26+B], [jumping_3+A] ;right body
IFG [thiefAnimIndex], 3 ;clear
SET [0x46+B], [0x1100] ;right body
IFL [thiefAnimIndex], 4
SET [0x27+B], [jumpingPixel+A]
IFG [thiefAnimIndex], 3
SET [0x07+B], [jumpingPixel+A]
IFL [thiefAnimIndex], 4
SET [0x07+B], [0x1100]
IFG [thiefAnimIndex], 3
SET [0x27+B], [0x1100]
;ADD [thiefJumpIndex],1
;IFE [thiefJumpIndex],3
SET PC, POP
:fallingOrigin
DAT 0
:thiefAnimIndex
DAT 0
:thiefJumpTimer
DAT 0
:thiefState
DAT 0
:mainLoopCounter
DAT 0
:isfirstGame
DAT 1
:isOnSplash
DAT 0
:gameOver
DAT 0
; Initialize the scroll buffer (at 0x8200) with addresses of tile indices
:fillScrollBuffer
SET I, 0 ; Start counting from zero
:fillScrollBufferLoop
SET [0x8200+I], parapetMiddle
; Draw parapets on top row
SET [0x8220+I], buildingSolidMiddle
; Draw buildings on bottom row
ADD I, 1 ; Increment I
IFL I, 32 ; Loop if I less than 32
SET PC, fillScrollBufferLoop
SET PC, POP ; Return from subroutine
; Animate everything in the scroll buffer
:scroll
SET I, 0 ; Set X to 0, I and J are weirdly in use
ADD [scrollPosition], 1
; Increment the animation index
MOD [scrollPosition], 4
; Mod animation index for 4 frames of animation
IFN [scrollPosition], 0
SET PC, scrollAnimLoop
; If scrollPosition isn't 0, skip this next bit
:scrollMoveLoop
SET [0x8200+I], [0x8201+I]
; Move each block of the top row over 1
SET [0x8220+I], [0x8221+I]
; Move each block of the bottom rows over 1
ADD I, 1 ; Increment X
IFL I, 31 ; IF X is less than 31, keep looping
SET PC, scrollMoveLoop
JSR blockGenerator
; Add the next block to the end of row
SET I, 0 ; Set X to 0 again
:scrollAnimLoop
SET X, [0x8200+I] ; Store the base address of the frame in X
SET Y, [0x8220+I] ; Store the base address of the frame in Y
ADD X, [scrollPosition]
; Add current animation index to X
ADD Y, [scrollPosition]
SET [0x8100+I], [X] ; Look up row 1 word and write it to VRAM
SET [0x8120+I], [Y] ; Look up row 2 word and write it to VRAM
SET [0x8140+I], [Y] ; Look up row 3 word and write it to VRAM
SET [0x8160+I], [Y] ; Look up row 4 word and write it to VRAM
ADD I, 1 ; Increment I
IFL I, 32 ; Loop while I is less than 32
SET PC, scrollAnimLoop
SET PC, POP ; Return from subroutine
:scrollPosition
DAT 0
; Use the clock to calculate the users score
:calcScore
set A, 1 ; Store ticks elapsed since clock reset in C
HWI [clockHWaddr] ; Send interrupt to clock
DIV C, 5
SET [currentScore], C
; Set the current score to the clock value
JSR displayScore ; Display the calculated digits
SET PC, POP ; Return from subroutine
; Display the players current score
:displayScore
IFE [isOnSplash],0
SET X, 0x801f ; Score display fist digit location
IFE [isOnSplash],1
SET X, 0x8132
SET B, 1 ; Digit to display
:displayScoreLoop
IFE [isOnSplash], 0
SET Y, 0x5433 ; Initialize digits to zero
IFE [isOnSplash], 1
SET Y, 0x0433 ; Initialize digits to zero
SET C, [currentScore] ; Set C to the players Current Score
DIV C, B ; Divide by B to "shift" C into the right cut off position
MOD C, 10 ; Mod by 10 to "cut off" the desired digit
ADD Y, C ; Add the score dgit value to the display value
SET [X], Y ; Set X to the display digit
SUB X, 1 ; Move over by one space
MUL B, 10 ; Move to next digit that needs to be displayed
IFE [isOnSplash],0
IFG X, 0x8019 ; If we are not at the last display location
SET PC, displayScoreLoop ; Loop back to top
IFE [isOnSplash],1
IFG X, 0x812d ; If we are not at the last display location
SET PC, displayScoreLoop ; Loop back to top
SET PC, POP ; Return from subroutine
:currentScore
DAT 0x0000 ; Player's current score
; Get clock value from start screen to make random generator
; As random as possible
:setRandomSeed
SET A, 1 ; Store number of ticks elapsed since last
; call to 0 in C register
HWI [clockHWaddr] ; Send interrupt to clock
SET [randomSeed], C ; Save clock value to randomSeed
SET PC, POP ; Return from subroutine
; Random number generator
; code from lowey2002
; http://www.0x10cforum.com/forum/m/4932880/viewthread/2732760-pseudorandom-generator
:random
SET X, [randomSeed] ; Set x to random seed
MUL X, 0xe3d1
ADD X, 0x2b69
SHR X, 3
SET [randomSeed], X ; Save new seed
SET I, [randomMax]
SUB I, [randomMin] ; Calc difference between bounds
MOD X, I ; Reduces to difference between bounds
ADD X, [randomMin] ; Increases to make sure x is above lower bound
SET PC, POP ; Return from subroutine
:randomMin
DAT 0x0002 ; Lower bound for random number
:randomMax
DAT 0x0064 ; Upper bound for random number
:randomSeed
DAT 0x3e42 ; Seed for random number
; Set up blockGenerator
:setupBlockGenerator
SET [blockGeneratorIndex], 0
; Reset generator index to 0
SET PC, POP ; Return from subroutine
; Feeds random number generator to get gap size, and starting point
:blockGenerator
SET A, [blockGeneratorIndex]
SET [0x821f], [parapetLUTs+A]
; pick the Ath Lut
SET [0x823f], [buildingLUTs+A]
; pick the Ath Lut
IFE [blockGeneratorIndex], 2
SET PC, blockGeneratorWait
IFE [blockGeneratorIndex], 5
SET PC, blockGeneratorWait
:blockGeneratorAdd
ADD [blockGeneratorIndex], 1
; move on to next animation
MOD [blockGeneratorIndex], 6
; keep it between 0 and 6
SET PC, POP
:blockGeneratorWait
SUB [blockGeneratorCounter], 1
IFG [blockGeneratorCounter], 0
SET PC, POP
IFE [blockGeneratorIndex], 2
SET [randomMax], 14
IFE [blockGeneratorIndex], 5
SET [randomMax], 8
JSR random
SET [blockGeneratorCounter] , X
SET PC, blockGeneratorAdd
:parapetLUTs ; Lut of parapet Luts
DAT parapetRightMiddle
DAT parapetRight
DAT gapMiddle
DAT parapetLeft
DAT parapetLeftMiddle
DAT parapetMiddle
:buildingLUTs ; Lut of building Luts
DAT buildingSolidRightMiddle
DAT buildingSolidRight
DAT gapMiddle
DAT buildingSolidLeft
DAT buildingSolidMiddle
DAT buildingSolidMiddle
:blockGeneratorCounter
DAT 0x0005 ; when in state 1 or 4 get num from random gen
:blockGeneratorIndex
DAT 0x0000 ; Which animation block we are at
; Display splash screen until spacebar pressed
:splashScreen
JSR clearScreen ; Clear screen to prep for splash
SET [0x80e4], 0x0440 ; (4, 7) Loc 228=0x0e4; char_idx: 64=0x40
SET [0x8104], 0x0441 ; (4, 8) Loc 260=0x104; char_idx: 65=0x41
SET [0x80e5], 0x0442 ; (5, 7) Loc 229=0x0e5; char_idx: 66=0x42
SET [0x8105], 0x0443 ; (5, 8) Loc 261=0x105; char_idx: 67=0x43
SET [0x80e6], 0x0444 ; (6, 7) Loc 230=0x0e6; char_idx: 68=0x44
SET [0x8106], 0x0445 ; (6, 8) Loc 262=0x106; char_idx: 69=0x45
SET [0x80e7], 0x0446 ; (7, 7) Loc 231=0x0e7; char_idx: 70=0x46
SET [0x8107], 0x0447 ; (7, 8) Loc 263=0x107; char_idx: 71=0x47
SET [0x80e8], 0x0446 ; (8, 7) Loc 232=0x0e8; char_idx: 70=0x46
SET [0x8108], 0x0448 ; (8, 8) Loc 264=0x108; char_idx: 72=0x48
SET [0x80e9], 0x0446 ; (9, 7) Loc 233=0x0e9; char_idx: 70=0x46
SET [0x8109], 0x0448 ; (9, 8) Loc 265=0x109; char_idx: 72=0x48
SET [0x806b], 0x0449 ; (11, 3) Loc 107=0x06b; char_idx: 73=0x49
SET [0x808b], 0x044a ; (11, 4) Loc 139=0x08b; char_idx: 74=0x4a
SET [0x80ab], 0x044b ; (11, 5) Loc 171=0x0ab; char_idx: 75=0x4b
SET [0x806c], 0x044c ; (12, 3) Loc 108=0x06c; char_idx: 76=0x4c
SET [0x808c], 0x044d ; (12, 4) Loc 140=0x08c; char_idx: 77=0x4d
SET [0x80ec], 0x044e ; (12, 7) Loc 236=0x0ec; char_idx: 78=0x4e
SET [0x810c], 0x044f ; (12, 8) Loc 268=0x10c; char_idx: 79=0x4f
SET [0x806d], 0x044c ; (13, 3) Loc 109=0x06d; char_idx: 76=0x4c
SET [0x808d], 0x0450 ; (13, 4) Loc 141=0x08d; char_idx: 80=0x50
SET [0x80ed], 0x0451 ; (13, 7) Loc 237=0x0ed; char_idx: 81=0x51
SET [0x810d], 0x0452 ; (13, 8) Loc 269=0x10d; char_idx: 82=0x52
SET [0x806e], 0x0453 ; (14, 3) Loc 110=0x06e; char_idx: 83=0x53
SET [0x808e], 0x0454 ; (14, 4) Loc 142=0x08e; char_idx: 84=0x54
SET [0x80ee], 0x044e ; (14, 7) Loc 238=0x0ee; char_idx: 78=0x4e
SET [0x810e], 0x0455 ; (14, 8) Loc 270=0x10e; char_idx: 85=0x55
SET [0x808f], 0x0456 ; (15, 4) Loc 143=0x08f; char_idx: 86=0x56
SET [0x80af], 0x0457 ; (15, 5) Loc 175=0x0af; char_idx: 87=0x57
SET [0x80ef], 0x044e ; (15, 7) Loc 239=0x0ef; char_idx: 78=0x4e
SET [0x810f], 0x0458 ; (15, 8) Loc 271=0x10f; char_idx: 88=0x58
SET [0x8090], 0x0459 ; (16, 4) Loc 144=0x090; char_idx: 89=0x59
SET [0x80b0], 0x045a ; (16, 5) Loc 176=0x0b0; char_idx: 90=0x5a
SET [0x80f0], 0x045b ; (16, 7) Loc 240=0x0f0; char_idx: 91=0x5b
SET [0x8110], 0x045c ; (16, 8) Loc 272=0x110; char_idx: 92=0x5c
SET [0x8091], 0x045d ; (17, 4) Loc 145=0x091; char_idx: 93=0x5d
SET [0x80b1], 0x045e ; (17, 5) Loc 177=0x0b1; char_idx: 94=0x5e
SET [0x80f1], 0x045f ; (17, 7) Loc 241=0x0f1; char_idx: 95=0x5f
SET [0x8111], 0x0460 ; (17, 8) Loc 273=0x111; char_idx: 96=0x60
SET [0x8092], 0x0461 ; (18, 4) Loc 146=0x092; char_idx: 97=0x61
SET [0x80b2], 0x0462 ; (18, 5) Loc 178=0x0b2; char_idx: 98=0x62
SET [0x8093], 0x0463 ; (19, 4) Loc 147=0x093; char_idx: 99=0x63
SET [0x80b3], 0x0464 ; (19, 5) Loc 179=0x0b3; char_idx: 100=0x64
SET [0x80f3], 0x0465 ; (19, 7) Loc 243=0x0f3; char_idx: 101=0x65
SET [0x8113], 0x0466 ; (19, 8) Loc 275=0x113; char_idx: 102=0x66
SET [0x80b4], 0x0167 ; (20, 5) Loc 180=0x0b4; char_idx: 103=0x67
SET [0x80f4], 0x0465 ; (20, 7) Loc 244=0x0f4; char_idx: 101=0x65
SET [0x8114], 0x0468 ; (20, 8) Loc 276=0x114; char_idx: 104=0x68
SET [0x80f6], 0x044e ; (22, 7) Loc 246=0x0f6; char_idx: 78=0x4e
SET [0x8116], 0x044f ; (22, 8) Loc 278=0x116; char_idx: 79=0x4f
SET [0x80f7], 0x045b ; (23, 7) Loc 247=0x0f7; char_idx: 91=0x5b
SET [0x8117], 0x0469 ; (23, 8) Loc 279=0x117; char_idx: 105=0x69
SET [0x80f8], 0x044e ; (24, 7) Loc 248=0x0f8; char_idx: 78=0x4e
SET [0x8118], 0x046a ; (24, 8) Loc 280=0x118; char_idx: 106=0x6a
SET [0x80f9], 0x0446 ; (25, 7) Loc 249=0x0f9; char_idx: 70=0x46
SET [0x8119], 0x046b ; (25, 8) Loc 281=0x119; char_idx: 107=0x6b
SET [0x80fa], 0x044e ; (26, 7) Loc 250=0x0fa; char_idx: 78=0x4e
SET [0x811a], 0x046c ; (26, 8) Loc 282=0x11a; char_idx: 108=0x6c
SET [0x811b], 0x046d ; (27, 8) Loc 283=0x11b; char_idx: 109=0x6d
IFE [isfirstGame], 0
JSR displayScore
:splashScreenDownLoop ; Loop while space is down
JSR keyboardRead
IFE [keyboardState], 1
SET PC, splashScreenDownLoop
:splashScreenUpLoop ; Loop while space is up
JSR keyboardRead
IFE [keyboardState], 0
SET PC, splashScreenUpLoop
JSR clearScreen
SET PC, POP
; Put a 1 in keyboardState is spacebar is down, 0 otherwise
:keyboardRead
SET A, 2
SET B, " "
HWI [keyboardHWaddr]
SET [keyboardState], C
SET PC, POP
:keyboardState
DAT 0
:clearScreen
SET X,0x7fff
:clearLoop
ADD X,1
SET [X],0x002a
IFG X,0x817f
SET PC,POP
JSR clearLoop
; Configures the clock to tick at 1/60s
:setupClock
SET A, 0 ; Put clock into set frequency mode
SET B, 1 ; Set clock frequency to 1/60s
HWI [clockHWaddr] ; Send settings to the clock
SET PC, POP ; Return from subroutine
; Starts an interrupt-driven loop for the falling animation
:startFallLoop
IAS fallLoop
SET [fallLoopCounter], 0
SET PC, setupLooping
; Setup mainLoop to be triggered once every clock tick
:startMainLoop
IAS mainLoop ; Set up mainLoop as the interrupt handler
:setupLooping
SET A, 2 ; Put clock into set interrupt mode
SET B, 1 ; Set clock interrupt message to 1
HWI [clockHWaddr] ; Send settings to the clock
SET PC, POP ; Return from subroutine
:stopLooping
SET A, 2 ; Put clock into set interrupt mode
SET B, 0 ; Turn clock interrupts off
HWI [clockHWaddr] ; Send settings to the clock
SET PC, POP ; Return from subroutine
; Configures the monitor and the VRAM for the monitor. Note: time consuming
:setupMonitor
SET A, 0 ; Put monitor into set VRAM mode
SET B, 0x8000 ; Set the start of the monitor's VRAM mapping
HWI [monitorHWaddr] ; Send settings to monitor. The monitor will still
; respond to interrupts while it's powering on
SET A, 1 ; Put monitor into set font mode
SET B, monitorFont ; Set the start of the monitor's font map
HWI [monitorHWaddr] ; Send settings to monitor
SET A, 2 ; Put the monitor into set palette mode
SET B, monitorPalette
; Set the start of the monitor's font map
HWI [monitorHWaddr] ; Send settings to monitor
SET PC, POP ; Return from subroutine
; Scans attached hardware and populates the (device)HWaddr memory locations
; with the address of each recognized attached device.
:detectHW
HWN I ; Store the number of attached devices in I
:detectHWaddrLoop ; Loop through valid HW addresses
SUB I, 1 ; Decrement I by 1. We do this first, because HWN
; returns the total number of devices, not the
; index of the last device
HWQ I ; Load information about device with HW address I
SET J, 0 ; Reset J to 0, because loop
:detectHWcompLoop ; Loop through know device IDs, looking for an ID
; match
IFE [J+detectHWdataLo], A
; See if the low word of the HW ID in A matches the
; Jth known device ID
IFE [J+detectHWdataHi], B
; See if the high word of HW ID in B matched the
; Jth known device ID
SET [J+clockHWaddr], I
; Store the HW address of the Jth recognized device
; The label is clockHWaddr because its the first
; in the block
ADD J, 3 ; Increment J by 3, becuase each block is 3 words
; long
IFL J, 9 ; Continue looping if J less than 9, as there are
; 3 known devices * 3 words. Hard coded for small
SET PC, detectHWcompLoop
; Conditionally jump to start of compLoop
IFG I, 0 ; If I is greater than 0, loop addrLoop
SET PC, detectHWaddrLoop
; Conditionally jump to start of addrLoop
SET PC, POP ; Return from subroutine
; Hardware IDs and addresses. Use detectHW to populate addresses
:detectHWdataLo
DAT 0xb402 ; Low word of Generic Clock ID
:detectHWdataHi
DAT 0x12d0 ; High word of Generic Clock ID
:clockHWaddr
DAT 0xffff ; To be filled with HW address of clock
DAT 0x7406, 0x30cf ; Generic Keyboard ID
:keyboardHWaddr
DAT 0xffff ; To be filled with HW address of keyboard
DAT 0xf615, 0x7349 ; LEM1802 Monitor ID
:monitorHWaddr
DAT 0xffff ; To be filled with HW address of monitor
; Definitions for the monitor's color palette
:monitorPalette
; Color 0 (black)
DAT 0x0000
; Color 1 (red)
DAT 0x0e33
; Color 2 (person gray)
DAT 0x0777
; Color 3 (building gray)
DAT 0x0ccc
; Color 4 (number white)
DAT 0x0fff
DAT 0x0434
:monitorFont
;THIEF 0-28
DAT 0xffff, 0xffff ; 0 = 0x0
DAT 0xffff, 0x73bd ; 1 = 0x1
DAT 0x5f5f, 0xbfff ; 2 = 0x2
DAT 0xc08d, 0x7dfd ; 3 = 0x3
DAT 0xffff, 0x7b15 ; 4 = 0x4
DAT 0xbfbf, 0x7fff ; 5 = 0x5
DAT 0xc03a, 0xf7f7 ; 6 = 0x6
DAT 0xffff, 0xff1d ; 7 = 0x7
DAT 0xc035, 0xfbfd ; 8 = 0x8
DAT 0xffff, 0x6f37 ; 9 = 0x9
DAT 0x7f7f, 0xffff ; 10 = 0xa
DAT 0x8135, 0xeeef ; 11 = 0xb
DAT 0xffff, 0x771b ; 12 = 0xc
DAT 0xc03a, 0xf7ef ; 13 = 0xd
DAT 0xffff, 0xfe1d ; 14 = 0xe
DAT 0xe01d, 0xfbfd ; 15 = 0xf
DAT 0xffff, 0x7fff ; 16 = 0x10
DAT 0xffff, 0xff8e ; 17 = 0x11
DAT 0x2faf, 0xdfff ; 18 = 0x12
DAT 0xf08e, 0xfdfe ; 19 = 0x13
DAT 0xffff, 0xbf7f ; 20 = 0x14
DAT 0xffff, 0xdfe7 ; 21 = 0x15
DAT 0x1757, 0xef7f ; 22 = 0x16
DAT 0xf8e7, 0xdeff ; 23 = 0x17
DAT 0xffff, 0xdfbf ; 24 = 0x18
DAT 0xffff, 0xffe3 ; 25 = 0x19
DAT 0x0bab, 0x77bf ; 26 = 0x1a
DAT 0xfce3, 0xffff ; 27 = 0x1b
DAT 0xfc00, 0xc000 ; 28 = 0x5 5
;BUILDING
DAT 0xffff, 0xfff8 ; 29 = 0x1d
DAT 0xc0c0, 0xc0c0 ; 30 = 0x1 1 part of unordered assignment
DAT 0x0262, 0x0000 ; 31 = 0x1f
DAT 0x0700, 0x0000 ; 32 = 0x4 4
DAT 0x6262, 0x0000 ; 33 = 0x21
DAT 0x6202, 0xf8ff ; 34 = 0x22
DAT 0x0000, 0xffff ; 35 = 0x23
DAT 0xffff, 0xf802 ; 36 = 0x24
DAT 0xffff, 0xff00 ; 37 = 0x25
DAT 0x6200, 0x0062 ; 38 = 0x26
DAT 0x02f8, 0xffff ; 39 = 0x27
DAT 0x00ff, 0xffff ; 40 = 0x28
DAT 0xfff8, 0x0262 ; 41 = 0x29
DAT 0xffff, 0x0000 ; 42 = 0x2a
DAT 0x0000, 0x6262 ; 43 = 0x2b
DAT 0x0000, 0x6202 ; 44 = 0x2c
DAT 0xf8ff, 0xffff ; 45 = 0x2d
DAT 0xf802, 0x6200 ; 46 = 0x2e
DAT 0xff00, 0x0000 ; 47 = 0x2f
DAT 0x0062, 0x6200 ; 48 = 0x30
DAT 0x0062, 0x02f8 ; 49 = 0x31
DAT 0x0000, 0x00ff ; 50 = 0x32
;NUMBERS
DAT 0x837d, 0x83ff ; 51 = 0x33 "0"
DAT 0x7b01, 0x7fff ; 52 = 0x34 "1"
DAT 0x3b4d, 0x73ff ; 53 = 0x35 "2"
DAT 0xbb6d, 0x93ff ; 54 = 0x36 "3"
DAT 0xe1ef, 0x01ff ; 55 = 0x37 "4"
DAT 0xb175, 0x8dff ; 56 = 0x38 "5"
DAT 0x836d, 0x9bff ; 57 = 0x39 "6"
DAT 0x3dcd, 0xf1ff ; 58 = 0x3a "7"
DAT 0x936d, 0x93ff ; 59 = 0x3b "8"
DAT 0xb36d, 0x83ff ; 60 = 0x3c "9"
;Padding
DAT 0xffff, 0xfefc ; 61 = 0x6 6
DAT 0xf0f0, 0xf0f0 ; 62 = 0x7 7
;Splash Screen Definitions
DAT 0x0000, 0x0007 ; 63 = 0x2 2
DAT 0xffff, 0xff1f ; 64 = 0x40
DAT 0xffff, 0xfff0 ; 65 = 0x41
DAT 0xdfdf, 0xdf3f ; 66 = 0x42
DAT 0xfefe, 0xfeff ; 67 = 0x43
DAT 0xff7f, 0x7fff ; 68 = 0x44
DAT 0xfff0, 0xfdf2 ; 69 = 0x45
DAT 0xffff, 0x7f7f ; 70 = 0x46
DAT 0xfff8, 0xf5f7 ; 71 = 0x47
DAT 0xfff4, 0xf5f9 ; 72 = 0x48
DAT 0x0707, 0xe7e7 ; 73 = 0x49
DAT 0x0000, 0x8f9f ; 74 = 0x4a
DAT 0x0000, 0xffff ; 75 = 0x4b
DAT 0xe7e7, 0xe7e7 ; 76 = 0x4c
DAT 0x9f9f, 0x9f9f ; 77 = 0x4d
DAT 0xffff, 0xff7f ; 78 = 0x4e
DAT 0xffff, 0xf4f5 ; 79 = 0x4f
DAT 0x9f9f, 0x9f8f ; 80 = 0x50
DAT 0x7fff, 0x7f7f ; 81 = 0x51
DAT 0xf9ff, 0xf0fd ; 82 = 0x52
DAT 0xc70f, 0x1fff ; 83 = 0x53
DAT 0xc7e0, 0xf0ff ; 84 = 0x54
DAT 0xfeff, 0xf0fb ; 85 = 0x55
DAT 0xffcf, 0xcfff ; 86 = 0x56
DAT 0xff00, 0x00ff ; 87 = 0x57
DAT 0xf0ff, 0xf8f7 ; 88 = 0x58
DAT 0xffff, 0xdf9f ; 89 = 0x59
DAT 0xffff, 0x7f3f ; 90 = 0x5a
DAT 0x7fff, 0xff7f ; 91 = 0x5b
DAT 0xf7ff, 0xf8f5 ; 92 = 0x5c
DAT 0x1f7f, 0xffff ; 93 = 0x5d
DAT 0x1fce, 0xe4f1 ; 94 = 0x5e
DAT 0x7fff, 0xffff ; 95 = 0x5f
DAT 0xf7ff, 0xffff ; 96 = 0x60
DAT 0xffff, 0x7f1f ; 97 = 0x61
DAT 0xf1e4, 0xce1f ; 98 = 0x62
DAT 0x9fdf, 0xffff ; 99 = 0x63
DAT 0x3f7f, 0xffff ; 100 = 0x64
DAT 0xff7f, 0xffff ; 101 = 0x65
DAT 0xfef0, 0xf6ff ; 102 = 0x66
DAT 0x1f1f, 0x1fff ; 103 = 0x67
DAT 0xf8f7, 0xf8ff ; 104 = 0x68
DAT 0xf9ff, 0xfef0 ; 105 = 0x69
DAT 0xf6ff, 0xf0fb ; 106 = 0x6a
DAT 0xf0ff, 0xf0fd ; 107 = 0x6b
DAT 0xf2ff, 0xfef0 ; 108 = 0x6c
DAT 0xf6ff, 0xffff ; 109 = 0x6d
;walking pixel
DAT 0x0000, 0x1030 ; 110 = 0xc 12
DAT 0xfeff, 0xffff ; 111 = 0x6f
DAT 0xfbff, 0xffff ; 112 = 0x70
DAT 0xf7ff, 0xffff ; 113 = 0x71
DAT 0x7fff, 0xffff ; 114 = 0x72
DAT 0xbfff, 0xffff ; 115 = 0x73
DAT 0xdfff, 0xffff ; 116 = 0x74
;jumping pixel
DAT 0x3010, 0x0000 ; 117 = 0xd 13
DAT 0xfeff, 0xffff ; 118 = 0x76
DAT 0xfbff, 0xffff ; 119 = 0x77
DAT 0xf7ff, 0xffff ; 120 = 0x78
DAT 0x7fff, 0xffff ; 121 = 0x79
DAT 0xbfff, 0xffff ; 122 = 0x7a
DAT 0xdfff, 0xffff ; 123 = 0x7b
DAT 0xf0f0, 0xf0f7 ; 124 = 0x8 8
DAT 0xf7f0, 0xf0f0 ; 125 = 0x9 9
DAT 0xfcfc, 0xfcfc ; 126 = 0xa 10
DAT 0xf8f8, 0xf8f8 ; 127 = 0xb 11
;LUTs with animation frame indexes for various graphics
:pixelWalking
DAT 0x016f ; (2, 1)
DAT 0x0170 ; (5, 1)
DAT 0x016f ; (8, 1)
:walking_1
DAT 0x0201 ; (0, 1)
DAT 0x0204 ; (3, 1)
DAT 0x0207 ; (6, 1)
:walking_2
DAT 0x0202 ; (1, 0)
DAT 0x0205 ; (4, 0)
DAT 0x0202 ; (7, 0)
:walking_3
DAT 0x0203 ; (1, 1)
DAT 0x0206 ; (4, 1)
DAT 0x0208 ; (7, 1)
:jumping_0 ;left hand
DAT 0x0210 ; (18, 0)
DAT 0x0214 ; (21, 0)
DAT 0x0218 ; (24, 0)
:jumping_1 ;left body
DAT 0x0211 ; (18, 1)
DAT 0x0215 ; (21, 1)
DAT 0x0219 ; (24, 1)
:jumping_2 ;head
DAT 0x0212 ; (19, 0)
DAT 0x0216 ; (22, 0)
DAT 0x021a ; (25, 0)
:jumping_3 ;right body
DAT 0x0213 ; (19, 1)
DAT 0x0217 ; (22, 1)
DAT 0x021b ; (25, 1)
:jumpingPixel
DAT 0x0179 ; (20, 0)
DAT 0x017a ; (23, 0)
DAT 0x017b ; (26, 0)
:gapMiddle
DAT 0x002a
DAT 0x002a
DAT 0x002a
DAT 0x002a
:parapetLeft
DAT 0x031d ; (0, 0)
DAT 0x0324 ; (5, 0)
DAT 0x0329 ; (10, 0)
DAT 0x032e ; (15, 0)
:buildingSolidLeft
DAT 0x0300 ; (0, 1)
DAT 0x0325 ; (5, 1)
DAT 0x032a ; (10, 1)
DAT 0x032f ; (15, 1)
:parapetLeftMiddle
DAT 0x031f ; (1, 0)
DAT 0x0326 ; (6, 0)
DAT 0x032b ; (11, 0)
DAT 0x0330 ; (16, 0)
:buildingSolidMiddle
DAT 0x3000 ; (1, 1)
DAT 0x3000 ; (6, 1)
DAT 0x3000 ; (11, 1)
DAT 0x3000 ; (16, 1)
:parapetMiddle
DAT 0x0321 ; (2, 0)
DAT 0x0326 ; (7, 0)
DAT 0x032b ; (12, 0)
DAT 0x0330 ; (17, 0)
:parapetRightMiddle
DAT 0x0321 ; (3, 0)
DAT 0x0326 ; (8, 0)
DAT 0x032c ; (13, 0)
DAT 0x0331 ; (18, 0)
:buildingSolidRightMiddle
DAT 0x3000 ; (3, 1)
DAT 0x3000 ; (8, 1)
DAT 0x3000 ; (13, 1)
DAT 0x0332 ; (18, 1)
:parapetRight
DAT 0x0322 ; (4, 0)
DAT 0x0327 ; (9, 0)
DAT 0x032d ; (14, 0)
DAT 0x0300 ; (19, 0)
:buildingSolidRight
DAT 0x0323 ; (4, 1)
DAT 0x0328 ; (9, 1)
DAT 0x0300 ; (14, 1)
DAT 0x0300 ; (19, 1)
:drawBackdrop
SET [0x8000], 0x5000 ; (0, 0) Loc 0=0x000; char_idx: 0=0x00
SET [0x8020], 0x5000 ; (0, 1) Loc 32=0x020; char_idx: 0=0x00
SET [0x8040], 0x5000 ; (0, 2) Loc 64=0x050; char_idx: 0=0x00
SET [0x8060], 0x5000 ; (0, 3) Loc 96=0x060; char_idx: 0=0x00
SET [0x8080], 0x051e ; (0, 4) Loc 128=0x080; char_idx: 1=0x01
SET [0x8001], 0x5000 ; (1, 0) Loc 1=0x001; char_idx: 0=0x00
SET [0x8021], 0x053f ; (1, 1) Loc 33=0x021; char_idx: 2=0x02
SET [0x8041], 0x5000 ; (1, 2) Loc 65=0x051; char_idx: 0=0x00
SET [0x8061], 0x5000 ; (1, 3) Loc 97=0x061; char_idx: 0=0x00
SET [0x8081], 0x051e ; (1, 4) Loc 129=0x081; char_idx: 1=0x01
SET [0x8002], 0x5000 ; (2, 0) Loc 2=0x002; char_idx: 0=0x00
SET [0x8003], 0x5000 ; (3, 0) Loc 3=0x003; char_idx: 0=0x00
SET [0x8004], 0x5000 ; (4, 0) Loc 4=0x004; char_idx: 0=0x00
SET [0x8005], 0x5000 ; (5, 0) Loc 5=0x005; char_idx: 0=0x00
SET [0x8006], 0x5000 ; (6, 0) Loc 6=0x006; char_idx: 0=0x00
SET [0x8007], 0x5000 ; (7, 0) Loc 7=0x007; char_idx: 0=0x00
SET [0x8008], 0x5000 ; (8, 0) Loc 8=0x008; char_idx: 0=0x00
SET [0x8028], 0x0520 ; (8, 1) Loc 40=0x028; char_idx: 4=0x05
SET [0x8048], 0x5000 ; (8, 2) Loc 72=0x058; char_idx: 0=0x00
SET [0x8009], 0x5000 ; (9, 0) Loc 9=0x009; char_idx: 0=0x00
SET [0x8029], 0x5000 ; (9, 1) Loc 41=0x029; char_idx: 0=0x00
SET [0x8049], 0x5000 ; (9, 2) Loc 73=0x059; char_idx: 0=0x00
SET [0x800a], 0x5000 ; (10, 0) Loc 10=0x00a; char_idx: 0=0x00
SET [0x802a], 0x5000 ; (10, 1) Loc 42=0x02a; char_idx: 0=0x00
SET [0x804a], 0x5000 ; (10, 2) Loc 74=0x05a; char_idx: 0=0x00
SET [0x800b], 0x5000 ; (11, 0) Loc 11=0x00b; char_idx: 0=0x00
SET [0x802b], 0x5000 ; (11, 1) Loc 43=0x02b; char_idx: 0=0x00
SET [0x804b], 0x051c ; (11, 2) Loc 75=0x05b; char_idx: 5=0x05
SET [0x800c], 0x5000 ; (12, 0) Loc 12=0x00c; char_idx: 0=0x00
SET [0x802c], 0x5000 ; (12, 1) Loc 44=0x02c; char_idx: 0=0x00
SET [0x804c], 0x5000 ; (12, 2) Loc 76=0x05c; char_idx: 0=0x00
SET [0x806c], 0x503f ; (12, 3) Loc 108=0x06c; char_idx: 4=0x05
SET [0x808c], 0x053d ; (12, 4) Loc 140=0x08c; char_idx: 6=0x06
SET [0x800d], 0x5000 ; (13, 0) Loc 13=0x00d; char_idx: 0=0x00
SET [0x802d], 0x5000 ; (13, 1) Loc 45=0x02d; char_idx: 0=0x00
SET [0x804d], 0x5000 ; (13, 2) Loc 77=0x05d; char_idx: 0=0x00
SET [0x806d], 0x5000 ; (13, 3) Loc 109=0x06d; char_idx: 0=0x00
SET [0x808d], 0x053e ; (13, 4) Loc 141=0x08d; char_idx: 7=0x07
SET [0x800e], 0x5000 ; (14, 0) Loc 14=0x00e; char_idx: 0=0x00
SET [0x802e], 0x5000 ; (14, 1) Loc 46=0x02e; char_idx: 0=0x00
SET [0x804e], 0x5000 ; (14, 2) Loc 78=0x05e; char_idx: 0=0x00
SET [0x806e], 0x5000 ; (14, 3) Loc 110=0x06e; char_idx: 0=0x00
SET [0x808e], 0x053e ; (14, 4) Loc 142=0x08e; char_idx: 7=0x07
SET [0x800f], 0x5000 ; (15, 0) Loc 15=0x00f; char_idx: 0=0x00
SET [0x802f], 0x5000 ; (15, 1) Loc 47=0x02f; char_idx: 0=0x00
SET [0x804f], 0x5000 ; (15, 2) Loc 79=0x05f; char_idx: 0=0x00
SET [0x806f], 0x5000 ; (15, 3) Loc 111=0x06f; char_idx: 0=0x00
SET [0x808f], 0x057c ; (15, 4) Loc 143=0x08f; char_idx: 8=0x08
SET [0x8010], 0x5000 ; (16, 0) Loc 16=0x010; char_idx: 0=0x00
SET [0x8030], 0x5000 ; (16, 1) Loc 48=0x050; char_idx: 0=0x00
SET [0x8050], 0x5000 ; (16, 2) Loc 80=0x050; char_idx: 0=0x00
SET [0x8070], 0x5000 ; (16, 3) Loc 112=0x070; char_idx: 0=0x00
SET [0x8011], 0x5000 ; (17, 0) Loc 17=0x011; char_idx: 0=0x00
SET [0x8031], 0x5000 ; (17, 1) Loc 49=0x051; char_idx: 0=0x00
SET [0x8051], 0x5000 ; (17, 2) Loc 81=0x051; char_idx: 0=0x00
SET [0x8071], 0x5000 ; (17, 3) Loc 113=0x071; char_idx: 0=0x00
SET [0x8012], 0x5000 ; (18, 0) Loc 18=0x012; char_idx: 0=0x00
SET [0x8032], 0x5000 ; (18, 1) Loc 50=0x052; char_idx: 0=0x00
SET [0x8052], 0x5000 ; (18, 2) Loc 82=0x052; char_idx: 0=0x00
SET [0x8072], 0x5000 ; (18, 3) Loc 114=0x072; char_idx: 0=0x00
SET [0x8013], 0x5000 ; (19, 0) Loc 19=0x013; char_idx: 0=0x00
SET [0x8033], 0x5000 ; (19, 1) Loc 51=0x053; char_idx: 0=0x00
SET [0x8053], 0x5000 ; (19, 2) Loc 83=0x053; char_idx: 0=0x00
SET [0x8073], 0x5000 ; (19, 3) Loc 115=0x073; char_idx: 0=0x00
SET [0x8093], 0x057d ; (19, 4) Loc 147=0x093; char_idx: 9=0x09
SET [0x8014], 0x5000 ; (20, 0) Loc 20=0x014; char_idx: 0=0x00
SET [0x8034], 0x5000 ; (20, 1) Loc 52=0x054; char_idx: 0=0x00
SET [0x8054], 0x5000 ; (20, 2) Loc 84=0x054; char_idx: 0=0x00
SET [0x8074], 0x5000 ; (20, 3) Loc 116=0x074; char_idx: 0=0x00
SET [0x8094], 0x057e ; (20, 4) Loc 148=0x094; char_idx: 10=0x0a
SET [0x8015], 0x5000 ; (21, 0) Loc 21=0x015; char_idx: 0=0x00
SET [0x8035], 0x5000 ; (21, 1) Loc 53=0x055; char_idx: 0=0x00
SET [0x8055], 0x5000 ; (21, 2) Loc 85=0x055; char_idx: 0=0x00
SET [0x8075], 0x5000 ; (21, 3) Loc 117=0x075; char_idx: 0=0x00
SET [0x8095], 0x057e ; (21, 4) Loc 149=0x095; char_idx: 10=0x0a
SET [0x8016], 0x5000 ; (22, 0) Loc 22=0x016; char_idx: 0=0x00
SET [0x8036], 0x5000 ; (22, 1) Loc 54=0x056; char_idx: 0=0x00
SET [0x8056], 0x5000 ; (22, 2) Loc 86=0x056; char_idx: 0=0x00
SET [0x8076], 0x5000 ; (22, 3) Loc 118=0x076; char_idx: 0=0x00
SET [0x8096], 0x057e ; (22, 4) Loc 150=0x096; char_idx: 10=0x0a
SET [0x8017], 0x5000 ; (23, 0) Loc 23=0x017; char_idx: 0=0x00
SET [0x8037], 0x5000 ; (23, 1) Loc 55=0x057; char_idx: 0=0x00
SET [0x8057], 0x5000 ; (23, 2) Loc 87=0x057; char_idx: 0=0x00
SET [0x8077], 0x5000 ; (23, 3) Loc 119=0x077; char_idx: 0=0x00
SET [0x8097], 0x057e ; (23, 4) Loc 151=0x097; char_idx: 10=0x0a