-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.asm
executable file
·11944 lines (11667 loc) · 852 KB
/
main.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
; da65 V2.19 - Git 4dfbccfaf
; Input file: clean.nes
; Page: 1
.setcpu "6502"
; ----------------------------------------------------------------------------
PPUCTRL := $2000
PPUMASK := $2001
PPUSTATUS := $2002
OAMADDR := $2003
OAMDATA := $2004
PPUSCROLL := $2005
PPUADDR := $2006
PPUDATA := $2007
SQ1_VOL := $4000
SQ1_SWEEP := $4001
SQ1_LO := $4002
SQ1_HI := $4003
SQ2_VOL := $4004
SQ2_SWEEP := $4005
SQ2_LO := $4006
SQ2_HI := $4007
TRI_LINEAR := $4008
TRI_LO := $400A
TRI_HI := $400B
NOISE_VOL := $400C
NOISE_LO := $400E
NOISE_HI := $400F
DMC_FREQ := $4010
DMC_RAW := $4011
DMC_START := $4012 ; start << 6 + $C000
DMC_LEN := $4013 ; len << 4 + 1
OAMDMA := $4014
SND_CHN := $4015
JOY1 := $4016
JOY2 := $4017
; ----------------------------------------------------------------------------
unusedJumpToReset:
jmp reset ; 8000 4C 11 A9 L..
; ----------------------------------------------------------------------------
resetContinued:
lda #$01 ; 8003 A9 01 ..
sta ppuStagingAddress+1 ; 8005 85 49 .I
jsr initializeTitleScreen ; 8007 20 61 9E a.
mainLoop:
ldx #rngSeed ; 800A A2 34 .4
jsr genNextPseudoRandom ; 800C 20 FA 99 ..
lda frameCounterLow ; 800F A5 32 .2
cmp frameCounterLowLastFrame ; 8011 C5 2B .+
beq mainLoop ; 8013 F0 F5 ..
sta frameCounterLowLastFrame ; 8015 85 2B .+
lda currentPPUSlot ; 8017 A5 25 .%
cmp nextPPUSlot ; 8019 C5 27 .'
bne @skipResetPPUStagingAddress ; 801B D0 04 ..
lda #$00 ; 801D A9 00 ..
sta ppuStagingAddress ; 801F 85 48 .H
@skipResetPPUStagingAddress:
jsr pollController ; 8021 20 00 A4 ..
jsr processMenuInput ; 8024 20 87 9F ..
jsr pauseOrUnpause ; 8027 20 C5 B5 ..
jsr checkLevelUp ; 802A 20 E5 8C ..
jsr somethingWithLeaderboard ; 802D 20 E3 91 ..
jsr loadComputerInputOrMoveScreen ; 8030 20 FC 9B ..
ldx #PLAYER1 ; 8033 A2 00 ..
jsr stageLineClearAnimation ; 8035 20 48 88 H.
ldx #PLAYER2 ; 8038 A2 01 ..
jsr stageLineClearAnimation ; 803A 20 48 88 H.
ldx #PLAYER1 ; 803D A2 00 ..
jsr branchOnActiveDemoOrGameOver ; 803F 20 C7 82 ..
ldx #PLAYER2 ; 8042 A2 01 ..
jsr branchOnActiveDemoOrGameOver ; 8044 20 C7 82 ..
jsr stageCurrentAndNextSprites ; 8047 20 37 8B 7.
jsr renderStatistics ; 804A 20 62 9B b.
jmp mainLoop ; 804D 4C 0A 80 L..
; ----------------------------------------------------------------------------
; menuGameMode is 3 (vs) or 4 (with) when computer is playing
testIfComputerPlayingThenMove:
lda player1ControllerNew,x ; 8050 B5 46 .F
and #~BUTTON_DOWN ; 8052 29 DF ).
cpx #PLAYER1 ; 8054 E0 00 ..
beq @player1Active ; 8056 F0 07 ..
ldy menuGameMode ; 8058 AC F0 04 ...
cpy #MENU_GAMEMODE_VS ; 805B C0 03 ..
bcs @ret ; 805D B0 04 ..
@player1Active:
ldy gameState ; 805F A4 29 .)
beq doSomethingWithInputDuringGameplay ; 8061 F0 01 ..
@ret:
rts ; 8063 60 `
; ----------------------------------------------------------------------------
doSomethingWithInputDuringGameplay:
tay ; 8064 A8 .
@LeftAndRight:
and #BUTTON_LEFT+BUTTON_RIGHT ; 8065 29 C0 ).
beq L8073 ; 8067 F0 0A ..
lda player1ControllerLastFrame,x ; 8069 B5 3E .>
@CheckForDown:
and #BUTTON_DOWN ; 806B 29 20 )
beq L8073 ; 806D F0 04 ..
tya ; 806F 98 .
and #$3F ; 8070 29 3F )?
tay ; 8072 A8 .
L8073:
lda player1ControllerHeld,x ; 8073 B5 42 .B
sta generalCounter36 ; 8075 85 36 .6
@LeftAndDown:
and #BUTTON_DOWN+BUTTON_LEFT ; 8077 29 60 )`
cmp #BUTTON_LEFT ; 8079 C9 40 .@
bne @LeftNotPressed ; 807B D0 15 ..
lda dasLeftPlayer1,x ; 807D BD AA 01 ...
clc ; 8080 18 .
adc #$01 ; 8081 69 01 i.
sta dasLeftPlayer1,x ; 8083 9D AA 01 ...
cmp #$0B ; 8086 C9 0B ..
bcc L8097 ; 8088 90 0D ..
tya ; 808A 98 .
ora #BUTTON_LEFT ; 808B 09 40 .@
tay ; 808D A8 .
lda #$05 ; 808E A9 05 ..
bne @jumpOverLoad0 ; 8090 D0 02 ..
@LeftNotPressed:
lda #$00 ; 8092 A9 00 ..
@jumpOverLoad0:
sta dasLeftPlayer1,x ; 8094 9D AA 01 ...
L8097:
lda generalCounter36 ; 8097 A5 36 .6
@RightAndDown:
and #BUTTON_RIGHT+BUTTON_DOWN ; 8099 29 A0 ).
cmp #BUTTON_RIGHT ; 809B C9 80 ..
bne @RightNotPressed ; 809D D0 15 ..
lda dasRightPlayer1,x ; 809F BD AC 01 ...
clc ; 80A2 18 .
adc #$01 ; 80A3 69 01 i.
sta dasRightPlayer1,x ; 80A5 9D AC 01 ...
cmp #$0B ; 80A8 C9 0B ..
bcc L80B9 ; 80AA 90 0D ..
tya ; 80AC 98 .
ora #BUTTON_RIGHT ; 80AD 09 80 ..
tay ; 80AF A8 .
lda #$05 ; 80B0 A9 05 ..
bne L80B6 ; 80B2 D0 02 ..
@RightNotPressed:
lda #$00 ; 80B4 A9 00 ..
L80B6:
sta dasRightPlayer1,x ; 80B6 9D AC 01 ...
L80B9:
lda generalCounter36 ; 80B9 A5 36 .6
and #BUTTON_B ; 80BB 29 02 ).
beq @BNotPressed ; 80BD F0 11 ..
lda autoRotateCounterP1,x ; 80BF BD AE 01 ...
clc ; 80C2 18 .
adc #$01 ; 80C3 69 01 i.
sta autoRotateCounterP1,x ; 80C5 9D AE 01 ...
cmp #$0F ; 80C8 C9 0F ..
bcc L80D5 ; 80CA 90 09 ..
tya ; 80CC 98 .
ora #BUTTON_B ; 80CD 09 02 ..
tay ; 80CF A8 .
@BNotPressed:
lda #$00 ; 80D0 A9 00 ..
sta autoRotateCounterP1,x ; 80D2 9D AE 01 ...
L80D5:
lda generalCounter36 ; 80D5 A5 36 .6
and #BUTTON_A ; 80D7 29 01 ).
beq @ANotPressed ; 80D9 F0 11 ..
lda autoRotateClockwiseP1,x ; 80DB BD B0 01 ...
clc ; 80DE 18 .
adc #$01 ; 80DF 69 01 i.
sta autoRotateClockwiseP1,x ; 80E1 9D B0 01 ...
cmp #$0F ; 80E4 C9 0F ..
bcc L80F1 ; 80E6 90 09 ..
tya ; 80E8 98 .
ora #BUTTON_A ; 80E9 09 01 ..
tay ; 80EB A8 .
@ANotPressed:
lda #$00 ; 80EC A9 00 ..
sta autoRotateClockwiseP1,x ; 80EE 9D B0 01 ...
L80F1:
lda generalCounter36 ; 80F1 A5 36 .6
@DownLeftRight:
and #BUTTON_DOWN+BUTTON_LEFT+BUTTON_RIGHT ; 80F3 29 E0 ).
cmp #BUTTON_DOWN ; 80F5 C9 20 .
bne L8122 ; 80F7 D0 29 .)
lda dropRepeatP1,x ; 80F9 BD B2 01 ...
clc ; 80FC 18 .
adc #$01 ; 80FD 69 01 i.
sta dropRepeatP1,x ; 80FF 9D B2 01 ...
cmp dropRatePossibleP1,x ; 8102 DD B4 01 ...
bcc L8120 ; 8105 90 19 ..
tya ; 8107 98 .
ora #BUTTON_DOWN ; 8108 09 20 .
sta generalCounter36 ; 810A 85 36 .6
lda dropRatePossibleP1,x ; 810C BD B4 01 ...
cmp #$02 ; 810F C9 02 ..
bcc L8116 ; 8111 90 03 ..
dec dropRatePossibleP1,x ; 8113 DE B4 01 ...
L8116:
jsr L9AEE ; 8116 20 EE 9A ..
ldy generalCounter36 ; 8119 A4 36 .6
L811B:
lda #$00 ; 811B A9 00 ..
sta dropRepeatP1,x ; 811D 9D B2 01 ...
L8120:
tya ; 8120 98 .
rts ; 8121 60 `
; ----------------------------------------------------------------------------
L8122:
lda #$05 ; 8122 A9 05 ..
sta dropRatePossibleP1,x ; 8124 9D B4 01 ...
bne L811B ; 8127 D0 F2 ..
L8129:
ldy L8198,x ; 8129 BC 98 81 ...
stx generalCounter39 ; 812C 86 39 .9
lda $2D ; 812E A5 2D .-
asl a ; 8130 0A .
asl a ; 8131 0A .
asl a ; 8132 0A .
sec ; 8133 38 8
sbc #$D8 ; 8134 E9 D8 ..
eor #$FF ; 8136 49 FF I.
cmp #$4F ; 8138 C9 4F .O
bcs L813E ; 813A B0 02 ..
lda #$4F ; 813C A9 4F .O
L813E:
sec ; 813E 38 8
sbc ppuScrollYOffset ; 813F ED F6 04 ...
sta oamStaging,y ; 8142 99 00 05 ...
sta oamStaging+4,y ; 8145 99 04 05 ...
sta oamStaging+8,y ; 8148 99 08 05 ...
lda #$00 ; 814B A9 00 ..
sta oamStaging+3,y ; 814D 99 03 05 ...
sta oamStaging+7,y ; 8150 99 07 05 ...
sta oamStaging+11,y ; 8153 99 0B 05 ...
bit playMode ; 8156 24 2F $/
bpl L815C ; 8158 10 02 ..
inx ; 815A E8 .
inx ; 815B E8 .
L815C:
lda generalCounter36 ; 815C A5 36 .6
bne L8165 ; 815E D0 05 ..
lda L8194,x ; 8160 BD 94 81 ...
bne L8168 ; 8163 D0 03 ..
L8165:
lda L8190,x ; 8165 BD 90 81 ...
L8168:
sta oamStaging+2,y ; 8168 99 02 05 ...
clc ; 816B 18 .
lda generalCounter36 ; 816C A5 36 .6
beq L8173 ; 816E F0 03 ..
ora #$30 ; 8170 09 30 .0
sec ; 8172 38 8
L8173:
sta oamStaging+1,y ; 8173 99 01 05 ...
lda generalCounter37 ; 8176 A5 37 .7
bcs L817C ; 8178 B0 02 ..
beq L817E ; 817A F0 02 ..
L817C:
ora #$30 ; 817C 09 30 .0
L817E:
sta oamStaging+5,y ; 817E 99 05 05 ...
lda generalCounter38 ; 8181 A5 38 .8
ora #$30 ; 8183 09 30 .0
sta oamStaging+9,y ; 8185 99 09 05 ...
ldx generalCounter39 ; 8188 A6 39 .9
lda #$3C ; 818A A9 3C .<
sta pointsDisplayTimerP1,x ; 818C 9D C8 01 ...
rts ; 818F 60 `
; ----------------------------------------------------------------------------
L8190:
.byte $60,$88,$28,$C0 ; 8190 60 88 28 C0`.(.
L8194:
.byte $58,$88,$28,$B8 ; 8194 58 88 28 B8X.(.
L8198:
.byte $E0,$EC ; 8198 E0 EC ..
; ----------------------------------------------------------------------------
stageDropPointSprites:
lda lineClearTimerP1,x ; 819A BD CE 01 ...
bne L81DC ; 819D D0 3D .=
lda pointsDisplayTimerP1,x ; 819F BD C8 01 ...
beq L81DC ; 81A2 F0 38 .8
ldy L8198,x ; 81A4 BC 98 81 ...
cmp #$3C ; 81A7 C9 3C .<
bne L81CC ; 81A9 D0 21 .!
lda oamStaging+2,y ; 81AB B9 02 05 ...
sta oamStaging+3,y ; 81AE 99 03 05 ...
clc ; 81B1 18 .
adc #$08 ; 81B2 69 08 i.
sta oamStaging+7,y ; 81B4 99 07 05 ...
adc #$08 ; 81B7 69 08 i.
sta oamStaging+11,y ; 81B9 99 0B 05 ...
lda #$03 ; 81BC A9 03 ..
bit playMode ; 81BE 24 2F $/
beq L81C3 ; 81C0 F0 01 ..
txa ; 81C2 8A .
L81C3:
sta oamStaging+2,y ; 81C3 99 02 05 ...
sta oamStaging+6,y ; 81C6 99 06 05 ...
sta oamStaging+10,y ; 81C9 99 0A 05 ...
L81CC:
dec pointsDisplayTimerP1,x ; 81CC DE C8 01 ...
bne L81DC ; 81CF D0 0B ..
lda #$F7 ; 81D1 A9 F7 ..
sta oamStaging,y ; 81D3 99 00 05 ...
sta oamStaging+4,y ; 81D6 99 04 05 ...
sta oamStaging+8,y ; 81D9 99 08 05 ...
L81DC:
rts ; 81DC 60 `
; ----------------------------------------------------------------------------
L81DD:
bit playMode ; 81DD 24 2F $/
bpl L81EC ; 81DF 10 0B ..
txa ; 81E1 8A .
eor #$01 ; 81E2 49 01 I.
tax ; 81E4 AA .
jsr L81EC ; 81E5 20 EC 81 ..
txa ; 81E8 8A .
eor #$01 ; 81E9 49 01 I.
tax ; 81EB AA .
L81EC:
txa ; 81EC 8A .
stx generalCounter36 ; 81ED 86 36 .6
asl a ; 81EF 0A .
adc generalCounter36 ; 81F0 65 36 e6
asl a ; 81F2 0A .
tay ; 81F3 A8 .
lda menuGameMode ; 81F4 AD F0 04 ...
cmp #MENU_GAMEMODE_VS ; 81F7 C9 03 ..
bcc L81FF ; 81F9 90 04 ..
tya ; 81FB 98 .
beq L81FF ; 81FC F0 01 ..
rts ; 81FE 60 `
; ----------------------------------------------------------------------------
L81FF:
ldx #$54 ; 81FF A2 54 .T
L8201:
lda player1ScoreOnes,y ; 8201 B9 1D 04 ...
cmp highScoreOnes,x ; 8204 DD 41 04 .A.
lda player1ScoreTens,y ; 8207 B9 1C 04 ...
sbc highScoreTens,x ; 820A FD 40 04 .@.
lda player1ScoreHundreds,y ; 820D B9 1B 04 ...
sbc highScoreHundreds,x ; 8210 FD 3F 04 .?.
lda player1ScoreThousands,y ; 8213 B9 1A 04 ...
sbc highScoreThousands,x ; 8216 FD 3E 04 .>.
lda player1ScoreTenThousands,y ; 8219 B9 19 04 ...
sbc highScoreTenThousands,x ; 821C FD 3D 04 .=.
lda player1ScoreHundredThousands,y ; 821F B9 18 04 ...
sbc highScoreHundredThousands,x ; 8222 FD 3C 04 .<.
bcc L822D ; 8225 90 06 ..
txa ; 8227 8A .
sbc #$06 ; 8228 E9 06 ..
tax ; 822A AA .
bcs L8201 ; 822B B0 D4 ..
L822D:
txa ; 822D 8A .
clc ; 822E 18 .
adc #$06 ; 822F 69 06 i.
cmp #$5A ; 8231 C9 5A .Z
beq L8297 ; 8233 F0 62 .b
jsr L829A ; 8235 20 9A 82 ..
lda player1ScoreOnes,y ; 8238 B9 1D 04 ...
sta highScoreOnes,x ; 823B 9D 41 04 .A.
lda player1ScoreTens,y ; 823E B9 1C 04 ...
sta highScoreTens,x ; 8241 9D 40 04 .@.
lda player1ScoreHundreds,y ; 8244 B9 1B 04 ...
sta highScoreHundreds,x ; 8247 9D 3F 04 .?.
lda player1ScoreThousands,y ; 824A B9 1A 04 ...
sta highScoreThousands,x ; 824D 9D 3E 04 .>.
lda player1ScoreTenThousands,y ; 8250 B9 19 04 ...
sta highScoreTenThousands,x ; 8253 9D 3D 04 .=.
lda player1ScoreHundredThousands,y ; 8256 B9 18 04 ...
sta highScoreHundredThousands,x ; 8259 9D 3C 04 .<.
lda generalCounter36 ; 825C A5 36 .6
asl a ; 825E 0A .
asl a ; 825F 0A .
tay ; 8260 A8 .
txa ; 8261 8A .
lsr a ; 8262 4A J
tax ; 8263 AA .
lda player1LinesThousands,y ; 8264 B9 24 04 .$.
cmp #$30 ; 8267 C9 30 .0
beq L8275 ; 8269 F0 0A ..
lda #$39 ; 826B A9 39 .9
sta leaderboardLines,x ; 826D 9D 96 04 ...
sta leaderboardLines+1,x ; 8270 9D 97 04 ...
bne L8284 ; 8273 D0 0F ..
L8275:
lda player1LinesHundreds,y ; 8275 B9 25 04 .%.
sta leaderboardLines,x ; 8278 9D 96 04 ...
lda player1LinesTens,y ; 827B B9 26 04 .&.
sta leaderboardLines+1,x ; 827E 9D 97 04 ...
lda player1LinesOnes,y ; 8281 B9 27 04 .'.
L8284:
sta leaderboardLines+2,x ; 8284 9D 98 04 ...
lda #$01 ; 8287 A9 01 ..
ldy generalCounter36 ; 8289 A4 36 .6
ora L93DA,y ; 828B 19 DA 93 ...
sta leaderboardInitials,x ; 828E 9D C3 04 ...
sta leaderboardInitials+1,x ; 8291 9D C4 04 ...
sta leaderboardInitials+2,x ; 8294 9D C5 04 ...
L8297:
ldx generalCounter36 ; 8297 A6 36 .6
rts ; 8299 60 `
; ----------------------------------------------------------------------------
L829A:
sta generalCounter37 ; 829A 85 37 .7
ldx #$54 ; 829C A2 54 .T
cpx generalCounter37 ; 829E E4 37 .7
beq L82C6 ; 82A0 F0 24 .$
L82A2:
dex ; 82A2 CA .
lda highScoreHundredThousands,x ; 82A3 BD 3C 04 .<.
sta leaderboardScores,x ; 82A6 9D 42 04 .B.
cpx generalCounter37 ; 82A9 E4 37 .7
bne L82A2 ; 82AB D0 F5 ..
lsr generalCounter37 ; 82AD 46 37 F7
ldx #$2A ; 82AF A2 2A .*
L82B1:
dex ; 82B1 CA .
lda leaderboardLines,x ; 82B2 BD 96 04 ...
sta leaderboardLines+3,x ; 82B5 9D 99 04 ...
lda leaderboardInitials,x ; 82B8 BD C3 04 ...
sta leaderboardInitials+3,x ; 82BB 9D C6 04 ...
cpx generalCounter37 ; 82BE E4 37 .7
bne L82B1 ; 82C0 D0 EF ..
lda generalCounter37 ; 82C2 A5 37 .7
asl a ; 82C4 0A .
tax ; 82C5 AA .
L82C6:
rts ; 82C6 60 `
; ----------------------------------------------------------------------------
; x contains current player (0 or 1)
branchOnActiveDemoOrGameOver:
jsr stageDropPointSprites ; 82C7 20 9A 81 ..
ldy gameState ; 82CA A4 29 .)
beq activeGamePlay ; 82CC F0 09 ..
cpy #GAMESTATE_DEMO ; 82CE C0 FB ..
beq activeGamePlay ; 82D0 F0 05 ..
cpy #GAMESTATE_GAMEOVER ; 82D2 C0 F9 ..
beq handleGameOver ; 82D4 F0 1D ..
gameOverReturn:
rts ; 82D6 60 `
; ----------------------------------------------------------------------------
activeGamePlay:
lda lineClearTimerP1,x ; 82D7 BD CE 01 ...
bne gameOverReturn ; 82DA D0 FA ..
ldy playMode ; 82DC A4 2F ./
bpl L82E8 ; 82DE 10 08 ..
lda lineClearTimerP1 ; 82E0 AD CE 01 ...
ora lineClearTimerP2 ; 82E3 0D CF 01 ...
bne gameOverReturn ; 82E6 D0 EE ..
L82E8:
lda player1GameActive,x ; 82E8 B5 4A .J
beq handleGameOver ; 82EA F0 07 ..
lda player1TetrominoCurrent,x ; 82EC B5 64 .d
bne L8320 ; 82EE D0 30 .0
jmp getNextTetromino ; 82F0 4C 29 99 L).
; ----------------------------------------------------------------------------
; A+B held to restart game. https://tcrf.net/Talk:Tetris_(NES,_Tengen)
handleGameOver:
lda player1ControllerHeld,x ; 82F3 B5 42 .B
and #BUTTON_A+BUTTON_B ; 82F5 29 03 ).
cmp #BUTTON_A+BUTTON_B ; 82F7 C9 03 ..
bne gameOverReturn ; 82F9 D0 DB ..
cpy #$FB ; 82FB C0 FB ..
beq gameOverReturn ; 82FD F0 D7 ..
lda playMode ; 82FF A5 2F ./
beq @playmodeIs0 ; 8301 F0 0F ..
bmi restoreOriginalRNGSeed ; 8303 30 10 0.
lda menuGameMode ; 8305 AD F0 04 ...
cmp #MENU_GAMEMODE_VS ; 8308 C9 03 ..
bne @notVsComputer ; 830A D0 03 ..
txa ; 830C 8A .
bne gameOverReturn ; 830D D0 C7 ..
@notVsComputer:
jmp restartVsMode ; 830F 4C 44 97 LD.
; ----------------------------------------------------------------------------
@playmodeIs0:
txa ; 8312 8A .
bne gameOverReturn ; 8313 D0 C1 ..
restoreOriginalRNGSeed:
lda savedRNGSeed ; 8315 A5 5A .Z
sta rngSeed ; 8317 85 34 .4
lda savedRNGSeed+1 ; 8319 A5 5B .[
sta rngSeed+1 ; 831B 85 35 .5
jmp initializeGameMode ; 831D 4C E3 95 L..
; ----------------------------------------------------------------------------
L8320:
jsr testIfComputerPlayingThenMove ; 8320 20 50 80 P.
sta generalCounter3b ; 8323 85 3B .;
dec player1FallTimer,x ; 8325 D6 6A .j
bne L8330 ; 8327 D0 07 ..
ora #$20 ; 8329 09 20 .
sta generalCounter3b ; 832B 85 3B .;
jsr L9AEE ; 832D 20 EE 9A ..
L8330:
lda generalCounter3b ; 8330 A5 3B .;
and #$E3 ; 8332 29 E3 ).
beq gameOverReturn ; 8334 F0 A0 ..
jsr L84D8 ; 8336 20 D8 84 ..
lda generalCounter3b ; 8339 A5 3B .;
and #$40 ; 833B 29 40 )@
beq L8352 ; 833D F0 13 ..
dec player1TetrominoX,x ; 833F D6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet ; 8341 20 50 86 P.
bcs L8352 ; 8344 B0 0C ..
lda #$09 ; 8346 A9 09 ..
sta dasLeftPlayer1,x ; 8348 9D AA 01 ...
inc player1TetrominoX,x ; 834B F6 62 .b
bvs L8352 ; 834D 70 03 p.
jsr L862E ; 834F 20 2E 86 ..
L8352:
lda generalCounter3b ; 8352 A5 3B .;
and #$80 ; 8354 29 80 ).
beq L836B ; 8356 F0 13 ..
inc player1TetrominoX,x ; 8358 F6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet ; 835A 20 50 86 P.
bcs L836B ; 835D B0 0C ..
lda #$09 ; 835F A9 09 ..
sta dasRightPlayer1,x ; 8361 9D AC 01 ...
dec player1TetrominoX,x ; 8364 D6 62 .b
bvs L836B ; 8366 70 03 p.
jsr L862E ; 8368 20 2E 86 ..
L836B:
lda generalCounter3b ; 836B A5 3B .;
and #$02 ; 836D 29 02 ).
beq L838E ; 836F F0 1D ..
lda player1TetrominoOrientation,x ; 8371 B5 68 .h
sta generalCounter3a ; 8373 85 3A .:
clc ; 8375 18 .
adc #$01 ; 8376 69 01 i.
and #$03 ; 8378 29 03 ).
sta player1TetrominoOrientation,x ; 837A 95 68 .h
jsr checkPositionAndClearFlagsOnCarrySet ; 837C 20 50 86 P.
bcs L838E ; 837F B0 0D ..
dec player1TetrominoX,x ; 8381 D6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet ; 8383 20 50 86 P.
bcs L838E ; 8386 B0 06 ..
inc player1TetrominoX,x ; 8388 F6 62 .b
lda generalCounter3a ; 838A A5 3A .:
sta player1TetrominoOrientation,x ; 838C 95 68 .h
; This has something to do with wallkicks
L838E:
lda generalCounter3b ; 838E A5 3B .;
and #$01 ; 8390 29 01 ).
beq L83B1 ; 8392 F0 1D ..
lda player1TetrominoOrientation,x ; 8394 B5 68 .h
sta generalCounter3a ; 8396 85 3A .:
sec ; 8398 38 8
sbc #$01 ; 8399 E9 01 ..
and #$03 ; 839B 29 03 ).
sta player1TetrominoOrientation,x ; 839D 95 68 .h
jsr checkPositionAndClearFlagsOnCarrySet ; 839F 20 50 86 P.
bcs L83B1 ; 83A2 B0 0D ..
dec player1TetrominoX,x ; 83A4 D6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet ; 83A6 20 50 86 P.
bcs L83B1 ; 83A9 B0 06 ..
inc player1TetrominoX,x ; 83AB F6 62 .b
lda generalCounter3a ; 83AD A5 3A .:
sta player1TetrominoOrientation,x ; 83AF 95 68 .h
L83B1:
lda generalCounter3b ; 83B1 A5 3B .;
and #$20 ; 83B3 29 20 )
beq L8416 ; 83B5 F0 5F ._
inc player1TetrominoY,x ; 83B7 F6 60 .`
jsr checkCoopCollision ; 83B9 20 15 8C ..
bcs L840B ; 83BC B0 4D .M
jsr L8658 ; 83BE 20 58 86 X.
bcs L8416 ; 83C1 B0 53 .S
dec player1TetrominoY,x ; 83C3 D6 60 .`
jsr L85B3 ; 83C5 20 B3 85 ..
jsr L9A47 ; 83C8 20 47 9A G.
jsr L8129 ; 83CB 20 29 81 ).
lda player1TetrominoY,x ; 83CE B5 60 .`
cmp #$06 ; 83D0 C9 06 ..
bcs L8417 ; 83D2 B0 43 .C
lda #$00 ; 83D4 A9 00 ..
bit playMode ; 83D6 24 2F $/
bpl L83DE ; 83D8 10 04 ..
sta player1GameActive ; 83DA 85 4A .J
sta player2GameActive ; 83DC 85 4B .K
L83DE:
sta player1GameActive,x ; 83DE 95 4A .J
lda gameState ; 83E0 A5 29 .)
bne L83E7 ; 83E2 D0 03 ..
jsr L81DD ; 83E4 20 DD 81 ..
L83E7:
lda player1GameActive ; 83E7 A5 4A .J
ora player2GameActive ; 83E9 05 4B .K
bne L83F8 ; 83EB D0 0B ..
lda #GAMESTATE_GAMEOVER ; 83ED A9 F9 ..
sta gameState ; 83EF 85 29 .)
sta player1FallTimer ; 83F1 85 6A .j
lda #MUSIC_SILENCE ; 83F3 A9 08 ..
jsr setMusicOrSoundEffect ; 83F5 20 B1 CF ..
L83F8:
txa ; 83F8 8A .
lda #$02 ; 83F9 A9 02 ..
bit playMode ; 83FB 24 2F $/
bmi L8403 ; 83FD 30 04 0.
txa ; 83FF 8A .
clc ; 8400 18 .
adc #$03 ; 8401 69 03 i.
L8403:
jsr updateGameBackground ; 8403 20 03 B6 ..
lda #MUSIC_GAMEOVER ; 8406 A9 0A ..
jmp setMusicOrSoundEffect ; 8408 4C B1 CF L..
; ----------------------------------------------------------------------------
L840B:
dec player1TetrominoY,x ; 840B D6 60 .`
lda #$01 ; 840D A9 01 ..
sta player1FallTimer,x ; 840F 95 6A .j
lda #$05 ; 8411 A9 05 ..
sta dropRatePossibleP1,x ; 8413 9D B4 01 ...
L8416:
rts ; 8416 60 `
; ----------------------------------------------------------------------------
L8417:
lda #$00 ; 8417 A9 00 ..
sta player1TetrominoCurrent,x ; 8419 95 64 .d
lda #SOUND_DROP ; 841B A9 0E ..
jsr setMusicOrSoundEffect ; 841D 20 B1 CF ..
jsr L8565 ; 8420 20 65 85 e.
jsr L8773 ; 8423 20 73 87 s.
L8426:
ldy #$00 ; 8426 A0 00 ..
lda #$07 ; 8428 A9 07 ..
sta generalCounter36 ; 842A 85 36 .6
L842C:
ldx #$08 ; 842C A2 08 ..
L842E:
lda $7A,y ; 842E B9 7A 00 .z.
cmp $B2,y ; 8431 D9 B2 00 ...
bne L844A ; 8434 D0 14 ..
iny ; 8436 C8 .
dex ; 8437 CA .
bne L842E ; 8438 D0 F4 ..
L843A:
lda $ED ; 843A A5 ED ..
clc ; 843C 18 .
adc #$20 ; 843D 69 20 i
sta $ED ; 843F 85 ED ..
bcc L8445 ; 8441 90 02 ..
inc $EE ; 8443 E6 EE ..
L8445:
dec generalCounter36 ; 8445 C6 36 .6
bne L842C ; 8447 D0 E3 ..
rts ; 8449 60 `
; ----------------------------------------------------------------------------
L844A:
sty generalCounter38 ; 844A 84 38 .8
stx generalCounter37 ; 844C 86 37 .7
L844E:
sty generalCounter39 ; 844E 84 39 .9
L8450:
iny ; 8450 C8 .
dex ; 8451 CA .
beq L845E ; 8452 F0 0A ..
lda $7A,y ; 8454 B9 7A 00 .z.
cmp $B2,y ; 8457 D9 B2 00 ...
beq L8450 ; 845A F0 F4 ..
bne L844E ; 845C D0 F0 ..
L845E:
jsr enableNMIAndWaitForRendering ; 845E 20 DB A3 ..
stx generalCounter3a ; 8461 86 3A .:
ldx generalCounter38 ; 8463 A6 38 .8
ldy #$00 ; 8465 A0 00 ..
L8467:
lda $B2,x ; 8467 B5 B2 ..
sta (ppuStagingAddress),y ; 8469 91 48 .H
iny ; 846B C8 .
inx ; 846C E8 .
dec generalCounter37 ; 846D C6 37 .7
bne L8467 ; 846F D0 F6 ..
txa ; 8471 8A .
tay ; 8472 A8 .
ldx generalCounter3a ; 8473 A6 3A .:
lda ppuStagingAddress ; 8475 A5 48 .H
sta renderSlot0Data,x ; 8477 95 08 ..
lda ppuStagingAddress+1 ; 8479 A5 49 .I
sta renderSlot0Data+1,x ; 847B 95 09 ..
lda generalCounter38 ; 847D A5 38 .8
and #$07 ; 847F 29 07 ).
clc ; 8481 18 .
adc $ED ; 8482 65 ED e.
sta renderSlot0Addr,x ; 8484 95 16 ..
lda $EE ; 8486 A5 EE ..
adc #$00 ; 8488 69 00 i.
sta renderSlot0Addr+1,x ; 848A 95 17 ..
lda generalCounter39 ; 848C A5 39 .9
sec ; 848E 38 8
sbc generalCounter38 ; 848F E5 38 .8
adc #$00 ; 8491 69 00 i.
sta ppuRenderSlot0Length,x ; 8493 95 24 .$
clc ; 8495 18 .
adc ppuStagingAddress ; 8496 65 48 eH
sta ppuStagingAddress ; 8498 85 48 .H
jmp L843A ; 849A 4C 3A 84 L:.
; ----------------------------------------------------------------------------
L849D:
lda #$00 ; 849D A9 00 ..
sta generalCounter36 ; 849F 85 36 .6
iny ; 84A1 C8 .
sty generalCounter37 ; 84A2 84 37 .7
bit playMode ; 84A4 24 2F $/
bmi L84AE ; 84A6 30 06 0.
lda #$0A ; 84A8 A9 0A ..
sta generalCounter38 ; 84AA 85 38 .8
bne L84C4 ; 84AC D0 16 ..
L84AE:
lda #$0C ; 84AE A9 0C ..
sta generalCounter38 ; 84B0 85 38 .8
L84B2:
lda (generalCounter3a),y ; 84B2 B1 3A .:
lsr a ; 84B4 4A J
lsr a ; 84B5 4A J
lsr a ; 84B6 4A J
lsr a ; 84B7 4A J
ldy generalCounter36 ; 84B8 A4 36 .6
sta (ppuStagingAddress),y ; 84BA 91 48 .H
inc generalCounter36 ; 84BC E6 36 .6
ldy generalCounter37 ; 84BE A4 37 .7
dec generalCounter38 ; 84C0 C6 38 .8
beq L84D7 ; 84C2 F0 13 ..
L84C4:
lda (generalCounter3a),y ; 84C4 B1 3A .:
iny ; 84C6 C8 .
sty generalCounter37 ; 84C7 84 37 .7
and #$0F ; 84C9 29 0F ).
ldy generalCounter36 ; 84CB A4 36 .6
sta (ppuStagingAddress),y ; 84CD 91 48 .H
inc generalCounter36 ; 84CF E6 36 .6
ldy generalCounter37 ; 84D1 A4 37 .7
dec generalCounter38 ; 84D3 C6 38 .8
bne L84B2 ; 84D5 D0 DB ..
L84D7:
rts ; 84D7 60 `
; ----------------------------------------------------------------------------
L84D8:
lda player1TetrominoY,x ; 84D8 B5 60 .`
sec ; 84DA 38 8
sbc #$01 ; 84DB E9 01 ..
sta $EA ; 84DD 85 EA ..
asl a ; 84DF 0A .
asl a ; 84E0 0A .
asl a ; 84E1 0A .
sta generalCounter36 ; 84E2 85 36 .6
lda player1TetrominoX,x ; 84E4 B5 62 .b
sec ; 84E6 38 8
sbc #$02 ; 84E7 E9 02 ..
bpl L84ED ; 84E9 10 02 ..
lda #$00 ; 84EB A9 00 ..
L84ED:
sta $EB ; 84ED 85 EB ..
lsr a ; 84EF 4A J
ora generalCounter36 ; 84F0 05 36 .6
sta $EC ; 84F2 85 EC ..
sta generalCounter36 ; 84F4 85 36 .6
stx generalCounter39 ; 84F6 86 39 .9
bit playMode ; 84F8 24 2F $/
bpl L84FE ; 84FA 10 02 ..
ldx #$02 ; 84FC A2 02 ..
L84FE:
lda playfieldPages,x ; 84FE BD 62 85 .b.
sta generalCounter37 ; 8501 85 37 .7
lda L8559,x ; 8503 BD 59 85 .Y.
sta $EE ; 8506 85 EE ..
lda $EA ; 8508 A5 EA ..
asl a ; 850A 0A .
asl a ; 850B 0A .
asl a ; 850C 0A .
asl a ; 850D 0A .
rol $EE ; 850E 26 EE &.
asl a ; 8510 0A .
rol $EE ; 8511 26 EE &.
adc L8556,x ; 8513 7D 56 85 }V.
bcc L851A ; 8516 90 02 ..
inc $EE ; 8518 E6 EE ..
L851A:
clc ; 851A 18 .
adc $EB ; 851B 65 EB e.
bcc L8521 ; 851D 90 02 ..
inc $EE ; 851F E6 EE ..
L8521:
sta $ED ; 8521 85 ED ..
ldx #$00 ; 8523 A2 00 ..
ldy #$00 ; 8525 A0 00 ..
lda $EB ; 8527 A5 EB ..
lsr a ; 8529 4A J
bcs L8537 ; 852A B0 0B ..
L852C:
lda (generalCounter36),y ; 852C B1 36 .6
lsr a ; 852E 4A J
lsr a ; 852F 4A J
lsr a ; 8530 4A J
lsr a ; 8531 4A J
jsr L8544 ; 8532 20 44 85 D.
bcs L8541 ; 8535 B0 0A ..
L8537:
lda (generalCounter36),y ; 8537 B1 36 .6
iny ; 8539 C8 .
and #$0F ; 853A 29 0F ).
jsr L8544 ; 853C 20 44 85 D.
bcc L852C ; 853F 90 EB ..
L8541:
ldx generalCounter39 ; 8541 A6 39 .9
rts ; 8543 60 `
; ----------------------------------------------------------------------------
L8544:
sta $7A,x ; 8544 95 7A .z
sta $B2,x ; 8546 95 B2 ..
inx ; 8548 E8 .
txa ; 8549 8A .
and #$07 ; 854A 29 07 ).
bne L8553 ; 854C D0 05 ..
tya ; 854E 98 .
clc ; 854F 18 .
adc #$04 ; 8550 69 04 i.
tay ; 8552 A8 .
L8553:
cpx #$38 ; 8553 E0 38 .8
rts ; 8555 60 `
; ----------------------------------------------------------------------------
L8556:
.byte $3F,$51,$48 ; 8556 3F 51 48 ?QH
L8559:
.byte $08,$08,$08 ; 8559 08 08 08 ...
L855C:
.byte $02,$14,$0A ; 855C 02 14 0A ...
L855F:
.byte $21,$21,$21 ; 855F 21 21 21 !!!
playfieldPages:
.byte $06,$07,$06 ; 8562 06 07 06 ...
; ----------------------------------------------------------------------------
L8565:
lda $EC ; 8565 A5 EC ..
sta generalCounter36 ; 8567 85 36 .6
stx generalCounter39 ; 8569 86 39 .9
bit playMode ; 856B 24 2F $/
bpl L8571 ; 856D 10 02 ..
ldx #$00 ; 856F A2 00 ..
L8571:
lda playfieldPages,x ; 8571 BD 62 85 .b.
sta generalCounter37 ; 8574 85 37 .7
ldx #$00 ; 8576 A2 00 ..
ldy #$00 ; 8578 A0 00 ..
lda $EB ; 857A A5 EB ..
lsr a ; 857C 4A J
bcs L8590 ; 857D B0 11 ..
L857F:
lda (generalCounter36),y ; 857F B1 36 .6
and #$0F ; 8581 29 0F ).
sta generalCounter38 ; 8583 85 38 .8
lda $B2,x ; 8585 B5 B2 ..
asl a ; 8587 0A .
asl a ; 8588 0A .
asl a ; 8589 0A .
asl a ; 858A 0A .
jsr L85A1 ; 858B 20 A1 85 ..
bcs L859E ; 858E B0 0E ..
L8590:
lda (generalCounter36),y ; 8590 B1 36 .6
and #$F0 ; 8592 29 F0 ).
sta generalCounter38 ; 8594 85 38 .8
lda $B2,x ; 8596 B5 B2 ..
jsr L85A1 ; 8598 20 A1 85 ..
iny ; 859B C8 .
bcc L857F ; 859C 90 E1 ..
L859E:
ldx generalCounter39 ; 859E A6 39 .9
rts ; 85A0 60 `
; ----------------------------------------------------------------------------
L85A1:
ora generalCounter38 ; 85A1 05 38 .8
sta (generalCounter36),y ; 85A3 91 36 .6
inx ; 85A5 E8 .
txa ; 85A6 8A .
and #$07 ; 85A7 29 07 ).
bne L85B0 ; 85A9 D0 05 ..
tya ; 85AB 98 .
clc ; 85AC 18 .
adc #$04 ; 85AD 69 04 i.
tay ; 85AF A8 .
L85B0:
cpx #$38 ; 85B0 E0 38 .8
rts ; 85B2 60 `
; ----------------------------------------------------------------------------
L85B3:
lda player1TetrominoCurrent,x ; 85B3 B5 64 .d
sta lastCurrentBlockP1,x ; 85B5 9D BC 01 ...
lda player1TetrominoY,x ; 85B8 B5 60 .`
sta lastTetrominoYP1,x ; 85BA 9D C0 01 ...
lda player1TetrominoX,x ; 85BD B5 62 .b
sta lastTetrominoXP1,x ; 85BF 9D C2 01 ...
lda player1TetrominoOrientation,x ; 85C2 B5 68 .h
sta lastOrientationP1,x ; 85C4 9D BE 01 ...
txa ; 85C7 8A .
asl a ; 85C8 0A .
tay ; 85C9 A8 .
lda player1RNGSeed,y ; 85CA B9 5C 00 .\.
sta lastRNGSeedP1,y ; 85CD 99 C4 01 ...
lda player1RNGSeed+1,y ; 85D0 B9 5D 00 .].
sta lastRNGSeedP1+1,y ; 85D3 99 C5 01 ...
jsr L869B ; 85D6 20 9B 86 ..
L85D9:
asl generalCounter36 ; 85D9 06 36 .6
bcc L85EB ; 85DB 90 0E ..
tya ; 85DD 98 .
pha ; 85DE 48 H
ldy generalCounter39 ; 85DF A4 39 .9
lda orientationTiles,y ; 85E1 B9 F3 86 ...
sta $B2,x ; 85E4 95 B2 ..
iny ; 85E6 C8 .
sty generalCounter39 ; 85E7 84 39 .9
pla ; 85E9 68 h
tay ; 85EA A8 .
L85EB:
inx ; 85EB E8 .
dey ; 85EC 88 .
beq L8604 ; 85ED F0 15 ..
tya ; 85EF 98 .
and #$03 ; 85F0 29 03 ).
bne L85D9 ; 85F2 D0 E5 ..
txa ; 85F4 8A .
clc ; 85F5 18 .
adc #$04 ; 85F6 69 04 i.
tax ; 85F8 AA .
cpy #$08 ; 85F9 C0 08 ..
bne L85D9 ; 85FB D0 DC ..
lda generalCounter37 ; 85FD A5 37 .7
sta generalCounter36 ; 85FF 85 36 .6
jmp L85D9 ; 8601 4C D9 85 L..
; ----------------------------------------------------------------------------
L8604:
ldx generalCounter38 ; 8604 A6 38 .8
rts ; 8606 60 `
; ----------------------------------------------------------------------------
L8607:
jsr L869B ; 8607 20 9B 86 ..
L860A:
asl generalCounter36 ; 860A 06 36 .6
bcc L8612 ; 860C 90 04 ..
lda #$00 ; 860E A9 00 ..
sta $B2,x ; 8610 95 B2 ..
L8612:
inx ; 8612 E8 .
dey ; 8613 88 .
beq L862B ; 8614 F0 15 ..
tya ; 8616 98 .
and #$03 ; 8617 29 03 ).
bne L860A ; 8619 D0 EF ..
txa ; 861B 8A .
clc ; 861C 18 .
adc #$04 ; 861D 69 04 i.
tax ; 861F AA .
cpy #$08 ; 8620 C0 08 ..
bne L860A ; 8622 D0 E6 ..
lda generalCounter37 ; 8624 A5 37 .7
sta generalCounter36 ; 8626 85 36 .6
jmp L860A ; 8628 4C 0A 86 L..
; ----------------------------------------------------------------------------
L862B:
ldx generalCounter38 ; 862B A6 38 .8
rts ; 862D 60 `
; ----------------------------------------------------------------------------
L862E:
inc player1TetrominoY,x ; 862E F6 60 .`
jsr checkCoopCollision ; 8630 20 15 8C ..
dec player1TetrominoY,x ; 8633 D6 60 .`
bcc L863C ; 8635 90 05 ..
L8637:
inc player1FallTimer,x ; 8637 F6 6A .j
inc player1FallTimer,x ; 8639 F6 6A .j