Files
Ranieri d74a3ce139 Feature/gs refactor (#204)
* refactor: from guest  threads to EE scheduler

* feat: bad wip mpeg fix for code veronica

* feat: cheap copy from host
feat: small perf o vsync tick

* feat: added EE clock Hz
fix: fix MPEG out of sync with new EE refactor

* fix: fix lotr tests

* fix: fix cri dtx loading
fix: fix wrong mmi instruction translation
fix: fix thread info params
feat: added EE  timers decoder and consumer
feat: split SFI and IOP memory to prevent collision and overrides

* feat: revert wrong changes

* refactor: change GS architecture
2026-08-13 22:49:04 -03:00

47 lines
997 B
C++

#ifndef PS2_GIF_ARBITER_H
#define PS2_GIF_ARBITER_H
#include <cstdint>
#include <functional>
#include <vector>
enum class GifPathId : uint8_t
{
Path1 = 1,
Path2 = 2,
Path3 = 3,
};
struct GifArbiterPacket
{
GifPathId pathId;
bool path2DirectHl = false;
bool path3Image = false;
std::vector<uint8_t> data;
};
class GifArbiter
{
public:
using ProcessPacketFn = std::function<void(const uint8_t *, uint32_t)>;
GifArbiter() = default;
explicit GifArbiter(ProcessPacketFn processFn);
void setProcessPacketFn(ProcessPacketFn fn) { m_processFn = std::move(fn); }
void submit(GifPathId pathId, const uint8_t *data, uint32_t sizeBytes, bool path2DirectHl = false);
void drain();
bool empty() const { return m_queue.empty(); }
private:
ProcessPacketFn m_processFn;
std::vector<GifArbiterPacket> m_queue;
static bool isImagePacket(const uint8_t *data, uint32_t sizeBytes);
static uint8_t pathPriority(GifPathId id);
};
#endif