mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-16 00:29:09 +00:00
VideoOut event cleanup (#2849)
* Readable VideoOutEvent data packing Inspired by the work of former shadPS4 devs and mostly based on red_prig's current code. * Apply DceData struct to sceVideoOutGetEventCount Makes the code easier to read * Update equeue.h * Update main.cpp * Update equeue.h * Proper struct names * Fix hint mask Thanks to red_prig for catching my mistake here. * Clang * Fix header discrepancy
This commit is contained in:
@@ -220,7 +220,7 @@ s32 PS4_SYSV_ABI sceVideoOutGetEventData(const Kernel::SceKernelEvent* ev, s64*
|
||||
if (ev->ident != static_cast<s32>(OrbisVideoOutInternalEventId::Flip) || ev->data == 0) {
|
||||
*data = event_data;
|
||||
} else {
|
||||
*data = event_data | 0xFFFF000000000000;
|
||||
*data = event_data | 0xffff000000000000;
|
||||
}
|
||||
return ORBIS_OK;
|
||||
}
|
||||
@@ -233,7 +233,8 @@ s32 PS4_SYSV_ABI sceVideoOutGetEventCount(const Kernel::SceKernelEvent* ev) {
|
||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_EVENT;
|
||||
}
|
||||
|
||||
return (ev->data >> 0xc) & 0xf;
|
||||
auto event_data = static_cast<OrbisVideoOutEventData>(ev->data);
|
||||
return event_data.count;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceVideoOutGetFlipStatus(s32 handle, FlipStatus* status) {
|
||||
|
||||
@@ -111,6 +111,12 @@ struct SceVideoOutColorSettings {
|
||||
u32 reserved[3];
|
||||
};
|
||||
|
||||
struct OrbisVideoOutEventData {
|
||||
u64 time : 12;
|
||||
u64 count : 4;
|
||||
u64 flip_arg : 48;
|
||||
};
|
||||
|
||||
void PS4_SYSV_ABI sceVideoOutSetBufferAttribute(BufferAttribute* attribute, PixelFormat pixelFormat,
|
||||
u32 tilingMode, u32 aspectRatio, u32 width,
|
||||
u32 height, u32 pitchInPixel);
|
||||
@@ -128,8 +134,8 @@ s32 PS4_SYSV_ABI sceVideoOutGetResolutionStatus(s32 handle, SceVideoOutResolutio
|
||||
s32 PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, s32 busType, s32 index,
|
||||
const void* param);
|
||||
s32 PS4_SYSV_ABI sceVideoOutClose(s32 handle);
|
||||
int PS4_SYSV_ABI sceVideoOutGetEventId(const Kernel::SceKernelEvent* ev);
|
||||
int PS4_SYSV_ABI sceVideoOutGetEventData(const Kernel::SceKernelEvent* ev, int64_t* data);
|
||||
s32 PS4_SYSV_ABI sceVideoOutGetEventId(const Kernel::SceKernelEvent* ev);
|
||||
s32 PS4_SYSV_ABI sceVideoOutGetEventData(const Kernel::SceKernelEvent* ev, s64* data);
|
||||
s32 PS4_SYSV_ABI sceVideoOutColorSettingsSetGamma(SceVideoOutColorSettings* settings, float gamma);
|
||||
s32 PS4_SYSV_ABI sceVideoOutAdjustColor(s32 handle, const SceVideoOutColorSettings* settings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user