mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
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:
@@ -164,13 +164,20 @@ void flashSaveDecide(uint32_t address, uint8_t byte)
|
|||||||
if (saveType == 1)
|
if (saveType == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// log("Deciding save type %08x\n", address);
|
if (cpuSramEnabled && cpuFlashEnabled) {
|
||||||
if (address == 0x0e005555) {
|
// log("Deciding save type %08x\n", address);
|
||||||
saveType = 3;
|
if (address == 0x0e005555) {
|
||||||
cpuSaveGameFunc = flashWrite;
|
saveType = 3;
|
||||||
} else {
|
cpuSramEnabled = false;
|
||||||
saveType = 2;
|
cpuSaveGameFunc = flashWrite;
|
||||||
cpuSaveGameFunc = sramWrite;
|
} 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);
|
(*cpuSaveGameFunc)(address, byte);
|
||||||
|
@@ -67,6 +67,11 @@ extern uint8_t biosProtected[4];
|
|||||||
|
|
||||||
extern void (*cpuSaveGameFunc)(uint32_t, uint8_t);
|
extern void (*cpuSaveGameFunc)(uint32_t, uint8_t);
|
||||||
|
|
||||||
|
extern bool cpuSramEnabled;
|
||||||
|
extern bool cpuFlashEnabled;
|
||||||
|
extern bool cpuEEPROMEnabled;
|
||||||
|
extern bool cpuEEPROMSensorEnabled;
|
||||||
|
|
||||||
#ifdef BKPT_SUPPORT
|
#ifdef BKPT_SUPPORT
|
||||||
extern uint8_t freezeWorkRAM[0x40000];
|
extern uint8_t freezeWorkRAM[0x40000];
|
||||||
extern uint8_t freezeInternalRAM[0x8000];
|
extern uint8_t freezeInternalRAM[0x8000];
|
||||||
|
Reference in New Issue
Block a user