@@ -466,7 +466,7 @@ testCrash:
466
466
sta cycleCount
467
467
lda #$6F
468
468
sta cycleCount+1 ;low byte at +1
469
-
469
+
470
470
lda completedLines ; checking if lines cleared
471
471
beq @linesNotCleared
472
472
ldx #$04 ;setting loop to run 4x
@@ -653,19 +653,19 @@ testCrash:
653
653
adc allegroIndex
654
654
sta allegroIndex
655
655
@palCycles:
656
- lda palFlag ; if pal, move thresholds for crashes 3467 cycles away
657
- beq @randomFactors
658
- sec
659
- lda cycleCount+1
660
- sbc #$8B
661
- sta cycleCount+1
662
- lda cycleCount
663
- sbc #$0D
664
- sta cycleCount
665
- clc
656
+ lda palFlag ; if pal, move thresholds for crashes 3467 cycles away
657
+ beq @randomFactors
658
+ sec
659
+ lda cycleCount+1
660
+ sbc #$8B
661
+ sta cycleCount+1
662
+ lda cycleCount
663
+ sbc #$0D
664
+ sta cycleCount
665
+ clc
666
666
@randomFactors:
667
- lda strictFlag
668
- bne @noDMA ;for strict crash, do not add random cycles.
667
+ lda strictFlag
668
+ bne @noDMA ;for strict crash, do not add random cycles.
669
669
lda oneThirdPRNG ; RNG for which cycle of the last instruction the game returns to
670
670
adc allegroIndex
671
671
sta allegroIndex
@@ -710,13 +710,13 @@ testCrash:
710
710
;confettiB = 30765-31193
711
711
cmp #$74 ;high byte of cycle count is already loaded
712
712
bne @nextSwitch
713
- lda strictFlag
714
- beq @normalChecks ;special conditions for "strict" mode. crash on 7423-7442, check red on 7443-7448.
715
- lda cycleCount+1
716
- cmp #$23 ;up to 8 cycles could have been added, but weren't, so our low bound is 8 below the typical.
717
- bcc @nextSwitch ;if too low, exit
718
- bcs @highBoundary ;otherwise, check high bound and skip check for gap.
719
- @normalChecks:
713
+ lda strictFlag
714
+ beq @normalChecks ;special conditions for "strict" mode. crash on 7423-7442, check red on 7443-7448.
715
+ lda cycleCount+1
716
+ cmp #$23 ;up to 8 cycles could have been added, but weren't, so our low bound is 8 below the typical.
717
+ bcc @nextSwitch ;if too low, exit
718
+ bcs @highBoundary ;otherwise, check high bound and skip check for gap.
719
+ @normalChecks:
720
720
lda cycleCount+1
721
721
cmp #$2B ; minimum crash
722
722
bcc @nextSwitch
@@ -733,11 +733,11 @@ testCrash:
733
733
bcs @nextSwitch ;between 7436 & 7448
734
734
cmp #$43
735
735
bcc @notRed ;checking if crash is during first crashable instruction
736
- txa
737
- lsr ;all odd switches on PAL result in no crash.
738
- bcs @oddSwitch
739
- lda palFlag
740
- bne @nextSwitch ;if PAL, no crash.
736
+ txa
737
+ lsr ;all odd switches on PAL result in no crash.
738
+ bcs @oddSwitch
739
+ lda palFlag
740
+ bne @nextSwitch ;if PAL, no crash.
741
741
@oddSwitch:
742
742
cpx #$07 ; checking which switch routine is active.
743
743
beq @isPal ;checks version if sw2
@@ -749,10 +749,10 @@ testCrash:
749
749
jsr satanSpawn
750
750
jmp @allegroClear ;allegroClear is basically return, just clears the variable first.
751
751
@isPal:
752
- lda palFlag
753
- beq @nextSwitch ;if NTSC, continue, no crash.
754
- jsr blackBox
755
- jmp @allegroClear
752
+ lda palFlag
753
+ beq @nextSwitch ;if NTSC, continue, no crash.
754
+ jsr blackBox
755
+ jmp @allegroClear
756
756
@notRed:
757
757
lda #$F0
758
758
sta crashState
@@ -899,8 +899,8 @@ confettiHandler:
899
899
beq @checkForNmi
900
900
jmp confettiHandler
901
901
@infiniteConfetti:
902
- lda palFlag
903
- bne @endConfetti ;infinite confetti does not exist on PAL
902
+ lda palFlag
903
+ bne @endConfetti ;infinite confetti does not exist on PAL
904
904
lda heldButtons_player1
905
905
adc #$80 ; loading 80 as Y coordinate of confetti text if nothing is held.
906
906
cmp #$80
@@ -911,18 +911,18 @@ confettiHandler:
911
911
rts
912
912
satanSpawn: ; copied from routine vanilla game's memset_ppu_page_and_more which is no longer present in gym
913
913
lda palFlag
914
- beq @ntsc
915
- lda #$00
914
+ beq @ntsc
915
+ lda #$00
916
916
sta verticalBlankingInterval
917
917
@checkForNmi:
918
918
lda verticalBlankingInterval ;busyloop
919
- beq @checkForNmi
920
- ldx #$FF
921
- ldy #$00
922
-
919
+ beq @checkForNmi
920
+ ldx #$FF
921
+ ldy #$00
922
+
923
923
@ntsc:
924
- lda #$AA
925
- sta tmp1
924
+ lda #$AA
925
+ sta tmp1
926
926
stx tmp2
927
927
sty tmp3
928
928
lda PPUSTATUS
@@ -996,4 +996,4 @@ patchData:
996
996
.byte $FF ,$FF ,$FF ,$FE ,$23 ,$34 ,$FF ,$FF
997
997
.byte $FF ,$FF ,$FF ,$FF ,$FF ,$FF ,$FE ,$22
998
998
.byte $CA ,$46 ,$47 ,$FE ,$22 ,$EA ,$56 ,$57
999
- .byte $FD
999
+ .byte $FD
0 commit comments