mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
a4d1f31487
psx_mod_set_pad_transform(player, &PSXModPadTransform) registers stage 2b of pad_external_input: after the physical pad and any controller source, before the mouse policy. The transform sees the resolved pad plus the port's host extras (gamepad present, LT/RT 0..255 from SDL, unthresholded) and may rewrite buttons, sticks and the presented controller type, e.g. a NeGcon whose I/II come from the triggers. Output is pre-filled as a pass-through, validated (struct size, ranges, type within allowed_types) and replaced by neutral when invalid; detaching or a mod/session reset owes one neutral release frame. initial_type sets the boot/hotplug type. The resolver stays pure: host extras arrive through a new capture hook and the transform through another, both covered in pad_external_input_test. Under the input guard the transform runs on zero triggers and its output is neutralized. A NeGcon result resets the mouse policy rather than letting it overwrite the I/II bytes. Offline only: netplay, resim, selfcheck replay and plain debug overrides never reach it. With no transform registered every pad is bit-identical to before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>