mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 18:52:11 -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>
18 lines
826 B
C
18 lines
826 B
C
#ifndef PSXRECOMP_MOD_LOCAL_INPUT_POLICY_H
|
|
#define PSXRECOMP_MOD_LOCAL_INPUT_POLICY_H
|
|
|
|
/* Local presentation plugins may inspect live host input only while its
|
|
* controller is available during ordinary offline execution. Guest pad mode
|
|
* is deliberately absent: a game selecting digital SIO does not make its
|
|
* locally attached analog stick unavailable to presentation code. Peer input
|
|
* and rollback replay remain simulation state, never presentation input. */
|
|
static inline int psx_mod_local_input_available(int player_valid,
|
|
int connected,
|
|
int netplay_active,
|
|
int resimulating) {
|
|
return player_valid && connected &&
|
|
!netplay_active && !resimulating;
|
|
}
|
|
|
|
#endif
|