From 42fc97a37ea624cb2719eba41a00d40e6f5e99ca Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 14 Apr 2017 12:59:40 +0200 Subject: [PATCH] Added variables for a missing connection callback --- ControllerPatcher.cpp | 6 ++++-- utils/CPRetainVars.cpp | 4 ++-- utils/CPRetainVars.hpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ControllerPatcher.cpp b/ControllerPatcher.cpp index be98ed1..efe6290 100644 --- a/ControllerPatcher.cpp +++ b/ControllerPatcher.cpp @@ -78,7 +78,8 @@ void ControllerPatcher::ResetConfig(){ memset(gNetworkController,0,sizeof(gNetworkController)); // Init / Invalid everything memset(gHID_Devices,0,sizeof(gHID_Devices)); // Init / Invalid everything - memset(gConnectCallback,0,sizeof(gConnectCallback)); + memset(gWPADConnectCallback,0,sizeof(gWPADConnectCallback)); + memset(gKPADConnectCallback,0,sizeof(gKPADConnectCallback)); memset(gExtensionCallback,0,sizeof(gExtensionCallback)); gCallbackCooldown = 0; @@ -479,7 +480,8 @@ void ControllerPatcher::DeInit(){ memset(config_controller_hidmask,0,sizeof(config_controller_hidmask)); memset(gNetworkController,0,sizeof(gNetworkController)); - memset(gConnectCallback,0,sizeof(gConnectCallback)); + memset(gWPADConnectCallback,0,sizeof(gWPADConnectCallback)); + memset(gKPADConnectCallback,0,sizeof(gKPADConnectCallback)); memset(gExtensionCallback,0,sizeof(gExtensionCallback)); gCallbackCooldown = 0; diff --git a/utils/CPRetainVars.cpp b/utils/CPRetainVars.cpp index 1878def..ad4ace0 100644 --- a/utils/CPRetainVars.cpp +++ b/utils/CPRetainVars.cpp @@ -57,9 +57,9 @@ u16 gNetworkController[gHIDMaxDevices][HID_MAX_PADS_COUNT][4] __attribute__((sec s32 gHIDNetworkClientID __attribute__((section(".data"))) = 0; u8 gUsedProtocolVersion __attribute__((section(".data"))) = WIIU_CP_TCP_HANDSHAKE; -wpad_connect_callback_t gConnectCallback[4] __attribute__((section(".data"))); +wpad_connect_callback_t gWPADConnectCallback[4] __attribute__((section(".data"))); +wpad_connect_callback_t gKPADConnectCallback[4] __attribute__((section(".data"))); wpad_extension_callback_t gExtensionCallback[4] __attribute__((section(".data"))); u8 gCallbackCooldown __attribute__((section(".data"))) = 0; u32 gUDPClientip __attribute__((section(".data"))) = 0; - diff --git a/utils/CPRetainVars.hpp b/utils/CPRetainVars.hpp index 0dd7944..2a40924 100644 --- a/utils/CPRetainVars.hpp +++ b/utils/CPRetainVars.hpp @@ -59,11 +59,11 @@ extern s32 gHIDNetworkClientID; extern u8 gUsedProtocolVersion; -extern wpad_connect_callback_t gConnectCallback[4]; +extern wpad_connect_callback_t gWPADConnectCallback[4]; +extern wpad_connect_callback_t gKPADConnectCallback[4]; extern wpad_extension_callback_t gExtensionCallback[4]; extern u8 gCallbackCooldown; extern u32 gUDPClientip; - #endif // CP_RETAINS_VARS_H_