Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/debug-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ These work on both Metal and Vulkan unless noted.
| `LARECOMP_NO_FRAME_CLEAR` | 1 (Vulkan: 0 / 1) | Don't clear scene render targets at their first use each frame. On Vulkan the default is no clears on integrated GPUs. |
| `LARECOMP_TEX_FULLHASH` | 1 | Hash every texture in full each time instead of the faster partial checks. |
| `LARECOMP_NO_WIDESCREEN` | 1 | Turn the widescreen view off (16:9 framing everywhere). |
| `LARECOMP_HUD_EDGES` | 1 | The game's HUD at the window's edges, as General > HUD = At edges. |
| `LARECOMP_NO_HUD_CORNERS` | 1 | Keep the game's HUD in the centred 16:9 box, whatever General > HUD says. |
| `LARECOMP_NO_PAUSE_FILL` | 1 | Keep the pause screen's backdrop in the 16:9 box on other window shapes (the game shows around it). |
| `LARECOMP_WIDE_TEST` | ratio | Pretend the window has this shape, relative to 16:9 (e.g. `1.3125` for 21:9). |

Expand Down
22 changes: 14 additions & 8 deletions runtime/hle/hud_corners.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Every platform: how shown the game's own X / Y item buttons are (hud_xy_alpha, for the D-pad items' cross), and with
// D-pad = Items the rupee count moved left, out from under that cross (rupee_dx).
//
// Phones and tablets: with Aspect ratio = Unlocked and a window wider or taller than 16:9, the game's HUD goes to the real
// screen corners instead of the centred 16:9 box, in every room so it never jumps at a door; and optionally its X / Y item
// With Aspect ratio = Unlocked, General > HUD = At edges (the default on phones and tablets; ultrawide monitors: issue
// #817) and a window wider or taller than 16:9, the game's HUD goes to the real screen corners instead of the centred
// 16:9 box, in every room so it never jumps at a door. Phones and tablets: optionally its X / Y item
// buttons are hidden while the on-screen controls (which show those items) are up.
//
// Game thread (rt_hud_corners_tick, from the HUD's state update, HUD_HEARTS_SITE, x0 = the HUD): each group pane under
Expand Down Expand Up @@ -177,21 +178,27 @@ void rt_hud_corners_tick(uint64_t hud) {
find_panes(hud);
}
if (g_pane[RUPEE]) set_xy(RUPEE, g_authored[RUPEE] + rupee_dx(), *(const float *)(uintptr_t)(g_pane[RUPEE] + 0x34));
#if PLAT_TOUCH
float f = widescreen_factor();
bool in = game_in_play() && world_on_screen();
bool want = in && g_settings.aspect == ASPECT_UNLOCKED && (f > 1.01f || f < 0.99f) && !ENV("LARECOMP_NO_HUD_CORNERS");
bool want = in && g_settings.aspect == ASPECT_UNLOCKED && (f > 1.01f || f < 0.99f) && !ENV("LARECOMP_NO_HUD_CORNERS") &&
(g_settings.hud_pos == HUD_EDGES || ENV("LARECOMP_HUD_EDGES"));
#if PLAT_TOUCH
bool hide = in && (g_settings.touch_hide_xy_hud || ENV("LARECOMP_HIDE_XY_HUD")) && touch_visible();
#else
bool hide = false;
#endif
if (!want && !hide && !g_moved) {
bool any = false;
for (unsigned i = 0; i < NPANES; i++) any |= g_hid[i];
if (!any) { g_active = false, g_left = g_right = 0; return; }
if (!any) { g_active = false, g_left = g_right = g_up = 0; return; }
}
float l = 0, r = 0, up = 0;
if (want && f < 1) up = 360 * (1 / f - 1); // (a tablet: the band's spare height above it)
if (want && f < 1) up = 360 * (1 / f - 1); // (a tablet, or a tall window: the band's spare height above it)
else if (want) {
float il, ir;
float il = 0, ir = 0;
#if PLAT_TOUCH
menu_safe_insets(&il, &ir); // (the camera cutout: on one side only in landscape)
#endif
float span = 1280 * f; // layout units across the window
l = 640 * (f - 1) - il * span, r = 640 * (f - 1) - ir * span;
if (l < 0) l = 0;
Expand All @@ -213,7 +220,6 @@ void rt_hud_corners_tick(uint64_t hud) {
else if (!hide && g_hid[i]) *fl |= 1, g_hid[i] = false;
}
g_moved = want, g_active = want, g_left = l, g_right = r, g_up = up;
#endif
}

// ---- render thread
Expand Down
3 changes: 3 additions & 0 deletions runtime/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const char *touch_control_name(int i) {

Settings g_settings = {
.aspect = ASPECT_UNLOCKED,
.hud_pos = PLAT_TOUCH ? HUD_EDGES : HUD_CENTERED, // (phones and tablets: as before the setting, clear of the thumbs)
.dyn_min = 540,
.fullscreen = false,
.volume = 1.0f,
Expand Down Expand Up @@ -310,6 +311,7 @@ void settings_load(void) {
else if (!strcmp(key, "move_360")) g_settings.move_360 = atoi(val) != 0;
else if (!strcmp(key, "hookshot_8way")) g_settings.hookshot_8way = atoi(val) != 0;
else if (!strcmp(key, "blur_removal")) g_settings.blur_removal = atoi(val) != 0;
else if (!strcmp(key, "hud")) g_settings.hud_pos = !strcmp(val, "edges") ? HUD_EDGES : HUD_CENTERED;
else if (!strcmp(key, "hide_hero_icon")) g_settings.hide_hero_icon = atoi(val) != 0;
else if (!strcmp(key, "pause_unfocused")) g_settings.pause_unfocused = atoi(val) != 0;
else if (!strcmp(key, "remember_window")) g_settings.remember_window = atoi(val) != 0;
Expand Down Expand Up @@ -407,6 +409,7 @@ void settings_save(void) {
#endif
fprintf(f, "# LAS Recomp settings (edited from the in-game menu: F1, Esc, or Minus+Plus on a controller)\n");
fprintf(f, "aspect = %s\n", g_settings.aspect == ASPECT_ORIGINAL ? "original" : "unlocked");
fprintf(f, "hud = %s\n", g_settings.hud_pos == HUD_EDGES ? "edges" : "centered");
fprintf(f, "fullscreen = %d\n", g_settings.fullscreen);
fprintf(f, "volume = %.2f\n", g_settings.volume);
fprintf(f, "audio_output = %s\n", k_audio_out_keys[g_settings.audio_out == AUDIO_OUT_51]);
Expand Down
3 changes: 3 additions & 0 deletions runtime/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdbool.h>

enum { ASPECT_UNLOCKED = 0, ASPECT_ORIGINAL = 1 };
enum { HUD_CENTERED = 0, HUD_EDGES = 1 };
enum { RES_MATCH = 0, /* 1..8 = 1x..8x */ RES_DYNAMIC = 9 /* output_scale.c's mode while dyn_res is on */, RES_Q75 = 10, RES_Q25 = 11, RES_Q50 = 12 };
// (11 was 67% of the display: larecomp.ini "67%" now loads as RES_Q75)
enum { UPSCALE_BILINEAR = 0, UPSCALE_METALFX = 1 /* macOS */, UPSCALE_FSR1 = 2 /* Windows: AMD FSR 1 */ };
Expand Down Expand Up @@ -70,6 +71,8 @@ typedef struct {
bool hookshot_8way; // the hookshot fires along the nearest of 8 directions (for 360-degree movement): runtime/hle/hookshot.c
bool blur_removal; // no tilt-shift blur at the top / bottom of the screen
bool hide_hero_icon; // no Hero Mode icon on the HUD
int hud_pos; // HUD_*: windows not 16:9 (Aspect ratio Unlocked): the game's HUD in the centred 16:9 box, or at
// the window's edges (runtime/hle/hud_corners.c). Default: centred, at the edges on phones and tablets
bool pause_unfocused; // the game stops while its window isn't in front (runtime/hle/vi.c)
bool remember_window; // the window opens at the size it was closed at (runtime/paths.c rt_window_remember)
int window_w, window_h; // that size, in points (0: none saved yet)
Expand Down
12 changes: 10 additions & 2 deletions runtime/ui/difficulty.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
// Mode keeps the game's own flag.)
extern "C" void difficulty_frame(void) {}

// General tab: the menus' and the game's language, text speed, the Hero Mode icon and the speedrun timer - settings
// that change how the game is shown, not how it plays (user, 2026-11-11). The start screen's System tab stays apart.
// General tab: the menus' and the game's language, text speed, where the HUD sits, the Hero Mode icon and the speedrun
// timer - settings that change how the game is shown, not how it plays (user, 2026-11-11). The start screen's System tab
// stays apart.
extern "C" void input_apply_background(void); // hle/input.c

extern "C" void general_draw(float scale) {
Expand Down Expand Up @@ -94,6 +95,13 @@
"Controllers keep working while another window is in front. macOS may ask for Input "
"Monitoring permission."))
input_apply_background(), settings_save();
{ // (issue #817: ultrawide monitors; phones and tablets had it at the edges always, now their default)
static const char *const pos[] = {LN("Centered"), LN("At edges")};
if (g_settings.aspect != ASPECT_UNLOCKED) opt_disable_next(), opt_needs_next("Aspect ratio", "Unlocked");
if (opt_choice("HUD", &g_settings.hud_pos, pos, 2, PLAT_TOUCH ? HUD_EDGES : HUD_CENTERED,
"Where the hearts, items and rupees sit when the screen isn't 16:9."))
settings_save();
}
if (opt_toggle("Hide Hero Mode icon", &g_settings.hide_hero_icon, false,
"Hides the Hero Mode emblem in the corner of the screen while playing a Hero Mode file."))
settings_save();
Expand Down
4 changes: 4 additions & 0 deletions runtime/ui/lang/de.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Update kann die Dateien der App hier nicht ändern. Nutze Herunterladen."},
{"Update", "Aktualisieren"},
{"Download", "Herunterladen"},
{"HUD", "HUD"},
{"Centered", "Mittig"},
{"At edges", "Am Rand"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Wo Herzen, Items und Rubine sitzen, wenn der Bildschirm nicht 16:9 ist."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/es.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Actualizar no puede cambiar aquí los archivos de la app. Usa Descargar."},
{"Update", "Actualizar"},
{"Download", "Descargar"},
{"HUD", "HUD"},
{"Centered", "Centrado"},
{"At edges", "En los bordes"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Dónde aparecen los corazones, los objetos y las rupias cuando la pantalla no es 16:9."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/fr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Mettre à jour ne peut pas modifier les fichiers de l'app ici. Utilise Télécharger."},
{"Update", "Mettre à jour"},
{"Download", "Télécharger"},
{"HUD", "HUD"},
{"Centered", "Centré"},
{"At edges", "Aux bords"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "L'emplacement des cœurs, des objets et des rubis quand l'écran n'est pas en 16:9."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/it.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Aggiorna non può modificare qui i file dell'app. Usa Scarica."},
{"Update", "Aggiorna"},
{"Download", "Scarica"},
{"HUD", "HUD"},
{"Centered", "Al centro"},
{"At edges", "Ai bordi"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Dove si trovano cuori, oggetti e rupie quando lo schermo non è 16:9."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/ja.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "ここではアップデートでアプリのファイルを変更できません。ダウンロードを使ってください。"},
{"Update", "アップデート"},
{"Download", "ダウンロード"},
{"HUD", "HUD"},
{"Centered", "中央"},
{"At edges", "画面の端"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "画面が16:9でないとき、ハートやアイテム、ルピーを表示する位置です。"},
4 changes: 4 additions & 0 deletions runtime/ui/lang/ko.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "여기서는 업데이트로 앱 파일을 바꿀 수 없습니다. 다운로드를 사용하세요."},
{"Update", "업데이트"},
{"Download", "다운로드"},
{"HUD", "HUD"},
{"Centered", "가운데"},
{"At edges", "화면 가장자리"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "화면이 16:9가 아닐 때 하트, 아이템, 루피가 표시되는 위치입니다."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/nl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Bijwerken kan de bestanden van de app hier niet wijzigen. Gebruik Downloaden."},
{"Update", "Bijwerken"},
{"Download", "Downloaden"},
{"HUD", "HUD"},
{"Centered", "Midden"},
{"At edges", "Aan de randen"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Waar de hartjes, voorwerpen en roepies staan als het scherm niet 16:9 is."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/pt-BR.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Atualizar não pode alterar os arquivos do app aqui. Use Baixar."},
{"Update", "Atualizar"},
{"Download", "Baixar"},
{"HUD", "HUD"},
{"Centered", "Centralizado"},
{"At edges", "Nas bordas"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Onde ficam os corações, itens e rupias quando a tela não é 16:9."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/ru.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "Обновить не может изменить файлы приложения здесь. Используйте Скачать."},
{"Update", "Обновить"},
{"Download", "Скачать"},
{"HUD", "HUD"},
{"Centered", "По центру"},
{"At edges", "По краям"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "Где показаны сердца, предметы и рупии, если экран не 16:9."},
4 changes: 4 additions & 0 deletions runtime/ui/lang/zh-Hans.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "此处无法通过更新修改应用文件。请使用下载。"},
{"Update", "更新"},
{"Download", "下载"},
{"HUD", "HUD"},
{"Centered", "居中"},
{"At edges", "屏幕边缘"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "屏幕不是16:9时,心、道具和卢比显示的位置。"},
4 changes: 4 additions & 0 deletions runtime/ui/lang/zh-Hant.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,7 @@
{"Update can't change the app's files here. Use Download.", "此處無法透過更新修改應用程式檔案。請使用下載。"},
{"Update", "更新"},
{"Download", "下載"},
{"HUD", "HUD"},
{"Centered", "置中"},
{"At edges", "畫面邊緣"},
{"Where the hearts, items and rupees sit when the screen isn't 16:9.", "畫面不是16:9時,愛心、道具和盧比顯示的位置。"},
Loading