GB MBC: Force minimum SRAM size on rare MBCs that always have SRAM
Vicki Pfau vi@endrift.com
Wed, 24 Mar 2021 18:59:56 -0700
2 files changed,
7 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -85,6 +85,7 @@ - FFmpeg: Fix some small memory leaks
- FFmpeg: Fix encoding of time base - GB: Fix crash when changing ROM while in banked address space - GB: Fix loading model overrides + - GB MBC: Force minimum SRAM size on rare MBCs that always have SRAM - GB Serialize: Fix crash when loading pre-0.7 SGB savestates - GB Video: Fix SGB video logs - GB Video: Discard SGB packets in non-SGB mVLs
M
src/gb/mbc.c
→
src/gb/mbc.c
@@ -353,6 +353,9 @@ case GB_MBC6:
gb->memory.mbcWrite = _GBMBC6; gb->memory.mbcRead = _GBMBC6Read; gb->memory.directSramAccess = false; + if (!gb->sramSize) { + gb->sramSize = GB_SIZE_EXTERNAL_RAM; // Force minimum size for convenience + } gb->sramSize += GB_SIZE_MBC6_FLASH; // Flash is concatenated at the end break; case GB_MBC7:@@ -386,6 +389,9 @@ break;
case GB_POCKETCAM: gb->memory.mbcWrite = _GBPocketCam; gb->memory.mbcRead = _GBPocketCamRead; + if (!gb->sramSize) { + gb->sramSize = GB_SIZE_EXTERNAL_RAM; // Force minimum size for convenience + } if (gb->memory.cam && gb->memory.cam->startRequestImage) { gb->memory.cam->startRequestImage(gb->memory.cam, GBCAM_WIDTH, GBCAM_HEIGHT, mCOLOR_ANY); }