From 6769ec30ace2ad707b79f1792e902ee480914b43 Mon Sep 17 00:00:00 2001 From: gocha Date: Tue, 8 Sep 2009 15:48:13 +0000 Subject: [PATCH] winport: add "Fast Fetch-Execute" to the menu, since r2844 brought some emulation glitches. --- desmume/src/armcpu.cpp | 7 ++++--- desmume/src/windows/main.cpp | 10 +++++++++- desmume/src/windows/resource.h | 1 + desmume/src/windows/resources.rc | Bin 692294 -> 692854 bytes 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/desmume/src/armcpu.cpp b/desmume/src/armcpu.cpp index db41d72ee..117116366 100644 --- a/desmume/src/armcpu.cpp +++ b/desmume/src/armcpu.cpp @@ -495,6 +495,7 @@ armcpu_flagIrq( armcpu_t *armcpu) { } +bool fastFetchExecute = true; template u32 armcpu_exec() { @@ -521,7 +522,7 @@ u32 armcpu_exec() cFetch = armcpu_prefetch(&ARMPROC); if (ARMPROC.stalled) { - return std::max(cFetch, cExecute); + return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); } #endif @@ -553,7 +554,7 @@ u32 armcpu_exec() #else cFetch = armcpu_prefetch(); #endif - return std::max(cFetch, cExecute); + return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); } if(PROCNUM==0) @@ -569,7 +570,7 @@ u32 armcpu_exec() #else cFetch = armcpu_prefetch(); #endif - return std::max(cFetch, cExecute); + return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); } //these templates needed to be instantiated manually diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 01ec476c7..6af9a5682 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -219,6 +219,8 @@ static bool lostFocusPause = true; static bool lastPauseFromLostFocus = false; static bool FrameLimit = true; +extern bool fastFetchExecute; // from armcpu.cpp + std::vector LuaScriptHWnds; LRESULT CALLBACK LuaScriptProc(HWND, UINT, WPARAM, LPARAM); @@ -3050,6 +3052,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM //Gray the recent ROM menu item if there are no recent ROMs DesEnableMenuItem(mainMenu, ID_FILE_RECENTROM, RecentRoms.size()>0); + DesEnableMenuItem(mainMenu, IDC_FASTFETCHEXECUTE, movieMode == MOVIEMODE_INACTIVE); + //Updated Checked menu items //Pause @@ -3121,8 +3125,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 ); - //Language selection MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, lostFocusPause); + MainWindow->checkMenu(IDC_FASTFETCHEXECUTE, fastFetchExecute); //Save type const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7}; @@ -4096,6 +4100,10 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM WritePrivateProfileInt("Focus", "BackgroundPause", (int)lostFocusPause, IniName); return 0; + case IDC_FASTFETCHEXECUTE: + fastFetchExecute = !fastFetchExecute; + return 0; + case IDC_SAVETYPE1: backup_setManualBackupType(0); return 0; case IDC_SAVETYPE2: backup_setManualBackupType(1); return 0; case IDC_SAVETYPE3: backup_setManualBackupType(2); return 0; diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index c9d37536b..00d54eedb 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -812,6 +812,7 @@ #define IDC_HKCOMBO 60077 #define IDD_KEYCUSTOM 60078 #define IDM_HOTKEY_CONFIG 60079 +#define IDC_FASTFETCHEXECUTE 60080 // Next default values for new objects // diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 7642d091eeb4da90177ebc73dc831841e27d1dbd..e7b9dfae3cb6d5ed4dd47955d277568461b8b909 100644 GIT binary patch delta 387 zcmX@MK12is23-bMh6*4rnW2=SWco)L zR{6;a?rhSI48aT`KxM8#(wV^nNJjv%Geamt$n-{i7X9Woe(i7k7=f5+`x`&zB@d`+ zLp#uh?Tz}ZKN+Vx$WYbYhV63;oQC@hU<_i02VhLA^-pY