1. Fixed the dual mode. You should now be able to change between the real and emulated Wiimote at any time, even when the Nunchuck is connected. It also supports third party Wireless Nunchucks that never sends any calibration values. The Nunchuck status should be automatically updated. The Nunchuck stick may get stuck, but that should fix itself if you disconnect and reconnect again. The only important problems seems to be that the real Wiimote fails to answer sometimes so that the Core functions disconnect it.

2. Began looking at how to reconnect the Wiimote after an unwanted HCI disconnect command

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2129 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-07 03:16:41 +00:00
parent 1d0e8ddf84
commit fcdd2a8e17
26 changed files with 466 additions and 259 deletions

View File

@ -39,6 +39,11 @@
namespace WiiMoteReal
{
int GetReportSize(struct wiimote_t* wm)
{
// The report size is 0x33 = 18, 0x37 = 22 withouth the leading (a1) byte
if(WIIUSE_USING_EXP(wm)) return 22; else return 18;
}
void handle_ctrl_status(struct wiimote_t* wm)
{
@ -51,12 +56,11 @@ void handle_ctrl_status(struct wiimote_t* wm)
Console::Print("battery: %f %%\n", wm->battery_level);
}
bool IRDataOK(struct wiimote_t* wm)
{
//Console::Print("IRDataOK: ");
// The report size is 0x33 = 18, 0x37 = 22 withouth the leading (a1) byte
int ReportSize; if(WIIUSE_USING_EXP(wm)) ReportSize = 22; else ReportSize = 18;
int ReportSize = GetReportSize(wm);
for(int i = 0; i < ReportSize; i++)
{
//Console::Print("%02x ", wm->event_buf[i]);
@ -246,6 +250,8 @@ void ReadWiimote()
be needed. But I still use it becase it seemed like state_changed() or the threshold values or
something else might fail so that only huge status changed were reported. */
handle_event(g_WiiMotesFromWiiUse[0]);
// Declaration
std::string Temp;
/* Timeout for data reading. This is used in Initialize() to read the Eeprom, if we have not gotten
@ -282,7 +288,7 @@ void ReadWiimote()
case WIIUSE_STATUS:
/* a status event occured */
handle_ctrl_status(g_WiiMotesFromWiiUse[i]);
//handle_ctrl_status(g_WiiMotesFromWiiUse[i]);
break;
case WIIUSE_DISCONNECT: