Merge pull request #2745 from AdmiralCurtiss/wiimote-disconnect-message

Display a message on screen when the emulated software disconnects a Wiimote.
This commit is contained in:
Markus Wick 2015-12-02 15:13:29 +01:00
commit 1c95cd5ad5
2 changed files with 10 additions and 0 deletions

View File

@ -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); DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDiscon->reason);
Host_SetWiiMoteConnectionState(0); Host_SetWiiMoteConnectionState(0);
DisplayDisconnectMessage((pDiscon->con_handle & 0xFF) + 1, pDiscon->reason);
SendEventCommandStatus(HCI_CMD_DISCONNECT); SendEventCommandStatus(HCI_CMD_DISCONNECT);
SendEventDisconnect(pDiscon->con_handle, pDiscon->reason); 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; 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) void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey)
{ {
DEBUG_LOG(WII_IPC_WIIMOTE, " link key: " DEBUG_LOG(WII_IPC_WIIMOTE, " link key: "

View File

@ -265,6 +265,8 @@ private:
void CommandVendorSpecific_FC4C(u8* _Input, u32 _Size); void CommandVendorSpecific_FC4C(u8* _Input, u32 _Size);
void CommandVendorSpecific_FC4F(u8* _Input, u32 _Size); void CommandVendorSpecific_FC4F(u8* _Input, u32 _Size);
static void DisplayDisconnectMessage(const int wiimoteNumber, const int reason);
// Debugging // Debugging
void LOG_LinkKey(const u8* _pLinkKey); void LOG_LinkKey(const u8* _pLinkKey);