diff --git a/RSP.cpp b/RSP.cpp index 5807ab1c..c4a3eb6c 100644 --- a/RSP.cpp +++ b/RSP.cpp @@ -288,4 +288,5 @@ void RSP_Init() gSP.objMatrix.Y = 0.0f; gSP.objMatrix.baseScaleX = 1.0f; gSP.objMatrix.baseScaleY = 1.0f; + gSP.objRendermode = 0; } diff --git a/S2DEX.cpp b/S2DEX.cpp index 75631aee..b760c19d 100644 --- a/S2DEX.cpp +++ b/S2DEX.cpp @@ -51,7 +51,7 @@ void S2DEX_Select_DL( u32 w0, u32 w1 ) void S2DEX_Obj_RenderMode( u32 w0, u32 w1 ) { - LOG(LOG_WARNING, "S2DEX_Obj_RenderMode unimplemented\n"); + gSPObjRendermode(w1); } void S2DEX_Obj_Rectangle_R( u32 w0, u32 w1 ) diff --git a/S2DEX.h b/S2DEX.h index 8aeaca1c..a608e132 100644 --- a/S2DEX.h +++ b/S2DEX.h @@ -1,11 +1,19 @@ #ifndef S2DEX_H #define S2DEX_H -#define G_BGLT_LOADBLOCK 0x0033 -#define G_BGLT_LOADTILE 0xfff4 +#define G_BGLT_LOADBLOCK 0x0033 +#define G_BGLT_LOADTILE 0xfff4 -#define G_BG_FLAG_FLIPS 0x01 -#define G_BG_FLAG_FLIPT 0x10 +#define G_BG_FLAG_FLIPS 0x01 +#define G_BG_FLAG_FLIPT 0x10 + +#define G_OBJRM_NOTXCLAMP 0x01 +#define G_OBJRM_XLU 0x02 +#define G_OBJRM_ANTIALIAS 0x04 +#define G_OBJRM_BILERP 0x08 +#define G_OBJRM_SHRINKSIZE_1 0x10 +#define G_OBJRM_SHRINKSIZE_2 0x20 +#define G_OBJRM_WIDEN 0x40 struct uObjScaleBg { diff --git a/gSP.cpp b/gSP.cpp index 8a54d26b..35515b2b 100644 --- a/gSP.cpp +++ b/gSP.cpp @@ -2453,6 +2453,11 @@ void gSPObjSubMatrix( u32 mtx ) gSP.objMatrix.baseScaleY = _FIXED2FLOAT(objMtx->BaseScaleY, 10); } +void gSPObjRendermode(u32 _mode) +{ + gSP.objRendermode = _mode; +} + #ifdef __VEC4_OPT void (*gSPTransformVertex4)(u32 v, float mtx[4][4]) = gSPTransformVertex4_default; diff --git a/gSP.h b/gSP.h index f984a6bf..0c44050b 100644 --- a/gSP.h +++ b/gSP.h @@ -104,6 +104,8 @@ struct gSPInfo f32 baseScaleX, baseScaleY; } objMatrix; + u32 objRendermode; + u32 vertexColorBase; u32 vertexi; @@ -207,6 +209,7 @@ void gSPBgRect1Cyc( u32 bg ); void gSPBgRectCopy( u32 bg ); void gSPObjMatrix( u32 mtx ); void gSPObjSubMatrix( u32 mtx ); +void gSPObjRendermode(u32 _mode); void gSPSetDMAOffsets( u32 mtxoffset, u32 vtxoffset ); void gSPSetDMATexOffset(u32 _addr); void gSPSetVertexColorBase( u32 base );