diff --git a/desmume/src/addons/gbagame.cpp b/desmume/src/addons/gbagame.cpp index 06f32b562..8191795df 100644 --- a/desmume/src/addons/gbagame.cpp +++ b/desmume/src/addons/gbagame.cpp @@ -22,6 +22,7 @@ #include "../mem.h" #include #include "../MMU.h" +#include "path.h" //SRAM is going to be stored just above the rom. //that is convenient for us, since it mirrors the nds memory map @@ -292,6 +293,12 @@ static void GBAgame_reset(void) if (!strlen(GBAgameName)) return; FILE *fgame = 0; + //perk: if the gbagame name is "self" this is a special indicator that we should mount the main rom that we're running as the gba game + if(!stricmp(GBAgameName,"self")) + { + strcpy(GBAgameName,path.path.c_str()); + } + fgame = fopen(GBAgameName,"rb"); if (!fgame) return; fseek(fgame, 0, SEEK_END); diff --git a/desmume/src/windows/gbaslot_config.cpp b/desmume/src/windows/gbaslot_config.cpp index f73830577..65549ce22 100644 --- a/desmume/src/windows/gbaslot_config.cpp +++ b/desmume/src/windows/gbaslot_config.cpp @@ -554,11 +554,10 @@ void GBAslotDialog(HWND hwnd) break; case NDS_ADDON_CFLASH: //save current values for win32 configuration - //(no tmp for mode, a little weird but thats just how it evolved) - win32_CFlash_cfgMode = CFlash_Mode; + win32_CFlash_cfgMode = tmp_CFlashMode; win32_CFlash_cfgDirectory = tmp_cflash_path; win32_CFlash_cfgFileName = tmp_cflash_filename; - WritePrivateProfileInt("GBAslot.CFlash","fileMode",CFlash_Mode,IniName); + WritePrivateProfileInt("GBAslot.CFlash","fileMode",tmp_CFlashMode,IniName); WritePrivateProfileString("GBAslot.CFlash","path",tmp_cflash_path,IniName); WritePrivateProfileString("GBAslot.CFlash","filename",tmp_cflash_filename,IniName);