From 929b1cc71c23a995a99472bad8b0cdfcb6cf97c7 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Wed, 7 Jan 2026 21:48:46 -0600 Subject: [PATCH] Fixed some flags not getting reset --- src/engine/level_script.c | 8 -------- src/game/moving_texture.c | 4 ++-- src/menu/star_select.c | 2 ++ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/engine/level_script.c b/src/engine/level_script.c index 3f5ce113..9237e101 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -592,9 +592,6 @@ static void level_cmd_set_gamma(void) { static void level_cmd_set_terrain_data(void) { if (sCurrAreaIndex != -1) { -#ifndef NO_SEGMENTED_MEMORY - gAreas[sCurrAreaIndex].terrainData = segmented_to_virtual(CMD_GET(void *, 4)); -#else Collision *data; u32 size; @@ -603,7 +600,6 @@ static void level_cmd_set_terrain_data(void) { size = get_area_terrain_size(data) * sizeof(Collision); gAreas[sCurrAreaIndex].terrainData = alloc_only_pool_alloc(sLevelPool, size); memcpy(gAreas[sCurrAreaIndex].terrainData, data, size); -#endif } sCurrentCmd = CMD_NEXT; } @@ -617,9 +613,6 @@ static void level_cmd_set_rooms(void) { static void level_cmd_set_macro_objects(void) { if (sCurrAreaIndex != -1) { -#ifndef NO_SEGMENTED_MEMORY - gAreas[sCurrAreaIndex].macroObjects = segmented_to_virtual(CMD_GET(void *, 4)); -#else // The game modifies the macro object data (for example marking coins as taken), // so it must be reset when the level reloads. MacroObject *data = segmented_to_virtual(CMD_GET(void *, 4)); @@ -629,7 +622,6 @@ static void level_cmd_set_macro_objects(void) { } gAreas[sCurrAreaIndex].macroObjects = alloc_only_pool_alloc(sLevelPool, len * sizeof(MacroObject)); memcpy(gAreas[sCurrAreaIndex].macroObjects, data, len * sizeof(MacroObject)); -#endif } sCurrentCmd = CMD_NEXT; } diff --git a/src/game/moving_texture.c b/src/game/moving_texture.c index 88c83a53..0d84115e 100644 --- a/src/game/moving_texture.c +++ b/src/game/moving_texture.c @@ -659,7 +659,7 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS } else if (asGenerated->parameter == SSL_MOVTEX_TOXBOX_QUICKSAND_MIST) { gMovtexVtxColor = MOVTEX_VTX_COLOR_RED; } - quadCollection = get_quad_collection_from_id(asGenerated->parameter); + quadCollection = segmented_to_virtual(get_quad_collection_from_id(asGenerated->parameter)); if (quadCollection == NULL) { return NULL; } @@ -824,7 +824,7 @@ Gfx *movtex_gen_list(s16 *movtexVerts, struct MovtexObject *movtexList, s8 attrL } gSPDisplayList(gfx++, movtexList->beginDl); - gLoadBlockTexture(gfx++, 32, 32, G_IM_FMT_RGBA, gMovtexIdToTexture[movtexList->textureId]); + gLoadBlockTexture(gfx++, 32, 32, G_IM_FMT_RGBA, segmented_to_virtual(gMovtexIdToTexture[movtexList->textureId])); gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL2(verts), movtexList->vtx_count, 0); gSPDisplayList(gfx++, movtexList->triDl); gSPDisplayList(gfx++, movtexList->endDl); diff --git a/src/menu/star_select.c b/src/menu/star_select.c index 4cd35346..068dafeb 100644 --- a/src/menu/star_select.c +++ b/src/menu/star_select.c @@ -398,6 +398,8 @@ s32 lvl_init_act_selector_values_and_stars(UNUSED s32 arg, UNUSED s32 unused) { sInitSelectedActNum = 0; sVisibleStars = 0; sActSelectorMenuTimer = 0; + sSelectedActIndex = 0; + sSelectableStarIndex = 0; sObtainedStars = save_file_get_course_star_count(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum));