From bd9684d1b34233cd184c97f27f6520cd63f2f444 Mon Sep 17 00:00:00 2001 From: Reonu Date: Wed, 12 May 2021 11:29:35 +0100 Subject: [PATCH] Removed old patch files --- enhancements/platformdisplacement2.patch | 288 ---------------------- enhancements/widescreenv2_sm64.patch | 198 --------------- enhancements/widescreenv2_ultrasm64.patch | 227 ----------------- 3 files changed, 713 deletions(-) delete mode 100644 enhancements/platformdisplacement2.patch delete mode 100644 enhancements/widescreenv2_sm64.patch delete mode 100644 enhancements/widescreenv2_ultrasm64.patch diff --git a/enhancements/platformdisplacement2.patch b/enhancements/platformdisplacement2.patch deleted file mode 100644 index 6bf33a8c..00000000 --- a/enhancements/platformdisplacement2.patch +++ /dev/null @@ -1,288 +0,0 @@ -diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c -index ebc6bf4..987f456 100644 ---- a/src/game/behaviors/bowser.inc.c -+++ b/src/game/behaviors/bowser.inc.c -@@ -972,6 +972,8 @@ s32 bowser_check_fallen_off_stage(void) // bowser off stage? - return 0; - } - -+struct PlatformDisplacementInfo sBowserDisplacementInfo; -+ - void (*sBowserActions[])(void) = { bowser_act_default, bowser_act_thrown_dropped, bowser_act_jump_onto_stage, bowser_act_dance, - bowser_act_dead, bowser_act_text_wait, bowser_act_intro_walk, bowser_act_charge_mario, - bowser_act_spit_fire_into_sky, bowser_act_spit_fire_onto_floor, bowser_act_hit_edge, bowser_act_turn_from_edge, -@@ -1033,7 +1035,7 @@ void bowser_free_update(void) { - struct Object *platform; - UNUSED f32 floorHeight; - if ((platform = o->platform) != NULL) -- apply_platform_displacement(0, platform); -+ apply_platform_displacement(&sBowserDisplacementInfo, &o->oPosX, &o->oFaceAngleYaw, platform); - o->oBowserUnk10E = 0; - cur_obj_update_floor_and_walls(); - cur_obj_call_action_function(sBowserActions); -diff --git a/src/game/behaviors/tilting_inverted_pyramid.inc.c b/src/game/behaviors/tilting_inverted_pyramid.inc.c -index ebce64f..29136e9 100644 ---- a/src/game/behaviors/tilting_inverted_pyramid.inc.c -+++ b/src/game/behaviors/tilting_inverted_pyramid.inc.c -@@ -131,7 +131,7 @@ void bhv_tilting_inverted_pyramid_loop(void) { - mx += posAfterRotation[0] - posBeforeRotation[0]; - my += posAfterRotation[1] - posBeforeRotation[1]; - mz += posAfterRotation[2] - posBeforeRotation[2]; -- set_mario_pos(mx, my, mz); -+ //set_mario_pos(mx, my, mz); - } - - o->header.gfx.throwMatrix = transform; -diff --git a/src/game/platform_displacement.c b/src/game/platform_displacement.c -index 29a741c..d1bb016 100644 ---- a/src/game/platform_displacement.c -+++ b/src/game/platform_displacement.c -@@ -8,6 +8,7 @@ - #include "object_list_processor.h" - #include "platform_displacement.h" - #include "types.h" -+#include "sm64.h" - - u16 D_8032FEC0 = 0; - -@@ -84,96 +85,139 @@ void set_mario_pos(f32 x, f32 y, f32 z) { - gMarioStates[0].pos[2] = z; - } - --/** -- * Apply one frame of platform rotation to Mario or an object using the given -- * platform. If isMario is 0, use gCurrentObject. -- */ --void apply_platform_displacement(u32 isMario, struct Object *platform) { -- f32 x; -- f32 y; -- f32 z; -- f32 platformPosX; -- f32 platformPosY; -- f32 platformPosZ; -- Vec3f currentObjectOffset; -- Vec3f relativeOffset; -- Vec3f newObjectOffset; -- Vec3s rotation; -- UNUSED s16 unused1; -- UNUSED s16 unused2; -- UNUSED s16 unused3; -- f32 displaceMatrix[4][4]; -- -- rotation[0] = platform->oAngleVelPitch; -- rotation[1] = platform->oAngleVelYaw; -- rotation[2] = platform->oAngleVelRoll; -- -- if (isMario) { -- D_8032FEC0 = 0; -- get_mario_pos(&x, &y, &z); -- } else { -- x = gCurrentObject->oPosX; -- y = gCurrentObject->oPosY; -- z = gCurrentObject->oPosZ; -- } -- -- x += platform->oVelX; -- z += platform->oVelZ; -+static struct PlatformDisplacementInfo sMarioDisplacementInfo; -+static Vec3f sMarioAmountDisplaced; - -- if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) { -- unused1 = rotation[0]; -- unused2 = rotation[2]; -- unused3 = platform->oFaceAngleYaw; -+extern s32 gGlobalTimer; - -- if (isMario) { -- gMarioStates[0].faceAngle[1] += rotation[1]; -- } -- -- platformPosX = platform->oPosX; -- platformPosY = platform->oPosY; -- platformPosZ = platform->oPosZ; -- -- currentObjectOffset[0] = x - platformPosX; -- currentObjectOffset[1] = y - platformPosY; -- currentObjectOffset[2] = z - platformPosZ; -- -- rotation[0] = platform->oFaceAnglePitch - platform->oAngleVelPitch; -- rotation[1] = platform->oFaceAngleYaw - platform->oAngleVelYaw; -- rotation[2] = platform->oFaceAngleRoll - platform->oAngleVelRoll; -- -- mtxf_rotate_zxy_and_translate(displaceMatrix, currentObjectOffset, rotation); -- linear_mtxf_transpose_mul_vec3f(displaceMatrix, relativeOffset, currentObjectOffset); -+/** -+ * Upscale or downscale a vector by another vector. -+ */ -+static void scale_vec3f(Vec3f dst, Vec3f src, Vec3f scale, u32 doInverted) { -+ if (doInverted) { -+ dst[0] = src[0] / scale[0]; -+ dst[1] = src[1] / scale[1]; -+ dst[2] = src[2] / scale[2]; -+ } else { -+ dst[0] = src[0] * scale[0]; -+ dst[1] = src[1] * scale[1]; -+ dst[2] = src[2] * scale[2]; -+ } -+} - -- rotation[0] = platform->oFaceAnglePitch; -- rotation[1] = platform->oFaceAngleYaw; -- rotation[2] = platform->oFaceAngleRoll; -+/** -+ * Apply one frame of platform displacement to Mario or an object using the given -+ * platform. -+ */ -+void apply_platform_displacement(struct PlatformDisplacementInfo *displaceInfo, Vec3f pos, s16 *yaw, struct Object *platform) { -+ Vec3f platformPos; -+ Vec3f posDifference; -+ Vec3f yawVec; -+ Vec3f scaledPos; -+ // Determine how much Mario turned on his own since last frame -+ s16 yawDifference = *yaw - displaceInfo->prevYaw; -+ -+ // Avoid a crash if the platform unloaded its collision while stood on -+ if (platform->header.gfx.throwMatrix == NULL) return; -+ -+ vec3f_copy(platformPos, (*platform->header.gfx.throwMatrix)[3]); -+ -+ // Determine how far Mario moved on his own since last frame -+ vec3f_copy(posDifference, pos); -+ vec3f_sub(posDifference, displaceInfo->prevPos); -+ -+ if ((platform == displaceInfo->prevPlatform) && (gGlobalTimer == displaceInfo->prevTimer + 1)) { -+ // Transform from relative positions to world positions -+ scale_vec3f(scaledPos, displaceInfo->prevTransformedPos, platform->header.gfx.scale, FALSE); -+ linear_mtxf_mul_vec3f(*platform->header.gfx.throwMatrix, pos, scaledPos); -+ -+ // Add on how much Mario moved in the previous frame -+ vec3f_add(pos, posDifference); -+ -+ // Calculate new yaw -+ linear_mtxf_mul_vec3f(*platform->header.gfx.throwMatrix, yawVec, displaceInfo->prevTransformedYawVec); -+ *yaw = atan2s(yawVec[2], yawVec[0]) + yawDifference; -+ } else { -+ // First frame of standing on the platform, don't calculate a new position -+ vec3f_sub(pos, platformPos); -+ } -+ -+ // Transform from world positions to relative positions for use next frame -+ linear_mtxf_transpose_mul_vec3f(*platform->header.gfx.throwMatrix, scaledPos, pos); -+ scale_vec3f(displaceInfo->prevTransformedPos, scaledPos, platform->header.gfx.scale, TRUE); -+ vec3f_add(pos, platformPos); -+ -+ // If the object is Mario, set inertia -+ if (pos == gMarioState->pos) { -+ vec3f_copy(sMarioAmountDisplaced, pos); -+ vec3f_sub(sMarioAmountDisplaced, displaceInfo->prevPos); -+ vec3f_sub(sMarioAmountDisplaced, posDifference); -+ -+ // Make sure inertia isn't set on the first frame otherwise the previous value isn't cleared -+ if ((platform != displaceInfo->prevPlatform) || (gGlobalTimer != displaceInfo->prevTimer + 1)) { -+ vec3f_set(sMarioAmountDisplaced, 0.f, 0.f, 0.f); -+ } -+ } -+ -+ // Update info for next frame -+ // Update position -+ vec3f_copy(displaceInfo->prevPos, pos); -+ -+ // Set yaw info -+ vec3f_set(yawVec, sins(*yaw), 0, coss(*yaw)); -+ linear_mtxf_transpose_mul_vec3f(*platform->header.gfx.throwMatrix, displaceInfo->prevTransformedYawVec, yawVec); -+ displaceInfo->prevYaw = *yaw; -+ -+ // Update platform and timer -+ displaceInfo->prevPlatform = platform; -+ displaceInfo->prevTimer = gGlobalTimer; -+} - -- mtxf_rotate_zxy_and_translate(displaceMatrix, currentObjectOffset, rotation); -- linear_mtxf_mul_vec3f(displaceMatrix, newObjectOffset, relativeOffset); -+// Doesn't change in the code, set this to FALSE if you don't want inertia -+u8 gDoInertia = TRUE; - -- x = platformPosX + newObjectOffset[0]; -- y = platformPosY + newObjectOffset[1]; -- z = platformPosZ + newObjectOffset[2]; -- } -+static u8 sShouldApplyInertia = FALSE; -+static u8 sInertiaFirstFrame = FALSE; - -- if (isMario) { -- set_mario_pos(x, y, z); -- } else { -- gCurrentObject->oPosX = x; -- gCurrentObject->oPosY = y; -- gCurrentObject->oPosZ = z; -- } -+/** -+ * Apply inertia based on Mario's last platform. -+ */ -+static void apply_mario_inertia(void) { -+ // On the first frame of leaving the ground, boost Mario's y velocity -+ if (sInertiaFirstFrame) { -+ gMarioState->vel[1] += sMarioAmountDisplaced[1]; -+ } -+ -+ // Apply sideways inertia -+ gMarioState->pos[0] += sMarioAmountDisplaced[0]; -+ gMarioState->pos[2] += sMarioAmountDisplaced[2]; -+ -+ // Drag -+ sMarioAmountDisplaced[0] *= 0.97f; -+ sMarioAmountDisplaced[2] *= 0.97f; -+ -+ // Stop applying inertia once Mario has landed, or when ground pounding -+ if (!(gMarioState->action & ACT_FLAG_AIR) || (gMarioState->action == ACT_GROUND_POUND)) { -+ sShouldApplyInertia = FALSE; -+ } - } - - /** -- * If Mario's platform is not null, apply platform displacement. -+ * Apply platform displacement or inertia if required. - */ - void apply_mario_platform_displacement(void) { - struct Object *platform; - - platform = gMarioPlatform; -- if (!(gTimeStopState & TIME_STOP_ACTIVE) && gMarioObject != NULL && platform != NULL) { -- apply_platform_displacement(1, platform); -+ if (!(gTimeStopState & TIME_STOP_ACTIVE) && gMarioObject != NULL) { -+ if (platform != NULL) { -+ apply_platform_displacement(&sMarioDisplacementInfo, gMarioState->pos, &gMarioState->faceAngle[1], platform); -+ sShouldApplyInertia = TRUE; -+ sInertiaFirstFrame = TRUE; -+ } else if (sShouldApplyInertia && gDoInertia) { -+ apply_mario_inertia(); -+ sInertiaFirstFrame = FALSE; -+ } - } - } - -diff --git a/src/game/platform_displacement.h b/src/game/platform_displacement.h -index 556192b..3609e2d 100644 ---- a/src/game/platform_displacement.h -+++ b/src/game/platform_displacement.h -@@ -5,10 +5,19 @@ - - #include "types.h" - -+struct PlatformDisplacementInfo { -+ Vec3f prevPos; -+ Vec3f prevTransformedPos; -+ Vec3f prevTransformedYawVec; -+ s16 prevYaw; -+ struct Object *prevPlatform; -+ s32 prevTimer; -+}; -+ - void update_mario_platform(void); - void get_mario_pos(f32 *x, f32 *y, f32 *z); - void set_mario_pos(f32 x, f32 y, f32 z); --void apply_platform_displacement(u32 isMario, struct Object *platform); -+void apply_platform_displacement(struct PlatformDisplacementInfo *displaceInfo, Vec3f pos, s16 *yaw, struct Object *platform); - void apply_mario_platform_displacement(void); - #ifndef VERSION_JP - void clear_mario_platform(void); diff --git a/enhancements/widescreenv2_sm64.patch b/enhancements/widescreenv2_sm64.patch deleted file mode 100644 index d7f27ade..00000000 --- a/enhancements/widescreenv2_sm64.patch +++ /dev/null @@ -1,198 +0,0 @@ -diff --git a/include/text_strings.h.in b/include/text_strings.h.in -index 749179b..3b23b41 100644 ---- a/include/text_strings.h.in -+++ b/include/text_strings.h.in -@@ -24,6 +24,10 @@ - // Ingame Menu - #define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses - #define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses -+#define TEXT_HUD_CURRENT_RATIO_43 _("CURRENT ASPECT RATIO: 4:3. PRESS L TO SWITCH TO 16:9") -+#define TEXT_HUD_CURRENT_RATIO_169 _("CURRENT ASPECT RATIO: 16:9. PRESS L TO SWITCH TO 4:3") -+#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO") -+#define TEXT_HUD_WIDE_INFO2 _("STRETCH THE IMAGE TO 16:9") - - #if defined(VERSION_JP) || defined(VERSION_SH) - -diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c -index 8190f88..deb69f5 100644 ---- a/src/game/ingame_menu.c -+++ b/src/game/ingame_menu.c -@@ -34,6 +34,11 @@ s16 gDialogY; // D_8032F69C - s16 gCutsceneMsgXOffset; - s16 gCutsceneMsgYOffset; - s8 gRedCoinsCollected; -+u8 textCurrRatio43[] = { TEXT_HUD_CURRENT_RATIO_43 }; -+u8 textCurrRatio169[] = { TEXT_HUD_CURRENT_RATIO_169 }; -+u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO }; -+u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 }; -+extern u8 widescreen = 0; - - extern u8 gLastCompletedCourseNum; - extern u8 gLastCompletedStarNum; -@@ -2266,6 +2271,14 @@ void render_pause_my_score_coins(void) { - print_generic_string(get_string_width(gTextCourseArr[gInGameLanguage]) + 51, 157, strCourseNum); - #else - print_generic_string(CRS_NUM_X1, 157, strCourseNum); -+ if (widescreen == 0) { -+ print_generic_string(10, 20, textCurrRatio43); -+ } -+ else { -+ print_generic_string(10, 20, textCurrRatio169); -+ print_generic_string(10, 200, textWideInfo); -+ print_generic_string(10, 180, textWideInfo2); -+ } - #endif - - actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]); -@@ -2557,10 +2570,25 @@ void render_pause_castle_main_strings(s16 x, s16 y) { - } - } - } -+ if (gPlayer1Controller->buttonPressed & L_TRIG){ -+ if (widescreen == 0){ -+ widescreen = 1; -+ } -+ else{ -+ widescreen = 0; -+ } -+ } - - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); -- -+ if (widescreen == 0) { -+ print_generic_string(10, 20, textCurrRatio43); -+ } -+ else { -+ print_generic_string(10, 20, textCurrRatio169); -+ print_generic_string(10, 200, textWideInfo); -+ print_generic_string(10, 180, textWideInfo2); -+ } - if (gDialogLineNum < COURSE_STAGES_COUNT) { - courseName = segmented_to_virtual(courseNameTbl[gDialogLineNum]); - render_pause_castle_course_stars(x, y, gCurrSaveFileNum - 1, gDialogLineNum); -@@ -2626,6 +2654,14 @@ s16 render_pause_courses_and_castle(void) { - shade_screen(); - render_pause_my_score_coins(); - render_pause_red_coins(); -+ if (gPlayer1Controller->buttonPressed & L_TRIG){ -+ if (widescreen == 0){ -+ widescreen = 1; -+ } -+ else{ -+ widescreen = 0; -+ } -+ } - - if (gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) { - render_pause_course_options(99, 93, &gDialogLineNum, 15); -diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c -index 58238e8..aabdb85 100644 ---- a/src/game/rendering_graph_node.c -+++ b/src/game/rendering_graph_node.c -@@ -10,6 +10,7 @@ - #include "rendering_graph_node.h" - #include "shadow.h" - #include "sm64.h" -+#define WIDESCREEN - - /** - * This file contains the code that processes the scene graph for rendering. -@@ -235,6 +236,7 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) - /** - * Process a perspective projection node. - */ -+extern u8 widescreen; - static void geo_process_perspective(struct GraphNodePerspective *node) { - if (node->fnNode.func != NULL) { - node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]); -@@ -246,7 +248,13 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { - #ifdef VERSION_EU - f32 aspect = ((f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height) * 1.1f; - #else -- f32 aspect = (f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height; -+ f32 aspect; -+ if (widescreen == 1){ -+ aspect = 1.775f; -+ } -+ else{ -+ aspect = 1.33333f; -+ } - #endif - - guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f); -diff --git a/src/menu/file_select.c b/src/menu/file_select.c -index c894797..dc759f7 100644 ---- a/src/menu/file_select.c -+++ b/src/menu/file_select.c -@@ -2854,10 +2854,12 @@ Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct Grap - * Relocates cursor position of the last save if the game goes back to the Mario Screen - * either completing a course choosing "SAVE & QUIT" or having a game over. - */ -+extern u8 widescreen; - s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) { - #ifdef VERSION_EU - s8 fileNum; - #endif -+ widescreen = 0; - sSelectedButtonID = MENU_BUTTON_NONE; - sCurrentMenuLevel = MENU_LAYER_MAIN; - sTextBaseAlpha = 0; -diff --git a/src/menu/star_select.c b/src/menu/star_select.c -index 025dbf2..d6aaa7e 100644 ---- a/src/menu/star_select.c -+++ b/src/menu/star_select.c -@@ -52,7 +52,7 @@ static s8 sSelectableStarIndex = 0; - - // Act Selector menu timer that keeps counting until you choose an act. - static s32 sActSelectorMenuTimer = 0; -- -+extern u8 widescreen; - /** - * Act Selector Star Type Loop Action - * Defines a select type for a star in the act selector. -@@ -92,8 +92,15 @@ void bhv_act_selector_star_type_loop(void) { - void render_100_coin_star(u8 stars) { - if (stars & (1 << 6)) { - // If the 100 coin star has been collected, create a new star selector next to the coin score. -- sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -- bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); -+ if (widescreen == 1){ -+ sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -+ bhvActSelectorStarType, ((370*4.0f)/3), 24, -300, 0, 0, 0); -+ } -+ else{ -+ sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -+ bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); -+ } -+ - sStarSelectorModels[6]->oStarSelectorSize = 0.8; - sStarSelectorModels[6]->oStarSelectorType = STAR_SELECTOR_100_COINS; - } -@@ -147,11 +154,21 @@ void bhv_act_selector_init(void) { - } - - // Render star selector objects -- for (i = 0; i < sVisibleStars; i++) { -- sStarSelectorModels[i] = -- spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -- 75 + sVisibleStars * -75 + i * 152, 248, -300, 0, 0, 0); -- sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ if (widescreen == 1) { -+ for (i = 0; i < sVisibleStars; i++) { -+ sStarSelectorModels[i] = -+ spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -+ (((75 + sVisibleStars * -75 + i * 152)*4.0f)/3), 248, -300, 0, 0, 0); -+ sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ } -+ } -+ else { -+ for (i = 0; i < sVisibleStars; i++) { -+ sStarSelectorModels[i] = -+ spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -+ 75 + sVisibleStars * -75 + i * 152, 248, -300, 0, 0, 0); -+ sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ } - } - - render_100_coin_star(stars); diff --git a/enhancements/widescreenv2_ultrasm64.patch b/enhancements/widescreenv2_ultrasm64.patch deleted file mode 100644 index 667e6e27..00000000 --- a/enhancements/widescreenv2_ultrasm64.patch +++ /dev/null @@ -1,227 +0,0 @@ -diff --git a/include/text_strings.h.in b/include/text_strings.h.in -index 749179b..3b23b41 100644 ---- a/include/text_strings.h.in -+++ b/include/text_strings.h.in -@@ -24,6 +24,10 @@ - // Ingame Menu - #define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses - #define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses -+#define TEXT_HUD_CURRENT_RATIO_43 _("CURRENT ASPECT RATIO: 4:3. PRESS L TO SWITCH TO 16:9") -+#define TEXT_HUD_CURRENT_RATIO_169 _("CURRENT ASPECT RATIO: 16:9. PRESS L TO SWITCH TO 4:3") -+#define TEXT_HUD_WIDE_INFO _("PLEASE CONFIGURE YOUR DISPLAY OR YOUR EMULATOR TO") -+#define TEXT_HUD_WIDE_INFO2 _("STRETCH THE IMAGE TO 16:9") - - #if defined(VERSION_JP) || defined(VERSION_SH) - -diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c -index 9344738..37bc1d1 100644 ---- a/src/game/ingame_menu.c -+++ b/src/game/ingame_menu.c -@@ -34,6 +34,11 @@ s16 gDialogY; // D_8032F69C - s16 gCutsceneMsgXOffset; - s16 gCutsceneMsgYOffset; - s8 gRedCoinsCollected; -+u8 textCurrRatio43[] = { TEXT_HUD_CURRENT_RATIO_43 }; -+u8 textCurrRatio169[] = { TEXT_HUD_CURRENT_RATIO_169 }; -+u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO }; -+u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 }; -+extern s32 widescreen = 0; - - extern u8 gLastCompletedCourseNum; - extern u8 gLastCompletedStarNum; -@@ -1672,6 +1677,7 @@ s8 gDialogCourseActNum = 1; - #define DIAG_VAL2 240 // JP & US - #endif - -+ - void render_dialog_entries(void) { - #ifdef VERSION_EU - s8 lowerBound; -@@ -1713,7 +1719,7 @@ void render_dialog_entries(void) { - switch (gDialogBoxState) { - case DIALOG_STATE_OPENING: - if (gDialogBoxOpenTimer == DEFAULT_DIALOG_BOX_ANGLE) { -- play_dialog_sound(gDialogID); -+ //play_dialog_sound(gDialogID); - play_sound(SOUND_MENU_MESSAGE_APPEAR, gGlobalSoundSource); - } - -@@ -2199,6 +2205,7 @@ void render_pause_my_score_coins(void) { - #else - u8 textCourse[] = { TEXT_COURSE }; - u8 textMyScore[] = { TEXT_MY_SCORE }; -+ - #endif - u8 textStar[] = { TEXT_STAR }; - u8 textUnfilledStar[] = { TEXT_UNFILLED_STAR }; -@@ -2266,8 +2273,18 @@ void render_pause_my_score_coins(void) { - print_generic_string(get_string_width(gTextCourseArr[gInGameLanguage]) + 51, 157, strCourseNum); - #else - print_generic_string(CRS_NUM_X1, 157, strCourseNum); -+ if (widescreen == 0) { -+ print_generic_string(10, 20, textCurrRatio43); -+ } -+ else { -+ print_generic_string(10, 20, textCurrRatio169); -+ print_generic_string(10, 200, textWideInfo); -+ print_generic_string(10, 180, textWideInfo2); -+ } -+ - #endif - -+ - actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]); - - if (starFlags & (1 << (gDialogCourseActNum - 1))) { -@@ -2557,10 +2574,25 @@ void render_pause_castle_main_strings(s16 x, s16 y) { - } - } - } -- -+ if (gPlayer1Controller->buttonPressed & L_TRIG){ -+ if (widescreen == 0){ -+ widescreen = 1; -+ } -+ else{ -+ widescreen = 0; -+ } -+ } - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); - -+ if (widescreen == 0) { -+ print_generic_string(10, 20, textCurrRatio43); -+ } -+ else { -+ print_generic_string(10, 20, textCurrRatio169); -+ print_generic_string(10, 200, textWideInfo); -+ print_generic_string(10, 180, textWideInfo2); -+ } - if (gDialogLineNum < COURSE_STAGES_COUNT) { - courseName = segmented_to_virtual(courseNameTbl[gDialogLineNum]); - render_pause_castle_course_stars(x, y, gCurrSaveFileNum - 1, gDialogLineNum); -@@ -2626,7 +2658,14 @@ s16 render_pause_courses_and_castle(void) { - shade_screen(); - render_pause_my_score_coins(); - render_pause_red_coins(); -- -+ if (gPlayer1Controller->buttonPressed & L_TRIG){ -+ if (widescreen == 0){ -+ widescreen = 1; -+ } -+ else{ -+ widescreen = 0; -+ } -+ } - if (gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) { - render_pause_course_options(99, 93, &gDialogLineNum, 15); - } -diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c -index 58238e8..5262fd3 100644 ---- a/src/game/rendering_graph_node.c -+++ b/src/game/rendering_graph_node.c -@@ -10,6 +10,7 @@ - #include "rendering_graph_node.h" - #include "shadow.h" - #include "sm64.h" -+#define WIDESCREEN - - /** - * This file contains the code that processes the scene graph for rendering. -@@ -235,6 +236,8 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) - /** - * Process a perspective projection node. - */ -+ -+extern s32 widescreen; - static void geo_process_perspective(struct GraphNodePerspective *node) { - if (node->fnNode.func != NULL) { - node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]); -@@ -246,7 +249,13 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { - #ifdef VERSION_EU - f32 aspect = ((f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height) * 1.1f; - #else -- f32 aspect = (f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height; -+ f32 aspect; -+ if (widescreen == 1){ -+ aspect = 1.775f; -+ } -+ else{ -+ aspect = 1.33333f; -+ } - #endif - - guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f); -diff --git a/src/menu/file_select.c b/src/menu/file_select.c -index 9437dcc..6ba1845 100644 ---- a/src/menu/file_select.c -+++ b/src/menu/file_select.c -@@ -2854,10 +2854,12 @@ Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct Grap - * Relocates cursor position of the last save if the game goes back to the Mario Screen - * either completing a course choosing "SAVE & QUIT" or having a game over. - */ -+extern s32 widescreen; - s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) { - #ifdef VERSION_EU - s8 fileNum; - #endif -+ widescreen = 0; - sSelectedButtonID = MENU_BUTTON_NONE; - sCurrentMenuLevel = MENU_LAYER_MAIN; - sTextBaseAlpha = 0; -diff --git a/src/menu/star_select.c b/src/menu/star_select.c -index 07610fa..9664cc1 100644 ---- a/src/menu/star_select.c -+++ b/src/menu/star_select.c -@@ -52,6 +52,7 @@ static s8 sSelectableStarIndex = 0; - - // Act Selector menu timer that keeps counting until you choose an act. - static s32 sActSelectorMenuTimer = 0; -+extern s32 widescreen; - - /** - * Act Selector Star Type Loop Action -@@ -92,8 +93,14 @@ void bhv_act_selector_star_type_loop(void) { - void render_100_coin_star(u8 stars) { - if (stars & (1 << 6)) { - // If the 100 coin star has been collected, create a new star selector next to the coin score. -- sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -- bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); -+ if (widescreen == 1){ -+ sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -+ bhvActSelectorStarType, ((370*4.0f)/3), 24, -300, 0, 0, 0); -+ } -+ else{ -+ sStarSelectorModels[6] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, -+ bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); -+ } - sStarSelectorModels[6]->oStarSelectorSize = 0.8; - sStarSelectorModels[6]->oStarSelectorType = STAR_SELECTOR_100_COINS; - } -@@ -147,11 +154,21 @@ void bhv_act_selector_init(void) { - } - - // Render star selector objects -- for (i = 0; i < sVisibleStars; i++) { -- sStarSelectorModels[i] = -- spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -- 75 + sVisibleStars * -75 + i * 152, 248, -300, 0, 0, 0); -- sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ if (widescreen == 1) { -+ for (i = 0; i < sVisibleStars; i++) { -+ sStarSelectorModels[i] = -+ spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -+ (((75 + sVisibleStars * -75 + i * 152)*4.0f)/3), 248, -300, 0, 0, 0); -+ sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ } -+ } -+ else { -+ for (i = 0; i < sVisibleStars; i++) { -+ sStarSelectorModels[i] = -+ spawn_object_abs_with_rot(gCurrentObject, 0, selectorModelIDs[i], bhvActSelectorStarType, -+ 75 + sVisibleStars * -75 + i * 152, 248, -300, 0, 0, 0); -+ sStarSelectorModels[i]->oStarSelectorSize = 1.0f; -+ } - } - - render_100_coin_star(stars);