Importing a SAV for a NES game from an emulator to your Virtual Consol

Discussion in 'Wii - Hacking' started by 9th_Sage, Sep 29, 2009.

  1. 9th_Sage
    OP

    Member 9th_Sage GBAtemp Maniac

    Joined:
    Apr 30, 2008
    Messages:
    1,481
    Country:
    United States
    I was wondering if anyone had ever tried to take a SAV file from an emulator and import it into their Wii save of the same game (in my case the first Legend of Zelda on the NES)? I dumped my save with Savegame Manager, and added the header present in the Wii save's SRAM to my sav, but just could not get it to work. It appears to me as though it should, but there must be something I'm missing. I'm hoping someone has tried it before and could give me a tip.

    Yes yes, I know I could just use FCEUX, but that's not the point of me trying to do this. [​IMG]
     
  2. s3phir0th115

    Member s3phir0th115 GBAtemp Advanced Fan

    Joined:
    Dec 31, 2008
    Messages:
    700
    Country:
    United States
    While I haven't worked with NES saves due to using fceux, I have worked with getting a snes save and a few Nintendo 64 saves to virtual console titles. They may or may not apply to nes ones, but I can give you some information that applies for all of them.

    In any case, you must know that simply copying your save to an SD card and editing that directly will not work. Your save is packed and encrypted with your wii's keys. In order to get these keys, you have to use something like xyzzy or bootmii. And you must use FE100 or the Unix tool it is based on to unpack your save with the keys. This same tool will allow you to pack saves once edited that will work on your wii.

    Now, as for the save format themselves. The snes save was completely standard, and I was able to just copy it over and it would work with snes9x. (Well, I copied that FROM the wii. But I could have just as easily packed a save and sent it to the wii.)

    The Nintendo 64 saves were a bit more difficult. For one thing, Nintendo 64 emulators will often byteswap game saves. Roms can also be byteswapped too. In order to get these saves on the wii, you usually will have to use a hex editor to byteswapped saves that are byteswapped. (I know it's confusing. It's the same action. Doing it will undo it if you did it before.)

    Now Majora's Mask was more of a bitch for me. It needed to be byteswapped, but Nintendo's emulator also added a footer that made the save over twice as big. All this required was getting a hex editor and adding the same thing to a regular save, then copying.

    Now, I doubt any NES saves would be complicated, but having not dealt with them specifically, I can't say for sure how they'll act. My prediction, would be just copying it over, and MAYBE adding padding. (What's confusing to me is that the snes save was smaller than the Nintendo 64 save, yet it had no padding at all.)
     
  3. 9th_Sage
    OP

    Member 9th_Sage GBAtemp Maniac

    Joined:
    Apr 30, 2008
    Messages:
    1,481
    Country:
    United States
    Well, as I said, I got the save by using Save Manager (therefore it was unencrypted already). It looks as though the save from the Wii has a header, which I added, and there was an extra byte at the end I added to my save from the emulator as well as adding the header to it.

    Must be something else I'm missing. It *does* look like it's the same as the save from the emulator on my PC that I was using (in a hex editor it looks to begin and end in the same way pretty much, except for that extra byte). Or I'm just doing something wrong. I ought to try it when it's not late at night again.
     
  4. s3phir0th115

    Member s3phir0th115 GBAtemp Advanced Fan

    Joined:
    Dec 31, 2008
    Messages:
    700
    Country:
    United States
    I'm not quite sure you understand what all I said. I meant using the save manager to get the save on the SD card. The wii encrypts the save when it's placed on the SD card, to prevent modification. That's why you have to extract your wii's keys in order to modify the save using the PC tool.

    Also, virtual console saves from the save manager don't just contain the save data from the emulator. They also contain the pictures used to make the animation you see when you select it in the menu. Actually, I'm fairly certain all saves have these animation pictures.

    So simply appending your emulator save on and trying to make it copy won't work. You must also consider that the wii expects encrypted saves.
     
  5. 9th_Sage
    OP

    Member 9th_Sage GBAtemp Maniac

    Joined:
    Apr 30, 2008
    Messages:
    1,481
    Country:
    United States
    No no, I mean Wanikoko's Save Manager application. It pretty much just copies/restores the files directly from NAND. It's similar to what you'd get from using FE100 on a save copied using the Wii's Data Management menu, but without the extra step of decrypting the save.

    I do know what and how FE100 works. I used it a while back to 'rescue' a Conduit save that wouldn't copy back to my system. I used FE100 to get at the files and used Save Manger to copy it back.
     
  6. s3phir0th115

    Member s3phir0th115 GBAtemp Advanced Fan

    Joined:
    Dec 31, 2008
    Messages:
    700
    Country:
    United States
    Ahh, I understand. I was under the impression that you were trying to work with a .bin retrieved straight from the Wii System Menu save manager.

    To make it simple, FE100 basically takes your wii's keys, and it is able to decrypt and unpack or encrypt and pack saves from a wii's who's keys it is given. I usually use it with the wii's save manager or ftpii if I want files straight from the nand.

    Anyway, what files exactly came from waninkoko's save manager for this game?

    Also, you mentioned a header for the file you believe is the save file. Have you also checked for a footer? As I mentioned with my experience with Majora's Mask's save, there was a huge footer filled with 0's that made the file twice as big as it needed to be, and I needed to add the same padding to my save before it would work.
     
  7. 9th_Sage
    OP

    Member 9th_Sage GBAtemp Maniac

    Joined:
    Apr 30, 2008
    Messages:
    1,481
    Country:
    United States
    Well, like I said, there was some sort of header (it had the game ID and such, FAKE in this case) and then something that appeared to look exactly the same as what the emulator's battery save looked like in hex. Well, not exactly since the save data is different, but the start of the sav file looked exactly the same as what came under this header, so I presumed that's where the extra data ended and the actual save began. As a test I ought to try that save in an emulator, actually, just to be sure (the one extracted from the Wii save data). There was a single extra byte at the end of the save also, which was 00. I also added this to mine, but it doesn't work. I was thinking though...it could be this header is something more. I wonder if they bothered to check the checksum or something? Nothing like that jumps out at me though.
     
  8. s3phir0th115

    Member s3phir0th115 GBAtemp Advanced Fan

    Joined:
    Dec 31, 2008
    Messages:
    700
    Country:
    United States
    Yeah, I would suspect the .bin is a container for other files. Perhaps try U8 tool or something to extract it and see if that does it? Or maybe Fe100?

    Also, saves from my experience don't even have file extensions. But they do have "RAM" in their name. (At least the n64 ones. I don't remember what exactly the snes one had.)

    Of course I'm shooting a bit in the dark here. But that's what I'd try next.

    Regarding the checksum theory, I've seen checksums used in the game content itself when I've worked with rom injection. When you're done packing certain files, you'd have to alter the tmd in a hex editor to make the checksum match the new one. (A find and replace action really, if you were smart and kept a checksum for the file pasted somewhere.) But I have no seen any such measures used in saves for VC games. I think Nintendo stopped at the encryption on those.
     
  9. 9th_Sage
    OP

    Member 9th_Sage GBAtemp Maniac

    Joined:
    Apr 30, 2008
    Messages:
    1,481
    Country:
    United States
    Hm, yeah, I hadn't thought to try U8 on it (if that DID spit out the portion I think is the header and the save seperately, that would surely make things smoother). I should try that. Not tonight though. I have a bad case of insommnia tonight, I really should be in bed.
     

Share This Page