@@ -469,7 +469,7 @@ testCrash:
469
469
cmp #$0B
470
470
lda #$00
471
471
bcc @sub11
472
- lda #$02 ;97 cycles if row is above 11
472
+ lda #$02 ;97 cycles if row is below 11; higher numbers are lower on the board
473
473
clc
474
474
@sub11: adc #$5F ;95 cycles
475
475
adc cycleCount+1
@@ -483,8 +483,7 @@ testCrash:
483
483
484
484
@linesNotCleared:
485
485
lda displayNextPiece
486
- and #BUTTON_SELECT
487
- beq @nextOff
486
+ bne @nextOff
488
487
lda #$8A ; add 394 cycles for nextbox
489
488
adc cycleCount+1
490
489
sta cycleCount+1
@@ -497,8 +496,8 @@ testCrash:
497
496
bne @allegro
498
497
lda #$95 ; 149 in decimal.
499
498
clc
500
- ldx wasAllegro ; FF is no allegro. 00 is allegro.
501
- bne @addMusicCycles
499
+ ldx wasAllegro ; FF is allegro. 00 is no allegro.
500
+ beq @addMusicCycles
502
501
adc #$26 ;add 38 cycles for disabling allegro
503
502
@addMusicCycles:
504
503
adc cycleCount+1
@@ -525,7 +524,7 @@ testCrash:
525
524
adc #$00 ; add carry again
526
525
sta cycleCount
527
526
lda wasAllegro
528
- beq @linesCycles ; 00 is allegro
527
+ bne @linesCycles ; FF is allegro
529
528
lda #$29 ; add 41 cycles for changing to allegro
530
529
adc cycleCount+1
531
530
sta cycleCount+1
@@ -591,17 +590,17 @@ testCrash:
591
590
lda completedLines
592
591
cmp #$01
593
592
bne @notsingle
594
- lda #$52 ; 53 for singles, carry is set
593
+ lda #$34 ; 53 for singles, carry is set
595
594
adc allegroIndex
596
595
sta allegroIndex
597
596
@notsingle:
598
597
bcc @scoreCycles
599
- lda #$41 ; 42 for clears over a single, carry is set
598
+ lda #$29 ; 42 for clears over a single, carry is set
600
599
adc allegroIndex
601
600
sta allegroIndex
602
601
@scoreCycles:
603
602
ldx completedLines
604
- beq @not0
603
+ bne @not0
605
604
inc cycleCount ; no cleared lines is +737, adding 256 twice and rest is covered by sumTable
606
605
inc cycleCount
607
606
@not0: lda sumTable, x ; constant amount of cycles added for each line clear
@@ -663,7 +662,7 @@ testCrash:
663
662
inc allegroIndex
664
663
@newBit0:
665
664
lda nmiReturnAddr
666
- cmp <updateAudioWaitForNmiAndResetOamStaging+10
665
+ cmp # <updateAudioWaitForNmiAndResetOamStaging+10
667
666
beq @returnLate ; RNG for which instruction returned to
668
667
lda #$03
669
668
clc
@@ -676,34 +675,35 @@ testCrash:
676
675
inc allegroIndex
677
676
@noDMA:
678
677
ldx #$08
679
- @loop: lda cycleCount ; adding stockpiled
678
+ @loop: lda cycleCount+ 1 ; adding stockpiled
680
679
clc
681
680
adc allegroIndex
682
681
sta cycleCount+1
683
682
lda cycleCount
684
683
adc #$00
685
684
sta cycleCount
686
- ;crash should occur on cycle count results 29734- 29739, 29745-29763 = $7426- 742B, $7431-7443
685
+ ;crash should occur on cycle count results 29739-29744, 29750-29768 = $742B-7430 , $7436-7448
687
686
cmp #$74 ;high byte of cycle count is already loaded
688
687
bne @nextSwitch
689
688
lda cycleCount+1
690
- cmp #$26 ; minimum crash
689
+ cmp #$2B ; minimum crash
691
690
bcc @nextSwitch
692
- cmp #$2C ; gap
691
+ cmp #$31 ; gap
693
692
bcs @continue
694
- lda #$FF
693
+ lda #$F0
695
694
sta crashFlag
696
695
bne @allegroClear
697
696
@continue:
698
- cmp #$31
697
+ cmp #$36
699
698
bcc @nextSwitch
700
- cmp #$44
699
+ cmp #$49
701
700
bcs @nextSwitch
702
- lda $FF
701
+ lda # $F0
703
702
sta crashFlag
703
+ bne @allegroClear
704
704
705
705
@nextSwitch:
706
- lda switchTable-1 ,x ; adding cycles to advance to next switch routine
706
+ lda switchTable-2 ,x ; adding cycles to advance to next switch routine
707
707
sta allegroIndex
708
708
dex
709
709
bne @loop
0 commit comments