Hi all I'm having some serious difficulty transferring saves from my emulators to my 3ds. I followed the guide for the gen 1 games that I found here, https://digiex.net/threads/pokemon-gameboy-rom-save-transfer-to-3ds-red-blue-yellow-green.14646/ But if i do the exact same thing with my gen 2 games they corrupt. Brief explanation is that I backup a save using checkpoint, transfer SD card to computer and replace the sav.dat file from the 3ds with the Crystal.sav from the emulator, making sure to rename it as well. Go back to the 3ds with the SD card, restore the save using checkpoint and boom, its corrupt. Everytime the save data for Crystal is 32kb as it should be.
For the Gen 2 saves on VC you need to load the save in VBA and save it once in game. Then edit the save in a hex editor and delete the last two lines of the save, like so: After that the save will work when transferred to the 3DS. The RTC data on emulators makes the save invalid when transferring it back to the 3DS, however doing the above will fix the issue. The hex editor i use is HxD.
Well after awhile I got it to work. After looking at the code you listed there I realized that the emulator I was using broke up the .sav and .rtc files into two seperate ones. So copy paste the code and boom! Works great, thanks a lot friend.