Files
Shokunin 82bc90dff2 Give a title pad transform the host pad of a digital-presented player
A digital presentation folds the sticks onto the D-pad and centres them,
so a transform on a digital player (the default for many titles) never
saw the stick. The transform decides what the guest sees, so for a
digital stage-1 pad with no controller source its frame is now the host
pad: real sticks and buttons without the stick->D-pad fold, type still
DIGITAL (new PadExtHooks.host_pad, capture_pad_slot_view). The output is
pre-filled with the stock pad and a decline delivers it, so pass-through
stays the stock folded digital bytes (mod_pad_transform_run takes the
stock pad). Analog pads, sources and guarded frames are unchanged.

Tests: pad_external_input_test (digital player: frame has the real lx and
unfolded buttons, decline and pass-through deliver the stock digital
bytes, no host-pad query for analog / guarded / source ports),
mod_pad_transform_test (decline returns the stock pad, output pre-filled
from it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:24:54 -07:00

23 lines
1.0 KiB
C

#pragma once
#include "mod_plugins.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Storage and per-frame validation for psx_mod_set_pad_transform (stage 2b of
* pad_external_input.h). Main (emulation) thread only.
*
* run(): 0 = no transform and no release pending (caller delivers the stock
* pad). 1 = *out is what to deliver: the transform's validated output, the
* stock pad when it declined, a neutral frame of the frame's type when its
* output was invalid, or the one neutral release frame owed after a
* detach/reset. `stock` is the pad stages 1-2 resolved, which the output
* arrives pre-filled with; NULL = the frame itself. reset() detaches every transform, leaving that release owed.
* initial_type(): the registered boot/hotplug type, or -1. */
int mod_pad_transform_run(uint32_t player, const PSXModPadFrame *frame,
const PSXModPadOutput *stock, PSXModPadOutput *out);
void mod_pad_transform_reset(void);
int mod_pad_transform_initial_type(uint32_t player);
#ifdef __cplusplus
}
#endif