summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index ef08e6b721..6e4b2831c3 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -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;