Fix VideoOut events (#2330)

* Fix event data for VideoOut events

Fix is based on some decompilation work shared by red_prig.

* Cleanup

* Oops

* Style fixes

* Clang

* Fix libSceVideoOut event idents

Based on some decompilation work, events coming from libSceVideoOut use a separate set of values for identifiers. These values are only converted to OrbisVideoOutEventId values during calls to sceVideoOutGetEventId.
For convenience, I've placed all relevant identifiers into a enum called OrbisVideoOutInternalEventId.
Thanks to @red_prig for the tips.

* Fix?

Seems like `static_cast<u32>(hint) & 0xFF == event.ident` here, and doing those right shifts on the event.ident winds up breaking stuff.
Without this change, the if always fails because event_id was getting set to 0 instead.

* Clang
This commit is contained in:
Stephen Miller 2025-02-03 09:37:28 -06:00 committed by GitHub
parent 02ad2b78fa
commit 8ad650582a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 69 additions and 10 deletions

View file

@ -84,7 +84,11 @@ bool EqueueInternal::TriggerEvent(u64 ident, s16 filter, void* trigger_data) {
std::scoped_lock lock{m_mutex};
for (auto& event : m_events) {
if (event.event.ident == ident && event.event.filter == filter) {
event.Trigger(trigger_data);
if (filter == SceKernelEvent::Filter::VideoOut) {
event.TriggerDisplay(trigger_data);
} else {
event.Trigger(trigger_data);
}
has_found = true;
}
}