Prevent two titles emulating at same time.

This will help producing false postive report and inform user to stop current title emulating before start new emulation.
This commit is contained in:
RadWolfie 2018-06-10 10:24:15 -05:00
parent 71a542d790
commit 7bd449c171
1 changed files with 12 additions and 0 deletions

View File

@ -2188,6 +2188,17 @@ void WndMain::SaveXbeAs()
void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState /*= debuggerOff*/) void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState /*= debuggerOff*/)
{ {
char szBuffer[MAX_PATH]; char szBuffer[MAX_PATH];
bool isEmulating = false;
g_EmuShared->GetIsEmulating(&isEmulating);
if (isEmulating) {
MessageBox(m_hwnd, "A title is currently emulating, please stop emulation before attempt start again.",
"Cxbx-Reloaded", MB_ICONERROR | MB_OK);
return;
}
g_EmuShared->SetIsEmulating(true);
// register xbe path with emulator process // register xbe path with emulator process
g_EmuShared->SetXbePath(m_Xbe->m_szPath); g_EmuShared->SetXbePath(m_Xbe->m_szPath);
@ -2288,6 +2299,7 @@ void WndMain::StopEmulation()
RefreshMenus(); RefreshMenus();
// Set the window size back to it's GUI dimensions // Set the window size back to it's GUI dimensions
ResizeWindow(m_hwnd, /*bForGUI=*/true); ResizeWindow(m_hwnd, /*bForGUI=*/true);
g_EmuShared->SetIsEmulating(false);
} }
// wrapper function to call CrashMonitor // wrapper function to call CrashMonitor