1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-06-29 00:48:43 +00:00

Update libnx and libstratosphere

This commit is contained in:
cathery 2020-03-21 00:29:53 +03:00
parent c91bcd9e26
commit 7cab2e1e89
5 changed files with 11 additions and 14 deletions

View File

@ -1,12 +1,9 @@
#include "SwitchControllerHandler.h"
#include <cmath>
#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<IController> &&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)

View File

@ -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)

View File

@ -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;

View File

@ -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");

@ -1 +1 @@
Subproject commit a4ce117292cc86e951d82666f4e13bc1dc40443f
Subproject commit 07630f73a72cf2d3ea2cefc70dcd8a0449fbcbd3