]> Chaos Git - corbenik/ctrulib.git/commitdiff
Rename GX commands
authorfincs <fincs.alt1@gmail.com>
Mon, 7 Sep 2015 10:53:37 +0000 (12:53 +0200)
committerfincs <fincs.alt1@gmail.com>
Mon, 7 Sep 2015 10:53:37 +0000 (12:53 +0200)
examples/graphics/gpu/geoshader/source/gpu.c
examples/graphics/gpu/simple_tri/source/gpu.c
examples/graphics/gpu/textured_cube/source/gpu.c
libctru/include/3ds/gpu/gx.h
libctru/source/gpu/gpu.c
libctru/source/gpu/gx.c

index 60761fcc0ea21404bbece0e9ac855d714f4426fb..f95013097ef431aaca0b8f2fc168ce21c915ae72 100644 (file)
@@ -27,7 +27,7 @@ void gpuExit(void)
 
 void gpuClearBuffers(u32 clearColor)
 {
-       GX_SetMemoryFill(
+       GX_MemoryFill(
                colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
                depthBuf, 0,          &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH);
        gspWaitForPSC0(); // Wait for the fill to complete
@@ -71,7 +71,7 @@ void gpuFrameEnd(void)
        gspWaitForP3D(); // Wait for the rendering to complete
 
        // Transfer the GPU output to the framebuffer
-       GX_SetDisplayTransfer(
+       GX_DisplayTransfer(
                colorBuf, GX_BUFFER_DIM(240, 400),
                (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
                DISPLAY_TRANSFER_FLAGS);
index 60761fcc0ea21404bbece0e9ac855d714f4426fb..f95013097ef431aaca0b8f2fc168ce21c915ae72 100644 (file)
@@ -27,7 +27,7 @@ void gpuExit(void)
 
 void gpuClearBuffers(u32 clearColor)
 {
-       GX_SetMemoryFill(
+       GX_MemoryFill(
                colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
                depthBuf, 0,          &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH);
        gspWaitForPSC0(); // Wait for the fill to complete
@@ -71,7 +71,7 @@ void gpuFrameEnd(void)
        gspWaitForP3D(); // Wait for the rendering to complete
 
        // Transfer the GPU output to the framebuffer
-       GX_SetDisplayTransfer(
+       GX_DisplayTransfer(
                colorBuf, GX_BUFFER_DIM(240, 400),
                (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
                DISPLAY_TRANSFER_FLAGS);
index 60761fcc0ea21404bbece0e9ac855d714f4426fb..f95013097ef431aaca0b8f2fc168ce21c915ae72 100644 (file)
@@ -27,7 +27,7 @@ void gpuExit(void)
 
 void gpuClearBuffers(u32 clearColor)
 {
-       GX_SetMemoryFill(
+       GX_MemoryFill(
                colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
                depthBuf, 0,          &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH);
        gspWaitForPSC0(); // Wait for the fill to complete
@@ -71,7 +71,7 @@ void gpuFrameEnd(void)
        gspWaitForP3D(); // Wait for the rendering to complete
 
        // Transfer the GPU output to the framebuffer
-       GX_SetDisplayTransfer(
+       GX_DisplayTransfer(
                colorBuf, GX_BUFFER_DIM(240, 400),
                (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
                DISPLAY_TRANSFER_FLAGS);
index 46672da906179330717740a13c26e3b5a9005a7f..290119639a4e349d09fbe253490e5a4f7920fd7d 100644 (file)
@@ -51,11 +51,14 @@ typedef enum
 #define GX_TRANSFER_OUT_FORMAT(x) ((x)<<12)
 #define GX_TRANSFER_SCALING(x)    ((x)<<24)
 
+#define GX_CMDLIST_BIT0  BIT(0)
+#define GX_CMDLIST_FLUSH BIT(1)
+
 Result GX_RequestDma(u32* src, u32* dst, u32 length);
-Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags);
-Result GX_SetMemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1);
-Result GX_SetDisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags);
-Result GX_SetTextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags);
-Result GX_SetCommandList_First(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
+Result GX_ProcessCommandList(u32* buf0a, u32 buf0s, u8 flags);
+Result GX_MemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1);
+Result GX_DisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags);
+Result GX_TextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags);
+Result GX_FlushCacheRegions(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
 
 extern u32* gxCmdBuf;
index e40ce68f7a6bf24179bb36b5d3a975417334c2a0..db73a321c7a6e4d5d5e0f53ebbdb48daa76e131a 100644 (file)
@@ -42,8 +42,7 @@ void GPUCMD_AddRawCommands(u32* cmd, u32 size)
 
 void GPUCMD_Run(void)
 {
-       GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, NULL, 0, NULL, 0);
-       GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
+       GX_ProcessCommandList(gpuCmdBuf, gpuCmdBufOffset*4, GX_CMDLIST_FLUSH);
 }
 
 extern u32 __linear_heap_size;
@@ -51,9 +50,9 @@ extern u32 __linear_heap;
 
 void GPUCMD_FlushAndRun(void)
 {
-       //take advantage of GX_SetCommandList_First to flush gsp heap
-       GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0);
-       GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
+       //take advantage of GX_FlushCacheRegions to flush gsp heap
+       GX_FlushCacheRegions(gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0);
+       GX_ProcessCommandList(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
 }
 
 void GPUCMD_Add(u32 header, u32* param, u32 paramlength)
index 437dff79c523e349628dc4938a36933b6a1023c5..6fc8b18a7b5dfd7c774a7010e33c81edb37201e8 100644 (file)
@@ -23,7 +23,7 @@ Result GX_RequestDma(u32* src, u32* dst, u32 length)
        return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand);
 }
 
-Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags)
+Result GX_ProcessCommandList(u32* buf0a, u32 buf0s, u8 flags)
 {
        u32 gxCommand[0x8];
        gxCommand[0]=0x01; //CommandID
@@ -36,7 +36,7 @@ Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags)
        return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand);
 }
 
-Result GX_SetMemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1)
+Result GX_MemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1)
 {
        u32 gxCommand[0x8];
        // gxCommand[0]=0x02; //CommandID
@@ -53,7 +53,7 @@ Result GX_SetMemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* bu
 }
 
 // Flags, for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.
-Result GX_SetDisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags)
+Result GX_DisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags)
 {
        u32 gxCommand[0x8];
        gxCommand[0]=0x03; //CommandID
@@ -67,7 +67,7 @@ Result GX_SetDisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32
        return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand);
 }
 
-Result GX_SetTextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags)
+Result GX_TextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags)
 {
        u32 gxCommand[0x8];
        gxCommand[0]=0x04; //CommandID
@@ -82,7 +82,7 @@ Result GX_SetTextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 siz
        return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand);
 }
 
-Result GX_SetCommandList_First(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s)
+Result GX_FlushCacheRegions(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s)
 {
        u32 gxCommand[0x8];
        gxCommand[0]=0x05; //CommandID