mirror of
https://github.com/Maschell/hid_to_vpad.git
synced 2025-01-23 18:21:15 +01:00
Formatting
This commit is contained in:
parent
943ac03b93
commit
0d38817857
16
src/main.cpp
16
src/main.cpp
@ -53,7 +53,7 @@ DEINITIALIZE_PLUGIN() {
|
|||||||
ControllerPatcher::stopNetworkServer();
|
ControllerPatcher::stopNetworkServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
ON_APPLICATION_START(args){
|
ON_APPLICATION_START(args) {
|
||||||
socket_lib_init();
|
socket_lib_init();
|
||||||
log_init();
|
log_init();
|
||||||
|
|
||||||
@ -65,8 +65,8 @@ ON_APPLICATION_START(args){
|
|||||||
ControllerPatcher::disableWiiUEnergySetting();
|
ControllerPatcher::disableWiiUEnergySetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
ON_APP_STATUS_CHANGED(status){
|
ON_APP_STATUS_CHANGED(status) {
|
||||||
if(status == WUPS_APP_STATUS_CLOSED){
|
if(status == WUPS_APP_STATUS_CLOSED) {
|
||||||
//CursorDrawer::destroyInstance();
|
//CursorDrawer::destroyInstance();
|
||||||
DEBUG_FUNCTION_LINE("ON_APPLICATION_ENDING\n");
|
DEBUG_FUNCTION_LINE("ON_APPLICATION_ENDING\n");
|
||||||
ControllerPatcher::destroyConfigHelper();
|
ControllerPatcher::destroyConfigHelper();
|
||||||
@ -86,24 +86,24 @@ DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buf
|
|||||||
bool do_callback = (result > 0 && (buffer[0].hold & VPAD_BUTTON_TV));
|
bool do_callback = (result > 0 && (buffer[0].hold & VPAD_BUTTON_TV));
|
||||||
ControllerPatcher::handleCallbackData(do_callback);
|
ControllerPatcher::handleCallbackData(do_callback);
|
||||||
|
|
||||||
if(ControllerPatcher::areControllersConnected() && buffer_size > 0){
|
if(ControllerPatcher::areControllersConnected() && buffer_size > 0) {
|
||||||
ControllerPatcher::setRumble(UController_Type_Gamepad,!!VPADBASEGetMotorOnRemainingCount(VPAD_CHAN_0));
|
ControllerPatcher::setRumble(UController_Type_Gamepad,!!VPADBASEGetMotorOnRemainingCount(VPAD_CHAN_0));
|
||||||
|
|
||||||
if(ControllerPatcher::setControllerDataFromHID(buffer) == CONTROLLER_PATCHER_ERROR_NONE){
|
if(ControllerPatcher::setControllerDataFromHID(buffer) == CONTROLLER_PATCHER_ERROR_NONE) {
|
||||||
|
|
||||||
if(buffer[0].hold & VPAD_BUTTON_HOME){
|
if(buffer[0].hold & VPAD_BUTTON_HOME) {
|
||||||
//You can open the home menu this way, but not close it. Need a proper way to close it using the same button...
|
//You can open the home menu this way, but not close it. Need a proper way to close it using the same button...
|
||||||
//OSSendAppSwitchRequest(5,0,0); //Open the home menu!
|
//OSSendAppSwitchRequest(5,0,0); //Open the home menu!
|
||||||
}
|
}
|
||||||
|
|
||||||
if(error != NULL){
|
if(error != NULL) {
|
||||||
*error = 0;
|
*error = 0;
|
||||||
}
|
}
|
||||||
result = 1; // We want the WiiU to ignore everything else.
|
result = 1; // We want the WiiU to ignore everything else.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ControllerPatcher::isButtonRemappingDone()){
|
if(ControllerPatcher::isButtonRemappingDone()) {
|
||||||
ControllerPatcher::buttonRemapping(buffer,result);
|
ControllerPatcher::buttonRemapping(buffer,result);
|
||||||
//ControllerPatcher::printVPADButtons(buffer); //Leads to random crashes on app transitions.
|
//ControllerPatcher::printVPADButtons(buffer); //Leads to random crashes on app transitions.
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user