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.
This commit is contained in:
Léo Lam committed 2016-10-15 22:28:07 +02:00
1 parent 48ff76d495
commit a0a246bf3e
4 files changed
+16 -2

No files matched your search

@@ -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;