From 40d58e14fc310081980efa73bced88728a88078f Mon Sep 17 00:00:00 2001 From: gocha Date: Sun, 16 May 2010 08:40:45 +0000 Subject: [PATCH] RAM Search: fix reset to update previous values RAM Search: redraw the list when search size/format is changed. Probably those are common bugs of the Gens-style RAM search dialog. --- desmume/src/windows/ram_search.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/desmume/src/windows/ram_search.cpp b/desmume/src/windows/ram_search.cpp index fed54396a..627054245 100644 --- a/desmume/src/windows/ram_search.cpp +++ b/desmume/src/windows/ram_search.cpp @@ -997,8 +997,12 @@ void CompactAddrs() ListView_SetItemCount(GetDlgItem(RamSearchHWnd,IDC_RAMLIST),ResultCount); } -void soft_reset_address_info () +void soft_reset_address_info (bool resetPrevValues = false) { + if (resetPrevValues) { + memcpy(buffers->s_prevValues, buffers->s_curValues, sizeof(buffers->s_prevValues)); + s_prevValuesNeedUpdate = false; + } ResetMemoryRegions(); memset(buffers->s_numChanges, 0, sizeof(buffers->s_numChanges)); CompactAddrs(); @@ -1150,6 +1154,7 @@ void signal_new_size () { ListView_Update(lv, -1); } + InvalidateRect(lv, NULL, TRUE); } @@ -1698,7 +1703,7 @@ LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd); int prevNumItems = last_rs_possible; - soft_reset_address_info(); + soft_reset_address_info(true); if(prevNumItems == last_rs_possible) SetRamSearchUndoType(RamSearchHWnd, 0); // nothing to undo