all repos — mgba @ 32b7cc2fba9526ca64e561b433d8c7df13f5f066

mGBA Game Boy Advance Emulator

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
commit

32b7cc2fba9526ca64e561b433d8c7df13f5f066

parent

1b81c08de8fd10035d5ae060b81747c6b880c906

2 files changed, 7 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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); }