Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restoring Saved Data from an Emulator
#7
A little bit more on this topic for anyone else that cares to delve into NGP savegame files. Some of this may be obvious or covered already, but here's a quick rundown.

The NGP uses flash memory for both the game and the savegame. On an official game, some sectors are marked as either protected or unprotected. The savegame data must go in an unprotected sector, but that doesn't mean that all of the unprotected sectors hold valid savegame info. Plus, the savegame info may be tiny, but there's no way to reserve anything smaller than a sector. Some sectors, however, are smaller than others.

When reading a cartridge, there is no good way to know what has changed from the time the cartridge was new. The only way the Linkmasta has to know what sector is savegame is to save all of the unprotected sectors.

An emulator is different, though. It can keep track (while emulating the game) of which sectors are being written to. These can be written to a file. In fact, it can even keep track at a sub-sector level. It could just save each byte that was written without any regard for sector sizes.

The NeoPop savegame format has some headers that essentially lay out where (in the cart) this data starts and how long it is. That's followed by the data. This can occur several times (like if the game saved to a few different places).

So, NeoPop (or RACE!) will save smaller chunks of data. If a game wrote to a single sector 3 times, it may save 3 small chunks of data. If the Linkmasta saved this same game, it would write 1 chunk of the entire sector (and probably other whole sectors that were also unprotected).

In the emulator, think of the savegame file as a DIFF or a PATCH. You start with the ROM file. Then, you add the savegame "diff" on top of that. This results in the game with the savegame.
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply


Messages In This Thread
Restoring Saved Data from an Emulator - by Senk - 09-03-2012, 02:36 PM
RE: Restoring Saved Data from an Emulator - by Flavor - 09-05-2012, 12:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)