Powerpak Savegames

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

Fab
Posts: 27
Joined: Fri Oct 23, 2009 1:36 pm

Powerpak Savegames

Post by Fab »

I know I can save games by holding the reset button for 3 secs and then save it to the ram by selecting a empty save game.

But where does it save it? On the .sav file or on the flashcard itself ?

How does the Game load the savefile? Can you have multiple save files ? Do you have to choose everytime a new empty file?
User avatar
Xious
Posts: 189
Joined: Sun Oct 11, 2009 5:21 am
Location: Sol 3 in Mutter's Spiral
Contact:

Re: Powerpak Savegames

Post by Xious »

Fab wrote:I know I can save games by holding the reset button for 3 secs and then save it to the ram by selecting a empty save game.
To start off, as far as I know, the .sav files used by the PowerPak are the same format as those used by most emulators, and thus if you have a game image with a .sav file already, you should be able to load it. I'll have to test this out to be sure, but I believe it will work.

You want blank .sav files when you want to play games from scratch.
Fab wrote:But where does it save it? On the .sav file or on the flashcard itself ?
Well, it does both actually; this should also help to partially answer your next question:

When the PowerPak loads the .sav file, the FPGA logic that is emulating a real cartridge treats it like the battery-backed RAM on that game cartridge. When you select the .sav file in advance, the PowerPak loads the contents of that .sav file into the memory allocated for saved game data (the BBR address range).

While you play a BBR (battery-backed RAM) game, say "Dragon Warrior", every time you save the game, the state of the BBR address range is changed in the PowerPak's memory, much as it would be on a real cartridge. Unfortunately, the memory on the PowerPak is not really BBR, so if you turn off the console, you'd normally lose it.

Thus, the PowerPak gets around this in a tricky way: When you hold the reset button for a specific duration of time, the logic of the PowerPak (which has not yet lost power) realizes on reset that it still has data in its BBR address range and prompts you to save or not: "Save to CF Card /Yes/No/".

If you do not choose a .sav file for such games when you load them, the PowerPak still realizes that they are BBR games and will prompt upon exit to save the game data to a .sav file. This is important to note, as some games will use BBR for off reasons and it's a good bet that games that you normally wouldn't expect, will in fact ask for it on exit. Keep some extra blank .sav files on your CF card for these oddities.

When you select 'Yes' and choose a .sav file, the PowerPak writes the BBR data to that .sav file on your CF card. Of course, the .sav file is on your CF card, which is why my answer is 'both'. All of your saved game data is recorded to the .sav file, so you can back it up, copy it, modify it, etc., as you wish.
Fab wrote:How does the Game load the savefile? Can you have multiple save files ? Do you have to choose everytime a new empty file?
You can have as many .sav files for each game as you wish. You can even load from one .sav file and save to another. You can reuse a .sav file as often as you wish and I suggest storing them in directories for each game or game type, with each .sav file named to match its parent game, as not to confuse them all.

I further suggest not crossing .sav files between incompatible games (such as LoZ and Final Fantasy) as this will have bizarre effects on loading, although because of that, it can of course, be fun to try.

Does this help to answer your questions?

-Xious
Fab
Posts: 27
Joined: Fri Oct 23, 2009 1:36 pm

Post by Fab »

Hey thanks for that detailed anwser.

I got it now. It's like an emulator you can save .sav files anywhere and load it manually at a start of a game.

But for saving I have to hold the reset button every time 3 seconds.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Has someone already made a program that walks the directory tree and makes 8 KiB .sav files for any iNES ROM with the battery bit turned on? If not, should I?
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

It might not be a bad idea for those that can't or don't want to do it manually.
joe1088
Posts: 22
Joined: Tue Mar 10, 2009 1:44 am
Location: Virginia Beach, VA
Contact:

Post by joe1088 »

That would be a big help. Currently I just have the save files unnamed.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

joe1088
Posts: 22
Joined: Tue Mar 10, 2009 1:44 am
Location: Virginia Beach, VA
Contact:

Post by joe1088 »

Thanks! It works (and now I know how to run a python file hehe).
danntor
Posts: 44
Joined: Sun Dec 27, 2009 2:38 am
Location: Western Australia

Post by danntor »

The script ran on Windows XP(Pthyon Version 2.6.4) and created .savs. I tried it on Debian Testing but the version of Python Debian Testing installs by default was too old (2.5.4).
drk421
Posts: 329
Joined: Sun Nov 14, 2004 11:24 am
Contact:

Post by drk421 »

Yay Python,
My favorite language.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

danntor wrote:The script ran on Windows XP(Pthyon Version 2.6.4) and created .savs. I tried it on Debian Testing but the version of Python Debian Testing installs by default was too old (2.5.4).
You saw the error because I left out 'from __future__ import with_statement', which enables context managers. Python 2.4 doesn't support them at all, 2.5 enables them only when imported, and 2.6 always enables context managers. I left this out on purpose because I wanted to make it compatible with 2.4, which is what some Pocket Heaven regulars appeared to still use the last time I posted a Python program. But I have trouble writing for 2.4; I keep slipping 2.5-isms like context managers into my code. It should be fixed now; thanks for pointing it out.
danntor
Posts: 44
Joined: Sun Dec 27, 2009 2:38 am
Location: Western Australia

Post by danntor »

Works now. Thanks for the update.
User avatar
Xious
Posts: 189
Joined: Sun Oct 11, 2009 5:21 am
Location: Sol 3 in Mutter's Spiral
Contact:

Post by Xious »

I'm not very hip on Python—meaning I don’t know how it functions on cross-platform architectures—and I’d like to use this on my systems (Mac-PPC). Is it like REBOL in that either it works within its own environment, or as a compiled REBOL app for systems with REBOL interpreters installed, or is it only a shell scripting language?

Do you, or does anybody here, have any experience with using Python on Mac OSX (PPC releases 10.2.x, 10.3.x & 10.4.x)?

Should I just drop this in a shell and see if it executes, or will it need tweaking to work properly?

Ideally, I'd like to compile this script into a Mac app, but I'm not sure if that is as easy as it sounds or if it'd require lots of work, it it's possible at all.

-Xious
drk421 wrote:Yay Python,
My favorite language.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Xious wrote:I'm not very hip on Python—meaning I don’t know how it functions on cross-platform architectures—and I’d like to use this on my systems (Mac-PPC). Is it like REBOL in that either it works within its own environment, or as a compiled REBOL app for systems with REBOL interpreters installed, or is it only a shell scripting language?
I'm not familiar with REBOL.

Yes, users need to have the Python player installed, but that's one EXE on Windows. On Linux, it's a yum or apt-get away if it's not preinstalled (as it usually is on modern distros). Apps are ordinarily distributed and executed as source code (.py), which Python automatically compiles into bytecode (.pyc) as needed. You can distribute your apps as .pyc, but it's strongly discouraged.
Should I just drop this in a shell and see if it executes, or will it need tweaking to work properly?
Once you have the Python player installed, you run a Python script on *n?x systems in much the same way that you run a shell script:
  • Make a plain text file called make_sram.py in the folder containing ROMs.
  • Paste the text.
  • chmod +x make_sram.py
  • ./make_sram.py
In order for the kernel to detect that this is a Python program, the #!/usr/bin/env python will need to be the first line.
gilgamesh21
Posts: 6
Joined: Sat Dec 26, 2009 4:49 pm

Some games not saving

Post by gilgamesh21 »

I have some trouble saving on some games on my powerpak. I can't seem to be able to save on earthbound zero and final fantasy 3. Well, i can save on the .sav file but when i load it, i get nothing, just like if i never saved.... please help!
Post Reply