News:

11 March 2016 - Forum Rules

Main Menu

Neo Geo Pocket Color Rom Save Editor?

Started by NewSlang22, November 16, 2021, 10:16:51 PM

Previous topic - Next topic

NewSlang22

Hello!  I'm new to rom hacking and I recently acquired a flash cart for the Neo Geo Pocket Color called a "NeoPocket Game Drive". In trying to get a rom of King of Fighters R-2 with all secret characters unlocked I turned up short. I couldn't find any NGPC roms with any modifications (other than different languages) or unlocked secret characters.

In my search I actually came upon a youtube video of King of Fighters R-2 with all secret characters unlocked and the author uploaded the save information for these unlocked characters via .NGF files. Apparently these .NGF are "battery saves" which were taken from the authors NeoPop NGPC emulator battery save folder. Now, the Neo Pocket Game Drive actually puts the save information onto the rom itself, which is stored on the flash memory of the flash cart. So say for instance when you want to delete a game from the flash memory but wanted to save the game progress so that you can install it again at a later time, the flash cart would import the rom with the save progress (the save information being on the rom itself) back onto the SD card that is plugged into the cart. So basically I was wondering, is there any possible way to "inject" or "patch" a NGPC rom with save information from a .NGF file which would merge the save info on the rom itself? I apologize for the long winded post but it was kind of difficult for me to find the right words to explain it.

Jorpho

#1
Your post is more than a little unclear, yes.

Quotethe flash cart would import the rom with the save progress (the save information being on the rom itself) back onto the SD card that is plugged into the cart.
So is the "battery save" stored separately from the ROM, or not?

If this flashcart you're using somehow stores the save in the same file as the ROM, then you're going to have to figure out how to split them apart. But that seems extremely unlikely and flashcarts do not generally work that way.

To elaborate further: if you copy the "rom with the save progress" back to your PC, is it exactly the same size as your original ROM dump? If they are the same size, you can quickly establish if the files are still exactly identical by adding them to a .zip file and checking if their CRC32 values match.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

NewSlang22

#2
Quote from: Jorpho on November 17, 2021, 12:13:30 AM
Your post is more than a little unclear, yes.
So is the "battery save" stored separately from the ROM, or not?

If this flashcart you're using somehow stores the save in the same file as the ROM, then you're going to have to figure out how to split them apart. But that seems extremely unlikely and flashcarts do not generally work that way.

To elaborate further: if you copy the "rom with the save progress" back to your PC, is it exactly the same size as your original ROM dump? If they are the same size, you can quickly establish if the files are still exactly identical by adding them to a .zip file and checking if their CRC32 values match.

Thanks for the reply! I apologize, what I meant to say was that NGPC roms on this particular flashcart (NeoPocket Game Drive) store the saves directly onto the rom itself. So if you wanted remove a game from the flash memory, but keep the save progress, the flashcart would simply create a copy of the rom that is stored on the "flash memory" of the flash cart, and it would transfer that copy onto an SD card that is inserted into the flash cart itself. Here's a response directly from a representative at Retro HQ, the creator of the Neo Pocket Game Drive:
Quote
"I've had a quick look and the NGF is the battery save. Very few games actually use the SRAM battery save as this is just a temporary store used to save the state between quick game sessions (Neo Turf Masters is one which uses this during a hole). This is something the GameDrive cannot support as the SRAM is wiped if a different game is inserted (the menu in this case) than when the unit was turned off.

The persistent saves are actually stored as part of the ROM image itself, which I'm not sure if emulators try and save to a different file, or more likely just directly back to the ROM image."

So according to this person, saves are kept on the rom file itself, and not in a separate .flash or .ngf file. I was just wondering if it is at all possible to "patch" or "merge" a rom file with a .NGF file, so that the save information is directly on the rom itself.

marc_max

Quote from: Jorpho on November 17, 2021, 12:13:30 AMSo is the "battery save" stored separately from the ROM, or not?

I might be wrong but if IIRC, saves for NGP/C games are stored in a small flashable part in the ROM. That's why some months ago most of the NGPC were redumped at no-intro, as they discovered their savegames were not empty.
NGP/C emulators usually save this part in separate files.

FAST6191

Quote from: Jorpho on November 17, 2021, 12:13:30 AM
If this flashcart you're using somehow stores the save in the same file as the ROM, then you're going to have to figure out how to split them apart. But that seems extremely unlikely and flashcarts do not generally work that way.
Some of the modern GBA repros work this way, and from an electrical engineering perspective I can kind of see it rather than having to write to two chips/deal with the fun of SRAM.
No idea about the system in question though and specifics there.

That said as above you want to identify the location of the save within the ROM file -- in an ideal world it would be immediately before or after but could be stuck in the middle somewhere if there is some kind of bank arrangement.
If there is no documentation then play, save, back up the ROM, play, save, back up the ROM. Compare and hopefully it becomes apparent the general area (ROM = read only after all, anything that changed* then wants to be the save). If the save has a particular "style" (header, general look of data) you might be able to narrow it down quickly, if not then repeat the above (early save, late save, radical change within save -- sell off all inventory sort of thing) until you hone in on it.

*some floppy disc games being the major exception for older stuff.

Emulators and flash carts do occasionally make a container/header for their saves -- most of the time older consoles just let devs do their own thing and as the saves would only be expected to work with the game it came from most devs did not make nice headers and other identifying information, and the makers of the consoles expected devs to come up with their own checksums/hashes, some do go emulator/flash cart devs then making their own so they can more easily pair things to the ROM it came from when file names or whatever got messed up, or do more exotic things like save slots. Some might even compress things but that tends to be for later devices (the lazy emulator/flash cart DS save defaults to 512K rather than figure out the actual size which adds up when you are using 2 gig cards and even those are on the larger side).


Jorpho

Well, it's surprising no one has worked on this problem more over the years. But then I suppose the NGPC was never especially popular.

I found this thread from 2012:
https://forum.freeplaytech.com/archive/index.php?thread-73.html

So, it looks like the .NGF file contains not only data, but also information about where in the ROM the data is supposed to be written to.

It thus appears that the only way to proceed is to determine exactly how the .NGF file is constructed, which is probably going to mean delving into the emulator's source code. The only alternative is to manually compare chunks of the .NGF file to the data in the ROM and see if you can determine how it lines up, as discussed above.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

KingMike

I know the Famicom Disk System has the same problem, of save files being stored to the disk.

I hear (some?) 3DS games do that as well, such as the Pokemon games.
At least that would be the case with physical copies. I wonder if digital copies are different and store the save separately. I mean they'd otherwise have to re-encode the ROM every time the game was saved, wouldn't they?
"My watch says 30 chickens" Google, 2018

Jorpho

Quote from: KingMike on November 18, 2021, 01:07:02 AMI hear (some?) 3DS games do that as well, such as the Pokemon games.
At least that would be the case with physical copies. I wonder if digital copies are different and store the save separately. I mean they'd otherwise have to re-encode the ROM every time the game was saved, wouldn't they?
Not sure what you're referring to. Everything I've read suggests all digital 3DS games pretty much store their data the same way. Cartridge saves have some peculiarities, but there's generally no reason to work with a raw save dump from a 3DS cartridge – at least, so far.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!