Currently, I'm about to finish one of my NES projects and it seems like save game data gets sometimes corrupted when using it on a flashcart according to my gametesters (See pictures on how it looks like and how it's supposed to look like). The save game data that's causing problems is the player name and the arrow positions which are supposed to be kept if the game is turned off. To quote one of my gametesters - "I am seeing another possible issue though. This has happened twice to me now. Not sure if it is the powerpak or not, but I will run the game for hours upon hours at a time and have no problems. I will turn off the game for a day or so, and then when I turn it back on the screen where you make your name, choose the music, and that good stuff trips out. The letter options for the name are shapes, symbols, and what looks like heiroglyphics. The arrows where you choose the music, see high score and stuff, are above the options, and can go all the way to the left and right side of the screen.
you can continue off that screen, but the name you chose are the same shapes and symbols.
I can remove the file from my powerpak and put the one you gave me back on, and it works fine again until you turn it off for awhile, and then it does it again".
Also, when I play my game on NEStopia for mac, the baterry backed WRAM works flawlessly, however, it doesn't on FCEUX for Windows (Using Parallels Desktop), at least when you close the emulator. The game data just resets...
How it's supposed to look like
How it looks like on a PowerPak
Here's some of my code. It's from an outdated version of my game but it is essentially the same in later versions (Don't have my src with me, sorry)
This is the WRAM reset routine. the wramcheck variable is only supposed to go back to zero when you do a specific task.
Don't know if you need more code. I'm sorry but I don't have my SRC with me since I'm on a vacation
you can continue off that screen, but the name you chose are the same shapes and symbols.
I can remove the file from my powerpak and put the one you gave me back on, and it works fine again until you turn it off for awhile, and then it does it again".
Also, when I play my game on NEStopia for mac, the baterry backed WRAM works flawlessly, however, it doesn't on FCEUX for Windows (Using Parallels Desktop), at least when you close the emulator. The game data just resets...
How it's supposed to look like
How it looks like on a PowerPak
Here's some of my code. It's from an outdated version of my game but it is essentially the same in later versions (Don't have my src with me, sorry)
Code:
LDA wramcheck
BNE NoReset
LDX #$00
Reset_VRAM: ;Resets VRAM if needed
LDA #$00 ;Puts zeros on all VRAM vatiables in the $6000 range
STA $6000,x
INX
CPX #$00
BNE Reset_VRAM
LDA #$7F
STA playername
STA playername+1
STA playername+2
STA playername+3
STA playername+4
STA playername+5
STA playername+6
STA playername+7
LDA #$8F
STA music
LDA #$D5
STA scores
LDA #$11
STA ok
INC wramcheck
NoReset:
BNE NoReset
LDX #$00
Reset_VRAM: ;Resets VRAM if needed
LDA #$00 ;Puts zeros on all VRAM vatiables in the $6000 range
STA $6000,x
INX
CPX #$00
BNE Reset_VRAM
LDA #$7F
STA playername
STA playername+1
STA playername+2
STA playername+3
STA playername+4
STA playername+5
STA playername+6
STA playername+7
LDA #$8F
STA music
LDA #$D5
STA scores
LDA #$11
STA ok
INC wramcheck
NoReset:
This is the WRAM reset routine. the wramcheck variable is only supposed to go back to zero when you do a specific task.
Don't know if you need more code. I'm sorry but I don't have my SRC with me since I'm on a vacation