libretro / vbam-libretro

A fork of VBA-M with libretro integration
24 stars 30 forks source link

HuC3: Refactoring to avoid breaking savestates #103

Closed negativeExponent closed 3 years ago

negativeExponent commented 3 years ago

Savestates are broken due to the change in savestate struct size for HuC3. Since save/load function also includes save data for other non-active mappers, the change in size breaks every savesfiles being made.

This PR refactors the HuC3 clock data struct to be separate from the main struct, and then only added to save/load functions when HuC3 mapper is used. This still breaks previous HuC3 states but other mappers should now not get affected

Solution: Savestate/LoadState should only include mapper data of current active running rom, not all mappers even if they are inactive. This will break every savefile but it would be better for the long run when changes are neede to be done.