From 9a8a0774434ae4d7923664fa6e551231429fc1f7 Mon Sep 17 00:00:00 2001 From: Squall Leonhart Date: Tue, 28 Feb 2023 06:00:21 +1100 Subject: [PATCH] Lets fix Stuart Little 2 properly (maybe?) This game cart may have a flashcontroller but no flashram onboard, the game automatically goes down the Flash Type path and hits a stackoverflow at cpuSaveGameFunc after cpuSramEnabled returns as false I'm not sure of the specifics, but with this change it seems to avoid this condition. I have tested a number of titles that create Sram, 512 and 1024Mbit flash and they all still seem to just fine. --- src/gba/Flash.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gba/Flash.cpp b/src/gba/Flash.cpp index bee83b19..ed6a90a4 100644 --- a/src/gba/Flash.cpp +++ b/src/gba/Flash.cpp @@ -103,6 +103,9 @@ void flashSaveDecide(uint32_t address, uint8_t byte) cpuSramEnabled ? "SRAM" : "FLASH", address, byte); } + if (coreOptions.saveType == GBA_SAVE_NONE) + return; + (*cpuSaveGameFunc)(address, byte); }