try to fix nowx wiimote

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2293 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
tmator 2009-02-17 22:06:40 +00:00
parent b5c0efd5ac
commit 7a03ffe210
3 changed files with 17 additions and 1 deletions

View File

@ -112,9 +112,10 @@ void handle_event(struct wiimote_t* wm)
wiiuse_set_ir(wm, 1);
// Print battery status
#if defined(HAVE_WX) && HAVE_WX
if(frame && g_Config.bUpdateRealWiimote)
frame->m_GaugeBattery->SetValue((int)floor((wm->battery_level * 100) + 0.5));
#endif
// Create shortcut to the nunchuck
struct nunchuk_t* nc = NULL;
if (wm->exp.type == EXP_NUNCHUK)
@ -167,6 +168,7 @@ void handle_event(struct wiimote_t* wm)
//Console::ClearScreen();
//Console::Print("%s\n\n", Tmp.c_str());
#if defined(HAVE_WX) && HAVE_WX
if(frame)
{
// Produce adjusted accelerometer values
@ -236,10 +238,12 @@ void handle_event(struct wiimote_t* wm)
frame->m_bmpDotRightOut[0]->SetPosition(wxPoint(Roll, Pitch));*/
// ---------------------
}
#endif
}
// Otherwise remove the values
else
{
#if defined(HAVE_WX) && HAVE_WX
if (frame)
{
@ -258,6 +262,7 @@ void handle_event(struct wiimote_t* wm)
frame->m_TextIR->SetLabel(wxT("Cursor:\nDistance:"));
}
#endif
}
}

View File

@ -28,6 +28,7 @@ if wmenv['HAVE_WX']:
libs = [ 'common', 'inputcommon' ]
cxxflags = [ '-fPIC' ]
if wmenv['HAVE_WIIUSE']:

View File

@ -302,7 +302,9 @@ extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _
Console::Print("\n\nWiimote Disconnected\n\n");
g_EmulatorRunning = false;
g_WiimoteUnexpectedDisconnect = true;
#if defined(HAVE_WX) && HAVE_WX
if (frame) frame->UpdateGUI();
#endif
return;
}
@ -333,6 +335,7 @@ extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _
extern "C" void Wiimote_Update()
{
// Tell us about the update rate, but only about once every second to avoid a major slowdown
#if defined(HAVE_WX) && HAVE_WX
if (frame)
{
GetUpdateRate();
@ -344,6 +347,7 @@ extern "C" void Wiimote_Update()
g_UpdateWriteScreen++;
}
#endif
// This functions will send:
// Emulated Wiimote: Only data reports 0x30-0x37
// Real Wiimote: Both data reports 0x30-0x37 and all other read reports
@ -498,7 +502,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
if(!Emu && !pStatus->extension)
{
DisableExtensions();
#if defined(HAVE_WX) && HAVE_WX
if (frame) frame->UpdateGUI();
#endif
}
}
break;
@ -533,7 +539,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
if (!Emu && data[7] == 0x01 && data[8] == 0x01) g_Config.bClassicControllerConnected = true;
g_Config.Save();
WiiMoteEmu::UpdateEeprom();
#if defined(HAVE_WX) && HAVE_WX
if (frame) frame->UpdateGUI();
#endif
Console::Print("%s", TmpData.c_str());
Console::Print("Game got the decrypted extension ID: %02x%02x\n\n", data[7], data[8]);
}
@ -544,7 +552,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
if (!Emu && data[11] == 0x01 && data[12] == 0x01) g_Config.bClassicControllerConnected = true;
g_Config.Save();
WiiMoteEmu::UpdateEeprom();
#if defined(HAVE_WX) && HAVE_WX
if (frame) frame->UpdateGUI();
#endif
Console::Print("%s", TmpData.c_str());
Console::Print("Game got the decrypted extension ID: %02x%02x%02x%02x%02x%02x\n\n", data[7], data[8], data[9], data[10], data[11], data[12]);
}