diff --git a/CHANGES b/CHANGES index 330f9d992..3bdeb0ed6 100644 --- a/CHANGES +++ b/CHANGES @@ -85,6 +85,7 @@ Other fixes: - 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 diff --git a/src/gb/mbc.c b/src/gb/mbc.c index 53d577452..3cb9a1a5d 100644 --- a/src/gb/mbc.c +++ b/src/gb/mbc.c @@ -353,6 +353,9 @@ void GBMBCInit(struct GB* gb) { 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 @@ void GBMBCInit(struct GB* gb) { 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); }