Remove u32* gxbuf parameter in GX/GPU functions
This commit is contained in:
parent
5fd4a726ff
commit
696ac996d1
@ -147,4 +147,3 @@ u8* gfxGetFramebuffer(gfxScreen_t screen, gfx3dSide_t side, u16* width, u16* hei
|
||||
extern u8* gfxTopLeftFramebuffers[2];
|
||||
extern u8* gfxTopRightFramebuffers[2];
|
||||
extern u8* gfxBottomFramebuffers[2];
|
||||
extern u32* gxCmdBuf;
|
||||
|
@ -14,10 +14,10 @@ void GPUCMD_SetBuffer(u32* adr, u32 size, u32 offset);
|
||||
void GPUCMD_SetBufferOffset(u32 offset);
|
||||
void GPUCMD_GetBuffer(u32** adr, u32* size, u32* offset);
|
||||
void GPUCMD_AddRawCommands(u32* cmd, u32 size);
|
||||
void GPUCMD_Run(u32* gxbuf);
|
||||
void GPUCMD_FlushAndRun(u32* gxbuf);
|
||||
void GPUCMD_Run(void);
|
||||
void GPUCMD_FlushAndRun(void);
|
||||
void GPUCMD_Add(u32 header, u32* param, u32 paramlength);
|
||||
void GPUCMD_Finalize();
|
||||
void GPUCMD_Finalize(void);
|
||||
|
||||
u32 f32tof24(float f);
|
||||
u32 computeInvValue(u32 val);
|
||||
|
@ -51,9 +51,11 @@ typedef enum
|
||||
#define GX_TRANSFER_OUT_FORMAT(x) ((x)<<12)
|
||||
#define GX_TRANSFER_SCALING(x) ((x)<<24)
|
||||
|
||||
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 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);
|
||||
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);
|
||||
|
||||
extern u32* gxCmdBuf;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <3ds/svc.h>
|
||||
#include <3ds/linear.h>
|
||||
#include <3ds/vram.h>
|
||||
#include <3ds/gpu/gx.h>
|
||||
|
||||
GSP_FramebufferInfo topFramebufferInfo, bottomFramebufferInfo;
|
||||
|
||||
|
@ -138,7 +138,7 @@ void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize)
|
||||
for(i=0;i<gpuResetSequenceLength;i++)GPUCMD_AddSingleParam(gpuResetSequence[i*2],gpuResetSequence[i*2+1]);
|
||||
|
||||
GPUCMD_Finalize();
|
||||
GPUCMD_Run(gpuBuf);
|
||||
//GPUCMD_Run(gpuBuf);
|
||||
GPUCMD_SetBufferOffset(0);
|
||||
}
|
||||
|
||||
|
@ -40,20 +40,20 @@ void GPUCMD_AddRawCommands(u32* cmd, u32 size)
|
||||
gpuCmdBufOffset+=size;
|
||||
}
|
||||
|
||||
void GPUCMD_Run(u32* gxbuf)
|
||||
void GPUCMD_Run(void)
|
||||
{
|
||||
GX_SetCommandList_First(gxbuf, gpuCmdBuf, gpuCmdBufOffset*4, NULL, 0, NULL, 0);
|
||||
GX_SetCommandList_Last(gxbuf, gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
|
||||
GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, NULL, 0, NULL, 0);
|
||||
GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
|
||||
}
|
||||
|
||||
extern u32 __linear_heap_size;
|
||||
extern u32 __linear_heap;
|
||||
|
||||
void GPUCMD_FlushAndRun(u32* gxbuf)
|
||||
void GPUCMD_FlushAndRun(void)
|
||||
{
|
||||
//take advantage of GX_SetCommandList_First to flush gsp heap
|
||||
GX_SetCommandList_First(gxbuf, gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0);
|
||||
GX_SetCommandList_Last(gxbuf, gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
|
||||
GX_SetCommandList_First(gpuCmdBuf, gpuCmdBufOffset*4, (u32 *) __linear_heap, __linear_heap_size, NULL, 0);
|
||||
GX_SetCommandList_Last(gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
|
||||
}
|
||||
|
||||
void GPUCMD_Add(u32 header, u32* param, u32 paramlength)
|
||||
@ -81,7 +81,7 @@ void GPUCMD_Add(u32 header, u32* param, u32 paramlength)
|
||||
if(paramlength&1)gpuCmdBuf[gpuCmdBufOffset++]=0x00000000; //alignment
|
||||
}
|
||||
|
||||
void GPUCMD_Finalize()
|
||||
void GPUCMD_Finalize(void)
|
||||
{
|
||||
GPUCMD_AddMaskedWrite(GPUREG_PRIMITIVE_CONFIG, 0x8, 0x00000000);
|
||||
GPUCMD_AddWrite(GPUREG_0111, 0x00000001);
|
||||
|
@ -11,10 +11,8 @@
|
||||
|
||||
u32* gxCmdBuf;
|
||||
|
||||
Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length)
|
||||
Result GX_RequestDma(u32* src, u32* dst, u32 length)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
gxCommand[0]=0x00; //CommandID
|
||||
gxCommand[1]=(u32)src; //source address
|
||||
@ -22,13 +20,11 @@ Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length)
|
||||
gxCommand[3]=length; //size
|
||||
gxCommand[4]=gxCommand[5]=gxCommand[6]=gxCommand[7]=0x0;
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
||||
|
||||
Result GX_SetCommandList_Last(u32* gxbuf, u32* buf0a, u32 buf0s, u8 flags)
|
||||
Result GX_SetCommandList_Last(u32* buf0a, u32 buf0s, u8 flags)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
gxCommand[0]=0x01; //CommandID
|
||||
gxCommand[1]=(u32)buf0a; //buf0 address
|
||||
@ -37,13 +33,11 @@ Result GX_SetCommandList_Last(u32* gxbuf, u32* buf0a, u32 buf0s, u8 flags)
|
||||
gxCommand[4]=gxCommand[5]=gxCommand[6]=0x0;
|
||||
gxCommand[7]=(flags>>1)&1; //when non-zero, call svcFlushProcessDataCache() with the specified buffer
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
||||
|
||||
Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1)
|
||||
Result GX_SetMemoryFill(u32* buf0a, u32 buf0v, u32* buf0e, u16 control0, u32* buf1a, u32 buf1v, u32* buf1e, u16 control1)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
// gxCommand[0]=0x02; //CommandID
|
||||
gxCommand[0]=0x01000102; //CommandID
|
||||
@ -55,14 +49,12 @@ Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 contr
|
||||
gxCommand[6]=(u32)buf1e; //buf1 end addr
|
||||
gxCommand[7]=(control0)|(control1<<16);
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
||||
|
||||
// Flags, for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.
|
||||
Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags)
|
||||
Result GX_SetDisplayTransfer(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
gxCommand[0]=0x03; //CommandID
|
||||
gxCommand[1]=(u32)inadr;
|
||||
@ -72,13 +64,11 @@ Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32
|
||||
gxCommand[5]=flags;
|
||||
gxCommand[6]=gxCommand[7]=0x0;
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
||||
|
||||
Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags)
|
||||
Result GX_SetTextureCopy(u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
gxCommand[0]=0x04; //CommandID
|
||||
gxCommand[1]=(u32)inadr;
|
||||
@ -89,13 +79,11 @@ Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 out
|
||||
gxCommand[6]=flags;
|
||||
gxCommand[7]=0x0;
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
||||
|
||||
Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s)
|
||||
Result GX_SetCommandList_First(u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s)
|
||||
{
|
||||
if(!gxbuf)gxbuf=gxCmdBuf;
|
||||
|
||||
u32 gxCommand[0x8];
|
||||
gxCommand[0]=0x05; //CommandID
|
||||
gxCommand[1]=(u32)buf0a; //buf0 address
|
||||
@ -106,5 +94,5 @@ Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u3
|
||||
gxCommand[6]=(u32)buf2s; //buf2 size
|
||||
gxCommand[7]=0x0;
|
||||
|
||||
return GSPGPU_SubmitGxCommand(gxbuf, gxCommand, NULL);
|
||||
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
|
||||
}
|
Loading…
Reference in New Issue
Block a user