mirror of https://github.com/mgba-emu/mgba.git
GB: Properly unmap ROM base when unloading ROM
This commit is contained in:
parent
2fc5e2d08d
commit
c2de079a9d
|
@ -293,6 +293,10 @@ void GBSavedataUnmask(struct GB* gb) {
|
|||
|
||||
void GBUnloadROM(struct GB* gb) {
|
||||
// TODO: Share with GBAUnloadROM
|
||||
off_t romBase = gb->memory.romBase - gb->memory.rom;
|
||||
if (romBase >= 0 && ((size_t) romBase < gb->memory.romSize || (size_t) romBase < gb->yankedRomSize)) {
|
||||
gb->memory.romBase = NULL;
|
||||
}
|
||||
if (gb->memory.rom && !gb->isPristine) {
|
||||
if (gb->yankedRomSize) {
|
||||
gb->yankedRomSize = 0;
|
||||
|
|
Loading…
Reference in New Issue