mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
f3801ba10b
psx_mod_read_local_pad_sticks(player, out[4]) returns the mapped local stick axes (lx, ly, rx, ry; 0..255, centre 128) without touching the SIO sample, so a presentation plugin (a look-around camera) can read the right stick even when the game selected a digital pad. It returns 0 and centred axes for an invalid or disconnected player, in netplay, and during rollback resimulation; peer input is never presentation input. The debug-server axis override feeds it for deterministic tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
578 B
C
17 lines
578 B
C
#include "mod_local_input_policy.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
static int failures;
|
|
#define CHECK(cond) do { if (!(cond)) { fprintf(stderr, "FAIL: %s\n", #cond); failures++; } } while (0)
|
|
|
|
int main(void) {
|
|
/* Digital guest pad mode does not gate local presentation input. */
|
|
CHECK(psx_mod_local_input_available(1, 1, 0, 0));
|
|
CHECK(!psx_mod_local_input_available(0, 1, 0, 0));
|
|
CHECK(!psx_mod_local_input_available(1, 0, 0, 0));
|
|
CHECK(!psx_mod_local_input_available(1, 1, 1, 0));
|
|
CHECK(!psx_mod_local_input_available(1, 1, 0, 1));
|
|
return failures ? 1 : 0;
|
|
}
|