Welcome! Log In Create A New Profile

Advanced

Help me out with save conversion.

Posted by twinkie 
Help me out with save conversion.
July 25, 2010 06:46AM
I found a guide on how to convert Virtual Console game saves to use with homebrew emulators, but i want to do the exact opposite.
I use Snes9xgx, the snes emulator for wii.

So pretty much what i wanna do is convert a .srm save (snes save file) into data.bin (save file used in virtual console).

I was looking in the web and the only thing i could find was this.
This is what some guy said in a forum:

"I tried converting my own emulator save to get it to work on the virtual console. I got it to work. I did the same bye flip operation on my own save so that it was like the original one, then I added padding at the end so that it matched up in filesize with what the Nintendo save was originally.
Then, I named the file as it was originally in the extracted save and proceeded to pack it up using FE100. I then put it on the SD card, and copied it to the Wii.
Amazingly enough, it loaded the save just fine on the virtual console. So I can now officially say the saves are compatible, the data is just "byte flipped and padded at the end", I guess you would say."

I have absolutely no idea what hes talking about, though.
Plz help me out
Re: Help me out with save conversion.
July 25, 2010 12:59PM
He's talking about getting an emulator save working with virtual console...

Flip thing he's talking about is changing endianness of data... Possibly Ninty's vc emulator uses big endian but homebrew emulator is using little endian...

You need to do the opposite
1. Extract game save using SaveGame Manager Blah Blah (There are numerous apps for this job)
2. Flip and trim the savefile (trimming is the opposite of padding, I don't know the details so ask that guy you quoted)
3. Use it with the homebrew emulator. Profit!

ps: Don't ask me the details as I don't know, I'm sure someone will respond to you in noob-friendly manner.
Re: Help me out with save conversion.
July 25, 2010 01:19PM
Quote
I.R.on
He's talking about getting an emulator save working with virtual console...

Flip thing he's talking about is changing endianness of data... Possibly Ninty's vc emulator uses big endian but homebrew emulator is using little endian...

You need to do the opposite
1. Extract game save using SaveGame Manager Blah Blah (There are numerous apps for this job)
2. Flip and trim the savefile (trimming is the opposite of padding, I don't know the details so ask that guy you quoted)
3. Use it with the homebrew emulator. Profit!

ps: Don't ask me the details as I don't know, I'm sure someone will respond to you in noob-friendly manner.

the OP wanted to go from homebrew emulator to vc, not the other way round.

As for getting this to work: Create a save in the VC version of the game, and dump it with SaveGame Manager. Then "flip" (no idea how to do this step, maybe a feature of hex editors?) your homebrew emulator save. Then open both saves in a hex editor, and add 0x00 bytes to the end of the homebrew emulator save until it is the exact same size as the vc one. Then replace the data.bin of the vc one with the (renamed) homebrew emulator save (leaving the other files from SGM intact) and then use SaveGame Manager again to install it.
Re: Help me out with save conversion.
July 25, 2010 04:00PM
Quote
SifJar

the OP wanted to go from homebrew emulator to vc, not the other way round.

As for getting this to work: Create a save in the VC version of the game, and dump it with SaveGame Manager. Then "flip" (no idea how to do this step, maybe a feature of hex editors?) your homebrew emulator save. Then open both saves in a hex editor, and add 0x00 bytes to the end of the homebrew emulator save until it is the exact same size as the vc one. Then replace the data.bin of the vc one with the (renamed) homebrew emulator save (leaving the other files from SGM intact) and then use SaveGame Manager again to install it.

Well I was misguided by the @OP's first statement which is wrong :)

Quote
twinkie
I found a guide on how to convert Virtual Console game saves to use with homebrew emulators, but i want to do the exact opposite.

The rough guide he posted already explains what he's trying to accomplish...

About the flipping thing, first you should make sure of the unit (word length) you are dealing with...

For 2 bytes,
say you want to represent a hexadecimal number AABB in memory, you lay it out

for Big Endian : AA BB
for Little Endian : BB AA

For 4 bytes,
say you want to represent a hexadecimal number AABBCCDD in memory, you lay it out

for Big Endian : AA BB CC DD
for Little Endian (2 bytes atomic size) : CC DD AA BB
for Little Endian (1 byte atomic size) : DD CC BB AA

Say if VC emulator stores the data as 2 bytes Little Endian (BB AA), and VC emulator stores them 2 bytes Big Endian then you just need to flip each two bytes...

BB AA -> AA BB and so on...

ps: Certain hex editors may support this (hex shop mentioned somewhere), possibly there are other simple tools to make the conversion too... The best is just code a simple app to automate the whole task... It's not in my interests but it's fairly easy to do, I may add support for this in upcoming FE100 releases though.
Re: Help me out with save conversion.
July 25, 2010 05:09PM
thanks ill try that out.
i'll post my results here.
Re: Help me out with save conversion.
July 25, 2010 05:18PM
Quote
I.R.on

As for getting this to work: Create a save in the VC version of the game, and dump it with SaveGame Manager. Then "flip" (no idea how to do this step, maybe a feature of hex editors?) your homebrew emulator save. Then open both saves in a hex editor, and add 0x00 bytes to the end of the homebrew emulator save until it is the exact same size as the vc one. Then replace the data.bin of the vc one with the (renamed) homebrew emulator save (leaving the other files from SGM intact) and then use SaveGame Manager again to install it.

Can you please explain this with more details, i happen to know quite a bit about wii homebrew, but im an absolute noob when it comes to hex editing, so i have no idea what the heck you mean with "add 0X00 bytes"



Edited 1 time(s). Last edit at 07/25/2010 05:19PM by twinkie.
Re: Help me out with save conversion.
July 25, 2010 08:56PM
Basically, add a load of bytes to the end, each containing (in hex, which is represented by the 0x) 00. If you have ever opened a file in a hex editor, you will have seen that there are many "pairs of numbers (and some letters)". These are "bytes" and are in hex. Simply add a lot of 00 bytes to the end of the file.
Re: Help me out with save conversion.
July 25, 2010 09:13PM
To do that simply,

1. Extract your vc save using savegame tools, I don't have preference over any so can't give you a name...
2. Open vc save using hex workshop
3. Open your Snes blah blah emulator's save in that hex workshop too, flip each two bytes... (it's said that there is such a function in hex workshop)
4. Select whole data in homebrew emulator's save you flipped... then just paste this into the vc save of yours. (remember you opened in hex workshop in step 2)
5. Save the vc save, replace it with the original you extracted from your wii...
6. Use a savegame tool to copy the whole save back to your wii...

ps: I haven't tried this, just following the quoted procedure you posted... Btw, I believe there is such guide at least for N64 saves here in wiibrew forums too... Hmm, found it, it explains the reverse process but there is no mentioning of padding or trimming the savefile... Here



Edited 1 time(s). Last edit at 07/25/2010 09:17PM by I.R.on.
Re: Help me out with save conversion.
July 26, 2010 06:10PM
Quote
I.R.on
To do that simply,

1. Extract your vc save using savegame tools, I don't have preference over any so can't give you a name...
2. Open vc save using hex workshop
3. Open your Snes blah blah emulator's save in that hex workshop too, flip each two bytes... (it's said that there is such a function in hex workshop)
4. Select whole data in homebrew emulator's save you flipped... then just paste this into the vc save of yours. (remember you opened in hex workshop in step 2)
5. Save the vc save, replace it with the original you extracted from your wii...
6. Use a savegame tool to copy the whole save back to your wii...

ps: I haven't tried this, just following the quoted procedure you posted... Btw, I believe there is such guide at least for N64 saves here in wiibrew forums too... Hmm, found it, it explains the reverse process but there is no mentioning of padding or trimming the savefile... Here

ok, thanks
Sorry, only registered users may post in this forum.

Click here to login