diff --git a/include/defines.h b/include/defines.h index 14542b7045..a6a34935b2 100644 --- a/include/defines.h +++ b/include/defines.h @@ -3,13 +3,13 @@ /** - * Options for Controller Pak state + * @brief Options for Controller Pak state */ #define OK 1 #define BAD 0 /** - * Enable debug mode + * @brief Enable debug mode * * Press start to skip through menus * @@ -37,13 +37,13 @@ * D-pad RIGHT = BOWSER * D-pad DOWN = MARIO * -*/ + */ #define DEBUG_MODE 0 #define DEBUG_MENU 1 #define HOLD_ALL_DPAD_AND_C_BUTTONS (U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS) /** - * Options for gDebugMenuSelection + * @brief Options for gDebugMenuSelection */ #define DEBUG_MENU_DISABLED 1 #define DEBUG_MENU_DEBUG_MODE 2 @@ -55,7 +55,7 @@ #define DEBUG_MENU_EXITED 64 /** - * Options for gDebugGotoScene + * @brief Options for gDebugGotoScene */ #define DEBUG_GOTO_RACING 0 #define DEBUG_GOTO_ENDING_SEQUENCE 1 @@ -63,8 +63,7 @@ #define DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA 3 /** - * Jump to demo mode from the debug menu - * using L and A + * @brief Jump to demo mode from the debug menu using L and A */ #define DEMO_MODE_ACTIVE 1 #define DEMO_MODE_INACTIVE 0 @@ -75,18 +74,16 @@ * Start sequence means waiting for the light to turn green. * Used in the Player struct's 'type' member: player->type */ - #define PLAYER_INACTIVE 0 // 0x0000 -#define PLAYER_EXISTS (1 << 15) // 0x8000 -#define PLAYER_CINEMATIC_MODE (1 << 11) // 0x0800 // Also used to track eliminations in Battle mode. +#define PLAYER_UNKNOWN_0x40 (1 << 6) // 0x0040 +#define PLAYER_INVISIBLE_OR_BOMB (1 << 8) // 0x0100 #define PLAYER_STAGING (1 << 9) // 0x0200 -#define PLAYER_START_SEQUENCE (1 << 13) // 0x2000 +#define PLAYER_UNKNOWN (1 << 10) // 0x0400 // unused ? +#define PLAYER_CINEMATIC_MODE (1 << 11) // 0x0800 // Also used to track eliminations in Battle mode. #define PLAYER_CPU (1 << 12) // 0x1000 +#define PLAYER_START_SEQUENCE (1 << 13) // 0x2000 #define PLAYER_HUMAN (1 << 14) // 0x4000 -#define PLAYER_INVISIBLE_OR_BOMB (1 << 8) // 0x0100 -#define PLAYER_UNKNOWN_0x40 (1 << 6) // 0x0040 -// unused? -#define PLAYER_UNKNOWN (1 << 10) // 0x0400 +#define PLAYER_EXISTS (1 << 15) // 0x8000 // Compiles to -0x1000 in diff.py #define PLAYER_HUMAN_AND_CPU PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_CPU | PLAYER_START_SEQUENCE @@ -117,15 +114,15 @@ #define MAX_NUM_MAIN_MENU_GAME_TYPES 3 /** - * Options for gModeSelection -**/ + * @brief Options for gModeSelection + */ #define GRAND_PRIX 0 #define TIME_TRIALS 1 #define VERSUS 2 #define BATTLE 3 /** - * Options for gCCSelection + * @brief Options for gCCSelection * CC stands for cubic-centimetres. * It measures engine displacement composed from * cylinder volume. @@ -139,11 +136,11 @@ #define CC_BATTLE 4 /** - * Options for gCupSelection + * @brief Options for gCupSelection * There is a "cup" for battle mode, probably so that * the battle courses could be displayed in the same * way race courses are. -**/ + */ #define MUSHROOM_CUP 0 #define FLOWER_CUP 1 #define STAR_CUP 2 @@ -152,11 +149,11 @@ #define NUM_CUPS 5 /** - * Character IDs + * @brief Character IDs * Note that these are not the same as the values * found in gCharacterGridSelections as those are * ordered by table -**/ + */ #define MARIO 0 #define LUIGI 1 #define YOSHI 2 @@ -167,8 +164,8 @@ #define BOWSER 7 /** - * Options for gMenuSelection -**/ + * @brief Options for gMenuSelection + */ #define OPTIONS_MENU 5 #define DATA_MENU 6 #define COURSE_DATA_MENU 7 @@ -181,8 +178,8 @@ #define RACING_DUPLICATE 14 /** - * Options for gGameState gMenuSelectionFromQuit and gMenuSelectionFromEndingSequence -**/ + * @brief Options for gGameState gMenuSelectionFromQuit and gMenuSelectionFromEndingSequence + */ #define START_MENU_FROM_QUIT 0 #define MAIN_MENU_FROM_QUIT 1 #define PLAYER_SELECT_MENU_FROM_QUIT 2 @@ -192,8 +189,8 @@ #define CREDITS_SEQUENCE 9 /** - * Options for gMainMenuSelectionDepth -**/ + * @brief Options for gMainMenuSelectionDepth + */ #define BLANK_MAIN_MENU 0 #define OPTIONS_SELECTION 1 #define DATA_SELECTION 2 @@ -205,8 +202,8 @@ #define TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT 8 /** - * Options for gControllerPakMenuSelection -**/ + * @brief Options for gControllerPakMenuSelection + */ #define CONTROLLER_PAK_MENU_SELECT_RECORD 1 #define CONTROLLER_PAK_MENU_END 2 #define CONTROLLER_PAK_MENU_ERASE 3 @@ -219,7 +216,7 @@ #define CONTROLLER_PAK_MENU_ERASE_ERROR_PAK_CHANGED 10 /** - * Options for gScreenModeSelection and gActiveScreenMode + * @brief Options for gScreenModeSelection and gActiveScreenMode */ #define SCREEN_MODE_1P 0 #define SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL 1 @@ -228,8 +225,8 @@ #define NUM_SCREEN_MODES 4 /** - * Indexes for accessing Time Trial records -**/ + * @brief Indexes for accessing Time Trial records + */ #define TIME_TRIAL_3LAP_RECORD_1 0 #define TIME_TRIAL_3LAP_RECORD_2 1 #define TIME_TRIAL_3LAP_RECORD_3 2 @@ -238,13 +235,13 @@ #define TIME_TRIAL_1LAP_RECORD 5 /** - * Text color options + * @brief Text color options * The 2 cycling options cycle through Blue -> Green -> Red * Cycle 2 appears to be one step ahead of Cycle 1 * Other values like 6 and 7 sort of work, they cause rapid * flashing between 2 colors, but also cause individual characters * to be cutoff on their right side -**/ + */ #define TEXT_BLUE 0 #define TEXT_GREEN 1 #define TEXT_RED 2 @@ -253,10 +250,10 @@ #define TEXT_BLUE_GREEN_RED_CYCLE_2 5 /** - * Sound mode options + * @brief Sound mode options * Option 2 appears to be unused, as such its probably not * a valid option -**/ + */ #define SOUND_STEREO 0 #define SOUND_HEADPHONES 1 #define SOUND_UNUSED 2 @@ -264,9 +261,9 @@ #define NUM_SOUND_MODES 4 /** - * Title screen demo options + * @brief Title screen demo options * All demos use 100 CC -**/ + */ #define DEMO_ONE 0 // Mario, Mario Raceway, Grand Prix #define DEMO_TWO 1 // Yoshi DK, Choco Mountain, Versus #define DEMO_THREE 2 // Luigi, Kalamari Desert, Grand Prix @@ -282,8 +279,8 @@ #define NUM_COURSES_PER_CUP 4 /** - * Item IDs -**/ + * @brief Item IDs + */ #define ITEM_NONE 0 #define ITEM_BANANA 1 #define ITEM_BANANA_BUNCH 2 @@ -302,14 +299,14 @@ #define ITEM_SUPER_MUSHROOM 15 /** - * Balloon status -**/ + * @brief Balloon status + */ #define BALLOON_STATUS_GONE 0 #define BALLOON_STATUS_PRESENT 1 #define BALLOON_STATUS_DEPARTING 2 /** - * Max representable time, 100 minutes measured in centiseconds + * @brief Max representable time, 100 minutes measured in centiseconds */ #define MAX_TIME 0x927C0 @@ -317,14 +314,14 @@ * @brief effect of player's * for statusEffect */ -#define BOOST_EFFECT 0x200 // being boosted by trigger a mushroom or star -#define BOO_EFFECT 0x800 // being a boo -#define STAR_EFFECT 0x2000 // being a star -#define HOLD_BANANA_EFFECT 0x40000 // holding a banana +#define BOOST_EFFECT 0x200 // being boosted by trigger a mushroom or star +#define BOO_EFFECT 0x800 // being a boo +#define STAR_EFFECT 0x2000 // being a star #define HIT_ROTATING_EFFECT 0x4000 // hitting a rotating object -#define HIT_BY_ITEM_EFFECT 0x1000000 // being hit by an item -#define REVERSE_EFFECT 0x400000 // being in the wrong direction -#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning +#define HOLD_BANANA_EFFECT 0x40000 // holding a banana +#define REVERSE_EFFECT 0x400000 // being in the wrong direction +#define HIT_BY_ITEM_EFFECT 0x1000000 // being hit by an item +#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning /** diff --git a/src/camera.c b/src/camera.c index 3e0142df90..f28ef50b1c 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1006,7 +1006,7 @@ void func_8001F394(Player *player, f32 *arg1) { } if (D_80164A08[playerIndex] == 0) { - if (player->statusEffects & 0x40000) { + if (player->statusEffects & HOLD_BANANA_EFFECT) { D_80164A08[playerIndex] = 1; } if ((player->effects & 0x2000) == 0x2000) { @@ -1025,7 +1025,7 @@ void func_8001F394(Player *player, f32 *arg1) { } switch (D_80164A08[playerIndex]) { case 1: - if (player->statusEffects & 0x40000) { + if (player->statusEffects & HOLD_BANANA_EFFECT) { move_f32_towards(&D_80164498[playerIndex], 20.0f, 0.2f); } else { if (D_80164498[playerIndex] > 1.0f) { diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 31aa2b2677..524e702f28 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -1546,7 +1546,7 @@ void func_8000929C(s32 playerId, Player *player) { func_80008F38(playerId); func_80011AE4(playerId); *(&D_801642DE + (playerId * 0x10)) = 0; - if ((D_8016348C == 0) && !(player->type & 0x800)) { + if ((D_8016348C == 0) && !(player->type & PLAYER_CINEMATIC_MODE)) { sp30 = var_a3; sp34 = var_t0; temp_f0_2 = func_80009258(playerId, sp38, sp44, (u16 *) var_a3); @@ -6219,7 +6219,7 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3 if ((temp_f0 > -20.0) && (temp_f0 < 20.0)) { temp_f0_2 = (f64) temp_f24; if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0) && (func_80006018(temp_f12, temp_f14, var_s0->velocity[0], var_s0->velocity[2], arg3, arg4, spC4, spBC) == (s32) 1U)) { - player->statusEffects |= 0x400000; + player->statusEffects |= REVERSE_EFFECT; } } } @@ -8821,7 +8821,7 @@ void func_8001AC10(s32 playerId) { struct BananaBunchParent *bananaBunchParent; player = &gPlayerOne[playerId]; - if (((gModeSelection != ((s32) 1)) && (((u16) D_801646CC) != ((u16) 1))) && (!(player->type & 0x800))) { + if (((gModeSelection != ((s32) 1)) && (((u16) D_801646CC) != ((u16) 1))) && (!(player->type & PLAYER_CINEMATIC_MODE))) { temp_s0 = &D_801642D8[playerId]; switch (temp_s0->unk_00) { case 0: @@ -8857,7 +8857,7 @@ void func_8001AC10(s32 playerId) { } else if (temp_s0->unk_00 == 1) { temp_s0->actorIndex = use_banana_item(player); if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { - player->statusEffects |= 0x40000; + player->statusEffects |= HOLD_BANANA_EFFECT; temp_s0->unk_00 = 2; temp_s0->unk_04 = 0; temp_s0->unk_06 += 1; @@ -8903,7 +8903,7 @@ void func_8001AC10(s32 playerId) { if ((temp_s0->actorIndex >= 0) && (temp_s0->actorIndex < 0x64)) { banana = (struct BananaActor*)&gActorList[temp_s0->actorIndex]; banana->state = 4; - player->statusEffects |= 0x40000; + player->statusEffects |= HOLD_BANANA_EFFECT; temp_s0->unk_00 = 0x0023; temp_s0->unk_04 = 0; temp_s0->unk_06 += 1; @@ -9179,7 +9179,7 @@ void func_8001AC10(s32 playerId) { break; case 25: - player->statusEffects |= 0x2000; + player->statusEffects |= STAR_EFFECT; temp_s0->unk_00 = 0x001A; temp_s0->unk_04 = 0; temp_s0->unk_06 += 1; @@ -9193,7 +9193,7 @@ void func_8001AC10(s32 playerId) { break; case 27: - player->statusEffects |= 0x800; + player->statusEffects |= BOO_EFFECT; temp_s0->unk_00 = 0x001C; temp_s0->unk_04 = 0; temp_s0->unk_06 += 1; @@ -9207,7 +9207,7 @@ void func_8001AC10(s32 playerId) { break; case 29: - player->statusEffects |= 0x200; + player->statusEffects |= BOOST_EFFECT; temp_s0->unk_00 = 0; temp_s0->unk_04 = 0; temp_s0->unk_06 += 1; @@ -9215,7 +9215,7 @@ void func_8001AC10(s32 playerId) { case 30: if (temp_s0->unk_04 >= 0x3D) { - player->statusEffects |= 0x200; + player->statusEffects |= BOOST_EFFECT; temp_s0->unk_00 = 0x001D; temp_s0->unk_04 = 0; } @@ -9223,7 +9223,7 @@ void func_8001AC10(s32 playerId) { case 31: if (temp_s0->unk_04 >= 0x3D) { - player->statusEffects |= 0x200; + player->statusEffects |= BOOST_EFFECT; temp_s0->unk_00 = 0x001E; temp_s0->unk_04 = 0; } @@ -9237,7 +9237,7 @@ void func_8001AC10(s32 playerId) { case 33: if ((((s16) temp_s0->unk_04) % 60) == 0) { - player->statusEffects |= 0x200; + player->statusEffects |= BOOST_EFFECT; if (temp_s0->unk_0E < temp_s0->unk_04) { temp_s0->unk_00 = 0; temp_s0->unk_04 = 0; diff --git a/src/code_8001F980.c b/src/code_8001F980.c index 146a4a5f1c..7d251ab040 100644 --- a/src/code_8001F980.c +++ b/src/code_8001F980.c @@ -313,7 +313,7 @@ void func_80020F1C(void) { void try_render_player(Player *player, s8 playerId, s8 arg2) { if (((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) - && ((player->type & 0x40) == 0)) { + && ((player->type & PLAYER_UNKNOWN_0x40) == 0)) { if ((player->unk_002 & 2 << (arg2 * 4)) == 2 << (arg2 * 4)) { player_render(player, playerId, arg2); } @@ -1086,7 +1086,7 @@ void render_light_environment_on_player(Player *player, s8 arg1) { void func_800235AC(Player *player, s8 arg1) { s32 temp; - if (((player->type & 0x100) == 0x100) && (player == gPlayerThree)) { + if (((player->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) && (player == gPlayerThree)) { change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f); change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f); D_80164B80[arg1] = 0; diff --git a/src/code_80057C60.c b/src/code_80057C60.c index a372829836..88174ccc44 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -6098,7 +6098,7 @@ void func_8006C6AC(Player *player, s16 arg1, s8 arg2, s8 arg3) { // func_80060BCC(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); func_80060BCC(player, arg1, sp28, (s32) arg2); } else if (!(player->effects & 8) && !(player->effects & 2)) { - if (((player->effects & 0x10) == 0x10) && ((player->type & 0x4000) == 0x4000)) { + if (((player->effects & 0x10) == 0x10) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { func_8005DA30(player, arg1, sp28, arg2, (s8) (s32) arg3); } else if (((f64) (D_801652A0[arg2] - player->boundingBoxCorners[3].cornerGroundY) >= 3.5) || ((f64) (D_801652A0[arg2] - player->boundingBoxCorners[2].cornerGroundY) >= 3.5)) { // func_8005EA94(player, arg1, sp28, arg2, /* extra? */ (s32) arg3); @@ -6211,11 +6211,11 @@ void func_8006C9B8(Player *player, s16 arg1, s8 arg2, s8 arg3) { player->unk_044 &= ~0x0100; return; } - if ((player->effects & 0x2000) && (player->type & 0x4000)) { + if ((player->effects & 0x2000) && (player->type & PLAYER_HUMAN)) { func_800621BC(player, arg1, sp28, arg2); return; } - if (((player->effects & 0x200000) || (player->effects & 0x100000)) && ((player->type & 0x4000) == 0x4000)) { + if (((player->effects & 0x200000) || (player->effects & 0x100000)) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { func_80061EF4(player, arg1, sp28, arg2); player->unk_046 &= ~0x0008; player->unk_044 &= ~0x0100; @@ -6659,14 +6659,14 @@ void func_8006E420(Player* player, s8 arg1, s8 arg2) { s16 temp_s0; if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) { - if ((player->type & 0x4000) == 0x4000) { + if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_8006D194(player, arg1, arg2); } for (temp_s0 = 0; temp_s0 < 10; ++temp_s0) { func_8006CEC0(player, temp_s0, arg1, arg2); - if (((player->type & 0x4000) == 0x4000) || (gGamestate == ENDING_SEQUENCE)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) || (gGamestate == ENDING_SEQUENCE)) { func_8006C9B8(player, temp_s0, arg1, arg2); } func_8006C6AC(player, temp_s0, arg1, arg2); diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index ad3a233164..315a0f49f5 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -658,7 +658,7 @@ void func_8006FA94(void) { } break; case 2: - if (gScreenModeSelection == 1) { + if (gScreenModeSelection == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) { if (gModeSelection == 0) { D_8018D114 = 2; D_8018D178 = 0x00000096; diff --git a/src/code_80071F00.c b/src/code_80071F00.c index f99f4a1f1e..1444a7d1bc 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -6332,7 +6332,7 @@ void func_80080A4C(s32 objectIndex, s32 cameraPlayerId) { Camera *camera = &camera1[cameraPlayerId]; Player *player = &gPlayerOne[cameraPlayerId]; - if (gScreenModeSelection != 3) { + if (gScreenModeSelection != SCREEN_MODE_3P_4P_SPLITSCREEN) { if ((func_80072320(objectIndex, 0x00000010) != 0) && (func_80088A58(objectIndex, player, 500.0f) != 0)) { func_8001CA10(camera); func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x1900800FU); diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 97f6afe822..f2ce9f82e2 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -1052,7 +1052,7 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) { if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000200) != 0) { for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) { if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x81000000)) { - if ((player->type & PLAYER_EXISTS) && !(player->type & 0x100) && (func_80088E98(objectIndex, player, arg1) != 0)) { + if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) && (func_80088E98(objectIndex, player, arg1) != 0)) { if (!(player->effects & 0x200)) { player->statusEffects |= REVERSE_EFFECT; if (is_obj_index_flag_unk_054_active(objectIndex, 0x04000000) != 0) { diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index 21fef37d61..271dda2edd 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -308,7 +308,7 @@ void func_8008C73C(Player *player, s8 arg1) { D_80165420[arg1] = 0; D_8018D920[arg1] = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); } else { func_800098FC(arg1, player); @@ -332,7 +332,7 @@ void func_8008C8C4(Player* player, s8 playerId) { player->unk_046 &= 0xFFBF; - if ((gIsPlayerTripleAButtonCombo[playerId] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[playerId] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed = (f32) (player->currentSpeed + 100.0f); } if ((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) == PLAYER_CPU) && (!gDemoMode) && ((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) { @@ -350,12 +350,12 @@ void func_8008C9EC(Player *player, s8 arg1) { if ((player->unk_046 & 0x40) == 0x40) { func_80031F48(player, 100.0f); } else { - if ((player->type & 0x4000) == 0x4000) { + if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_80031F48(player, 1.0f); } else { func_80031F48(player, 4.0f); } - if (!(player->type & 0x4000)) { + if (!(player->type & PLAYER_HUMAN)) { func_80031F48(player, 30.0f); } } @@ -386,7 +386,7 @@ void func_8008C9EC(Player *player, s8 arg1) { } } } - if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { D_80165480[arg1] = 0x00000078; if (player->currentSpeed <= 90.0f) { player->currentSpeed = 90.0f; @@ -403,7 +403,7 @@ void func_8008CDC0(Player* player, s8 arg1) { player->unk_0AC = 1; player->effects &= ~0x10; - if (((player->unk_07C >> 0x10) >= 0x14) || ((player->unk_07C >> 0x10) < -0x13) || (((player->unk_094 / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) || (((player->type & 0x4000) == 0) && ((player->effects & 0x1000) == 0))) { + if (((player->unk_07C >> 0x10) >= 0x14) || ((player->unk_07C >> 0x10) < -0x13) || (((player->unk_094 / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) || (((player->type & PLAYER_HUMAN) == 0) && ((player->effects & 0x1000) == 0))) { func_8008C73C(player, arg1); } else { @@ -437,7 +437,7 @@ void func_8008CEB0(Player *player, s8 arg1) { } else { player->unk_0B6 |= 0x20; player->effects &= ~0x40000; - if ((player->type & 0x4000) == 0x4000) + if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); var_v1 = 0; @@ -503,7 +503,7 @@ void func_8008D170(Player *player, s8 arg1) { } else { player->unk_0B6 |= 0x20; player->effects &= ~0x40000; - if ((player->type & 0x4000) == 0x4000) + if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); var_v1 = 0; @@ -537,12 +537,12 @@ void func_8008D3C4(Player* player, s8 arg1) { func_8008C354(player, arg1); player->effects |= 0x2000; - player->statusEffects &= ~0x200; + player->statusEffects &= ~BOOST_EFFECT; player->unk_DB4.unk0 = 0; player->unk_DB4.unk8 = 8.0f; if (D_8015F890 != 1) { - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C9250(arg1); func_800C9060(arg1, 0x1900A40B); } @@ -594,11 +594,11 @@ void func_8008D570(Player *player, s8 arg1) { player->unk_078 = 0; D_8018D920[arg1] = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C9060(arg1, 0x19008002); } - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x2900800C); } } @@ -651,7 +651,7 @@ void func_8008D7B0(Player* player, s8 arg1) { player->unk_07C = 0; player->unk_078 = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); } } @@ -730,7 +730,7 @@ void func_8008DABC(Player *player, s8 arg1) { player->unk_046 |= 0x80; } - if (((player->type & 0x4000) != 0) && ((player->effects & 0x04000000) == 0)) { + if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & 0x04000000) == 0)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); } @@ -761,7 +761,7 @@ void func_8008DC08(Player* player, s8 arg1) { if ((player->statusEffects & 0x100) == 0) { D_8018D990[arg1] = 1; player->unk_238 = 0; - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { func_800C9060(arg1, 0x1901904B); break; } @@ -771,7 +771,7 @@ void func_8008DC08(Player* player, s8 arg1) { if (player->unk_238 >= 0x1E) { D_8018D990[arg1] = 1; player->unk_238 = 0; - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { func_800C9060(arg1, 0x1901904B); break; } @@ -840,7 +840,7 @@ void func_8008DC08(Player* player, s8 arg1) { D_80165190[2][arg1] = 1; D_80165190[3][arg1] = 1; - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); } break; @@ -870,7 +870,7 @@ void func_8008DF98(Player* player, s8 arg1) { D_8018D920[arg1] = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); } else { func_800098FC(arg1, player); @@ -916,7 +916,7 @@ void func_8008E118(Player *player, s8 arg1) { } else { player->unk_0B0 += 1; player->unk_08C = (f32) ((f64) player->unk_08C * 0.6); - if ((player->unk_0B0 == 1) && (player->type & 0x4000)) { + if ((player->unk_0B0 == 1) && (player->type & PLAYER_HUMAN)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); } if ((player->unk_0B0 >= 0) && (player->unk_0B0 < 0x1CC)) { @@ -924,7 +924,7 @@ void func_8008E118(Player *player, s8 arg1) { move_f32_towards(&player->boundingBoxSize, (f32) ((f64) gKartBoundingBoxSizeTable[player->characterId] * 0.9), 0.1f); } else { func_8008E3C0(player, arg1); - if (player->type & 0x4000) { + if (player->type & PLAYER_HUMAN) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); } } @@ -977,7 +977,7 @@ void func_8008E4A4(Player* player, s8 arg1) { player->unk_042 = 0; player->type &= ~0x80; - if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } if (gModeSelection == BATTLE) { @@ -1000,7 +1000,7 @@ void func_8008E4A4(Player* player, s8 arg1) { if (gModeSelection == BATTLE) { func_8006B8B4(player, arg1); } - if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } @@ -1027,7 +1027,7 @@ void func_8008E6C0(Player *player, s8 arg1) player->unk_042 = 0; player->unk_0E0 = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) { func_800CA24C(arg1); } @@ -1088,7 +1088,7 @@ void func_8008E8D8(Player *player, s8 arg1) { D_80165190[2][arg1] = 1; player->unk_042 = 0; - if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } @@ -1108,7 +1108,7 @@ void func_8008E8D8(Player *player, s8 arg1) { D_80165190[2][arg1] = 1; D_80165190[3][arg1] = 1; player->unk_042 = 0; - if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & 0x4000) == 0x4000)) { + if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { player->currentSpeed += 100.0f; } @@ -1135,7 +1135,7 @@ void func_8008EAE0(Player* player, s8 arg1) { player->unk_042 = 0; player->unk_0E0 = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); func_800C9060(arg1, SOUND_ACTION_EXPLOSION); } else { @@ -1171,7 +1171,7 @@ void func_8008EC88(Player* player, s8 arg1) { player->unk_DB4.unk0 = 0; player->unk_DB4.unk8 = 8.0f; if (D_8015F890 != 1) { - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008001); func_800C9060(arg1, 0x1900A40B); } @@ -1218,7 +1218,7 @@ void func_8008EEE4(Player* player, s8 arg1) { player->statusEffects &= ~0x8000; if (D_8015F890 != 1) { - if (((player->type & 0x4000) == 0x4000) && ((player->type & 0x100) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008001); func_800C9060(arg1, 0x1900A40B); } @@ -1264,7 +1264,7 @@ void func_8008F104(Player* player, s8 arg1) { player->unk_078 = 0; D_8018D920[arg1] = -0x8000; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); } } @@ -1357,7 +1357,7 @@ void func_8008F494(Player* player, s8 arg1) { player->unk_236 = 0x1E; player->unk_042 = 0; - if (((player->type & 0x4000) != 0) && + if (((player->type & PLAYER_HUMAN) != 0) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) && ((player->unk_0CA & 2) == 0) && ((player->unk_0DE & 1) == 0) && @@ -1394,7 +1394,7 @@ void func_8008F650(Player* player, s8 arg1) { if (((s32) gCourseTimer - D_8018D930[arg1]) >= 9) { D_8018D900[arg1] = 1; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { if (D_8018D900[arg1] == 1) { func_800CA730(arg1); D_8018D900[arg1] = 0; @@ -1415,7 +1415,7 @@ void func_8008F778(Player* player, s8 arg1) { func_8008C354(player, arg1); player->effects |= 0x200; - player->statusEffects &= ~0x2000; + player->statusEffects &= ~STAR_EFFECT; D_8018D930[arg1] = gCourseTimer; D_8018D900[arg1] = 1; @@ -1433,7 +1433,7 @@ void func_8008F778(Player* player, s8 arg1) { void func_8008F86C(Player* player, s8 arg1) { player->effects &= ~0x200; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800CA730(arg1); return; } @@ -1479,7 +1479,7 @@ void func_8008F8DC(Player* arg0, s8 arg1) { void func_8008FA38(Player* player, s8 arg1) { s16 temp_v1; - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { player->unk_044 |= 0x200; for (temp_v1 = 0; temp_v1 < 10; ++temp_v1) { @@ -1492,11 +1492,11 @@ void func_8008FA38(Player* player, s8 arg1) { func_8008C354(player, arg1); player->effects |= 0x80000000; - player->statusEffects &= ~0x800; + player->statusEffects &= ~BOO_EFFECT; D_8018D950[arg1] = gCourseTimer; D_8018D970[arg1] = 0xFF; - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { func_800CAFC0(arg1); } } @@ -1527,7 +1527,7 @@ void func_8008FB30(Player* arg0, s8 arg1) { void func_8008FC1C(Player* player) { s32 playerIndex; - if ((player->type & 0x40) != 0) { + if ((player->type & PLAYER_UNKNOWN_0x40) != 0) { playerIndex = get_player_index_for_player(player); player->type = 0x7000; func_80056A94(playerIndex); @@ -1540,7 +1540,7 @@ void func_8008FC64(Player* player, s8 arg1) { player->unk_0C6 = 0; player->statusEffects &= 0xFBFFFFFF; player->statusEffects |= 0x08000000; - player->type |= 0x40; + player->type |= PLAYER_UNKNOWN_0x40; func_8008FDA8(player, arg1); func_800569F4(arg1); @@ -1866,7 +1866,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { } break; case 1: - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { + if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { func_8009E088(arg1, 0xA); } if ((player->unk_0CA & 1) == 1) { @@ -1898,7 +1898,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { break; case 3: D_80165330[arg1] = 0; - if (((player->type & 0x4000) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) { func_8009E020(arg1, 0x14); } func_80090178(player, arg1, sp44, sp38); @@ -1931,7 +1931,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { if (((player->effects & 8) != 8) || (player->effects & 0x8000)) { player->unk_0CA &= ~0x1000; if (player->unk_0C8 >= 0x5B) { - if (player->type & 0x4000) { + if (player->type & PLAYER_HUMAN) { func_800C9018(arg1, 0x0100FA28); } if (gModeSelection == BATTLE) { @@ -1971,7 +1971,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { s32 func_800910E4(Player *player) { s32 phi_v0 = 0; - if ((((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->type & 0x40) != 0)) || ((player->type & PLAYER_CINEMATIC_MODE) != 0)) || ((player->type & PLAYER_EXISTS) == 0)) { + if ((((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->type & PLAYER_UNKNOWN_0x40) != 0)) || ((player->type & PLAYER_CINEMATIC_MODE) != 0)) || ((player->type & PLAYER_EXISTS) == 0)) { return 1; } diff --git a/src/code_80091750.c b/src/code_80091750.c index 480eb0288a..deec8260be 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -6589,7 +6589,7 @@ void func_8009CE64(s32 arg0) { switch (gNextDemoId) { /* switch 4 */ case 0: /* switch 4 */ gCurrentCourseId = 0; - gScreenModeSelection = 0; + gScreenModeSelection = SCREEN_MODE_1P; gPlayerCountSelection1 = (s32) 1; gPlayerCount = 1; gCharacterSelections->unk0 = 0; @@ -6597,7 +6597,7 @@ void func_8009CE64(s32 arg0) { break; case 1: /* switch 4 */ gCurrentCourseId = (s16) 1; - gScreenModeSelection = (s32) 1; + gScreenModeSelection = SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL; gPlayerCountSelection1 = 2; gPlayerCount = (s8) 2; gCharacterSelections->unk0 = (s8) 2; @@ -6606,7 +6606,7 @@ void func_8009CE64(s32 arg0) { break; case 2: /* switch 4 */ gCurrentCourseId = 0x000B; - gScreenModeSelection = 0; + gScreenModeSelection = SCREEN_MODE_1P; gPlayerCountSelection1 = (s32) 1; gPlayerCount = 1; gCharacterSelections->unk0 = 1; @@ -6614,7 +6614,7 @@ void func_8009CE64(s32 arg0) { break; case 3: /* switch 4 */ gCurrentCourseId = 0x000E; - gScreenModeSelection = 3; + gScreenModeSelection = SCREEN_MODE_3P_4P_SPLITSCREEN; gPlayerCountSelection1 = 3; gPlayerCount = (s8) 3; gCharacterSelections->unk0 = 5; @@ -6624,7 +6624,7 @@ void func_8009CE64(s32 arg0) { break; case 4: /* switch 4 */ gCurrentCourseId = 2; - gScreenModeSelection = 0; + gScreenModeSelection = SCREEN_MODE_1P; gPlayerCountSelection1 = (s32) 1; gPlayerCount = 1; gCharacterSelections->unk0 = 7; @@ -6632,7 +6632,7 @@ void func_8009CE64(s32 arg0) { break; case 5: /* switch 4 */ gCurrentCourseId = 0x000C; - gScreenModeSelection = 3; + gScreenModeSelection = SCREEN_MODE_3P_4P_SPLITSCREEN; gPlayerCountSelection1 = 4; gPlayerCount = (s8) 4; gCharacterSelections->unk0 = 0; @@ -6700,7 +6700,7 @@ void func_8009CE64(s32 arg0) { break; } func_8000F124(); - if ((gScreenModeSelection == 3) && ((gModeSelection == 0) || (gModeSelection == 1))) { + if ((gScreenModeSelection == SCREEN_MODE_3P_4P_SPLITSCREEN) && ((gModeSelection == 0) || (gModeSelection == 1))) { gModeSelection = 2; } if ((gCurrentCourseId != 0x000F) && (gCurrentCourseId != 0x0010) && (gCurrentCourseId != 0x0011) && (gCurrentCourseId != 0x0013)) { @@ -6716,7 +6716,7 @@ void func_8009CE64(s32 arg0) { gModeSelection = 3; if (gPlayerCountSelection1 == 1) { gPlayerCount = (s8) 2; - gScreenModeSelection = 1; + gScreenModeSelection = SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL; gPlayerCountSelection1 = (s32) gPlayerCount; } } @@ -10699,16 +10699,16 @@ void func_800A7A4C(s32 arg0) { case 0x10: /* switch 8 */ case 0x11: /* switch 8 */ switch (gMainMenuSelectionDepth) { /* switch 5 */ - case 1: /* switch 5 */ - case 2: /* switch 5 */ - case 3: /* switch 5 */ + case OPTIONS_SELECTION: /* switch 5 */ + case DATA_SELECTION: /* switch 5 */ + case PLAYER_NUM_SELECTION: /* switch 5 */ func_800A9B9C(var_s1); break; - case 4: /* switch 5 */ - case 5: /* switch 5 */ - case 6: /* switch 5 */ - case 7: /* switch 5 */ - case 8: /* switch 5 */ + case GAME_MODE_SELECTION: /* switch 5 */ + case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 5 */ + case CONFIRM_OK_SELECTION: /* switch 5 */ + case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 5 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */ func_800A9C40(var_s1); break; } @@ -10722,16 +10722,16 @@ void func_800A7A4C(s32 arg0) { case 0xD: /* switch 8 */ case 0xE: /* switch 8 */ switch (gMainMenuSelectionDepth) { /* switch 6 */ - case 1: /* switch 6 */ - case 2: /* switch 6 */ - case 3: /* switch 6 */ + case OPTIONS_SELECTION: /* switch 6 */ + case DATA_SELECTION: /* switch 6 */ + case PLAYER_NUM_SELECTION: /* switch 6 */ func_800A9B9C(var_s1); break; - case 4: /* switch 6 */ - case 5: /* switch 6 */ - case 6: /* switch 6 */ - case 7: /* switch 6 */ - case 8: /* switch 6 */ + case GAME_MODE_SELECTION: /* switch 6 */ + case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 6 */ + case CONFIRM_OK_SELECTION: /* switch 6 */ + case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 6 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */ func_800A9C40(var_s1); break; } @@ -11053,7 +11053,7 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry *arg1) { gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA); if ((arg0 + 1) == gPlayerCount) { - if ((gMainMenuSelectionDepth == 1) || (gMainMenuSelectionDepth == 2) || (gMainMenuSelectionDepth == 3)) { + if ((gMainMenuSelectionDepth == OPTIONS_SELECTION) || (gMainMenuSelectionDepth == DATA_SELECTION) || (gMainMenuSelectionDepth == PLAYER_NUM_SELECTION)) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35); } else { gDisplayListHead = draw_box_fill(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x35, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); @@ -11063,7 +11063,7 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry *arg1) { } for (var_s0 += 0x41, var_s2 = 0; var_s2 <= D_800F2B60[0][arg0]; var_s2++, var_s0 += 0x12) { if ((var_s2 == D_800E86AC[arg0]) && ((arg0 + 1) == gPlayerCount) && (gMainMenuSelectionDepth >= 4)) { - if (gMainMenuSelectionDepth == 4) { + if (gMainMenuSelectionDepth == GAME_MODE_SELECTION) { gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x11); } else { gDisplayListHead = draw_box_fill(gDisplayListHead, var_s3, var_s0, var_s4, var_s0 + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); @@ -11090,7 +11090,7 @@ void func_800A8564(struct_8018D9E0_entry *arg0) { switch (arg0->type) { /* irregular */ case 0xF: var_a0 = D_0200487C; - if ((gMainMenuSelectionDepth == 6) || (gMainMenuSelectionDepth == 7)) { + if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION) || (gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT)) { var_a1 = 1; } break; @@ -11735,7 +11735,7 @@ void func_800A9C40(struct_8018D9E0_entry *arg0) { arg0->unk4 = 1; case 1: func_800AA280(arg0); - if ((gMainMenuSelectionDepth == 7) || (gMainMenuSelectionDepth == 8)) { + if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { arg0->unk1C = 0x00000020; } else { if (arg0->unk1C < 0x20) { @@ -11768,7 +11768,7 @@ void func_800A9D5C(struct_8018D9E0_entry *arg0) { switch (arg0->unk4) { case 2: - if ((gMainMenuSelectionDepth == 7) || (gMainMenuSelectionDepth == 8)) { + if ((gMainMenuSelectionDepth == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (gMainMenuSelectionDepth == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { arg0->column = 0x00000080; arg0->row = 0x0000003E; } else { diff --git a/src/hud_renderer.c b/src/hud_renderer.c index 632f1e57f1..5d488b0b71 100644 --- a/src/hud_renderer.c +++ b/src/hud_renderer.c @@ -3441,7 +3441,7 @@ void func_80050E34(s32 playerId, s32 arg1) { func_80042330(spD0 + 0x1B, (spC4 + spCC) + 4, 0U, 1.0f); } gSPDisplayList(gDisplayListHead++, D_0D006950); - if ((player == gPlayerOne) && (gScreenModeSelection == 0)) { + if ((player == gPlayerOne) && (gScreenModeSelection == SCREEN_MODE_1P)) { gSPDisplayList(gDisplayListHead++, D_0D007A40); func_8004B35C(D_8018D3E4, D_8018D3E8, D_8018D3EC, 0x000000FF); func_80044924(gTextureCharacterPortraitBorder, 0x00000020, 0x00000020); @@ -4344,7 +4344,7 @@ void func_800532A4(s32 cameraId) { } else { func_800485C4(object->pos, object->unk_0B2, object->sizeScaling, (s32) object->unk_0A0, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, (s32) object->textureWidth, (s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2); } - if (gScreenModeSelection == 0) { + if (gScreenModeSelection == SCREEN_MODE_1P) { var_f0 = object->pos[0] - D_8018CF14->pos[0]; var_f2 = object->pos[2] - D_8018CF14->pos[2]; if (var_f0 < 0.0f) { diff --git a/src/menus.c b/src/menus.c index 1175551907..a3a33f1efd 100644 --- a/src/menus.c +++ b/src/menus.c @@ -849,7 +849,7 @@ void logo_intro_menu_act(struct Controller *arg0, UNUSED u16 arg1) { gCupSelection = 1; gCupCourseSelection = 0; gCurrentCourseId = 0; - gScreenModeSelection = 0; + gScreenModeSelection = SCREEN_MODE_1P; gCharacterSelections[0] = 0; gModeSelection = 0; gPlayerCount = 1; diff --git a/src/racing/actors.c b/src/racing/actors.c index ee5482e56e..c3f0946b5f 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -2665,7 +2665,7 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) { s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) { if (func_8029EEB8(player, marioRacewaySign->pos, 7.0f, 200.0f, 0.8f) == 1) { - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { if ((player->effects & 0x200) != 0) { marioRacewaySign->flags |= 0x400; func_800C98B8(player->pos, player->velocity, 0x19018010U); @@ -2681,7 +2681,7 @@ s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) { s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) { if (func_8029EEB8(player, plant->pos, plant->boundingBoxSize, plant->boundingBoxSize, 2.5f) == 1) { - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { if ((player->effects & 0x200) != 0) { plant->flags |= 0x400; func_800C98B8(player->pos, player->velocity, 0x1901A24AU); @@ -2732,7 +2732,7 @@ s32 func_8029F408(Player *player, struct YoshiValleyEgg *egg) { if (totalBox < xz_dist) { return 0; } - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { if ((player->effects & 0x200) != 0) { egg->flags |= 0x400; egg->pathCenter[1] = 8.0f; @@ -2797,7 +2797,7 @@ s32 func_8029F69C(Player *player, struct Actor *actor) { } sp48 = player->velocity[0]; sp44 = player->velocity[2]; - if (player->type & 0x4000) { + if (player->type & PLAYER_HUMAN) { if (player->effects & 0x200) { actor->flags |= 0x400; func_800C98B8(player->pos, player->velocity, 0x19018010U); @@ -3294,7 +3294,7 @@ void func_802A0450(Player *player, struct Actor *actor) { actor->state = 3; actor->flags = -0x8000; actor->unk_04 = 0; - if (player->type & 0x4000) { + if (player->type & PLAYER_HUMAN) { func_8007ABFC(player - gPlayerOne, 7); } } else if (actor->state == 0) { @@ -3307,7 +3307,7 @@ void func_802A0450(Player *player, struct Actor *actor) { actor->state = 3; actor->flags = -0x8000; actor->unk_04 = 0; - if (player->type & 0x4000) { + if (player->type & PLAYER_HUMAN) { func_8007ABFC(player - gPlayerOne, 0); } } else if (actor->state == 0) { diff --git a/src/racing/actors_extended.c b/src/racing/actors_extended.c index c32cc30acb..a6298b5e61 100644 --- a/src/racing/actors_extended.c +++ b/src/racing/actors_extended.c @@ -292,7 +292,7 @@ void update_actor_banana_bunch(struct BananaBunchParent *banana_bunch) { } if (someCount == 0) { destroy_actor((struct Actor *) banana_bunch); - owner->statusEffects &= ~0x40000; + owner->statusEffects &= ~HOLD_BANANA_EFFECT; } else if ((owner->type & 0x4000) != 0) { controller = &gControllers[banana_bunch->playerId]; if ((controller->buttonPressed & Z_TRIG) != 0) { @@ -716,7 +716,7 @@ void update_actor_banana(struct BananaActor *banana) { } func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]); func_802B4E30((struct Actor *) banana); - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { if (gDemoMode) { controller = gControllerOne; } else { @@ -726,7 +726,7 @@ void update_actor_banana(struct BananaActor *banana) { controller->buttonDepressed &= ~Z_TRIG; banana->state = 1; banana->unk_04 = 0x00B4; - player->statusEffects &= ~0x40000; + player->statusEffects &= ~HOLD_BANANA_EFFECT; func_800C9060(player - gPlayerOne, 0x19008012U); pad3 = controller->rawStickY; if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) { @@ -925,7 +925,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b tempBanana->youngerIndex = actorIndex; break; } - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { func_800C9060(player - gPlayerOne, 0x19008012); } } @@ -1030,7 +1030,7 @@ void use_thunder_item(Player *player) { Player *otherPlayer; func_8009E5BC(); - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { // Play sound. func_800CAB4C(player - gPlayerOne); } @@ -1119,7 +1119,7 @@ void func_802B30EC(void) { } } - if (((player->type & 0x4000) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { + if (((player->type & PLAYER_HUMAN) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { if ((controller->buttonPressed & Z_TRIG) != 0) { controller->buttonPressed &= ~Z_TRIG; func_802B2FA0(player); @@ -1173,7 +1173,7 @@ void update_actor_green_shell(struct ShellActor *shell) { } else { shell->pos[1] = pad2; } - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { controller = &gControllers[shell->playerId]; if ((controller->buttonDepressed & Z_TRIG) != 0) { controller->buttonDepressed &= ~Z_TRIG; @@ -1554,7 +1554,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) { shell->pos[1] = pad7; } - if ((player->type & 0x4000) != 0) { + if ((player->type & PLAYER_HUMAN) != 0) { if (gDemoMode) { controller = gControllerOne; } else {