more completed (but not finished) sceVideoOutAddFlipEvent

This commit is contained in:
georgemoralis 2023-09-05 14:28:52 +03:00
parent 3a7563ef64
commit 466cfe96e6
3 changed files with 29 additions and 7 deletions

View File

@ -81,12 +81,12 @@ s32 PS4_SYSV_ABI sceVideoOutAddFlipEvent(LibKernel::EventQueues::SceKernelEqueue
event.event.udata = udata;
event.event.fflags = 0;
event.event.data = 0;
// event.filter.delete_event_func = flip_event_delete_func;//called in sceKernelDeleteEvent
// event.filter.reset_event_func = flip_event_reset_func;//called in sceKernelWaitEqueue
// event.filter.trigger_event_func = flip_event_trigger_func;//called in sceKernelTriggerEvent
// event.filter.delete_event_func = flip_event_delete_func;//called in sceKernelDeleteEvent //TODO
// event.filter.reset_event_func = flip_event_reset_func;//called in sceKernelWaitEqueue //TODO
// event.filter.trigger_event_func = flip_event_trigger_func;//called in sceKernelTriggerEvent //TODO
event.filter.data = ctx;
int result = 0; // sceKernelAddEvent(eq, event);
int result = eq->addEvent(event);
ctx->m_flip_evtEq.push_back(eq);

View File

@ -1,5 +1,24 @@
#include "event_queue.h"
#include "debug.h"
namespace HLE::Kernel::Objects {
EqueueInternal::~EqueueInternal() {}
int EqueueInternal::addEvent(const EqueueEvent& event) {
Lib::LockMutexGuard lock(m_mutex);
if (m_events.size() > 0) {
BREAKPOINT();
}
// TODO check if event is already exists and return it. Currently we just add in m_events array
m_events.push_back(event);
if (event.isTriggered) {
BREAKPOINT(); // we don't support that either yet
}
return 0;
}
}; // namespace HLE::Kernel::Objects

View File

@ -1,7 +1,8 @@
#pragma once
#include <types.h>
#include <Lib/Threads.h>
#include <string>
#include <vector>
namespace HLE::Kernel::Objects {
@ -64,8 +65,10 @@ class EqueueInternal {
EqueueInternal() = default;
virtual ~EqueueInternal();
void setName(const std::string& m_name) { this->m_name = m_name; }
int addEvent(const EqueueEvent& event);
private:
std::string m_name;
Lib::Mutex m_mutex;
std::vector<EqueueEvent> m_events;
};
}; // namespace HLE::Kernel::Objects