add --gbaslot-rom=self special value which mounts the current nds rom as a gba game, and fix the win32 cflash configuration dialog

This commit is contained in:
zeromus 2010-06-17 05:24:35 +00:00
parent f72ce94f8d
commit b804c2e2b1
2 changed files with 9 additions and 3 deletions

View File

@ -22,6 +22,7 @@
#include "../mem.h"
#include <string.h>
#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);

View File

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