Rename GX commands

This commit is contained in:
fincs 2015-09-07 12:53:37 +02:00
parent 530849a4b0
commit c594170fca
6 changed files with 23 additions and 21 deletions

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill( GX_MemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -71,7 +71,7 @@ void gpuFrameEnd(void)
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // Transfer the GPU output to the framebuffer
GX_SetDisplayTransfer( GX_DisplayTransfer(
colorBuf, GX_BUFFER_DIM(240, 400), colorBuf, GX_BUFFER_DIM(240, 400),
(u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill( GX_MemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -71,7 +71,7 @@ void gpuFrameEnd(void)
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // Transfer the GPU output to the framebuffer
GX_SetDisplayTransfer( GX_DisplayTransfer(
colorBuf, GX_BUFFER_DIM(240, 400), colorBuf, GX_BUFFER_DIM(240, 400),
(u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill( GX_MemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -71,7 +71,7 @@ void gpuFrameEnd(void)
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // Transfer the GPU output to the framebuffer
GX_SetDisplayTransfer( GX_DisplayTransfer(
colorBuf, GX_BUFFER_DIM(240, 400), colorBuf, GX_BUFFER_DIM(240, 400),
(u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);

View File

@ -51,11 +51,14 @@ typedef enum
#define GX_TRANSFER_OUT_FORMAT(x) ((x)<<12) #define GX_TRANSFER_OUT_FORMAT(x) ((x)<<12)
#define GX_TRANSFER_SCALING(x) ((x)<<24) #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_RequestDma(u32* src, u32* dst, u32 length);
Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags); Result GX_ProcessCommandList(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_MemoryFill(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_DisplayTransfer(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_TextureCopy(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_FlushCacheRegions(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
extern u32* gxCmdBuf; extern u32* gxCmdBuf;

View File

@ -42,8 +42,7 @@ void GPUCMD_AddRawCommands(u32* cmd, u32 size)
void GPUCMD_Run(void) void GPUCMD_Run(void)
{ {
GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, NULL, 0, NULL, 0); GX_ProcessCommandList(gpuCmdBuf, gpuCmdBufOffset*4, GX_CMDLIST_FLUSH);
GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
} }
extern u32 __linear_heap_size; extern u32 __linear_heap_size;
@ -51,9 +50,9 @@ extern u32 __linear_heap;
void GPUCMD_FlushAndRun(void) void GPUCMD_FlushAndRun(void)
{ {
//take advantage of GX_SetCommandList_First to flush gsp heap //take advantage of GX_FlushCacheRegions to flush gsp heap
GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0); GX_FlushCacheRegions(gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0);
GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0); GX_ProcessCommandList(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
} }
void GPUCMD_Add(u32 header, u32* param, u32 paramlength) void GPUCMD_Add(u32 header, u32* param, u32 paramlength)

View File

@ -23,7 +23,7 @@ Result GX_RequestDma(u32* src, u32* dst, u32 length)
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand); 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]; u32 gxCommand[0x8];
gxCommand[0]=0x01; //CommandID gxCommand[0]=0x01; //CommandID
@ -36,7 +36,7 @@ Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags)
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand); 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]; u32 gxCommand[0x8];
// gxCommand[0]=0x02; //CommandID // 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. // 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]; u32 gxCommand[0x8];
gxCommand[0]=0x03; //CommandID 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); 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]; u32 gxCommand[0x8];
gxCommand[0]=0x04; //CommandID 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); 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]; u32 gxCommand[0x8];
gxCommand[0]=0x05; //CommandID gxCommand[0]=0x05; //CommandID