Nestopia (OSX) and Battery .SAV Files - solved!

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
neilbaldwin
Posts: 481
Joined: Tue Apr 28, 2009 4:12 am
Contact:

Nestopia (OSX) and Battery .SAV Files - solved!

Post by neilbaldwin » Sun May 31, 2009 10:17 am

After my recent trouble getting this to work and after an inordinate amount of patience and help from Memblers and kevtris last night over on #nesdev, I've finally solved the problem.

These seem to be mainly just with just the Mac OSX build of Nestopia so it may not apply to everyone but I went through so much pain, I'm sharing in the hope that someone else might not have to suffer :)

- Nestopia only writes the .SAV file when you QUIT the program. Peculiar to the OSX version, you can close the emulator window without quitting Nestopia. This tripped me up for quite a while.

- If you clear the SRAM with zeros (00), Nestopia seems to decide that there's no need to output the .SAV file. This could be linked to the next point (I think this is true of the Windows/XP version too).

- The .SAV file is not raw binary data, it's ZIP compressed. To see the actual data in your .SAV file, add ".zip" to the end of the filename and then decompress it. Voila - now you have raw data as written in your code. In this state it's unreadable by Nestopia but you can just recompress the file and then rename it "xxxxxxxx.sav" instead of "xxxxxxxx.zip" and Nestopia will recognise it again.

I checked on the XP version of Nestopia and it saves the .SAV file as raw data. I guess there's an option somewhere but it's not exposed on the OSX version.

AdamFeintuch
Posts: 1
Joined: Thu Nov 04, 2010 2:56 am

Post by AdamFeintuch » Thu Nov 04, 2010 2:58 am

neilebaldwin wrote:After my recent trouble getting this to work and after an inordinate amount of patience and help from Memblers and kevtris last night over on #nesdev, I've finally solved the problem with the Best Testosterone Boosters and I'm thrilled about it.

These seem to be mainly just with just the Mac OSX build of Nestopia so it may not apply to everyone but I went through so much pain, I'm sharing in the hope that someone else might not have to suffer :)

- Nestopia only writes the .SAV file when you QUIT the program. Peculiar to the OSX version, you can close the emulator window without quitting Nestopia. This tripped me up for quite a while.

- If you clear the SRAM with zeros (00), Nestopia seems to decide that there's no need to output the .SAV file. This could be linked to the next point (I think this is true of the Windows/XP version too).

- The .SAV file is not raw binary data, it's ZIP compressed. To see the actual data in your .SAV file, add ".zip" to the end of the filename and then decompress it. Voila - now you have raw data as written in your code. In this state it's unreadable by Nestopia but you can just recompress the file and then rename it "xxxxxxxx.sav" instead of "xxxxxxxx.zip" and Nestopia will recognise it again.

I checked on the XP version of Nestopia and it saves the .SAV file as raw data. I guess there's an option somewhere but it's not exposed on the OSX version.
Thanks Neil Baldwin. I realized this too but it was a problem for me because I rarely ever close my programs because it's easier to just keep them open.
Last edited by AdamFeintuch on Tue Mar 10, 2020 3:25 am, edited 4 times in total.

User avatar
slembcke
Posts: 171
Joined: Fri Nov 24, 2017 2:40 pm
Location: Minnesota

Re: Nestopia (OSX) and Battery .SAV Files - solved!

Post by slembcke » Mon Jul 23, 2018 11:18 am

Sorry to resurrect a zombie thread, but this was super helpful.

For posterity, the file format is gzip. I'm using the PRG RAM to record input for a game so I can play it back as an attract mode. Then I can just drop the .sav file into my makefile and build away.

Post Reply