Display a message on screen when the emulated software disconnects a Wiimote.

This commit is contained in:
Admiral H. Curtiss 2015-07-16 04:36:42 +02:00
parent c0f80ca524
commit e473ebc2e3
2 changed files with 10 additions and 0 deletions

View File

@ -1308,6 +1308,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);
@ -1877,6 +1878,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: "

View File

@ -267,6 +267,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);