Page 1 of 1

Extracting saves from Legend of Zelda: Collector's Edition.

Posted: Wed Sep 24, 2014 7:03 am
by Vague Rant
I've been playing some Ocarina of Time via the GameCube Collector's Edition (USA release) lately, but since locked down saves are the worst in a world where there's 40 different ways to play games, I wanted a way to use my Collector's Edition save on any other N64 emulator.

With credit to einstein95 on Badnik IRC, you can find (almost) the beginning of an Ocarina of Time save by searching for ASCII "ZELDA", which occurs at 0x07 in an original N64 OoT save. This can be found quite easily in an extracted GCI save file from the Collector's Edition, and means that the beginning of the save is at 0x6044 in said GCI. From here, we need to copy 32KB (0x8000 bytes) to a new file, which will be our Ocarina of Time SRAM.

NB: It's possible that the address is different in other regions, so you may wish to confirm that "ZELDA" occurs seven bytes into your copy range just to be sure.

Named appropriately for your emulator (in my case, with Wii64, that's THE LEGEND OF ZELDA(U).sra), this should be all you need to do to continue your game outside of the Collector's Edition. Similar methods should work to extract saves from the Zelda 1, 2 and Majora's Mask GameCube saves; just search for some known bytes in each and copy the appropriate length.

For now, doing the reverse doesn't seem to be possible: the GameCube save presumably uses a checksum of its own and sees the modified save as corruption. It should be possible to find and correct this checksum for a capable user (read: not me), so that games started on other emulators can be continued on the Collector's Edition, but at the moment this is a one-way switch.

EDIT: Corrected string to search for.

Re: Extracting saves from Legend of Zelda: Collector's Editi

Posted: Wed Sep 24, 2014 11:17 am
by 47iscool
I've done that a while back.

And speaking of re-inserting, it can be done. You would just need to copy the 32kb of data to where the emulated data is at in Dolphin's RAM. HxD would suffice to do that.

Re: Extracting saves from Legend of Zelda: Collector's Editi

Posted: Wed Sep 24, 2014 3:49 pm
by ShadowOne333
Vague Rant wrote:With credit to einstein95 on Badnik IRC, you can find (almost) the beginning of an Ocarina of Time save by searching for ASCII "ZELDAZ", which occurs at 0x07 in an original N64 OoT save. This can be found quite easily in an extracted GCI save file from the Collector's Edition, and means that the beginning of the save is at 0x6044 in said GCI. From here, we need to copy 32KB (0x8000 bytes) to a new file, which will be our Ocarina of Time SRAM.

Named appropriately for your emulator (in my case, with Wii64, that's THE LEGEND OF ZELDA(U).sra), this should be all you need to do to continue your game outside of the Collector's Edition. Similar methods should work to extract saves from the Zelda 1, 2 and Majora's Mask GameCube saves; just search for some known bytes in each and copy the appropriate length.
The ZELDAZ doesn't occur in 0x07.
I only have "ZELDA" in that location, without the last "Z"
"ZELDAZ" in a .sra file happens all the way up to 0x28DC.

One other thing though, exactly where does it begin?
You say it starts at 0x6044 in the GCI, but that part of the GCI doesn't have "ZELDA" nor "ZELDAZ".
"ZELDA" ASCII starts until 0x604B, and "ZELDAZ" starts at 0x6080.

I want to know from which address I need to start copying and until what address it should be copied.

I am using NTSC-U saves for both the Collector's Edition and the Wii64 save files (THE LEGEND OF ZELDA(U).sra, as the one you said).

Re: Extracting saves from Legend of Zelda: Collector's Editi

Posted: Wed Sep 24, 2014 5:15 pm
by Vague Rant
You're right, ZELDAZ does appear later, I had the strings mixed up. ZELDAZ is still probably a better way to get to the general area without knowing the exact offset since it saves you hitting false positives. I updated the original post to correct this error.

Like I said in the first post, the ZELDA string appears at 0x07, not 0x00. Hence, while ZELDA is at 0x604B, the beginning of the actual SRAM is at 0x6044. It's simple: 0x604b - 0x07 = 0x6044

0x8000 bytes on from here is 0xE043, so that's the end of the file. For me, the very last byte is "01" after a sea of "00"s, so this might be a good way to confirm you've found it, but I don't know if this value is a constant or not.

Re: Extracting saves from Legend of Zelda: Collector's Editi

Posted: Wed Sep 24, 2014 5:42 pm
by ShadowOne333
Vague Rant wrote:You're right, ZELDAZ does appear later, I had the strings mixed up. ZELDAZ is still probably a better way to get to the general area without knowing the exact offset since it saves you hitting false positives. I updated the original post to correct this error.

Like I said in the first post, the ZELDA string appears at 0x07, not 0x00. Hence, while ZELDA is at 0x604B, the beginning of the actual SRAM is at 0x6044. It's simple: 0x604b - 0x07 = 0x6044

0x8000 bytes on from here is 0xE043, so that's the end of the file. For me, the very last byte is "01" after a sea of "00"s, so this might be a good way to confirm you've found it, but I don't know if this value is a constant or not.
Good, thank you!

So let me see if I got it right...
I start at 0x6044 all the way up to 0xE043, copy all the data in between to 0x0000 of the .sra file, it should copy everything up to 0x8000 in that file.

Am I right? Or did I miss something?

EDIT: I just tested the .sra file, it did load but it only copied the first save slot out of the three ones available, and I had another save in my third slot.
So I think each "ZELDA" string is the start of each of the slots, being 0x6044 the first slot.

EDIT 2: Ok so I managed to "extract and inject" the saves from the GCI into the SRA and FLA files for both Ocarina and Majora's.
They load fine and everything in Wii64, but the only issue is that the health meter (hearts) are all white instead of red.
I don't know what the issue might be.
I got in contact with another user that had injected the save from the Master Quest into a P64 save and will help me out later.

Re: Extracting saves from Legend of Zelda: Collector's Editi

Posted: Thu Jan 15, 2015 9:50 pm
by BOBdotEXE
hmm, I searched for and found the ZELDA string (in the gci) then I advanced 8000, and copied what was inbetween to an sra file,
at 00, but in game it shows up with all the slots empty.

This is the first time I've used a hex editor in like 6 years, so is there any other easier way to get it working?

Re: Extracting saves from Legend of Zelda: Collector's Edition.

Posted: Thu Feb 16, 2017 9:15 am
by Home_Rowed
I joined just to post the info for Zelda 1.

Zelda 1 SAV from GCI
Start: 0x2043
End: 0x4042