From b6f011c8f68c2919725ed992d3cd6219c483746b Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:50:26 +0300 Subject: [PATCH] event_queue: Add clear flag to events and don't return error --- src/core/libraries/gnmdriver/gnmdriver.cpp | 2 +- src/core/libraries/kernel/event_queue.cpp | 2 +- src/core/libraries/videoout/video_out.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index 37403d13..77a13800 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -346,7 +346,7 @@ s32 PS4_SYSV_ABI sceGnmAddEqEvent(SceKernelEqueue eq, u64 id, void* udata) { EqueueEvent kernel_event{}; kernel_event.event.ident = id; kernel_event.event.filter = SceKernelEvent::Filter::GraphicsCore; - kernel_event.event.flags = SceKernelEvent::Flags::Add; + kernel_event.event.flags = SceKernelEvent::Flags::Clear; kernel_event.event.fflags = 0; kernel_event.event.data = id; kernel_event.event.udata = udata; diff --git a/src/core/libraries/kernel/event_queue.cpp b/src/core/libraries/kernel/event_queue.cpp index 18561d6b..7d5163cf 100644 --- a/src/core/libraries/kernel/event_queue.cpp +++ b/src/core/libraries/kernel/event_queue.cpp @@ -94,7 +94,7 @@ int EqueueInternal::GetTriggeredEvents(SceKernelEvent* ev, int num) { for (auto& event : m_events) { if (event.IsTriggered()) { - if (ev->flags & SceKernelEvent::Flags::Clear) { + if (event.event.flags & SceKernelEvent::Flags::Clear) { event.Reset(); } diff --git a/src/core/libraries/videoout/video_out.cpp b/src/core/libraries/videoout/video_out.cpp index 51cfcf4c..826b2247 100644 --- a/src/core/libraries/videoout/video_out.cpp +++ b/src/core/libraries/videoout/video_out.cpp @@ -50,13 +50,15 @@ s32 PS4_SYSV_ABI sceVideoOutAddFlipEvent(Kernel::SceKernelEqueue eq, s32 handle, Kernel::EqueueEvent event{}; event.event.ident = SCE_VIDEO_OUT_EVENT_FLIP; event.event.filter = Kernel::SceKernelEvent::Filter::VideoOut; + event.event.flags = Kernel::SceKernelEvent::Flags::Clear; event.event.udata = udata; event.event.fflags = 0; event.event.data = 0; event.data = port; + eq->AddEvent(event); port->flip_events.push_back(eq); - return eq->AddEvent(event); + return ORBIS_OK; } s32 PS4_SYSV_ABI sceVideoOutAddVblankEvent(Kernel::SceKernelEqueue eq, s32 handle, void* udata) { @@ -74,13 +76,15 @@ s32 PS4_SYSV_ABI sceVideoOutAddVblankEvent(Kernel::SceKernelEqueue eq, s32 handl Kernel::EqueueEvent event{}; event.event.ident = SCE_VIDEO_OUT_EVENT_VBLANK; event.event.filter = Kernel::SceKernelEvent::Filter::VideoOut; + event.event.flags = Kernel::SceKernelEvent::Flags::Clear; event.event.udata = udata; event.event.fflags = 0; event.event.data = 0; event.data = port; + eq->AddEvent(event); port->vblank_events.push_back(eq); - return eq->AddEvent(event); + return ORBIS_OK; } s32 PS4_SYSV_ABI sceVideoOutRegisterBuffers(s32 handle, s32 startIndex, void* const* addresses,