From 62d941a979255f695da2a073813ad05f70df2ec8 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 17 Oct 2013 01:07:08 -0700 Subject: [PATCH] Plumb through filename for checking overrides --- src/gba/gba-thread.c | 2 +- src/gba/gba.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 47a6fc575..858163c7e 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -56,8 +56,8 @@ static void* _GBAThreadRun(void* context) { strcat(savedata, "sav"); } } - GBALoadROM(&gba, threadContext->fd, threadContext->fname); gba.savefile = savedata; + GBALoadROM(&gba, threadContext->fd, threadContext->fname); } #ifdef USE_DEBUGGER diff --git a/src/gba/gba.c b/src/gba/gba.c index a7aba1e85..d3d582824 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -454,6 +454,9 @@ void _checkOverrides(struct GBA* gba, uint32_t id) { int i; for (i = 0; _savedataOverrides[i].id; ++i) { if (_savedataOverrides[i].id == id) { + if (_savedataOverrides[i].type != SAVEDATA_NONE) { + GBASavedataInit(&gba->memory.savedata, gba->savefile); + } gba->memory.savedata.type = _savedataOverrides[i].type; switch (_savedataOverrides[i].type) { case SAVEDATA_FLASH512: