GB Memory: Support manual SRAM editing (fixes #1580)

This commit is contained in:
Vicki Pfau 2019-11-30 11:37:36 -08:00
parent ffe99c08b7
commit d3ec40b392
2 changed files with 11 additions and 1 deletions

View File

@ -97,6 +97,8 @@ Other fixes:
- Core: Fix uninitialized memory issues with graphics caches
- Vita: Fix analog controls (fixes mgba.io/i/1554)
- Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574)
Misc:
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
0.8 beta 1: (2019-10-20)
- Initial beta for 0.8

View File

@ -649,7 +649,15 @@ void GBPatch8(struct LR35902Core* cpu, uint16_t address, int8_t value, int8_t* o
break;
case GB_REGION_EXTERNAL_RAM:
case GB_REGION_EXTERNAL_RAM + 1:
mLOG(GB_MEM, STUB, "Unimplemented memory Patch8: 0x%08X", address);
if (memory->rtcAccess) {
memory->rtcRegs[memory->activeRtcReg] = value;
} else if (memory->sramAccess && memory->sram && memory->mbcType != GB_MBC2) {
// TODO: Remove sramAccess check?
memory->sramBank[address & (GB_SIZE_EXTERNAL_RAM - 1)] = value;
} else {
memory->mbcWrite(gb, address, value);
}
gb->sramDirty |= GB_SRAM_DIRT_NEW;
return;
case GB_REGION_WORKING_RAM_BANK0:
case GB_REGION_WORKING_RAM_BANK0 + 2: