From a8f34e48c88cb26f6e681f036980c4606b5f7338 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sun, 8 Nov 2026 07:59:44 -0500 Subject: [PATCH] Offer a 1080p game resolution. The picture's height can now be 1080, below the game's own 1440, for slower GPUs: the scene, the DLSS and FSR 3.1 modes and frame generation follow it, and the ultrawide shapes become 2560x1080 and 3840x1080. "Native" keeps its floor of 1440. The example settings file now documents game_aspect and game_res. Co-Authored-By: Claude Opus 5.5 --- nx2navi.ini.example | 6 ++++++ runtime/cfg.c | 2 +- runtime/ui/menu.cpp | 8 ++++---- runtime/widescreen.c | 11 +++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/nx2navi.ini.example b/nx2navi.ini.example index 203ebd40..471e885a 100644 --- a/nx2navi.ini.example +++ b/nx2navi.ini.example @@ -156,6 +156,12 @@ # gets the camera's view but a 16:9 HUD, stretched over the picture, unless you build its layout with # tools/make_romfs_patches.py --aspect WxH. Read at start. # output_res = 1920x1080 +# Ocarina of Time sizes its picture with these two instead (output_res and render_scale do nothing there). The shape: +# 16:9, window (the window's shape, or the monitor's in fullscreen), 21:9 or 32:9. The height: 1080 (lighter than the +# game's own), 1440 (the game's own), 1800, 2160, 2880 or window (the window's height, at least 1440). The DLSS and +# FSR 3.1 modes render their share of this picture. Read at start. +# game_aspect = 16:9 +# game_res = 1440 # 3D render scale: the scene's size relative to the game resolution, game (5/6, the game's own 1600x900 at 1080p) or # a percentage (25 to 400, at most 4096 pixels a side); above 100 supersamples the scene (anti-aliasing). Read at start. # render_scale = game diff --git a/runtime/cfg.c b/runtime/cfg.c index 6973171e..35843a2c 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -123,7 +123,7 @@ static const CfgMeta metas[] = { {"FRAMEGEN", "off", "off|fsr3|dlss", RESTART}, // vk_fg.cpp, vk_dlssg.c {"DLSS_CHAR_MASK", "65", "0|35|65|100", LIVE}, {"FXAA", "1", "0|1", LIVE}, {"GAME_ASPECT", "16:9", "16:9|window|21:9|32:9", RESTART}, // widescreen.c - {"GAME_RES", "1440", "1440|1800|2160|2880|window", RESTART}, // widescreen.c: the picture's height + {"GAME_RES", "1440", "1080|1440|1800|2160|2880|window", RESTART}, // widescreen.c: the picture's height {"ASPECT", "fit", "fit|stretch", LIVE}, {"FOV", "100", "70..140", LIVE}, {"ANISO", "game", "game|2|4|8|16", RESTART}, // vk_texture.c sampler_features // colour adjustment (vk_color.c); the preset is the menu's, the four values are what the present uses diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 9854c6a5..67522c5d 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -876,11 +876,11 @@ static void row_framegen(void) { if (nv >= 0 && nv < n) opt_apply("NX2NAVI_FRAMEGEN", values[nv]); } -// The picture's height (widescreen.c picture_height): the game's 1440 or more. +// The picture's height (widescreen.c picture_height): 1080, the game's 1440 or more. static void row_game_res(void) { - static const char *const values[] = {"1440", "1800", "2160", "2880", "window"}; - const char *names[] = {"1440p", "1800p", "2160p (4K)", "2880p (5K)", menu_text(UI_MENU_GAME_RES_NATIVE)}; - opt_choice_list("NX2NAVI_GAME_RES", UI_MENU_GAME_RES, values, names, 5, UI_MENU_GAME_RES_DESC); + static const char *const values[] = {"1080", "1440", "1800", "2160", "2880", "window"}; + const char *names[] = {"1080p", "1440p", "1800p", "2160p (4K)", "2880p (5K)", menu_text(UI_MENU_GAME_RES_NATIVE)}; + opt_choice_list("NX2NAVI_GAME_RES", UI_MENU_GAME_RES, values, names, 6, UI_MENU_GAME_RES_DESC); } static void tab_screen(float scale) { diff --git a/runtime/widescreen.c b/runtime/widescreen.c index 01c3d4d1..04e61bb6 100644 --- a/runtime/widescreen.c +++ b/runtime/widescreen.c @@ -55,17 +55,20 @@ static double wanted_ratio(void) { return (double)w / h; } -// NX2NAVI_GAME_RES: the picture's height, from the game's 1440 up to 4320 ("window": the window's height, or the -// monitor's in fullscreen). +// NX2NAVI_GAME_RES: the picture's height, 1080 up to 4320 ("window": the window's height, or the monitor's in +// fullscreen, never below the game's 1440). 1080 is the one height below the game's own: a lighter picture for slower +// GPUs, its scene and the DLSS modes scaled down with it (wide_present, scale_k). +#define PICTURE_MIN_H 1080 static unsigned picture_height(void) { const char *s = cfg_value("NX2NAVI_GAME_RES"); - int w = 0, h = GAME_H; + int w = 0, h = GAME_H, min = PICTURE_MIN_H; if (!strcmp(s, "window")) { if (!screen_size(&w, &h)) h = GAME_H; + min = GAME_H; } else { h = atoi(s); } - return h < GAME_H ? GAME_H : h > 4320 ? 4320 : (unsigned)h; + return h < min ? (unsigned)min : h > 4320 ? 4320 : (unsigned)h; }