Universal-Team / pkmn-chest

A Pokémon Bank for the 3rd through 5th generation Pokémon games for the Nintendo DS(i).
https://universal-team.net/projects/pkmn-chest
GNU General Public License v3.0
226 stars 10 forks source link

[Bug Report] Pokemon Emerald save from mGBA will not load #85

Open flanter21 opened 11 months ago

flanter21 commented 11 months ago

Describe the bug mGBA appends several bytes to the end of the Pokemon Emerald save, probably for the RTC (as I could not replicate this issue with LeafGreen which does not have a ).

To Reproduce Steps to reproduce the behavior:

  1. Copy save file last modified/created by mGBA to SD card.
  2. Open save file in pkmn-chest
  3. See error

Expected behavior Save file will load as normal.

Screenshots If applicable, add screenshots to help explain your problem.

Console (please complete the following information):

Additional context Save file will run just fine in mGBA and GBArunner2. Also works in pkhex. Will also work in pkmn-chest after removing the added bytes at the end of the file (after the string of FF FF FF FF...).

Pinkietron commented 10 months ago

mGBA appends the rtc to the end of the save file as you stated. This makes the file larger than most save managers are expecting, so it won't load. To fix that, open the save in a hex editor on your computer, delete the last line, and then save it. In mGBA settings you can also disable RTC for games so this does not continue to happen.

endrift commented 2 months ago

To fix it, pkmn-chest could also add support for the footer.

Hardivh commented 3 weeks ago

It's happening to me too.

Only on Emerald, I have a save file for Fire Red that works normally

Pinkietron commented 3 weeks ago

Fire Red does not have RTC which would be the reason why only RSE is affected by this. Try the fix I posted above.

Hardivh commented 3 weeks ago

Oh damn, it worked! I opened a hex editor online, uploaded the Emerald save and deleted the last line. It's now properly working

Thanks a lot!