mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 05:17:44 -07:00
Merge pull request #13172 from deReeperJosh/superchargersfix
IOS/USB: Reconnect HIDv4 Devices after shutdown
This commit is contained in:
commit
7e1074b140
@ -96,10 +96,11 @@ std::optional<IPCReply> USB_HIDv4::GetDeviceChange(const IOCtlRequest& request)
|
||||
m_devicechange_hook_request = std::make_unique<IOCtlRequest>(GetSystem(), request.address);
|
||||
// If there are pending changes, the reply is sent immediately (instead of on device
|
||||
// insertion/removal).
|
||||
if (m_has_pending_changes)
|
||||
if (m_has_pending_changes || m_is_shut_down)
|
||||
{
|
||||
TriggerDeviceChangeReply();
|
||||
m_has_pending_changes = false;
|
||||
m_is_shut_down = false;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
@ -114,6 +115,7 @@ IPCReply USB_HIDv4::Shutdown(const IOCtlRequest& request)
|
||||
memory.Write_U32(0xffffffff, m_devicechange_hook_request->buffer_out);
|
||||
GetEmulationKernel().EnqueueIPCReply(*m_devicechange_hook_request, -1);
|
||||
m_devicechange_hook_request.reset();
|
||||
m_is_shut_down = true;
|
||||
}
|
||||
return IPCReply(IPC_SUCCESS);
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ private:
|
||||
static constexpr u8 HID_CLASS = 0x03;
|
||||
|
||||
bool m_has_pending_changes = true;
|
||||
bool m_is_shut_down = false;
|
||||
std::mutex m_devicechange_hook_address_mutex;
|
||||
std::unique_ptr<IOCtlRequest> m_devicechange_hook_request;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user