Merge pull request #311 from ogamespec/master

Fixed pad stick
This commit is contained in:
ogamespec 2023-08-24 16:31:13 +03:00 committed by GitHub
commit f4fa7b5dbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,15 +111,17 @@ void PADClose()
// ---------------------------------------------------------------------------
// process input
// TODO: The problem with stick sticking to the right in Bootrom is in this location
#define THRESOLD 87
#define STICK_INITIAL -128
#define THRESOLD 127
#define STICK_INITIAL 0
static void pad_reset_chan(PADState* state)
{
memset(state, 0, sizeof(PADState));
// The analog control values can range from -127 to +127.
// The pad.a library further filters them by setting the lower cap to 15 and the upper cap to 87 for stick and 74 for cstick.
// But these are purely programmatic fiddles that don't concern us.
state->stickX = state->stickY = STICK_INITIAL;
state->substickX = state->substickY = STICK_INITIAL;
}