added status of the wiimote to the statusbar

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1014 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2008-10-30 12:57:35 +00:00
parent 34d408b860
commit d378b9d31f
6 changed files with 36 additions and 7 deletions

View File

@ -51,5 +51,6 @@ void Host_SetWaitCursor(bool enable);
void Host_UpdateStatusBar(const char* _pText); void Host_UpdateStatusBar(const char* _pText);
void Host_SysMessage(const char *fmt, ...); void Host_SysMessage(const char *fmt, ...);
void Host_SetWiiMoteConnectionState(int _State);
#endif #endif

View File

@ -19,6 +19,7 @@
#include "../Plugins/Plugin_Wiimote.h" #include "../Plugins/Plugin_Wiimote.h"
#include "../Debugger/Debugger_SymbolMap.h" #include "../Debugger/Debugger_SymbolMap.h"
#include "../Host.h"
// ugly hacks for "SendEventNumberOfCompletedPackets" // ugly hacks for "SendEventNumberOfCompletedPackets"
int g_HCICount = 0; int g_HCICount = 0;
@ -51,6 +52,8 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
m_ClassOfDevice[2] = 0x00; m_ClassOfDevice[2] = 0x00;
memset(m_LocalName, 0, HCI_UNIT_NAME_SIZE); memset(m_LocalName, 0, HCI_UNIT_NAME_SIZE);
Host_SetWiiMoteConnectionState(0);
} }
CWII_IPC_HLE_Device_usb_oh1_57e_305::~CWII_IPC_HLE_Device_usb_oh1_57e_305() CWII_IPC_HLE_Device_usb_oh1_57e_305::~CWII_IPC_HLE_Device_usb_oh1_57e_305()
@ -333,6 +336,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
{ {
if (m_WiiMotes[i].EventPagingChanged(2)) if (m_WiiMotes[i].EventPagingChanged(2))
{ {
Host_SetWiiMoteConnectionState(1);
SendEventRequestConnection(m_WiiMotes[i]); SendEventRequestConnection(m_WiiMotes[i]);
} }
} }
@ -1193,7 +1197,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input)
LOG(WIIMOTE, " num_keys_read: %i", Reply.num_keys_read); LOG(WIIMOTE, " num_keys_read: %i", Reply.num_keys_read);
// generate link key // generate link key
for (int i=0; i<m_WiiMotes.size(); i++) for (size_t i=0; i<m_WiiMotes.size(); i++)
{ {
SendEventLinkKeyNotification(m_WiiMotes[i]); SendEventLinkKeyNotification(m_WiiMotes[i]);
} }

View File

@ -19,6 +19,7 @@
#include "WII_IPC_HLE_WiiMote.h" #include "WII_IPC_HLE_WiiMote.h"
#include "../Plugins/Plugin_Wiimote.h" #include "../Plugins/Plugin_Wiimote.h"
#include "../Host.h"
#include "WII_IPC_HLE_Device_usb.h" #include "WII_IPC_HLE_Device_usb.h"
@ -147,8 +148,6 @@ CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305*
, m_HIDControlChannel_ConfigWait(false) , m_HIDControlChannel_ConfigWait(false)
, m_HIDInterruptChannel_ConnectedWait(false) , m_HIDInterruptChannel_ConnectedWait(false)
, m_HIDInterruptChannel_ConfigWait(false) , m_HIDInterruptChannel_ConfigWait(false)
, m_HIDInterruptChannelHost_Config(false)
, m_HIDControlChannelHost_Config(false)
{ {
s_Usb = _pHost; s_Usb = _pHost;
LOG(WIIMOTE, "Wiimote %i constructed", _Number); LOG(WIIMOTE, "Wiimote %i constructed", _Number);
@ -931,6 +930,9 @@ void CWII_IPC_HLE_WiiMote::SendL2capData(u16 scid, const void* _pData, u32 _Size
//send //send
m_pHost->SendACLFrame(GetConnectionHandle(), DataFrame, Offset); m_pHost->SendACLFrame(GetConnectionHandle(), DataFrame, Offset);
//
Host_SetWiiMoteConnectionState(2);
} }

View File

@ -127,12 +127,10 @@ private:
bool m_HIDControlChannel_Connected; bool m_HIDControlChannel_Connected;
bool m_HIDControlChannel_ConnectedWait; bool m_HIDControlChannel_ConnectedWait;
bool m_HIDControlChannel_Config; bool m_HIDControlChannel_Config;
bool m_HIDControlChannelHost_Config;
bool m_HIDControlChannel_ConfigWait; bool m_HIDControlChannel_ConfigWait;
bool m_HIDInterruptChannel_Connected; bool m_HIDInterruptChannel_Connected;
bool m_HIDInterruptChannel_ConnectedWait; bool m_HIDInterruptChannel_ConnectedWait;
bool m_HIDInterruptChannel_Config; bool m_HIDInterruptChannel_Config;
bool m_HIDInterruptChannelHost_Config;
bool m_HIDInterruptChannel_ConfigWait; bool m_HIDInterruptChannel_ConfigWait;

View File

@ -146,7 +146,9 @@ CFrame::CFrame(wxFrame* parent,
SetIcon(IconTemp); SetIcon(IconTemp);
// Give it a status line // Give it a status line
m_pStatusBar = CreateStatusBar(); m_pStatusBar = CreateStatusBar(2);
int StylesField[] = {wxSB_FLAT, wxSB_FLAT};
m_pStatusBar->SetStatusStyles(2, StylesField);
CreateMenu(); CreateMenu();
// This panel is the parent for rendering and it holds the gamelistctrl // This panel is the parent for rendering and it holds the gamelistctrl
@ -541,7 +543,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
case IDM_UPDATESTATUSBAR: case IDM_UPDATESTATUSBAR:
if (m_pStatusBar != NULL) if (m_pStatusBar != NULL)
{ {
m_pStatusBar->SetStatusText(event.GetString()); m_pStatusBar->SetStatusText(event.GetString(), event.GetInt());
} }
break; break;
} }

View File

@ -302,6 +302,7 @@ void Host_UpdateStatusBar(const char* _pText)
{ {
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR);
event.SetString(wxString::FromAscii(_pText)); event.SetString(wxString::FromAscii(_pText));
event.SetInt(0);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
} }
@ -318,3 +319,24 @@ void Host_SysMessage(const char *fmt, ...)
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0; if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
wxMessageBox(wxString::FromAscii(msg)); wxMessageBox(wxString::FromAscii(msg));
} }
void Host_SetWiiMoteConnectionState(int _State)
{
static int currentState = -1;
if (_State == currentState)
return;
currentState = _State;
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR);
switch(_State)
{
case 0: event.SetString(wxString::FromAscii("not connected")); break;
case 1: event.SetString(wxString::FromAscii("connecting...")); break;
case 2: event.SetString(wxString::FromAscii("conected!")); break;
}
event.SetInt(1);
wxPostEvent(main_frame, event);
}