Merge pull request #4302 from leoetlino/graceful-fixes
Minor fixes to graceful shutdown
This commit is contained in:
commit
ce5c8c28b2
|
@ -135,6 +135,11 @@ IPCCommandResult CWII_IPC_HLE_Device_stm_eventhook::IOCtl(u32 command_address)
|
|||
return GetNoReply();
|
||||
}
|
||||
|
||||
bool CWII_IPC_HLE_Device_stm_eventhook::HasHookInstalled() const
|
||||
{
|
||||
return s_event_hook_address != 0;
|
||||
}
|
||||
|
||||
void CWII_IPC_HLE_Device_stm_eventhook::TriggerEvent(const u32 event) const
|
||||
{
|
||||
if (!m_Active || s_event_hook_address == 0)
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
IPCCommandResult Close(u32 command_address, bool force) override;
|
||||
IPCCommandResult IOCtl(u32 command_address) override;
|
||||
|
||||
bool HasHookInstalled() const;
|
||||
void ResetButton() const;
|
||||
void PowerButton() const;
|
||||
|
||||
|
|
|
@ -615,8 +615,7 @@ void CFrame::OnClose(wxCloseEvent& event)
|
|||
event.Veto();
|
||||
}
|
||||
// Tell OnStopped to resubmit the Close event
|
||||
if (m_confirmStop)
|
||||
m_bClosing = true;
|
||||
m_bClosing = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1714,5 +1713,6 @@ void CFrame::HandleSignal(wxTimerEvent& event)
|
|||
{
|
||||
if (!s_shutdown_signal_received.TestAndClear())
|
||||
return;
|
||||
m_bClosing = true;
|
||||
Close();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/HotkeyManager.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_stm.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h"
|
||||
#include "Core/Movie.h"
|
||||
|
@ -1341,10 +1343,14 @@ void CFrame::DoStop()
|
|||
}
|
||||
}
|
||||
|
||||
if (SConfig::GetInstance().bWii && !m_tried_graceful_shutdown)
|
||||
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);
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
// 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;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "Core/Core.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_stm.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h"
|
||||
#include "Core/State.h"
|
||||
|
@ -232,7 +234,9 @@ class PlatformX11 : public Platform
|
|||
{
|
||||
if (s_shutdown_requested.TestAndClear())
|
||||
{
|
||||
if (!s_tried_graceful_shutdown.IsSet() && SConfig::GetInstance().bWii)
|
||||
const auto& stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
|
||||
if (!s_tried_graceful_shutdown.IsSet() && stm &&
|
||||
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->HasHookInstalled())
|
||||
{
|
||||
ProcessorInterface::PowerButton_Tap();
|
||||
s_tried_graceful_shutdown.Set();
|
||||
|
|
Loading…
Reference in New Issue