From ffb708a23e035d41fd27ff0bc03559370215f745 Mon Sep 17 00:00:00 2001 From: gocha Date: Sun, 16 May 2010 10:26:11 +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. --- src/drivers/win/ram_search.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/drivers/win/ram_search.cpp b/src/drivers/win/ram_search.cpp index 3b63b2d1..19ff0de8 100644 --- a/src/drivers/win/ram_search.cpp +++ b/src/drivers/win/ram_search.cpp @@ -968,8 +968,13 @@ void CompactAddrs() ListView_SetItemCount(GetDlgItem(RamSearchHWnd,IDC_RAMLIST),ResultCount); } -void soft_reset_address_info () +void soft_reset_address_info (bool resetPrevValues = false) { + if (resetPrevValues) { + if(s_prevValues) + memcpy(s_prevValues, s_curValues, (sizeof(*s_prevValues)*(MAX_RAM_SIZE))); + s_prevValuesNeedUpdate = false; + } ResetMemoryRegions(); if(s_numChanges) memset(s_numChanges, 0, (sizeof(*s_numChanges)*(MAX_RAM_SIZE))); @@ -1185,6 +1190,7 @@ void signal_new_size () { ListView_Update(lv, -1); } + InvalidateRect(lv, NULL, TRUE); } @@ -1743,7 +1749,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