Commit 009c09ef authored by retro-wertz's avatar retro-wertz
Browse files

GBA: Show log when rom uses SRAM of FLASH save types

Log should only show once during the first write to SRAM or FLASH address using flashSaveDecide()
parent 90bc79f2
......@@ -164,13 +164,20 @@ void flashSaveDecide(uint32_t address, uint8_t byte)
if (saveType == 1)
return;
// log("Deciding save type %08x\n", address);
if (address == 0x0e005555) {
saveType = 3;
cpuSaveGameFunc = flashWrite;
} else {
saveType = 2;
cpuSaveGameFunc = sramWrite;
if (cpuSramEnabled && cpuFlashEnabled) {
// log("Deciding save type %08x\n", address);
if (address == 0x0e005555) {
saveType = 3;
cpuSramEnabled = false;
cpuSaveGameFunc = flashWrite;
} else {
saveType = 2;
cpuFlashEnabled = false;
cpuSaveGameFunc = sramWrite;
}
log("%s emulation is enabled by writing to: $%08x : %02x\n",
cpuSramEnabled ? "SRAM" : "FLASH", address, byte);
}
(*cpuSaveGameFunc)(address, byte);
......
......@@ -67,6 +67,11 @@ extern uint8_t biosProtected[4];
extern void (*cpuSaveGameFunc)(uint32_t, uint8_t);
extern bool cpuSramEnabled;
extern bool cpuFlashEnabled;
extern bool cpuEEPROMEnabled;
extern bool cpuEEPROMSensorEnabled;
#ifdef BKPT_SUPPORT
extern uint8_t freezeWorkRAM[0x40000];
extern uint8_t freezeInternalRAM[0x8000];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment