diff --git a/GX2_template.cbp b/GX2_template.cbp
index e28a604..75e1ad3 100644
--- a/GX2_template.cbp
+++ b/GX2_template.cbp
@@ -28,121 +28,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -154,10 +50,6 @@
-
-
-
-
@@ -205,16 +97,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -255,6 +137,9 @@
+
+
+
diff --git a/Makefile b/Makefile
index 5315ac1..a21d464 100644
--- a/Makefile
+++ b/Makefile
@@ -160,7 +160,7 @@ install_channel: $(BUILD) NUSPacker.jar encryptKeyWith
java -jar NUSPacker.jar -in "channel" -out "install_channel"
NUSPacker.jar:
- wget https://bitbucket.org/timogus/nuspacker/downloads/NUSPacker.jar
+ java -jar downloader.jar https://bitbucket.org/timogus/nuspacker/downloads/NUSPacker.jar
encryptKeyWith:
@echo "Missing common key file \"encryptKeyWith\"! Insert the common key as string into \"encryptKeyWith\" file in the HBL Makefile path!"
diff --git a/downloader.jar b/downloader.jar
new file mode 100644
index 0000000..7c17167
Binary files /dev/null and b/downloader.jar differ
diff --git a/src/dynamic_libs/padscore_functions.h b/src/dynamic_libs/padscore_functions.h
index 68cf989..7e2222c 100644
--- a/src/dynamic_libs/padscore_functions.h
+++ b/src/dynamic_libs/padscore_functions.h
@@ -28,7 +28,17 @@
extern "C" {
#endif
-#include "common/types.h"
+extern u32 padscore_handle;
+
+#define WPAD_EXT_CORE 0
+#define WPAD_EXT_NUNCHUK 1
+#define WPAD_EXT_CLASSIC 2
+#define WPAD_EXT_MPLUS 5
+#define WPAD_EXT_MPLUS_NUNCHUK 6
+#define WPAD_EXT_MPLUS_CLASSIC 7
+#define WPAD_EXT_PRO_CONTROLLER 31
+
+#define WPAD_FMT_PRO_CONTROLLER 22
#define WPAD_BUTTON_LEFT 0x0001
#define WPAD_BUTTON_RIGHT 0x0002
@@ -60,8 +70,34 @@ extern "C" {
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
-void InitPadScoreFunctionPointers(void);
+#define WPAD_PRO_BUTTON_UP 0x00000001
+#define WPAD_PRO_BUTTON_LEFT 0x00000002
+#define WPAD_PRO_TRIGGER_ZR 0x00000004
+#define WPAD_PRO_BUTTON_X 0x00000008
+#define WPAD_PRO_BUTTON_A 0x00000010
+#define WPAD_PRO_BUTTON_Y 0x00000020
+#define WPAD_PRO_BUTTON_B 0x00000040
+#define WPAD_PRO_TRIGGER_ZL 0x00000080
+#define WPAD_PRO_RESERVED 0x00000100
+#define WPAD_PRO_TRIGGER_R 0x00000200
+#define WPAD_PRO_BUTTON_PLUS 0x00000400
+#define WPAD_PRO_BUTTON_HOME 0x00000800
+#define WPAD_PRO_BUTTON_MINUS 0x00001000
+#define WPAD_PRO_TRIGGER_L 0x00002000
+#define WPAD_PRO_BUTTON_DOWN 0x00004000
+#define WPAD_PRO_BUTTON_RIGHT 0x00008000
+#define WPAD_PRO_BUTTON_STICK_R 0x00010000
+#define WPAD_PRO_BUTTON_STICK_L 0x00020000
+#define WPAD_PRO_STICK_L_EMULATION_UP 0x00200000
+#define WPAD_PRO_STICK_L_EMULATION_DOWN 0x00100000
+#define WPAD_PRO_STICK_L_EMULATION_LEFT 0x00040000
+#define WPAD_PRO_STICK_L_EMULATION_RIGHT 0x00080000
+
+#define WPAD_PRO_STICK_R_EMULATION_UP 0x02000000
+#define WPAD_PRO_STICK_R_EMULATION_DOWN 0x01000000
+#define WPAD_PRO_STICK_R_EMULATION_LEFT 0x00400000
+#define WPAD_PRO_STICK_R_EMULATION_RIGHT 0x00800000
typedef struct _KPADData
{
@@ -78,7 +114,7 @@ typedef struct _KPADData
u8 device_type;
u8 wpad_error;
u8 pos_valid;
- u8 unused_4[1];
+ u8 format;
union
{
@@ -101,19 +137,56 @@ typedef struct _KPADData
f32 rtrigger;
} classic;
+ struct
+ {
+ u32 btns_h;
+ u32 btns_d;
+ u32 btns_r;
+ f32 lstick_x;
+ f32 lstick_y;
+ f32 rstick_x;
+ f32 rstick_y;
+ int charging;
+ int wired;
+ } pro;
+
u32 unused_6[20];
};
u32 unused_7[16];
} KPADData;
+typedef struct WPADReadData_ {
+ u8 unknown[40];
+ u8 dev;
+ u8 err;
+ u8 unknown1[2];
+ u32 buttons;
+ s16 l_stick_x;
+ s16 l_stick_y;
+ s16 r_stick_x;
+ s16 r_stick_y;
+ u8 unknown2[8];
+ u8 fmt;
+}WPADReadData;
+
+typedef WPADReadData KPADUnifiedWpadData;
+
+void InitPadScoreFunctionPointers(void);
+void InitAcquirePadScore(void);
+
+typedef void (* wpad_extension_callback_t)(s32 chan, s32 status);
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
extern void (* KPADInit)(void);
+extern void (* WPADInit)(void);
extern s32 (* WPADProbe)(s32 chan, u32 * pad_type);
extern s32 (* WPADSetDataFormat)(s32 chan, s32 format);
extern void (* WPADEnableURCC)(s32 enable);
extern void (* WPADRead)(s32 chan, void * data);
extern s32 (* KPADRead)(s32 chan, void * data, u32 size);
+extern s32 (* KPADReadEx)(s32 chan, KPADData * data, u32 size, s32 *error);
+extern void (*WPADSetAutoSleepTime)(u8 time);
+extern void (*WPADDisconnect)( s32 chan );
#ifdef __cplusplus
}
diff --git a/src/gui/GuiFrame.cpp b/src/gui/GuiFrame.cpp
index 77552c8..8f23e68 100644
--- a/src/gui/GuiFrame.cpp
+++ b/src/gui/GuiFrame.cpp
@@ -230,6 +230,21 @@ void GuiFrame::update(GuiController * c)
}
}
+
+void GuiFrame::process(){
+ if(isStateSet(STATE_DISABLED) && parentElement)
+ return;
+
+ GuiElement::process();
+
+ //! update appended items next frame
+ u32 size = elements.size();
+
+ for (u32 i = 0; i < size && i < elements.size(); ++i){
+ elements[i]->process();
+ }
+}
+
void GuiFrame::updateElementList(void)
{
if(listChangeQueue.empty() == false)
diff --git a/src/gui/GuiFrame.h b/src/gui/GuiFrame.h
index 2a1eeee..120ebdc 100644
--- a/src/gui/GuiFrame.h
+++ b/src/gui/GuiFrame.h
@@ -74,6 +74,7 @@ class GuiFrame : public GuiElement
//!Allows the GuiFrame and all elements to respond to the input data specified
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
void update(GuiController * t);
+ void process();
//!virtual Close Window - this will put the object on the delete queue in MainWindow
virtual void close();
//!virtual show window function
diff --git a/src/main.cpp b/src/main.cpp
index 59b0fc5..48a7be0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -15,7 +15,7 @@ extern "C" int Menu_Main(void){
//!*******************************************************************
//! do OS (for acquire) and sockets first so we got logging
InitPadScoreFunctionPointers();
-
+ socket_lib_init();
log_init("192.168.0.181");
//Otherwise apply the patches!!!
@@ -33,7 +33,7 @@ extern "C" int Menu_Main(void){
Application::destroyInstance();
memoryRelease();
- log_print("Going back to the Homebrew launcher\n");
+ log_print("Leaving the application\n");
log_deinit();
return EXIT_SUCCESS;