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]>
AppKit, which SDL uses for windows, Metal surfaces, event pumping and game
controllers, works only on the main thread, and a guest never hands its
thread back. The macOS relinker emits a call to Aps5StartGuest as the
entry of a relinked executable; no library provided it.
- Aps5StartGuest runs the guest entry on a new thread with the stack size
of the main thread (at least 8 MiB) and serves the main dispatch queue
from the run loop of the main thread. The guest ends the process with
exit; a guest entry that returns aborts.
- Aps5RunOnMainThread runs a function on the main thread and waits for it,
or in place where the main thread is the caller or Aps5StartGuest was
never called.
- libSceVideoOut sends its SDL calls through OnMainThread, which carries
the exceptions back to the caller: the initialisation and shutdown of the
video and game controller subsystems, the window, its Vulkan surface and
drawable size, the event polling and the pad, mouse and keyboard input,
which are created and destroyed there. On the other platforms the
functions run in place.
- The flip test starts its tests through Aps5StartGuest on macOS, as a
relinked guest does.
Co-authored-by: mugurc <[email protected]>
PadInput opens every joystick SDL sees, so a controller attached to
the host takes slot 0 and the slot checks abort. The test now exits
with 77, registered as SKIP_RETURN_CODE, when SDL sees any host
joystick before it attaches its virtual controllers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceVideoOutGetOutputStatus derived resolution from the size of the
registered buffers, so a title that reads it right after sceVideoOutOpen
got 1 (1080p) whatever the display. In a payload process on a PS5
(firmware 12.70), with no buffer registered, the field changed with the
console's resolution setting: 2 with it on Automatic on a 4K display, 1
with it set to 1080p. Read it from the display mode SDL reports for the
window's display, next to the refresh rate, and keep it independent of
the registered buffers.
ANYPS5_VIDEO_OUT_TEST_DRIVER defaulted to SDL's offscreen driver on every
host. That driver has no Vulkan on Windows, so all thirteen flip tests that
open a display skipped there. Windows now defaults to the windows driver.
A machine without a Vulkan driver makes DisplayWindow report that Vulkan
lacks VK_KHR_surface, so the flip tests also skip on a DisplayWindow error
that names Vulkan, as they do on offscreen's message.
The controls check read exactly two events after subscribing to pre-vblank
and waiting for one vblank, and expected one of them to be PRE_VBLANK_START.
The VideoOut filter queues every vblank of the earlier VBLANK registration,
and the queue returns one registration's events before the next, so when a
second vblank lands between the earlier read and the wait (a real display's
cadence), both events read are VBLANK and the pre-vblank event is the third.
The check now reads up to eight events and requires a VBLANK for the vblank
registration and a PRE_VBLANK_START with its own user data among them.
With APS5_DUMP_FRAMES, FrameDumpWriter::Enqueue threw "frame dump queue exceeded 64 MiB" when the
writer thread fell more than 64 MiB behind, which failed the presentation and ended the title.
#4320 made that rare at the default APS5_DUMP_SCALE=4; at APS5_DUMP_SCALE=1 a 1920x1080 title
reaches it within nine frames and a 3840x2160 one on the third.
Enqueue now waits on the writer's condition variable until the frame fits, and the writer
notifies after each file; a single frame larger than the queue still throws. The VideoOut frame
dump queue test gets a wait mode at scale 1 whose third frame has to wait for the held first one.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
video_out_telemetry and video_out_telemetry_caption were registered only
for non-Windows hosts. Telemetry.cpp needs getpid, which Windows spells
_getpid, and a narrow path for OpenFromEnvironment, because a
std::filesystem::path c_str() is wide there. Register the tests with the
Windows PATH and unwind settings of the other video out tests; the caption
test skips (77) when the offscreen SDL driver has no Vulkan support.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
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.
Some titles stop on a prompt to shake the controller, which keyboard players
and controllers without motion sensors cannot answer. While the Shake input is
held (X by default), the composed pad state reports motion with the
acceleration and angular velocity flipping sign every 50 ms; a controller's own
sensor data is used otherwise.
Co-Authored-By: Claude Opus 5.5 <[email protected]>