Merge pull request #4545 from leoetlino/stop-recording
Stop Movie/Netplay before triggering STM shutdown
This commit is contained in:
commit
abfa297166
|
@ -90,6 +90,7 @@ public:
|
|||
|
||||
void DoPause();
|
||||
void DoStop();
|
||||
bool TriggerSTMPowerEvent();
|
||||
void OnStopped();
|
||||
void DoRecordingSave();
|
||||
void UpdateGUI();
|
||||
|
|
|
@ -824,20 +824,6 @@ void CFrame::DoStop()
|
|||
}
|
||||
}
|
||||
|
||||
const auto& stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
|
||||
if (!m_tried_graceful_shutdown && stm &&
|
||||
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->HasHookInstalled())
|
||||
{
|
||||
Core::DisplayMessage("Shutting down", 30000);
|
||||
// Unpause because gracefully shutting down needs the game to actually request a shutdown
|
||||
if (Core::GetState() == Core::CORE_PAUSE)
|
||||
DoPause();
|
||||
ProcessorInterface::PowerButton_Tap();
|
||||
m_confirmStop = false;
|
||||
m_tried_graceful_shutdown = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (UseDebugger && g_pCodeWindow)
|
||||
{
|
||||
if (g_pCodeWindow->HasPanel<CWatchWindow>())
|
||||
|
@ -862,11 +848,31 @@ void CFrame::DoStop()
|
|||
if (NetPlayDialog::GetNetPlayClient())
|
||||
NetPlayDialog::GetNetPlayClient()->Stop();
|
||||
|
||||
if (!m_tried_graceful_shutdown && TriggerSTMPowerEvent())
|
||||
{
|
||||
m_tried_graceful_shutdown = true;
|
||||
return;
|
||||
}
|
||||
Core::Stop();
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
bool CFrame::TriggerSTMPowerEvent()
|
||||
{
|
||||
const auto stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
|
||||
if (!stm || !std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->HasHookInstalled())
|
||||
return false;
|
||||
|
||||
Core::DisplayMessage("Shutting down", 30000);
|
||||
// Unpause because gracefully shutting down needs the game to actually request a shutdown
|
||||
if (Core::GetState() == Core::CORE_PAUSE)
|
||||
DoPause();
|
||||
ProcessorInterface::PowerButton_Tap();
|
||||
m_confirmStop = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CFrame::OnStopped()
|
||||
{
|
||||
m_confirmStop = false;
|
||||
|
|
Loading…
Reference in New Issue