Files
PS2Recomp/ps2xRuntime/include/runtime/ps2_gif_arbiter.h
T
Ranieri 52edf07657 Feature/agressive recompiler (#146)
* feat: added guestBranchKind enum to categorize branch types
feat: added missingFunctionPolicy enum to define behaviors for missing function scenarios
refactor: added handle guest branches and report missing functions
feat lookupFunction to utilize new dispatch logic and improve error handling for unregistered functions

* fix: fix test conflict

* feat: added debug sound driver logs

* feat: emmiter for return

* feat: added recompiler reporter
feat: added strict diagnostics flag for heavy debug calls

* feat: staticc table insted of hashmap for runtime

* feat: back file to ignore

* feat: explode code across helpers and classes

* feat: update codegen test
feat: better guest nop check

* feat: fix link problem on linux

* feat: fix Segmentation fault

* feat: added recompile replace for DMA and MMIO
feat: added a clean memory helpers
feat: use memory helpers across the project
feat: fix ucrt on msvc

* feat: undo messup merge
2026-07-07 10:14:25 -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