Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Apr 1, 2024
1 parent 8d41827 commit 4070098
Show file tree
Hide file tree
Showing 75 changed files with 392 additions and 390 deletions.
4 changes: 2 additions & 2 deletions decompile/General/224/224_Full.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void DECOMP_TT_EndEvent_DrawMenu(void)
if ((unknownFlags_1d44 & 0x8000000) == 0)
{
// between 1001 and 1018, frame counter is paused until &0x10,
// that's 15 frames between lerp high score off-screen, and showing MenuBox
// that's 15 frames between lerp high score off-screen, and showing Menu
if ((framesSinceRaceEnded < FPS_DOUBLE(1018)) && ((sdata->menuReadyToPass & 0x10) != 0)) goto AddStuff;
if (framesSinceRaceEnded < FPS_DOUBLE(1001)) goto AddStuff;
}
Expand Down Expand Up @@ -243,7 +243,7 @@ void DECOMP_TT_EndEvent_DrawMenu(void)
// if not showing menu yet
if ((sdata->menuReadyToPass & 1) == 0)
{
// start showing menubox
// start showing menu
sdata->menuReadyToPass = sdata->menuReadyToPass & 0xffffffef | 1;

sdata->flags_timeTrialEndOfRace = 0;
Expand Down
8 changes: 4 additions & 4 deletions decompile/General/230/230_31_MM_MenuProc_Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void DECOMP_MM_MenuProc_Main(struct RectMenu *mainMenu)
gGT->gameMode1 |= ADVENTURE_MODE;
gGT->gameMode2 &= ~(CHEAT_WUMPA | CHEAT_MASK | CHEAT_TURBO | CHEAT_ENGINE | CHEAT_BOMBS);

// menubox for new/load
// menu for new/load
mainMenu->ptrNextBox_InHierarchy = &D230.menuAdventure;
mainMenu->state |= DRAW_NEXT_MENU_IN_HIERARCHY;
return;
Expand Down Expand Up @@ -170,7 +170,7 @@ void DECOMP_MM_MenuProc_Main(struct RectMenu *mainMenu)
// set game mode to Arcade Mode
gGT->gameMode1 |= ARCADE_MODE;

// set next menuBox
// set next menu
mainMenu->ptrNextBox_InHierarchy = &D230.menuRaceType;
mainMenu->state |= DRAW_NEXT_MENU_IN_HIERARCHY;
return;
Expand All @@ -179,7 +179,7 @@ void DECOMP_MM_MenuProc_Main(struct RectMenu *mainMenu)
// Versus
if (choose == 0x4f)
{
// next menuBox is choosing single+cup
// next menu is choosing single+cup
mainMenu->ptrNextBox_InHierarchy = &D230.menuRaceType;
mainMenu->state |= DRAW_NEXT_MENU_IN_HIERARCHY;
return;
Expand All @@ -193,7 +193,7 @@ void DECOMP_MM_MenuProc_Main(struct RectMenu *mainMenu)
// set game mode to Battle Mode
gGT->gameMode1 |= BATTLE_MODE;

// set next menuBox to 2P,3P,4P
// set next menu to 2P,3P,4P
mainMenu->ptrNextBox_InHierarchy = &D230.menuPlayers2P3P4P;
mainMenu->state |= DRAW_NEXT_MENU_IN_HIERARCHY;
return;
Expand Down
4 changes: 2 additions & 2 deletions decompile/General/230/230_37_MM_MenuProc_SingleCup.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ void DECOMP_MM_MenuProc_SingleCup(struct RectMenu* menu)
// if mode is Arcade
if ((gGT->gameMode1 & ARCADE_MODE) != 0)
{
// set next menuBox to 1P+2P select
// set next menu to 1P+2P select
menu->ptrNextBox_InHierarchy = &D230.menuPlayers1P2P;
D230.characterSelect_transitionState = 1;
return;
}

// if mode is VS

// set next menuBox to 2P+3P+4P (vs or battle)
// set next menu to 2P+3P+4P (vs or battle)
menu->ptrNextBox_InHierarchy = &D230.menuPlayers2P3P4P;
D230.characterSelect_transitionState = 2;
}
Expand Down
2 changes: 1 addition & 1 deletion decompile/General/230/230_39_MM_AdvNewLoad_GetMenuPtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

struct RectMenu* DECOMP_MM_AdvNewLoad_GetMenuPtr(void)
{
// menubox for new/load
// menu for new/load
return &D230.menuAdventure;
}
2 changes: 1 addition & 1 deletion decompile/General/230/230_56_MM_TrackSelect_MenuProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void DECOMP_MM_TrackSelect_MenuProc(struct RectMenu* menu)
#endif
}

// passthrough MenuBox for the function
// passthrough Menu for the function
// QueueLoadTrack
sdata->ptrDesiredMenu = &data.menuQueueLoadTrack;

Expand Down
2 changes: 1 addition & 1 deletion decompile/General/230/230_59_MM_CupSelect_MenuProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void DECOMP_MM_CupSelect_MenuProc(struct RectMenu* menu)
gGT->cup.points[i] = 0;
}

// passthrough MenuBox for the function
// passthrough Menu for the function
sdata->ptrDesiredMenu = &data.menuQueueLoadTrack;

// set current level
Expand Down
2 changes: 1 addition & 1 deletion decompile/General/230/230_63_MM_Battle_MenuProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void DECOMP_MM_Battle_MenuProc(struct RectMenu* unused)
// if starting race
if (D230.battle_postTransition_boolStart != 0)
{
// passthrough MenuBox for funcPtr "QueueLoadTrack"
// passthrough Menu for funcPtr "QueueLoadTrack"
sdata->ptrDesiredMenu = &data.menuQueueLoadTrack;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion decompile/General/230/230_70_MM_ResetAllMenus.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void DECOMP_MM_ResetAllMenus(void)
{
struct RectMenu* menu = D230.arrayMenuPtrs[i];

// Close menubox
// Close menu
menu->state |= 8;
menu->state &= ~(ONLY_DRAW_TITLE | DRAW_NEXT_MENU_IN_HIERARCHY);

Expand Down
4 changes: 2 additions & 2 deletions decompile/General/232/232_12_AH_SaveObj_ThTick.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void DECOMP_AH_SaveObj_ThTick(struct Thread* t)
SelectProfile_GetTrackID();
#endif

// enable menubox for green load/save screen
// enable menu for green load/save screen
DECOMP_RECTMENU_Show(&data.menuGreenLoadSave);
}

Expand All @@ -153,7 +153,7 @@ void DECOMP_AH_SaveObj_ThTick(struct Thread* t)
// if you aren't already returning to player
((uVar6 & 0x400) == 0) &&

// if there's no MenuBox active
// if there's no Menu active
(sdata->ptrActiveMenu == NULL))
{
// toggle flag to return, this either snaps back
Expand Down
4 changes: 2 additions & 2 deletions decompile/General/233/233_37_39_CS_Garage.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void DECOMP_CS_Garage_MenuProc(void)
// if pressed X twice quickly
if (gGarage.boolSelected == 1)
{
// set desiredMenuBox to OSK (on-screen keyboard)
// set desiredMenu to OSK (on-screen keyboard)
sdata->ptrDesiredMenu = &data.menuSubmitName;

data.characterIDs[0] = sdata->advCharSelectIndex_curr;
Expand Down Expand Up @@ -525,7 +525,7 @@ void DECOMP_CS_Garage_MenuProc(void)
((gGT->gameMode2 & GARAGE_OSK) != 0)
)
{
// set desiredMenuBox to OSK (on-screen keyboard)
// set desiredMenu to OSK (on-screen keyboard)
sdata->ptrDesiredMenu = &data.menuSubmitName;

data.characterIDs[0] = sdata->advCharSelectIndex_curr;
Expand Down
8 changes: 4 additions & 4 deletions decompile/General/MAIN/MainFreeze_MenuPtrDefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void DECOMP_MainFreeze_MenuPtrDefault(struct RectMenu* menu)
// stringID 14: "OPTIONS"
if (stringID == 14)
{
// Set MenuBox to Options
// Set Menu to Options
sdata->ptrDesiredMenu = &data.menuRacingWheelConfig;

data.menuRacingWheelConfig.rowSelected = 8;
Expand All @@ -60,15 +60,15 @@ void DECOMP_MainFreeze_MenuPtrDefault(struct RectMenu* menu)
// stringID 12: "UKA UKA HINTS"
if (stringID == 11 || stringID == 12)
{
// Set MenuBox to Hints
// Set Menu to Hints
sdata->ptrDesiredMenu = &D232.menuHintMenu; // in 232
return;
}

// stringID 3: "QUIT"
if (stringID == 3)
{
// Set MenuBox to Quit
// Set Menu to Quit
sdata->ptrDesiredMenu = &data.menuQuit;
data.menuQuit.rowSelected = 1;
return;
Expand All @@ -77,7 +77,7 @@ void DECOMP_MainFreeze_MenuPtrDefault(struct RectMenu* menu)
// must wait 5 frames until next pause
gGT->cooldownFromUnpauseUntilPause = 5;

// hide MenuBox
// hide Menu
DECOMP_RECTMENU_Hide(menu);

// get rid of pause flag
Expand Down
14 changes: 7 additions & 7 deletions decompile/General/MAIN/MainFreeze_MenuPtrOptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ void DECOMP_MainFreeze_MenuPtrOptions(struct RectMenu* menu)
RECT volumeSliderBarOutline;
short volumeSliderTriangle [8];

// extra menubox details
// extra menu details
RECT glowingcursor;
RECT titleSeparatorLine;
RECT menuBoxBG;
RECT menuBG;

short local_70;
u_short menuRowsNegativePaddingCopy;
Expand Down Expand Up @@ -451,11 +451,11 @@ void DECOMP_MainFreeze_MenuPtrOptions(struct RectMenu* menu)
titleSeparatorLine.h = 2;
RECTMENU_DrawOuterRect_Edge(&titleSeparatorLine, (u_int)&sdata->battleSetup_Color_UI_1, 0x20, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);

menuBoxBG.x = 0x38;
menuBoxBG.w = 400;
menuBoxBG.h = 0x87 - menuRowsNegativePaddingCopy;
menuBoxBG.y = menuRowsNegativePadding_halved_again + 0x14;
RECTMENU_DrawInnerRect(&menuBoxBG, 4, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);
menuBG.x = 0x38;
menuBG.w = 400;
menuBG.h = 0x87 - menuRowsNegativePaddingCopy;
menuBG.y = menuRowsNegativePadding_halved_again + 0x14;
RECTMENU_DrawInnerRect(&menuBG, 4, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);

if ((local_70 != 0) || ((sdata->AnyPlayerTap & (BTN_TRIANGLE | BTN_START | BTN_SQUARE_one)) != 0))
{
Expand Down
6 changes: 3 additions & 3 deletions decompile/General/MAIN/MainFreeze_MenuPtrOptions_Rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ force_inline void DISPLAYRECTMENU_MainFreeze_MenuPtrOptions(struct RectMenu* men
// note: multitap only works if it's connected to the P1 slot
int isMultitap = (sdata->gGamepads->slotBuffer[0].controllerData == (PAD_ID_MULTITAP << 4));

// a menubox row is 10 pixels
// a menu row is 10 pixels
int menuRowsNegativePadding = gamepad->menuRowsToRemove * 10;

int analogRowPosY = 0;
Expand Down Expand Up @@ -378,14 +378,14 @@ force_inline void DISPLAYRECTMENU_MainFreeze_MenuPtrOptions(struct RectMenu* men
};
RECTMENU_DrawOuterRect_Edge(&titleSeparatorLine, (u_int)&sdata->battleSetup_Color_UI_1, 0x20, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);

RECT menuBoxBG =
RECT menuBG =
{
.x = 56,
.y = (menuRowsNegativePadding / 2) + 20,
.w = 400,
.h = 135 - menuRowsNegativePadding
};
RECTMENU_DrawInnerRect(&menuBoxBG, 4, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);
RECTMENU_DrawInnerRect(&menuBG, 4, (u_long *)(sdata->gGT->backBuffer->otMem).startPlusFour);
}

void DECOMP_MainFreeze_MenuPtrOptions(struct RectMenu* menu)
Expand Down
24 changes: 12 additions & 12 deletions decompile/General/RECTMENU/RECTMENU_DrawSelf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <common.h>

void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short menuboxWidth)
void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short menuWidth)
{
u_short textFlags;
u_int state;
Expand All @@ -17,7 +17,7 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short
RECT background;
RECT borders;
short local_60;
short menuboxHeight;
short menuHeight;
short offsetY;
short local_50;
short local_48;
Expand Down Expand Up @@ -72,19 +72,19 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short

state = menu->state;

menu->width = menuboxWidth;
menu->width = menuWidth;
menu->state &= 0xfffffff7;
menu->height = local_60;

if ((state & 2) != 0)
{
menuboxHeight = 0;
DECOMP_RECTMENU_GetHeight(menu, &menuboxHeight, 1);
local_38 = (short)(-menuboxHeight/2);
menuHeight = 0;
DECOMP_RECTMENU_GetHeight(menu, &menuHeight, 1);
local_38 = (short)(-menuHeight/2);
}
if ((state & 1) != 0)
{
local_40 = (short)(-menuboxWidth/2);
local_40 = (short)(-menuWidth/2);
}
sVar6 = 0;
row = &menu->rows[0];
Expand All @@ -111,15 +111,15 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short
{
uVar5 = uVar8 | 0x8000;
titleString = sdata->lngStrings[index];
offsetX = (short)(posX + menu->posX_prev + (menuboxWidth/2));
offsetX = (short)(posX + menu->posX_prev + (menuWidth/2));
}
DECOMP_DecalFont_DrawLine(titleString, offsetX, posY_prev, sVar4, uVar5);
posY_prev = local_48 + posY_prev + 6;
}

if (row->stringIndex != -1)
{
local_30 = (menuboxWidth/2) + 1;
local_30 = (menuWidth/2) + 1;
local_2c = posX_prev;
do
{
Expand Down Expand Up @@ -189,7 +189,7 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short
{
rgb = &sdata->menuRowHighlight_Green;
}
background.w = menuboxWidth;
background.w = menuWidth;

DECOMP_CTR_Box_DrawClearBox(
&background, rgb, 1,
Expand All @@ -200,7 +200,7 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short
{
DECOMP_RECTMENU_DrawSelf(menu->ptrNextBox_InHierarchy,
posX + menu->posX_prev,
local_38 + offsetY + menu->posY_prev + sVar7 + 0xc, menuboxWidth);
local_38 + offsetY + menu->posY_prev + sVar7 + 0xc, menuWidth);
}
posX_prev = menu->posX_prev;
posY_prev = menu->posY_prev;
Expand All @@ -212,7 +212,7 @@ void DECOMP_RECTMENU_DrawSelf(struct RectMenu* menu, int posX, short posY, short
{
borders.h = sVar7 + 8;
}
borders.w = menuboxWidth + 0xc;
borders.w = menuWidth + 0xc;
borders.y = local_38 + offsetY + posY_prev - 4;
borders.x = local_40 + posX + posX_prev - 6;
DECOMP_RECTMENU_DrawFullRect(menu, &borders);
Expand Down
Loading

0 comments on commit 4070098

Please sign in to comment.