From 73a6ae25923b0ee2279d4d0d43b0ec9ba125c1a2 Mon Sep 17 00:00:00 2001 From: tmator Date: Tue, 17 Feb 2009 22:15:27 +0000 Subject: [PATCH] finish to fix nowx, is it work on linux ? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2294 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_Wiimote/Src/DataReports.cpp | 19 ++++++++++++++++++- Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp | 5 ++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/DataReports.cpp b/Source/Plugins/Plugin_Wiimote/Src/DataReports.cpp index 653bda3173..0054157d27 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/DataReports.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/DataReports.cpp @@ -133,8 +133,9 @@ void SendReportCore(u16 _channelID) wm_report_core* pReport = (wm_report_core*)(DataFrame + Offset); Offset += sizeof(wm_report_core); memset(pReport, 0, sizeof(wm_report_core)); - +#if defined(HAVE_WX) && HAVE_WX FillReportInfo(pReport->c); +#endif LOGV(WII_IPC_WIIMOTE, 2, " SendReportCore()"); @@ -157,8 +158,10 @@ void SendReportCoreAccel(u16 _channelID) Offset += sizeof(wm_report_core_accel); memset(pReport, 0, sizeof(wm_report_core_accel)); +#if defined(HAVE_WX) && HAVE_WX FillReportInfo(pReport->c); FillReportAcc(pReport->a); +#endif LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccel (0x31)"); LOGV(WII_IPC_WIIMOTE, 2, " Channel: %04x", _channelID); @@ -182,11 +185,13 @@ void SendReportCoreAccelIr12(u16 _channelID) { Offset += sizeof(wm_report_core_accel_ir12); memset(pReport, 0, sizeof(wm_report_core_accel_ir12)); +#if defined(HAVE_WX) && HAVE_WX FillReportInfo(pReport->c); FillReportAcc(pReport->a); // We settle with emulating two objects, not all four. We leave object 2 and 3 with 0xff. FillReportIR(pReport->ir[0], pReport->ir[1]); +#endif memset(&pReport->ir[2], 0xff, sizeof(wm_ir_extended)); memset(&pReport->ir[3], 0xff, sizeof(wm_ir_extended)); @@ -216,16 +221,22 @@ void SendReportCoreAccelExt16(u16 _channelID) wm_classic_extension _ext; memset(&_ext, 0, sizeof(wm_classic_extension)); +#if defined(HAVE_WX) && HAVE_WX FillReportInfo(pReport->c); FillReportAcc(pReport->a); +#endif if(g_Config.bNunchuckConnected) { +#if defined(HAVE_WX) && HAVE_WX FillReportExtension(pReport->ext); +#endif } else if(g_Config.bClassicControllerConnected) { +#if defined(HAVE_WX) && HAVE_WX FillReportClassicExtension(_ext); +#endif // Copy _ext to pReport->ext memcpy(&pReport->ext, &_ext, sizeof(_ext)); } @@ -257,17 +268,23 @@ void SendReportCoreAccelIr10Ext(u16 _channelID) wm_classic_extension _ext; memset(&_ext, 0, sizeof(wm_classic_extension)); +#if defined(HAVE_WX) && HAVE_WX FillReportInfo(pReport->c); FillReportAcc(pReport->a); FillReportIRBasic(pReport->ir[0], pReport->ir[1]); +#endif if(g_Config.bNunchuckConnected) { +#if defined(HAVE_WX) && HAVE_WX FillReportExtension(pReport->ext); +#endif } else if(g_Config.bClassicControllerConnected) { +#if defined(HAVE_WX) && HAVE_WX FillReportClassicExtension(_ext); +#endif // Copy _ext to pReport->ext memcpy(&pReport->ext, &_ext, sizeof(_ext)); } diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp index 2f1b705cd7..e0852f74ec 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp @@ -290,6 +290,7 @@ void ResetVariables() g_Encryption = false; // Set default recording values +#if defined(HAVE_WX) && HAVE_WX for (int i = 0; i < 3; i++) { g_RecordingPlaying[i] = -1; @@ -298,7 +299,7 @@ void ResetVariables() g_RecordingStart[i] = 0; g_RecordingCurrentTime[i] = 0; } - +#endif g_EmulatedWiiMoteInitialized = false; } @@ -520,7 +521,9 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size) { LOG(WII_IPC_WIIMOTE, "Wiimote_ControlChannel"); std::string Temp = ArrayToString(data, 0, _Size); +#if defined(HAVE_WX) && HAVE_WX Console::Print("\n%s: ControlChannel: %s\n", Tm().c_str(), Temp.c_str()); +#endif LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str()); }