Added option to disable the network controller

This commit is contained in:
Maschell 2017-07-20 17:28:14 +02:00
parent f8aa5558cd
commit 718ac61d77
4 changed files with 12 additions and 0 deletions

View File

@ -529,11 +529,14 @@ bool ControllerPatcher::Init(){
}
void ControllerPatcher::startNetworkServer(){
if(!gNetworkControllerActivated) return;
log_printf("ControllerPatcher::startNetworkServer(line %d) statedNetworkServer! \n",__LINE__);
UDPServer::getInstance();
TCPServer::getInstance();
}
void ControllerPatcher::stopNetworkServer(){
log_printf("ControllerPatcher::stopNetworkServer(line %d) called! \n",__LINE__);
UDPServer::destroyInstance();
UDPClient::destroyInstance();
TCPServer::destroyInstance();
@ -1062,6 +1065,11 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setRumbleActivated(bool va
return CONTROLLER_PATCHER_ERROR_NONE;
}
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setNetworkControllerActivated(bool value){
gNetworkControllerActivated = value;
return CONTROLLER_PATCHER_ERROR_NONE;
}
bool ControllerPatcher::isRumbleActivated(){
return gGlobalRumbleActivated;
}

View File

@ -241,6 +241,8 @@ class ControllerPatcher{
static CONTROLLER_PATCHER_RESULT_OR_ERROR setRumbleActivated(bool value);
static CONTROLLER_PATCHER_RESULT_OR_ERROR setNetworkControllerActivated(bool value);
static bool isRumbleActivated();
};

View File

@ -63,6 +63,7 @@ wpad_extension_callback_t gExtensionCallback[4] __attribute__((section(".data"))
wpad_sampling_callback_t gSamplingCallback __attribute__((section(".data"))) = 0;
u8 gCallbackCooldown __attribute__((section(".data"))) = 0;
u8 gAppStatus __attribute__((section(".data"))) = 0;
u8 gNetworkControllerActivated __attribute__((section(".data"))) = 1;
u8 gGlobalRumbleActivated __attribute__((section(".data"))) = 0;

View File

@ -68,6 +68,7 @@ extern wpad_sampling_callback_t gSamplingCallback;
extern u8 gCallbackCooldown;
extern u8 gGlobalRumbleActivated;
extern u8 gAppStatus;
extern u8 gNetworkControllerActivated;
extern u32 gUDPClientip;
extern ControllerMappingPADInfo* gProPadInfo[4];