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.
This commit is contained in:
gocha 2010-05-16 08:40:45 +00:00
parent b6d3c26b2b
commit 40d58e14fc
1 changed files with 7 additions and 2 deletions

View File

@ -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