From 7cab2e1e89af205ad41b2dadd633066bfeda25a0 Mon Sep 17 00:00:00 2001 From: cathery Date: Sat, 21 Mar 2020 00:29:53 +0300 Subject: [PATCH] Update libnx and libstratosphere --- source/ControllerSwitch/SwitchControllerHandler.cpp | 13 +++++-------- source/Sysmodule/source/main.cpp | 2 +- source/Sysmodule/source/psc_module.cpp | 2 +- source/Sysmodule/source/usb_module.cpp | 6 +++--- source/libstratosphere | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/source/ControllerSwitch/SwitchControllerHandler.cpp b/source/ControllerSwitch/SwitchControllerHandler.cpp index 047c6da..7f7958f 100644 --- a/source/ControllerSwitch/SwitchControllerHandler.cpp +++ b/source/ControllerSwitch/SwitchControllerHandler.cpp @@ -1,12 +1,9 @@ #include "SwitchControllerHandler.h" #include -#define JOYSTICK_MAX_FIXED (JOYSTICK_MAX) -#define JOYSTICK_MIN_FIXED (JOYSTICK_MIN + 1) - static_assert( - JOYSTICK_MAX_FIXED == 32767 && JOYSTICK_MIN_FIXED == -32767, - "Seems like you're using a libnx build that has fixed the joystick values, please remove these _FIXED defines and use the unmodified joystick values instead" + JOYSTICK_MAX == 32767 && JOYSTICK_MIN == -32767, + "JOYSTICK_MAX and/or JOYSTICK_MIN has incorrect values. Update libnx" ); SwitchControllerHandler::SwitchControllerHandler(std::unique_ptr &&controller) @@ -36,10 +33,10 @@ void SwitchControllerHandler::ConvertAxisToSwitchAxis(float x, float y, float de { float floatRange = 2.0f; //JOYSTICK_MAX is 1 above and JOYSTICK_MIN is 1 below acceptable joystick values, causing crashes on various games including Xenoblade Chronicles 2 and Resident Evil 4 - float newRange = (JOYSTICK_MAX_FIXED - JOYSTICK_MIN_FIXED); + float newRange = (JOYSTICK_MAX - JOYSTICK_MIN); - *x_out = (((x + 1.0f) * newRange) / floatRange) + JOYSTICK_MIN_FIXED; - *y_out = (((y + 1.0f) * newRange) / floatRange) + JOYSTICK_MIN_FIXED; + *x_out = (((x + 1.0f) * newRange) / floatRange) + JOYSTICK_MIN; + *y_out = (((y + 1.0f) * newRange) / floatRange) + JOYSTICK_MIN; /* OldRange = (OldMax - OldMin) NewRange = (NewMax - NewMin) diff --git a/source/Sysmodule/source/main.cpp b/source/Sysmodule/source/main.cpp index 6e32dbd..2bb8330 100644 --- a/source/Sysmodule/source/main.cpp +++ b/source/Sysmodule/source/main.cpp @@ -59,7 +59,7 @@ extern "C" void __appInit(void) R_ABORT_UNLESS(fsInitialize()); }); - R_ABORT_UNLESS(fsdevMountSdmc()); + R_ABORT_UNLESS(fsdevMountSdmc()); } extern "C" void __appExit(void) diff --git a/source/Sysmodule/source/psc_module.cpp b/source/Sysmodule/source/psc_module.cpp index 99ea79e..2794763 100644 --- a/source/Sysmodule/source/psc_module.cpp +++ b/source/Sysmodule/source/psc_module.cpp @@ -22,7 +22,7 @@ namespace syscon::psc void PscThreadFunc(void *arg) { do { - if (R_SUCCEEDED(waitSingle(pscModuleWaiter, U64_MAX))) + if (R_SUCCEEDED(waitSingle(pscModuleWaiter, UINT64_MAX))) { PscPmState pscState; u32 out_flags; diff --git a/source/Sysmodule/source/usb_module.cpp b/source/Sysmodule/source/usb_module.cpp index bd84252..156a179 100644 --- a/source/Sysmodule/source/usb_module.cpp +++ b/source/Sysmodule/source/usb_module.cpp @@ -47,7 +47,7 @@ namespace syscon::usb void UsbEventThreadFunc(void *arg) { do { - if (R_SUCCEEDED(eventWait(&g_usbCatchAllEvent, U64_MAX))) + if (R_SUCCEEDED(eventWait(&g_usbCatchAllEvent, UINT64_MAX))) { WriteToLog("Catch-all event went off"); @@ -75,7 +75,7 @@ namespace syscon::usb void UsbDs3EventThreadFunc(void *arg) { do { - if (R_SUCCEEDED(eventWait(&g_usbDualshock3Event, U64_MAX))) + if (R_SUCCEEDED(eventWait(&g_usbDualshock3Event, UINT64_MAX))) { WriteToLog("Dualshock 3 event went off"); @@ -94,7 +94,7 @@ namespace syscon::usb void UsbDs4EventThreadFunc(void *arg) { do { - if (R_SUCCEEDED(eventWait(&g_usbDualshock4Event, U64_MAX))) + if (R_SUCCEEDED(eventWait(&g_usbDualshock4Event, UINT64_MAX))) { WriteToLog("Dualshock 4 event went off"); diff --git a/source/libstratosphere b/source/libstratosphere index a4ce117..07630f7 160000 --- a/source/libstratosphere +++ b/source/libstratosphere @@ -1 +1 @@ -Subproject commit a4ce117292cc86e951d82666f4e13bc1dc40443f +Subproject commit 07630f73a72cf2d3ea2cefc70dcd8a0449fbcbd3