Update GPU register names
This commit is contained in:
parent
f640360108
commit
a36f5c49d2
@ -140,8 +140,8 @@ void C3Di_UpdateContext(void)
|
||||
if (ctx->flags & C3DiF_Viewport)
|
||||
{
|
||||
ctx->flags &= ~C3DiF_Viewport;
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_0041, ctx->viewport, 4);
|
||||
GPUCMD_AddWrite(GPUREG_0068, ctx->viewport[4]);
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_VIEWPORT_WIDTH, ctx->viewport, 4);
|
||||
GPUCMD_AddWrite(GPUREG_VIEWPORT_XY, ctx->viewport[4]);
|
||||
}
|
||||
|
||||
if (ctx->flags & C3DiF_Scissor)
|
||||
@ -185,8 +185,8 @@ void C3Di_UpdateContext(void)
|
||||
}
|
||||
|
||||
ctx->flags &= ~C3DiF_TexAll;
|
||||
GPUCMD_AddMaskedWrite(GPUREG_006F, 0x2, units<<8); // enables texcoord outputs
|
||||
GPUCMD_AddWrite(GPUREG_TEXUNITS_CONFIG, 0x00011000|units); // enables texture units
|
||||
GPUCMD_AddMaskedWrite(GPUREG_006F, 0x2, units<<8); // enables texcoord outputs
|
||||
GPUCMD_AddWrite(GPUREG_TEXUNIT_ENABLE, 0x00011000|units); // enables texture units
|
||||
}
|
||||
|
||||
if (ctx->flags & C3DiF_TexEnvAll)
|
||||
@ -213,8 +213,8 @@ void C3D_FlushAsync(void)
|
||||
if (ctx->flags & C3DiF_NeedFinishDrawing)
|
||||
{
|
||||
ctx->flags &= ~C3DiF_NeedFinishDrawing;
|
||||
GPUCMD_AddWrite(GPUREG_0111, 0x00000001);
|
||||
GPUCMD_AddWrite(GPUREG_0110, 0x00000001);
|
||||
GPUCMD_AddWrite(GPUREG_FRAMEBUFFER_FLUSH, 0x00000001);
|
||||
GPUCMD_AddWrite(GPUREG_FRAMEBUFFER_INVALIDATE, 0x00000001);
|
||||
GPUCMD_AddWrite(GPUREG_0063, 0x00000001);
|
||||
}
|
||||
|
||||
|
@ -51,5 +51,5 @@ void C3D_SetBufInfo(C3D_BufInfo* info)
|
||||
void C3Di_BufInfoBind(C3D_BufInfo* info)
|
||||
{
|
||||
GPUCMD_AddWrite(GPUREG_ATTRIBBUFFERS_LOC, info->base_paddr >> 3);
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_ATTRIBBUFFER0_CONFIG0, (u32*)info->buffers, sizeof(info->buffers)/sizeof(u32));
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_ATTRIBBUFFER0_OFFSET, (u32*)info->buffers, sizeof(info->buffers)/sizeof(u32));
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ void C3D_DrawArrays(GPU_Primitive_t primitive, int first, int size)
|
||||
|
||||
// Set primitive type
|
||||
GPUCMD_AddMaskedWrite(GPUREG_PRIMITIVE_CONFIG, 2, primitive);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_025F, 2, 0x00000001);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_RESTART_PRIMITIVE, 2, 0x00000001);
|
||||
// The index buffer is not used, but 0x000F0227 is still required
|
||||
GPUCMD_AddWrite(GPUREG_INDEXBUFFER_CONFIG, 0x80000000);
|
||||
// Number of vertices
|
||||
GPUCMD_AddWrite(GPUREG_NUMVERTICES, size);
|
||||
// First vertex
|
||||
GPUCMD_AddWrite(GPUREG_DRAW_VERTEX_OFFSET, first);
|
||||
GPUCMD_AddWrite(GPUREG_VERTEX_OFFSET, first);
|
||||
|
||||
// Unknown commands
|
||||
GPUCMD_AddMaskedWrite(GPUREG_0253, 1, 0x00000001);
|
||||
|
@ -11,14 +11,16 @@ void C3D_DrawElements(GPU_Primitive_t primitive, int count, int type, const void
|
||||
|
||||
// Set primitive type
|
||||
GPUCMD_AddMaskedWrite(GPUREG_PRIMITIVE_CONFIG, 2, primitive);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_025F, 2, 0x00000001);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_RESTART_PRIMITIVE, 2, 0x00000001);
|
||||
// Configure the index buffer
|
||||
GPUCMD_AddWrite(GPUREG_INDEXBUFFER_CONFIG, (pa - base) | (type << 31));
|
||||
// Number of vertices
|
||||
GPUCMD_AddWrite(GPUREG_NUMVERTICES, count);
|
||||
// First vertex
|
||||
GPUCMD_AddWrite(GPUREG_VERTEX_OFFSET, 0);
|
||||
|
||||
// Unknown commands
|
||||
GPUCMD_AddMaskedWrite(GPUREG_GEOSTAGE_CONFIG, 2, 0x00000100);
|
||||
//GPUCMD_AddMaskedWrite(GPUREG_GEOSTAGE_CONFIG, 2, 0x00000100);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_0253, 2, 0x00000100);
|
||||
|
||||
GPUCMD_AddMaskedWrite(GPUREG_0245, 1, 0x00000000);
|
||||
|
@ -64,7 +64,7 @@ void C3Di_EffectBind(C3D_Effect* e)
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_ALPHATEST_CONFIG, (u32*)&e->alphaTest, 4);
|
||||
GPUCMD_AddWrite(GPUREG_BLEND_COLOR, e->blendClr);
|
||||
GPUCMD_AddWrite(GPUREG_BLEND_CONFIG, e->alphaBlend);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_COLOROUTPUT_CONFIG, 2, 0x00000100);
|
||||
GPUCMD_AddMaskedWrite(GPUREG_BLEND_ENABLE, 2, 0x00000100);
|
||||
|
||||
// Wat
|
||||
GPUCMD_AddMaskedWrite(GPUREG_0062, 1, 0);
|
||||
|
@ -64,23 +64,22 @@ void C3Di_RenderBufBind(C3D_RenderBuf* rb)
|
||||
{
|
||||
u32 param[4];
|
||||
|
||||
param[0] = param[1] = 1;
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_0110, param, 2);
|
||||
GPUCMD_AddWrite(GPUREG_FRAMEBUFFER_INVALIDATE, 1);
|
||||
|
||||
param[0] = osConvertVirtToPhys((u32)rb->depthBuf) >> 3;
|
||||
param[1] = osConvertVirtToPhys((u32)rb->colorBuf) >> 3;
|
||||
param[2] = 0x01000000 | (((u32)(rb->height-1) & 0xFFF) << 12) | (rb->width & 0xFFF);
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_DEPTHBUFFER_LOC, param, 3);
|
||||
|
||||
GPUCMD_AddWrite(GPUREG_006E, param[2]); //?
|
||||
GPUCMD_AddWrite(GPUREG_FRAMEBUFFER_DIM2, param[2]); //?
|
||||
GPUCMD_AddWrite(GPUREG_DEPTHBUFFER_FORMAT, rb->depthFmt);
|
||||
GPUCMD_AddWrite(GPUREG_COLORBUFFER_FORMAT, ((u32)rb->colorFmt << 16) | colorFmtSizes[rb->colorFmt]);
|
||||
GPUCMD_AddWrite(GPUREG_011B, 0x00000000); //?
|
||||
GPUCMD_AddWrite(GPUREG_FRAMEBUFFER_BLOCK32, 0x00000000); //?
|
||||
|
||||
// "Enable depth buffer" (?)
|
||||
param[0] = param[1] = 0xF;
|
||||
param[2] = param[3] = 0x2;
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_0112, param, 4);
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_COLORBUFFER_READ, param, 4);
|
||||
}
|
||||
|
||||
void C3D_RenderBufDelete(C3D_RenderBuf* rb)
|
||||
|
@ -39,5 +39,5 @@ void C3D_SetTexEnv(int id, C3D_TexEnv* env)
|
||||
void C3Di_TexEnvBind(int id, C3D_TexEnv* env)
|
||||
{
|
||||
if (id >= 4) id += 2;
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_TEXENV0_CONFIG0 + id*8, (u32*)env, sizeof(C3D_TexEnv)/sizeof(u32));
|
||||
GPUCMD_AddIncrementalWrites(GPUREG_TEXENV0_SOURCE + id*8, (u32*)env, sizeof(C3D_TexEnv)/sizeof(u32));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user