summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2016-10-04 22:58:01 +0200
committerLéo Lam <leo@innovatetechnologi.es>2016-10-15 22:28:07 +0200
commita0a246bf3e33eac9fd4d234590c721d972979bc7 (patch)
tree72ffc4a4622cbdbd1b9f51ef0de9df8530f21343 /Source/Core/DolphinWX/FrameTools.cpp
parent48ff76d495949219474254b62388f1b83ddbf5c1 (diff)
Only attempt a graceful shutdown when there's a STM hook
For Wii graceful shutdown to work, the emulated software has to open the STM event hook and install a hook. Without this, there is no way to inform them about the shutdown, so trying to do a graceful shutdown and requiring the use of the shutdown fallback (exiting a second time to force) is pointless.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index 7da392e2b4..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,7 +1343,9 @@ 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);
// Unpause because gracefully shutting down needs the game to actually request a shutdown