From 147512c112d06f33f26458ade5efc5b91bc05790 Mon Sep 17 00:00:00 2001 From: gocha Date: Sat, 21 Jul 2012 11:56:28 +0900 Subject: [PATCH] win32: fix RAM Autosearch function which has been broken by the last commit. --- win32/ram_search.cpp | 8 +++++--- win32/ram_search.h | 2 +- win32/wsnes9x.cpp | 6 +++--- win32/wsnes9x.h | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/win32/ram_search.cpp b/win32/ram_search.cpp index 53224172..af5428fd 100644 --- a/win32/ram_search.cpp +++ b/win32/ram_search.cpp @@ -1277,13 +1277,15 @@ LRESULT CustomDraw (LPARAM lParam) return CDRF_DODEFAULT; } -void Update_RAM_Search() //keeps RAM values up to date in the search and watch windows +void Update_RAM_Search(bool DoAutoSearch) //keeps RAM values up to date in the search and watch windows { + DoAutoSearch &= AutoSearch; + if(disableRamSearchUpdate) return; int prevValuesNeededUpdate; - if (AutoSearch && !ResultCount) + if (DoAutoSearch && !ResultCount) { if(!AutoSearchAutoRetry) { @@ -1309,7 +1311,7 @@ void Update_RAM_Search() //keeps RAM values up to date in the search and watch w signal_new_frame(); } - if (AutoSearch && ResultCount) + if (DoAutoSearch && ResultCount) { //Clear_Sound_Buffer(); if(!rs_val_valid) diff --git a/win32/ram_search.h b/win32/ram_search.h index fe2c5b73..c5184b21 100644 --- a/win32/ram_search.h +++ b/win32/ram_search.h @@ -29,7 +29,7 @@ extern HWND RamSearchHWnd; void ResetResults(); void CloseRamWindows(); //Close the Ram Search & Watch windows when rom closes void ReopenRamWindows(); //Reopen them when a new Rom is loaded -void Update_RAM_Search(); //keeps RAM values up to date in the search and watch windows +void Update_RAM_Search(bool DoAutoSearch); //keeps RAM values up to date in the search and watch windows #define RW_VIRTUAL_ADDR_SHIFT 24 diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 2208d43d..a2319b3e 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -3514,7 +3514,7 @@ int WINAPI WinMain( } S9xMainLoop(); - UpdateToolWindows(); + UpdateToolWindows(true); GUI.FrameCount++; } @@ -3589,9 +3589,9 @@ loop_exit: return msg.wParam; } -void UpdateToolWindows() +void UpdateToolWindows(bool frameAdvance) { - Update_RAM_Search(); //Update_RAM_Watch() is also called + Update_RAM_Search(frameAdvance); //Update_RAM_Watch() is also called RefreshAllToolWindows(); } diff --git a/win32/wsnes9x.h b/win32/wsnes9x.h index 3023d1fd..0e0e6e53 100644 --- a/win32/wsnes9x.h +++ b/win32/wsnes9x.h @@ -612,6 +612,6 @@ bool GetFilterHiResSupport(RenderFilter filterID); const TCHAR * S9xGetDirectoryT (enum s9x_getdirtype); RECT GetWindowMargins(HWND hwnd, UINT width); -void UpdateToolWindows(); +void UpdateToolWindows(bool frameAdvance = false); #endif // !defined(SNES9X_H_INCLUDED)