diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index d4c3653f..eeee459d 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -142,6 +142,7 @@ static CFGSTRUCT fceuconfig[] = { ACS(BasicBotDir), AC(EnableBackgroundInput), AC(MemWatchLoadOnStart), + AC(MemWatchLoadFileOnStart), //ACS(memwLastfile[2048]), ENDCFGSTRUCT diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index dd27b91e..4d408fb2 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -32,8 +32,8 @@ static int NeedsInit = 1; char *MemWatchDir = 0; char memwLastFilename[2048]; bool fileChanged = false; -bool MemWatchLoadOnStart = false; //If load memw on fceu start TODO: receive it from config file, if not in config, set to false -bool loadFileonStart = false; //If load last file on memw start TODO: receive from config file, if not in config, set to false +bool MemWatchLoadOnStart = false; +bool MemWatchLoadFileOnStart = false; static HMENU memwmenu = 0; //char RecentMemwDirs[5][48]; //Recent directories @@ -545,6 +545,7 @@ static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA break; case WM_INITMENU: CheckMenuItem(memwmenu, MEMW_OPTIONS_LOADSTART, MemWatchLoadOnStart ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(memwmenu, MEMW_OPTIONS_LOADLASTFILE, MemWatchLoadFileOnStart ? MF_CHECKED : MF_UNCHECKED); break; case WM_CLOSE: case WM_QUIT: @@ -585,18 +586,8 @@ static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA break; case MEMW_OPTIONS_LOADLASTFILE: //Load last file when opening memwatch - - if (loadFileonStart==false) - { - CheckMenuItem(memwmenu,MEMW_OPTIONS_LOADLASTFILE,MF_CHECKED); - loadFileonStart=true; - } - else - { - CheckMenuItem(memwmenu,MEMW_OPTIONS_LOADLASTFILE,MF_UNCHECKED); - loadFileonStart=false; - } - + MemWatchLoadFileOnStart ^= 1; + CheckMenuItem(memwmenu, MEMW_OPTIONS_LOADLASTFILE, MemWatchLoadFileOnStart ? MF_CHECKED : MF_UNCHECKED); break; case MEMW_HELP_WCOMMANDS: diff --git a/src/drivers/win/memwatch.h b/src/drivers/win/memwatch.h index 767b1b1a..4fb0791e 100644 --- a/src/drivers/win/memwatch.h +++ b/src/drivers/win/memwatch.h @@ -4,3 +4,4 @@ void AddMemWatch(char memaddress[32]); //char memwLastFilename[2048]; extern char * MemWatchDir; extern bool MemWatchLoadOnStart; +extern bool MemWatchLoadFileOnStart;