fix master dl overflows (#33)

This commit is contained in:
Archez
2024-05-22 09:04:57 -05:00
committed by Garrett Cox
parent cf7264f072
commit 17866937a3
2 changed files with 14 additions and 8 deletions
+4 -2
View File
@@ -98,8 +98,10 @@ typedef struct {
/* 0x1C8 */ Gfx setScissor[2];
/* 0x1D8 */ Gfx unk_1D8[25]; // unused
/* 0x2A0 */ Gfx disps[5];
/* 0x2C8 */ Gfx clearFillRect[3]; // fillrect for clearing buffers
/* 0x2E0 */ Gfx fillRect[3]; // fillrect for general purpose
// #region 2S2H [Cosmetic] clearFillRect and fillRect increased to 4 instructions to account for gDPFillWideRectangle
/* 0x2C8 */ Gfx clearFillRect[4]; // fillrect for clearing buffers
/* 0x2E0 */ Gfx fillRect[4]; // fillrect for general purpose
// #endregion
/* 0x2F8 */ Gfx debugDisp[1];
} GfxMasterList; // size = 0x300
+10 -6
View File
@@ -1512,9 +1512,11 @@ void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g
masterGfx = gGfxMasterDL->clearFillRect;
// #region 2S2H [Cosmetic] Account for different aspect ratios than 4:3
gDPFillWideRectangle(&masterGfx[0], OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gCfbWidth - 1), gCfbHeight - 1);
gDPPipeSync(&masterGfx[1]);
gSPEndDisplayList(&masterGfx[2]);
// WideRectangle consumes two instructions and requires ++ for the macro to work
Gfx* tmpGfx = masterGfx;
gDPFillWideRectangle(tmpGfx++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gCfbWidth - 1), gCfbHeight - 1);
gDPPipeSync(&masterGfx[2]);
gSPEndDisplayList(&masterGfx[3]);
// #endregion
// General Fillrect?
@@ -1522,9 +1524,11 @@ void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g
masterGfx = gGfxMasterDL->fillRect;
// #region 2S2H [Cosmetic] Account for different aspect ratios than 4:3
gDPFillWideRectangle(&masterGfx[0], OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gCfbWidth), gCfbHeight);
gDPPipeSync(&masterGfx[1]);
gSPEndDisplayList(&masterGfx[2]);
// WideRectangle consumes two instructions and requires ++ for the macro to work
tmpGfx = masterGfx;
gDPFillWideRectangle(tmpGfx++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gCfbWidth), gCfbHeight);
gDPPipeSync(&masterGfx[2]);
gSPEndDisplayList(&masterGfx[3]);
// #endregion
// Sync SP Segments with current CPU Segments