Skip to content

Commit 7395e3a

Browse files
committed
fixed region detection
1 parent 724e0f5 commit 7395e3a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.asm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ presetIndex := $60E
217217
pausedOutOfDateRenderFlags := $60F ; 0 - statistics 1 - saveslot
218218
debugLevelEdit := $610
219219
debugNextCounter := $611
220+
regionFlag := $612
220221

221222
; ... $67F
222223
musicStagingSq1Lo:= $0680
@@ -502,6 +503,12 @@ initRamContinued:
502503
jmp @mainLoop
503504

504505
checkRegion:
506+
lda regionFlag
507+
beq @check
508+
rts
509+
@check:
510+
lda #1
511+
sta regionFlag
505512
; region detection via http://forums.nesdev.com/viewtopic.php?p=163258#p163258
506513
;;; use the power-on wait to detect video system-
507514
ldx #0
@@ -618,7 +625,6 @@ playState_playerControlsActiveTetrimino:
618625
rts
619626

620627
gameMode_legalScreen: ; boot
621-
jsr checkRegion
622628
; ABSS goes to gameTypeMenu instead of here
623629

624630
; reset cursors (seems to cause problems on misterFPGA)
@@ -674,6 +680,7 @@ gameMode_gameTypeMenu:
674680
jsr changeCHRBank0
675681
lda #$00
676682
jsr changeCHRBank1
683+
jsr checkRegion
677684
jsr waitForVBlankAndEnableNmi
678685
jsr updateAudioWaitForNmiAndResetOamStaging
679686
jsr updateAudioWaitForNmiAndEnablePpuRendering

0 commit comments

Comments
 (0)