RAM Search: fix reset code and update the current values for every addresses.
RAM Search: workaround for auto search restart.
This commit is contained in:
parent
7526131735
commit
651b5a16c2
|
@ -969,14 +969,30 @@ void CompactAddrs()
|
|||
ListView_SetItemCount(GetDlgItem(RamSearchHWnd,IDC_RAMLIST),ResultCount);
|
||||
}
|
||||
|
||||
void soft_reset_address_info (bool resetPrevValues = false)
|
||||
void soft_reset_address_info ()
|
||||
{
|
||||
/*
|
||||
if (resetPrevValues) {
|
||||
if(s_prevValues)
|
||||
memcpy(s_prevValues, s_curValues, (sizeof(*s_prevValues)*(MAX_RAM_SIZE)));
|
||||
s_prevValuesNeedUpdate = false;
|
||||
}
|
||||
}*/
|
||||
s_prevValuesNeedUpdate = false;
|
||||
ResetMemoryRegions();
|
||||
if(!RamSearchHWnd)
|
||||
{
|
||||
EnterCriticalSection(&s_activeMemoryRegionsCS);
|
||||
s_activeMemoryRegions.clear();
|
||||
LeaveCriticalSection(&s_activeMemoryRegionsCS);
|
||||
ResultCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// force s_prevValues to be valid
|
||||
signal_new_frame();
|
||||
s_prevValuesNeedUpdate = true;
|
||||
signal_new_frame();
|
||||
}
|
||||
if(s_numChanges)
|
||||
memset(s_numChanges, 0, (sizeof(*s_numChanges)*(MAX_RAM_SIZE)));
|
||||
CompactAddrs();
|
||||
|
@ -1232,6 +1248,7 @@ void Update_RAM_Search() //keeps RAM values up to date in the search and watch w
|
|||
if(disableRamSearchUpdate)
|
||||
return;
|
||||
|
||||
int prevValuesNeededUpdate;
|
||||
if (AutoSearch && !ResultCount)
|
||||
{
|
||||
if(!AutoSearchAutoRetry)
|
||||
|
@ -1247,22 +1264,25 @@ void Update_RAM_Search() //keeps RAM values up to date in the search and watch w
|
|||
AutoSearchAutoRetry = true;
|
||||
}
|
||||
reset_address_info();
|
||||
prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
||||
}
|
||||
|
||||
int prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
||||
if (RamSearchHWnd)
|
||||
else
|
||||
{
|
||||
// update active RAM values
|
||||
signal_new_frame();
|
||||
}
|
||||
prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
||||
if (RamSearchHWnd)
|
||||
{
|
||||
// update active RAM values
|
||||
signal_new_frame();
|
||||
}
|
||||
|
||||
if (AutoSearch && ResultCount)
|
||||
{
|
||||
//Clear_Sound_Buffer();
|
||||
if(!rs_val_valid)
|
||||
rs_val_valid = Set_RS_Val();
|
||||
if(rs_val_valid)
|
||||
prune(rs_c,rs_o,rs_t=='s',rs_val,rs_param);
|
||||
if (AutoSearch && ResultCount)
|
||||
{
|
||||
//Clear_Sound_Buffer();
|
||||
if(!rs_val_valid)
|
||||
rs_val_valid = Set_RS_Val();
|
||||
if(rs_val_valid)
|
||||
prune(rs_c,rs_o,rs_t=='s',rs_val,rs_param);
|
||||
}
|
||||
}
|
||||
|
||||
if(RamSearchHWnd)
|
||||
|
@ -1751,7 +1771,7 @@ LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd);
|
||||
int prevNumItems = last_rs_possible;
|
||||
|
||||
soft_reset_address_info(true);
|
||||
soft_reset_address_info();
|
||||
|
||||
if(prevNumItems == last_rs_possible)
|
||||
SetRamSearchUndoType(RamSearchHWnd, 0); // nothing to undo
|
||||
|
|
Loading…
Reference in New Issue