GB: use upstream MBC2 savedata (saving/loading) handling. #474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've taken again some MBC2 savedata handling code from upstream VisualBoyAdvance-M code (instead of that hacky
gbRam
for MBC2 sincegbMemoryMap
for MBC2 doesn't get deleted at reset) before they changed everything to gbCartData, which isn't present in VBA-GX.MemgbWriteSave
andMemgbReadSave
for MBC2, specific functions used on VBA-GX, also have been changed for reflect the new changes.(See https://github.com/visualboyadvance-m/visualboyadvance-m/blob/9889ef4fa8dfc50fd15591c066f0b9df9411240f/src/gb/GB.cpp for see where did i took this)
I retested F-1 Race, Kirby's Pinball Land, Golf, and a few other MBC2 games, and seems saving/loading is still working since last time i digged into MBC2 savedata handling on VBA-GX.
Currently in further testing, but i will leave this PR as a draft meanwhile.