Yes, that is my goal. When booting up SMB, these RAM addresses are cleared until you press start to begin a new game.Dwedit wrote: Mon Jun 09, 2025 9:11 pm Everything depends.
Are you trying to preserve the contents of a register? Preserve the carry flag? I don't know what the requirements are.
As I said, RAM address $07FC is the flag for world selection, which on startup is cleared (#$00). Under normal circumstances, if you beat World 8-4, and press B to go back to the title screen, it is then set to #$01 along with the primary hard mode flag (RAM $076A). But if you happen to do a cartridge swap (and this is a trick some players do to try to access invalid worlds from 9 to 256), without turning off the console's power you swap in some other game, and if that other game you're playing also happens to have $07FC among its RAM addresses, and you then try to reload SMB later (again leaving the console turned on), if the value stored in $07FC from that other game is #$02 or higher, then in SMB this value may cause the game to glitch.
In case you'd like to know why I keep bringing this up, here is a snippet of code from TakuikaNinja's version of the SMB1 bugfix:
Source: https://github.com/TakuikaNinja/smb1-bu ... rc/prg.asm
Code: Select all
WBootCheck:
lda TopScoreDisplay,x ; check each score digit in the top score
cmp #10 ; to see if we have a valid digit
bcs ColdBoot ; if not, give up and proceed with cold boot
dex
bpl WBootCheck
lda WarmBootValidation ; second checkpoint, check to see if
cmp #$a5 ; another location has a specific value
bne ColdBoot
lda ContinueWorld ; glitch world fix
cmp #World8+1 ; check against max world value + 1 (world 9)
bcs ColdBoot ; cold boot if greater than or equal
lda WorldSelectEnableFlag ; also check if the world select flag is <= 1
lsr
bne ColdBoot
ldy #WarmBootOffset ; if passed, load warm boot pointer
~Ben