Skip to content

Commit

Permalink
Debugger: Allow screensaver/sleep to turn on when paused while debug …
Browse files Browse the repository at this point in the history
…tools are opened
  • Loading branch information
SourMesen committed Nov 30, 2024
1 parent 9b4905a commit 403fe08
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Core/Debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@
#include "Shared/BaseState.h"
#include "Shared/Emulator.h"
#include "Shared/Interfaces/IConsole.h"
#include "Shared/MemoryOperationType.h"
#include "Shared/EventType.h"
#include "Utilities/HexUtilities.h"
#include "Utilities/FolderUtilities.h"
#include "Utilities/Patches/IpsPatcher.h"
#include "Shared/MemoryOperationType.h"
#include "Shared/EventType.h"
#include "Utilities/PlatformUtilities.h"

uint64_t ITraceLogger::NextRowId = 0;

Expand Down Expand Up @@ -495,13 +496,15 @@ void Debugger::SleepUntilResume(CpuType sourceCpu, BreakSource source, MemoryOpe
_emu->GetNotificationManager()->SendNotification(ConsoleNotificationType::CodeBreak, &evt);
ProcessEvent(EventType::CodeBreak, sourceCpu);
notificationSent = true;
PlatformUtilities::EnableScreensaver();
}

while((_waitForBreakResume && !_suspendRequestCount) || _breakRequestCount) {
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(_breakRequestCount ? 1 : 10));
}

if(notificationSent) {
PlatformUtilities::DisableScreensaver();
_emu->GetNotificationManager()->SendNotification(ConsoleNotificationType::DebuggerResumed);
}

Expand Down

0 comments on commit 403fe08

Please sign in to comment.