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
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);
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
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);
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
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);
#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;
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;
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)
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
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
}
// 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
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
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