]> Chaos Git - corbenik/ctrulib.git/commitdiff
added GX_SetMemoryFill control enums
authorLectem <lectem@gmail.com>
Wed, 3 Jun 2015 19:17:38 +0000 (21:17 +0200)
committerLectem <lectem@gmail.com>
Wed, 3 Jun 2015 19:17:38 +0000 (21:17 +0200)
examples/gpu/source/main.c
libctru/include/3ds/gpu/gx.h
libctru/source/services/gx.c

index 4e1bb86260c88e20061a6fca0898a315e865ab84..830232f798f668fd3d74fd0de028ed2876e38c33 100644 (file)
@@ -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();
 
index f4aa3e5b3bd07e8a0ef03683fa9ea7d6b4777348..561473f78f61a2e708b9a0ed7e9bfeaa23ac73bd 100644 (file)
@@ -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);
index 4257710d2945d50f25b10a7f88674d960816b873..cfc017b53755fd76c3ddb8d481bcd6cb66451a00 100644 (file)
@@ -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);
 }