#include #include #include #include #include #include #include "code_800029B0.h" #include "code_80005FD0.h" #include "code_80057C60.h" #include "code_8006E9C0.h" #include "code_80086E70.h" #include "update_objects.h" #include "objects.h" #include "bomb_kart.h" #include "save.h" #include #include #include #include "audio/external.h" #include "courses/all_course_data.h" #include "main.h" #include "menus.h" #include #include "render_objects.h" #include "menu_items.h" #include "src/data/some_data.h" #include "effects.h" #include #include "port/Game.h" #include "port/Engine.h" #include "engine/editor/Editor.h" #include "engine/tracks/Track.h" #include "engine/sky/Sky.h" void init_hud(void) { reset_object_variable(); func_8006FA94(); switch (gScreenModeSelection) { case SCREEN_MODE_1P: init_hud_one_player(); break; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: init_hud_two_player_vertical(); break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: init_hud_two_player_horizontal(); break; case SCREEN_MODE_3P_4P_SPLITSCREEN: init_hud_three_four_player(); break; } func_80070148(); } void reset_object_variable(void) { s32 i; s32 j; func_8006EB10(); clear_object_list(); memset(playerHUD, 0, HUD_PLAYERS_SIZE * sizeof(hud_player)); for (i = 0; i < HUD_PLAYERS_SIZE; i++) { playerHUD[i].lapCount = 0; playerHUD[i].alsoLapCount = 0; playerHUD[i].unk_81 = 0; } for (j = 0; j < HUD_PLAYERS_SIZE; j++) { playerHUD[j].raceCompleteBool = 0; } } void func_8006EB10(void) { s32 i; for (i = 0; i < gObjectParticle1_SIZE; i++) { gObjectParticle1[i] = NULL_OBJECT_ID; } for (i = 0; i < gObjectParticle2_SIZE; i++) { gObjectParticle2[i] = NULL_OBJECT_ID; } for (i = 0; i < gObjectParticle3_SIZE; i++) { gObjectParticle3[i] = NULL_OBJECT_ID; } for (i = 0; i < gObjectParticle4_SIZE; i++) { gObjectParticle4[i] = NULL_OBJECT_ID; } // clang-format off // Has to be on one line, because IDO hates you :) for (i = 0; i < gLeafParticle_SIZE; i++) { gLeafParticle[i] = NULL_OBJECT_ID; } // clang-format on D_8018CF18 = D_8018CF20 = D_8018CF48 = D_8018CF60 = D_8018CF78 = D_8018CF90 = D_8018CFA8 = 0; D_8018CFB0 = D_8018CFB8 = D_8018CFC0 = D_8018CFC8 = D_8018CFD0 = D_8018CFD8 = D_8018CFE0 = 0; D_8018D018 = 0; D_8018D010 = 0; D_8018D008 = 0; D_8018D000 = 0; D_8018CFF8 = 0; D_8018CFF0 = 0; D_8018CFE8 = 0; D_8018D110 = 0; D_8018D0E8 = 0; D_8018D0C0 = 0; D_8018D020 = D_8018D048 = D_8018D070 = D_8018D098 = 0; gNextFreeObjectParticle1 = gNextFreeObjectParticle2 = gNextFreeObjectParticle3 = gNextFreeObjectParticle4 = gNextFreeLeafParticle = 0; } void clear_object_list() { memset(gObjectList, 0, OBJECT_LIST_SIZE * sizeof(Object)); objectListSize = -1; } /** * Dma's mario kart 64 logo and track outline textures. */ u8* dma_misc_textures(u8* devAddr, u8* baseAddress, u32 size, u32 offset) { #ifdef TARGET_N64 u8** tempAddress; u8* address; address = baseAddress + offset; size = ALIGN16(size); osInvalDCache(address, (size)); osPiStartDma(&gDmaIoMesg, 0, 0, (uintptr_t) &_other_texturesSegmentRomStart[((u32) devAddr) & 0xFFFFFF], address, size, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1); tempAddress = &address; mio0decode(*tempAddress, (u8*) baseAddress); #else baseAddress = devAddr; // memcpy doesn't seem to be applicable here. // memcpy(baseAddress, devAddr, size); // baseAddress = devAddr; #endif return baseAddress; } // Stubbed because load texture directly. void load_mario_kart_64_logo(void) { } // Some kind of initalization for the Item Window part of the HUD void init_item_window(s32 objectIndex) { ItemWindowObjects* temp_v0; temp_v0 = (ItemWindowObjects*) &gObjectList[objectIndex]; temp_v0->currentItem = ITEM_NONE; temp_v0->textureListIndex = temp_v0->currentItem; temp_v0->tlutList = (u8*) common_tlut_item_window_none; temp_v0->activeTLUT = (u8*) common_tlut_item_window_none; temp_v0->textureList = common_texture_item_window_none; temp_v0->activeTexture = common_texture_item_window_none; temp_v0->unk_04C = -1; temp_v0->unk_09C = 0x00A0; // Screen X position temp_v0->unk_09E = -0x0020; // Screen Y position temp_v0->sizeScaling = 1.0f; } void get_minimap_properties() { D_8018D240 = (uintptr_t) CM_GetProps()->Minimap.Texture; // This is incredibly dumb. MinimapDimensions ought to be something more like // `u16 MinimapDimensions[][2]` but that doesn't match for some insane reason gMinimapWidth = CM_GetProps()->Minimap.Width; // MinimapDimensions[trackId * 2]; gMinimapHeight = CM_GetProps()->Minimap.Height; // MinimapDimensions[trackId * 2 + 1]; } void func_8006EF60(void) { s32 i; // `huh`'s and `i`'s types have to differ, for some reason s16 huh; u8* wut = 0; // Commented the below code out because it is sketchy. // Just-in-case it results in ub or similar. // clang-format off // God forgive me for my sins... // huh = 0x14; if (0) {} for (i = 0; i < huh; i++) {D_8018D248[i] = CM_GetProps()->MinimapTexture; wut += ResourceGetTexSizeByName(CM_GetProps()->MinimapTexture); } // clang-format on } void func_8006F008(void) { xOrientation = 1.0f; if (gIsMirrorMode != 0) { xOrientation = -1.0f; } if (!IsPodiumCeremony()) { get_minimap_properties(); } // Flip the minimap player markers if (gIsMirrorMode != 0) { CM_GetProps()->Minimap.PlayerX = CM_GetProps()->Minimap.Width - CM_GetProps()->Minimap.PlayerX; // gMinimapPlayerX = gMinimapWidth - gMinimapPlayerX } switch (gPlayerCount) { case 2: // Set X coord if (!IsToadsTurnpike()) { CM_GetProps()->Minimap.Pos[PLAYER_ONE].X = 265; CM_GetProps()->Minimap.Pos[PLAYER_TWO].X = 265; } else { CM_GetProps()->Minimap.Pos[PLAYER_ONE].X = 255; CM_GetProps()->Minimap.Pos[PLAYER_TWO].X = 255; } // Set Y coord CM_GetProps()->Minimap.Pos[PLAYER_ONE].Y = 65; CM_GetProps()->Minimap.Pos[PLAYER_TWO].Y = 180; break; case 3: CM_GetProps()->Minimap.Pos[PLAYER_ONE].X = 235; CM_GetProps()->Minimap.Pos[PLAYER_ONE].Y = 175; break; case 4: CM_GetProps()->Minimap.Pos[PLAYER_ONE].X = 160; CM_GetProps()->Minimap.Pos[PLAYER_ONE].Y = 120; break; } } void func_8006F824(s32 arg0) { D_80165808 = gHUDModes; D_80165810 = D_801657E6; D_80165820 = D_801657F0; D_80165818 = D_801657E8; D_80165828 = D_801657F8; D_80165832[0] = D_80165800[0]; D_80165832[1] = D_80165800[1]; if ((arg0 != 0) && (gIsGamePaused == 0) && (Editor_IsPaused() == false)) { play_sound2(SOUND_ACTION_PING); } } void func_8006F8CC(void) { if (gTrackMapInit == 0) { gTrackMapInit = 1; gHUDModes = 0; D_801657E6 = 0; D_801657F0 = 0; D_801657E8 = 1; D_80165800[0] = D_80165800[1] = 1; if (gPlayerCount == 4) { if (gModeSelection != 3) { gHUDModes = 1; D_801657F0 = 1; D_801657F8 = 1; D_80165800[0] = D_80165800[1] = 0; } else { D_801657F8 = 0; D_80165800[0] = D_80165800[1] = 1; } } else if (gPlayerCount == 3) { D_801657E8 = 0; D_801657F8 = 1; } else if (gPlayerCount == 2) { if (gModeSelection != (s32) 3) { gHUDModes = 1; D_801657F0 = 1; D_80165800[0] = D_80165800[1] = 0; } CM_GetProps()->Minimap.Pos[0].Y = 65; CM_GetProps()->Minimap.Pos[1].Y = 180; } func_8006F824(0); } else { gHUDModes = D_80165808; D_801657E6 = D_80165810; D_801657F0 = D_80165820; D_801657E8 = D_80165818; D_801657F8 = D_80165828; D_80165800[0] = D_80165832[0]; D_80165800[1] = D_80165832[1]; } if (gDemoMode != 0) { D_801657F0 = 0; } } #ifdef NON_MATCHING // Major register allocation problems in the first for-loop // Smaller issues elsewhere, probably some one line, multiple variable assignment shenanigans going on // https://decomp.me/scratch/ohbAc void func_8006FA94(void) { s32 var_a0; Player* player; func_8006F8CC(); func_8006F008(); osSetTime(0); D_8018D170 = 0; D_8018D190 = 0; gIsHUDVisible = 0; D_8018D178 = 0; D_8018D1CC = 0; D_801657E2 = 0; D_80165730 = 0; D_801658FE = 0; /* D_801657E5 = 0; D_801657E3 = D_801657E5; D_801657E1 = D_801657E3; */ D_801657E1 = D_801657E3 = D_801657E5 = 0; /* D_80165658->unk8 = 0; D_80165658->unk4 = 0; D_80165658->unk0 = 0; */ D_80165658[0] = D_80165658[1] = D_80165658[2] = 0; /* D_801658D6 = 0; D_801658E4 = D_801658D6; D_801658F4 = D_801658E4; D_801658EC = D_801658F4; D_801658DC = D_801658EC; D_801658CE = D_801658DC; D_801658C6 = D_801658CE; D_801658BC = D_801658C6; */ D_801658BC = D_801658C6 = D_801658CE = D_801658DC = D_801658EC = D_801658F4 = D_801658E4 = D_801658D6 = 0; switch (gPlayerCount) { /* irregular */ case 1: if (gModeSelection == 0) { D_8018D114 = 0; D_8018D178 = 150; D_8018D180 = 240; } else { D_8018D114 = 1; D_8018D178 = 10; D_8018D180 = 0; } break; case 2: if (gScreenModeSelection == 1) { if (gModeSelection == 0) { D_8018D114 = 2; D_8018D178 = 150; D_8018D180 = 240; D_8018D2AC = 60; } else if (gModeSelection == 2) { D_8018D114 = 3; D_8018D178 = 30; D_8018D180 = 30; D_8018D2AC = 60; } else { D_8018D114 = 4; D_8018D178 = 40; D_8018D180 = 40; D_8018D2AC = 60; } } else if (gModeSelection == 0) { D_8018D114 = 5; } else if (gModeSelection == 2) { D_8018D114 = 6; } else { D_8018D114 = 7; } break; case 3: if (gModeSelection == 2) { D_8018D114 = 8; D_8018D178 = 100; D_8018D180 = 150; D_8018D2AC = 60; } else { D_8018D114 = 9; D_8018D178 = 100; D_8018D180 = 150; D_8018D2AC = 60; } break; case 4: if (gModeSelection == 2) { D_8018D114 = 10; D_8018D178 = 30; D_8018D180 = 30; D_8018D2AC = 10; } else { D_8018D114 = 11; D_8018D178 = 30; D_8018D180 = 30; D_8018D2AC = 10; } break; } if (gEnableDebugMode == 0) { D_8016576A = 0; D_8016579C = 0; } for (var_a0 = 0; var_a0 < gPlayerCount; var_a0++) { D_8018CFBC[var_a0] = 0; D_8018CFAC[var_a0] = 0; D_8018CFC4[var_a0] = 0; D_8018CFB4[var_a0] = 0; } D_8018D204 = 1; D_8018D1FC = 0; D_8018D224 = 0; D_8018D1F0 = D_8018D1F8 = 0; D_8018D228 = 0xFF; /* D_80165628 = 0; D_80165618 = 0; D_80165608 = D_80165618; D_801655F8 = D_80165618; D_801655E8 = D_80165618; D_801655D8 = D_80165618; */ D_801655D8 = D_801655E8 = D_801655F8 = D_80165608 = D_80165618 = D_80165628 = 0; D_8018D160 = 0; D_8018D1DC = 0; D_8018D1C4 = 0; D_8018D1B4 = 0; D_8018D1A0 = 0; D_8018D168 = 0; D_801656F0 = 0; D_801657B2 = 0; D_801657D8 = D_801657B2; D_8018D214 = D_801657D8; gHUDDisable = D_8018D214; D_801657AE = gHUDDisable; D_8018D20C = 0; D_8018D320 = 3; D_8018D2AC = 0; D_8018D2BC = 0; D_8018D2B4 = D_8018D2BC; D_8018D2A4 = D_8018D2B4; D_8018D2C8[0] = 0; D_8018D2C8[1] = 0; D_8018D2C8[2] = 0; D_8018D2C8[3] = 0; D_8016581C = 0; D_8016580C = 0; D_80165814 = 0; D_80165804 = 0; D_801657FC = 0; D_8018D18C = -1; D_8018D184 = D_8018D18C; D_8018D16C = D_8018D18C; D_8018D17C = D_8018D18C; D_8018D174 = D_8018D18C; player = gPlayerOne; for (var_a0 = 0; var_a0 < NUM_PLAYERS; var_a0++) { D_8018D0F0[var_a0] = D_8018D050[var_a0] = -32.0f; D_8018CE10[var_a0].unk_04[0] = D_8018CE10[var_a0].unk_04[1] = D_8018CE10[var_a0].unk_04[2] = 0.0f; D_8018CF50[var_a0] = var_a0; D_8018CF28[var_a0] = player; player->unk_040 = -1; player++; } } #else GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006FA94.s") #endif void func_80070148(void) { s32 var_s0; for (var_s0 = 0; var_s0 < 8; var_s0++) { find_unused_obj_index(&D_8018CE10[var_s0].objectIndex); } } void init_object_list_index(void) { s32 loopIndex; for (loopIndex = 0; loopIndex < SOME_OBJECT_INDEX_LIST_SIZE; loopIndex++) { find_unused_obj_index(&indexObjectList1[loopIndex]); find_unused_obj_index(&indexObjectList2[loopIndex]); find_unused_obj_index(&indexObjectList3[loopIndex]); find_unused_obj_index(&indexObjectList4[loopIndex]); } // for (loopIndex = 0; loopIndex < NUM_BOMB_KARTS_VERSUS; loopIndex++) { // find_unused_obj_index(&gIndexObjectBombKart[loopIndex]); // } } Vtx cloudvtx[4][4] = { { { { { -32, -16, 0 }, 0, { 0, 0 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 0 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 496 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 496 }, { 255, 255, 255, 255 } } }, }, { { { { -32, -16, 0 }, 0, { 0, 512 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 512 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 1008 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 1008 }, { 255, 255, 255, 255 } } }, }, { { { { -32, -16, 0 }, 0, { 0, 1024 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 1024 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 1520 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 1520 }, { 255, 255, 255, 255 } } }, }, { { { { -32, -16, 0 }, 0, { 0, 1536 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 1536 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 2032 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 2032 }, { 255, 255, 255, 255 } } }, } }; Vtx cloudvtx2[3][4] = { { { { { -32, -16, 0 }, 0, { 0, -32 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, -32 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 662 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 662 }, { 255, 255, 255, 255 } } }, }, { { { { -32, -16, 0 }, 0, { 0, 682 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 682 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 1324 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 1324 }, { 255, 255, 255, 255 } } }, }, { { { { -32, -16, 0 }, 0, { 0, 1335 }, { 255, 255, 255, 255 } } }, { { { 31, -16, 0 }, 0, { 4032, 1335 }, { 255, 255, 255, 255 } } }, { { { 31, 15, 0 }, 0, { 4032, 2027 }, { 255, 255, 255, 255 } } }, { { { -32, 15, 0 }, 0, { 0, 2027 }, { 255, 255, 255, 255 } } }, } }; void init_cloud_object(s32 objectIndex, s32 arg1, CloudData* arg2) { ItemWindowObjects* temp_v0; init_object(objectIndex, arg1); temp_v0 = (ItemWindowObjects*) &gObjectList[objectIndex]; temp_v0->unk_0D5 = arg2->subType; temp_v0->currentItem = ITEM_NONE; temp_v0->direction_angle[1] = arg2->rotY; temp_v0->unk_09E = arg2->posY; temp_v0->sizeScaling = (f32) arg2->scalePercent / 100.0; if (GameEngine_ResourceGetTexTypeByName(CM_GetProps()->CloudTexture) != 1) { temp_v0->activeTexture = ((u8*) LOAD_ASSET_RAW(CM_GetProps()->CloudTexture)) + (arg2->subType * 1024); func_80073404(objectIndex, 0x40U, 0x20U, D_0D005FB0); } else { temp_v0->activeTexture = CM_GetProps()->CloudTexture; if (strcmp(CM_GetProps()->CloudTexture, gTextureExhaust0) == 0 || strcmp(CM_GetProps()->CloudTexture, gTextureExhaust1) == 0 || strcmp(CM_GetProps()->CloudTexture, gTextureExhaust2) == 0) { func_80073404(objectIndex, 0x40U, 0x20U, cloudvtx2[arg2->subType]); } else { func_80073404(objectIndex, 0x40U, 0x20U, cloudvtx[arg2->subType]); } } temp_v0->primAlpha = 0x00FF; } void init_clouds(CloudData* cloudList) { s32 var_s0 = 0; CloudData* test = &cloudList[0]; do { if (1) {} init_cloud_object(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test); var_s0++; test++; } while (test->rotY != 0xFFFF); D_8018D1F8 += var_s0; D_8018D1F0 = var_s0; D_8018D230 = 0; } /** * This function is part of the spawning for the "stars" in some stages * * arg2 is a pointer to some type of spawn data for the stars, although it not super clear * what types each element is. It seems like its a bunch of u16's, so maybe a Vec4su? * * The stars in Wario's Stadium, Toad's Turnpike, and Rainbow Road are not part of the skybox. * They are instead objects that seemingly hover in the air around the player * They have no true x/y/z position, instead they seem to be kept in a position relative to the * player they hang around. There is however an y rotation and y position for where they should be on screen * when they are visbile (unk_09E[0] and [1]). * sizeScaling is some sort of size scaling on the start texture. * unk_0A2 is an alpha value, used to make the star twinkle. **/ void init_star_object(s32 objectIndex, s32 arg1, StarData* arg2) { ItemWindowObjects* temp_v0; init_object(objectIndex, arg1); temp_v0 = (ItemWindowObjects*) &gObjectList[objectIndex]; temp_v0->unk_0D5 = arg2->subType; temp_v0->currentItem = ITEM_BANANA; temp_v0->direction_angle[1] = arg2->rotY; temp_v0->unk_09E = arg2->posY; // screen Y position temp_v0->sizeScaling = (f32) arg2->scalePercent / 100.0; // some type of scaling on the texture temp_v0->activeTexture = D_0D0293D8; func_80073404(objectIndex, 0x10U, 0x10U, common_vtx_rectangle); } void init_stars(StarData* starList) { s32 var_s0 = 0; StarData* test = &starList[0]; do { if (1) {} init_star_object(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test); var_s0++; test++; } while (test->rotY != 0xFFFF); D_8018D1F8 += var_s0; D_8018D1F0 = var_s0; D_8018D230 = 1; } void func_8007055C(ScreenContext* screen) { s32 var_s0; s32 var_s4; InitSkyActors(screen); func_8008C23C(); } // GrandPrixBalloons related. Spawn location and some sort of bool check void func_80070714(void) { D_80165730 = 1; // if (gPlayerCount == ONE_PLAYERS_SELECTED) { // D_80165738 = 0x64; // D_80165740 = 0x3C; // D_80165748 = 0x1E; // } else { // D_80165738 = 0x32; // D_80165740 = 0x1E; // D_80165748 = 0xA; // } } void init_course_object(void) { s32 objectId; s32 i; CM_InitTrackObjects(); } void init_hud_one_player(void) { s32 someIndex; f32 something; // permuter magic long long why; s32 one = 1; D_8018D140 = 0; D_8018D150 = 0; D_8018CFCC = 1.0f; find_unused_obj_index(&D_80183DA0); find_unused_obj_index(&gItemWindowObjectByPlayerId[0]); find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); func_8007055C(gScreenOneCtx); func_8007055C(gScreenTwoCtx); init_course_object(); playerHUD[PLAYER_ONE].speedometerX = 0x0156; playerHUD[PLAYER_ONE].speedometerY = 0x0106; D_8018CFEC = playerHUD[PLAYER_ONE].speedometerX + 0x18; D_8018CFF4 = playerHUD[PLAYER_ONE].speedometerY + 6; D_8016579E = 0xDD00; playerHUD[PLAYER_ONE].rankX = 52; playerHUD[PLAYER_ONE].rankY = 0x00C8; playerHUD[PLAYER_ONE].slideRankX = 0; playerHUD[PLAYER_ONE].slideRankY = 0; playerHUD[PLAYER_ONE].stagingPosition = gGPCurrentRaceRankByPlayerId[0]; playerHUD[PLAYER_ONE].timerX = 0x012C; playerHUD[PLAYER_ONE].lapCompletionTimeXs[0] = 0x012C; playerHUD[PLAYER_ONE].lapCompletionTimeXs[1] = 0x012C; playerHUD[PLAYER_ONE].timerY = 0x0011; playerHUD[PLAYER_ONE].lapX = -40; playerHUD[PLAYER_ONE].lapAfterImage1X = -40; playerHUD[PLAYER_ONE].lapAfterImage2X = -40; playerHUD[PLAYER_ONE].lapY = 0x0019; playerHUD[PLAYER_ONE].itemBoxX = 0x00A0; playerHUD[PLAYER_ONE].itemBoxY = -0x0020; playerHUD[PLAYER_ONE].slideItemBoxX = 0; playerHUD[PLAYER_ONE].slideItemBoxY = 0; // permuter magic why = 0x000000A0; init_item_window(gItemWindowObjectByPlayerId[0]); for (someIndex = 0, something = 35.0f; someIndex < 8; someIndex++, something += 32.0) { D_8018D0C8[someIndex] = 40.0f; D_8018D028[someIndex] = -24.0f; D_8018D050[someIndex] = something; D_8018D0F0[someIndex] = something; D_8018D0A0[someIndex] = 0.0f; D_8018D078[someIndex] = 0.0f; } D_8018CFD4 = 1.0f; D_8018D3D4 = D_8018D3D8 = D_8018D3DC = 0x000000FF; D_8018D3E0 = why; D_8018D3E4 = 0x000000FF; D_8018D3E8 = 0x000000FF; D_8018D3EC = 0x000000FF; D_8018D3F0 = 0x000000FF; D_8018D3F4 = one; playerHUD[PLAYER_ONE].unk_4C = 0x0078; playerHUD[PLAYER_ONE].unk_4A = 0x00A0; playerHUD[PLAYER_ONE].rankScaling = 0.5f; D_801656B0 = 0; D_80165708 = 0x0028; D_8018D00C = 5.0f; D_8018D388 = 4; D_8018D380 = 0x00A0; D_8018D384 = 0x0078; D_8018D3C4 = 0x00000032; D_8018D3BC = 0x0028; D_8018D3C0 = 0x00000050; D_801657A2 = 0x0333; switch (gModeSelection) { /* irregular */ case 0: D_8018D158 = 8; break; case 1: D_80165638 = (func_800B4F2C() & 0xFFFFF) - 1; D_80165648 = func_800B4E24(0) & 0xFFFFF; D_80165888 = 1; D_80165890 = 1; D_8018D158 = 1; break; } } void init_hud_two_player_vertical(void) { find_unused_obj_index(&D_80183DA0); find_unused_obj_index(&gItemWindowObjectByPlayerId[0]); find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); func_8007055C(gScreenOneCtx); func_8007055C(gScreenTwoCtx); init_course_object(); playerHUD[PLAYER_ONE].itemBoxX = -0x52; playerHUD[PLAYER_ONE].itemBoxY = 0x32; playerHUD[PLAYER_ONE].slideItemBoxX = 0; playerHUD[PLAYER_ONE].slideItemBoxY = 0; playerHUD[PLAYER_ONE].unk_4A = 0x50; playerHUD[PLAYER_ONE].unk_4C = 0x78; playerHUD[PLAYER_ONE].rankX = 0x32; playerHUD[PLAYER_ONE].rankY = 0xD2; playerHUD[PLAYER_ONE].slideRankX = 0; playerHUD[PLAYER_ONE].slideRankY = 0; playerHUD[PLAYER_ONE].timerX = 0x4B; playerHUD[PLAYER_ONE].timerY = 0x10; playerHUD[PLAYER_ONE].lapX = 0x67; playerHUD[PLAYER_ONE].lapY = 0x28; init_item_window(gItemWindowObjectByPlayerId[PLAYER_ONE]); playerHUD[PLAYER_TWO].itemBoxX = 0x43; playerHUD[PLAYER_TWO].itemBoxY = 0x32; playerHUD[PLAYER_TWO].slideItemBoxX = 0; playerHUD[PLAYER_TWO].slideItemBoxY = 0; playerHUD[PLAYER_TWO].unk_4A = 0xF0; playerHUD[PLAYER_TWO].unk_4C = 0x78; playerHUD[PLAYER_TWO].rankX = 0xC8; playerHUD[PLAYER_TWO].rankY = 0xD2; playerHUD[PLAYER_TWO].slideRankX = 0; playerHUD[PLAYER_TWO].slideRankY = 0; playerHUD[PLAYER_TWO].timerX = 0xDC; playerHUD[PLAYER_TWO].timerY = 0x10; playerHUD[PLAYER_TWO].lapX = 0xF7; playerHUD[PLAYER_TWO].lapY = 0x28; init_item_window(gItemWindowObjectByPlayerId[PLAYER_TWO]); playerHUD[PLAYER_ONE].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[0]; playerHUD[PLAYER_TWO].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[1]; playerHUD[PLAYER_ONE].rankScaling = playerHUD[PLAYER_TWO].rankScaling = 0.5f; D_8018D3C4 = 0x1E; D_8018D3BC = 0x18; D_8018D3C0 = 0x28; D_801657A2 = 0x666; switch (gModeSelection) { /* irregular */ case GRAND_PRIX: D_8018D158 = 8; break; case VERSUS: D_8018D158 = 2; break; case BATTLE: D_8018D158 = 2; break; } } void init_hud_two_player_horizontal() { find_unused_obj_index(&D_80183DA0); find_unused_obj_index(&gItemWindowObjectByPlayerId[0]); find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); init_object_list_index(); func_8007055C(gScreenOneCtx); func_8007055C(gScreenTwoCtx); init_course_object(); playerHUD[PLAYER_ONE].itemBoxY = 0x22; playerHUD[PLAYER_ONE].itemBoxX = -0x53; playerHUD[PLAYER_ONE].slideItemBoxX = 0; playerHUD[PLAYER_ONE].slideItemBoxY = 0; playerHUD[PLAYER_ONE].unk_4A = 0xA0; playerHUD[PLAYER_ONE].unk_4C = 0x3C; playerHUD[PLAYER_ONE].rankX = 0x34; playerHUD[PLAYER_ONE].rankY = 0x62; playerHUD[PLAYER_ONE].slideRankX = 0; playerHUD[PLAYER_ONE].slideRankY = 0; playerHUD[PLAYER_ONE].timerX = 0xEA; playerHUD[PLAYER_ONE].timerY = 0x10; playerHUD[PLAYER_ONE].lapX = 0x101; playerHUD[PLAYER_ONE].lapY = 0x6A; playerHUD[PLAYER_TWO].itemBoxX = -0x53; playerHUD[PLAYER_TWO].itemBoxY = 0x8F; playerHUD[PLAYER_TWO].slideItemBoxX = 0; playerHUD[PLAYER_TWO].slideItemBoxY = 0; playerHUD[PLAYER_TWO].unk_4A = 0xA0; playerHUD[PLAYER_TWO].unk_4C = 0xB4; playerHUD[PLAYER_TWO].rankX = 0x34; playerHUD[PLAYER_TWO].rankY = 0xD2; playerHUD[PLAYER_TWO].slideRankX = 0; playerHUD[PLAYER_TWO].slideRankY = 0; playerHUD[PLAYER_TWO].timerX = 0xEA; playerHUD[PLAYER_TWO].timerY = 0x7F; playerHUD[PLAYER_TWO].lapX = 0x101; playerHUD[PLAYER_TWO].lapY = 0xDA; if (gModeSelection == BATTLE) { playerHUD[PLAYER_ONE].itemBoxY = 0x5E; playerHUD[PLAYER_TWO].itemBoxY = 0xD0; } playerHUD[PLAYER_ONE].rankScaling = playerHUD[PLAYER_TWO].rankScaling = 0.5f; playerHUD[PLAYER_ONE].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[0]; playerHUD[PLAYER_TWO].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[1]; init_item_window(gItemWindowObjectByPlayerId[0]); init_item_window((gItemWindowObjectByPlayerId[1])); D_8018D3C4 = 0x1E; D_8018D3BC = 0x18; D_8018D3C0 = 0x28; D_801657A2 = 0x666; switch (gModeSelection) { /* irregular */ case GRAND_PRIX: D_8018D158 = 8; return; case VERSUS: D_8018D158 = 2; return; case BATTLE: D_8018D158 = 2; return; } } void init_hud_three_four_player(void) { find_unused_obj_index(&D_80183DA0); find_unused_obj_index(&gItemWindowObjectByPlayerId[0]); find_unused_obj_index(&gItemWindowObjectByPlayerId[1]); find_unused_obj_index(&gItemWindowObjectByPlayerId[2]); find_unused_obj_index(&gItemWindowObjectByPlayerId[3]); init_object_list_index(); if (CVarGetInteger("gMultiplayerNoFeatureCuts", false) == true) { func_8007055C(gScreenOneCtx); func_8007055C(gScreenTwoCtx); func_8007055C(gScreenThreeCtx); if (gPlayerCountSelection1 == 4) { func_8007055C(gScreenFourCtx); } } init_course_object(); playerHUD[PLAYER_ONE].itemBoxX = -0x36; playerHUD[PLAYER_ONE].itemBoxY = 0x36; playerHUD[PLAYER_ONE].slideItemBoxX = 0; playerHUD[PLAYER_ONE].slideItemBoxY = 0; playerHUD[PLAYER_ONE].unk_4A = 0x50; playerHUD[PLAYER_ONE].unk_4C = 0x3C; playerHUD[PLAYER_ONE].rankX = 0x25; playerHUD[PLAYER_ONE].rankY = 0x64; playerHUD[PLAYER_ONE].slideRankX = 0; playerHUD[PLAYER_ONE].slideRankY = 0; playerHUD[PLAYER_ONE].lapX = 0x8C; playerHUD[PLAYER_ONE].lapY = 0x60; playerHUD[PLAYER_ONE].unk_6C = 0xDE; playerHUD[PLAYER_ONE].unk_6E = 0xC8; playerHUD[PLAYER_TWO].itemBoxX = 0x175; playerHUD[PLAYER_TWO].itemBoxY = 0x36; playerHUD[PLAYER_TWO].slideItemBoxX = 0; playerHUD[PLAYER_TWO].slideItemBoxY = 0; playerHUD[PLAYER_TWO].unk_4A = 0xF0; playerHUD[PLAYER_TWO].unk_4C = 0x3C; playerHUD[PLAYER_TWO].rankX = 0x11A; playerHUD[PLAYER_TWO].rankY = 0x64; playerHUD[PLAYER_TWO].slideRankX = 0; playerHUD[PLAYER_TWO].slideRankY = 0; playerHUD[PLAYER_TWO].lapX = 0xB4; playerHUD[PLAYER_TWO].lapY = 0x60; playerHUD[PLAYER_TWO].unk_6C = 0xC8; playerHUD[PLAYER_TWO].unk_6E = 0xC8; playerHUD[PLAYER_THREE].itemBoxX = -0x36; playerHUD[PLAYER_THREE].itemBoxY = 0x2D; playerHUD[PLAYER_THREE].slideItemBoxX = 0; playerHUD[PLAYER_THREE].slideItemBoxY = 0; playerHUD[PLAYER_THREE].unk_4A = 0x50; playerHUD[PLAYER_THREE].unk_4C = 0xB4; playerHUD[PLAYER_THREE].rankX = 0x25; playerHUD[PLAYER_THREE].rankY = 0xD2; playerHUD[PLAYER_THREE].slideRankX = 0; playerHUD[PLAYER_THREE].slideRankY = 0; playerHUD[PLAYER_THREE].lapX = 0x8C; playerHUD[PLAYER_THREE].lapY = 0xD4; playerHUD[PLAYER_THREE].unk_6C = 0xDE; playerHUD[PLAYER_THREE].unk_6E = 0xC0; playerHUD[PLAYER_FOUR].itemBoxX = 0x175; playerHUD[PLAYER_FOUR].itemBoxY = 0x2D; playerHUD[PLAYER_FOUR].slideItemBoxX = 0; playerHUD[PLAYER_FOUR].slideItemBoxY = 0; playerHUD[PLAYER_FOUR].unk_4A = 0xF0; playerHUD[PLAYER_FOUR].unk_4C = 0xB4; playerHUD[PLAYER_FOUR].rankX = 0x11A; playerHUD[PLAYER_FOUR].rankY = 0xD2; playerHUD[PLAYER_FOUR].slideRankX = 0; playerHUD[PLAYER_FOUR].slideRankY = 0; playerHUD[PLAYER_FOUR].lapX = 0xB4; playerHUD[PLAYER_FOUR].lapY = 0xD4; playerHUD[PLAYER_FOUR].unk_6C = 0xC8; playerHUD[PLAYER_FOUR].unk_6E = 0xC0; if (gModeSelection == BATTLE) { playerHUD[PLAYER_ONE].itemBoxY = 0xC8; playerHUD[PLAYER_TWO].itemBoxY = 0xC8; playerHUD[PLAYER_THREE].itemBoxY = 0xB8; playerHUD[PLAYER_FOUR].itemBoxY = 0xB8; } playerHUD[PLAYER_ONE].rankScaling = playerHUD[PLAYER_TWO].rankScaling = playerHUD[PLAYER_THREE].rankScaling = playerHUD[PLAYER_FOUR].rankScaling = 0.5f; playerHUD[PLAYER_ONE].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[0]; playerHUD[PLAYER_TWO].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[1]; playerHUD[PLAYER_THREE].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[2]; playerHUD[PLAYER_FOUR].stagingPosition = (s16) gGPCurrentRaceRankByPlayerId[3]; init_item_window(gItemWindowObjectByPlayerId[0]); init_item_window(gItemWindowObjectByPlayerId[1]); init_item_window(gItemWindowObjectByPlayerId[2]); init_item_window(gItemWindowObjectByPlayerId[3]); playerHUD[PLAYER_ONE].unknownScaling = playerHUD[PLAYER_TWO].unknownScaling = playerHUD[PLAYER_THREE].unknownScaling = playerHUD[PLAYER_FOUR].unknownScaling = 1.5f; D_8018D158 = (s32) gPlayerCount; D_8018D3C4 = 0x00000014; D_8018D3BC = 0x00000010; D_8018D3C0 = 0x0000001E; D_801657A2 = 0x0888; }