Skip to content

feat(libSceVideoOut): deliver pre-vblank start events - #2152

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:feat/videoout-pre-vblank-start-events
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MathiasDevelopes:feat/videoout-pre-vblank-start-events

Conversation

@MathiasDevelopes

Copy link
Copy Markdown
Contributor

What

[sceVideoOutAddPreVblankStartEvent](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceVideoOut/src/Event.cpp) threw VideoOut: physical pre-vblank timing is not implemented. Planet Coaster (PPSA01736) registers a pre-vblank start event at startup and does not catch the exception, so it aborts:

[libc] unhandled exception 'St13runtime_error' thrown from ...
terminate called after throwing an instance of 'std::runtime_error'
FATAL: abort() (SIGABRT)

(what() is not printed on this path. A temporary print in __cxa_throw showed it as VideoOut: physical pre-vblank timing is not implemented.)

The event is now registered through the same registerVideoOutEvent path as the vblank event, so re-registration updates udata and sceVideoOutDeletePreVblankStartEvent (already implemented) removes it. In [VideoOutDriver::vblankEnd](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp), each emulated vblank tick increments the port's preVblankStatus count, which already existed and was unused, and stamps its process time. It then triggers the pre-vblank start events with that count as data, just before the vblank events of the same tick.

How long before the vblank the console signals pre-vblank start is unknown. The vblank here is a host timer with no scanout, so the event fires at the vblank tick. This is recorded in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md) under unknown function info. [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/0fe263a4760dfbfa973366890061749b4af0de97/src/core/libraries/videoout/video_out.h#L52) defines the event ID but neither registers nor triggers the event, so it gives no reference timing either.

Tested

Windows 11, MinGW-w64 15.2.0, RTX 3060.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

sceVideoOutAddPreVblankStartEvent threw "physical pre-vblank timing is
not implemented", so titles that pace on it stopped at startup. It now
registers the event like the vblank event does, and each emulated vblank
tick triggers the pre-vblank start events just before the vblank events,
with the pre-vblank count as data. The console's lead time is unknown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 10:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
@oneandonlydean
oneandonlydean merged commit b57e66f into boykopovar:main Oct 10, 2026
7 of 8 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…t-pre-vblank-start-events

feat(libSceVideoOut): deliver pre-vblank start events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants