Skip to content

Commit 2d211e0

Browse files
committed
Added "red" crash behavior, with graphics corruption on switch 6 and no crash on switch 2.
1 parent 7fe0610 commit 2d211e0

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

src/playstate/updatestats.asm

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,9 @@ testCrash:
691691
lda cycleCount
692692
adc #$00
693693
sta cycleCount
694-
;crash should occur on cycle count results 29739-29744, 29750-29768 = $742B-7430, $7436-7448
694+
;crash should occur on cycle count results 29739-29744, 29750-29768 = $742B-7430, $7436-7448 | red crash on 7448 7447 7446 7445 7444 7443
695+
;x8 sw1 | x7 sw2 | x6 sw3 | x5 sw4 | x4 sw5 | x3 sw6 | x2 sw7 | x1 sw8
696+
;switch routine is reversed.
695697
;confettiA should occur on cycle count when switch1 = 29768+75 = 29843-30192
696698
;level lag is +195 from line lag
697699
;level lag to RTS is +70 rts +6 jsr +6 +41 to beginning of confettiA = 123 = 30315+ line lag
@@ -712,6 +714,18 @@ testCrash:
712714
bcc @nextSwitch
713715
cmp #$49
714716
bcs @nextSwitch
717+
cmp #$43
718+
bcc @notRed
719+
cpx #$07
720+
beq @nextSwitch
721+
cpx #$03
722+
bne @notRed
723+
ldx #$FF
724+
ldy #$00
725+
lda #$81
726+
jsr satanSpawn
727+
jmp @allegroClear
728+
@notRed:
715729
lda #$F0
716730
sta crashFlag
717731
jmp @crashGraphics
@@ -864,4 +878,42 @@ confettiHandler:
864878
@endConfetti:
865879
lda #$00
866880
sta allegroIndex
867-
rts
881+
rts
882+
satanSpawn:
883+
sta tmp1
884+
stx tmp2
885+
sty tmp3
886+
lda PPUSTATUS
887+
lda currentPpuCtrl
888+
and #$FB
889+
sta PPUCTRL
890+
sta currentPpuCtrl
891+
lda tmp1
892+
sta PPUADDR
893+
ldy #$00
894+
sty PPUADDR
895+
ldx #$04
896+
cmp #$20
897+
bcs LAC40
898+
ldx tmp3
899+
LAC40: ldy #$00
900+
lda tmp2
901+
LAC44: sta PPUDATA
902+
dey
903+
bne LAC44
904+
dex
905+
bne LAC44
906+
ldy tmp3
907+
lda tmp1
908+
cmp #$20
909+
bcc LAC67
910+
adc #$02
911+
sta PPUADDR
912+
lda #$C0
913+
sta PPUADDR
914+
ldx #$40
915+
LAC61: sty PPUDATA
916+
dex
917+
bne LAC61
918+
LAC67: ldx tmp2
919+
rts

0 commit comments

Comments
 (0)