View Full Version: Memory Card Blues

fuzziqer >>GameCube Action Replay Simulator and Control Simulator >>Memory Card Blues


<< Prev | Next >>

Bomb Bloke- 03-10-2006
Memory Card Blues
Please excuse this large essay of a first post. About a month ago, I sat down in front of my 'Cube and started playing. Suddenly, I got an error message - This Memory Card Needs Formatting. Well, this being my 128mb card (with my entire save game collection built up over three years on it), I had no intention of doing that, I simply rebooted the console. In most cases, this would have fixed the problem, but in this one the card still wouldn't read. Having already picked up PSO and a broadband adaptor, I hit the web in search of a memory card importer/exporter and found this site. Gcars loaded up easily enough, and I used it to first rip a 56 block card, a few save files, and then my "corrupted" card. Surprisingly the upload continued well past the 128mbyte mark, at 160mb I got suspicious and killed the program. After comparing the save game extracts to the full card image they were taken from, I wrote a small piece of code to extract similar "save slots" from the corrupted card, and Gcars let me put these onto another of my smaller cards. Although the saves listed up in the memory card manager, games refused to load them, saying they were corrupt. A closer look at the banners showed strange stripes in the images, another go with the hex editer revealed blocks of "empty" bytes in the extracted data at steady intevals. I ripped the card again, this time waiting until the program was finished. The resulting image was 180mbytes, but this time the image was wrecked - it was all just garbage data. I did another rip to be sure (it came out the same), and then a few more "partial" rips. Only the complete ones were totally garbled, but all the other ones still had the "null" blocks. At that point I looked up some technical docs, and read up on the format of the cards. About now I realised that my card was 128mbits, not bytes, and found that Gcars was in fact repeating the same data over and over again into the file. I then ran an extract for 16mbytes of data, but it still had the "null" blocks. Each of these "null" blocks contained a single byte that incremented in value with each block. The first one would be x00, then x01, and so forth. The counter didn't reset when Gcars started repeating the actual card data, it just kept going up. Eventually the entire block was filled up with the incrementing values, replacing the 0 value bytes. Each of the semi-readible exports I did had an extra 124 bytes of data (all set to x00) prefixed to the start of them, which I had to skip over before reading the actual card data. In addition, the card header was written another 38 bytes (again 0's) past where I would have expected it to be (shortening the distance between itself and the directory structure of the card). I guess this is why the program was unable to work out how big the card really was. The first "null block" appeared at offset x230, and was 112 bytes. Eventually the blocks fell to a size of 76 bytes. The "counter" byte I mentioned before was always the second byte of each block, and didn't always increment, but would sometimes seem to change randomly. The distance between the start of each null block was an exact 512 bytes, and this remained constant throughout each export I did. Anyway, here's what I'm wondering - Could any of you guys try ripping a card the same size as mine (2043 blocks), and see if the same "holes" appear in the data? If so, that would indicate that Gcars simply isn't reading the card correctly, as if 1/5 of the data really IS missing then I'll never be able to restore it! With any luck, some of what I've listed here might help with adding large card support to Gcars, but mostly I just want my saves back!

fuzziqersoftware- 03-10-2006
Re: Memory Card Blues
That is quite odd..... I'm surprised it read your card at all, to tell the truth. GCARS doesn't work properly on large (>251 blocks) cards or third-party cards. It's a good thing you didn't try to write anything to it, because your card would probably have been corrupted completely (reformattable, of course, but your save data would be gone). If you have an official Nintendo memory card, try that; I've verified that GCARS works 99.999% of the time with Nintendo memory cards, as long as they're unlocked first. I still have a lot of work to do on the memory card manager, and it looks like there are some bugs in Levine as well. I don't have a 2043 block card, but I do have a 1019, so if I can get it to work, a 2043 should work as well. I'll have a go at it this weekend.

Bomb Bloke- 03-10-2006

The program simply called the card an "unrecognised device", so I couldn't write to it even if I did want to risk it. About the only thing it would let me do is copy the card image to my computer. Probably caused a ton of overflow errors (as it didn't know the size of the card) but it more or less worked. I found that, immediately after entering the memory card manager, if I pressed the A button I'd get a hex listing of the card. This didn't match either of the listings I pulled to my computer though. It read and wrote to my other cards perfectly (except when trying to save Gcars settings). I'm not sure I understand what you mean by an "unlocked" memory card, however, though I have seen the term used around the forum once or twice.

fuzziqersoftware- 03-10-2006

Hmmm...... if you put GCARS in debug mode (press L+R+X I think on the title screen), it'll show the device IDs as well as the device names. It doesn't recognize large cards because most have nonstandard device IDs. It'd be interesting to know what the device ID is; I thought I made it recognize all types of cards. The term "unlocked" only refers to official Nintendo memory cards, which must be inserted when the system boots or they won't work with GCARS (or an AR for that matter - ever noticed that an AR crashes if you put a Nintendo card in slot B when it's running?)

Bomb Bloke- 03-11-2006

Couldn't seem to get debug mode going, I also tried the L+X+Y combo but that didn't seem to work either. When it asks which memory card to use for saving data, it lists a hex number by each card plugged in, regardless as to whether I hold down button combos or not. The 59 block card gives x00000004 (I assume this stands for a 4mbits), the 2043 block card gives x00000580 (I assume the x80 (d128) stands for 128mbit, not sure about the extra 5...).

fuzziqersoftware- 03-11-2006

The last byte of the card ID is the size in mbits, but I don't know what the 5 is. I assume it's an identifier that signifies that it's a 3rd-party card...... I'll have to do some more -*test*-('")ing with my 1019 card.

Bomb Bloke- 03-12-2006

Assuming the four bytes are taken consecutively from the card header, I don't see why that 5 should be there at all. Best I can find is that that byte should be some sort of padding (in which case it should be 0), or else it should be part of the card size field (in which case it should still be 0, as the card isn't that big). But if it really is just padding then I don't see why 3rd party companies wouldn't use it for their own purposes.

fuzziqersoftware- 03-12-2006

The 4 bytes actually come directly from the memory card hardware. They're retrieved using the EXI command 0x0000 (the device ID command). I -*test*-('")ed yesterday and it turns out that GCARS does actually recognize the correct size of the card, it just screws up on large cards for some reason. I guess it'll take a little more debugging than I thought.

Bomb Bloke- 03-20-2006

When I get Gcars to rip my large card, if I let it keep going until it thinks it's done, I get 184,549,376bytes. That's an exact 176mbytes, or 1408mbits; a match to the device ID of x00000580. Checking the rips I did of the card, I can't find the x05 byte in the header at all. Perhaps it's because my card is corrupted (so there's gotta be some funny data in there somewhere), but Gcars seems to be using that byte anyway. A "<cardsize> = <deviceID> & xFF" command should get around that.

fuzziqersoftware- 03-20-2006

Ah, found it. cardsize = (exi_deviceid(slot,0) & 0x0000FFFC) * 0x20000; should have been cardsize = (exi_deviceid(slot,0) & 0x000000FC) * 0x20000;

Bomb Bloke- 04-10-2006

So does that mean you've got large cards working in Gcars, or is it still early days for that?

fuzziqersoftware- 04-11-2006

It's possible. I really have no idea, since my large card stopped working a while ago.... :(

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.