Commit Graph
30 Commits
Author SHA1 Message Date
Dean 3e7d1d297c Merge pull request #8138 from bl4nkTHEBUNKER/fix/pad-touchpad-resolution
fix(libScePad): report the DualSense touchpad resolution
2026-10-21 06:25:52 +13:00
Adrià 1d41645527 Merge pull request #7633 from WallisSkill/fix/dualsense-audio-haptics
fix(libSceVideoOut): rumble a DualSense from haptic audio without a sound card
2026-10-20 13:07:58 +02:00
Adrià 36b72ad84a Merge pull request #7632 from WallisSkill/fix/pad-output-coalesce
fix(libSceVideoOut): coalesce controller output updates
2026-10-20 13:00:37 +02:00
dantdmdarealguy e3125e43af feat(agc,videoout): save the displayed frame as a PNG with a screenshot key
F12 (the new Screenshot input action) requests a capture of the next
presented display buffer. The presenter records it with the existing
APS5_DUMP_FRAMES GPU readback at full resolution, and the frame dump
writer thread encodes it with decoder_png into anyps5-screenshots/
beside the executable, or ANYPS5_SCREENSHOTS.
2026-10-20 00:28:39 -05:00
bl4nkTHEBUNKER f57b79ef51 fix(libScePad): report the DualSense touchpad resolution
The controller information reported 1920 by 943, the DualShock 4 height with
the DualSense pixel density, while the host controller's fingers were scaled to
1920 by 942 and the keyboard touch contacts sat on the 942 centre line. A title
that maps touch coordinates through the reported resolution lost the lower part
of the touchpad. The width and height now live beside the pad state and all
three places use them.
2026-10-20 01:52:50 +02:00
Eli Yarson b8607f4ced feat(videoout): write pad and present telemetry to APS5_VIDEOOUT_TELEMETRY_DIR
APS5_VIDEOOUT_TELEMETRY_DIR=<directory> appends one JSON object per line to <directory>/videoout.jsonl: a contract line for the run (commit and pid), a pad line whenever the published pad state changes in its buttons, sticks, L2 or R2, a present line after the first present and every 30 after that with the count and rate the window title shows, and a drops line with the number of lines the writer discarded, reported every ten seconds while it grows and once at a normal exit. A bounded queue of 4096 lines and one writer thread batch the file, so neither the present nor the input path waits for it; a pad change that the full queue refused stays pending for a later publish, and the frame count moves from UpdateTitle's function-static to DisplayWindow so the input path can name the present it belongs to.

Without the variable no file is opened and no thread is started: a present or an input update costs one call that checks a guard variable and returns null.
2026-10-19 15:27:49 +02:00
WallisSkillandClaude Opus 5.5 8540328431 fix(libSceVideoOut): pace only the light bar and resend refused effects
The 30 ms limit gated all controller output, so a rumble pulse shorter
than the interval could be lost and a stop could wait up to 30 ms.
Rumble goes out on every output change again, as on main; SDL already
skips repeated values and merges consecutive rumble reports. Only the
light bar is paced: a changed colour is sent at most every 30 ms, always
the latest one, and a colour SDL refuses is retried after the interval.

The trigger effect is cached only when SDL_GameControllerSendEffect
succeeds, so a refused effect is sent again on the next update as it was
before. LightBarPacer and TriggerEffectCache hold these decisions;
pad_output_pacing covers changes, retries, a new controller and a light
bar animated every frame at 120 Hz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 02:14:44 +07:00
WallisSkillandClaude Opus 5.5 ffa63e8fec fix(libSceVideoOut): rumble a DualSense from haptic audio without a sound card
AudioOut2 turns controller haptic PCM into motor rumble only when no
controller sound card plays it, which is the case for a DualSense over
Bluetooth. PadInput then dropped that rumble for every DualSense, so
titles that vibrate through haptic audio never rumbled one over
Bluetooth. A DualSense now takes it like any other controller; with a
sound card no haptic rumble is submitted, so nothing plays twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:09:43 +07:00
WallisSkillandClaude Opus 5.5 be1287b66c fix(libSceVideoOut): coalesce controller output updates
Every change of the pad output state sent a rumble, light bar and trigger
effect update to SDL, and the trigger effect was sent again even when it
had not changed. Titles that animate the light bar or drive rumble from
haptic audio change that state every frame, so at 120 Hz about 110
reports a second were queued while SDL's HIDAPI rumble thread sends at
most one per 10 ms. Different report kinds do not merge in its queue, so
the backlog grew: rumble arrived ever later, and disconnecting the
controller blocked the presenter until the queue drained.

Updates now go out at most every 30 ms with the latest state, and the
trigger effect is sent only when it changes or a controller connects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:02:01 +07:00
Yunus Shaikh 2a3946dbb0 Merge main into feat/videoout-performance-overlay
Main adds StorageTextureCacheBudget where this branch adds the public
LargestDeviceLocalHeap wrapper, in both the header and the source.
Keep both.
2026-10-17 15:57:45 -07:00
TamaleroandClaude Opus 5.5 07dd28f448 fix(libSceVideoOut): keep mouse clicks and motion off the pad while the title reads the mouse
The default bindings map the left and right mouse buttons to Square and
R2, and mouse mode maps motion to the right stick. A title that opens the
mouse with sceMouseOpen therefore gets every click twice: as a mouse
button and as a pad press. PPSA15388 treats the pad press as a switch to
gamepad input, re-centres its cursor and drops the click, so menu items
cannot be clicked.

While libSceMouse has a handle open, KeyboardMouse ignores mouse motion
and mouse-button presses. Releases still pass, so a button held before
the title opened the mouse is let go. Keys and the wheel are unchanged,
as with the IME guard next to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:40:53 -07:00
Yunus Shaikh a41be04ed9 feat(videoout): toggle the performance overlay with F10
TogglePerformanceOverlay is bound to F10 by default and, like
ToggleFullscreen, accepts only a keyboard key in anyps5-input.ini.
2026-10-14 16:36:48 +00:00
Joel Fernandes dcfabcc579 feat(pad): bridge controller audio haptics to motor rumble 2026-10-14 13:45:00 +02:00
p3nicillinandClaude Opus 5.5 435be9905d feat(libSceIme): open a panel-less IME fed by the host keyboard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:49:04 +01:00
AlxcBTWandClaude Opus 5.5 38bc0fd348 feat(input): turn mouse speed into a smooth right-stick tilt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 17:00:20 +02:00
dantdmdarealguy 3c581619d3 feat(input): configure stick deadzones and mouse sensitivity
anyps5-input.ini accepts LeftStickDeadzone and RightStickDeadzone (whole
percent, 0 to 90), a radial deadzone on the controller sticks whose
remaining travel is rescaled to the full range, and MouseSensitivity
(above 0, at most 10), which replaces the fixed factor of 1 for mouse
look. The defaults keep the current mapping exactly.
2026-10-11 15:57:12 -05:00
hamb3r ca2cbc29a3 style(pad): remove disallowed explanatory comment 2026-10-05 16:34:57 +03:00
hamb3r aad1be52e8 fix(pad): synthesize touch contact for Xbox View 2026-10-05 16:13:26 +03:00
hamb3randsaulo benigno a347b02b48 feat(pad): map Xbox View button to PS5 touchpad
Controllers other than DualShock 4 and DualSense lack a dedicated touchpad button. Maps the SDL Back button (View on Xbox) to PadButton::TouchPad for non-PlayStation controllers.

Co-Authored-By: saulo benigno <saulobenigno@gmail.com>
2026-10-05 03:11:15 +03:00
Dean Galvin e2609a87be fix(pad): build SDL with HIDAPI so DualSense output reaches the controller
The bundled SDL was configured with SDL_HIDAPI OFF, so a DualSense went
through the generic joystick driver of the platform: no touchpad, no
light bar and no DualSense effect reports, which left the light bar,
trigger effect and (on Linux) rumble requests that PadInput already
sends through SDL without effect on the controller. With HIDAPI, SDL's
PS5 driver handles the pad: touchpad, light bar, rumble, trigger effects
and the motion sensors.

A USB pad always uses the driver's enhanced reports.
SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE enables them for a Bluetooth pad as
well, which otherwise stays on the simple report without effects.

pad_sdl checks that the bundled SDL is built with the HIDAPI joystick
driver.
2026-10-01 00:35:57 +13:00
OverkillLabsandClaude Sonnet 5 e532b19cee refactor(pad): trim comments and apply naming conventions
Bring the pad-gamepad-haptics diff in line with docs/dev/CONVENTIONS.md:
strip explanatory/rationale comments (struct layouts, algorithm notes,
rewired-NID rationale) down to code only, and rename the anonymous-
namespace helpers in PadState.cpp (Normalize/Fuse/EncodeZones/MaxOf/
ScaleStrength) to camelCase to match upstream's free-function style.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:24:39 +03:00
OverkillLabsandClaude Sonnet 5 1d245cbeb2 videoout: bridge SDL sensor/haptics to pad output alongside existing input-mapping flow
Reconcile our SDL gamepad motion/haptics work with upstream's
configurable keyboard/mouse binding feature (PadInput now built around
Pad::LoadInputMapping() and a std::vector<Pad::InputBinding>). Upstream's
openFirstAvailableController()/openController(deviceIndex) flow and
HandleEvent/Update/publish logic for keyboard, mouse, and wheel
bindings are kept as-is (including APS5_NO_PAD_INPUT handling); the
sensor-enabling and host-haptics steps are grafted on as additional
work done once a controller is open:

- openController(deviceIndex) now also calls enableSensors() and
  marks a re-apply of the current guest output request pending.
- New sampleController()/applyOutput()/enableSensors() bring in real
  gamepad sampling, motion sensor reads, DualSense touchpad finger
  tracking, and pushing rumble/light bar/adaptive trigger state out via
  SDL_GameControllerRumble/SetLED/SendEffect. sampleController()'s
  button list and trigger/stick scaling are an exact copy of the
  button/trigger/stick reading that used to be inlined in publish()
  under the SDL_GameControllerGetAttached check (no deadzone added,
  no extra button remapped) -- only the motion, touchpad, and
  device-kind sampling on top of it are new.
- Update() now also samples the controller and applies pending output
  every tick, in addition to upstream's SDL_GameControllerUpdate() call
  and its keyboard/mouse/wheel timing logic.
- publish() seeds PadInputState from the sampled gamepad state first
  (buttons/sticks/analog triggers/motion/touch/device kind), then
  layers upstream's keyboard/mouse binding loop on top exactly as
  upstream had it, so a bound key still overrides the gamepad the same
  way it did before this merge. Upstream's L2/R2 button-flag derivation
  is preserved, just computed once at the end from whichever value
  (gamepad or a keyboard/mouse override) ends up in analogButtonsL2/R2.
- The background-events SDL hint is now set unconditionally (previously
  only inside the "not yet initialized" branch), since upstream's own
  VideoOutDriver already brings up SDL_INIT_GAMECONTROLLER before
  PadInput is constructed, which meant the hint would never run.

No changes were needed in VideoOutDriver.cpp: PadInput lazily
initializes SDL_INIT_GAMECONTROLLER itself in
openFirstAvailableController() (already a no-op if the subsystem is up),
and the class's public interface (default-constructible, HandleEvent/
Update) is unchanged, so upstream's existing `PadInput padInput;` /
HandleEvent / Update call sites keep working without modification.
VideoOutDriver.cpp's own independent flip-queue/vblank-telemetry rework
was left untouched as out of scope.

Confidence: high for the keyboard/mouse binding path (untouched) and
for the gamepad button/stick/trigger path (byte-for-byte copy of the
pre-existing mapping); the new motion/haptics/touchpad code is novel
and builds/links cleanly but has not been run against real hardware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:43:27 +03:00
boykopovar 9dd86e99bf fix(pad): add missing header for log macros to pad input cpp 2026-09-28 08:41:20 +03:00
MartinCajiao 0644a8c38f feat(input): support SDL game controllers 2026-09-27 20:27:22 -05:00
MartinCajiao c13f0eee67 feat(input): allow configurable keyboard and mouse bindings 2026-09-27 19:54:19 -05:00
devilismyfriendandClaude Fable 5.1 af3c2024ed feat(runtime): timed waits, sync primitive fixes, heap and RTC fixes, unattended-run switches
libkernel: a TimedWait service for condition variables, semaphores, event flags, rwlocks and
equeues with the scheduler tick; mutex/cond/sem corner cases the title hits; job worker
affinity is opt-in (APS5_JOB_AFFINITY). libc: calloc/realloc heap slot swap, a default
terminate handler with a backtrace, CPU topology helper. libSceRtc export fixes with tests.
libSceVideoOut: APS5_NO_PAD_INPUT ignores host input for unattended measurements,
APS5_FLIP_QUEUE_WAIT keeps a stalled process alive for a debugger. ApplicationHeap and
GuestRtc tests wired into the test build.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-26 19:00:39 -07:00
boykopovar e392506e0a feat(pad): add enums + edit mapping 2026-09-25 16:59:23 +03:00
boykopovar 6b8e16b73e feat(video): fullsceen mode by f11 2026-09-25 11:18:58 +03:00
boykopovar 05c8146744 refactor(pad): libScePad files structure refactor 2026-09-25 00:04:19 +03:00
boykopovar ce287648bf feat(pad): add read input state logic to libScePad 2026-09-24 23:59:12 +03:00