Skip to content

Commit dc230ba

Browse files
Merge pull request #95 from HydrantDude/master
Finishing touches to crash detection
2 parents 1418035 + 014ca64 commit dc230ba

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/modes/crash.asm

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ testCrash:
286286
jsr satanSpawn
287287
jmp @allegroClear ;allegroClear is basically return, just clears the variable first.
288288
@isPal:
289+
lda palFlag
290+
beq @nextSwitch ;if NTSC, continue, no crash.
291+
jsr blackBox
292+
@allegroJump:
293+
jmp @allegroClear
289294
lda palFlag
290295
beq @nextSwitch ;if NTSC, continue, no crash.
291296
jsr blackBox
@@ -314,9 +319,15 @@ testCrash:
314319
@nextOn:
315320
lda cycleCount ;testing for limited confetti
316321
cmp #$76 ;high byte min
317-
bcc @allegroClear
322+
bcc @allegroJump
318323
bne @not76
319324
lda cycleCount+1
325+
ldx strictFlag
326+
beq @notStrict_confetti
327+
cmp #$BD
328+
bcc @allegroJump
329+
bcs @confettiA
330+
@notStrict_confetti:
320331
cmp #$C5 ;low byte min
321332
bcc @allegroClear
322333
bcs @confettiA
@@ -337,6 +348,12 @@ testCrash:
337348
bcc @allegroClear
338349
bne @levelLag
339350
lda cycleCount+1
351+
ldx strictFlag
352+
beq @notStrict_level
353+
cmp #$95
354+
bcc @allegroClear
355+
bcs @levelLag
356+
@notStrict_level:
340357
cmp #$9D;low byte min
341358
bcc @allegroClear
342359
@levelLag:
@@ -348,6 +365,12 @@ testCrash:
348365
bcc @allegroClear
349366
bne @lineLag
350367
lda cycleCount+1
368+
ldx strictFlag
369+
beq @notStrict_lines
370+
cmp #$58
371+
bcc @allegroClear
372+
bcs @lineLag
373+
@notStrict_lines:
351374
cmp #$60;low byte min
352375
bcc @allegroClear
353376
@lineLag:
@@ -359,6 +382,12 @@ testCrash:
359382
bcc @allegroClear
360383
bne @not7A
361384
lda cycleCount+1
385+
ldx strictFlag
386+
beq @notStrict_B
387+
cmp #$57
388+
bcc @allegroClear
389+
bcs @confettiB
390+
@notStrict_B:
362391
cmp #$5F ;low byte min
363392
bcc @allegroClear
364393
bcs @confettiB
@@ -379,6 +408,7 @@ testCrash:
379408
beq @noLag ;if lag should happen, wait a frame here so that sprite staging doesn't happen.
380409
lda #$00
381410
sta verticalBlankingInterval
411+
sta lagState ;clear lagstate for next
382412
@checkForNmi:
383413
lda verticalBlankingInterval ;busyloop
384414
beq @checkForNmi

0 commit comments

Comments
 (0)