fix false positive emulation is either still running or stopped

This commit is contained in:
RadWolfie 2023-02-10 06:59:16 -06:00
parent 0b695637ce
commit f4488c0270
2 changed files with 16 additions and 19 deletions

View File

@ -583,6 +583,7 @@ XBSYSAPI EXPORTNUM(49) xbox::void_xt DECLSPEC_NORETURN NTAPI xbox::HalReturnToFi
case ReturnFirmwareFatal: case ReturnFirmwareFatal:
{ {
xbox::HalWriteSMBusValue(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, SMC_COMMAND_SCRATCH, 0, SMC_SCRATCH_DISPLAY_FATAL_ERROR); xbox::HalWriteSMBusValue(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, SMC_COMMAND_SCRATCH, 0, SMC_SCRATCH_DISPLAY_FATAL_ERROR);
is_reboot = true;
g_VMManager.SavePersistentMemory(); g_VMManager.SavePersistentMemory();

View File

@ -2331,29 +2331,25 @@ void WndMain::CrashMonitor(DWORD dwChildProcID)
HANDLE hProcess = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, FALSE, dwChildProcID); HANDLE hProcess = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, FALSE, dwChildProcID);
// If we do receive valid handle, let's do the next step. // If we do receive valid handle, let's do the next step.
if (hProcess != NULL) { if (hProcess != NULL) {
WaitForSingleObject(hProcess, INFINITE); WaitForSingleObject(hProcess, INFINITE);
GetExitCodeProcess(hProcess, &dwExitCode); GetExitCodeProcess(hProcess, &dwExitCode);
CloseHandle(hProcess); CloseHandle(hProcess);
g_EmuShared->GetBootFlags(&iBootFlags); g_EmuShared->GetBootFlags(&iBootFlags);
if (!iBootFlags) { // Check if reboot did occur.
if (dwExitCode == EXIT_SUCCESS) {// StopEmulation if (iBootFlags) {
return; // Destroy this thread and start a new one
} // since emulation is still running.
// Or else, it's a crash return;
} }
else { // Otherwise emulation did stopped or crashed
// But need to tell GUI that emulation did end.
// multi-xbe }
// destroy this thread and start a new one
return;
}
}
} }
// Crash clean up. // Crash clean up.