From 549061586ae65d583f7e3d5337391a725934c55f Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Mon, 15 Sep 2014 23:22:04 +0000 Subject: [PATCH] -added libwupc, this will make the wiiu pro controller usable in wiiflow --- Makefile.main | 4 +-- portlibs/include/wupc/wupc.h | 49 +++++++++++++++++++++++++++++++++++ portlibs/lib/libwupc.a | Bin 0 -> 37512 bytes source/gui/gui.cpp | 6 ++++- source/gui/gui.hpp | 4 ++- source/loader/sys.c | 4 +++ source/menu/menu.hpp | 3 +++ source/menu/menu_input.cpp | 45 ++++++++++++++++++++------------ 8 files changed, 94 insertions(+), 21 deletions(-) create mode 100644 portlibs/include/wupc/wupc.h create mode 100644 portlibs/lib/libwupc.a diff --git a/Makefile.main b/Makefile.main index 869cffcc..5ee379c6 100644 --- a/Makefile.main +++ b/Makefile.main @@ -57,7 +57,7 @@ ios := 249 #--------------------------------------------------------------------------------- CFLAGS = -g -ggdb -Os -Wall -Wextra $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H CXXFLAGS = $(CFLAGS) -LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size +LDFLAGS = -g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,wiiuse_register ifeq ($(BUILDMODE),channel) CFLAGS += -DFULLCHANNEL @@ -67,7 +67,7 @@ endif #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- -LIBS := -lcustomfat -lcustomntfs -lcustomext2fs -lpng -lturbojpeg -lm -lz -lwiiuse -lbte -lasnd -logc -lfreetype -lvorbisidec -lmad +LIBS := -lcustomfat -lcustomntfs -lcustomext2fs -lpng -lturbojpeg -lm -lz -lwiiuse -lwupc -lbte -lasnd -logc -lfreetype -lvorbisidec -lmad #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing diff --git a/portlibs/include/wupc/wupc.h b/portlibs/include/wupc/wupc.h new file mode 100644 index 00000000..02653964 --- /dev/null +++ b/portlibs/include/wupc/wupc.h @@ -0,0 +1,49 @@ +/**************************************************************************** + * Copyright (C) 2014 FIX94 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + ****************************************************************************/ +#ifndef _WUPC_H_ +#define _WUPC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +struct WUPCData { + s16 xAxisL; + s16 xAxisR; + s16 yAxisL; + s16 yAxisR; + u32 button; +}; + +void WUPC_Init(); +void WUPC_Shutdown(); +struct WUPCData *WUPC_Data(u8 chan); +void WUPC_Rumble(u8 chan, bool rumble); +u32 WUPC_UpdateButtonStats(); +u32 WUPC_ButtonsUp(u8 chan); +u32 WUPC_ButtonsDown(u8 chan); +u32 WUPC_ButtonsHeld(u8 chan); +s16 WUPC_lStickX(u8 chan); +s16 WUPC_lStickY(u8 chan); +s16 WUPC_rStickX(u8 chan); +s16 WUPC_rStickY(u8 chan); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/portlibs/lib/libwupc.a b/portlibs/lib/libwupc.a new file mode 100644 index 0000000000000000000000000000000000000000..397dae2bfda06eeee91917c6885aa0a3bf353615 GIT binary patch literal 37512 zcmeHwdwf;Jwg2pW9yupDBmn}1N8p5)K_KBJ28fbCfB+E@NX1G$GV@)&p9=joTiI{=VWrm zsWYU)`b?!%wo=ZT|IS}3b#~3lg{f8PjZK|h>5i4P4Jwt|+)>+}+T7IC-I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W4;USM%PHU5{K`quFtBvF7S|t#A!K!}ot^yYKT5)_3}r2fvqS*Psxt z7wmJHF#2nK7(UhaTliexSG>-({^9kk-BX3JXSUB8!WduM_wX^lzmXAsA0wyu{o=bo z)5SJ#eW9W7r^kmsZ6BHEJ$|F#U(PX)f2ZGf=1h-&#P= 0; chan--) { + WUPC_Rumble(chan, 0); WPAD_Rumble(chan, 0); PAD_ControlMotor(chan, 0); @@ -393,6 +396,7 @@ void CButtonsMgr::tick(void) for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) if (m_rumble[chan] > 0 && --m_rumble[chan] == 0) { + WUPC_Rumble(chan, 0); WPAD_Rumble(chan, 0); PAD_ControlMotor(chan, 0); } diff --git a/source/gui/gui.hpp b/source/gui/gui.hpp index fe4a42be..154417b3 100644 --- a/source/gui/gui.hpp +++ b/source/gui/gui.hpp @@ -6,6 +6,7 @@ #include #include "wiiuse/wpad.h" +#include "wupc/wupc.h" #include "video.hpp" #include "FreeTypeGX.h" @@ -60,7 +61,7 @@ public: void noHover(bool nohover = false); void click(s16 id = -1); bool selected(s16 button = -1); - void setRumble(int, bool wii = false, bool gc = false); + void setRumble(int, bool wii = false, bool gc = false, bool wupc = false); void deselect(void){ for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) m_selected[chan] = -1; } void stopSounds(void); void setSoundVolume(int vol); @@ -144,6 +145,7 @@ private: u8 m_rumble[WPAD_MAX_WIIMOTES]; bool wii_rumble[WPAD_MAX_WIIMOTES]; bool gc_rumble[WPAD_MAX_WIIMOTES]; + bool wupc_rumble[WPAD_MAX_WIIMOTES]; GuiSound *m_sndHover; GuiSound *m_sndClick; u8 m_soundVolume; diff --git a/source/loader/sys.c b/source/loader/sys.c index 99dcd026..82fcf2bc 100644 --- a/source/loader/sys.c +++ b/source/loader/sys.c @@ -16,6 +16,7 @@ #include "memory/mem2.hpp" #include "memory/memory.h" #include "wiiuse/wpad.h" +#include "wupc/wupc.h" /* Variables */ bool reset = false; @@ -33,6 +34,7 @@ void Open_Inputs(void) { /* Initialize Wiimote subsystem */ PAD_Init(); + WUPC_Init(); WPAD_Init(); /* Set POWER button callback */ @@ -43,6 +45,8 @@ void Open_Inputs(void) void Close_Inputs(void) { + WUPC_Shutdown(); + u32 cnt; /* Disconnect Wiimotes */ diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index 7f977ad1..d87b9aff 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -28,6 +28,7 @@ #include "music/MusicPlayer.hpp" #include "plugin/plugin.hpp" #include "wiiuse/wpad.h" +#include "wupc/wupc.h" using namespace std; @@ -624,6 +625,8 @@ private: bool wBtn_HeldChan(int btn, u8 ext, int &chan); u32 gc_btnsPressed; u32 gc_btnsHeld; + u32 wupc_btnsPressed[WPAD_MAX_WIIMOTES]; + u32 wupc_btnsHeld[WPAD_MAX_WIIMOTES]; bool m_show_pointer[WPAD_MAX_WIIMOTES]; float left_stick_angle[WPAD_MAX_WIIMOTES]; diff --git a/source/menu/menu_input.cpp b/source/menu/menu_input.cpp index 6621ec71..c1424045 100644 --- a/source/menu/menu_input.cpp +++ b/source/menu/menu_input.cpp @@ -60,6 +60,7 @@ void CMenu::ScanInput() m_show_zone_prev = false; m_show_zone_next = false; + WUPC_UpdateButtonStats(); WPAD_ScanPads(); PAD_ScanPads(); @@ -102,7 +103,8 @@ void CMenu::ScanInput() } for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - m_btnMgr.setRumble(chan, WPadIR_Valid(chan), PAD_StickX(chan) < -20 || PAD_StickX(chan) > 20 || PAD_StickY(chan) < -20 || PAD_StickY(chan) > 20); + m_btnMgr.setRumble(chan, WPadIR_Valid(chan), PAD_StickX(chan) < -20 || PAD_StickX(chan) > 20 || PAD_StickY(chan) < -20 || PAD_StickY(chan) > 20, + WUPC_lStickX(chan) < -160 || WUPC_lStickX(chan) > 160 || WUPC_lStickY(chan) < -160 || WUPC_lStickY(chan) > 160); m_btnMgr.setMouse(WPadIR_Valid(chan) || m_show_pointer[chan]); if(WPadIR_Valid(chan)) { @@ -130,6 +132,7 @@ void CMenu::ButtonsPressed() { wii_btnsPressed[chan] = WPAD_ButtonsDown(chan); gc_btnsPressed |= PAD_ButtonsDown(chan); + wupc_btnsPressed[chan] = WUPC_ButtonsDown(chan); } } @@ -140,12 +143,14 @@ void CMenu::ButtonsHeld() { wii_btnsHeld[chan] = WPAD_ButtonsHeld(chan); gc_btnsHeld |= PAD_ButtonsHeld(chan); + wupc_btnsHeld[chan] = WUPC_ButtonsHeld(chan); } } bool CMenu::wBtn_PressedChan(int btn, u8 ext, int &chan) { - return ((wii_btnsPressed[chan] & btn) && (ext == WPAD_EXP_NONE || ext == wd[chan]->exp.type)); + return ((wii_btnsPressed[chan] & btn) && (ext == WPAD_EXP_NONE || ext == wd[chan]->exp.type)) + || ((wupc_btnsPressed[chan] & btn) && (ext == WPAD_EXP_CLASSIC)); } bool CMenu::wBtn_Pressed(int btn, u8 ext) @@ -160,7 +165,8 @@ bool CMenu::wBtn_Pressed(int btn, u8 ext) bool CMenu::wBtn_HeldChan(int btn, u8 ext, int &chan) { - return ((wii_btnsHeld[chan] & btn) && (ext == WPAD_EXP_NONE || ext == wd[chan]->exp.type)); + return ((wii_btnsHeld[chan] & btn) && (ext == WPAD_EXP_NONE || ext == wd[chan]->exp.type)) + || ((wupc_btnsHeld[chan] & btn) && (ext == WPAD_EXP_CLASSIC)); } bool CMenu::wBtn_Held(int btn, u8 ext) @@ -178,13 +184,14 @@ void CMenu::LeftStick() u8 speed = 0, pSpeed = 0; for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if(left_stick_mag[chan] > 0.15 || abs(PAD_StickX(chan)) > 20 || abs(PAD_StickY(chan)) > 20) + if(left_stick_mag[chan] > 0.15 || abs(PAD_StickX(chan)) > 20 || abs(PAD_StickY(chan)) > 20 + || abs(WUPC_lStickX(chan)) > 160 || abs(WUPC_lStickY(chan)) > 160) { m_show_pointer[chan] = true; if(LEFT_STICK_LEFT) { speed = (u8)(left_stick_mag[chan] * 10.00); - pSpeed = (u8)abs(PAD_StickX(chan))/10; + pSpeed = (u8)(abs(PAD_StickX(chan))/10 | abs(WUPC_lStickX(chan))/80); if(stickPointer_x[chan] > m_cursor[chan].width()/2) stickPointer_x[chan] = stickPointer_x[chan]-speed-pSpeed; pointerhidedelay[chan] = 150; @@ -192,7 +199,7 @@ void CMenu::LeftStick() if(LEFT_STICK_DOWN) { speed = (u8)(left_stick_mag[chan] * 10.00); - pSpeed = (u8)abs(PAD_StickY(chan))/10; + pSpeed = (u8)(abs(PAD_StickY(chan))/10 | abs(WUPC_lStickY(chan))/80); if(stickPointer_y[chan] < (m_vid.height() + (m_cursor[chan].height()/2))) stickPointer_y[chan] = stickPointer_y[chan]+speed+pSpeed; pointerhidedelay[chan] = 150; @@ -200,7 +207,7 @@ void CMenu::LeftStick() if(LEFT_STICK_RIGHT) { speed = (u8)(left_stick_mag[chan] * 10.00); - pSpeed = (u8)abs(PAD_StickX(chan))/10; + pSpeed = (u8)(abs(PAD_StickX(chan))/10 | abs(WUPC_lStickX(chan))/80); if(stickPointer_x[chan] < (m_vid.width() + (m_cursor[chan].width()/2))) stickPointer_x[chan] = stickPointer_x[chan]+speed+pSpeed; pointerhidedelay[chan] = 150; @@ -208,7 +215,7 @@ void CMenu::LeftStick() if(LEFT_STICK_UP) { speed = (u8)(left_stick_mag[chan] * 10.00); - pSpeed = (u8)abs(PAD_StickY(chan))/10; + pSpeed = (u8)(abs(PAD_StickY(chan))/10 | abs(WUPC_lStickY(chan))/80); if(stickPointer_y[chan] > m_cursor[chan].height()/2) stickPointer_y[chan] = stickPointer_y[chan]-speed-pSpeed; pointerhidedelay[chan] = 150; @@ -393,7 +400,7 @@ bool CMenu::lStick_Up(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((LEFT_STICK_ANG_UP && left_stick_mag[chan] > 0.15) || PAD_StickY(chan) > 20) + if((LEFT_STICK_ANG_UP && left_stick_mag[chan] > 0.15) || PAD_StickY(chan) > 20 || WUPC_lStickY(chan) > 160) return true; } return false; @@ -403,7 +410,7 @@ bool CMenu::lStick_Right(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((LEFT_STICK_ANG_RIGHT && left_stick_mag[chan] > 0.15) || PAD_StickX(chan) > 20) + if((LEFT_STICK_ANG_RIGHT && left_stick_mag[chan] > 0.15) || PAD_StickX(chan) > 20 || WUPC_lStickX(chan) > 160) return true; } return false; @@ -413,7 +420,7 @@ bool CMenu::lStick_Down(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((LEFT_STICK_ANG_DOWN && left_stick_mag[chan] > 0.15) || PAD_StickY(chan) < -20) + if((LEFT_STICK_ANG_DOWN && left_stick_mag[chan] > 0.15) || PAD_StickY(chan) < -20 || WUPC_lStickY(chan) < -160) return true; } return false; @@ -423,7 +430,7 @@ bool CMenu::lStick_Left(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((LEFT_STICK_ANG_LEFT && left_stick_mag[chan] > 0.15) || PAD_StickX(chan) < -20) + if((LEFT_STICK_ANG_LEFT && left_stick_mag[chan] > 0.15) || PAD_StickX(chan) < -20 || WUPC_lStickX(chan) < -160) return true; } return false; @@ -433,7 +440,8 @@ bool CMenu::rStick_Up(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((RIGHT_STICK_ANG_UP && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) || PAD_SubStickY(chan) > 20) + if((RIGHT_STICK_ANG_UP && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) + || PAD_SubStickY(chan) > 20 || WUPC_rStickY(chan) > 160) return true; } return false; @@ -443,7 +451,8 @@ bool CMenu::rStick_Right(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((RIGHT_STICK_ANG_RIGHT && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) || PAD_SubStickX(chan) > 20) + if((RIGHT_STICK_ANG_RIGHT && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) + || PAD_SubStickX(chan) > 20 || WUPC_rStickX(chan) > 160) return true; } return false; @@ -453,7 +462,8 @@ bool CMenu::rStick_Down(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((RIGHT_STICK_ANG_DOWN && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) || PAD_SubStickY(chan) < -20) + if((RIGHT_STICK_ANG_DOWN && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) + || PAD_SubStickY(chan) < -20 || WUPC_rStickY(chan) < -160) return true; } return false; @@ -463,7 +473,8 @@ bool CMenu::rStick_Left(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if((RIGHT_STICK_ANG_LEFT && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) || PAD_SubStickX(chan) < -20) + if((RIGHT_STICK_ANG_LEFT && right_stick_mag[chan] > 0.15 && right_stick_skip[chan] == 0) + || PAD_SubStickX(chan) < -20 || WUPC_rStickX(chan) < -160) return true; } return false; @@ -483,7 +494,7 @@ bool CMenu::wRoll_Right(void) { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { - if(WBTN_B_HELD && (wmote_roll[chan] > 5) && wmote_roll_skip[chan] == 0) + if(WBTN_B_HELD && (wmote_roll[chan] > 5) && wmote_roll_skip[chan] == 0) return true; } return false;