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.udata = udata;
event.event.fflags = 0; event.event.fflags = 0;
event.event.data = 0; event.event.data = 0;
// event.filter.delete_event_func = flip_event_delete_func;//called in sceKernelDeleteEvent // 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 // 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 // event.filter.trigger_event_func = flip_event_trigger_func;//called in sceKernelTriggerEvent //TODO
event.filter.data = ctx; event.filter.data = ctx;
int result = 0; // sceKernelAddEvent(eq, event); int result = eq->addEvent(event);
ctx->m_flip_evtEq.push_back(eq); ctx->m_flip_evtEq.push_back(eq);

View file

@ -1,5 +1,24 @@
#include "event_queue.h" #include "event_queue.h"
#include "debug.h"
namespace HLE::Kernel::Objects { namespace HLE::Kernel::Objects {
EqueueInternal::~EqueueInternal() {} 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 }; // namespace HLE::Kernel::Objects

View file

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