rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
353 stars 1.06k forks source link

Expansion version in save file #3829

Closed Ninjdai1 closed 9 months ago

Ninjdai1 commented 9 months ago

Description

TL;DR: Similar to #3454 in the save file

The goal of this would be to make the expansion's version accessible to programs similar to pkhex: I'm currently in the making of an expansion-compatible savefile editor. Problem is, some mons and items are not available depending on the version, which would probably cause issues if a mon, moves or items were added in a version they weren't in. Also, if #3438 or similar were to get merged, it would make that kind of software able to change the offsets it uses to get the data.

I know, as it would most likely change a saveblock, this will probabl get rejected, but I still wanted to bring the idea. Thanks for reading :3

Discord contact info

ninjdai

mrgriffin commented 9 months ago

You probably want your save editor to open both the ROM and the save, and that way you could read the Expansion version out of the RHH ROM header. The GF ROM header will give you pointers to things like gMoveNames and gSpeciesInfo which can help you identify which moves/species/etc are available.

Of course if a hack has added additional stuff to gSpeciesInfo or whatever, then the Expansion version isn't enough to tell you how to interpret the data, and atm there's nothing in the ROM or save which would.


That said, if/when save migration lands there's a chance it could store both the Expansion version and the hack version. The most recent draft PR only stored the hack version though.

mrgriffin commented 9 months ago

Oh, you might need things like MOVES_COUNT added to the RHH ROM header so that you don't have to resort to hacky things with gMoveNames to work out how many moves there are—feel free to raise a PR with that :)