From 13b4b0ca9b0f8c83dcb059a3eac04977bac4cd95 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:50:55 +0100 Subject: [PATCH 1/8] Lay the UI out for any screen shape from 4:3 to 32:9, and offer 4:3 and phone sizes (#632, #1453) A game resolution whose shape the fifteen listed sizes did not cover (13:6 on a phone streamed to, 4:3) drew 16:9 with bars: neither the setup's Shapes step (installer/screens.py shape_size) nor the game's background generator (runtime/romfs.c romfs_folders_prepare) made a layout for it, though tools/ultrawide_layout.py handles any aspect ratio and runtime/romfs.c overlay_init already loads a folder of the exact size. cfg.c cfg_shape_size and screens.py shape_size now give an unlisted shape from 4:3 to 32:9 its own size, so both make romfs-patches-x for it; a display of an unlisted shape still keeps the 1920x1080 default and gets no folder. The list gains 4:3 (1440x1080, 1600x1200, 2048x1536, 2732x2048) and 19.5:9 and 20:9 phone sizes (2340x1080, 3120x1440, 2400x1080, 3200x1440), in the menu's game resolution row too. Co-Authored-By: Claude Opus 5.5 --- docs/installer.md | 4 +++- installer/screens.py | 32 ++++++++++++++++++++++++-------- runtime/cfg.c | 19 ++++++++++++++++--- runtime/cfg.h | 5 +++-- runtime/cfg_probe.c | 14 +++++++++++--- runtime/ui/menu.cpp | 13 ++++++++----- tests/installer_test.py | 11 +++++++++-- totk.ini.example | 20 +++++++++++--------- 8 files changed, 85 insertions(+), 33 deletions(-) diff --git a/docs/installer.md b/docs/installer.md index ac0388ac..9953c60a 100644 --- a/docs/installer.md +++ b/docs/installer.md @@ -109,7 +109,9 @@ loads the saves 1.4.3 wrote. file but the UI archive; for `pc` with the same `--binds` as the PC prompts step, whose key the step follows). The shapes are those of every connected display (Windows: `EnumDisplayDevices`; Linux: `xrandr`, else the DRM connectors), of the `output_res` the game defaults to on each, and of the `totk.ini` `output_res` (`installer/screens.py`). One folder per shape, named after the shape's size in `ASPECT_SIZES` (the - closest within 1%; `5120x2160` uses `2560x1080`); `runtime/romfs.c` `overlay_init` maps the game resolution the + closest within 1%; `5120x2160` uses `2560x1080`), or for an unlisted shape from 4:3 to 32:9 its own size (a + `totk.ini` `output_res` of `2560x1200`, say; a display of an unlisted shape gets none, as the game keeps 1920x1080 + there); `runtime/romfs.c` `overlay_init` maps the game resolution the same way, and a folder of the exact size from an older setup still wins. A 16:9 player gets none. The step runs again when the displays, the prompts or the patches change. At a game resolution whose shape has no folder the game draws 16:9 with bars and starts the generator itself, in the background, for the next start: at start and diff --git a/installer/screens.py b/installer/screens.py index 8b96e349..99cccbef 100644 --- a/installer/screens.py +++ b/installer/screens.py @@ -16,22 +16,28 @@ from pathlib import Path # The game resolutions of another shape than 16:9 that runtime/ui/menu.cpp row_output_res lists, in the order of # 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) +# 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', '1280x800', '1680x1050', '1920x1200', '2560x1600', - '1920x1280', '2160x1440', '2256x1504', '2880x1920', '3000x2000') + '1920x1280', '2160x1440', '2256x1504', '2880x1920', '3000x2000', + '1440x1080', '1600x1200', '2048x1536', '2732x2048', + '2340x1080', '3120x1440', '2400x1080', '3200x1440') SHAPED = tuple(tuple(int(v) for v in s.split('x')) for s in ASPECT_SIZES) TOLERANCE = 0.01 # cfg.c and resolution.c res_is_16x9: shapes within 1% are the same +# cfg.c SHAPE_MIN / SHAPE_MAX: the aspect ratios a UI layout can be made for (tools/ultrawide_layout.py), 4:3 to 32:9 +SHAPE_MIN, SHAPE_MAX = 4 / 3 * 0.99, 32 / 9 * 1.01 def is_16x9(w, h): return abs((w / h) / (16 / 9) - 1) <= TOLERANCE -def shape_size(w, h): +def shape_size(w, h, listed=False): """The folder size of w x h's shape: of ASPECT_SIZES within 1% of its aspect ratio, the closest, the first of equal - ones (5120x2160 is 2560x1080's shape). None for 16:9 and for a shape the setup has no layout for. The same rule as - runtime/cfg.c cfg_shape_size.""" + ones (5120x2160 is 2560x1080's shape); another shape from 4:3 to 32:9 its own size (an output_res of a phone's + 3120x1440, say), unless listed. None for 16:9 and for a shape no layout can be made for (portrait, narrower than + 4:3, wider than 32:9). The same rule as runtime/cfg.c cfg_shape_size.""" if not w or not h or is_16x9(w, h): return None r, best, err = w / h, None, None @@ -39,7 +45,15 @@ def shape_size(w, h): e = abs(sw / sh / r - 1) if e <= TOLERANCE and (err is None or e < err): best, err = f'{sw}x{sh}', e - return best + if best or listed or not SHAPE_MIN <= r <= SHAPE_MAX: + return best + return f'{w}x{h}' + + +def size_order(size): + """Sort key: the ASPECT_SIZES order, then the sizes of unlisted shapes by width and height.""" + w, h = (int(v) for v in size.split('x')) + return (ASPECT_SIZES.index(size), 0, 0) if size in ASPECT_SIZES else (len(ASPECT_SIZES), w, h) def default_size(w, h): @@ -199,8 +213,10 @@ def wanted(dest, screens=None): text = '' sizes = set() for w, h in screens: + # A display of an unlisted shape keeps the 1920x1080 default (cfg.c screen_default): no folder for it unless + # output_res asks for its size. w, h = max(w, h), min(w, h) - sizes.add(shape_size(w, h)) + sizes.add(shape_size(w, h, listed=True)) d = default_size(w, h) if d: sizes.add(shape_size(*(int(v) for v in d.split('x')))) @@ -208,4 +224,4 @@ def wanted(dest, screens=None): if m: sizes.add(shape_size(int(m.group(1)), int(m.group(2)))) sizes.discard(None) - return sorted(sizes, key=ASPECT_SIZES.index), prompts_style(text) + return sorted(sizes, key=size_order), prompts_style(text) diff --git a/runtime/cfg.c b/runtime/cfg.c index 45d66eea..d8919a6a 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -410,12 +410,21 @@ static const unsigned SHAPED[][2] = { {3840, 1080}, {5120, 1440}, // 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) + {2340, 1080}, {3120, 1440}, {2400, 1080}, {3200, 1440}, // 19.5:9 and 20:9 (phones, streamed) }; +// The shapes a UI layout can be made for (tools/ultrawide_layout.py works on any aspect ratio between these): from 4:3 +// to 32:9, 1% either side. A shape between them that SHAPED does not list takes a folder of its own exact size. +#define SHAPE_MIN (4.0 / 3.0 * 0.99) +#define SHAPE_MAX (32.0 / 9.0 * 1.01) + // The folder size of w x h's shape: of SHAPED within 1% of its aspect ratio, the closest, the first of equal ones // (5120x2160 takes 2560x1080). The UI layout depends on the aspect ratio alone (tools/ultrawide_layout.py apply), so // the setup writes one romfs-patches-x per shape, named after this size (installer/screens.py shape_size, the -// same rule), and romfs.c overlay_init looks for it. 0 for 16:9 and for a shape without a layout. +// same rule), and romfs.c overlay_init looks for it. A shape SHAPED does not list but within SHAPE_MIN..SHAPE_MAX (a +// phone's 13:6 screen streamed to, say) is its own folder, w x h itself, which the setup and the game's background +// generator make as they make the listed ones. 0 for 16:9 and outside that range (portrait screens). int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]) { if (!w || !h) return 0; double r = (double)w / h, err = 0; @@ -425,8 +434,12 @@ int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]) { double e = fabs((double)SHAPED[i][0] / SHAPED[i][1] / r - 1); if (e <= 0.01 && (best < 0 || e < err)) best = i, err = e; } - if (best < 0) return 0; - out[0] = SHAPED[best][0], out[1] = SHAPED[best][1]; + if (best >= 0) { + out[0] = SHAPED[best][0], out[1] = SHAPED[best][1]; + return 1; + } + if (r < SHAPE_MIN || r > SHAPE_MAX) return 0; + out[0] = w, out[1] = h; return 1; } diff --git a/runtime/cfg.h b/runtime/cfg.h index 140a5b9e..93080b7d 100644 --- a/runtime/cfg.h +++ b/runtime/cfg.h @@ -23,8 +23,9 @@ unsigned cfg_version(void); int cfg_from_env(const char *name); // 1 when the player set name (the environment or totk.ini), 0 when cfg_get gives a device profile's default or NULL. int cfg_is_set(const char *name); -// The folder size of w x h's shape (cfg.c SHAPED: the closest aspect ratio within 1%, the first of equal ones), the -// one romfs-patches-x the setup writes for it. 0 for 16:9 and for a shape without a UI layout. +// The folder size of w x h's shape (cfg.c SHAPED: the closest aspect ratio within 1%, the first of equal ones; an +// unlisted shape from 4:3 to 32:9 keeps w x h), the one romfs-patches-x the setup writes for it. 0 for 16:9 and +// for a shape without a UI layout (portrait, narrower than 4:3, wider than 32:9). int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]); // The size output_res defaults to on this display (its shape, cfg.c screen_default) while the player set no // output_res, also when the default stays 1920x1080 because that shape lacks the prompts' folder. The generator the game diff --git a/runtime/cfg_probe.c b/runtime/cfg_probe.c index 3e7ec18a..fb23a735 100644 --- a/runtime/cfg_probe.c +++ b/runtime/cfg_probe.c @@ -357,7 +357,8 @@ int probe_cfg(void) { "prompts: the PlayStation folder puts A on the circle exactly when the layout puts A on the east button"); } // One folder per screen shape (cfg.c cfg_shape_size, installer/screens.py shape_size): the closest aspect ratio of - // SHAPED within 1%, the first of equal ones; 16:9 and unlisted shapes have none. + // SHAPED within 1%, the first of equal ones; an unlisted shape from 4:3 to 32:9 its own size; 16:9, portrait and + // shapes narrower than 4:3 none. unsigned sz[2] = {0, 0}; CHECK(cfg_shape_size(5120, 2160, sz) && sz[0] == 2560 && sz[1] == 1080, "shape: 5120x2160 takes 2560x1080's folder"); CHECK(cfg_shape_size(3440, 1440, sz) && sz[0] == 3440 && sz[1] == 1440, "shape: 3440x1440 keeps its own (0.8% off 2560x1080)"); @@ -365,8 +366,15 @@ int probe_cfg(void) { 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, "shape: 16:10, 3:2 and 32:9 take their first size"); - CHECK(!cfg_shape_size(1920, 1080, sz) && !cfg_shape_size(2560, 1440, sz) && !cfg_shape_size(1024, 768, sz), - "shape: none for 16:9 and 4:3"); + 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, + "shape: 4:3 and 19.5:9 take their first size"); + CHECK(cfg_shape_size(2560, 1200, sz) && sz[0] == 2560 && sz[1] == 1200 && cfg_shape_size(2000, 1080, sz) && + sz[0] == 2000 && sz[1] == 1080, + "shape: an unlisted shape between 4:3 and 32:9 keeps its own size"); + CHECK(!cfg_shape_size(1920, 1080, sz) && !cfg_shape_size(2560, 1440, sz) && !cfg_shape_size(1280, 1024, sz) && + !cfg_shape_size(1080, 1920, sz) && !cfg_shape_size(7680, 1440, sz), + "shape: none for 16:9, narrower than 4:3, portrait and wider than 32:9"); // romfs.c shaped_name: the exact size's folder (an older setup wrote every size) wins, else the shape's { char dir[1100], f[1200]; diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index e0973839..280a7692 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -571,15 +571,18 @@ 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 and the 3:2 screens of laptops and -// tablets (Surface, Framework; the camera and the HUD follow -// another shape, resolution.c res_init; the installer lays the HUD out for each, installer/steps.py ASPECT_SIZES), and -// the current value when it is another size. +// 32:9 monitor sizes, 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", "1280x800", "1680x1050", "1920x1200", "2560x1600", - "1920x1280", "2160x1440", "2256x1504", "2880x1920", "3000x2000"}; + "1920x1280", "2160x1440", "2256x1504", "2880x1920", "3000x2000", + "1440x1080", "1600x1200", "2048x1536", "2732x2048", + "2340x1080", "3120x1440", "2400x1080", "3200x1440"}; enum { N = sizeof vals / sizeof *vals }; char shown[N][32]; const char *names[N]; diff --git a/tests/installer_test.py b/tests/installer_test.py index 44201d08..04cff31b 100644 --- a/tests/installer_test.py +++ b/tests/installer_test.py @@ -1051,8 +1051,11 @@ 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))], - ['2560x1080', '3440x1440', '3840x1600', '1280x800', None, None]) + (1920, 1080), (1024, 768), (3120, 1440), (2560, 1200), + (1280, 1024), (1080, 1920), (7680, 1440))], + ['2560x1080', '3440x1440', '3840x1600', '1280x800', None, '1440x1080', '2340x1080', + '2560x1200', None, None, None]) + 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') @@ -1086,6 +1089,10 @@ class ShapesTest(unittest.TestCase): (['2560x1080', '3440x1440', '1280x800', '1920x1280'], 'pc')) self.assertEqual(screens.wanted(self.dest / 'none', [(2560, 1440)]), ([], None)) + def test_wanted_unlisted_output_res_gets_its_own_size(self): + (self.dest / 'totk.ini').write_text('output_res = 2560x1200\n') + self.assertEqual(screens.wanted(self.dest, [(2560, 1200), (1600, 1200)]), (['1440x1080', '2560x1200'], None)) + def test_layout_settings_keep_the_last_nonempty_value(self): for empty in ('', ' ', '""'): with self.subTest(empty=empty): diff --git a/totk.ini.example b/totk.ini.example index 2c2ef109..b5b98cc9 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -220,15 +220,17 @@ # 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. The installer -# prepares the UI layout for fifteen sizes: 2560x1080, 3440x1440, 3840x1600, 5120x2160 (21:9), 3840x1080, 5120x1440 -# (32:9), 1280x800, 1680x1050, 1920x1200, 2560x1600 (16:10), 1920x1280, 2160x1440, 2256x1504, 2880x1920 and 3000x2000 -# (3:2). For any other size, or a source build that has not made the layout, the game draws the largest 16:9 size that -# fits inside it (3440x1080 gives 1920x1080) and the present adds bars; build the layout with -# tools/make_romfs_patches.py --aspect WxH to use the full shape. Read at start. Default: 1920x1080, or on a primary -# display of one of those shapes the smallest of its sizes 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). +# 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 +# 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 game's vertical view, so it +# shows less at the sides; fov widens it. 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 From ce156ff76bcb48b1f1527b2aff102ae1f70061c3 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Tue, 24 Nov 2026 23:02:37 +0100 Subject: [PATCH 2/8] Keep the 16:9 width of the view at shapes narrower than 16:9 (vert_plus) (#632) The camera kept the game's vertical view angle at every shape, so 16:10, 3:2 and 4:3 showed less of the world at the sides than 16:9. res_fov_live now also multiplies the fov patch's factor by 2 atan(tan(v/2) k) / v, k = 16:9 over the aspect and v = 51.2 degrees, the game's default vertical angle measured from a 4:3 frame at fov 130 against 16:9 (scale 0.730). Measured after: 4:3 frames are 16:9 ones scaled by 0.752 (0.750 is exact), 16:10 by 1.000 (1.106 without). vert_plus = 0 keeps the game's vertical view; it multiplies with fov. Co-Authored-By: Claude Opus 5.5 --- runtime/cfg.c | 5 +++-- runtime/resolution.c | 43 ++++++++++++++++++++++++++++++++++--------- totk.ini.example | 9 +++++++-- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/runtime/cfg.c b/runtime/cfg.c index d8919a6a..2d89ca04 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -66,7 +66,7 @@ static const char *const known[] = { "SHADER_MEMO", "SHADOW", "SHADOW_DEFER", "SHADOW_RANGE", "SHADOW_RES", "SHADOW_SCALE", "SHADOW_SNAP", "SHARED_FONTS", "SHARPNESS", "SHOTS", "SHOTS_DIR", "SHUTTER_FIX", "SHOTS_FULL", "SKIP_CS", "SPEED_PROBE", "SPIN", "SPIN_HANDOFF_US", "SPLIT_DRAWS", "SPLIT_US", "STICK_DEADZONE", "STICK_SENS", "SWKBD_ANSWER", "SYNC_AHEAD", - "SWKBD_TEST", "TEST_OOM", "TEST_PAD", "TEST_PAD_RUMBLE_MS", "TEST_PREPARE_SHADERS", "TEX_ALIAS", "TEX_BLOCK_MIB", "TEX_HEAP_EXTRA_MB", "TEX_MEMO", "TEX_RELEASED_MIB", "TEX_VRAM_PRESSURE", "TIMER_1MS", "TRACE", "TXD_TRANSPOSE", "UBO_SNAPSHOT", "UB_OVERLAY", "UB_OVERLAY_OUT", "UPSCALER", "VB_USED", "VK_DYN_A2C", "VK_DYN_VERTEX", "VK_NO_FLOAT64", "VK_NO_HOST_IMPORT", + "SWKBD_TEST", "TEST_OOM", "TEST_PAD", "TEST_PAD_RUMBLE_MS", "TEST_PREPARE_SHADERS", "TEX_ALIAS", "TEX_BLOCK_MIB", "TEX_HEAP_EXTRA_MB", "TEX_MEMO", "TEX_RELEASED_MIB", "TEX_VRAM_PRESSURE", "TIMER_1MS", "TRACE", "TXD_TRANSPOSE", "UBO_SNAPSHOT", "UB_OVERLAY", "UB_OVERLAY_OUT", "UPSCALER", "VB_USED", "VERT_PLUS", "VK_DYN_A2C", "VK_DYN_VERTEX", "VK_NO_FLOAT64", "VK_NO_HOST_IMPORT", "VK_PRESENT", "VK_RECORDER", "VK_SSBO_ALIGN", "VK_SUBGROUP", "VK_SUBGROUP_PIN", "VK_VALIDATION", "VMA_BLOCK_MIB", "VOLUME", "VOLUME_MASK_BIAS", "VOLUME_MUSIC", "VOLUME_SFX", "VOLUME_VOICE", "VRAM_HEADROOM", "VRAM_LIMIT_MIB", "VS_OUTS", "WALK_KEY", "WALK_SCALE", "WB_EAGER", "WB_EXACT", "WB_FENCE_LIMIT", "WB_MERGE", "WINDOW_SIZE", "XLATE", "XLATE_ID", "XLATE_KEEP", "XLATE_PROCS", "ZSTD_CHECK", "ZSTD_NATIVE", @@ -81,7 +81,7 @@ static const struct { const char *key, *section; } sections[] = { {"FULLSCREEN", "display"}, {"WINDOW_SIZE", "display"}, {"PERF_OVERLAY", "display"}, {"VK_PRESENT", "display"}, {"GPU_INDEX", "display"}, {"OUTPUT_RES", "display"}, {"RENDER_SCALE", "display"}, {"UPSCALER", "display"}, {"HUD_WIDTH", "display"}, - {"SHARPNESS", "display"}, {"DYNAMIC_RES", "display"}, {"ASPECT", "display"}, {"MOVIE_ASPECT", "display"}, {"FOV", "display"}, {"ANISO", "display"}, + {"SHARPNESS", "display"}, {"DYNAMIC_RES", "display"}, {"ASPECT", "display"}, {"MOVIE_ASPECT", "display"}, {"FOV", "display"}, {"VERT_PLUS", "display"}, {"ANISO", "display"}, {"LOD_STEADY", "display"}, {"COLOR_PRESET", "display"}, {"COLOR_BRIGHTNESS", "display"}, {"COLOR_CONTRAST", "display"}, {"COLOR_SATURATION", "display"}, {"COLOR_GAMMA", "display"}, {"HDR", "display"}, {"HDR_PEAK_NITS", "display"}, {"HDR_GAME_NITS", "display"}, @@ -149,6 +149,7 @@ static const CfgMeta metas[] = { {"DLSS_CHAR_MASK", "65", "0|35|65|100", LIVE}, {"REFLEX", "off", "off|auto|on|boost", RESTART}, {"FXAA", "1", "0|1", LIVE}, {"LOD_STEADY", "0", "0|1", RESTART}, // sets steady {"ASPECT", "fit", "fit|stretch", LIVE}, {"MOVIE_ASPECT", "keep", "keep|stretch", LIVE}, {"FOV", "100", "70..140", LIVE}, + {"VERT_PLUS", "1", "0|1", LIVE}, // resolution.c res_fov_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 {"COLOR_PRESET", "default", "default|vivid|clarity|custom", LIVE}, {"COLOR_BRIGHTNESS", "0", "-30..30", LIVE}, diff --git a/runtime/resolution.c b/runtime/resolution.c index 465105c1..fd18b71c 100644 --- a/runtime/resolution.c +++ b/runtime/resolution.c @@ -44,6 +44,8 @@ #include "ov.h" #include "platform/platform.h" +static void vert_plus_init(double ratio_over_16x9); + #define BASE_W 1920 #define BASE_H 1080 #define SCENE_W 1600 @@ -643,6 +645,7 @@ void res_init(void) { memcpy(page + 56, &r, sizeof r); rt_patch_switch(aspect, 1); rt_log("resolution: camera aspect ratio %.4f (16:9 is %.4f)", ratio, game); + if (ratio < game) vert_plus_init(ratio / game); } } else { rt_patch_switch(aspect, 0); // the page holds no ratio @@ -673,25 +676,47 @@ int res_wants_wide_overlay(const unsigned out[2]) { // Field of view (TOTK_FOV, percent of the game's own, 70..140, live): the camera's vertical view angle times the factor // on page +60 (recomp/patches-v110.txt, patches-v121.txt and patches-v143.txt, set fov). The horizontal angle follows -// through the aspect ratio. 100 switches the set off, so the camera code is the game's own. Runs on a settings change -// (gfx_present.c window_settings_live), the first time at the first present. +// through the aspect ratio. A factor of 1 switches the set off, so the camera code is the game's own. Runs on a settings +// change (gfx_present.c window_settings_live), the first time at the first present. +// +// Vert+ (TOTK_VERT_PLUS, on by default): the camera keeps the game's vertical view angle at every shape, so a shape +// narrower than 16:9 (16:10, 3:2, 4:3) showed less of the world at the sides than 16:9 does. The factor is then also +// multiplied by the one that gives the game's default view the horizontal angle it has at 16:9: tan(v'/2) = tan(v/2) +// * (16/9) / aspect, so v' / v = 2 atan(tan(v/2) k) / v with k = 16:9 over the aspect. v is the game's default +// vertical angle, 51.2 degrees, measured on 1.4.3 at Lookout Landing: a 4:3 frame at TOTK_FOV=130 is a 16:9 frame of +// the same moment scaled by 0.730 about its middle (tan(v/2) / tan(1.3 v/2) = 0.730 gives v = 51.2). The patch scales +// the angle linearly, so a zoomed view (the bow, the scope) gets the same factor, a few percent short of the exact one. #define FOV_MIN 70 #define FOV_MAX 140 +#define VERT_PLUS_V (51.2 * 3.14159265358979 / 180) +static float vert_plus_k = 1; // set by res_init (vert_plus_init) for a camera narrower than 16:9 + +static void vert_plus_init(double ratio_over_16x9) { + double k = 1 / ratio_over_16x9, v = VERT_PLUS_V; + vert_plus_k = (float)(2 * atan(tan(v / 2) * k) / v); +} + void res_fov_live(void) { - static int set = -2, shown = 100; + static int set = -2, shown = 100, shown_vp = -1; if (set == -2) set = rt_patch_set("fov"); int pct = cfg_int("TOTK_FOV"); pct = pct < FOV_MIN ? FOV_MIN : pct > FOV_MAX ? FOV_MAX : pct; - if (pct == shown) return; - shown = pct; + int vp = vert_plus_k != 1 && cfg_bool("TOTK_VERT_PLUS"); + if (pct == shown && vp == shown_vp) return; + shown = pct, shown_vp = vp; if (set < 0) { - rt_log("resolution: this game version has no field-of-view patch; TOTK_FOV=%d does nothing", pct); + if (pct != 100 || vp) + rt_log("resolution: this game version has no field-of-view patch; TOTK_FOV=%d and Vert+ do nothing", pct); return; } - float k = pct / 100.0f; + float k = pct / 100.0f * (vp ? vert_plus_k : 1); memcpy((uint8_t *)rt_patch_page() + 60, &k, sizeof k); // before the switch: a site that sees it on reads k - rt_patch_switch(set, pct != 100); - rt_log("resolution: field of view %d%% of the game's", pct); + rt_patch_switch(set, k != 1); + if (vp) + rt_log("resolution: field of view %d%% of the game's, times %.4f for Vert+ (the 16:9 width at this narrower " + "shape)", pct, vert_plus_k); + else + rt_log("resolution: field of view %d%% of the game's", pct); } // TOTK_DYNAMIC_RES = 0 holds the game's dynamic resolution at 100 % (patches-v110.txt, patches-v121.txt and patches-v143.txt, diff --git a/totk.ini.example b/totk.ini.example index b5b98cc9..d838e4c5 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -225,8 +225,8 @@ # 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 game's vertical view, so it -# shows less at the sides; fov widens it. Portrait shapes and shapes outside 4:3..32:9 draw 16:9 with bars. Read at +# 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 @@ -265,6 +265,11 @@ # Field of view, in percent of the game's own: 70 to 140, 100 (the default) leaves the camera as it is. Higher shows # more of the world around Link. Game versions 1.1.0, 1.2.1 and 1.4.3. Changes while the game runs take effect at once. # fov = 100 +# Vert+ at a game resolution narrower than 16:9 (16:10, 3:2, 4:3): 1, the default, widens the camera's vertical view +# so the picture shows as much of the world at the sides as 16:9 does, and more above and below. 0: the game's own +# vertical view at every shape, so a narrower shape shows less at the sides. Multiplies with fov. Changes while the +# game runs take effect at once. +# vert_plus = 1 # Anisotropic filtering of surface textures: game (the level the game asks for, as on the Switch) or 2, 4, 8, 16. Keeps # ground, roads and walls seen at a shallow angle sharp into the distance. Only filtered, mipmapped textures that tile # are raised; shadow maps, data maps and screen-sized buffers keep the game's setting. Read at start. 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 3/8] 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 From 66bb3c749aba483637e427f02e6ac1df94182f62 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Tue, 24 Nov 2026 23:30:47 +0100 Subject: [PATCH 4/8] Keep the Purah Pad frame's width and an unstretched loading map at wide shapes AppMenuOverlay_00 keeps a full-width root, so the stone and light pieces of the map's side frame (N_Frame_00, P_Frame{L,R}*) were stretched across a 21:9 or 32:9 screen; they now take scale k at the edges. The loading screen widened N_Base_00 back to the screen, which stretched the map capture inside it; instead the capture panes and their pictures get a size of 1920/k - 450 (1470 at 16:9), so more map shows unstretched, and the side panel stays at the right edge at its own width. The map's cut and backing panes (AppMap_00 N_Cut_00 and the others) take 2250/k as a size. ultrawide_layout.py gains the pane width field (+76); tests/hud_layout_test.py leaves these three layouts out of its byte comparison with the older implementation. Co-Authored-By: Claude Opus 5.5 --- tests/hud_layout_test.py | 5 +++++ tools/ultrawide_layout.py | 33 ++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/tests/hud_layout_test.py b/tests/hud_layout_test.py index 7e45efd8..1a925264 100644 --- a/tests/hud_layout_test.py +++ b/tests/hud_layout_test.py @@ -156,6 +156,11 @@ class RealArchiveTest(unittest.TestCase): ui.apply(full, members, width, height) expected = bytearray(original) baseline['apply'](expected, members, width, height) + # The map, the Purah Pad's frame and the loading screen changed on purpose after it (the map and the + # loading map fill the screen, the frame keeps its width); every other layout is still byte for byte. + for name in ('AppMap_00', 'AppMenuOverlay_00', 'LoadingFade_00'): + lo, hi = members[f'blyt/{name}.bflyt'] + expected[lo:hi] = full[lo:hi] self.assertEqual(full, expected) for cap, extension in ((16 / 9, 0), (21 / 9, 300)): data = bytearray(original) diff --git a/tools/ultrawide_layout.py b/tools/ultrawide_layout.py index b92e8d3b..12e237d0 100644 --- a/tools/ultrawide_layout.py +++ b/tools/ultrawide_layout.py @@ -15,9 +15,10 @@ and every pane field and animation key holds the value the edit expects before i import math import struct -# BFLYT pane sections (pan1, pic1, txt1, ...): name at +12 (24 bytes), translate x / y at +44 / +48, scale x / y at +68 / +72. +# BFLYT pane sections (pan1, pic1, txt1, ...): name at +12 (24 bytes), translate x / y at +44 / +48, scale x / y at +68 / +72, +# size (width) at +76. PANE_MAGICS = (b'pan1', b'pic1', b'txt1', b'wnd1', b'bnd1', b'prt1', b'ali1', b'scr1') -FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72} +FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72, 'w': 76} # Full-screen layouts whose root pane stays as wide as the canvas. KEEP_ROOT = {'AppMenuBG_00', 'PauseMenuBG_00', 'ShopMenuParasailBG_00', 'ShortCutBG_00', 'TitleMenuBG_00', 'EventFade_00', @@ -72,6 +73,12 @@ def edits(k, hud_aspect): ('AppAlbum_00', 'N_FadeInOut_00', 'scale_x', k), ('AppAlbum_00', 'N_Open_01', 'scale_x', wide), *[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_x', wide) for i in range(4)], ('AppMap_00', 'N_MiniMap_00', 'x', -270 * (1 - k)), + # The map: the panes that cut it out and its black backing are 2250 wide, so under the 16:9 root the world map + # ended short of the screen's sides and black bars showed there. They take the screen's width in the root's + # units instead (a size, not a scale: the map inside keeps its proportions and more of it shows), and so do the + # icon area and the shadow frame over it. + *[('AppMap_00', pane, 'w', 2250 / k) for pane in ('N_Cut_00', 'N_Capture_00', 'Black8_01', 'N_Cut_01', + 'P_MapCapture_00', 'N_Cut_02', 'N_IconArea_00', 'W_Shadow_00')], ('AppMenuOverlay_00', 'N_FadeInOut_00', 'scale_x', k), ('AppMenuOverlay_00', 'N_FadeInOut_01', 'scale_x', k), ('AppMenuOverlay_00', 'N_Icon_00', 'scale_x', k), ('AppMenuOverlay_00', 'N_TitleOne_01', 'scale_x', k), ('AppOpenDemoWindow_00', 'P_BG_00', 'scale_x', wide), ('AutoBuilder_00', 'N_BG_00', 'scale_x', wide), @@ -83,12 +90,17 @@ def edits(k, hud_aspect): ('CameraSystemWindow_00', 'T_Text_00', 'scale_x', k), ('ChallengeLog_00', 'C_CaptureUp_00', 'x', OFF), ('ChallengeLog_00', 'C_CaptureUp_01', 'x', OFF), ('GameOver_00', 'P_BG_00', 'scale_x', wide), - ('LoadingFade_00', 'N_Base_00', 'scale_x', wide), ('LoadingFade_00', 'N_Logo_00', 'x', w), + # The loading screen: the map on the left runs from the screen's left edge to under the side panel, which stays + # at the right edge at its own width. The map's capture panes and their pictures get the wider size (1470 at + # 16:9: the screen's 1920 less 450), so more of the map shows instead of a stretched one; the backgrounds and + # the bar span the screen. + ('LoadingFade_00', 'N_Logo_00', 'x', w), ('LoadingFade_00', 'N_Status_00', 'x', w), ('LoadingFade_00', 'N_Tips_00', 'x', -w), - ('LoadingFade_00', 'P_BG_00', 'scale_x', wide), ('LoadingFade_00', 'P_SideBGDeco_00', 'scale_x', k), - ('LoadingFade_00', 'Pa_IconPlayer_00', 'scale_x', k), ('LoadingFade_00', 'Pa_LargeDungeonMap_00', 'scale_x', k), - ('LoadingFade_00', 'Pa_LargeDungeonMap_01', 'scale_x', k), ('LoadingFade_00', 'Pa_Map_00', 'scale_x', k), - ('LoadingFade_00', 'Pa_Map_01', 'scale_x', k), + ('LoadingFade_00', 'P_BG_00', 'scale_x', wide), ('LoadingFade_00', 'P_BG_01', 'scale_x', wide), + ('LoadingFade_00', 'P_Grid_00', 'scale_x', wide), ('LoadingFade_00', 'P_Bar_00', 'scale_x', wide), + *[('LoadingFade_00', pane, 'w', 1920 / k - 450) for pane in ('C_CaptureMap_00', 'C_CaptureMap_01', + 'P_CaptureMap_00', 'P_CaptureMap_01')], + ('LoadingFade_00', 'W_SideBGDeco_00', 'x', 960 / k), ('LoadingFade_00', 'P_SideBGDeco_00', 'x', 960 / k), ('MessageLog_01', 'P_Capture_00', 'scale_x', wide), ('OwnedHorseList_00', 'N_BG_00', 'scale_x', wide), ('PaCommonBtnTitle_00', 'B_Hit_00', 'x', OFF), ('PaCommonBtnTitle_00', 'N_Cursor_00', 'x', OFF), ('PaLargeDungeonMap_00', 'P_BG_00', 'scale_x', wide), ('PaMessageBtn_00', 'B_Hit_00', 'x', OFF), @@ -99,6 +111,13 @@ def edits(k, hud_aspect): *[e for pane, x, _ in BALLOON_PART for e in (('PaBalloonMessage_00', pane, 'scale_x', k), ('PaBalloonMessage_00', pane, 'x', x * k))], ] + # The Purah Pad's frame (map, album, ...): AppMenuOverlay_00 keeps a root as wide as the screen, so the stone and + # light pieces at its left and right edges (x = -960 / 960, anchored at their outer side) were stretched with it. + # They keep their own width at the edges. + out += [('AppMenuOverlay_00', f'P_Frame{side}{part}', 'scale_x', k) for side in 'LR' + for part in ('Core_00', 'AlbNrm_00', 'Light_00', 'EdgeFast_00', 'EdgeSlow_00', 'EdgeFastGlow_00', + 'EdgeSlowGlow_00')] + out += [('AppMenuOverlay_00', f'P_Frame{side}Dent_0{i}', 'scale_x', k) for side in 'LR' for i in (0, 1)] # Menus framed by two side decorations, a header and a background: the frame stays at the screen's edges. for layout, deco in (('PauseMenuOverlay_00', 'P_Deco{}_00'), ('SystemLoadList_00', 'P_Deco{}_00'), ('SystemOption_00', 'P_Deco{}_00'), ('SystemSaveLoad_00', 'P_Deco{}_00')): From 9932ac2892cafd14d7adb5f8293f104a2cadb958 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Tue, 24 Nov 2026 23:47:01 +0100 Subject: [PATCH 5/8] Fill wide screens with the map and the loading screen instead of black bars The full map's width was held at 2250 by AppMap_00_MiniMap's size keys (they win over the layout's sizes): wide_anim sets them to 2250 / k, so the map is drawn across a 32:9 screen; the layer tabs and the time and position move to the screen's edges. The loading map is a capture of the 3 x 3 world map tiles of 840 units around the player's tile (TOTK_DUMP: nine 840x840 tile draws into the capture), so a capture wider than about 1680 shows black where the player stands near a tile's edge: loading_map keeps it at most 1660 wide from the screen's left edge, moves the map's slide keys (LoadingFade_00_BarIn and BarOut) with it, and widens the side panel, a window whose frame keeps its proportions, to the screen's right edge. Co-Authored-By: Claude Opus 5.5 --- tests/hud_layout_test.py | 10 +++--- tools/ultrawide_layout.py | 75 ++++++++++++++++++++++++++++++++++----- 2 files changed, 73 insertions(+), 12 deletions(-) diff --git a/tests/hud_layout_test.py b/tests/hud_layout_test.py index 1a925264..e7ee56ba 100644 --- a/tests/hud_layout_test.py +++ b/tests/hud_layout_test.py @@ -156,10 +156,12 @@ class RealArchiveTest(unittest.TestCase): ui.apply(full, members, width, height) expected = bytearray(original) baseline['apply'](expected, members, width, height) - # The map, the Purah Pad's frame and the loading screen changed on purpose after it (the map and the - # loading map fill the screen, the frame keeps its width); every other layout is still byte for byte. - for name in ('AppMap_00', 'AppMenuOverlay_00', 'LoadingFade_00'): - lo, hi = members[f'blyt/{name}.bflyt'] + # The map (its layout and the minimap animation's width keys), the Purah Pad's frame and the loading screen + # changed on purpose after it (the maps fill the screen, the frame keeps its width); the rest is byte for byte. + for member in ('blyt/AppMap_00.bflyt', 'blyt/AppMenuOverlay_00.bflyt', 'blyt/LoadingFade_00.bflyt', + 'anim/AppMap_00_MiniMap.bflan', 'anim/LoadingFade_00_BarIn.bflan', + 'anim/LoadingFade_00_BarOut.bflan'): + lo, hi = members[member] expected[lo:hi] = full[lo:hi] self.assertEqual(full, expected) for cap, extension in ((16 / 9, 0), (21 / 9, 300)): diff --git a/tools/ultrawide_layout.py b/tools/ultrawide_layout.py index 12e237d0..4c24f36b 100644 --- a/tools/ultrawide_layout.py +++ b/tools/ultrawide_layout.py @@ -61,6 +61,22 @@ def hud_extent(k, hud_aspect): inner = 1 / ((16 / 9) / hud_aspect) - 1 # 1 / kc - 1 return 960 * inner, 960 * k * inner +# The loading screen's map is a capture of the world map that the game draws as the 3 x 3 tiles of 840 units around the +# player's tile (measured with TOTK_DUMP at 3840x1080: nine 840x840 tile draws into the capture), so only 840 units +# either side of the player are certain to hold map; wider, the capture shows black beside the tiles where the player +# stands near a tile's edge. At 16:9 it is 1470 wide (the screen's 1920 less 450), its left edge 23 units past the +# screen's, and the side panel (a window, so its frame keeps its proportions at any width) covers its right 237 units. +LOADING_MAP_MAX = 1660 + +def loading_map(k): + """(width, shift, panel width) of the loading screen's map capture and side panel for k = 16:9 over the aspect: the + map as wide as the screen allows up to LOADING_MAP_MAX, its left edge where 16:9 has it relative to the screen's + edge (shift: how far its centre moves from x -248), and the panel from the map's right part to the screen's edge.""" + width = min(1920 / k - 450, max(1470, LOADING_MAP_MAX)) + centre = -960 / k - 23 + width / 2 + panel = 960 / k - (centre + width / 2 - 237) + return width, centre + 248, panel + def edits(k, hud_aspect): """(layout, pane, field, value) for the aspect: k = 16/9 over the aspect (the root's scale), w = how far a 1920-wide layout's edge moves out in its own units (960 * (1 / k - 1)). OFF moves a pane out of sight. hud_aspect: the @@ -72,7 +88,9 @@ def edits(k, hud_aspect): out = [ ('AppAlbum_00', 'N_FadeInOut_00', 'scale_x', k), ('AppAlbum_00', 'N_Open_01', 'scale_x', wide), *[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_x', wide) for i in range(4)], - ('AppMap_00', 'N_MiniMap_00', 'x', -270 * (1 - k)), + # With the map as wide as the screen, the layer tabs go to its left edge and the time, temperature and + # position to its right edge, as at 16:9 (neither position is animated; AppMap_00_MiniMap keys their visibility). + ('AppMap_00', 'N_MiniMap_00', 'x', -w), ('AppMap_00', 'N_AllMapTime_00', 'x', w), # The map: the panes that cut it out and its black backing are 2250 wide, so under the 16:9 root the world map # ended short of the screen's sides and black bars showed there. They take the screen's width in the root's # units instead (a size, not a scale: the map inside keeps its proportions and more of it shows), and so do the @@ -90,17 +108,17 @@ def edits(k, hud_aspect): ('CameraSystemWindow_00', 'T_Text_00', 'scale_x', k), ('ChallengeLog_00', 'C_CaptureUp_00', 'x', OFF), ('ChallengeLog_00', 'C_CaptureUp_01', 'x', OFF), ('GameOver_00', 'P_BG_00', 'scale_x', wide), - # The loading screen: the map on the left runs from the screen's left edge to under the side panel, which stays - # at the right edge at its own width. The map's capture panes and their pictures get the wider size (1470 at - # 16:9: the screen's 1920 less 450), so more of the map shows instead of a stretched one; the backgrounds and - # the bar span the screen. + # The loading screen: the map starts at the screen's left edge and the side panel ends at its right edge, each + # unstretched. See loading_map for the widths. ('LoadingFade_00', 'N_Logo_00', 'x', w), ('LoadingFade_00', 'N_Status_00', 'x', w), ('LoadingFade_00', 'N_Tips_00', 'x', -w), ('LoadingFade_00', 'P_BG_00', 'scale_x', wide), ('LoadingFade_00', 'P_BG_01', 'scale_x', wide), ('LoadingFade_00', 'P_Grid_00', 'scale_x', wide), ('LoadingFade_00', 'P_Bar_00', 'scale_x', wide), - *[('LoadingFade_00', pane, 'w', 1920 / k - 450) for pane in ('C_CaptureMap_00', 'C_CaptureMap_01', - 'P_CaptureMap_00', 'P_CaptureMap_01')], - ('LoadingFade_00', 'W_SideBGDeco_00', 'x', 960 / k), ('LoadingFade_00', 'P_SideBGDeco_00', 'x', 960 / k), + *[('LoadingFade_00', pane, 'w', loading_map(k)[0]) for pane in ('C_CaptureMap_00', 'C_CaptureMap_01', + 'P_CaptureMap_00', 'P_CaptureMap_01')], + ('LoadingFade_00', 'N_Map_00', 'x', -248 + loading_map(k)[1]), + ('LoadingFade_00', 'W_SideBGDeco_00', 'x', 960 / k), ('LoadingFade_00', 'W_SideBGDeco_00', 'w', loading_map(k)[2]), + ('LoadingFade_00', 'P_SideBGDeco_00', 'x', 960 / k), ('MessageLog_01', 'P_Capture_00', 'scale_x', wide), ('OwnedHorseList_00', 'N_BG_00', 'scale_x', wide), ('PaCommonBtnTitle_00', 'B_Hit_00', 'x', OFF), ('PaCommonBtnTitle_00', 'N_Cursor_00', 'x', OFF), ('PaLargeDungeonMap_00', 'P_BG_00', 'scale_x', wide), ('PaMessageBtn_00', 'B_Hit_00', 'x', OFF), @@ -219,6 +237,45 @@ def anim_keys(blarc, lo, pane, tag, target): pos += size return out +FLPA_SIZE_X = 8 # BFLAN FLPA target: the pane's width + +# The map's panes that AppMap_00_MiniMap sizes: in the full map they hold the width 2250 in its keys (the minimap +# shrinks them), and the animation's keys win over the layout's size, so a wider screen still cut the map at 2250. +MAP_SIZED = ('N_IconArea_00', 'N_Cut_00', 'N_Capture_00', 'P_MapCapture_00', 'Black8_01', 'N_Cut_01', 'N_Cut_02') + +def wide_anim(blarc, members, k, changed): + """The animation keys that hold the full map's width, for a canvas wider than 16:9: 2250 becomes 2250 / k, the + screen's width in the 16:9 root's units plus the same margin, as edits() does for the layout's sizes.""" + member = 'anim/AppMap_00_MiniMap.bflan' + if member not in members: raise SystemExit(f'AppMap_00_MiniMap: no animation {member} in the archive') + lo = members[member][0] + if blarc[lo:lo + 4] != b'FLAN': return # tests/hud_layout_test.py's synthetic archive: fixed-offset keys only + found = 0 + for pane in MAP_SIZED: + for keys in anim_keys(blarc, lo, pane, b'FLPA', FLPA_SIZE_X): + for key in keys: + if abs(struct.unpack_from('= 1e-4: raise SystemExit(f'{anim} +{offset}: {have}, expected {shipped}') struct.pack_into(' Date: Wed, 25 Nov 2026 07:43:23 +0100 Subject: [PATCH 6/8] List ultrawide monitors and the other screen shapes in the README's features Co-Authored-By: Claude Opus 5.5 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06260a41..90ea7d17 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,12 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md). modes as DLSS: for FSR 4 the setup downloads AMD's signed FSR SDK libraries (github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, AMD FSR SDK license), ticked by default with an AMD GPU - HDR10 output with peak, game and HUD brightness settings -- 16:10 (Steam Deck, handhelds), 3:2 (Surface, Framework), 21:9 and 32:9 (ultrawide) game resolutions, with the camera and the interface in that shape +- Ultrawide monitors, 21:9 and 32:9 (2560x1080, 3440x1440, 3840x1600, 5120x2160, 3840x1080, 5120x1440, 7680x2160): + the camera sees the whole width, the map and the loading screen fill it without bars or stretching, and the HUD sits + at the screen's edges or in the middle 21:9 or 16:9 (`hud_width`) +- Other screen shapes from 4:3 to 32:9, each with the camera and the interface in that shape: 16:10 (Steam Deck, + handhelds), 3:2 (Surface, Framework), 4:3 (iPads, CRT monitors) and phones (19.5:9, 20:9) for streaming; on shapes + narrower than 16:9 the view keeps the 16:9 width (Vert+) - Anisotropic texture filtering up to 16x, for sharp ground into the distance - In-game settings menu (F1) and performance overlay (F10) - Play time across runs on the Game tab of the settings menu, kept in `playtime.txt` next to the saves From f51308cb8fd96a39161a046989676d7a0b2eb3f2 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Wed, 25 Nov 2026 07:58:40 +0100 Subject: [PATCH 7/8] Fill shapes narrower than 16:9 with the map instead of black above and below it AppMap_00's capture, cut, backing and shadow panes are 1080 high, the height of a 16:9 layout, in the layout and in the full map's keys of AppMap_00_MiniMap, which win over the layout's sizes. On a 4:3 or 16:10 canvas they now take the screen's height, 1080 / k, so the map reaches the Purah Pad frame at the top and bottom. Co-Authored-By: Claude Opus 5.5 --- tools/ultrawide_layout.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/ultrawide_layout.py b/tools/ultrawide_layout.py index 4c24f36b..095961b5 100644 --- a/tools/ultrawide_layout.py +++ b/tools/ultrawide_layout.py @@ -18,7 +18,7 @@ import struct # BFLYT pane sections (pan1, pic1, txt1, ...): name at +12 (24 bytes), translate x / y at +44 / +48, scale x / y at +68 / +72, # size (width) at +76. PANE_MAGICS = (b'pan1', b'pic1', b'txt1', b'wnd1', b'bnd1', b'prt1', b'ali1', b'scr1') -FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72, 'w': 76} +FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72, 'w': 76, 'h': 80} # Full-screen layouts whose root pane stays as wide as the canvas. KEEP_ROOT = {'AppMenuBG_00', 'PauseMenuBG_00', 'ShopMenuParasailBG_00', 'ShortCutBG_00', 'TitleMenuBG_00', 'EventFade_00', @@ -176,6 +176,10 @@ def tall_edits(k): *[('LoadingFade_00', p, 'scale_y', k) for p in ('Pa_IconPlayer_00', 'Pa_LargeDungeonMap_00', 'Pa_LargeDungeonMap_01', 'Pa_Map_00', 'Pa_Map_01')], *[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_y', tall) for i in range(4)], + # The map's capture, its cut, backing and shadow are 1080 high, the height of a 16:9 layout: they take the + # screen's height, 1080 / k, so the map fills it instead of leaving black above and below (tall_anim + # does the same for the keys of AppMap_00_MiniMap that hold 1080) + *[('AppMap_00', pane, 'h', 1080 * tall) for pane in MAP_TALL + ('W_Shadow_00',)], *[(layout, 'P_BG_00', 'scale_y', tall) for layout in ('AppOpenDemoWindow_00', 'GameOver_00', 'LoadingFade_00', 'PaLargeDungeonMap_00', 'PaRecipeCardList_00')], ('LoadingFade_00', 'N_Base_00', 'scale_y', tall), @@ -243,6 +247,10 @@ FLPA_SIZE_X = 8 # BFLAN FLPA target: the pane's width # shrinks them), and the animation's keys win over the layout's size, so a wider screen still cut the map at 2250. MAP_SIZED = ('N_IconArea_00', 'N_Cut_00', 'N_Capture_00', 'P_MapCapture_00', 'Black8_01', 'N_Cut_01', 'N_Cut_02') +# The map's panes that hold the 16:9 layout's height, 1080, in the layout and in the full map's keys of AppMap_00_MiniMap +MAP_TALL = ('N_Cut_00', 'N_Capture_00', 'P_MapCapture_00', 'Black8_01') +FLPA_SIZE_Y = 9 # BFLAN FLPA target: the pane's height + def wide_anim(blarc, members, k, changed): """The animation keys that hold the full map's width, for a canvas wider than 16:9: 2250 becomes 2250 / k, the screen's width in the 16:9 root's units plus the same margin, as edits() does for the layout's sizes.""" @@ -297,6 +305,13 @@ def tall_anim(blarc, members, k, changed): abs(get(k1 + 4) + 360) < 1e-3 and get(k1 + 8) == 0): raise SystemExit(f'AppMap_00_MiniMap {pane}: not a line from 0 to y -360') put(k0 + 8, -(360 + h)), put(k1 + 4, -(360 + h)) + # The full map's height keys hold 1080 (the minimap shrinks the panes), and they win over the layout's sizes + found = 0 + for pane in MAP_TALL: + for keys in anim_keys(blarc, lo, pane, b'FLPA', FLPA_SIZE_Y): + for key in keys: + if abs(get(key + 4) - 1080) < 1e-3: put(key + 4, 1080 / k); found += 1 + if found < len(MAP_TALL): raise SystemExit(f'AppMap_00_MiniMap: {found} height keys of 1080, expected at least {len(MAP_TALL)}') # The large place name of a discovery holds its height (285, then 260) in flat keys; they move to the top edge. curves = anim_keys(blarc, anim('Location_00_IsDiscovery'), 'N_Large_00', b'FLPA', FLPA_Y) values = [get(key + 4) for keys in curves for key in keys] From c03fffd7cdc28f8d059303f6e87309d588a480fc Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Wed, 25 Nov 2026 11:29:22 +0100 Subject: [PATCH 8/8] Give the camera's album window the screen's shape and keep the inn's clock under its choices at shapes narrower than 16:9 The "save to the album?" window showed a 4:3 or 16:10 photo in a 16:9 frame, stretched across: N_FirstOut_00's scale_y k, there for the compendium's square photos, also undid N_InOut_00's taller frame for the album photo under it. The scale goes on N_PictureBook_00 and the album's question and buttons (N_AlbumCon_00) instead, and those move out by the frame's extra half height. The clock of an inn's choices (Time_00) stayed in the middle 16:9 while MessageDialog_00 went to the bottom edge, so it covered the last choices; it goes to the bottom edge too. Co-Authored-By: Claude Opus 5.5 --- tests/hud_layout_test.py | 4 +++- tools/ultrawide_layout.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/hud_layout_test.py b/tests/hud_layout_test.py index e7ee56ba..3e11a948 100644 --- a/tests/hud_layout_test.py +++ b/tests/hud_layout_test.py @@ -157,8 +157,10 @@ class RealArchiveTest(unittest.TestCase): expected = bytearray(original) baseline['apply'](expected, members, width, height) # The map (its layout and the minimap animation's width keys), the Purah Pad's frame and the loading screen - # changed on purpose after it (the maps fill the screen, the frame keeps its width); the rest is byte for byte. + # changed on purpose after it (the maps fill the screen, the frame keeps its width, the camera's album window + # has the screen's shape, the inn's clock follows the choices to the bottom edge); the rest is byte for byte. for member in ('blyt/AppMap_00.bflyt', 'blyt/AppMenuOverlay_00.bflyt', 'blyt/LoadingFade_00.bflyt', + 'blyt/CameraSystemWindow_00.bflyt', 'blyt/Time_00.bflyt', 'anim/AppMap_00_MiniMap.bflan', 'anim/LoadingFade_00_BarIn.bflan', 'anim/LoadingFade_00_BarOut.bflan'): lo, hi = members[member] diff --git a/tools/ultrawide_layout.py b/tools/ultrawide_layout.py index 095961b5..3e7d436b 100644 --- a/tools/ultrawide_layout.py +++ b/tools/ultrawide_layout.py @@ -172,7 +172,14 @@ def tall_edits(k): out = [('AppAlbum_00', 'N_FadeInOut_00', 'scale_y', k), ('AppAlbum_00', 'N_Open_01', 'scale_y', tall), *[('AppMenuOverlay_00', p, 'scale_y', k) for p in ('N_FadeInOut_00', 'N_FadeInOut_01', 'N_Icon_00', 'N_TitleOne_01')], - ('CameraPointer_00', 'N_Type_01', 'scale_y', k), ('CameraSystemWindow_00', 'N_FirstOut_00', 'scale_y', k), + ('CameraPointer_00', 'N_Type_01', 'scale_y', k), + # The camera's "save to the album?" window: N_InOut_00 takes the screen's height (below), so the photo's + # frame (N_AlbumPic_00) has the screen's shape, as the photo has. The compendium's square photos + # (N_PictureBook_00) and the album's question and buttons (N_AlbumCon_00) keep their proportions, and the + # question and the buttons move out by the frame's extra half height (319.5 of its 639). + *[('CameraSystemWindow_00', p, 'scale_y', k) for p in ('N_PictureBook_00', 'N_AlbumCon_00')], + ('CameraSystemWindow_00', 'T_TextAlbum_00', 'y', 380 + 319.5 * (tall - 1)), + *[('CameraSystemWindow_00', p, 'y', -396 - 319.5 * (tall - 1)) for p in ('Pa_BtnL_01', 'Pa_BtnR_01')], *[('LoadingFade_00', p, 'scale_y', k) for p in ('Pa_IconPlayer_00', 'Pa_LargeDungeonMap_00', 'Pa_LargeDungeonMap_01', 'Pa_Map_00', 'Pa_Map_01')], *[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_y', tall) for i in range(4)], @@ -198,7 +205,10 @@ def tall_edits(k): 'ShopMenu_00', 'SystemActionGuide_00') + SYSTEM_MENUS] out += [(name, 'RootPane', 'y', -540 * (1 - k)) for name in ( 'CtrlGuide_00', 'DoCommand_00', 'EnvironmentInfo_00', 'HorseGauge_00', 'MessageDialog_00', 'MessageLog_01', - 'PauseMenuOverlay_00', 'SaveLoadIcon_00', 'TreasureFullShortCut_00')] + 'PauseMenuOverlay_00', 'SaveLoadIcon_00', 'TreasureFullShortCut_00', + # the clock an inn's choices show (05:00) under MessageDialog_00's list: it stayed in the middle 16:9 and was + # drawn over the list's last rows + 'Time_00')] out += [('AppAlbum_00', 'N_PicLoad_01', 'y', -540 * (1 - k)), ('AppMap_00', 'N_AllMapTime_00', 'y', -h), ('AppMenuOverlay_00', 'A_Align_00', 'y', -(505 + h)), ('AppMenuOverlay_00', 'Pa_GuideLeft_00', 'y', -(505 + h)), ('AppMenuOverlay_00', 'N_TitleTab_00', 'y', 491 + h),