RAM Search: fix reset code and update the current values for every addresses.
RAM Search: workaround for auto search restart. As usual, I need to apply the same fix to every emulators, that uses the same RAM Search code.
This commit is contained in:
parent
9f31c63d7a
commit
9faea35458
|
@ -997,13 +997,22 @@ void CompactAddrs()
|
||||||
ListView_SetItemCount(GetDlgItem(RamSearchHWnd,IDC_RAMLIST),ResultCount);
|
ListView_SetItemCount(GetDlgItem(RamSearchHWnd,IDC_RAMLIST),ResultCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void soft_reset_address_info (bool resetPrevValues = false)
|
void soft_reset_address_info ()
|
||||||
{
|
{
|
||||||
if (resetPrevValues) {
|
s_prevValuesNeedUpdate = false;
|
||||||
memcpy(buffers->s_prevValues, buffers->s_curValues, sizeof(buffers->s_prevValues));
|
|
||||||
s_prevValuesNeedUpdate = false;
|
|
||||||
}
|
|
||||||
ResetMemoryRegions();
|
ResetMemoryRegions();
|
||||||
|
if(!RamSearchHWnd)
|
||||||
|
{
|
||||||
|
s_activeMemoryRegions.clear();
|
||||||
|
ResultCount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// force s_prevValues to be valid
|
||||||
|
signal_new_frame();
|
||||||
|
s_prevValuesNeedUpdate = true;
|
||||||
|
signal_new_frame();
|
||||||
|
}
|
||||||
memset(buffers->s_numChanges, 0, sizeof(buffers->s_numChanges));
|
memset(buffers->s_numChanges, 0, sizeof(buffers->s_numChanges));
|
||||||
CompactAddrs();
|
CompactAddrs();
|
||||||
}
|
}
|
||||||
|
@ -1202,6 +1211,7 @@ void Update_RAM_Search() //keeps RAM values up to date in the search and watch w
|
||||||
// if(disableRamSearchUpdate)
|
// if(disableRamSearchUpdate)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
|
int prevValuesNeededUpdate;
|
||||||
if (AutoSearch && !ResultCount)
|
if (AutoSearch && !ResultCount)
|
||||||
{
|
{
|
||||||
if(!AutoSearchAutoRetry)
|
if(!AutoSearchAutoRetry)
|
||||||
|
@ -1217,22 +1227,25 @@ void Update_RAM_Search() //keeps RAM values up to date in the search and watch w
|
||||||
AutoSearchAutoRetry = true;
|
AutoSearchAutoRetry = true;
|
||||||
}
|
}
|
||||||
reset_address_info();
|
reset_address_info();
|
||||||
|
prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
int prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
|
||||||
if (RamSearchHWnd)
|
|
||||||
{
|
{
|
||||||
// update active RAM values
|
prevValuesNeededUpdate = s_prevValuesNeedUpdate;
|
||||||
signal_new_frame();
|
if (RamSearchHWnd)
|
||||||
}
|
{
|
||||||
|
// update active RAM values
|
||||||
|
signal_new_frame();
|
||||||
|
}
|
||||||
|
|
||||||
if (AutoSearch && ResultCount)
|
if (AutoSearch && ResultCount)
|
||||||
{
|
{
|
||||||
//Clear_Sound_Buffer();
|
//Clear_Sound_Buffer();
|
||||||
if(!rs_val_valid)
|
if(!rs_val_valid)
|
||||||
rs_val_valid = Set_RS_Val();
|
rs_val_valid = Set_RS_Val();
|
||||||
if(rs_val_valid)
|
if(rs_val_valid)
|
||||||
prune(rs_c,rs_o,rs_t=='s',rs_val,rs_param);
|
prune(rs_c,rs_o,rs_t=='s',rs_val,rs_param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RamSearchHWnd)
|
if(RamSearchHWnd)
|
||||||
|
@ -1703,7 +1716,7 @@ LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd);
|
RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd);
|
||||||
int prevNumItems = last_rs_possible;
|
int prevNumItems = last_rs_possible;
|
||||||
|
|
||||||
soft_reset_address_info(true);
|
soft_reset_address_info();
|
||||||
|
|
||||||
if(prevNumItems == last_rs_possible)
|
if(prevNumItems == last_rs_possible)
|
||||||
SetRamSearchUndoType(RamSearchHWnd, 0); // nothing to undo
|
SetRamSearchUndoType(RamSearchHWnd, 0); // nothing to undo
|
||||||
|
|
Loading…
Reference in New Issue