From 463af9cb143a20b35da611ca229ae6a2adb292aa Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Tue, 24 Nov 2026 23:10:34 +0100 Subject: [PATCH] Offer 7680x2160, the 32:9 size of 57-inch dual-4K monitors It takes the 32:9 layout folder (3840x1080's, cfg.c cfg_shape_size); totk.ini.example names the common 21:9 and 32:9 sizes and hud_width for the HUD in the middle. Co-Authored-By: Claude Opus 5.5 --- installer/screens.py | 2 +- runtime/cfg.c | 2 +- runtime/cfg_probe.c | 3 ++- runtime/ui/menu.cpp | 4 ++-- tests/installer_test.py | 4 ++-- totk.ini.example | 23 ++++++++++++----------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/installer/screens.py b/installer/screens.py index 99cccbef..a007f3d5 100644 --- a/installer/screens.py +++ b/installer/screens.py @@ -18,7 +18,7 @@ from pathlib import Path # runtime/cfg.c SHAPED: 21:9 and 32:9 monitors, 16:10 screens (the Steam Deck's 1280x800, handhelds and laptops) and 3:2 # screens (Surface and Framework laptops and tablets), 4:3 screens (CRT monitors, iPads) and 19.5:9 and 20:9 phone screens # (streamed to a phone) -ASPECT_SIZES = ('2560x1080', '3440x1440', '3840x1600', '5120x2160', '3840x1080', '5120x1440', +ASPECT_SIZES = ('2560x1080', '3440x1440', '3840x1600', '5120x2160', '3840x1080', '5120x1440', '7680x2160', '1280x800', '1680x1050', '1920x1200', '2560x1600', '1920x1280', '2160x1440', '2256x1504', '2880x1920', '3000x2000', '1440x1080', '1600x1200', '2048x1536', '2732x2048', diff --git a/runtime/cfg.c b/runtime/cfg.c index 2d89ca04..33cdd2ae 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -408,7 +408,7 @@ static const char *raw_get(const char *name) { // the Switch ones. static const unsigned SHAPED[][2] = { {2560, 1080}, {3440, 1440}, {3840, 1600}, {5120, 2160}, // 21:9 - {3840, 1080}, {5120, 1440}, // 32:9 + {3840, 1080}, {5120, 1440}, {7680, 2160}, // 32:9 {1280, 800}, {1680, 1050}, {1920, 1200}, {2560, 1600}, // 16:10 {1920, 1280}, {2160, 1440}, {2256, 1504}, {2880, 1920}, {3000, 2000}, // 3:2 {1440, 1080}, {1600, 1200}, {2048, 1536}, {2732, 2048}, // 4:3 (CRT monitors, iPads) diff --git a/runtime/cfg_probe.c b/runtime/cfg_probe.c index fb23a735..e966183c 100644 --- a/runtime/cfg_probe.c +++ b/runtime/cfg_probe.c @@ -364,7 +364,8 @@ int probe_cfg(void) { CHECK(cfg_shape_size(3440, 1440, sz) && sz[0] == 3440 && sz[1] == 1440, "shape: 3440x1440 keeps its own (0.8% off 2560x1080)"); CHECK(cfg_shape_size(1920, 800, sz) && sz[0] == 3840 && sz[1] == 1600, "shape: 1920x800 takes 3840x1600's folder"); CHECK(cfg_shape_size(2560, 1600, sz) && sz[0] == 1280 && sz[1] == 800 && cfg_shape_size(3000, 2000, sz) && - sz[0] == 1920 && sz[1] == 1280 && cfg_shape_size(5120, 1440, sz) && sz[0] == 3840 && sz[1] == 1080, + sz[0] == 1920 && sz[1] == 1280 && cfg_shape_size(5120, 1440, sz) && sz[0] == 3840 && sz[1] == 1080 && + cfg_shape_size(7680, 2160, sz) && sz[0] == 3840 && sz[1] == 1080, "shape: 16:10, 3:2 and 32:9 take their first size"); CHECK(cfg_shape_size(1024, 768, sz) && sz[0] == 1440 && sz[1] == 1080 && cfg_shape_size(2048, 1536, sz) && sz[0] == 1440 && sz[1] == 1080 && cfg_shape_size(3120, 1440, sz) && sz[0] == 2340 && sz[1] == 1080, diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 280a7692..ea00b862 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -571,14 +571,14 @@ static void folders_retry(const char *id, int need) { } // The game resolution (resolution.c): 16:9 sizes from its smallest, 1280x720 (for weak GPUs), up, the common 21:9 and -// 32:9 monitor sizes, the 16:10 screens of the Steam Deck, handhelds and laptops, the 3:2 screens of laptops and +// 32:9 monitor sizes (7680x2160: the 57-inch dual-4K ones), the 16:10 screens of the Steam Deck, handhelds and laptops, the 3:2 screens of laptops and // tablets (Surface, Framework), the 4:3 screens of CRT monitors and iPads and the 19.5:9 and 20:9 screens of phones a // game is streamed to (the camera and the HUD follow another shape, resolution.c res_init; the installer lays the HUD // out for each, installer/screens.py ASPECT_SIZES), and the current value when it is another size: any shape from 4:3 // to 32:9 gets a layout of its own (cfg.c cfg_shape_size). static void row_output_res(void) { static const char *const vals[] = {"1280x720", "1600x900", "1920x1080", "2560x1440", "3200x1800", "3840x2160", - "2560x1080", "3440x1440", "3840x1600", "5120x2160", "3840x1080", "5120x1440", + "2560x1080", "3440x1440", "3840x1600", "5120x2160", "3840x1080", "5120x1440", "7680x2160", "1280x800", "1680x1050", "1920x1200", "2560x1600", "1920x1280", "2160x1440", "2256x1504", "2880x1920", "3000x2000", "1440x1080", "1600x1200", "2048x1536", "2732x2048", diff --git a/tests/installer_test.py b/tests/installer_test.py index 04cff31b..b4e5ef90 100644 --- a/tests/installer_test.py +++ b/tests/installer_test.py @@ -1052,9 +1052,9 @@ class ShapesTest(unittest.TestCase): def test_shape_rule(self): self.assertEqual([screens.shape_size(*s) for s in ((5120, 2160), (3440, 1440), (1920, 800), (2560, 1600), (1920, 1080), (1024, 768), (3120, 1440), (2560, 1200), - (1280, 1024), (1080, 1920), (7680, 1440))], + (1280, 1024), (1080, 1920), (7680, 1440), (7680, 2160))], ['2560x1080', '3440x1440', '3840x1600', '1280x800', None, '1440x1080', '2340x1080', - '2560x1200', None, None, None]) + '2560x1200', None, None, None, '3840x1080']) self.assertIsNone(screens.shape_size(2560, 1200, listed=True)) # a display of an unlisted shape self.assertEqual(screens.default_size(3440, 1440), '2560x1080') # runtime/cfg.c screen_default self.assertEqual(screens.default_size(1280, 800), '1280x800') diff --git a/totk.ini.example b/totk.ini.example index d838e4c5..059278ca 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -219,18 +219,19 @@ # gpu_index = 0 # gpu_name = NVIDIA # Game resolution: the size the game draws its picture and interface in (1280x720 to 7680x4320). Above 1920x1080 the -# game's texture heap and memory pool grow with it. Another shape than 16:9, such as 3440x1440 on a 21:9 monitor or -# the Steam Deck's 1280x800 (16:10), gives the camera's view that shape and lays the HUD out for it. Any shape from 4:3 -# to 32:9 works: 21:9 and 32:9 monitors, 16:10 and 3:2 screens, 4:3 (1440x1080, 2048x1536 on an iPad) and phone +# game's texture heap and memory pool grow with it. Another shape than 16:9, such as 3440x1440 on a 21:9 monitor or the +# Steam Deck's 1280x800 (16:10), gives the camera's view that shape and lays the HUD out for it. Any shape from 4:3 to +# 32:9 works: 21:9 monitors (2560x1080, 3440x1440, 3840x1600, 5120x2160), 32:9 ones (3840x1080, 5120x1440, 7680x2160; +# hud_width below keeps the HUD in the middle), 16:10 and 3:2 screens, 4:3 (1440x1080, 2048x1536 on an iPad) and phone # screens streamed to (2340x1080 or 3120x1440 at 19.5:9, 2400x1080 at 20:9). The installer makes the UI layout for the -# shapes of the connected displays and of this setting; at a shape it has none for, the game draws the largest 16:9 -# size that fits inside it with bars and makes the layout in the background for the next start (a source build: make -# it with tools/make_romfs_patches.py --aspect WxH). A shape narrower than 16:9 keeps the width of the 16:9 view and -# shows more above and below (vert_plus). Portrait shapes and shapes outside 4:3..32:9 draw 16:9 with bars. Read at -# start. Default: 1920x1080, or on a primary display of 21:9, 32:9, 16:10, 3:2 or 4:3 the smallest size of that shape -# at least 1080 high that fits the display (1920x1280 on a 3:2 laptop, 2560x1080 on a 21:9 monitor), so the picture -# fills the screen without black bars, with prompts = xbox or pc too (on an install by an older setup, which built the -# Xbox prompts for 16:9 only, prompts = xbox keeps 1920x1080). +# shapes of the connected displays and of this setting; at a shape it has none for, the game draws the largest 16:9 size +# that fits inside it with bars and makes the layout in the background for the next start (a source build: make it with +# tools/make_romfs_patches.py --aspect WxH). A shape narrower than 16:9 keeps the width of the 16:9 view and shows more +# above and below (vert_plus). Portrait shapes and shapes outside 4:3..32:9 draw 16:9 with bars. Read at start. Default: +# 1920x1080, or on a primary display of 21:9, 32:9, 16:10, 3:2 or 4:3 the smallest size of that shape at least 1080 high +# that fits the display (1920x1280 on a 3:2 laptop, 2560x1080 on a 21:9 monitor), so the picture fills the screen +# without black bars, with prompts = xbox or pc too (on an install by an older setup, which built the Xbox prompts for +# 16:9 only, prompts = xbox keeps 1920x1080). # output_res = 1920x1080 # HUD width on a game resolution wider than 16:9: full, the default, puts the HUD at the screen's left and right edges; # 21:9 keeps it within the middle 21:9 of the screen and 16:9 within the middle 16:9 (the game's own HUD), so the