all repos — mgba @ 8903d3145849278cd087aabe72ebe4ad46b78464

mGBA Game Boy Advance Emulator

Pepper logging throughout the savegame loading mechanism
Jeffrey Pfau jeffrey@endrift.com
Tue, 21 Oct 2014 22:12:57 -0700
commit

8903d3145849278cd087aabe72ebe4ad46b78464

parent

c52edab71a0f3465c508b554130fdccb4108a654

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

jump to
M src/gba/gba-memory.csrc/gba/gba-memory.c

@@ -365,6 +365,7 @@ case REGION_CART_SRAM:

case REGION_CART_SRAM_MIRROR: wait = memory->waitstatesNonseq16[address >> BASE_OFFSET]; if (memory->savedata.type == SAVEDATA_NONE) { + GBALog(gba, GBA_LOG_INFO, "Detected SRAM savegame"); GBASavedataInitSRAM(&memory->savedata); } if (memory->savedata.type == SAVEDATA_SRAM) {

@@ -476,6 +477,7 @@ }

break; case REGION_CART2_EX: if (memory->savedata.type == SAVEDATA_NONE) { + GBALog(gba, GBA_LOG_INFO, "Detected EEPROM savegame"); GBASavedataInitEEPROM(&memory->savedata); } GBASavedataWriteEEPROM(&memory->savedata, value, 1);

@@ -532,8 +534,10 @@ case REGION_CART_SRAM:

case REGION_CART_SRAM_MIRROR: if (memory->savedata.type == SAVEDATA_NONE) { if (address == SAVEDATA_FLASH_BASE) { + GBALog(gba, GBA_LOG_INFO, "Detected Flash savegame"); GBASavedataInitFlash(&memory->savedata); } else { + GBALog(gba, GBA_LOG_INFO, "Detected SRAM savegame"); GBASavedataInitSRAM(&memory->savedata); } }

@@ -817,6 +821,7 @@ dest += destOffset;

--wordsRemaining; } else if (destRegion == REGION_CART2_EX) { if (memory->savedata.type == SAVEDATA_NONE) { + GBALog(gba, GBA_LOG_INFO, "Detected EEPROM savegame"); GBASavedataInitEEPROM(&memory->savedata); } word = cpu->memory.load16(cpu, source, 0);
M src/gba/gba.csrc/gba/gba.c

@@ -659,6 +659,7 @@ }

for (i = 0; _overrides[i].id[0]; ++i) { const uint32_t* overrideId = (const uint32_t*) _overrides[i].id; if (*overrideId == id) { + GBALog(gba, GBA_LOG_DEBUG, "Found override for game %s!", _overrides[i].id); switch (_overrides[i].type) { case SAVEDATA_FLASH512: case SAVEDATA_FLASH1M: