GB Memory: Support manual SRAM editing (fixes #1580)
Vicki Pfau vi@endrift.com
Sat, 30 Nov 2019 11:37:36 -0800
2 files changed,
11 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -97,6 +97,8 @@ - 3DS: Fix screen darkening (fixes mgba.io/i/1562)
- 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
M
src/gb/memory.c
→
src/gb/memory.c
@@ -649,7 +649,15 @@ }
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: