From 32b031483d4fb467cfbb83d578d38203c9162fd8 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 10 Aug 2010 03:09:14 +0000 Subject: [PATCH] merge r3739 --start-paused fixes to release branch and as usual unnecessarily touch 1 million files --- desmume/src/windows/hotkey.cpp | 4 ++-- desmume/src/windows/main.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index b4289ff44..29059bfaa 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -161,14 +161,14 @@ void HK_StateLoadSlot(int num, bool justPressed) if (romloaded && justPressed) { BOOL wasPaused = paused; - NDS_Pause(); + Pause(); loadstate_slot(num); //Loadstate lastSaveState = num; //Set last savestate used UpdateToolWindows(); if(!wasPaused) - NDS_UnPause(); + Unpause(); else Display(); diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 3cc22699c..5e7c69adb 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -174,6 +174,7 @@ HMENU mainMenu = NULL; //Holds handle to the main DeSmuME menu CToolBar* MainWindowToolbar; DWORD hKeyInputTimer; +bool start_paused; extern LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); void InitRamSearch(); @@ -1915,7 +1916,7 @@ void LoadSaveStateInfo() static BOOL LoadROM(const char * filename, const char * logicalName) { ResetSaveStateTimes(); - NDS_Pause(); + Pause(); //if (strcmp(filename,"")!=0) INFO("Attempting to load ROM: %s\n",filename); if (NDS_LoadROM(filename, logicalName) > 0) @@ -2425,6 +2426,7 @@ int _main() cmdline.errorHelp(__argv[0]); return 1; } + start_paused = cmdline.start_paused; Desmume_InitOnce(); @@ -2719,11 +2721,6 @@ int _main() if(OpenCore(cmdline.nds_file.c_str())) { romloaded = TRUE; - if(cmdline.start_paused) - { - NDS_Pause(); - cmdline.start_paused = 0; - } } } @@ -3146,7 +3143,11 @@ static BOOL OpenCore(const char* filename) { romloaded = TRUE; if(movieMode == MOVIEMODE_INACTIVE) - Unpause(); + { + if(!start_paused) + Unpause(); + start_paused = 0; + } // Update the toolbar MainWindowToolbar->EnableButton(IDM_PAUSE, true);