diff --git a/decompile/General/230/230_50_MM_Characters_MenuProc.c b/decompile/General/230/230_50_MM_Characters_MenuProc.c index 41bed37d8..be63fe190 100644 --- a/decompile/General/230/230_50_MM_Characters_MenuProc.c +++ b/decompile/General/230/230_50_MM_Characters_MenuProc.c @@ -50,6 +50,8 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) struct CharacterSelectMeta* csm_Active; struct GameTracker* gGT = sdata->gGT; + + int* ot = gGT->backBuffer->otMem.startPlusFour; for (i = 0; i < 4; i++) { @@ -470,8 +472,7 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) color = *(Color *) puVar12; DECOMP_RECTMENU_DrawOuterRect_HighLevel( - r, color, 0, - gGT->backBuffer->otMem.startPlusFour); + r, color, 0, ot); } DECOMP_MM_Characters_PreventOverlap(); @@ -588,7 +589,7 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) Color color = *(Color *) &colorRGBA; // this draws the flashing blue square that appears when you highlight a character in the character select screen - DECOMP_CTR_Box_DrawSolidBox(r, color, gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawSolidBox(r, color, ot); } if ( @@ -661,7 +662,7 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) // Draw 2D Menu rectangle background DECOMP_RECTMENU_DrawInnerRect( - r, 0, gGT->backBuffer->otMem.startPlusFour); + r, 0, ot); } } @@ -688,7 +689,7 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) color = *(Color *) &colorRGBA; DECOMP_RECTMENU_DrawOuterRect_HighLevel( - r, color, 0, gGT->backBuffer->otMem.startPlusFour); + r, color, 0, ot); // if player selected a character if (((int)(short)sdata->characterSelectFlags >> j & 1U) != 0) @@ -712,14 +713,14 @@ void DECOMP_MM_Characters_MenuProc(struct RectMenu* unused) color = *(Color *) &colorRGBA; DECOMP_RECTMENU_DrawOuterRect_HighLevel( &r58, color, 0, - gGT->backBuffer->otMem.startPlusFour); + ot); } } psVar22 = psVar22 + 2; // Draw 2D Menu rectangle background DECOMP_RECTMENU_DrawInnerRect( - r, 9, &gGT->backBuffer->otMem.startPlusFour[3]); + r, 9, &ot[3]); // not screen-space anymore, // this is viewport-space diff --git a/decompile/General/230/230_63_MM_Battle_MenuProc.c b/decompile/General/230/230_63_MM_Battle_MenuProc.c index e0404a262..a1a3ebbe6 100644 --- a/decompile/General/230/230_63_MM_Battle_MenuProc.c +++ b/decompile/General/230/230_63_MM_Battle_MenuProc.c @@ -711,6 +711,8 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) } } + int* ot = gGT->backBuffer->otMem.startPlusFour; + for (i = 0; i < 4; i++) { uVar4 = local_60b[i]; @@ -745,7 +747,7 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) color.self = *data.ptrColor[PLAYER_BLUE+i]; DECOMP_CTR_Box_DrawSolidBox( &local_48, color, - gGT->backBuffer->otMem.startPlusFour); + ot); } if (sdata->battleSetupRowHighlighted == 2) @@ -755,7 +757,7 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) local_50.x = tmbattle[4].currX + 0x9c + WIDE_PICK(0,25); local_50.y = tmbattle[4].currY + sVar20 + 3; - DECOMP_CTR_Box_DrawClearBox(&local_50, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawClearBox(&local_50, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, ot); } local_40.w = WIDE_34(0x140); @@ -765,7 +767,7 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) // Draw 2D Menu rectangle background DECOMP_RECTMENU_DrawInnerRect( - &local_40, 0, gGT->backBuffer->otMem.startPlusFour); + &local_40, 0, ot); // "WEAPONS:" DECOMP_DecalFont_DrawLine( @@ -907,7 +909,7 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) local_60.h = 0x20; local_60.y = local_40.y + (sdata->battleSetupRowHighlighted - 3) * 0x20 + 2; - DECOMP_CTR_Box_DrawClearBox(&local_60, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawClearBox(&local_60, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, ot); } local_58.x = local_40.x + 3; @@ -915,10 +917,10 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused) local_58.w = local_40.w - 6; local_58.h = local_40.h - 4; - DECOMP_CTR_Box_DrawClearBox(&local_58, &D230.color3, TRANS_50_DECAL, gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawClearBox(&local_58, &D230.color3, TRANS_50_DECAL, ot); DECOMP_RECTMENU_DrawInnerRect( - &local_40, 0, gGT->backBuffer->otMem.startPlusFour); + &local_40, 0, ot); // save all five battle settings // these are selected rows from all battle options diff --git a/decompile/General/230/230_67_MM_HighScore_MenuProc.c b/decompile/General/230/230_67_MM_HighScore_MenuProc.c index 95bce0186..3889948a0 100644 --- a/decompile/General/230/230_67_MM_HighScore_MenuProc.c +++ b/decompile/General/230/230_67_MM_HighScore_MenuProc.c @@ -180,6 +180,8 @@ void DECOMP_MM_HighScore_MenuProc(struct RectMenu* menu_unused) iVar7 = (FPS_DOUBLE(8) - D230.highScore_transitionFrames[1]) * D230.highScore_horizontalMove[0] * 0x40; } + int* ot = sdata->gGT->backBuffer->otMem.startPlusFour; + if (((iVar7 != -0x200) && (iVar7 != 0x200)) && ((iVar4 != -0xd8 && (iVar4 != 0xd8)))) { DECOMP_MM_HighScore_Draw(D230.highScore_trackCurr,(int)D230.highScore_rowCurr,(int)(short)iVar7,(int)(short)iVar4); @@ -190,7 +192,7 @@ void DECOMP_MM_HighScore_MenuProc(struct RectMenu* menu_unused) local_20.h = 0x19; local_20.x = D230.transitionMeta_HighScores[0].currX + -0x14; local_20.y = D230.transitionMeta_HighScores[0].currY + (short)iVar4 + 9; - DECOMP_RECTMENU_DrawInnerRect(&local_20,0,(u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour); + DECOMP_RECTMENU_DrawInnerRect(&local_20,0,ot); } } iVar5 = 0; @@ -213,7 +215,7 @@ void DECOMP_MM_HighScore_MenuProc(struct RectMenu* menu_unused) local_20.h = 0x19; local_20.x = D230.transitionMeta_HighScores[0].currX + -0x14; local_20.y = D230.transitionMeta_HighScores[0].currY + (short)iVar6 + 9; - DECOMP_RECTMENU_DrawInnerRect(&local_20,0,(u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour); + DECOMP_RECTMENU_DrawInnerRect(&local_20,0,ot); return; } \ No newline at end of file diff --git a/decompile/General/232/232_25_AH_Pause_Draw.c b/decompile/General/232/232_25_AH_Pause_Draw.c index 7bf7da3a0..f97029b98 100644 --- a/decompile/General/232/232_25_AH_Pause_Draw.c +++ b/decompile/General/232/232_25_AH_Pause_Draw.c @@ -439,7 +439,8 @@ void DECOMP_AH_Pause_Draw(int pageID, int posX) Color color; color.self = sdata->battleSetup_Color_UI_1; - DECOMP_RECTMENU_DrawOuterRect_Edge(&r, color, 0x20, gGT->backBuffer->otMem.startPlusFour); + int* ot = gGT->backBuffer->otMem.startPlusFour; + DECOMP_RECTMENU_DrawOuterRect_Edge(&r, color, 0x20, ot); r.x = 0x100 - half; r.y = 10; @@ -448,7 +449,7 @@ void DECOMP_AH_Pause_Draw(int pageID, int posX) // Draw 2D Menu rectangle background DECOMP_RECTMENU_DrawInnerRect( - &r, 4, &gGT->backBuffer->otMem.startPlusFour[3]); + &r, 4, &ot[3]); for(int i = 0; i < 0xe; i++) { diff --git a/decompile/General/232/232_29_AH_HintMenu_MenuProc.c b/decompile/General/232/232_29_AH_HintMenu_MenuProc.c index 910949455..a0cd29742 100644 --- a/decompile/General/232/232_29_AH_HintMenu_MenuProc.c +++ b/decompile/General/232/232_29_AH_HintMenu_MenuProc.c @@ -123,7 +123,8 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.y = (short)iVar11 + 0x4e; box.h = 0x11; - DECOMP_CTR_Box_DrawClearBox(&box, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, gGT->backBuffer->otMem.startPlusFour); + int* ot = gGT->backBuffer->otMem.startPlusFour; + DECOMP_CTR_Box_DrawClearBox(&box, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, ot); box.y = 0x3c; box.x = -0xe; @@ -131,7 +132,7 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.h = 2; color.self = sdata->battleSetup_Color_UI_1; - DECOMP_RECTMENU_DrawOuterRect_Edge(&box, color, 0x20, gGT->backBuffer->otMem.startPlusFour); + DECOMP_RECTMENU_DrawOuterRect_Edge(&box, color, 0x20, ot); box.y = 0x28; box.h = (short)iVar11 + 0x3b; @@ -139,7 +140,7 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.w = 0x21c; DECOMP_RECTMENU_DrawInnerRect( - &box, 4, &gGT->backBuffer->otMem.startPlusFour[3]); + &box, 4, &ot[3]); return; } @@ -321,7 +322,8 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.y = (menu->rowSelected - D232.hintMenu_scrollIndex) * 0x10 + 0x4f; box.h = 0x11; - DECOMP_CTR_Box_DrawClearBox(&box, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, gGT->backBuffer->otMem.startPlusFour); + int* ot = gGT->backBuffer->otMem.startPlusFour; + DECOMP_CTR_Box_DrawClearBox(&box, &sdata->menuRowHighlight_Normal, TRANS_50_DECAL, ot); box.y = 0x3c; box.h = 2; @@ -329,7 +331,7 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.w = 0x228; color.self = sdata->battleSetup_Color_UI_1; - DECOMP_RECTMENU_DrawOuterRect_Edge(&box, color, 0x20, gGT->backBuffer->otMem.startPlusFour); + DECOMP_RECTMENU_DrawOuterRect_Edge(&box, color, 0x20, ot); box.y = 0x28; box.h = (short)iVar10 + 0x2b; @@ -337,7 +339,7 @@ void DECOMP_AH_HintMenu_MenuProc(struct RectMenu* menu) box.w = 0x228; DECOMP_RECTMENU_DrawInnerRect( - &box, 4, gGT->backBuffer->otMem.startPlusFour); + &box, 4, ot); if ( (bVar3) || diff --git a/decompile/General/AltMods/MM_CustomCups.c b/decompile/General/AltMods/MM_CustomCups.c index dc09ae4f6..a3320cae1 100644 --- a/decompile/General/AltMods/MM_CustomCups.c +++ b/decompile/General/AltMods/MM_CustomCups.c @@ -182,16 +182,13 @@ void CustomCups_MenuProc(struct RectMenu* menu) FONT_SMALL, (JUSTIFY_CENTER | PERIWINKLE)); - struct DB *backBuffer = - sdata->gGT->backBuffer; + int* ot = sdata->gGT->backBuffer->otMem.startPlusFour; DECOMP_RECTMENU_DrawInnerRect( - &windowSel[CUP_SELECT], 1, - backBuffer->otMem.startPlusFour); + &windowSel[CUP_SELECT], 1, ot); DECOMP_RECTMENU_DrawInnerRect( - &windowText, 1, - backBuffer->otMem.startPlusFour); + &windowText, 1, ot); } } diff --git a/decompile/General/UI/UI_RaceStart_IntroText1P.c b/decompile/General/UI/UI_RaceStart_IntroText1P.c index f37e1ecdf..ffb1caf8b 100644 --- a/decompile/General/UI/UI_RaceStart_IntroText1P.c +++ b/decompile/General/UI/UI_RaceStart_IntroText1P.c @@ -212,15 +212,17 @@ void DECOMP_UI_RaceStart_IntroText1P(void) { // Draw tiny rectangle near big black title bar (first) rect.y = gGT->pushBuffer[0].rect.y - (windowHeight + -0x1c); - Color color; + + Color color; color.self = colors[0]; - DECOMP_CTR_Box_DrawSolidBox(&rect, color, - gGT->backBuffer->otMem.startPlusFour); + + int* ot = gGT->backBuffer->otMem.startPlusFour; + + DECOMP_CTR_Box_DrawSolidBox(&rect, color, ot); // Draw tiny rectangle near big black title bar (second) rect.y = gGT->pushBuffer[0].rect.y + gGT->pushBuffer[0].rect.h + windowHeight + -0x1e; - DECOMP_CTR_Box_DrawSolidBox(&rect, color, - gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawSolidBox(&rect, color, ot); // 30-pixel height // clear RGB, keep alpha (which is zero anyway) @@ -230,13 +232,11 @@ void DECOMP_UI_RaceStart_IntroText1P(void) { // draw big black title bar (first) rect.y = gGT->pushBuffer[0].rect.y - windowHeight; - DECOMP_CTR_Box_DrawSolidBox(&rect, color, - gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawSolidBox(&rect, color, ot); // draw big black title bar (second) rect.y = gGT->pushBuffer[0].rect.y + gGT->pushBuffer[0].rect.h + windowHeight + -0x1e; - DECOMP_CTR_Box_DrawSolidBox(&rect, color, - gGT->backBuffer->otMem.startPlusFour); + DECOMP_CTR_Box_DrawSolidBox(&rect, color, ot); } return; }