From de687695cfffc1589176c2639e8876e4d5158a5c Mon Sep 17 00:00:00 2001 From: Lectem Date: Wed, 3 Jun 2015 21:17:38 +0200 Subject: [PATCH] added GX_SetMemoryFill control enums --- examples/gpu/source/main.c | 4 ++-- libctru/include/3ds/gpu/gx.h | 11 ++++++++++- libctru/source/services/gx.c | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/gpu/source/main.c b/examples/gpu/source/main.c index 4e1bb86..830232f 100644 --- a/examples/gpu/source/main.c +++ b/examples/gpu/source/main.c @@ -315,7 +315,7 @@ int main(int argc, char** argv) //we draw the right buffer, wait for it to finish and then switch back to left one //clear the screen - GX_SetMemoryFill(NULL, (u32*)gpuOut, backgroundColor, (u32*)&gpuOut[0x2EE00], 0x201, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], 0x201); + GX_SetMemoryFill(NULL, (u32*)gpuOut, backgroundColor, (u32*)&gpuOut[0x2EE00], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH , (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH); gspWaitForPSC0(); //draw the right framebuffer @@ -339,7 +339,7 @@ int main(int argc, char** argv) } //clear the screen - GX_SetMemoryFill(NULL, (u32*)gpuOut, backgroundColor, (u32*)&gpuOut[0x2EE00], 0x201, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], 0x201); + GX_SetMemoryFill(NULL, (u32*)gpuOut, backgroundColor, (u32*)&gpuOut[0x2EE00], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH); gspWaitForPSC0(); gfxSwapBuffersGpu(); diff --git a/libctru/include/3ds/gpu/gx.h b/libctru/include/3ds/gpu/gx.h index f4aa3e5..561473f 100644 --- a/libctru/include/3ds/gpu/gx.h +++ b/libctru/include/3ds/gpu/gx.h @@ -18,6 +18,15 @@ typedef enum GX_TRANSFER_SCALE_Y = 2 } GX_TRANSFER_SCALE; +typedef enum +{ + GX_FILL_TRIGGER = 0x001, + GX_FILL_FINISHED = 0x002, + GX_FILL_16BIT_DEPTH = 0x000, + GX_FILL_24BIT_DEPTH = 0x100, + GX_FILL_32BIT_DEPTH = 0x200, +} GX_FILL_CONTROL; + #define GX_TRANSFER_FLIP_VERT(x) ((x)<<0) #define GX_TRANSFER_OUT_TILED(x) ((x)<<1) #define GX_TRANSFER_RAW_COPY(x) ((x)<<3) @@ -27,7 +36,7 @@ typedef enum Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length); Result GX_SetCommandList_Last(u32* gxbuf, u32* buf0a, u32 buf0s, u8 flags); -Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 width0, u32* buf1a, u32 buf1v, u32* buf1e, u16 width1); +Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1); Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags); Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags); Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s); diff --git a/libctru/source/services/gx.c b/libctru/source/services/gx.c index 4257710..cfc017b 100644 --- a/libctru/source/services/gx.c +++ b/libctru/source/services/gx.c @@ -40,7 +40,7 @@ Result GX_SetCommandList_Last(u32* gxbuf, u32* buf0a, u32 buf0s, u8 flags) return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL); } -Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 width0, u32* buf1a, u32 buf1v, u32* buf1e, u16 width1) +Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1) { if(!gxbuf)gxbuf=gxCmdBuf; @@ -53,7 +53,7 @@ Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 width gxCommand[4]=(u32)buf1a; //buf1 address gxCommand[5]=buf1v; //buf1 value gxCommand[6]=(u32)buf1e; //buf1 end addr - gxCommand[7]=(width0)|(width1<<16); + gxCommand[7]=(control0)|(control1<<16); return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL); }