Mario Kart 64
Loading...
Searching...
No Matches
menus.c File Reference
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <common_structs.h>
#include <mk64.h>
#include "menus.h"
#include "main.h"
#include "code_800029B0.h"
#include "actors.h"
#include "audio/external.h"
#include "code_80005FD0.h"
#include "code_80091750.h"
#include "code_800AF9B0.h"
#include "save.h"
#include "staff_ghosts.h"
#include "save_data.h"
#include <sounds.h>
#include "spawn_players.h"
Include dependency graph for menus.c:

Macros

#define DEBUG_MODE_TOGGLE   false
 
#define DEBUG_MENU_SELECTION   DEBUG_MENU_DISABLED
 

Functions

void update_menus (void)
 
void options_menu_act (struct Controller *controller, u16 controllerIdx)
 
void data_menu_act (struct Controller *controller, UNUSED u16 controllerIdx)
 
void course_data_menu_act (struct Controller *controller, UNUSED u16 controllerIdx)
 
void logo_intro_menu_act (struct Controller *controller, UNUSED u16 controllerIdx)
 
void controller_pak_menu_act (struct Controller *controller, UNUSED u16 controllerIdx)
 
void splash_menu_act (struct Controller *controller, u16 controllerIdx)
 
void setup_game_mode_selected (void)
 
bool is_character_spot_free (s32 gridId)
 
void course_select_menu_act (struct Controller *arg0, u16 controllerIdx)
 
void load_menu_states (s32 menuSelection)
 
void reset_cycle_flash_menu (void)
 
void set_sound_mode (void)
 
bool is_screen_being_faded (void)
 
UNUSED void debug_print_ghost_kart_character_id (s32 arg0, s32 arg1)
 

Variables

s32 gIntroModelZEye
 
f32 gIntroModelScale
 
f32 gIntroModelRotX
 
f32 gIntroModelRotY
 
f32 gIntroModelRotZ
 
f32 gIntroModelPosX
 
f32 gIntroModelPosY
 
f32 gIntroModelPosZ
 
s32 gMenuFadeType
 
s8 gCharacterGridSelections [4]
 
bool8 gCharacterGridIsSelected [4]
 
s8 gSubMenuSelection
 
s8 gMainMenuSelection
 
s8 gPlayerSelectMenuSelection
 
s8 gDebugMenuSelection
 
s8 gControllerPakMenuSelection
 
s8 gScreenModeListIndex
 
u8 gSoundMode
 
s8 gPlayerCount
 
s8 gVersusResultCursorSelection
 
s8 gTimeTrialsResultCursorSelection
 
s8 gBattleResultCursorSelection
 
s8 gTimeTrialDataCourseIndex
 
s8 gCourseRecordsMenuSelection
 
s8 gCourseRecordsSubMenuSelection
 
s8 gDebugGotoScene
 
bool8 gGhostPlayerInit
 
bool8 gCourseMapInit
 
s32 gMenuTimingCounter
 
s32 gMenuDelayTimer
 
s8 gDemoUseController
 
s8 gCupSelection
 
s8 sTempCupSelection
 
s8 gCourseIndexInCup
 
s8 unref_8018EE0C
 
s32 gMenuSelection = LOGO_INTRO_MENU
 
s32 gFadeModeSelection = FADE_MODE_NONE
 
s8 gCharacterSelections [4] = { MARIO, LUIGI, YOSHI, TOAD }
 
s8 gGameModeMenuColumn [4] = { 0, 0, 0, 0 }
 
s8 gGameModeSubMenuColumn [4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }
 
s8 gNextDemoId = 0
 
s8 gControllerPakSelectedTableRow = 0
 
s8 gControllerPakVisibleTableRows [12] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 }
 
s8 gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE
 
s8 unref_D_800E86D4 [12] = { 0 }
 
s8 unref_800E86E0 [4] = { 0, 0, 0, 1 }
 
u32 sVIGammaOffDitherOn = (OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON)
 
const s8 sScreenModePlayerTable []
 
const s8 sScreenModePlayerCount [] = { 1, 2, 2, 3, 4 }
 
const s8 gPlayerModeSelection [] = { 1, 2, 1, 1 }
 
const s8 sGameModePlayerColumnDefault [][3]
 
const s8 sGameModePlayerColumnExtra [][3]
 
const s32 gGameModePlayerSelection [][3]
 
const s8 sCharacterGridOrder []
 
const s16 gCupCourseOrder [5][4]
 
const s8 unref_800F2BDC [4] = { 1, 0, 0, 0 }
 
const s8 sScreenModeIdxFromPlayerMode [4] = { 0, 1, 3, 4 }
 
const union GameModePack sSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } }
 

Macro Definition Documentation

◆ DEBUG_MENU_SELECTION

#define DEBUG_MENU_SELECTION   DEBUG_MENU_DISABLED

◆ DEBUG_MODE_TOGGLE

#define DEBUG_MODE_TOGGLE   false

Function Documentation

◆ controller_pak_menu_act()

void controller_pak_menu_act ( struct Controller * controller,
UNUSED u16 controllerIdx )

Navigation of the controller pak table data

Here is the call graph for this function:
Here is the caller graph for this function:

◆ course_data_menu_act()

void course_data_menu_act ( struct Controller * controller,
UNUSED u16 controllerIdx )

Navigation of the course records data menu

Here is the call graph for this function:
Here is the caller graph for this function:

◆ course_select_menu_act()

void course_select_menu_act ( struct Controller * arg0,
u16 controllerIdx )

Navigation of the player select screen Grid positions are from right to left, then top to bottom Navigation of the map select course menu screen

Here is the call graph for this function:
Here is the caller graph for this function:

◆ data_menu_act()

void data_menu_act ( struct Controller * controller,
UNUSED u16 controllerIdx )

Navigation of the data menu

Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_print_ghost_kart_character_id()

UNUSED void debug_print_ghost_kart_character_id ( s32 arg0,
s32 arg1 )

Unused debug function, prints the character id for the player and both controller pak ghosts

Here is the call graph for this function:

◆ is_character_spot_free()

bool is_character_spot_free ( s32 gridId)

Navigation of the main game mode select screen Check if there is no currently selected and/or hovered character at grid position gridId

◆ is_screen_being_faded()

bool is_screen_being_faded ( void )

Checks is a fade render mode is active so menus can't be interacted while a fade transition is active

Here is the caller graph for this function:

◆ load_menu_states()

void load_menu_states ( s32 menuSelection)

Loads menu states so they are preserved between menu changes

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logo_intro_menu_act()

void logo_intro_menu_act ( struct Controller * controller,
UNUSED u16 controllerIdx )

On input skip logo screen

Here is the call graph for this function:
Here is the caller graph for this function:

◆ options_menu_act()

void options_menu_act ( struct Controller * controller,
u16 controllerIdx )

Navigation of the options menu

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_cycle_flash_menu()

void reset_cycle_flash_menu ( void )

Self explanatory, gets reset when moving cursor option or after a fade

Here is the caller graph for this function:

◆ set_sound_mode()

void set_sound_mode ( void )

Self explanatory, changes sound mode pack

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_game_mode_selected()

void setup_game_mode_selected ( void )

◆ splash_menu_act()

void splash_menu_act ( struct Controller * controller,
u16 controllerIdx )

Navigation of the main splash start screen menu Also handles debug menu options

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_menus()

void update_menus ( void )

General menu main handler Includes opening logo and splash screens

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gBattleResultCursorSelection

s8 gBattleResultCursorSelection

◆ gCharacterGridIsSelected

bool8 gCharacterGridIsSelected[4]

◆ gCharacterGridSelections

s8 gCharacterGridSelections[4]

◆ gCharacterSelections

s8 gCharacterSelections[4] = { MARIO, LUIGI, YOSHI, TOAD }

◆ gControllerPakMenuSelection

s8 gControllerPakMenuSelection

◆ gControllerPakScrollDirection

s8 gControllerPakScrollDirection = CONTROLLER_PAK_SCROLL_DIR_NONE

◆ gControllerPakSelectedTableRow

s8 gControllerPakSelectedTableRow = 0

◆ gControllerPakVisibleTableRows

s8 gControllerPakVisibleTableRows[12] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 }

◆ gCourseIndexInCup

s8 gCourseIndexInCup

◆ gCourseMapInit

bool8 gCourseMapInit

◆ gCourseRecordsMenuSelection

s8 gCourseRecordsMenuSelection

◆ gCourseRecordsSubMenuSelection

s8 gCourseRecordsSubMenuSelection

◆ gCupCourseOrder

const s16 gCupCourseOrder[5][4]
Initial value:
= {
}
@ COURSE_WARIO_STADIUM
Definition mk64.h:41
@ COURSE_MARIO_RACEWAY
Definition mk64.h:27
@ COURSE_BANSHEE_BOARDWALK
Definition mk64.h:30
@ COURSE_KALAMARI_DESERT
Definition mk64.h:38
@ COURSE_BIG_DONUT
Definition mk64.h:46
@ COURSE_ROYAL_RACEWAY
Definition mk64.h:34
@ COURSE_BLOCK_FORT
Definition mk64.h:42
@ COURSE_FRAPPE_SNOWLAND
Definition mk64.h:32
@ COURSE_LUIGI_RACEWAY
Definition mk64.h:35
@ COURSE_RAINBOW_ROAD
Definition mk64.h:40
@ COURSE_YOSHI_VALLEY
Definition mk64.h:31
@ COURSE_CHOCO_MOUNTAIN
Definition mk64.h:28
@ COURSE_TOADS_TURNPIKE
Definition mk64.h:37
@ COURSE_SKYSCRAPER
Definition mk64.h:43
@ COURSE_DOUBLE_DECK
Definition mk64.h:44
@ COURSE_BOWSER_CASTLE
Definition mk64.h:29
@ COURSE_KOOPA_BEACH
Definition mk64.h:33
@ COURSE_MOO_MOO_FARM
Definition mk64.h:36
@ COURSE_DK_JUNGLE
Definition mk64.h:45
@ COURSE_SHERBET_LAND
Definition mk64.h:39

◆ gCupSelection

s8 gCupSelection

◆ gDebugGotoScene

s8 gDebugGotoScene

◆ gDebugMenuSelection

s8 gDebugMenuSelection

◆ gDemoUseController

s8 gDemoUseController

◆ gFadeModeSelection

s32 gFadeModeSelection = FADE_MODE_NONE

◆ gGameModeMenuColumn

s8 gGameModeMenuColumn[4] = { 0, 0, 0, 0 }

◆ gGameModePlayerSelection

const s32 gGameModePlayerSelection[][3]
Initial value:
= {
{ GRAND_PRIX, TIME_TRIALS, 0x00000000 },
{ VERSUS, BATTLE, 0x00000000 },
{ VERSUS, BATTLE, 0x00000000 },
}
#define BATTLE
Definition defines.h:124
#define VERSUS
Definition defines.h:123
#define GRAND_PRIX
Options for gModeSelection.
Definition defines.h:121
#define TIME_TRIALS
Definition defines.h:122

◆ gGameModeSubMenuColumn

s8 gGameModeSubMenuColumn[4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }

◆ gGhostPlayerInit

bool8 gGhostPlayerInit

◆ gIntroModelPosX

f32 gIntroModelPosX

◆ gIntroModelPosY

f32 gIntroModelPosY

◆ gIntroModelPosZ

f32 gIntroModelPosZ

◆ gIntroModelRotX

f32 gIntroModelRotX

◆ gIntroModelRotY

f32 gIntroModelRotY

◆ gIntroModelRotZ

f32 gIntroModelRotZ

◆ gIntroModelScale

f32 gIntroModelScale

◆ gIntroModelZEye

s32 gIntroModelZEye

BSS

◆ gMainMenuSelection

s8 gMainMenuSelection

◆ gMenuDelayTimer

s32 gMenuDelayTimer

◆ gMenuFadeType

s32 gMenuFadeType

◆ gMenuSelection

s32 gMenuSelection = LOGO_INTRO_MENU

Data

◆ gMenuTimingCounter

s32 gMenuTimingCounter

◆ gNextDemoId

s8 gNextDemoId = 0

◆ gPlayerCount

s8 gPlayerCount

◆ gPlayerModeSelection

const s8 gPlayerModeSelection[] = { 1, 2, 1, 1 }

◆ gPlayerSelectMenuSelection

s8 gPlayerSelectMenuSelection

◆ gScreenModeListIndex

s8 gScreenModeListIndex

◆ gSoundMode

u8 gSoundMode

◆ gSubMenuSelection

s8 gSubMenuSelection

◆ gTimeTrialDataCourseIndex

s8 gTimeTrialDataCourseIndex

◆ gTimeTrialsResultCursorSelection

s8 gTimeTrialsResultCursorSelection

◆ gVersusResultCursorSelection

s8 gVersusResultCursorSelection

◆ sCharacterGridOrder

const s8 sCharacterGridOrder[]
Initial value:
= {
}
#define LUIGI
Definition defines.h:162
#define BOWSER
Definition defines.h:168
#define MARIO
Character IDs Note that these are not the same as the values found in gCharacterGridSelections as tho...
Definition defines.h:161
#define YOSHI
Definition defines.h:163
#define DK
Definition defines.h:165
#define WARIO
Definition defines.h:166
#define PEACH
Definition defines.h:167
#define TOAD
Definition defines.h:164

◆ sGameModePlayerColumnDefault

const s8 sGameModePlayerColumnDefault[][3]
Initial value:
= {
{ 2, 1, 0 },
{ 2, 2, 0 },
{ 2, 0, 0 },
{ 2, 0, 0 },
}

◆ sGameModePlayerColumnExtra

const s8 sGameModePlayerColumnExtra[][3]
Initial value:
= {
{ 3, 1, 0 },
{ 3, 3, 0 },
{ 3, 0, 0 },
{ 3, 0, 0 },
}

◆ sScreenModeIdxFromPlayerMode

const s8 sScreenModeIdxFromPlayerMode[4] = { 0, 1, 3, 4 }

◆ sScreenModePlayerCount

const s8 sScreenModePlayerCount[] = { 1, 2, 2, 3, 4 }

◆ sScreenModePlayerTable

const s8 sScreenModePlayerTable[]
Initial value:
= {
}
#define SCREEN_MODE_2P_SPLITSCREEN_VERTICAL
Definition defines.h:200
#define SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL
Definition defines.h:199
#define SCREEN_MODE_1P
Options for gScreenModeSelection and gActiveScreenMode.
Definition defines.h:198
#define SCREEN_MODE_3P_4P_SPLITSCREEN
Definition defines.h:201

RoData

◆ sSoundMenuPack

const union GameModePack sSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } }

◆ sTempCupSelection

s8 sTempCupSelection

◆ sVIGammaOffDitherOn

u32 sVIGammaOffDitherOn = (OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON)

◆ unref_800E86E0

s8 unref_800E86E0[4] = { 0, 0, 0, 1 }

◆ unref_800F2BDC

const s8 unref_800F2BDC[4] = { 1, 0, 0, 0 }

◆ unref_8018EE0C

s8 unref_8018EE0C

◆ unref_D_800E86D4

s8 unref_D_800E86D4[12] = { 0 }