video_out_mouse_tests holds a button, opens a dialog and releases it: the title
receives one reset instead of the release, later presses and releases are
dropped, and both reach the title again once the dialog closed.
When the first button event arrives while a modal dialog captures input, MouseInput
publishes a button reset instead of it and drops every press and release until
the dialog is gone, so a button the title saw pressed before the dialog opened
does not stay pressed when its release is dropped.
video_out_mouse_tests checks that a button press made while a dialog is shown
produces no mouse data, and that presses and releases reach the title once the
dialog closed.
MouseInput drops a button press while a modal dialog captures input, so the click
that answers the dialog is not also delivered to the title. Releases still reach
it in this commit.
video_out_mouse_tests checks that the wheel reaches the title without a dialog,
that motion and wheel produce no mouse data while a dialog is shown, and that
motion is delivered again once it closed.
MouseInput drops relative motion and wheel steps while a modal dialog captures
input, so moving or scrolling to answer the dialog does not also move the title's
cursor. Button events are unchanged by this commit. video_out_mouse_tests links
libSceIme for the dialog tests that follow.
When the first key event arrives while a modal dialog captures input, KeyboardInput
publishes a key reset instead of it and then drops every key press and release
until the dialog is gone, so a key the title saw pressed before the dialog opened
does not stay pressed when its release is dropped.
KeyboardInput no longer publishes a key press to libSceKeyboard while a modal dialog
captures input, so the keys that answer the dialog are not also typed into the
title. Key releases still reach it. keyboard_tests links libSceIme because it
builds KeyboardInput.cpp itself.
pad_sdl_tests opens a two-button dialog with a virtual controller: the title reads
only the neutral intercepted state while it is shown, a Cross press answers it
with the focused button, the same press stays hidden from the title until it is
released, and the next press reaches the title.
While a modal dialog captures input, the controller hand-off that already serves
an IME keyboard publishes slot 0's buttons and left stick to the dialog and
returns the neutral intercepted state to the title, and the button held when the
dialog closes stays hidden until it is released. Key presses, mouse button
presses, wheel steps and motion no longer reach the keyboard-to-pad mapping while
the dialog is shown; releases still do, so no mapped button stays pressed.
video_out_dialog_input_tests feeds synthetic SDL events to DialogInput with a
three-button dialog open: every focus key and the wheel, the confirming and
cancelling keys and buttons, repeats, events for another window, unmapped keys
and buttons, and events while no dialog is open.
DialogInput turns window events into modal dialog inputs: Left, Up, Right, Down,
Tab and Shift+Tab and the mouse wheel move the focus, Enter, the keypad Enter and
Space and a left click confirm, Escape and a right click cancel. Repeats of the
confirming and cancelling keys, other windows' events and other keys are
ignored. The presentation thread feeds it with the events it already polls for
the IME text input.
The presentation thread registers itself as a modal dialog presenter while its
window exists and withdraws on exit, so a dialog opened with no window to show
it is refused and keeps its caller's own answer. Before each flip it reads the
pending dialog and passes it to the driver, or clears it. The IME keyboard keeps
the overlay: while it is shown or captures the keyboard or the pad, the dialog
is not read.
The motor rumble and the trigger rumble of non-DualSense controllers reach SDL with the amplitude a title asked for and no host-side way to reduce or disable it. Build both commands through the rumble intensity helper: at the default of 100 the command is the one built before, and at 0 the host only ever receives a stop. The variable is read when the pad input starts, so an invalid value stops the game there. Vibration that a title plays as audio and that falls back to motor rumble goes through the same path and is scaled with it. DualSense adaptive trigger effects are left untouched.
PS5_Vulkan measured on a base PS5 set to 1080p output that
sceVideoOutIsOutputSupported(15) answers 0, neither 1 nor an error, and
that sceVideoOutConfigureOutput(15) then returns 0x80290019, in a title
declaring high-frame-rate output. A host display below 120 Hz answered
0x80290016 to both instead. Titles that branch on the answer being 1
are unchanged; the undeclared-title answer stays 0x80290016.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PS5_Vulkan measured on a PS5 (firmware 13.40) that
sceVideoOutRegisterBuffers2 refuses a set at buffers 15 to 19 with
0x80290001. The call threw instead. The other out-of-range arguments
keep throwing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 4 KiB display buffer alignment check now names linear and PS4
buffers, because PS4 tiled display buffers may be 4 KiB aligned too.
video_out_flip_ps4 still looked for the old text when a PS4 buffer set
is changed to the PS5 tiled layout, so it failed although the change is
still refused.
A press published before the keyboard captured the pad stayed in the
read latch and in the sample queue. The first ReadState after the
handoff returned it beside the Intercepted bit, and Read drained the
queued samples from before the capture unmasked. Clear both when a
sample starts the capture, so every read while it lasts holds only the
Intercepted bit.
Found by MarcZX10's review.
sceVideoOutGetEventId, sceVideoOutGetEventData and sceVideoOutGetEventCount
threw for an event whose filter is not EVFILT_VIDEO_OUT, and
sceVideoOutGetEventId also threw for a VideoOut id this library never
registers. A title that asks for the id of each event in a queue that
also holds other events stopped there. PPSA28180 compares the result
with VIDEO_OUT_ERROR_INVALID_EVENT, as reported in #11376 (item 6).
They return VIDEO_OUT_ERROR_INVALID_EVENT (0x8029000D) instead, before
sceVideoOutGetEventData writes its output, as the PS4 libraries of
shadPS4 and fpPS4 do. The id is compared in full, so an id above 32
bits is no longer read as a registered one. A null pointer still
throws. The PS5 result is unverified and recorded in the libSceVideoOut
debt.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main declares sceVideoOutCursorEnable, Disable, SetImageAddress and
SetPosition in the library's public header; the second declarations in
Output.hpp made the header audit fail on duplicates.
The removed checks asserted the exact failure text of cursor image, image
address and index calls and of a null flip status output. Those calls are
still not implemented and still refuse explicitly; the tests no longer pin
what they answer.
SDL_NumJoysticks returns a negative value on error, which the host
controller check turned into exit code 77 and CTest reported as a
skip. A negative count now fails the test with SDL_GetError, and only
a positive count skips it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>