Dolphin, the GameCube and Wii emulator - Forums

Full Version: Fix a Corrupt RAW Memory Card Dump?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hello.

I have been using a RAW dump of my real, official memory card 251 to play Dolphin. I used DacoTaco's CTR-GTS to make the RAW dump and it has always (and still does) worked with Dolphin (Now 3.0) just fine. (Even the uncopyable games such as Pokemon XD and F-Zero GX play fine) After making significant progress in a couple games, I wanted to restore the dump back to the memory card so I could play on the Gamecube again. The restore corrupted the memory card. To see if I could find the problem, I looked at the memory card dump with Dolphin's memory card manager and noticed on the second page a blank entry on the that has no banner and says it is 0 blocks and starts on block -1. I assume this is the reason the memory card is reading as corrupt on the Gamecube, but I am unable to delete this entry in the memory card manager.

I was wondering if there is program or way to fix this memory card dump. I know I can export .gci files for all the copyable save files and copy them to a new card, but I really want to try everything I can do save this dump file so I don't lose my finished Pokemon XD save and 100% unlocked F-Zero GX save file.

Thanks in advance for any help.

-MD
directory entries won't corrupt the memory card, they could be set to almost anything
a corrupt memorycard is caused by invalid checksums (2 checksums are stored per header block, 5 headers blocks per memorycard)
or an invalid serial number (serial number is calculated by format time and memorycard's flash id)

if games in dolphin still recognize the memorycard, it cannot be the checksums, and either it is an invalid serial number, or the transfer to the memory card is corrupting it

can you redump the raw file after restoring it to your memory card, so that it can be compared with your original?
can you format the memorycard with the system menu and dump an empty raw file, so that the flash id can be calculated?
Thanks for the quick reply. I am having trouble getting DacoTaco's CTR-GTS to read my official memory card now. I had a little trouble the first time I backed it up and can't remember what I did to get it to work last time. (I followed the instructions on the WiiBrew page at least 10 times before it finally worked, then after that I never had a problem until now)

I can restore the card dump to an unofficial memory card and redump it, in which it looks identical to the original dump when viewed in Dolphin's memory card manager.

When I originally ran into the problem I noticed that as soon as the Wii/Gamecube game determined the official memory card was corrupt, then running DacoTaco's CTR-GTS after would give the message that the card was corrupt and would need to be formatted before backing up/restoring.

I'll keep trying to get the program to read the official card so I can get that flash ID. And try the restore/redump with the official card. (Could you tell me in the meantime how to find this value? I do not know what any of the values on the debug screen of the memory card manager mean, unfortunately.)

Thank you,
-MD
(02-06-2012, 11:41 AM)MountainDrew Wrote: [ -> ]I can restore the card dump to an unofficial memory card and redump it, in which it looks identical to the original dump when viewed in Dolphin's memory card manager.

Great way to test that everything is writing correctly (no sd card issues etc), but restoring a full memorycard dump will only work on the original card.

there are two functions in dolphin which use the flashID, either a hardcoded one (the format functions in GCMemcard http://code.google.com/p/dolphin-emu/sou...emcard.cpp,
or in the case of a raw memcard dump
SetCardFlashID in Sram.cpp (http://code.google.com/p/dolphin-emu/sou...W/Sram.cpp)
where the card flash id is obtained from the memorycard's serial number

unfortunately, I haven't had the time to put the display of the flash id in dolphin's memorycard manager, so for now, it would be necessary to run dolphin and check sram.bin at the corresponding location for the flashid, or calculating it using the method shown in the sram.cpp function
Finally got DacoTaco's CTR-GCS (Sorry, I misnamed it earlier) to read the official memory card. Unlike the unofficial card is unable to redump after restoring, the next time CTR-GCS is loaded, it notices the card as being corrupt. I formatted and dumped the blank card, but I don't quite follow what I need to do to get the flash ID. I'm not the most experienced with dolphin or coding so I apologize, but you might have to treat me like a newbie and spell everything out for me.

Thanks again for your help,

-MD
it might be easier to just upload both memorycard files

To look at the flashid yourself, use the memorycard file in dolphin and run at least one gamecube game the same region as the memory card.

Open dolphin/user/gc/sram.raw in a hex editor.

EDIT---
Sorry, decimal -> hex fail and had a card formatted by slot A "plugged into" slot B
slot A is a 20 (0x14) through 31 (0x1F)
slot b is 32 (0x20) through 43 (0x2B)


attached is an image showing the default flashid used by memorycards formatted by dolphin (DOLPHINSLOTA)
Thanks again. Yeah, I was pretty close to getting there, (figured out how to update the sram.raw) but I was unable to read the hex editor. So, while I try to compare your image to my editor, I'll upload the files.

The one with the default name is blank, and I added '(Corrupt)' to the one I had been using with Dolphin.

-MD
they have the same flashid (0x60, 0x78, 0x55, 0xb0, 0xbd, 0x98, 0x79, 0xbf, 0x9a, 0x3b, 0x6f, 0x12)
so there goes that theory ... :/

are you able to restore the blank file successfully?

maybe Daco has other ideas,
not sure if it works exactly like ctr-gcs worked for gamecube as that is how i have been successfully restoring full memorycard dumps
Thanks for taking the time to check that. Yes, the blank file restores successfully. (Just tried it)

Also, I've backed up and restored an unofficial card many times with great success. (Backed up, played on Dolphin, made progress, restored and the Gamecube would read the updated saves just fine)

-MD
the memorycard manager will not correctly work with your memorycard. when writing it, i neglected to handle fragmented files and any exported files will probably incorrect, as well as deleting will probably corrupt it. I've been meaning to fix this, but haven't found the time.
the displayed file you mention is caused by this

Have you modified the memory card using the memory card manager? this may explain the corruption noticed by the official memory card

I deleted all files from the memorycard except fzero using the wii system menu, maybe this will work?

Pages: 1 2 3 4