mirror of
https://github.com/libretro/Mesen.git
synced 2025-02-07 17:46:45 +00:00
Debugger: Fixed hex editor highlight issues (when loading save state, etc.)
This commit is contained in:
parent
9e032b772f
commit
67b9a5c707
@ -296,6 +296,7 @@ void Console::ResetComponents(bool softReset)
|
||||
if(softReset) {
|
||||
shared_ptr<Debugger> debugger = _debugger;
|
||||
if(debugger) {
|
||||
debugger->ResetCounters();
|
||||
debugger->ProcessEvent(EventType::Reset);
|
||||
}
|
||||
}
|
||||
@ -496,7 +497,7 @@ bool Console::IsRunning()
|
||||
|
||||
bool Console::IsPaused()
|
||||
{
|
||||
return _runLock.IsFree();
|
||||
return _runLock.IsFree() || !_pauseLock.IsFree();
|
||||
}
|
||||
|
||||
void Console::UpdateNesModel(bool sendNotification)
|
||||
@ -589,6 +590,11 @@ void Console::LoadState(istream &loadStream)
|
||||
Snapshotable::SkipBlock(&loadStream);
|
||||
}
|
||||
|
||||
shared_ptr<Debugger> debugger = Instance->_debugger;
|
||||
if(debugger) {
|
||||
debugger->ResetCounters();
|
||||
}
|
||||
|
||||
MessageManager::SendNotification(ConsoleNotificationType::StateLoaded);
|
||||
}
|
||||
}
|
||||
|
@ -1084,6 +1084,12 @@ const char* Debugger::GetScriptLog(int32_t scriptId)
|
||||
return "";
|
||||
}
|
||||
|
||||
void Debugger::ResetCounters()
|
||||
{
|
||||
_memoryAccessCounter->ResetCounts();
|
||||
_profiler->Reset();
|
||||
}
|
||||
|
||||
void Debugger::ProcessScriptSaveState(uint16_t &addr, uint8_t &value)
|
||||
{
|
||||
if(_hasScript) {
|
||||
|
@ -227,6 +227,8 @@ public:
|
||||
void RemoveScript(int32_t scriptId);
|
||||
const char* GetScriptLog(int32_t scriptId);
|
||||
|
||||
void ResetCounters();
|
||||
|
||||
void ProcessScriptSaveState(uint16_t &addr, uint8_t &value);
|
||||
void ProcessCpuOperation(uint16_t addr, uint8_t &value, MemoryOperationType type);
|
||||
void ProcessPpuOperation(uint16_t addr, uint8_t &value, MemoryOperationType type);
|
||||
|
@ -65,6 +65,10 @@ void MemoryAccessCounter::ResetCounts()
|
||||
memset(_readCounts[i].data(), 0, _readCounts[i].size() * sizeof(uint32_t));
|
||||
memset(_writeCounts[i].data(), 0, _writeCounts[i].size() * sizeof(uint32_t));
|
||||
memset(_execCounts[i].data(), 0, _execCounts[i].size() * sizeof(uint32_t));
|
||||
|
||||
memset(_readStamps[i].data(), 0, _readStamps[i].size() * sizeof(uint32_t));
|
||||
memset(_writeStamps[i].data(), 0, _writeStamps[i].size() * sizeof(uint32_t));
|
||||
memset(_execStamps[i].data(), 0, _execStamps[i].size() * sizeof(uint32_t));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,11 +89,11 @@ namespace Mesen.GUI.Debugger
|
||||
|
||||
if(_freezeState != null && _freezeState[index]) {
|
||||
return Color.Magenta;
|
||||
} else if(_showExec && _execStamps[index] != 0 && (framesSinceExec < _framesToFade || _framesToFade == 0)) {
|
||||
} else if(_showExec && _execStamps[index] != 0 && framesSinceExec >= 0 && (framesSinceExec < _framesToFade || _framesToFade == 0)) {
|
||||
return Color.FromArgb(alpha, DarkerColor(Color.Green, (_framesToFade - framesSinceExec) / _framesToFade));
|
||||
} else if(_showWrite && _writeStamps[index] != 0 && (framesSinceWrite < _framesToFade || _framesToFade == 0)) {
|
||||
} else if(_showWrite && _writeStamps[index] != 0 && framesSinceWrite >= 0 && (framesSinceWrite < _framesToFade || _framesToFade == 0)) {
|
||||
return Color.FromArgb(alpha, DarkerColor(Color.Red, (_framesToFade - framesSinceWrite) / _framesToFade));
|
||||
} else if(_showRead && _readStamps[index] != 0 && (framesSinceRead < _framesToFade || _framesToFade == 0)) {
|
||||
} else if(_showRead && _readStamps[index] != 0 && framesSinceRead >= 0 && (framesSinceRead < _framesToFade || _framesToFade == 0)) {
|
||||
return Color.FromArgb(alpha, DarkerColor(Color.Blue, (_framesToFade - framesSinceRead) / _framesToFade));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user