From e89da7a2166ecce21c0448878a2ba85cfd000497 Mon Sep 17 00:00:00 2001 From: shinyquagsire23 Date: Thu, 25 Aug 2016 22:01:44 -0700 Subject: [PATCH] Additional GX2 definitions from decaf-emu --- include/gx2/display.h | 3 +++ include/gx2/enum.h | 18 ++++++++++++++++++ include/gx2/mem.h | 24 ++++++++++++++++++++++++ include/gx2/state.h | 3 +++ include/gx2/surface.h | 5 +++++ rpl/libgx2/exports.h | 6 ++++++ 6 files changed, 59 insertions(+) create mode 100644 include/gx2/mem.h diff --git a/include/gx2/display.h b/include/gx2/display.h index f3b07fb..71f8dfd 100644 --- a/include/gx2/display.h +++ b/include/gx2/display.h @@ -58,6 +58,9 @@ GX2SetDRCScale(uint32_t x, GX2TVScanMode GX2GetSystemTVScanMode(); +GX2TVScanMode +GX2GetSystemDRCScanMode(); + GX2DrcRenderMode GX2GetSystemDRCMode(); diff --git a/include/gx2/enum.h b/include/gx2/enum.h index 203afa8..fa1b21b 100644 --- a/include/gx2/enum.h +++ b/include/gx2/enum.h @@ -174,6 +174,19 @@ typedef enum GX2IndexType GX2_INDEX_TYPE_U32 = 9, } GX2IndexType; +typedef enum GX2InvalidateMode +{ + GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER = 1 << 0, + GX2_INVALIDATE_MODE_TEXTURE = 1 << 1, + GX2_INVALIDATE_MODE_UNIFORM_BLOCK = 1 << 2, + GX2_INVALIDATE_MODE_SHADER = 1 << 3, + GX2_INVALIDATE_MODE_COLOR_BUFFER = 1 << 4, + GX2_INVALIDATE_MODE_DEPTH_BUFFER = 1 << 5, + GX2_INVALIDATE_MODE_CPU = 1 << 6, + GX2_INVALIDATE_MODE_STREAM_OUT_BUFFER = 1 << 7, + GX2_INVALIDATE_MODE_EXPORT_BUFFER = 1 << 8, +} GX2InvalidateMode; + typedef enum GX2InitAttributes { GX2_INIT_END = 0, @@ -493,6 +506,11 @@ typedef enum GX2TVRenderMode typedef enum GX2TVScanMode { GX2_TV_SCAN_MODE_NONE = 0, + GX2_TV_SCAN_MODE_480I = 1, + GX2_TV_SCAN_MODE_480P = 2, + GX2_TV_SCAN_MODE_720P = 3, + GX2_TV_SCAN_MODE_1080I = 5, + GX2_TV_SCAN_MODE_1080P = 6, } GX2TVScanMode; #ifdef __cplusplus diff --git a/include/gx2/mem.h b/include/gx2/mem.h new file mode 100644 index 0000000..a37b0d7 --- /dev/null +++ b/include/gx2/mem.h @@ -0,0 +1,24 @@ +#pragma once +#include +#include "enum.h" + +/** + * \defgroup gx2_mem Memory + * \ingroup gx2 + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +void +GX2Invalidate(GX2InvalidateMode mode, + void *buffer, + uint32_t size); + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/include/gx2/state.h b/include/gx2/state.h index 7fc6b4e..9e7d520 100644 --- a/include/gx2/state.h +++ b/include/gx2/state.h @@ -18,6 +18,9 @@ GX2Init(uint32_t *attributes); void GX2Shutdown(); +void +GX2Flush(); + #ifdef __cplusplus } #endif diff --git a/include/gx2/surface.h b/include/gx2/surface.h index 75199b8..b8d71a4 100644 --- a/include/gx2/surface.h +++ b/include/gx2/surface.h @@ -112,6 +112,11 @@ GX2CalcDepthBufferHiZInfo(GX2DepthBuffer *depthBuffer, uint32_t *outSize, uint32_t *outAlignment); +void +GX2CalcColorBufferAuxInfo(GX2Surface *surface, + uint32_t *outSize, + uint32_t *outAlignment); + void GX2SetColorBuffer(GX2ColorBuffer *colorBuffer, GX2RenderTarget target); diff --git a/rpl/libgx2/exports.h b/rpl/libgx2/exports.h index b3796aa..2467673 100644 --- a/rpl/libgx2/exports.h +++ b/rpl/libgx2/exports.h @@ -23,6 +23,7 @@ EXPORT(GX2SetDRCBuffer); EXPORT(GX2SetDRCScale); EXPORT(GX2GetSystemTVScanMode); EXPORT(GX2GetSystemDRCMode); +EXPORT(GX2GetSystemDRCScanMode); // gx2/displaylist.h EXPORT(GX2BeginDisplayListEx); @@ -49,6 +50,9 @@ EXPORT(GX2GetRetiredTimeStamp); EXPORT(GX2GetLastSubmittedTimeStamp); EXPORT(GX2WaitTimeStamp); +// gx2/mem.h +EXPORT(GX2Invalidate); + // gx2/registers.h EXPORT(GX2SetAAMask); EXPORT(GX2InitAAMaskReg); @@ -129,6 +133,7 @@ EXPORT(GX2InitSamplerXYFilter); EXPORT(GX2InitSamplerZMFilter); // gx2/state.h +EXPORT(GX2Flush); EXPORT(GX2Init); EXPORT(GX2Shutdown); @@ -161,6 +166,7 @@ EXPORT(GX2GetGeometryShaderGPRs); EXPORT(GX2GetGeometryShaderStackEntries); // gx2/surface.h +EXPORT(GX2CalcColorBufferAuxInfo); EXPORT(GX2CalcSurfaceSizeAndAlignment); EXPORT(GX2CalcDepthBufferHiZInfo); EXPORT(GX2SetColorBuffer);