mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Windows: Fix mis-interaction between no-menu pause and pause on window lost focus, reported by IRVN
This commit is contained in:
1 parent
3dc46666ff
commit
63a41e7635
3 files changed
+12
-2
No files matched your search
+9
-1
@@ -81,6 +81,7 @@ volatile bool coreStatePending = false;
|
||||
|
||||
static bool powerSaving = false;
|
||||
static bool g_breakAfterFrame = false;
|
||||
static std::string g_breakReason;
|
||||
|
||||
static MIPSExceptionInfo g_exceptionInfo;
|
||||
|
||||
@@ -390,7 +391,6 @@ void Core_Break(const char *reason, u32 relatedAddress) {
|
||||
}
|
||||
|
||||
{
|
||||
// Stop the tracer
|
||||
std::lock_guard<std::mutex> lock(g_stepMutex);
|
||||
if (!g_cpuStepCommand.empty() && Core_IsStepping()) {
|
||||
// If we're in a failed step that uses a temp breakpoint, we need to be able to override it here.
|
||||
@@ -404,7 +404,11 @@ void Core_Break(const char *reason, u32 relatedAddress) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the tracer
|
||||
mipsTracer.stop_tracing();
|
||||
|
||||
g_breakReason = reason;
|
||||
g_cpuStepCommand.type = CPUStepType::None;
|
||||
g_cpuStepCommand.reason = reason;
|
||||
g_cpuStepCommand.relatedAddr = relatedAddress;
|
||||
@@ -415,6 +419,10 @@ void Core_Break(const char *reason, u32 relatedAddress) {
|
||||
System_Notify(SystemNotification::DEBUG_MODE_CHANGE);
|
||||
}
|
||||
|
||||
const std::string &Core_BreakReason() {
|
||||
return g_breakReason;
|
||||
}
|
||||
|
||||
// Free-threaded (or at least should be)
|
||||
void Core_Resume() {
|
||||
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
|
||||
|
||||
@@ -50,6 +50,8 @@ void Core_Break(const char *reason, u32 relatedAddress = 0);
|
||||
// Resumes execution. Works both when stepping the CPU and the GE.
|
||||
void Core_Resume();
|
||||
|
||||
const std::string &Core_BreakReason();
|
||||
|
||||
// This should be called externally.
|
||||
// Can fail if another step type was requested this frame.
|
||||
bool Core_RequestCPUStep(CPUStepType stepType, int stepSize);
|
||||
|
||||
@@ -906,7 +906,7 @@ namespace MainWindow
|
||||
} else {
|
||||
if (pause) {
|
||||
Core_Break("ui.lost_focus", 0);
|
||||
} else {
|
||||
} else if (Core_BreakReason() == "ui.lost_focus") {
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user