fix(libSceVideoOut): answer the event getters as firmware 13.42 does #18308

Merged
zaryabzip merged 3 commits from upstream-pr/18308 into main 2026-11-13 01:19:44 +00:00
zaryabzip commented 2026-11-11 05:37:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-11-11T05:37:06Z.


What

The three VideoOut event getters now give firmware 13.42's answers:

Call Firmware 13.42 main
sceVideoOutGetEventId(nullptr) 0x80290002 (INVALID_ADDRESS) throws
sceVideoOutGetEventData with either pointer null 0x80290002 throws
sceVideoOutGetEventCount of an event of another filter bits 12 to 15 of data 0x8029000d (INVALID_EVENT)

Source. @BunnyFl's reading of libSceVideoOut.sprx on #15134 (comment), all three read to every return. It came from disassembly; nothing was run on a console.

  • sceVideoOutGetEventId (entry 0x127e0): a null event gives 0x80290002. A filter other than 0xfff3 gives 0x8029000d. Otherwise it switches on the ident's top 16 bits.
  • sceVideoOutGetEventData (entry 0x12880): either pointer null gives 0x80290002. A filter other than 0xfff3 gives 0x8029000d. Otherwise it stores data >> 16, sign-extended only for a negative flip event.
  • sceVideoOutGetEventCount (entry 0x12850) returns bits 12 to 15 of data and checks nothing.

The current debt entry already says a null pointer throws here where shadPS4 and fpPS4 return INVALID_ADDRESS. The firmware agrees with them.

Change (Event.cpp).

  • The two null checks return VIDEO_OUT_ERROR_INVALID_ADDRESS.
  • sceVideoOutGetEventCount drops its filter check.
  • A null event in sceVideoOutGetEventCount still throws: the firmware reads through it, so there is no code to return.
  • The other-filter and unknown-id answers of the first two calls are unchanged, since the firmware has the same 0x8029000d there.

Debt (libSceVideoOut.md). The existing getter entry now cites the 13.42 reading. It records the null throw in GetEventCount, and that GetEventId still returns the event id itself, where the firmware maps the top 16 bits of its own idents.

Test (GuestVideoOutEventId.cpp, ctest guest_video_out_event_id, no display needed).

  • The three Throws rows for the null pointers become Returns(..., 0x80290002), and the null-event row also checks that data stays unwritten.
  • RejectsEventOfAnotherFilter now expects GetEventCount to return the event's count bits. The graphics-core event's data becomes 0x5001, so that row expects 5, not 0.

Overlap. #17292 (@al3w0f205, test-only) merged first. 93f03f02f5 merges main and keeps its new rows, then this PR's null rows in place of its three Throws rows. The macOS harness still passes this head, and main's getters still fail exactly the five changed rows.

Tested

  • macOS host (arm64): the three getters were extracted verbatim from Event.cpp into a host harness and linked with this test file.
    • This head passes.
    • main's getters fail exactly the five changed rows: the two other-filter count rows return 0x8029000d, and the three null rows throw.
  • Windows, by JJenkx at f32ba8c2e1 merged onto main a7ac923b80, a clean merge (comment). Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release: guest_video_out_event_id passes 3 of 3.
  • Windows, by gabichuuuuu at f32ba8c2e1 merged onto main 28237a8567, a clean merge (comment). Windows 11 x64, WinLibs GCC 15.2.0 r7, Ninja, Release: guest_video_out_event_id passes 3 of 3. With this PR's code reverted to main, it fails 2 of 2.
  • 748619b4ae, after these runs, only renames the test's RejectsEventOfAnotherFilter helper to CheckEventOfAnotherFilter (review).

tools/check_conventions.py --base main passes. git merge-tree finds no conflict with main 22cc516f87 or with any open PR that merges with main, apart from #17292 above.

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 under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (the test needs no display or GPU)
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5254441285 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18308). Originally posted by [zaryabzip](https://github.com/zaryabzip) on 2026-11-11T05:37:06Z. --- ### What The three VideoOut event getters now give firmware 13.42's answers: | Call | Firmware 13.42 | `main` | |---|---|---| | `sceVideoOutGetEventId(nullptr)` | `0x80290002` (`INVALID_ADDRESS`) | throws | | `sceVideoOutGetEventData` with either pointer null | `0x80290002` | throws | | `sceVideoOutGetEventCount` of an event of another filter | bits 12 to 15 of `data` | `0x8029000d` (`INVALID_EVENT`) | **Source.** @BunnyFl's reading of `libSceVideoOut.sprx` on #15134 ([comment](https://github.com/boykopovar/AnyPS5/issues/15134#issuecomment-6755215803)), all three read to every return. It came from disassembly; nothing was run on a console. - `sceVideoOutGetEventId` (entry `0x127e0`): a null event gives `0x80290002`. A filter other than `0xfff3` gives `0x8029000d`. Otherwise it switches on the ident's top 16 bits. - `sceVideoOutGetEventData` (entry `0x12880`): either pointer null gives `0x80290002`. A filter other than `0xfff3` gives `0x8029000d`. Otherwise it stores `data >> 16`, sign-extended only for a negative flip event. - `sceVideoOutGetEventCount` (entry `0x12850`) returns bits 12 to 15 of `data` and checks nothing. The current debt entry already says a null pointer throws here where shadPS4 and fpPS4 return `INVALID_ADDRESS`. The firmware agrees with them. **Change** (`Event.cpp`). - The two null checks return `VIDEO_OUT_ERROR_INVALID_ADDRESS`. - `sceVideoOutGetEventCount` drops its filter check. - A null event in `sceVideoOutGetEventCount` still throws: the firmware reads through it, so there is no code to return. - The other-filter and unknown-id answers of the first two calls are unchanged, since the firmware has the same `0x8029000d` there. **Debt** (`libSceVideoOut.md`). The existing getter entry now cites the 13.42 reading. It records the null throw in `GetEventCount`, and that `GetEventId` still returns the event id itself, where the firmware maps the top 16 bits of its own idents. **Test** (`GuestVideoOutEventId.cpp`, ctest `guest_video_out_event_id`, no display needed). - The three `Throws` rows for the null pointers become `Returns(..., 0x80290002)`, and the null-event row also checks that `data` stays unwritten. - `RejectsEventOfAnotherFilter` now expects `GetEventCount` to return the event's count bits. The graphics-core event's `data` becomes `0x5001`, so that row expects 5, not 0. **Overlap.** #17292 (@al3w0f205, test-only) merged first. `93f03f02f5` merges `main` and keeps its new rows, then this PR's null rows in place of its three `Throws` rows. The macOS harness still passes this head, and `main`'s getters still fail exactly the five changed rows. ### Tested - **macOS host (arm64)**: the three getters were extracted verbatim from `Event.cpp` into a host harness and linked with this test file. - This head passes. - `main`'s getters fail exactly the five changed rows: the two other-filter count rows return `0x8029000d`, and the three null rows throw. - **Windows, by JJenkx** at `f32ba8c2e1` merged onto `main` `a7ac923b80`, a clean merge ([comment](https://github.com/boykopovar/AnyPS5/pull/18308#issuecomment-6788602974)). Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release: `guest_video_out_event_id` passes 3 of 3. - **Windows, by gabichuuuuu** at `f32ba8c2e1` merged onto `main` `28237a8567`, a clean merge ([comment](https://github.com/boykopovar/AnyPS5/pull/18308#issuecomment-6814542784)). Windows 11 x64, WinLibs GCC 15.2.0 r7, Ninja, Release: `guest_video_out_event_id` passes 3 of 3. With this PR's code reverted to `main`, it fails 2 of 2. - `748619b4ae`, after these runs, only renames the test's `RejectsEventOfAnotherFilter` helper to `CheckEventOfAnotherFilter` ([review](https://github.com/boykopovar/AnyPS5/pull/18308#pullrequestreview-5878773219)). `tools/check_conventions.py --base main` passes. `git merge-tree` finds no conflict with `main` `22cc516f87` or with any open PR that merges with `main`, apart from #17292 above. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a (the test needs no display or GPU) - [x] AI-assisted: <!-- yes / no --> yes (Claude Code)
MarcZX10 commented 2026-11-12 17:10:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T17:10:12Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

The head is f32ba8c2e185b791616517fc7c52b9fdc1e6e08f. The diff does what the description says in the code, and I found no defect in the code it changes. The firmware 13.42 answers come from disassembly that is not in the repository, so they are not verified here.

What I ran

Head SHA: f32ba8c2e185b791616517fc7c52b9fdc1e6e08f. No build and no test run, per the review rules for this run.

python3 repo_read.py search sceVideoOutGetEvent

Files read in full at the head: core/libs/prx/libSceVideoOut/src/Event.cpp (lines 1 to 30, 160 to 199), core/libs/tests/GuestVideoOutEventId.cpp (all 95 lines), and diff.patch for the three changed files.

Results

Check Result Note
Diff matches the description passed Three getters, test rows and debt entry agree
Other callers of the getters passed 28 matches; none relies on the old throws
guest_video_out_event_id ctest not run No build in this review
Firmware 13.42 answers not verified Disassembly is not in the repository
macOS harness and Windows check not run Author-reported; Windows run pending
check_conventions.py, git merge-tree not run Author-reported

Findings

Blocking

None.

Non-blocking

  • core/libs/tests/GuestVideoOutEventId.cpp:44: RejectsEventOfAnotherFilter now expects sceVideoOutGetEventCount to return the event's count bits, so the name no longer matches the row. Renaming it (for example to CheckEventOfAnotherFilter) would keep the test readable.

Sources

Not verified

  • Firmware 13.42 return values for the null pointers and the other-filter case. Only the author's disassembly reading supports them.
  • The guest test on this head: not built or run here.
  • The macOS host harness and the Windows run: author-reported.
  • tools/check_conventions.py --base main and the git merge-tree results: author-reported.
  • The overlap with #17292: not checked.
  • No negative control was run.

To get this to a good state

Nothing is required. The rename in the Non-blocking list is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5878773219 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18308#pullrequestreview-5878773219). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T17:10:12Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. The head is `f32ba8c2e185b791616517fc7c52b9fdc1e6e08f`. The diff does what the description says in the code, and I found no defect in the code it changes. The firmware 13.42 answers come from disassembly that is not in the repository, so they are not verified here. ## What I ran Head SHA: `f32ba8c2e185b791616517fc7c52b9fdc1e6e08f`. No build and no test run, per the review rules for this run. ``` python3 repo_read.py search sceVideoOutGetEvent ``` Files read in full at the head: `core/libs/prx/libSceVideoOut/src/Event.cpp` (lines 1 to 30, 160 to 199), `core/libs/tests/GuestVideoOutEventId.cpp` (all 95 lines), and `diff.patch` for the three changed files. ## Results | Check | Result | Note | |---|---|---| | Diff matches the description | passed | Three getters, test rows and debt entry agree | | Other callers of the getters | passed | 28 matches; none relies on the old throws | | `guest_video_out_event_id` ctest | not run | No build in this review | | Firmware 13.42 answers | not verified | Disassembly is not in the repository | | macOS harness and Windows check | not run | Author-reported; Windows run pending | | `check_conventions.py`, `git merge-tree` | not run | Author-reported | ## Findings ### Blocking None. ### Non-blocking - `core/libs/tests/GuestVideoOutEventId.cpp:44`: `RejectsEventOfAnotherFilter` now expects `sceVideoOutGetEventCount` to return the event's count bits, so the name no longer matches the row. Renaming it (for example to `CheckEventOfAnotherFilter`) would keep the test readable. ## Sources - Event getters at the head, lines 171 to 195: https://github.com/boykopovar/AnyPS5/blob/f32ba8c2e185b791616517fc7c52b9fdc1e6e08f/core/libs/prx/libSceVideoOut/src/Event.cpp#L171-L195 - The firmware reading is cited by the author as a comment on issue 15134 (https://github.com/boykopovar/AnyPS5/issues/15134#issuecomment-6755215803). I did not check it. ## Not verified - Firmware 13.42 return values for the null pointers and the other-filter case. Only the author's disassembly reading supports them. - The guest test on this head: not built or run here. - The macOS host harness and the Windows run: author-reported. - `tools/check_conventions.py --base main` and the `git merge-tree` results: author-reported. - The overlap with #17292: not checked. - No negative control was run. ## To get this to a good state Nothing is required. The rename in the Non-blocking list is optional.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18308
No description provided.