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()
This commit is contained in:
retro-wertz 2018-06-16 15:59:53 +08:00
parent 90bc79f299
commit 009c09ef4a
2 changed files with 19 additions and 7 deletions

View File

@ -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);

View File

@ -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];