diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index 8e857c47b3..46ebb9a8cf 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -1305,6 +1305,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDisconnect(u8* _Input) DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDiscon->reason); Host_SetWiiMoteConnectionState(0); + DisplayDisconnectMessage((pDiscon->con_handle & 0xFF) + 1, pDiscon->reason); SendEventCommandStatus(HCI_CMD_DISCONNECT); SendEventDisconnect(pDiscon->con_handle, pDiscon->reason); @@ -1874,6 +1875,13 @@ CWII_IPC_HLE_WiiMote* CWII_IPC_HLE_Device_usb_oh1_57e_305::AccessWiiMote(u16 _Co return nullptr; } +void CWII_IPC_HLE_Device_usb_oh1_57e_305::DisplayDisconnectMessage(const int wiimoteNumber, const int reason) +{ + // TODO: If someone wants to be fancy we could also figure out what the values for pDiscon->reason mean + // and display things like "Wiimote %i disconnected due to inactivity!" etc. + Core::DisplayMessage(StringFromFormat(_trans("Wiimote %i disconnected by emulated software"), wiimoteNumber), 3000); +} + void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey) { DEBUG_LOG(WII_IPC_WIIMOTE, " link key: " diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h index cd8c7446b6..538e8a48a8 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h @@ -265,6 +265,8 @@ private: void CommandVendorSpecific_FC4C(u8* _Input, u32 _Size); void CommandVendorSpecific_FC4F(u8* _Input, u32 _Size); + static void DisplayDisconnectMessage(const int wiimoteNumber, const int reason); + // Debugging void LOG_LinkKey(const u8* _pLinkKey);