// The Insert menu. Drawn with Dear ImGui over the window's image at the last step of a present (menu_record; vk_imgui.h, in the // game's style: vk_ui.h), so it costs nothing while closed and it never touches the game's picture, nor what frame interpolation // sees. The FPS counter and the start-up screen are drawn the same way. F1 always opens and closes it, Insert too by default. // Up and Down choose, Left and Right change, Esc closes; the game gets no keyboard input while it is open. // (hookshot) A gamepad's Home button, or Select and Start together, opens it too; the D-pad chooses and changes, the button // the Switch's A is bound to changes too (and opens a page), the one B is bound to goes back (vk_menu_keys.h). The game gets no gamepad input while it is open either. // Its Controls page binds the Switch's buttons to gamepad inputs and keys. // (hookshot) The mouse is free while it is open (the window lets it go: WM_APP + 8, host/display.c and // host/posix/display_sdl.c): the row under the cursor is selected, a click on a tab shows it, on a value's left or right // half changes it down or up, on a toggle flips it, on a slider's track sets it (or drag it); the wheel scrolls the rows // (never a value, wherever the cursor is); a right click is Esc. On the Cheats page and its lists a click is Enter (on a // choice's or an amount's left or right half, Left or Right) and a right click goes back. The drawing records each control's // place and the mouse is tested against that (vk_menu_hit.h). // (hookshot) The rows that take a restart (Row::restart) are tagged "After restart" while their value is not the one the game // started with, and the Graphics tab's help lists them. Closing the menu then asks whether to restart now (menu_restart.h): // Later keeps the saved settings for the next start and is not asked again until they change; Restart now saves and // closes the window as the player would, and the game starts again (WM_APP + 9: host/hos_relaunch.c). // (Triforce, 11-10) The menu is drawn as the game's own Options screen (SystemOption_00 of its layout archive): the System // screens' header with the options' categories across it as the pause menu has its own (Display, Graphics, Audio, Controls, // System; L and R, Q and E), the rows on the game's plates in its list column, the caption plate at the right, the guides at // the foot, in the game's fonts and with its button icons (vk_ui.h, vk_game_tex.h, vk_imgui.cpp: all read from the player's // game files at run time). The Debug tab is always shown (11-15, the owner: "make debug on by default and remove the alt+g // shortcut"; Alt+G unlocked it before). The Menu size row is gone: the game's menus have one size. The FPS counter is a HUD counter (the // HUD's own digits, no plate). tests/ui_preview.cpp draws all of it into pictures without the game. // (Triforce, options_version 7, the owner: "group them correctly, such as HDR should be its own group, the upscaling should be // its own group ... Add the in-game filigree to group them" and "multiple settings that do multiple things and they contradict // each other ... If a setting can be implemented in some other way, then remove the setting entirely") Each tab's rows come in // groups, each under a heading drawn as the game's list separator with the group's title (MENU_HEADING, ui::heading); a row // that does nothing with the others as they are is not shown (row_shown). The rows that chose one thing twice are one row each // (merged_rows.h: HDR with RenoDX, Frame generation with DLSS's, Frame pacing with Steady, Low latency for Reflex or Anti-Lag // 2, the Upscaler's native AA as the Render resolution's Native (100%)), and the Quality preset, the Window scaling filter, // the Reflex frame limit, the Handheld profile and the shared Stick dead zone are gone, their jobs done otherwise. #include #include #include #include #include #include #include #include #include #include // ((Triforce) the name pages' read of the game's files) #include #include "vk_dlssg.h" #include "cpu_count.h" // ((Triforce, 11-22, OS-49) the threads to size by: HOS_SIM_CPU #include "vk_pace.h" // (Triforce: who holds the frames, for the rows that hand them to another limiter) #include "vk_bugshot.h" // (Triforce: a bug capture's picture, taken before the overlays are drawn) #include "vk_paths.h" #include "vk_menu.h" #include "vk_menu_hit.h" #include "vk_draw.h" // (pipeline_cache_save: Restart now keeps what was built) #include "oot_cheat_items.h" #include "debug_names.h" // ((Triforce) the Debug tab's name pages: their lists, and oot_debug_link.h's lines) #include "debug_pending.h" // ((Triforce) the Inventory's change waiting for the game) #include "vk_progress.h" // (StartupView, version_text: the start-up screen) #if __has_include("vk_startup_draw.h") // (the shader-screen branch's file: with it the start-up screen is its drawing) #include "vk_startup_draw.h" // (the start-up screen's drawing: draw_startup_screen) #endif #include "vk_ui.h" #include "vk_menu_keys.h" // (which gamepad buttons confirm and go back: those A and B are bound to) // (how it looks: Dear ImGui, vk_imgui.h) #include "vk_dlss.h" #include "vk_fsr3.h" // (the Upscaler row: whether AMD FSR 3.1 runs on this GPU) #include "vk_fsr3fi.h" // (the Frame generation row: whether FSR 3.1 makes the frame) #include "vk_framegen.h" // ((Triforce) 11-24: framegen_maker, who made the last frames: perf_framegen_text) #include "vk_fsr4.h" #include "vk_xess.h" // ((Triforce) the Upscaler row: whether Intel XeSS runs here) #include "vk_temporal.h" #include "vk_fsr3_inputs.h" // (Triforce: the render size while AMD FSR 3.1 draws, for the performance overlay) #include "perf_stats.h" // (Triforce: the performance overlay's frame times) #include "perf_machine.h" // (Triforce: and the machine's numbers, sampled on a thread of their own) #include "vk_renodx.h" // (renodx_built: the RenoDX rows only in a build with its shaders) #include "vk_reflex.h" #include "vk_antilag.h" #include "upscaler_rows.h" #include "output_modes.h" // ((Triforce) the Output resolution's display modes and common sizes: mode_sizes #include "fps_levels.h" // ((Triforce) the FPS counter row's levels between On and Full: draw_fps, fps_detail_sample #include "auto_settings.h" // ((Triforce) the Graphics tab's Auto (this PC) row: auto_apply, menu_auto_tune #ifndef _WIN32 #include // ((Triforce) sysconf: the RAM, Auto (this PC)'s auto_hardware) #endif #include "first_start.h" // ((Triforce, 11-22, PRESENT-46) the Render resolution of a first start on a weak card: menu_first_start) #include "vk_present_rect.h" // ((Triforce, options_version 7) where the picture goes in the window: the filter it takes) #include "text_spread.h" // ((Triforce, 11-19) the title entry's shadow and glow as the game's entries' #include "game_grid.h" // ((Triforce, 11-19) where the game's layouts are in the window: the Mods entry on its list) #include "merged_rows.h" // ((Triforce, options_version 7) the rows that each choose two saved values, and the older files' migration) #include "aa_rows.h" // (Triforce, the Anti-aliasing row: its choices, and when it does not apply) #include "vk_aa.h" // (...RX_VK_AA over it, and whether the game's pass was there to replace) #include "vk_n64.h" // ((Triforce, N64 Classic, step 4) its TV in the window filter's place) #include "evil_hd.h" // ((Triforce, 11-23) the Evil HD row: what it puts over the rows below it) #include "tex_detail.h" // (the Texture detail row: the levels' names, RX_VK_TEX_DETAIL) #include "fps_cap.h" // (the Game frame rate cap row's Monitor's rate) #include "ultrawide_rows.h" // ((Triforce) the Ultrawide row's shapes, and its old Monitor's shape read before options_version 6) #include "output_sizes.h" // ((Triforce) the Output resolution row's sizes: the fixed ones, Screen and Custom) #include "present_mode.h" // (the VSync row: what its choice comes to on this driver) #include "game_language.h" // (the Game language row: what language.txt chooses and offers) #include "vk_menu_i18n.h" // ((Triforce) the menu's languages: the Menu language row, the texts looked up (vk_ui.h)) #include "menu_restart.h" #include "mod_cheat_rows.h" // (Triforce: the System tab's rows for the cheats of the mods' cheat files) #include "achievement_rows.h" // (Triforce: the achievements the host names, their notice and their page) #include "save_file_rows.h" // (Triforce: the save files the host names, and the title's file select) #include "menu_sound_events.h" // (Triforce: the options' own sounds: which one a tick asks for, and their queue to the host) #include "mods_entry_anim.h" // ((Triforce, 11-19) the Mods entry under the title's list: the game's entries' animations) #include "focus_anim.h" // ((Triforce, 11-19) Mods and Quit under the System list, Quit's dialog: the game's buttons' and dialogs') #include "mods_page_anim.h" // ((Triforce, 11-20) the Mods screen as it opens: its In) #include "vk_mods.h" // (Triforce: the Mods page's engine, GameBanana's list and the installs) #include "vk_salesman.h" // (Triforce: the Happy Mask Salesman beside the cards) #include "imgui_internal.h" // (RegisterUserTexture: the mods' pictures) #include "ini_merge.h" // ((Triforce, handoff ยง9) the options file's lines merged by key with a change made outside the game) #include "file_whole.h" // (and the file written whole: file_writers::write_whole) #include "reshade_menu.h" // ((Triforce) 11-24: the Graphics tab's Post-processing group, the ReShade preset's rows and comparison) #include "sim_turf.h" // ((Triforce) the Simulated turf page: its rows' values, the area, its file) #include "vk_work.h" // (after the others: counts the commands that do GPU work, for full_barrier) #ifndef HOOKSHOT_VERSION // (nx2/build.py gives it to this file: nx2/version.py) #define HOOKSHOT_VERSION "unknown" #endif namespace mkwvk { HWND app_window(); int texture_detail_auto(); // (vk_texture.cpp: what the video memory gives this card, -1 before the first texture) int display_refresh_mhz(); // (vk_main.cpp: the window's display, mHz; 0 when not known) int swapchain_present_mode(); // (vk_main.cpp: the swapchain's present mode, present_mode.h's numbers; -1 none) // ((Triforce) the performance overlay on Full: the rendering GPU's LUID (vk_main.cpp), the GPU's time in the recordings and their // uploads so far (vk_replay.cpp), the textures uploaded so far (vk_texture.cpp), whether frame generation makes frames now // (vk_framegen.cpp)) bool gpu_device_luid(uint8_t out[8]); int64_t gpu_time_busy_ns(); void texture_stats(int64_t* uploads, int64_t* astc_gpu, int64_t* bytes_uploaded); bool framegen_on(); Options opts; namespace { // (Triforce) The tabs across the Options screen's header, as the pause menu's categories: a kind of option each. Debug is the // last, always shown (debug_shown) enum MenuTab { TAB_DISPLAY = 0, TAB_GRAPHICS = 1, TAB_AUDIO = 2, TAB_CONTROLS = 3, TAB_SYSTEM = 4, TAB_DEBUG = 5, // (the OoT debug tools of #785 and the developer's rows, a tab of their own) TAB_COUNT = 6, TAB_MOTION = TAB_COUNT, // (hookshot: not a tab of the strip, the Motion page that the Controls tab's Motion row // opens: one past the strip's tabs, so a tab added before TAB_COUNT moves it along) TAB_PAGE = TAB_MOTION + 1, // (hookshot: the Controls page's rows, above its grid; no tab shows them) TAB_N64 = TAB_PAGE + 1, // ((Triforce, 11-22, N64 Classic, step 5) the Remembered page that the Graphics tab's // Remembered settings row opens: no tab shows it) TAB_SIM_TURF = TAB_N64 + 1, // ((Triforce, 11-24) the Simulated turf page that the Graphics tab's Simulated turf row opens: // no tab shows it. Its values are each area's, in sim_turf_settings.ini, read after the options // file: the options file's lines of its rows are the last ones shown, read by nothing) TAB_HIDDEN = TAB_SIM_TURF + 1 // ((Triforce, options_version 7) saved values a merged row stands for: never shown, merged_rows.h) }; struct Row { MenuTab tab; const char* name; int* value; int lo, hi, step; const char* (*text)(int v); const char* help; // (shown under the list while the row is selected: what the row is, the same whatever its value) // (a line about the value chosen, under the help, or nullptr: hint(v, -1) is the one to show now for v, hint(v, 0), // hint(v, 1), ... every one v can have (those that depend on the other rows or on the GPU), until nullptr, so the // menu keeps the height of the tallest: measure_help) const char* (*hint)(int v, int variant) = nullptr; bool restart = false; // (read once, at the start: a change applies after a restart) // (a change here left the Quality preset alone: the controls, the window, the counter, frame generation. (Triforce, // options_version 7) The preset is gone and nothing reads it; the rows keep their shape) bool preset_exempt = false; signed char cheat = -1; // (a debug tool, on the Debug tab with the tools on: its index in the cheat_ tables, -1 none) bool heading = false; // (a section's title on its tab, not a row: the selection steps over it) }; /// A row's hints from a table, the value lo first (nullptr: none for that value) const char* hint_in(const char* const* t, int n, int lo, int v, int variant) { return variant <= 0 && v - lo >= 0 && v - lo < n ? t[v - lo] : nullptr; } #define MENU_HINTS(fn, lo, ...) \ const char* fn(int v, int variant) { \ static const char* const t[] = {__VA_ARGS__}; \ return hint_in(t, (int)(sizeof t / sizeof t[0]), lo, v, variant); \ } const char* tx_framegen(int v) { // (Triforce: the last is AMD's frame generation library, vk_fsr4.h fsr4fg. A saved AMD FSR 4 on a PC where the library // cannot make the frames shows what runs there, 2x: framegen_rows.h shown. (FG-1) Named by the version AMD's library makes // the frames with: "AMD FSR (3.1.6)" on an RX 6000 or 7000, "AMD FSR (4.0.2)" on an RX 9000) static const char* t[] = {"Off", "Auto", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "AMD FSR"}; const int shown = std::clamp(framegen_rows::shown(v, fsr4fg::offered_known()), 0, (int)framegen_rows::kRowMax); // ((Triforce) as known: menu_ahead) if (shown != framegen_rows::FSR4) return t[shown]; static char label[32]; return framegen_rows::row_label(label, sizeof label, fsr4fg::version()); } const char* tx_onoff(int v) { return v ? "On" : "Off"; } const char* tx_dlssg(int v) { return v == 1 ? "2x" : v == 2 ? "3x" : v == 3 ? "4x" : "Off"; } /// (what runs in this session, or why not: vk_dlssg.cpp. Variant 0 stands for the longest line, for the menu's height) const char* hn_dlssg(int v, int variant) { if (variant > 0) return nullptr; if (variant == 0) return "Not on this graphics card or driver: it needs an RTX 40 or 50 card."; if (!v) return "Off."; return mkwvk::dlssg::asked() ? mkwvk::dlssg::status() : "Starts with the next start of the game."; } const char* tx_menu_shortcut(int v) { // (F1 is never turned off: the menu is always one key away. Esc as well, as a PC game's pause menu) // (and a DualShock 4's or DualSense's touchpad click, as F1) static const char* const names[] = {"Insert or F1", "F1 only", "Insert, F1 or Esc", "Insert, F1 or touchpad", "Insert, F1, Esc or touchpad"}; return names[std::clamp(v, 0, 4)]; } const char* tx_hdr(int v) { return v == 1 ? "Expanded" : v == 2 ? "Native" : "Off"; } // ((Triforce, 11-16) "Native", the owner's word) namespace mr7 = merged_rows; /// ((Triforce, options_version 7) the HDR row: opts.hdr with RenoDX HDR as its fourth value, merged_rows.h) const char* tx_hdr_mode(int v) { return v == mr7::HDR_RENODX ? "Native + RenoDX" : tx_hdr(v); } /// The row's value in words; and with HDR on while the swapchain stayed SDR, why instead (dev.hdr_sdr_why, vk_main.cpp /// create_swapchain): the player is told what to change, not sent to a setting that is already right. Variants: the /// value's own line, then each reason const char* hn_hdr_mode(int v, int variant) { static const char* const t[] = { "The usual SDR picture.", "The game's SDR picture shown on an HDR display: its white at Paper white, its highlights up to Peak brightness.", "The game's own HDR, told your display's Paper white and Peak brightness.", ("The game's own HDR with RenoDX's tone mapping, eye adaptation and color grading in place of the game's (the RenoDX " "rows below). RenoDX is by Carlos Lopez (clshortfuse), under the MIT license.")}; static const char* const why[] = { "The picture stays SDR: the graphics driver offers no HDR output (no VK_EXT_swapchain_colorspace).", "The picture stays SDR: HDR is off for this display in Windows' display settings.", ("The picture stays SDR: Windows has HDR on, but the graphics driver offers the game no HDR output. Reinstall the " "driver with a clean install, then restart the PC."), "The picture stays SDR: the display offers no HDR output. Is HDR on in the display settings?"}; const int reasons = hdr_sdr_count - 1; // (every HdrSdrWhy but hdr_sdr_none) static_assert(sizeof why / sizeof *why == hdr_sdr_count - 1, "hn_hdr_mode: a line for each HdrSdrWhy but hdr_sdr_none"); if (v < 0 || v >= (int)(sizeof t / sizeof *t)) return nullptr; if (variant < 0) // (the one to show now. The swapchain is made again when the row changes, so the reason is this value's) return v && opts.hdr && !dev.hdr && dev.hdr_sdr_why != hdr_sdr_none ? why[std::clamp((int)dev.hdr_sdr_why, 1, reasons) - 1] : t[v]; if (variant == 0) return t[v]; return v && variant <= reasons ? why[variant - 1] : nullptr; } const char* tx_nits(int v) { static char b[24]; snprintf(b, sizeof b, "%d nits", v); return b; } static_assert(fps_cap::kMonitor == 6, "the Game frame rate cap row's last value is Monitor's rate"); const char* tx_fps_cap(int v) { static const char* const t[] = {"60 (the console's)", "90", "120", "144", "165", "240"}; if (v < 0) return v == -1 ? "45" : v == -2 ? "40" : "30"; // (Triforce: the limits under 60, host/nn_vi.c fps_max) if (v >= fps_cap::kUncapped) return "Uncapped"; // ((Triforce) as fast as the PC can, at real time: host/nn_vi.c fps_cap_of) if (v >= fps_cap::kMonitor) { // (Triforce: Monitor's rate, with what this display gives now: fps_cap.h, as the host asks it) static char b[32]; const int cap = fps_cap::of_display(display_refresh_mhz()); if (!cap) return "Monitor's rate"; snprintf(b, sizeof b, "Monitor's rate (%d)", cap); return b; } return t[v]; } // (Triforce) The Steady frame rate row (host/pace_steady.h's PACE_STEADY_*) const char* tx_steady_fps(int v) { return v == 1 ? "Any rate" : v == 2 ? "Refresh steps" : "Off"; } /// ((Triforce, options_version 7) the Frame pacing row: Frame pacing and Steady frame rate in one, merged_rows.h) const char* tx_pacing(int v) { static const char* const t[] = {"Off", "Even", "Steady, any rate", "Steady, refresh steps"}; return t[std::clamp(v, 0, 3)]; } MENU_HINTS(hn_pacing, 0, "Each frame as soon as it is ready.", "Frames at an even interval: less stutter, at up to a frame of delay.", "The game paced to a rate this PC holds here, under the Frame rate cap, each frame shown evenly: for a display with " "G-SYNC or FreeSync, or VSync off. Applies after a restart.", "As Steady, any rate, kept to whole divisions of the refresh rate (at 240 Hz: 120, 80, 60): for VSync without G-SYNC or " "FreeSync. Applies after a restart.") // (Triforce) The VSync row (opts.vsync; present_mode.h has what On and Off ask for): the line under its help says what the // choice came to on this driver, by the present mode of the swapchain there is, or which switch decides for the run. // Variants (every one): each mode the value can come to, then the two switches /// ((Triforce) 11-24) its third value, Every refresh: FIFO, as RX_VK_FIFO (vk_main.cpp create_swapchain) const char* tx_vsync(int v) { return v == 2 ? "Every refresh" : tx_onoff(v); } const char* hn_vsync(int v, int variant) { static const char* const on[] = { "Each frame waits for the screen's next refresh: no tearing.", "The newest finished frame at each refresh of the screen: no tearing, and nothing held back.", "This driver has no tear-free mode that does not hold the frame rate down: frames are shown at once, as with Off.", }; static const char* const off[] = { "This graphics driver cannot show frames at once here: as On.", "This graphics driver cannot show frames at once here: as On.", "Each frame is shown the moment it is ready: a little less delay, and the picture can tear.", }; static const char* const fifo_env = "Set for this run by RX_VK_FIFO: each frame waits for the screen's next refresh."; static const char* const immediate_env = "RX_VK_IMMEDIATE asks for frames shown at once in this run, whatever is chosen here."; static const char* const every = "Each frame waits for the screen's next refresh (FIFO): no tearing, at most the screen's rate, " "and a frame late for one refresh waits for the next."; if (variant < 0) { static const bool fifo = getenv("RX_VK_FIFO") != nullptr, immediate = getenv("RX_VK_IMMEDIATE") != nullptr; if (fifo || immediate) return fifo ? fifo_env : immediate_env; if (v == 2) return every; const int mode = swapchain_present_mode(); if (mode < present_mode::kFifo || mode > present_mode::kImmediate) return nullptr; // (no swapchain: nothing to say) return (v ? on : off)[mode]; } if (variant <= present_mode::kImmediate) return (v ? on : off)[variant]; return variant == 3 ? fifo_env : variant == 4 ? immediate_env : variant == 5 ? every : nullptr; } // (hookshot) Motion controls: the choice, and whether a connected controller has a gyroscope (host/pad_sdl.c). Either can be // chosen whatever is connected: a pad plugged in later is read when it comes const char* tx_gyro(int v) { const int status = host && host->gyro_status ? host->gyro_status() : -1; if (status == 2) return v ? "On (gyro found)" : "Off (gyro found)"; if (status == 1) return v ? "On (no gyro on this pad)" : "Off (no gyro on this pad)"; if (status == 0) return v ? "On (no controller)" : "Off (no controller)"; return v ? "On" : "Off"; } const char* tx_mousecam(int v) { return v == 2 ? "Off" : v ? "Native" : "As the stick"; } // ((Triforce) 2: Off) const char* tx_sens(int v) { static char b[12]; snprintf(b, sizeof b, "%.2f", v / 100.0); return b; } // (the game's picture and the window it is shown in, as the last present had them: menu_note_present_sizes. (Triforce, // options_version 7) The Window scaling filter row is gone: those sizes choose the filter there, upscaler_rows.h auto_filter) std::atomic present_sizes{0}; // ((Triforce, options_version 7) The Low latency row: NVIDIA Reflex on an NVIDIA card, AMD Anti-Lag 2 on an AMD one, one row // for either (merged_rows.h); none where neither runs. With DLSS frame generation Reflex is Streamline's) mr7::Vendor latency_vendor() { return reflex_available() || mkwvk::dlssg::reflex_on() ? mr7::LATENCY_NVIDIA : antilag_available() ? mr7::LATENCY_AMD : mr7::LATENCY_NONE; } const char* tx_latency(int v) { static const char* t[] = {"Off", "On", "On + Boost"}; // ((Triforce, 11-16: the owner saw Off and "not available" with DLSS frame generation on an NVIDIA card) With DLSS frame // generation Reflex is Streamline's and always on (vk_dlssg.cpp reflex_apply): its Off shows On, Boost as chosen if (mkwvk::dlssg::reflex_on()) return t[std::clamp(v, 1, 2)]; return t[std::clamp(v, 0, mr7::latency_hi(latency_vendor()))]; } /// Low latency: the value with NVIDIA Reflex (variants 0 to 2: each value's line), with AMD Anti-Lag 2 (3), or that Reflex runs /// through Streamline with DLSS frame generation (4) const char* hn_latency(int v, int variant) { static const char* const nv[] = {"Off.", "NVIDIA Reflex: each frame starts as late as it can, for less input delay.", "As On, and the graphics card's clocks are kept up as well."}; static const char* const amd[] = {"Off.", "AMD Anti-Lag 2: each frame starts as late as it can, for less input delay. Not " "used with frame generation."}; static const char* const sl = "With DLSS frame generation Reflex runs through NVIDIA Streamline and stays on, as frame " "generation needs it. On + Boost keeps the graphics card's clocks up as well."; if (variant < 0) { if (mkwvk::dlssg::reflex_on()) return sl; return latency_vendor() == mr7::LATENCY_AMD ? amd[std::clamp(v, 0, 1)] : nv[std::clamp(v, 0, 2)]; } return variant == 0 ? nv[std::clamp(v, 0, 2)] : variant == 1 ? amd[std::clamp(v, 0, 1)] : variant == 2 ? sl : nullptr; } // The Upscaler (opts.dlss): what scales the 3D up to the output. DLSS and DLAA only where dlss_why() lets them run, FSR 3.1 // only where vk_fsr3.cpp says it does, FSR 4 and its native AA only where fsr4_why() does; the menu shows (and steps from) // what runs, and keeps the saved choice for a PC where it can namespace ur = upscaler_rows; /// One bit per upscaler that runs here (upscaler_rows.h bit). Each backend caches its own answer, so this costs nothing unsigned upscalers_available() { // ((Triforce) 11-24: Off, no upscaler, everywhere) return ur::bit(ur::GAME) | ur::bit(ur::OFF) | ur::dlss_bits(dlss_why() == DLSS_OK) | ur::fsr3_bits(fsr3::supported()) | ur::fsr4_bits(fsr4_why() == FSR_OK) | ur::xess_bits(xess_why() == XESS_OK); // ((Triforce) Intel XeSS where it runs) } /// (FSR 3.1 has inputs of its own, at the Render resolution's mode or as its Native AA; DLSS and FSR 4 run on the frame /// chain they share, temporal_mode) int upscaler() { if (fsr3_wanted()) return fsr3_native() ? ur::FSR3_AA : ur::FSR3; const int t = temporal_mode(); return t == ur::GAME && opts.dlss == ur::OFF ? (int)ur::OFF : t; // ((Triforce) 11-24: Off, no engine: upscale_off_wanted) } /// ((Triforce, options_version 7) the engine alone: an engine's native AA is the Render resolution row's Native (100%)) const char* tx_upscaler(int) { if (n64_in_front() != n64_rules::OFF) return "N64 Classic"; // ((Triforce, N64 Classic) its 3D pass draws in their place) static const char* t[ur::kUpscalers] = {"Game", "NVIDIA DLSS", "NVIDIA DLSS", "AMD FSR 3.1", "AMD FSR 4", "AMD FSR 4", "AMD FSR 3.1", "Off", "Intel XeSS", "Intel XeSS"}; // ((Triforce, FSR4-7) FSR 4 by the version AMD's library runs here, "AMD FSR 4.1", once it has been asked. up is the // engine (ur::engine), so FSR 4's Native AA reads as its engine too, "AMD FSR 4.1": the Render resolution says Native) const int up = ur::engine(std::clamp(upscaler(), 0, ur::kUpscalers - 1)); if (ur::is_fsr4(up)) return fsr4_name(up == ur::FSR4_AA); return t[up]; } /// The Upscaler: the one shown (what runs, upscaler()), and with the game's own, why DLSS and FSR are not offered. Variants /// (every one): each value, then the game's own with each of DLSS's reasons, then with each of FSR's const char* hn_upscaler(int v, int variant) { static const char* const t[ur::kUpscalers] = { // ((Triforce, options_version 7) one line per engine: an engine's native AA is the Render resolution's Native (100%), // whose own line says so, and its value reads as its engine here (v = ur::engine(v) below). (S7) DLSS's line, DLAA's // too, names AMD's RCAS before the HUD; (FSR3-03) FSR 3.1 gives what moves by itself its own motion: no trails said) "The game's own upscaler.", "NVIDIA's, on RTX graphics cards. Sharpness sharpens its 3D before the HUD, with AMD's RCAS. Things that move by " "themselves can trail for now.", nullptr, "AMD's, on any graphics card, built from AMD's own shaders.", "AMD's machine-learned upscaler, with AMD's files beside the game. Things that move by themselves can trail for now.", nullptr, nullptr, // ((Triforce) 11-24) "No upscaler, not even the game's network: the 3D stretched to the output with a plain filter. The fastest, and the " "roughest picture: softer below 100%.", // ((Triforce) Intel XeSS, its Native AA the Render resolution's Native (100%) as the others') "Intel's machine-learned upscaler, with Intel's libxess.dll beside the game. Sharpness sharpens its 3D before the HUD, " "with AMD's RCAS. Things that move by themselves can trail for now.", nullptr, }; static const char* const dlss_no[DLSS_WHY_COUNT] = { nullptr, "DLSS and DLAA: not in this build (built without NVIDIA's DLSS SDK, see the readme).", "DLSS and DLAA: off for this run (RX_VK_DLSS=0).", "DLSS and DLAA: need an NVIDIA RTX GPU.", "DLSS and DLAA: need a newer NVIDIA driver.", "DLSS and DLAA: DLSS's runtime was not found (the game folder's ngx folder, see the readme).", "DLSS and DLAA: NVIDIA's NGX on Linux loads DLSS's runtime only from a folder named in ASCII (see the readme).", "DLSS and DLAA: NVIDIA's NGX started but gave DLSS nothing to work with (see the log).", }; static const char* const fsr_no[FSR_WHY_COUNT] = { nullptr, "AMD FSR 4: not in this build (see the readme).", "AMD FSR 4: off for this run (RX_VK_FSR4=0).", "AMD FSR 4: AMD's files were not found beside the game (see the readme).", "AMD FSR 4: AMD's files have no FSR 4 for this GPU and driver: it needs a Radeon RX 6000, 7000 or 9000 and AMD's " "driver 26.10.1 or newer.", }; // ((Triforce) why Intel XeSS is not offered (vk_xess.h XessWhy). Its library missing is said on an Intel GPU alone: on // another, the line would be on every PC without Intel's file) static const char* const xess_no[XESS_WHY_COUNT] = { nullptr, "Intel XeSS: Windows only (Intel makes no XeSS library for Linux).", "Intel XeSS: off for this run (RX_VK_XESS=0).", "Intel XeSS: Intel's libxess.dll was not found beside the game (see the readme).", "Intel XeSS: the GPU or its Vulkan driver lacks what XeSS needs (the log says what).", "Intel XeSS: Intel's library does not run on this GPU or driver.", }; // ((Triforce, FSR4-1) the engine chosen, off after failing again and again: the game's own stands in for it. FSR 4 by the // version AMD's library ran, as the Upscaler row names it (fsr4_name: "AMD FSR 4.1"; "AMD FSR 4" until it was asked). // (The reasons above are for an FSR 4 that does not run here, whose version no library has given: its plain name) static char fsr4_stood_in[160]; snprintf(fsr4_stood_in, sizeof fsr4_stood_in, "The game's own stands in: %s failed four times in a row (the log says " "why). Set the Upscaler again to try it anew.", fsr4_name(false)); const char* const stood_in[3] = { "The game's own stands in: NVIDIA DLSS failed four times in a row (the log says why). Set the Upscaler again to try " "it anew.", fsr4_stood_in, "The game's own stands in: Intel XeSS failed four times in a row (the log says why). Set the Upscaler again to try " "it anew.", }; // (now: the value shown and what runs here, with every engine's reasons; every one: as said above, then ((Triforce) // XeSS's reasons and its stand-in line after them) int d = 0, f = 0, x = 0; constexpr int kXessAt = DLSS_WHY_COUNT + FSR_WHY_COUNT + 1; // (the first of XeSS's variants) if (variant < 0) { v = std::clamp(upscaler(), 0, ur::kUpscalers - 1), d = (int)dlss_why(), f = (int)fsr4_why(), x = (int)xess_why(); if (x == XESS_NO_LIBRARY && dev.props.vendorID != 0x8086) x = 0; // (Intel's file named on Intel's GPUs alone) if (const int in = temporal_stood_in(); v == ur::GAME && in != ur::GAME) return stood_in[ur::is_xess(in) ? 2 : ur::is_fsr4(in) ? 1 : 0]; } else if (v == ur::GAME) { if (variant < DLSS_WHY_COUNT) d = variant; else if (variant < DLSS_WHY_COUNT + FSR_WHY_COUNT - 1) f = variant - DLSS_WHY_COUNT + 1; else if (variant < DLSS_WHY_COUNT + FSR_WHY_COUNT + 1) return stood_in[variant - (DLSS_WHY_COUNT + FSR_WHY_COUNT - 1)]; else if (variant < kXessAt + XESS_WHY_COUNT - 1) x = variant - kXessAt + 1; else if (variant == kXessAt + XESS_WHY_COUNT - 1) return stood_in[2]; else return nullptr; } else if (variant > 0) { return nullptr; } v = ur::engine(v); // ((Triforce, options_version 7) a native AA is its engine's: the Render resolution says Native) // (the reasons are said only where the engine is in the build: one without FSR does not tell an NVIDIA user why) const char* dn = dlss_built() || variant >= 0 ? dlss_no[d] : nullptr; const char* fn = fsr4_built() || variant >= 0 ? fsr_no[f] : nullptr; const char* xn = xess_built() || variant >= 0 ? xess_no[x] : nullptr; // ((Triforce) a Linux build says nothing of XeSS) if (v != ur::GAME || (!dn && !fn && !xn)) return t[v]; static char b[DLSS_WHY_COUNT][FSR_WHY_COUNT][XESS_WHY_COUNT][400]; snprintf(b[d][f][x], sizeof b[d][f][x], "%s%s%s%s%s%s%s", t[0], dn ? " " : "", dn ? dn : "", fn ? " " : "", fn ? fn : "", xn ? " " : "", xn ? xn : ""); return b[d][f][x]; } /// The DLSS model row (opts.dlss_model): NVIDIA's network by its preset, or RX_VK_DLSS_PRESET's for this run const char* dlss_preset_env() { static const char* const e = getenv("RX_VK_DLSS_PRESET"); return ur::preset_env(e) ? e : nullptr; } const char* tx_dlss_model(int v) { static const char* const t[] = {"Transformer (K)", "Transformer 2 (M)", "Transformer 2 (L)", "NVIDIA default"}; if (const char* e = dlss_preset_env()) { static char b[48]; const unsigned p = ur::dlss_preset(v, e); if (p) snprintf(b, sizeof b, "Preset %c (RX_VK_DLSS_PRESET)", ur::preset_letter(p)); else snprintf(b, sizeof b, "NVIDIA default (RX_VK_DLSS_PRESET)"); return b; } // ((Triforce, 11-22, the performance audit's PRESENT-36, after Source A's) with RX_VK_DLSS_CNN_VRAM=1 the K row on a card // under 7 GB draws with NVIDIA's CNN model, preset E, and says so: what DLSS asks for, vk_dlss.cpp wanted_preset) if (ur::cnn_for_vram(v, dlss_cnn_vram())) return "CNN (E)"; return t[std::clamp(v, 0, ur::kModels - 1)]; } /// The DLSS model: the value chosen; variant 1: set for this run by RX_VK_DLSS_PRESET. ((Triforce, options_version 7) The row /// shows only while NVIDIA DLSS is the Upscaler: row_shown) const char* hn_dlss_model(int v, int variant) { static const char* const t[] = { "NVIDIA's transformer model: the one tested most here.", "NVIDIA's second-generation transformer, its pick for Performance: sharper, at a little more GPU time.", "The second-generation transformer as NVIDIA tuned it for Ultra Performance, the smallest Render resolutions.", "Lets DLSS's runtime pick for each mode: what it picks can change with a runtime update.", }; static const char* const env = "Set for this run by RX_VK_DLSS_PRESET."; // ((Triforce, 11-22, PRESENT-36) variant 2, the K row's alone: preset E for this card (RX_VK_DLSS_CNN_VRAM=1)) static const char* const cnn = "Chosen for this card's video memory (under 7 GB): less GPU time than K."; if (variant < 0) variant = dlss_preset_env() ? 1 : ur::cnn_for_vram(v, dlss_cnn_vram()) ? 2 : 0; if (variant == 1) return env; if (variant == 2) return v == ur::MODEL_K ? cnn : nullptr; return variant == 0 ? t[std::clamp(v, 0, ur::kModels - 1)] : nullptr; } /// ((Triforce) The FSR 4 model row (opts.fsr4_model): AMD's own pick for this GPU, or the smaller INT8 Lite network const char* tx_fsr4_model(int v) { return v ? "Lite (INT8)" : "Auto (AMD's)"; } /// The FSR 4 model: the value chosen; variant 1: set for this run by RX_VK_FSR4_MODEL const char* hn_fsr4_model(int v, int variant) { static const char* const t[] = { "AMD's own choice for this GPU: FP8 on RDNA 4, full INT8 on RDNA 3 and Strix Halo, the Navi 2 INT8 model on RX 6000, " "Lite on Strix Point and Van Gogh.", "AMD's smaller FSR 4 network. On a GPU AMD already runs Lite on, this setting does nothing.", }; static const char* const env = "Set for this run by RX_VK_FSR4_MODEL."; if (variant < 0) variant = fsr4_model_env() >= 0 ? 1 : 0; if (variant == 1) return env; return variant == 0 ? t[std::clamp(v, 0, ur::kFsr4Models - 1)] : nullptr; } const char* tx_aniso(int v) { // (Triforce: the Texture filtering row) static const char* t[] = {"Game", "2x", "4x", "8x", "16x"}; // ((Triforce, 11-16) "Game", the owner's word) if ((unsigned)v >= sizeof t / sizeof t[0]) return t[0]; return t[v]; } // (Triforce) The Texture detail row (opts.tex_detail, tex_detail.h): Automatic is the card's own level by its video memory, // which the row says once the first texture was made; RX_VK_TEX_DETAIL goes over the row for a run int tex_detail_env() { static const int e = tex_detail::parse(getenv("RX_VK_TEX_DETAIL")); return e; } const char* tx_tex_detail(int v) { static const char* const t[] = {"Automatic", "Full", "Reduced", "Low"}; static const char* const picked[] = {"Automatic (Full)", "Automatic (Reduced)", "Automatic (Low)"}; if ((unsigned)v >= sizeof t / sizeof t[0]) v = 0; const int here = texture_detail_auto(); return v == 0 && here >= 0 && here <= 2 ? picked[here] : t[v]; } /// ((Triforce, 11-23) the Evil HD row, evil_hd.h: what each value does here MENU_HINTS(hn_evil_hd, 0, "Off: the picture as the rows below are set.", "On: SMAA Ultra, 16x filtering and ambient occlusion now; every texture whole from the next start. A little more GPU " "time and video memory: a card with less than 12 GB can run out. With DLSS or FSR it is their own edges, and no " "ambient occlusion.") /// ((Triforce, 11-23) the Texture filtering row: nothing for its value; while Evil HD is on, that it is 16x whatever is chosen const char* hn_aniso(int, int variant) { static const char* const evil = "Evil HD is on: 16x, whatever is chosen here."; if (variant < 0) return opts.evil_hd ? evil : nullptr; return variant == 0 ? evil : nullptr; } /// The Texture detail: the value chosen; variant 1: set for this run by RX_VK_TEX_DETAIL; ((Triforce) 4: Evil HD on) const char* hn_tex_detail(int v, int variant) { static const char* const t[] = { "By this graphics card's video memory: Full from 12 GB (never on integrated graphics), Reduced on 8 and 10 GB cards, " "Low under that. The value shows what it gives here.", "Every texture whole. On a card with less than 12 GB the video memory can run out, and the frame rate then falls to a " "fraction.", "The game's large textures at half their size each way, a quarter of their video memory. Text, icons and the HUD stay " "whole.", "As Reduced, and the largest textures at a quarter of their size each way.", }; static const char* const env[] = {"Full for this run (RX_VK_TEX_DETAIL=full), whatever is chosen here.", "Reduced for this run (RX_VK_TEX_DETAIL=reduced), whatever is chosen here.", "Low for this run (RX_VK_TEX_DETAIL=low), whatever is chosen here."}; static const char* const evil = "Evil HD is on: Full from the next start, whatever is chosen here."; if (variant < 0) variant = tex_detail_env() >= 0 ? 1 + tex_detail_env() : opts.evil_hd ? 4 : 0; if (variant == 0) return t[(unsigned)v < sizeof t / sizeof t[0] ? v : 0]; return variant <= 3 ? env[variant - 1] : variant == 4 ? evil : nullptr; } // ((Triforce) 11-24) The Detail rows. Shadow resolution (opts.shadow_res): the sun's cascades at the game's own sizes // (host/oot_shadow.c; on Highest the nearest one kept steady, host/oot_shadow_fit.c). Game's is the default: as shipped const char* tx_shadow_res(int v) { static const char* const t[] = {"Game's", "High", "Highest"}; return t[(unsigned)v < 3 ? v : 0]; } MENU_HINTS(hn_shadow_res, 0, "1600 pixels a side, the console's. About 31 MB of video memory.", "2200 pixels a side. About 58 MB of video memory.", "3072 pixels a side, the game's own highest, and the shadows near you shimmer less while the camera moves. About " "113 MB of video memory.") // ((Triforce) 11-24) Colour vision correction (opts.colour_vision; colour_vision.h): the finished picture's colours moved onto // an axis the player sees. Off is the default: the picture as the game makes it const char* tx_colour_vision(int v) { static const char* const t[] = {"Off", "Protan (red-green)", "Deutan (red-green)", "Tritan (blue-yellow)"}; return t[(unsigned)v < 4 ? v : 0]; } MENU_HINTS(hn_colour_vision, 0, "The picture's colors as the game makes them.", "For protanopia and protanomaly: reds told apart from greens, the difference moved towards blue and yellow.", "For deuteranopia and deuteranomaly: greens told apart from reds, the difference moved towards blue and yellow.", "For tritanopia and tritanomaly: blues told apart from yellows, the difference moved towards red and green.") // (Grass distance (opts.grass_distance): the short grass blades' reach, vk_draw.cpp grass_reach. Game's is the default) const char* tx_grass_distance(int v) { static const char* const t[] = {"Game's", "2x", "3x", "4x"}; return t[(unsigned)v < 4 ? v : 0]; } MENU_HINTS(hn_auto_pc, 0, "The rows are as you set them.", "Set for this PC: the log says what was chosen and why. A new graphics card chooses again.") /// (Triforce) Opaque textures as BC1 (opts.tex_bc1, tex_bc1.h): nothing about the value itself; variants 0 and 1: /// RX_VK_TEX_BC1 decides for this run, off or on const char* hn_tex_bc1(int, int variant) { static const char* const t[] = {"Off for this run (RX_VK_TEX_BC1=0), whatever is chosen here.", "On for this run (RX_VK_TEX_BC1), whatever is chosen here."}; if (variant < 0) { static const char* const e = getenv("RX_VK_TEX_BC1"); return !e || !*e ? nullptr : t[atoi(e) != 0]; } return variant < 2 ? t[variant] : nullptr; } // ((Triforce) 11-24) The Audio tab's Test microphone row: while on, the chosen microphone's level before and after the // Microphone gain row (host->mic_test, host/nn_audio_in.c), in the row's own cell as a meter; what goes on in the line under // its help. For this run only: never saved, and off as the Audio tab is left, the options close, the window loses the focus // or the Microphone row is Off (mic_test_tick) constexpr const char* kTestMic = "Test microphone"; // ((Triforce) 11-24) The System tab's NFC group: the Scan amiibo page (host/nn_nfp.c, the game folder's amiibo folder) for every // player, not only with the Debug tab's tools on. The same page as the Debug tab's row, which stays (names_open) constexpr const char* kNfcTag = "NFC tag"; bool mic_testing = false; int mic_levels[2] = {}, mic_test_state = 0; /// The Test microphone row's line under its help: what the meter shows, and what is wrong when something is const char* mic_test_line() { if (!(mic_test_state & HOS_MIC_TEST_ON)) return "Start the test, then play a note or hum: the bar shows how loud the microphone is after the gain."; static std::string line; line = !(mic_test_state & HOS_MIC_TEST_OPEN) ? "The microphone could not be opened." : !(mic_test_state & HOS_MIC_TEST_FRESH) ? "Waiting for the microphone's sound." : (mic_test_state & HOS_MIC_TEST_CLIP) ? "Too loud: the sound is clipped. Lower the Microphone gain." : "The first figure is the microphone's level, the second after the gain."; if (mic_test_state & HOS_MIC_TEST_STANDIN) line += " The default microphone stands in for the one chosen."; return line.c_str(); } const char* tx_percent(int v) { static char b[8]; snprintf(b, sizeof b, "%d%%", v); return b; } // (local, RenoDX port: vk_renodx.cpp) const char* tx_rdx_tonemap(int v) { return v == 2 ? "RenoDRT" : v ? "PsychoV35" : "Vanilla"; } // (Triforce: RenoDRT) const char* tx_rdx_gamma(int v) { return v == 1 ? "2.2" : v == 2 ? "BT.1886 (2.4)" : "Off"; } // (Triforce) const char* tx_rdx_midgray(int v) { return v == 1 ? "Vanilla" : v == 2 ? "Eye adaptation" : "Render"; } const char* tx_rdx_space(int v) { return v == 1 ? "BT.709" : v == 2 ? "DCI-P3" : "Vanilla"; } const char* tx_rdx_grade(int v) { static char b[8]; snprintf(b, sizeof b, "%d", v); return b; } // The output the menu's sizes are shown for: the Output resolution row's (applied at the next start), so the rows below follow a change // at once; the handheld profile runs the game's own (1536x864) struct Out { uint32_t w, h; }; // ((Triforce, 11-16, the owner: "Add a resolution of 5120x2160 before 5120x2880") 6 is 5120x2160, after the others so that the // saved numbers keep their sizes. (Triforce) 8 Screen and 9 Custom take their sizes from outside the build. The rule for all of // them is output_sizes.h's: the size is the picture's, the game's frame 16:9 at its height constexpr Out kOutputs[] = {{2048, 1152}, {2560, 1440}, {3840, 2160}, {1920, 1080}, {5120, 1440}, {5120, 2880}, {5120, 2160}, {1536, 864}}; static_assert(std::size(kOutputs) == OUTPUT_FIXED_N); constexpr int kLastOutput = OUTPUT_LAST; int output_choice(int v) { return v >= 0 && v <= kLastOutput ? v : 0; } // The connected screens as the host found them at the start (MkwVkHost.screens, at menu_init): each one's native size, the // size the game takes it at (output_size_used: {0, 0} for none), the monitor's own name, and whether the window opens on it. // The row offers each one's size; what is saved is that size, as Custom's (output_width=, output_height=), never a place in // this list: the same file means the same picture with other screens connected, and a size whose screen is gone is Custom struct Screen { Out native, used; std::string name; bool opens; }; std::vector screens; void screen_add(uint32_t w, uint32_t h, const char* name, bool opens) { unsigned uw = 0, uh = 0; if (!output_size_used(w, h, &uw, &uh)) return; screens.push_back(Screen{Out{w, h}, Out{uw, uh}, name ? name : "", opens}); } /// The screen the window opens on, nullptr when the host knows none const Screen* screen_opening() { for (const Screen& s : screens) if (s.opens) return &s; return nullptr; } /// The main monitor's size, for an options file from before options_version 6 whose Ultrawide row was Monitor's shape: the /// one the host reads that row by (host/hos_main.c, host/nn_applet.c: GetSystemMetrics). Off Windows that is the desktop's /// main display (host/posix/win32_posix.c, display_sdl.c), which is the screen the window opens on; the renderer has no /// GetSystemMetrics there, and takes it from the host's screens. {0, 0} when none is known: 16:9, for the host as well Out main_screen() { #ifdef _WIN32 return Out{(uint32_t)std::max(GetSystemMetrics(SM_CXSCREEN), 0), (uint32_t)std::max(GetSystemMetrics(SM_CYSCREEN), 0)}; #else return screen_opening() ? screen_opening()->native : Out{0, 0}; #endif } /// The connected screens of a size, as the game takes them, by name: "LG ULTRAGEAR", "2x LG ULTRAGEAR", "DELL U2720Q, LG /// ULTRAGEAR"; one the system gives no name is "Screen". "" when no screen has that size std::string screen_names(Out size) { std::vector> names; for (const Screen& s : screens) { if (s.used.w != size.w || s.used.h != size.h) continue; const std::string name = s.name.empty() ? "Screen" : s.name; const auto at = std::find_if(names.begin(), names.end(), [&](const auto& n) { return n.first == name; }); if (at == names.end()) names.push_back({name, 1}); else at->second++; } std::string all; for (const auto& [name, count] : names) all += (all.empty() ? "" : ", ") + (count > 1 ? std::to_string(count) + "x " : std::string()) + name; return all; } /// HOS_OUTPUT_SIZE's size, which the host takes over the Custom rows for the run: true and the sides while it is set (a /// value that is not x: 0 x 0, no size, as the host) bool custom_env(long* w = nullptr, long* h = nullptr) { const char* e = getenv("HOS_OUTPUT_SIZE"); if (!e) return false; long ew = 0, eh = 0; if (!output_parse_size(e, &ew, &eh)) ew = eh = 0; if (w) *w = ew; if (h) *h = eh; return true; } /// Custom's size as the game takes it: the Output width and Output height rows' (HOS_OUTPUT_SIZE's over them) within what a /// picture can be, output_size_used; {0, 0} for none (a HOS_OUTPUT_SIZE that is not a size) Out custom_size() { long w = opts.output_width, h = opts.output_height; custom_env(&w, &h); unsigned uw = 0, uh = 0; return output_size_used(w, h, &uw, &uh) ? Out{uw, uh} : Out{0, 0}; } /// The Custom rows' values from the options file's output_width= and output_height= (0: no line), at menu_init: as written /// where the rows can hold them, else the size the game takes them as (output_size_used: its shape kept, which keeping each /// row to its own ends would not), so that the menu shows and saves what the host ran (host/nn_applet.c flex_read) void custom_rows_read(long w, long h) { output_custom_read(&w, &h); unsigned uw = 0, uh = 0; const bool held = w >= OUTPUT_MIN_W && w <= OUTPUT_MAX_W && h >= OUTPUT_MIN_H && h <= OUTPUT_MAX_H; if (!held && output_size_used(w, h, &uw, &uh)) w = uw, h = uh; opts.output_width = (int)w, opts.output_height = (int)h; } // While a screen occupies the two active output fields, retain the player's unrounded Custom input. Out remembered_custom{}; void restore_custom() { if (!remembered_custom.h) return; opts.output_width = (int)remembered_custom.w; opts.output_height = (int)remembered_custom.h; remembered_custom = {}; } void choose_screen(Out size) { if (!remembered_custom.h) remembered_custom = Out{(unsigned)opts.output_width, (unsigned)opts.output_height}; unsigned w, h; if (output_size_used(remembered_custom.w, remembered_custom.h, &w, &h) && w == size.w && h == size.h) { restore_custom(); return; } opts.output_width = (int)size.w; opts.output_height = (int)size.h; } void read_remembered_custom(const char* text) { long w = 0, h = 0; if (output_parse_size(text, &w, &h) && w >= OUTPUT_MIN_W && w <= OUTPUT_MAX_W && h >= OUTPUT_MIN_H && h <= OUTPUT_MAX_H) remembered_custom = Out{(unsigned)w, (unsigned)h}; } /// The size of a saved value: a fixed one's, Custom's, or the old Screen's ({0, 0}: none) Out row_size(int v) { v = output_choice(v); if (v == OUTPUT_SCREEN) return screen_opening() ? screen_opening()->used : Out{0, 0}; // (the old Screen value: as the host) return v < OUTPUT_SCREEN ? kOutputs[v] : custom_size(); } /// The size a choice runs at: the row's, 2560x1440 when Screen or Custom has none, as the host Out output_size_of(int v) { const Out s = row_size(v); return s.h ? s : kOutputs[1]; } /// Whether a choice's size has a shape of its own, not 16:9: its picture is that size, and the Ultrawide row has nothing to /// choose (docked only: the handheld profile runs the game's own output) bool output_shaped(int v) { const Out s = output_size_of(v); return opts.output_res != merged_rows::kHandheldOutput && output_size_shaped(s.w, s.h); } /// The game's frame for a choice, its HUD, menus and story movies: the size, or 16:9 at its height when it has another shape Out output_frame(int v) { const Out s = output_size_of(v); return output_size_shaped(s.w, s.h) ? Out{output_frame_width(s.h), s.h} : s; } /// HOS_ASPECT's shape, which the host takes over the Output resolution's and the Ultrawide row's for the run; 0 when not set float aspect_env() { const char* e = getenv("HOS_ASPECT"); return e ? (float)atof(e) : 0.0f; } /// The picture the options give at the next start, as host/hos_main.c makes it (output_picture): the Output resolution's size /// when it has its own shape, else its height in the Ultrawide row's shape (HOS_ASPECT's over both). 2048x1152 is the game's /// 2560x1440 at its graphics scale 0.8 (host/nn_applet.c), its wider picture too Out output_picture_of(int v, int ultrawide_row) { v = output_choice(v); const Out size = output_size_of(v), frame = v ? output_frame(v) : kOutputs[1]; const bool env = getenv("HOS_ASPECT") != nullptr; const bool sized = !env && output_size_shaped(size.w, size.h); const double want = env ? aspect_env() : sized ? (double)size.w / (double)size.h : ultrawide_row_ratio(ultrawide_row); unsigned w = 0, h = 0; if (!output_picture(frame.h, want, sized, &w, &h)) return v ? frame : kOutputs[0]; return v ? Out{w, h} : Out{w * 4 / 5, h * 4 / 5}; } /// ((Triforce) the sizes of the screen the game's window is on, its display modes and the common sizes of each shape up to its /// size, as the game takes them (output_modes.h; read_mode_sizes, as the menu opens): none until then std::vector mode_list; // The row's choices: the fixed sizes, each connected screen's size that is not one of those (once for screens of one size), and // Custom where its size is not a screen's. Smallest to largest, by width and then height; of one size a fixed one first; one // with no size at the end. A choice is saved as its value: a fixed size's number, or OUTPUT_CUSTOM with the size in the Output // width and Output height rows, which choosing a screen's size fills in with the size the game takes that screen at (size; // native: that screen's own, {0, 0} for a choice that is no screen's) struct OutEntry { int id; Out size, native; }; std::vector output_entries() { std::vector e; const auto has = [&](int id, Out s) { return std::any_of(e.begin(), e.end(), [&](const OutEntry& x) { return x.id == id && x.size.w == s.w && x.size.h == s.h; }); }; // (a screen of a fixed size is that fixed choice, the same picture; but not of 2048x1152, which is the game's 2560x1440 at // its own scale and not a 2048x1152 picture) const auto fixed = [](Out s) { for (int v = 1; v < OUTPUT_FIXED_N; v++) if (v != merged_rows::kHandheldOutput && kOutputs[v].w == s.w && kOutputs[v].h == s.h) return true; return false; }; for (int v = 0; v < OUTPUT_FIXED_N; v++) e.push_back(OutEntry{v, kOutputs[v], Out{0, 0}}); // (HOS_OUTPUT_SIZE is Custom's size for the run: a screen's size cannot be chosen then) for (const Screen& s : screens) if (!custom_env() && !fixed(s.used) && !has(OUTPUT_CUSTOM, s.used)) e.push_back(OutEntry{OUTPUT_CUSTOM, s.used, s.native}); // ((Triforce) the screen's display modes and the common sizes of each shape: chosen, Custom with that size, as a screen's) for (const Out& m : mode_list) if (!custom_env() && !fixed(m) && !has(OUTPUT_CUSTOM, m)) e.push_back(OutEntry{OUTPUT_CUSTOM, m, m}); // (the old Screen value, only while it is still what is chosen: menu_init makes it the screen's size, output_adopt_screen) if (output_choice(opts.output_res) == OUTPUT_SCREEN) e.push_back(OutEntry{OUTPUT_SCREEN, row_size(OUTPUT_SCREEN), Out{0, 0}}); // A fixed choice can have a remembered Custom in an edited file. Only the remembered pair is restored. if ((opts.output_res == OUTPUT_CUSTOM || !remembered_custom.h || custom_env()) && !has(OUTPUT_CUSTOM, custom_size())) e.push_back(OutEntry{OUTPUT_CUSTOM, custom_size(), Out{0, 0}}); if (remembered_custom.h && !custom_env()) { unsigned w, h; if (output_size_used(remembered_custom.w, remembered_custom.h, &w, &h) && !has(OUTPUT_CUSTOM, Out{w, h})) e.push_back(OutEntry{OUTPUT_CUSTOM, Out{w, h}, Out{0, 0}}); } const auto key = [](const OutEntry& x) { return x.size.h ? (uint64_t)x.size.w << 32 | x.size.h : ~0ull; }; std::stable_sort(e.begin(), e.end(), [&](const OutEntry& a, const OutEntry& b) { return key(a) < key(b); }); return e; } /// The choice the options have now: the saved value's, and for Custom the one of its size (a screen's, or Custom itself) int output_entry_now(const std::vector& e) { const int v = output_choice(opts.output_res); const Out c = custom_size(); for (size_t i = 0; i < e.size(); i++) if (e[i].id == v && (v != OUTPUT_CUSTOM || (e[i].size.w == c.w && e[i].size.h == c.h))) return (int)i; return 0; } /// A choice as the row shows it: the size, with the names of the connected screens that have it ("3840x1600 (LG ULTRAGEAR)"); /// Custom with its size std::string output_label(const OutEntry& x) { if (!x.size.h) return x.id == OUTPUT_SCREEN ? "Screen (not known)" : "Custom (not set)"; if (x.id == merged_rows::kHandheldOutput) return "1536x864 (handheld)"; const std::string size = std::to_string(x.size.w) + "x" + std::to_string(x.size.h); if (x.id == OUTPUT_CUSTOM && !x.native.h) return "Custom (" + size + ")"; if (x.id == 0) return size; // (the game's own: no screen's size, output_entries) const std::string names = screen_names(x.size); return names.empty() ? (x.id == OUTPUT_SCREEN ? "Screen (" + size + ")" : size) : size + " (" + names + ")"; } /// One choice down or up the row (dir -1 or 1): false at its end. With apply the options take it: its value, and a /// screen's size as Custom's bool output_step(int dir, bool apply) { const std::vector e = output_entries(); const int at = output_entry_now(e), to = std::clamp(at + dir, 0, (int)e.size() - 1); if (to == at) return false; if (apply) { opts.output_res = e[to].id; // (the size as the game takes it, which the rows can always hold: a 7680x4320 screen's is 5120x2880, not each side cut // to the rows' ends, which would be another shape) if (e[to].native.h) choose_screen(e[to].size); else restore_custom(); } return true; } /// An options file's output_res=8, Screen (and HOS_OUTPUT_RES=8): the size of the screen the window opens on, which /// is what the host ran it as at this start (host/nn_applet.c). The menu keeps it as that size, Custom's, so that the next /// save writes a size and not "whichever screen" (a fixed size's number where it is one); with no screen known, the /// 2560x1440 the host ran. Left alone while /// HOS_OUTPUT_SIZE is Custom's size void output_adopt_screen() { if (output_choice(opts.output_res) != OUTPUT_SCREEN || custom_env()) return; const Screen* s = screen_opening(); opts.output_res = s ? OUTPUT_CUSTOM : 1; for (int v = 1; s && v < OUTPUT_FIXED_N; v++) // (a screen of a fixed size: that fixed choice) if (v != merged_rows::kHandheldOutput && kOutputs[v].w == s->used.w && kOutputs[v].h == s->used.h) opts.output_res = v; if (s && opts.output_res == OUTPUT_CUSTOM) choose_screen(s->used); } /// The picture the menu's sizes are shown for (the Render resolution's, the performance panel's) Out shown_output() { return opts.output_res == merged_rows::kHandheldOutput ? Out{1536, 864} : output_picture_of(opts.output_res, opts.ultrawide); } // The size the game draws the 3D at for a fixed scale of its output, a twelfth of it: every twelfth asked came out exact at the three // outputs (2048x1152: 0.58 drew 1195x672, 0.6667 1366x768). So the scale the game is given is the twelfth too: 0.67 drew 2615x1471 at // 3840x2160, not the 2560x1440 of 8/12. int twelfths(float scale) { return std::min(std::max((int)(scale * 12.0f + 0.5f), 1), 12); } void game_size(float scale, uint32_t& w, uint32_t& h) { const Out o = shown_output(); const int k = twelfths(scale); w = (o.w * k + 11) / 12, h = o.h * k / 12; } const char* tx_resolution(int v) { static char b[48]; const int up = upscaler(); if (ur::full_scale(up)) return "Native (100%)"; // ((Triforce, options_version 7) DLAA, FSR 4's and FSR 3.1's native AA) v = ur::snap(up, v); // ((Triforce) 11-24: the Upscaler's own step for the saved scale, which stays the player's: set_row) if (!ur::percent(v)) return "Auto (dynamic)"; // ((Triforce) Intel XeSS: the preset whose range holds the share, upscaler_rows.h xess_mode_name) if (const char* mode = up == ur::XESS ? ur::xess_mode_name(v) : ur::scales_by_mode(up) ? ur::dlss_mode_name(v) : nullptr) { snprintf(b, sizeof b, "%s (%d%%)", mode, ur::percent(v)); return b; } uint32_t w, h; game_size(ur::percent(v) / 100.0f, w, h); snprintf(b, sizeof b, "%d%% (%ux%u)", ur::percent(v), w, h); return b; } /// The Render resolution: the value chosen, for the Upscaler shown (every one: each value with each Upscaler) const char* hn_resolution(int v, int variant) { const int up = variant < 0 ? std::clamp(upscaler(), 0, ur::kUpscalers - 1) : variant; if (up >= ur::kUpscalers) return nullptr; if (ur::full_scale(up)) // ((Triforce, options_version 7) Native (100%): the engine's native anti-aliasing) // ((Triforce, FSR4-2) chosen in play, the engine scales the smaller 3D up to the output until the next start) return "The 3D at the output's full size, its edges smoothed by the upscaler: the sharpest, and the slowest. The 3D " "takes its full size at the next start."; const int p = ur::percent(ur::snap(up, v)); // ((Triforce) 11-24: as tx_resolution shows it) if (up == ur::DLSS) { switch (p) { case 0: return "The game lowers it when the GPU is busy, and DLSS follows."; case 67: return "DLSS's Quality mode: its sharpest from a smaller 3D."; case 58: return "DLSS's Balanced mode, between Quality and Performance."; case 50: return "DLSS's Performance mode: faster, and softer."; case 33: return "DLSS's Ultra Performance mode: its fastest, and its softest."; default: return nullptr; // (not one of DLSS's steps: the row moves to one) } } if (up == ur::FSR3 || up == ur::FSR4) { // (the same modes, AMD's ratios) switch (p) { case 0: return "The game lowers it when the GPU is busy, and FSR follows."; case 67: return "FSR's Quality mode, 1.5x: its sharpest."; case 58: return "FSR's Balanced mode, 1.7x."; case 50: return "FSR's Performance mode, 2x: faster, and softer."; case 33: return "FSR's Ultra Performance mode, 3x: its fastest, and its softest."; default: return nullptr; // (not one of FSR's steps: the row moves to one) } } if (up == ur::XESS) { // ((Triforce) each step under the XeSS preset whose range holds it: xess_rules.h) switch (p) { case 0: return "The game lowers it when the GPU is busy, and XeSS follows."; case 67: return "XeSS's Ultra Quality mode, 1.5x: its sharpest from a smaller 3D."; case 58: return "Between XeSS's Quality and Balanced, under its Balanced mode, 2x."; case 50: return "XeSS's Balanced mode, 2x: faster, and softer."; case 33: return "XeSS's Ultra Performance mode, 3x: its fastest, and its softest."; default: return nullptr; // (not one of its steps: the row moves to one) } } if (!p) return "The game lowers it when the GPU is busy."; if (p == 100) return "The 3D at the output's full size: the sharpest, and the slowest."; return "A steady size: lower is faster, and softer."; } /// (Triforce) The Anti-aliasing row (aa_rows.h, vk_aa.h): its choice, RX_VK_AA's for the run over it; while DLSS or FSR /// draws, whose anti-aliasing the picture has instead const char* tx_aa(int v) { if (n64_in_front() != n64_rules::OFF) return "N64 Classic"; // ((Triforce, N64 Classic) its grid smooths the edges) const int up = upscaler(); if (ur::is_dlss(up)) return "DLSS's own"; if (ur::is_xess(up)) return "XeSS's own"; // ((Triforce) Intel XeSS) if (aa_rows::upscaler_own(up)) return "FSR's own"; return aa_rows::name(aa_rows::chosen(v, aa_env_choice())); } /// The Anti-aliasing: the value chosen (variant 0); that it does not apply while NVIDIA DLSS or DLAA (1) or AMD FSR (2) /// draws; that RX_VK_AA set it for this run (3); that the game's pass was not there to replace (4); ((Triforce) that it does /// not apply while Intel XeSS draws (6) const char* hn_aa(int v, int variant) { static const char* const t[aa_rows::kValues] = { "The game's own SMAA, as on the console.", "None: the 3D's edges as they were drawn. The sharpest, with stair steps on edges and shimmer on thin things.", "FXAA in place of the game's SMAA: a fast smoothing of the finished 3D's edges, a little softer on fine detail.", "SMAA at its highest preset in place of the game's own: long and diagonal edges smoother, for more GPU time."}; static const char* const own[2] = { "NVIDIA DLSS and DLAA smooth the 3D's edges themselves, from frames the game's SMAA has not been over: nothing to set " "here. The choice is kept for the game's own upscaler.", "AMD FSR smooths the 3D's edges itself, from frames the game's SMAA has not been over: nothing to set here. The choice " "is kept for the game's own upscaler."}; static const char* const env = "Set for this run by RX_VK_AA, whatever is chosen here."; static const char* const missing = "No frame of the last minute had the game's own anti-aliasing pass to replace (a screen without the 3D, or another " "version of the game): the picture is the game's."; static const char* const n64 = // ((Triforce, N64 Classic) variant 5) "N64 Classic draws the 3D on its own grid, which smooths the edges: nothing to set here while it is on. The choice is " "kept for when it is off."; if (variant < 0) { const int up = upscaler(); const bool asked = aa_rows::chosen(evil_hd::aa(opts.evil_hd, v), aa_env_choice()) != aa_rows::GAME; variant = n64_in_front() != n64_rules::OFF ? 5 : ur::is_dlss(up) ? 1 : ur::is_xess(up) ? 6 : aa_rows::upscaler_own(up) ? 2 : asked && aa_state() == aa_rows::MISSING ? 4 : aa_env_choice() >= 0 ? 3 : opts.evil_hd ? 7 : 0; } switch (variant) { case 0: return t[v >= 0 && v < aa_rows::kValues ? v : 0]; case 1: return own[0]; case 2: return own[1]; case 3: return env; case 4: return missing; case 5: return n64; case 6: // ((Triforce) Intel XeSS) return "Intel XeSS smooths the 3D's edges itself, from frames the game's SMAA has not been over: nothing to set here. " "The choice is kept for the game's own upscaler."; case 7: return "Evil HD is on: SMAA Ultra, whatever is chosen here."; // ((Triforce, 11-23) evil_hd.h) default: return nullptr; } } int shape_owner(); // ---- ((Triforce, 11-22, N64 Classic, step 5) its row and the Remembered page (n64_rules.h; vk_n64.cpp) ---- void save(); // (below) /// The N64 Classic row: its value's name, RX_VK_N64's for the run over it const char* tx_n64(int v) { return n64_rules::name(n64_env_set() ? n64_preset() : v); } /// The N64 Classic row: the value chosen (variant 0), or that RX_VK_N64 set it for this run (1) const char* hn_n64(int v, int variant) { static const char* const t[n64_rules::kPresets] = { "The remake as it is.", "The 1998 cartridge on a TV of then: the 3D on 240 lines with 16-bit colour and its dither, blurry textures, scanlines " "and a curved screen, at 20 frames a second. Always the same.", "How you remember it: sharper and richer than the real thing. Set it to your taste in Remembered settings."}; static const char* const env = "Set for this run by RX_VK_N64, whatever is chosen here."; if (variant < 0) variant = n64_env_set() ? 1 : 0; if (variant == 0) return t[v >= 0 && v < n64_rules::kPresets ? v : 0]; return variant == 1 ? env : nullptr; } const char* tx_n64_fps(int v) { static const char* const t[] = {"Frame rate cap", "60", "30", "20 (1998)", "17 (1998, 50 Hz)"}; return t[std::clamp(v, 0, 4)]; } const char* tx_n64_lines(int v) { static const char* const t[] = {"240 lines", "360 lines", "480 lines", "720 lines"}; return t[std::clamp(v, 0, 3)]; } const char* tx_n64_colour(int v) { static const char* const t[] = {"15-bit (1998)", "18-bit", "Full"}; return t[std::clamp(v, 0, 2)]; } const char* tx_n64_dither(int v) { static const char* const t[] = {"Off", "Light", "Full"}; return t[std::clamp(v, 0, 2)]; } const char* tx_n64_blur(int v) { static char b[16]; if (v <= 0) return "Off"; snprintf(b, sizeof b, "+%.1f", v * n64_rules::kBlurStep); return b; } const char* tx_n64_mask(int v) { static const char* const t[] = {"Auto", "Off", "Aperture grille", "Slot mask", "Shadow mask"}; return t[std::clamp(v, 0, 4)]; } const char* tx_n64_bleed(int v) { static const char* const t[] = {"Off", "Light", "Composite"}; return t[std::clamp(v, 0, 2)]; } const char* tx_n64_curve(int v) { static const char* const t[] = {"Flat", "Slight", "Curved", "Very curved"}; return t[std::clamp(v, 0, 3)]; } /// A Remembered page row's place in n64_rules::Rows (its value is opts.n64_rem's), -1 for any other value int n64_rem_row(const int* value) { const int* first = &opts.n64_rem[0]; return value && value >= first && value < first + n64_rules::kRows ? (int)(value - first) : -1; } /// The Graphics tab's row that opens the Remembered page (the TAB_N64 rows), as the Motion row opens the Motion page bool is_n64_page_row(const Row& r) { return r.tab == TAB_GRAPHICS && !r.value && !strcmp(r.name, "Remembered settings"); } /// ((Triforce, 11-24) the Graphics tab's row that opens the Simulated turf page (the TAB_SIM_TURF rows), and the page's action bool is_sim_turf_page_row(const Row& r) { return r.tab == TAB_GRAPHICS && !r.value && !strcmp(r.name, "Simulated turf"); } bool is_sim_turf_reset_row(const Row& r) { return r.tab == TAB_SIM_TURF && !r.value && !strcmp(r.name, "Reset current area"); } /// (the page's rows by Use global multipliers: on, the four multipliers of every area's own values; off, this area's own four /// values and its Reset) bool sim_turf_row_shown(const Row& r) { namespace sts = sim_turf_settings; if (r.tab != TAB_SIM_TURF || r.value == &sts::global) return true; for (int& m : sts::multipliers) if (r.value == &m) return sts::global != 0; return sts::global == 0; } const char* hn_sim_turf_area(int, int variant) { return variant <= 0 ? sim_turf_area_note() : nullptr; } const char* hn_sim_turf_reset(int, int variant) { if (variant > 0) return nullptr; if (variant == 0) return "This area already has the game's own values."; return !sim_turf_ready() ? "Go to an area first." : sim_turf_can_reset() ? nullptr : "This area already has the game's own values."; } /// The Remembered page's two actions: 1 Copy Faithful, 2 Reset to defaults; 0 another row int n64_action(const Row& r) { if (r.tab != TAB_N64 || r.value) return 0; return !strcmp(r.name, "Copy Faithful") ? 1 : !strcmp(r.name, "Reset to defaults") ? 2 : 0; } /// An action pressed: Faithful's values into Remembered's rows (20 frames a second too), or Remembered's defaults; saved void n64_act(int action) { if (action != 1 && action != 2) return; const n64_rules::Rows to = action == 1 ? n64_rules::kFaithful : n64_rules::defaults(); std::copy(std::begin(to.v), std::end(to.v), opts.n64_rem); save(); } /// A row with nothing else to choose here: shown without its arrows, Left and Right leave it (and the saved value) alone bool row_fixed(const int* value) { // ((Triforce) the Ultrawide row while the Output resolution's own shape or HOS_ASPECT is the picture's; the Custom rows // while HOS_OUTPUT_SIZE is Custom's size) if (value == &opts.ultrawide && shape_owner() != 0) return true; if ((value == &opts.output_width || value == &opts.output_height) && custom_env()) return true; // ((Triforce, options_version 7) the rows that showed fixed where they could do nothing (Reflex, Anti-Lag, the window's // filter, the Render resolution with a native AA) are hidden there, or gone: row_shown) return (value == &opts.aa && aa_rows::fixed(upscaler(), aa_env_choice() >= 0)) || (value == &opts.dlss && ur::upscaler_fixed(upscalers_available())) || (value == &opts.dlss_model && ur::model_fixed(upscaler(), dlss_preset_env() != nullptr)) || (value == &opts.fsr4_model && ur::fsr4_model_fixed(upscaler(), fsr4_model_env() >= 0)) || // ((Triforce)) // ((Triforce, 11-22, N64 Classic) the Upscaler and the Anti-aliasing while its 3D pass draws in their place; its own // row with RX_VK_N64 set for the run; a Remembered row with nothing to do (n64_rules.h row_fixed) ((value == &opts.dlss || value == &opts.aa) && n64_in_front() != n64_rules::OFF) || (value == &opts.n64_classic && n64_env_set()) || (n64_rem_row(value) >= 0 && n64_rules::row_fixed(n64_rules::rows_of(opts.n64_rem), n64_rem_row(value))); } const char* tx_output_res(int v) { static char b[200]; const std::vector e = output_entries(); v = output_choice(v); if (v == merged_rows::kHandheldOutput) return "1536x864 (handheld)"; size_t at = (size_t)output_entry_now(e); if (e[at].id != v) { // (not the value chosen: a fixed size's own choice, or Custom's) for (size_t i = 0; i < e.size(); i++) if (e[i].id == v && (e[at].id != v || !e[i].native.h)) at = i; } snprintf(b, sizeof b, "%s", output_label(e[at]).c_str()); return b; } /// (Triforce) The Output width and Output height rows (output_width=, output_height=): a side in pixels as chosen, or /// HOS_OUTPUT_SIZE's while it is set. What the game makes of the two is the Output resolution row's Custom (custom_size) const char* tx_custom_side(int v, bool height) { static char b[2][16]; long w = 0, h = 0; if (custom_env(&w, &h)) v = (int)(height ? h : w); if (v > 0) snprintf(b[height], sizeof b[height], "%d", v); else snprintf(b[height], sizeof b[height], "Not set"); return b[height]; } const char* tx_custom_width(int v) { return tx_custom_side(v, false); } const char* tx_custom_height(int v) { return tx_custom_side(v, true); } const char* tx_speed(int v) { return v ? "Real time" : "Per frame"; } const char* tx_text_speed(int v) { static const char* t[] = {"Normal", "2x", "4x", "Instant"}; if ((unsigned)v >= sizeof t / sizeof t[0]) return t[0]; return t[v]; } // (Triforce) The Text size row (host/oot_text_size.c, host/oot_play.h oot_text_size_scale has the scales) const char* tx_text_size(int v) { static const char* t[] = {"Normal", "110%", "125%", "150%", "175%"}; if ((unsigned)v >= sizeof t / sizeof t[0]) return t[0]; return t[v]; } // (Triforce) The Damage taken row (host/oot_damage.c, host/oot_play.h OOT_DAMAGE_*) const char* tx_damage_taken(int v) { static const char* const t[] = {"Half", "Normal", "Double", "Quadruple"}; return t[v >= 0 && v < 4 ? v : 1]; } // (Triforce) The Field of view row (host/oot_fov.c): percent of the game's own angle const char* tx_fov(int v) { static char b[24]; snprintf(b, sizeof b, v == 100 ? "100%% (the game's)" : "%d%%", v); return b; } const char* tx_ultrawide(int v) { // (Triforce: 1 to 4, the fixed shapes, ultrawide_rows.h; host/hos_main.c ultrawide_ratio) static const char* const t[] = {"16:9", "16:10", "21:9", "32:9", "4:3"}; return t[std::min(std::max(v, 0), 4)]; } /// A shape, width over height, by name: one of the Ultrawide row's where it is that one, else its width for a height of 1 /// (3840x1600: 2.40:1) const char* shape_name(double ratio) { static char b[16]; for (int row = 1; row <= 3; row++) if (fabs(ratio / (double)ultrawide_row_ratio(row) - 1.0) < 0.001) return tx_ultrawide(row); snprintf(b, sizeof b, "%.2f:1", ratio); return b; } /// What decides the picture's shape at the next start, as host/hos_main.c takes it: 2 HOS_ASPECT, 1 the Output resolution's /// own shape (a size that is not 16:9), 0 the Ultrawide row int shape_owner() { return getenv("HOS_ASPECT") ? 2 : output_shaped(opts.output_res) ? 1 : 0; } /// The picture's shape at the next start by name: the Ultrawide row's choice v, or the shape that is the picture's whatever /// is chosen there (shape_owner) const char* shape_now(int v) { const int owner = shape_owner(); if (owner == 0) return tx_ultrawide(v); if (owner == 2) return aspect_env() > 1.0f && !output_shape_is_game(aspect_env()) ? shape_name(aspect_env()) : tx_ultrawide(0); const Out o = output_size_of(opts.output_res); return shape_name((double)o.w / (double)o.h); } /// The Ultrawide row's value: its choice, or the shape the picture has whatever is chosen here, with where it comes from const char* tx_shape(int v) { static char b[48]; const int owner = shape_owner(); if (owner == 0) return tx_ultrawide(v); const Out o = output_size_of(opts.output_res); if (owner == 2) snprintf(b, sizeof b, "%s (HOS_ASPECT)", shape_now(v)); else snprintf(b, sizeof b, "%s (%ux%u)", shape_now(v), o.w, o.h); return b; } const char* tx_wide_hud(int v) { return v ? "Screen edges" : "Middle"; } // ((Triforce) The HUD placement row and Custom's rows (host/hos_wide_ui.c places the three groups at each present) const char* tx_hud_placement(int v) { return v ? "Custom" : "Game's"; } MENU_HINTS(hn_hud_placement, 0, "The hearts, buttons and minimap where the game puts them.", "Move and resize the hearts, the buttons and the minimap from their usual places.") bool hud_custom_row(const int* v) { return v == &opts.hud_health_x || v == &opts.hud_health_y || v == &opts.hud_health_scale || v == &opts.hud_buttons_x || v == &opts.hud_buttons_y || v == &opts.hud_buttons_scale || v == &opts.hud_minimap_x || v == &opts.hud_minimap_y || v == &opts.hud_minimap_scale; } int pack_placement(int x, int y, int scale) { return (x + 16) | ((y + 16) << 6) | (scale << 12); } const char* tx_prompts(int v) { static const char* t[HOS_PROMPT_N + 1] = {"Auto", "Switch", "Xbox", "PlayStation 4", "PlayStation 5", "Steam Deck", "Keyboard & mouse"}; return t[std::min(std::max(v, 0), (int)HOS_PROMPT_N)]; } // ((Triforce) 11-24) The Fullscreen screen row (opts.fs_screen): Automatic, the screen the window is on, or each connected // screen as the host listed them at the start, by its name and size (fs_screen_labels). The choice is kept by that label too // (fullscreen_screen_name), so the same screen is found when the list's order changes; one that is gone is Automatic. // host/display.c moves the window there (HOS_OPT_FULLSCREEN_SCREEN). Windows only: the row is not shown elsewhere std::vector fs_screen_labels; std::string fs_screen_want; // (the label the options file had, until menu_init has found it) const char* tx_fs_screen(int v) { if (v <= 0 || v > (int)fs_screen_labels.size()) return "Automatic"; return fs_screen_labels[(size_t)v - 1].c_str(); } const char* tx_gpu(int v) { static char buf[300]; const int idx = v - 1; if (v <= 0) snprintf(buf, sizeof buf, "Auto"); else if (idx < (int)gpu_device_names.size()) snprintf(buf, sizeof buf, "%d: %s", idx, gpu_device_names[idx].c_str()); else snprintf(buf, sizeof buf, "%d: Device %d", idx, idx); // (the whole name shows: the selected row slides through it, see marquee_pos) return buf; } const char* tx_pad_layout(int v); // (hookshot) the Microphone row: Off, the system's default, or one of the host's microphones (host/nn_audio_in.c: the // ocarina's input streams), told to the host by its name (host->mic_select) whenever it changes. The chosen one is kept by // its name, mic_want, also while it is unplugged: the row then has one more entry for it, " (not connected)", the // host lets the default stand in and opens it again once it is back, and the name stays in the ini. In the ini the name is // cut to kMicNameKept bytes (at a character's start), so the line fits the 80-byte readers of the file (host/nn_hid.c, // nn_applet.c, hos_main.c), and a name is matched by that much of it constexpr int kMaxMics = 64; constexpr size_t kMicNameKept = 60; std::string mic_want; // (the chosen microphone's name, cut to kMicNameKept; empty: Off or the default chosen) // ((Triforce) 11-20) the GPU device row's card by its name (triforce_options.ini gpu_device_name, written beside the number by // the launcher and by save below; empty: none saved, or Auto). pick_device finds the card by it (gpu_choice.h pick) std::string gpu_want; bool mic_missing = false; // (mic_want is not plugged in: the row's last entry, 2 + mic_listed, stands for it) int mic_listed = 0; // (the microphones as the host last listed them) bool can_mic() { return host && host->mic_count && host->mic_name && host->mic_select; } size_t text_char_start(const std::string& text, size_t at) { while (at > 0 && at < text.size() && ((unsigned char)text[at] & 0xc0) == 0x80) at--; return at; } std::string mic_key(const char* name) { std::string k(name ? name : ""); for (char& c : k) // (a device's name goes into triforce_options.ini: a line break in it would add lines there) if ((unsigned char)c < 0x20 || c == 0x7f) c = ' '; if (k.size() > kMicNameKept) k = k.substr(0, text_char_start(k, kMicNameKept)); // (and no spaces at the end: a saved line's end, made one above, and those an older build saved with the name) while (!k.empty() && k.back() == ' ') k.pop_back(); return k; } /// ((Triforce) 11-24) The Fullscreen screen row's label as the options file keeps it: mic_key's, cut so that its line fits the /// file's 80-byte readers std::string fs_key(const std::string& label) { std::string k = mic_key(label.c_str()); if (k.size() > 54) k = k.substr(0, text_char_start(k, 54)); while (!k.empty() && k.back() == ' ') k.pop_back(); return k; } /// buf cut back to whole UTF-8 characters (snprintf may have cut one) void utf8_whole(char* buf) { size_t n = strlen(buf), i = n; while (i > 0 && ((unsigned char)buf[i - 1] & 0xC0) == 0x80) i--; // (the last character's continuation bytes) if (i == 0) return; const unsigned char lead = (unsigned char)buf[i - 1]; const size_t want = lead >= 0xF0 ? 4 : lead >= 0xE0 ? 3 : lead >= 0xC0 ? 2 : 1; if (n - (i - 1) < want) buf[i - 1] = 0; } const char* tx_mic(int v) { static char buf[160]; if (v <= 0) return "Off"; if (v == 1) return "Default"; if (mic_missing && v == 2 + mic_listed) { const int room = (int)sizeof buf - (int)sizeof " (not connected)"; snprintf(buf, (size_t)room + 1, "%s", mic_want.c_str()); utf8_whole(buf); strcat(buf, " (not connected)"); return buf; } const char* n = can_mic() ? host->mic_name(v - 2) : ""; snprintf(buf, sizeof buf, "%s", n && *n ? n : "Microphone"); utf8_whole(buf); return buf; } // ((Triforce) 11-24) The Audio tab's Output device row: the default, or one of the host's playback devices // (host/audio_output_devices.c), told to the host by its endpoint id (host->audio_output_select), which the sound's thread // opens at its next block. The choice is kept by that id, output_want, never by the device's place or its name (two devices // can share one); also while it is unplugged: the row then has one more entry for it, " (not connected)", the default // stands in and the host tries it again. The options file's audio_output_device_id= and audio_output_device_name= (the name // for that entry); the row's own number is not saved (ini_row). HOS_AUDIO_DEVICE over it for a run struct OutputChoice { std::string id, name; }; std::vector output_devices; // (as the host last listed them) int output_pick = 0; // (the row: 0 the default, n the nth device, one past them the unplugged one) std::string output_want, output_saved_name; bool output_missing = false; bool can_outputs() { return host && host->audio_output_count && host->audio_output_info && host->audio_output_select && host->audio_output_state; } bool output_forced() { const char* e = getenv("HOS_AUDIO_DEVICE"); return e && *e; } /// An endpoint id as the file has it, or "" when it cannot be one: too long, or a control character in it std::string output_id_key(const char* text) { std::string s(text ? text : ""); while (!s.empty() && (s.back() == '\r' || s.back() == '\n')) s.pop_back(); if (s.size() >= HOS_OUTPUT_ID_CAP) return std::string(); for (const char c : s) if ((unsigned char)c < 0x20 || c == 0x7f) return std::string(); return s; } const char* tx_output_device(int v) { static std::string text; if (output_forced()) return "Set by HOS_AUDIO_DEVICE"; if (v <= 0) return "Default"; if (output_missing && v == (int)output_devices.size() + 1) { text = (output_saved_name.empty() ? std::string("The chosen device") : output_saved_name) + " (not connected)"; return text.c_str(); } if ((size_t)(v - 1) >= output_devices.size()) return "Default"; text = output_devices[(size_t)v - 1].name; int same = 0; // (two devices of one name: their places as well) for (const auto& d : output_devices) same += d.name == text; if (same > 1) text += " [" + std::to_string(v) + "]"; return text.c_str(); } const char* hn_output_device(int, int variant) { if (variant > 0) return nullptr; if (variant < 0) return "Where the game plays its sound. A change restarts only the sound, at once."; if (output_forced()) return "HOS_AUDIO_DEVICE chooses the device for this run. The row's choice is kept."; const int state = can_outputs() ? host->audio_output_state() : 0; if (state & HOS_OUTPUT_UNAVAILABLE) return "No device could be opened. The game keeps trying."; if (output_missing || (state & HOS_OUTPUT_FALLBACK)) return "The default plays for now. The chosen device is kept and tried again while the game runs."; return output_pick ? "This device, whatever the system's default is." : "The system's default playback device, as it changes."; } /// The Microphone row: Off, the default, a microphone of the list, or the chosen one while it is unplugged (variant 1) const char* hn_mic(int v, int variant) { if (v <= 0) return variant <= 0 ? "The game hears silence." : nullptr; if (v == 1) return variant <= 0 ? "The system's default recording device. On Windows, desktop apps must be allowed to use the " "microphone (Settings, Privacy & security)." : nullptr; const bool missing = variant < 0 ? mic_missing && v == 2 + mic_listed : variant == 1; if (variant > 1) return nullptr; return missing ? "Not plugged in: Default stands in until it is back." : "This microphone, by its name. A change applies at once."; } // (Triforce) The Game language row. The game's language is the host's to read, once, at the start: language.txt in the // game folder (host/nn_applet.c desired_language), which Setup writes at a build and which lists the game's languages; // HOS_LANGUAGE goes over it for a run. The row's entries are the languages that file names (game_language.h), and a choice // is written back into the file as its choice line, everything else in it as it was (lang_store, at each save). It is not // kept in triforce_options.ini. No row while the file is not there or names nothing to choose from namespace gl = game_language; int lang_entries[gl::kCount]; // (the row's entries: places in gl::kLanguages, in its order) int lang_count = 0; int lang_saved = -1; // (the entry language.txt chooses now: as read at the start, or as last written) bool lang_failed = false; // (the last choice could not be written: the row is back on the file's) const char* tx_language(int v) { // ((Triforce) each by its own name: Deutsch, ะ ัƒััะบะธะน, ๆ—ฅๆœฌ่ชž, in any menu language) return lang_count > 0 ? i18n::game_lang_name(lang_entries[std::min(std::max(v, 0), lang_count - 1)]) : ""; } /// The Game language: nothing about the value itself; variant 0: HOS_LANGUAGE decides for this run; variant 1: the choice /// could not be written const char* hn_language(int, int variant) { static const char* const env = "This run's language is set by HOS_LANGUAGE. The choice here is for runs without it."; static const char* const failed = "language.txt in the game folder could not be written: the language stays as it was."; if (variant < 0) { static const bool by_env = getenv("HOS_LANGUAGE") != nullptr; return lang_failed ? failed : by_env ? env : nullptr; } return variant == 0 ? env : variant == 1 ? failed : nullptr; } // ((Triforce) The Menu language row (opts.menu_lang): Auto, then each language by its own name (vk_menu_i18n.h). Not the // game's: the menu's texts alone, at once) const char* tx_menu_lang(int v) { if (v <= 0) return "Auto (game's language)"; return i18n::lang_name(v - 1); } const char* hn_menu_lang(int v, int variant) { // (a language of its own: the help says it all) return v <= 0 && variant <= 0 ? "Follows the game's language (language.txt in the game folder)." : nullptr; } const char* tx_rumble(int v) { return v ? tx_percent(v) : "Off"; } // ((Triforce) 11-24) Vibration (host/vibration.h): what plays each controller. Auto plays the best a controller can do, Basic // its motors, Off nothing; Rumble strength stays every backend's strength. The host writes back what plays the controller // used last (HOS_OPT_VIBRATION_STATUS: its kind times 16, plus what it says), which the row's help line says. const char* tx_vibration(int v) { static const char* t[] = {"Auto", "Basic", "Off"}; return (unsigned)v < 3 ? t[v] : t[0]; } std::atomic vibration_status_cache{0}; // (no controller until the host reports) int vibration_says() { return vibration_status_cache.load(std::memory_order_relaxed) % 16; } const char* vibration_why(int s) { static const char* t[] = { "No controller is connected.", "Vibration is Off.", "Its two motors play the game's vibration.", "Its own HD rumble plays the game's vibration as it is.", "Its voice coils play the game's fine vibration, through its USB cable.", "Its voice coils play the game's fine vibration over Bluetooth.", "All four of its motors play, the triggers' too.", "RenHDrum makes its HD rumble.", "Its fine haptics play through the sound card it has on a USB cable, which was not found: its motors play " "meanwhile.", "Its fine haptics need RenHDrum beside the game (renhdrum.dll, or renhdrum.so on Linux), which is not there: its " "motors play.", "Its Bluetooth connection can't be written to here, so its motors play; on a USB cable, its voice coils play the " "game's fine vibration.", "Its grips play the game's fine vibration. Experimental: made from one person's measurements of the controller."}; return (unsigned)s < sizeof t / sizeof t[0] ? t[s] : nullptr; } // ((Triforce) 11-24) the Controller speaker rows (host/pad_speaker.c): where each kind of sound plays, the sync, the headphones const char* tx_pad_speaker(int v) { return v == 1 ? "Controller only" : v == 2 ? "Controller + TV" : "Off"; } const char* tx_pad_headphones(int v) { return v == 1 ? "Controller sounds" : v == 2 ? "All sound" : "Off"; } const char* tx_pad_sync(int v) { // (above 0 the controller waits, below 0 the TV's copy of its sounds does) static char b[48]; if (v < 0) snprintf(b, sizeof b, "TV waits %d ms", -v); else if (v > 0) snprintf(b, sizeof b, "Controller waits %d ms", v); else snprintf(b, sizeof b, "%d ms", 0); return b; } // (under the Vibration row's help: what plays the controller used last now; every one, for the help's height) const char* hn_vibration(int v, int variant) { (void)v; return vibration_why(variant < 0 ? vibration_says() : variant); } const char* tx_volume(int v) { return v ? tx_percent(v) : "Muted"; } const char* tx_menu_sounds(int v) { return v ? tx_percent(v) : "Off"; } // (Triforce: the Menu sounds row) const char* tx_sprint(int v) { return v == 1 ? "Left stick click" : v == 2 ? "B" : "Off"; } const char* tx_sprint_mode(int v) { return v ? "Hold" : "Toggle"; } // (hookshot) Menu size: how large the overlays are drawn (vk_ui.h unit); Auto is Large in fullscreen at 1080 lines and up while // a controller is the menu's input, else Medium bool pad_last = false; // (a controller was the menu's last input: its buttons in the prompts) // (Auto's choice: the controller or not, decided as the menu opens by the input that opened it. A controller's input makes it // Large at any time; the keys and the mouse never make it smaller while the menu is open, so it never changes size under the // cursor) bool auto_pad = false; int pad_confirm = 0, pad_back = 1; // (the face buttons that confirm and go back, HOS_PAD_*: menu_keys::confirm_back, each tick) bool auto_large(uint32_t h) { return opts.fullscreen && h >= 1080 && auto_pad; } const char* tx_menu_size(int v) { static const char* t[] = {"Auto", "Small", "Medium", "Large"}; if (v == 0) return auto_large(dev.swap_extent.height) ? "Auto (Large)" : "Auto (Medium)"; return (unsigned)v < 4 ? t[v] : t[0]; } // (Triforce) a stick's own dead zone: XInput's own (~24%, the default), or 0% to 50%. ((Triforce, options_version 7) The shared // Stick dead zone row is gone: an older file's is each stick's own now, merged_rows.h migrate) const char* tx_own_dead_zone(int v) { return v < 0 ? "Default (24%)" : tx_percent(v); } // (Triforce) the Walk key row's keys, in host/nn_hid.c walk_key_code's order const char* tx_walk_key(int v) { static const char* t[] = {"Off", "Caps Lock", "Shift", "Ctrl", "Tab"}; return (unsigned)v < 5 ? t[v] : t[0]; } // (hookshot) Audio output: the speakers the game mixes for, read once at its start (host/nn_audio.c au_menu_output) const char* tx_audio_output(int v) { static const char* t[] = {"Auto", "Stereo", "5.1", "Mono"}; // ((Triforce) Mono: stereo's layout, averaged as it is mixed) return (unsigned)v < 4 ? t[v] : t[0]; } // (hookshot) the motion's deadzone: the console's three zero-drift modes, the rate under which the pad counts as still const char* tx_deadzone(int v) { static const char* t[] = {"Low", "Standard", "High"}; return t[v < 0 ? 0 : v > 2 ? 2 : v]; } const char* tx_robust(int v) { static const char* t[] = {"Auto", "Off", "On"}; return (unsigned)v < 3 ? t[v] : t[0]; } // ((Triforce, 11-24) the Debug tab's Compile shaders row (opts.compile_shaders; gpu/vk/compile_level.h) const char* tx_compile_shaders(int v) { return v == 1 ? "Most" : "All"; } MENU_HINTS(hn_compile_shaders, 0, "The shader preparation builds every pipeline it can before the title, as before: the longest preparation, the " "fewest compiles in play.", "The preparation leaves out the predicted pipelines (built behind the game while a menu or the title is shown) " "and the compute pipelines no list names: a shorter first preparation, and a short hitch where play first needs " "one of those.") const char* tx_mesh(int v) { return v == 1 ? "Compute fallback" : "Auto"; } // ((Triforce, 11-18) opts.mesh_mode, vk_main.cpp) // (Triforce) The Debug tab's Replay helper threads row (opts.replay_threads; vk_replay.cpp par_threads_max): Off, or the // parallel replay tried on 2 to 8 threads as RX_VK_PARALLEL_AUTO= does. The switches go over the row for a run const char* replay_threads_env() { static const char* const e = getenv("RX_VK_PARALLEL") ? "RX_VK_PARALLEL" : getenv("RX_VK_PARALLEL_AUTO") ? "RX_VK_PARALLEL_AUTO" : nullptr; return e; } const char* tx_replay_threads(int v) { // (Triforce: 8, Automatic, is the count replay_threads.h gives this PC, tried as the fixed counts are) static const char* const t[] = {"Off", "Auto, 2 threads", "Auto, 3 threads", "Auto, 4 threads", "Auto, 5 threads", "Auto, 6 threads", "Auto, 7 threads", "Auto, 8 threads", "Automatic"}; static_assert(replay_threads_of(1) == 2 && replay_threads_of(7) == 8 && !replay_threads_of(0) && !replay_threads_of(8)); static_assert(replay_threads::kRowAutomatic == 8 && replay_threads::of_row(8, 3) == 3 && replay_threads::of_row(7, 3) == 8); return t[(unsigned)v < sizeof t / sizeof t[0] ? v : 0]; } /// Replay helper threads: variants 0 and 1: a switch decides for this run; variant 2, Automatic's own line (the row's value /// unless the options file says otherwise, replay_threads.h) const char* hn_replay_threads(int v, int variant) { static const char* const by_default = "The default. The log's \"replay helper threads\" line at the start says how many this PC " "gets, and its \"parallel replay, trial\" lines when they are in use."; static const char* const t[] = {"Set for this run by RX_VK_PARALLEL, whatever is chosen here.", "Set for this run by RX_VK_PARALLEL_AUTO, whatever is chosen here.", by_default}; const bool automatic = v == replay_threads::kRowAutomatic; if (variant < 0) { const char* e = replay_threads_env(); return e ? (!strcmp(e, "RX_VK_PARALLEL") ? t[0] : t[1]) : automatic ? t[2] : nullptr; } return variant < 2 || (variant == 2 && automatic) ? t[variant] : nullptr; } MENU_HINTS(hn_gpu, 0, "The best dedicated GPU.") /// (Triforce) The Frame generation row's AMD FSR 4 (framegen_rows.h FSR4): what makes the frame, or, for a choice saved /// where it could, why AMD's library cannot here (fsr4fg::why) and what makes the frame in its place. Variants: every line /// it can show const char* hn_framegen_fsr4(int variant) { // ((Triforce, FG-1, FG-2, FG-5) AMD's library of either version, the HUD kept out of what it moves, and paused while // HDR Native or RenoDX's RGBA16F scene holds it from every present (fsr4fg::held, not the HDR row alone: HDR Native // without an HDR display is no pause, and RenoDX's scene stays for the run whatever the row says now). There the // renderer's own makes the frame, as at 2x (framegen_rows.h held_made). The last variant is that pause) static const char* const ok = "One made frame between each two of the game's, by AMD's frame generation library (its version " "is on the row) from the scene's depth and motion, the HUD kept where the game drew it."; static const char* const native = "Paused with HDR Native or RenoDX: AMD's needs the picture without the HUD, which only the " "game encodes there. The renderer's own makes the one frame, as at 2x; HDR Expanded works."; static const char* const no[framegen_rows::FG_WHY_COUNT] = { nullptr, "AMD FSR is not in this build: the renderer's own makes the one frame, as at 2x.", "AMD's frame generation is switched off for this run (RX_VK_FSR4_FG=0 or RX_VK_FSR4=0): the renderer's own makes the frame.", "Not known yet: asked of AMD's library once the game's picture is up.", "AMD's files were not found beside the game: the renderer's own makes the one frame, as at 2x.", "AMD's frame generation library was not found beside the game: the renderer's own makes the frame.", "AMD's library has no frame generation for this GPU and driver: the renderer's own makes the frame.", "AMD's frame generation failed in this run (the log says where): the renderer's own makes the frame."}; if (variant < 0) { const int w = (int)fsr4fg::why_known(); // ((Triforce) as known: "not known yet" until menu_ahead has asked) if (w == framegen_rows::FG_OK) return framegen_rows::held_whole_run(fsr4fg::held()) ? native : ok; return no[std::clamp(w, 1, (int)framegen_rows::FG_WHY_COUNT - 1)]; } return variant == 0 ? ok : variant < (int)framegen_rows::FG_WHY_COUNT ? no[variant] : variant == (int)framegen_rows::FG_WHY_COUNT ? native : nullptr; } /// Frame generation: how many frames are made for each of the game's const char* hn_framegen(int v, int variant) { if (v == framegen_rows::FSR4) return hn_framegen_fsr4(variant); // (Triforce: AMD's library makes the frame) // ((Triforce) 11-24: by AMD FSR 3.1 where the Frame generation by row has it make them and it runs, from the scene's depth and // motion: vk_framegen.cpp. Variant 1 is the longest such text, for the menu's height) if (v >= 2 && v <= 8 && (variant < 0 ? fsr3fi::frames_wanted() != 0 : variant == 1)) { static char f[9][112]; const int k = variant == 1 ? 8 : v; snprintf(f[k], sizeof f[k], "%s between each two of the game's, by AMD FSR 3.1 from the scene's depth and motion.", k == 2 ? "One made frame" : k == 3 ? "Two made frames" : k == 4 ? "Three made frames" : k == 5 ? "Four made frames" : k == 6 ? "Five made frames" : k == 7 ? "Six made frames" : "Seven made frames"); return f[k]; } if (variant > 0) return nullptr; if (v <= 0) return "Only the game's own frames: no added delay."; if (v == 1) return "A frame for each of the display's refreshes: none made when the game keeps up. Frame pacing does not apply."; static char b[9][96]; snprintf(b[v], sizeof b[v], "%s between each two of the game's.", v == 2 ? "One made frame" : v == 3 ? "Two made frames" : v == 4 ? "Three made frames" : v == 5 ? "Four made frames" : v == 6 ? "Five made frames" : v == 7 ? "Six made frames" : "Seven made frames"); return b[std::clamp(v, 2, 8)]; } /// ((Triforce) 11-24) The Frame generation by row (opts.fg_by, framegen_rows.h BY_*): who makes the frames at Auto and 2x to 8x const char* tx_fg_by(int v) { return v == framegen_rows::BY_FSR3 ? "AMD FSR 3.1" : "Triforce"; } /// Its line: what makes them, and for AMD FSR 3.1 where it cannot run here, why (variants: every line it can show) const char* hn_fg_by(int v, int variant) { static const char* const own = "Triforce's own interpolation, from the picture alone: the lightest on the GPU."; static const char* const fsr = "AMD FSR 3.1's frame interpolation, from the scene's depth and motion, the HUD kept still: " "less ghosting, more GPU time. Any GPU."; static const char* const cannot = "This GPU lacks what AMD FSR 3.1's passes need: Triforce's own makes the frames."; static const char* const native = "Paused with HDR Native: Triforce's own makes the frames, in their 10 bits."; if (variant >= 0) return variant == 0 ? own : variant == 1 ? fsr : variant == 2 ? cannot : variant == 3 ? native : nullptr; if (v != framegen_rows::BY_FSR3) return own; if (opts.hdr == 2) return native; // (the picture is HDR Native's where the display has HDR: vk_fsr3fi.cpp frames_wanted) return !dev.device || fsr3fi::capable() ? fsr : cannot; } /// ((Triforce, options_version 7) The Frame generation row: the renderer's own and AMD FSR 4's (opts.framegen), then NVIDIA /// DLSS 2x to 4x (opts.dlssg), which was a row of its own: merged_rows.h) const char* tx_framegen_row(int v) { static const char* const dlss[] = {"NVIDIA DLSS 2x", "NVIDIA DLSS 3x", "NVIDIA DLSS 4x"}; return v >= mr7::FG_DLSS ? dlss[std::clamp(v - mr7::FG_DLSS, 0, 2)] : tx_framegen(v); } /// Frame generation: the renderer's own and AMD FSR 4's lines (hn_framegen), and for NVIDIA DLSS what runs, or that it starts /// with the next start (hn_dlssg) const char* hn_framegen_row(int v, int variant) { if (v < mr7::FG_DLSS) return hn_framegen(v, variant); if (variant > 1) return nullptr; if (variant == 0) return "NVIDIA DLSS frame generation, from the scene's depth and motion, with NVIDIA Reflex: RTX 40 and 50 cards."; if (variant == 1) return hn_dlssg(1, 0); return mkwvk::dlssg::asked() ? mkwvk::dlssg::status() : "Starts with the next start of the game."; } MENU_HINTS(hn_output_res, 0, "The game's own size.", "The sharpest on a 2560x1440 screen: nothing to scale to the window.", "The sharpest on a 3840x2160 screen. The game's render targets get a bigger GPU pool, so a full-size 3D fits.", "The sharpest on a 1920x1080 screen: the HUD and text pixel for pixel, nothing to scale to the window.", "A 32:9 picture, the sharpest on a 5120x1440 ultrawide screen: pixel for pixel, the HUD in its 16:9 shape in the middle. The game's render targets get a bigger GPU pool, so a full-size 3D fits.", "The sharpest on a 5120x2880 (5K) screen: the whole frame pixel for pixel. The game's render targets get a bigger GPU pool, so a full-size 3D fits.", "A 21:9 picture, the sharpest on a 5120x2160 ultrawide screen: pixel for pixel, the HUD in its 16:9 shape in the middle. The game's render targets get a bigger GPU pool, so a full-size 3D fits.", "The game's handheld profile, as if the console were undocked: lighter on the graphics card, and softer.", "The size of the screen the game opens on, whatever its shape: pixel for pixel in fullscreen, the HUD in its 16:9 shape in the middle of a wider screen.", "A connected screen's own size, pixel for pixel in fullscreen there, or any size set with Output width and Output height below (HOS_OUTPUT_SIZE over them, when it is set): up to the pixels of 5120x2880, the HUD in its 16:9 shape in the middle of a wider picture.") // ((Triforce, options_version 7) the Window scaling filter row is gone, and with it its hint: the sizes choose the filter, // upscaler_rows.h window_filter. FSR 1's RCAS follows the Sharpness row: none at 0, vk_framegen.cpp framegen_scale) /// Sharpness: off at 0; ((Triforce, S1, S7) else where it sharpens: the upscaler's 3D before the HUD (variant 1), or the /// finished picture at the window (2). Variants: every line it can show const char* hn_sharpness(int v, int variant) { static const char* const t[3] = {"Off: the picture as it is.", "The upscaler sharpens the 3D before the HUD: the HUD and text stay as they are.", "The finished picture at the window, the HUD and text with it."}; if (variant < 0) variant = v == 0 ? 0 : temporal_sharpens_3d() ? 1 : 2; return variant < 3 ? t[variant] : nullptr; } MENU_HINTS(hn_ultrawide, 0, "The game's own shape.", "A 16:10 picture whatever the screen (as a 1920x1200 or 2560x1600 screen), the world a little narrower at the sides: " "the window opens in that shape, and a screen of another shape shows it between black bars.", "A 21:9 picture whatever the screen (64:27, as a 2560x1080 screen): the window opens in that shape, and a screen of " "another shape shows it between black bars. The HUD keeps its 16:9 shape in the middle.", "A 32:9 picture whatever the screen (as a 5120x1440 screen): the window opens in that shape, and a screen of " "another shape shows it between black bars. The HUD keeps its 16:9 shape in the middle.", // ((Triforce, 11-22, N64 Classic, step 6) the 1998 TV's shape) "A 4:3 picture whatever the screen, the shape of a TV of 1998: the world narrower at the sides, the HUD across its " "width, and a screen of another shape shows it between black bars. With N64 Classic, its 3D is 320 x 240.") /// The Ultrawide row's line: its value's (variant 0), or what sets the shape in its place (shape_owner): the Output /// resolution's own shape (1), HOS_ASPECT (2) const char* hn_shape(int v, int variant) { if (variant < 0) variant = shape_owner(); switch (variant) { case 0: return hn_ultrawide(v, 0); case 1: return "The Output resolution's own shape: its size is the whole picture, and the HUD keeps its 16:9 shape in the " "middle of a wider one. Nothing to set here; a 16:9 Output resolution takes its shape from this row."; case 2: return "Set for this run by HOS_ASPECT, whatever is chosen here."; default: return nullptr; } } const char* tx_wide_menus(int v) { static const char* t[] = {"Full width", "Centred, blurred sides", "Centred, black bars", "Extended"}; return t[std::min(std::max(v, 0), 3)]; } MENU_HINTS(hn_wide_menus, 0, "The menus stretched over the whole screen, as before.", "The menus in the middle 16:9; beside them, what the game draws there, out of focus.", "The menus in the middle 16:9; black beside them.", // ((Triforce) host/hos_wide_ui.c: the menus' layouts planned as the HUD's) "The menus at their 16:9 size, what sits at their sides moved out to the screen's edges.") MENU_HINTS(hn_robust, 0, "Off, on every card.", "Can be faster on some NVIDIA cards.", "Always on.") MENU_HINTS(hn_mesh, 0, "As the game finds best for this GPU: the fallback on AMD's RX 6000 driver, native mesh shaders elsewhere.", "Every mesh draw through compute shaders: a little slower. Try it if walls glow or the GPU stops responding on an AMD " "card. The shaders are prepared again once.") MENU_HINTS(hn_fps, 0, nullptr, "With frame generation on, the game's own rate too.", "In the counter's place in the top right corner, a see-through panel: the GPU's and the CPU's load, temperatures and memory, " "the frame rate with its lows, the frame times and their graph, the waits per frame and the picture's settings. It " "measures only while it is shown.", // ((Triforce) the levels between On and Full, fps_levels.h: the values after Full's, shown before it) "The frame rate, and under it the frame time and the 1% low as a frame time.", "Frame time, and a graph of the last frames against the Frame rate cap's frame time.", "Graph, and where the frame's time goes: the game, the renderer, its waits for pipelines and shaders, and the GPU's time " "beside them.", "Breakdown, and the renderer's own numbers: video memory, draws, dispatches, passes and uploads a frame, pipelines built.") /// (Triforce) The FPS counter row's third value, Full, after NX2navi's perf_overlay (off, fps, full): 0 and 1 are Off and /// On as before. The row keeps its name, and with it its key in the options file (fps_counter) const char* tx_perf(int v) { return fps_levels::name(v); } // ((Triforce) and the levels between On and Full: fps_levels.h MENU_HINTS(hn_menu_size, 0, "Large in fullscreen on a screen of 1080 lines or more while a controller is in use, else Medium.", "Smaller, for a desk.", "The usual size.", "Larger, for a TV across the room.") MENU_HINTS(hn_speed, 0, "A step each frame: the game slows down whenever it runs below 60 fps.", "Normal speed down to 15 fps, by taking longer steps.") MENU_HINTS(hn_text_speed, 0, "The game's own pace, with its pauses.", "Twice as fast.", "Four times as fast.", "Each page at once, as pressing A does.") MENU_HINTS(hn_text_size, 0, "The game's own size.", "A little larger.", "Larger.", "Much larger.", "The largest.") MENU_HINTS(hn_audio_output, 0, "5.1 when the output device has 5.1 or more speakers, else stereo.", "Stereo, whatever the device has.", "5.1, whatever the device has. Mixed down on stereo speakers.", "The same sound in both ears: the average of stereo's two channels. At once from Stereo; after a restart from 5.1.") MENU_HINTS(hn_background, 0, "Only while the game's window has the focus.", "Also behind other windows, for streaming or other apps. The keyboard and mouse still need the game's window.") MENU_HINTS(hn_mousecam, 0, "The mouse stands in for the right stick, with its curve and top speed.", "The mouse turns the camera itself, one to one, as in a PC game.", "The mouse plays no part: a click in the window does not capture it. For a controller or the keyboard alone.") MENU_HINTS(hn_mouse_invert, 0, nullptr, "Moving the mouse forward tilts the camera down.") MENU_HINTS(hn_gyro, 0, "The sticks alone aim.", "Switch Pro controllers and pads in Switch mode, DualSense and DualShock 4. The value says whether the " "connected pad has a gyroscope.") MENU_HINTS(hn_pad_layout, 0, "The Switch's order: A on the right, B at the bottom, X at the top, Y on the left.", "A at the bottom (action and talk), B on the right, X on the left, Y at the top.", "A at the bottom, B on the right; X and Y as on the Switch.", "Bindings of your own, from the Controls page.") // ((Triforce) Auto's choice is host/prompts.c auto_face's; the keyboard and mouse face is nx2/prompt_keys.py's) MENU_HINTS(hn_prompts, 0, "Those of the first controller, from its name (SDL's); the Xbox's for a controller that has no name, as with " "XInput alone. When the game starts with no controller: those of the device you used last in the game before, " "the keys' and the mouse's the first time.", nullptr, nullptr, nullptr, nullptr, nullptr, "Each button shows the first key or mouse button bound to it on this page, moving shows the movement keys, and " "the camera shows the mouse. These menus show the buttons of a controller you use.") // (Triforce) what each walk key is bound to out of the box (host/nn_hid.c key_default), which it stops pressing while chosen MENU_HINTS(hn_walk_key, 0, "The movement keys always push the stick all the way: Link runs.", "Caps Lock presses no button by default. The system still switches capitals on and off with each press.", "Shift is B's key by default. While it is the walk key it does not press B: give B another key on the " "Controls page.", "Ctrl is the left stick press's key by default, which the Sprint button's Left stick click uses. While it is " "the walk key it does not press it.", "Tab is one of Plus's keys by default. While it is the walk key it does not press Plus; Enter still does.") // (Triforce) the Lazy write-back row (vk_memory.cpp lazy_decide, wb_lazy_state.h choose) // ((Triforce) the Threaded rendering row: Off, On, Auto (threaded_rendering.h's order) const char* tx_threaded(int v) { return v == 2 ? "Auto" : tx_onoff(v); } MENU_HINTS(hn_threaded, 0, "The game's own thread turns its commands into the graphics card's, as always.", "A render thread, a recorder thread and a present thread, whatever the processor.", "On with 4 processor cores or more; with no video memory mirrors only the recorder thread, from 6 cores.") MENU_HINTS(hn_lazy_write_back, 0,"Copied back after every submission, as always.", "Copied back when it is read. Stays off with an AMD card's driver unless RX_VK_LAZY_WB=1 is set, and does nothing " "with no VRAM mirrors.") // (Triforce) The cheats of the mods' cheat files (mods//cheats/.txt), which the host reads and runs // (host/mod_cheats.c) and names for the menu at the first frame (menu_option_set: HOS_OPT_MODCHEAT_*). Each has a row on the // System tab with the file's own name, On | Off as the toggles; the table below holds mod_cheat_rows::kSlots rows for them and // a heading, not shown until the host has named its cheats (row_shown). A row has no value of the menu's: its switch is the // list's, which the host asks for every frame (menu_take_mod_cheat) and keeps for the next start itself mod_cheat_rows::List mod_cheats; constexpr char kModCheatHeading[] = "Mod cheats"; // (the heading row's name in the table below: row_shown tells it by it) constexpr char kModCheatHelp[] = "A cheat from a mod's cheat file, in the mods folder. On: its code runs once every frame of the game. Off at first; one you " "switch on stays on at the next start."; /// A row's place among the mods' cheats (its name is the list's own), -1 for every other row int mod_cheat_slot(const char* name) { return mod_cheats.slot_of(name); } #define MOD_CHEAT_ROW(i) {TAB_SYSTEM, mod_cheats.names[i], nullptr, 0, 0, 0, nullptr, kModCheatHelp, nullptr, false, true}, #define MOD_CHEAT_ROWS8(i) \ MOD_CHEAT_ROW(i) MOD_CHEAT_ROW(i + 1) MOD_CHEAT_ROW(i + 2) MOD_CHEAT_ROW(i + 3) MOD_CHEAT_ROW(i + 4) MOD_CHEAT_ROW(i + 5) \ MOD_CHEAT_ROW(i + 6) MOD_CHEAT_ROW(i + 7) static_assert(mod_cheat_rows::kSlots == 96, "MOD_CHEAT_ROWS8 below is used twelve times: a row for every slot"); // ((Triforce, options_version 7) The rows that each choose two saved values (merged_rows.h): their values as the rows show // them, made from the saved ones before each tick and each drawing (merged_sync) and written back to them by set_row // (merged_store). Never saved themselves (ini_row): the saved values keep their own keys, in the hidden rows below) struct Merged { int hdr = 0, framegen = 0, pacing = 0, latency = 0; }; Merged merged; bool is_merged(const int* v) { return v == &merged.hdr || v == &merged.framegen || v == &merged.pacing || v == &merged.latency; } // ((Triforce, options_version 7, the owner: "group them correctly, such as HDR should be its own group, the upscaling should be // its own group, etc. Add the in-game filigree to group them, separate them") A group's heading: the game's separator with // the group's title under it (ui::heading). The selection steps over it, the mouse has nothing on it, and it is hidden while // every row of its group is (row_shown). The Debug tab has its own layout and its one heading, Developer (debug_rows) #define MENU_HEADING(tab, title) {tab, title, nullptr, 0, 0, 0, nullptr, nullptr, nullptr, false, true, -1, true} // (Triforce) Achievements (host/achievements.c keeps them, on unless HOS_ACHIEVEMENTS=0, and names them for the menu: // menu_option_set, HOS_OPT_ACH_*; achievement_rows.h has the list). The System tab's Achievements row opens their page, // kAchPage: every one with its icon, earned or not. The row is not shown until the host has named them (row_shown). One // earned while the game runs has a notice at the top of the screen for a moment, draw_ach_notice achievement_rows::List ach_list; achievement_rows::View ach_view; constexpr int kAchPage = 10; // (page: see kModsPage) constexpr char kAchRow[] = "View achievements"; // (the row's name in the table below: is_ach_row tells it by it) constexpr int64_t kAchNoticeMs = 4000; // (how long a notice stays: host/achievements.c waits a little longer between two) int ach_columns = 2, ach_capacity = 8; // (the page's cards as last drawn: the keys move by them) int ach_notice = -1; // (the achievement the notice shows, -1 none) int64_t ach_notice_at = 0; // (and since when, prof_now) // (Triforce) Save files, as the Nintendo 64 game had them (host/save_files.c keeps them, on unless HOS_SAVE_FILES=0, and names // them for the menu: menu_option_set, HOS_OPT_FILES_*; save_file_rows.h has the list). The game reads its saves once, at its // start, so a file is a start: the game starts on the file played last and shows its title as ever, and the title's list has // an entry of ours under Mods, Save Select (draw_files_row), which opens the file select, kFilesPage. There the file this // run plays goes on at once; another is asked of the host and the game restarts on it. (It opened by itself over the // title's list at first: he did not want that.) The System tab's Save files row opens the same page; not shown until the // host has named the files save_file_rows::List save_files; constexpr int kFilesPage = 11; // (page: see kModsPage) constexpr char kFilesRow[] = "Save files"; // (the row's name in the table below: is_files_row tells it by it) int files_choice = 0; // (the card chosen) bool files_at_title = false; // (the page was opened by the title, not by its row: Back and Play give the game its list) int files_wait = -1; // (the file asked of the host, until it answers) bool files_failed = false; // (the host could not keep the last choice) bool is_files_row(const Row& r) { return r.tab == TAB_SYSTEM && !r.value && !strcmp(r.name, kFilesRow); } /// The System tab's Achievements row: confirm opens their page bool is_ach_row(const Row& r) { return r.tab == TAB_SYSTEM && !r.value && !strcmp(r.name, kAchRow); } // ((Triforce, 11-22, N64 Classic, step 5) a row of the Remembered page: its value opts.n64_rem's, its range and step // n64_rules.h kSpec's (its key kSpec's too, through ini_key's table of names), taken at once #define N64_ROW(row, title, text, help) \ {TAB_N64, title, &opts.n64_rem[n64_rules::row], n64_rules::kSpec[n64_rules::row].lo, n64_rules::kSpec[n64_rules::row].hi, \ n64_rules::kSpec[n64_rules::row].step, text, help, nullptr, false, true} constexpr char kUseWindowSize[] = "Use current window size"; Row rows[] = { // ---- Display ---- MENU_HEADING(TAB_DISPLAY, "Screen"), {TAB_DISPLAY, "Fullscreen", &opts.fullscreen, 0, 1, 1, tx_onoff, "The game fills the whole screen, without the window's border. F10 and Alt+Enter do the same.", nullptr, false, true}, {TAB_DISPLAY, "Fullscreen screen", &opts.fs_screen, 0, 15, 1, tx_fs_screen, "Which screen Fullscreen fills: Automatic, the one the window is on, or one of the connected screens. Changes at once.", nullptr, false, true}, {TAB_DISPLAY, "Output resolution", &opts.output_res, 0, kLastOutput, 1, tx_output_res, "The picture's size, before it is scaled to the window: the fixed sizes, and the size of each connected screen by its " "name. A size that is not 16:9 is a wider or narrower picture: the HUD, menus and story movies keep their 16:9 shape at its " "height. Docked only. Applies after a restart.", hn_output_res, true}, // ((Triforce) the Custom size's two sides, output_width= and output_height= by their names, shown while Custom or a // screen's size is chosen: row_shown. No line about the value: the Output resolution row above shows the size the game // makes of the two) {TAB_DISPLAY, kUseWindowSize, nullptr, 0, 0, 0, nullptr, "Copy the current window's pixel size to Custom. In fullscreen this uses the fullscreen size. Applies after a restart."}, {TAB_DISPLAY, "Output width", &opts.output_width, OUTPUT_MIN_W, OUTPUT_MAX_W, 8, tx_custom_width, "The output resolution's width in pixels, where it is a screen's size or Custom; hold Left or Right to move faster, or type " "a number and press Enter. Output resolution shows the size the game takes: 5:4 to 48:9 in shape, at most the pixels of " "5120x2880. Applies after a restart.", nullptr, true}, {TAB_DISPLAY, "Output height", &opts.output_height, OUTPUT_MIN_H, OUTPUT_MAX_H, 8, tx_custom_height, "The output resolution's height in pixels, where it is a screen's size or Custom; hold Left or Right to move faster, or type " "a number and press Enter. Output resolution shows the size the game takes: 5:4 to 48:9 in shape, at most the pixels of " "5120x2880. Applies after a restart.", nullptr, true}, {TAB_DISPLAY, "GPU device", &opts.gpu_device, 0, 8, 1, tx_gpu, "Which graphics card the game runs on. Applies after a restart.", hn_gpu, true, true}, MENU_HEADING(TAB_DISPLAY, "Ultrawide"), {TAB_DISPLAY, "Aspect ratio", &opts.ultrawide, 0, 4, 1, tx_shape, "The picture's shape for a 16:9 Output resolution: the game's own 16:9, or a fixed 16:10, 21:9 or 32:9 at the same height, " "for a screen or a window of that shape, or 4:3, a TV's of 1998. A screen of another shape shows the picture between black bars. An Output " "resolution that is not 16:9 has its own shape, shown here. Applies after a restart.", hn_shape, true}, // (Triforce: host/oot_wide_hud.c) // ((Triforce) Screen edges: host/hos_wide_ui.c plans the HUD's layouts for the picture at each present, so it changes at once) {TAB_DISPLAY, "HUD position", &opts.wide_hud, 0, 1, 1, tx_wide_hud, "With a picture wider than 16:9: where corner HUD elements, tips and notices sit. Middle: in the " "middle 16:9, as on a normal screen. Screen edges: out in the screen's corners. Changes at once.", nullptr, false, true}, {TAB_DISPLAY, "Menu sides", &opts.wide_menus, 0, 3, 1, tx_wide_menus, // ((Triforce) 3 Extended: host/hos_wide_ui.c) "With a picture wider than 16:9: the pause, item and map menus, and what shows beside them. Loading screens and story movies, " "which draw no world either, get the same sides (the title's movie fills the picture up to 12:5); a fade always covers the " "whole screen. Changes at once.", hn_wide_menus}, // ((Triforce) the HUD's three groups moved and sized, on a 16:9 or wider picture: host/hos_wide_ui.c, changes at once) MENU_HEADING(TAB_DISPLAY, "HUD"), {TAB_DISPLAY, "HUD placement", &opts.hud_placement, 0, 1, 1, tx_hud_placement, "Where the hearts, the buttons and the minimap sit in play. Custom moves and resizes each group. Changes at once.", hn_hud_placement, false, true}, {TAB_DISPLAY, "Hearts and magic across", &opts.hud_health_x, -15, 15, 1, tx_percent, "Moves the hearts and magic left or right, as a share of the picture's width.", nullptr, false, true}, {TAB_DISPLAY, "Hearts and magic up", &opts.hud_health_y, -15, 15, 1, tx_percent, "Moves the hearts and magic down or up, as a share of the picture's height.", nullptr, false, true}, {TAB_DISPLAY, "Hearts and magic size", &opts.hud_health_scale, 75, 125, 1, tx_percent, "Resizes the hearts and magic together.", nullptr, false, true}, {TAB_DISPLAY, "Buttons across", &opts.hud_buttons_x, -15, 15, 1, tx_percent, "Moves the action prompts and the item buttons left or right, as a share of the picture's width.", nullptr, false, true}, {TAB_DISPLAY, "Buttons up", &opts.hud_buttons_y, -15, 15, 1, tx_percent, "Moves the action prompts and the item buttons down or up, as a share of the picture's height.", nullptr, false, true}, {TAB_DISPLAY, "Buttons size", &opts.hud_buttons_scale, 75, 125, 1, tx_percent, "Resizes the action prompts and the item buttons together.", nullptr, false, true}, {TAB_DISPLAY, "Minimap across", &opts.hud_minimap_x, -15, 15, 1, tx_percent, "Moves the minimap left or right, as a share of the picture's width.", nullptr, false, true}, {TAB_DISPLAY, "Minimap up", &opts.hud_minimap_y, -15, 15, 1, tx_percent, "Moves the minimap down or up, as a share of the picture's height.", nullptr, false, true}, {TAB_DISPLAY, "Minimap size", &opts.hud_minimap_scale, 75, 125, 1, tx_percent, "Resizes the minimap.", nullptr, false, true}, MENU_HEADING(TAB_DISPLAY, "HDR"), // (HDR and RenoDX HDR in one row: merged_rows.h. Off, Expanded and Native change at once, as the HDR row did; Native + // RenoDX, which the scene's format and RenoDX's shaders are chosen for at the start (host/nn_vi.c hos_scene_rgba16f), // after a restart: restart_value_of) {TAB_DISPLAY, "HDR", &merged.hdr, 0, 3, 1, tx_hdr_mode, "HDR10 on an HDR display (Windows: Use HDR on in the display settings). Native + RenoDX applies after a restart.", hn_hdr_mode, true, true}, {TAB_DISPLAY, "Paper white", &opts.hdr_white, 80, 400, 10, tx_nits, "How bright white is: around 200 nits for a normal room, higher for a bright one.", nullptr, false, true}, // (Triforce: up to HDR10's own 10,000 nits, as NX2navi's hdr_peak_nits; it stopped at 4,000. Every reader takes that much) {TAB_DISPLAY, "Peak brightness", &opts.hdr_peak, 400, 10000, 100, tx_nits, "The brightest highlights: set it to your display's peak brightness.", nullptr, false, true}, {TAB_DISPLAY, "UI brightness", &opts.rdx_ui_white, 80, 400, 10, tx_nits, "How bright the HUD's and the menus' white is with RenoDX. The scene's white is Paper white.", nullptr, false, true}, // (local, RenoDX port: vk_renodx.cpp. Shown with HDR Native + RenoDX, where its shaders run; the rows of one tone mapper // while it is chosen, rdx_applies. Ranges and steps as NX2navi's menu has them) MENU_HEADING(TAB_DISPLAY, "RenoDX"), {TAB_DISPLAY, "Tonemapper", &opts.rdx_tonemap, 0, 2, 1, tx_rdx_tonemap, "How the scene's light is brought to the display. Vanilla: the game's own curve. PsychoV35: keeps hue and saturation " "into the highlights. RenoDRT: carries the game's SDR look up to the peak brightness.", nullptr, false, true}, {TAB_DISPLAY, "Gamma correction", &opts.rdx_gamma, 0, 2, 1, tx_rdx_gamma, "Shows the picture as a 2.2 or BT.1886 (2.4) display would, as the game was made to be seen: darker shadows. Off keeps " "the sRGB curve.", nullptr, false, true}, {TAB_DISPLAY, "Color space", &opts.rdx_space, 0, 2, 1, tx_rdx_space, "The colors the picture is taken to be in. Vanilla: the game's own. BT.709: as the SDR picture. DCI-P3: more " "saturated.", nullptr, false, true}, {TAB_DISPLAY, "Exposure", &opts.rdx_exposure, 0, 200, 5, tx_percent, "The scene's brightness before tone mapping. 100% is the game's.", nullptr, false, true}, {TAB_DISPLAY, "Middle gray", &opts.rdx_midgray, 0, 2, 1, tx_rdx_midgray, "What the scene's middle gray is held to. Render: as rendered. Vanilla: where the game's curve puts it. Eye " "adaptation: it follows what is on screen over a few seconds.", nullptr, false, true}, {TAB_DISPLAY, "Match tone slope", &opts.rdx_match_slope, 0, 1, 1, tx_onoff, "PsychoV35: the mid tones get the contrast of the game's own curve. Off: PsychoV35's own, softer.", nullptr, false, true}, {TAB_DISPLAY, "Tone slope", &opts.rdx_tone_slope, 0, 100, 1, tx_rdx_grade, "PsychoV35: how steep the tone curve is through middle gray. 50 leaves it unchanged.", nullptr, false, true}, {TAB_DISPLAY, "Hue clip", &opts.rdx_hue_clip, 0, 100, 5, tx_percent, "PsychoV35: how much bright colors turn as they do where the SDR picture clips, fire towards yellow and white. 0% " "keeps their hue.", nullptr, false, true}, {TAB_DISPLAY, "Highlight saturation", &opts.rdx_highlight_sat, 0, 100, 1, tx_rdx_grade, "RenoDRT: how strong the colors of the brightest parts are. 50 leaves them unchanged.", nullptr, false, true}, {TAB_DISPLAY, "Blowout", &opts.rdx_blowout, 0, 100, 1, tx_rdx_grade, "RenoDRT: turns the brightest parts towards white. 0 keeps their color.", nullptr, false, true}, {TAB_DISPLAY, "Flare", &opts.rdx_flare, 0, 100, 1, tx_rdx_grade, "RenoDRT: lifts the darkest parts as a little stray light would. 0 keeps black black.", nullptr, false, true}, {TAB_DISPLAY, "Hue correction", &opts.rdx_hue, 0, 100, 5, tx_percent, "RenoDRT: how much bright colors keep the hue they had before tone mapping.", nullptr, false, true}, {TAB_DISPLAY, "Color grading", &opts.rdx_grade, 0, 100, 5, tx_percent, "RenoDRT: how much of the game's own color grading is kept. 0% is the scene without it.", nullptr, false, true}, {TAB_DISPLAY, "Highlights", &opts.rdx_highlights, 0, 100, 5, tx_rdx_grade, "The bright parts of the scene. 50 is neutral.", nullptr, false, true}, {TAB_DISPLAY, "Shadows", &opts.rdx_shadows, 0, 100, 5, tx_rdx_grade, "The dark parts of the scene. 50 is neutral.", nullptr, false, true}, {TAB_DISPLAY, "Contrast", &opts.rdx_contrast, 0, 100, 5, tx_rdx_grade, "The scene's contrast. 50 is neutral.", nullptr, false, true}, {TAB_DISPLAY, "Saturation", &opts.rdx_saturation, 0, 100, 5, tx_rdx_grade, "The scene's color. 50 is neutral.", nullptr, false, true}, {TAB_DISPLAY, "Bloom", &opts.rdx_bloom, 0, 100, 5, tx_rdx_grade, "The glow around bright things. 50 is the game's. RenoDX is by Carlos Lopez (clshortfuse), under the MIT license.", nullptr, false, true}, // ((Triforce) 11-24) the picture's colours for a colour vision deficiency (vk_framegen.cpp framegen_scale). Taken at once MENU_HEADING(TAB_DISPLAY, "Accessibility"), {TAB_DISPLAY, "Color vision correction", &opts.colour_vision, 0, 3, 1, tx_colour_vision, "Recolors the finished picture for red-green or blue-yellow color vision deficiency, keeping its brightness. Not with " "HDR Native. Changes at once.", hn_colour_vision, false, true}, MENU_HEADING(TAB_DISPLAY, "Overlay"), // (Triforce, after NX2navi's perf_overlay: a third value, Full, NX2navi's full performance overlay: perf_sample, draw_perf) {TAB_DISPLAY, "FPS counter", &opts.show_fps, 0, fps_levels::kMax, 1, tx_perf, "Frames per second in the top right corner. Full: a performance panel in its place: the GPU's and the CPU's load, " "temperatures and memory, the frame rate and its lows, the frame times and their graph, the waits per frame and the " "picture's settings.", hn_fps, false, true}, // ---- Graphics: the picture, top to bottom ---- // ((Triforce, 11-23) Evil HD, the owner's one switch for a powerful PC: evil_hd.h. First, over the rows it stands for) MENU_HEADING(TAB_GRAPHICS, "Evil HD"), {TAB_GRAPHICS, "Evil HD", &opts.evil_hd, 0, 1, 1, tx_onoff, "The fullest picture the game can give, for a powerful PC: SMAA Ultra edges, 16x texture filtering, every texture whole, " "the shadows of distant grass and leaves as the game draws them, and soft shadows in corners and creases (ambient " "occlusion), and the grass, plants, flowers and stones drawn 4 times as far (in the areas you enter after it is turned on). " "Your own choices in those rows come back when it is off. F2 turns it on and off.", hn_evil_hd, false, true}, // ((Triforce) Auto (this PC): auto_settings.h, auto_apply. Off by default: nothing set, nothing tuned) MENU_HEADING(TAB_GRAPHICS, "This PC"), {TAB_GRAPHICS, "Auto (this PC)", &opts.auto_pc, 0, 1, 1, tx_onoff, "On: the Upscaler, Render resolution, Texture detail, Shadow resolution and Grass distance are set for this PC's graphics " "card, memory and processor, and adjusted in the first minutes of play to hold the Frame rate cap. Changing one of those " "rows yourself turns it Off. The Render resolution and Upscaler apply after a restart.", hn_auto_pc, false, true}, MENU_HEADING(TAB_GRAPHICS, "Upscaling"), // (the Upscaler only in a build with DLSS or FSR 4, or where AMD FSR 3.1 runs: row_shown. An engine's native anti-aliasing // is the Render resolution's Native (100%), upscaler_rows.h) {TAB_GRAPHICS, "Upscaler", &opts.dlss, 0, ur::kUpscalers - 1, 1, tx_upscaler, "What draws the 3D up to the Output resolution.", hn_upscaler}, {TAB_GRAPHICS, "DLSS model", &opts.dlss_model, 0, ur::kModels - 1, 1, tx_dlss_model, "Which of NVIDIA's DLSS networks draws the picture.", hn_dlss_model, false, true}, {TAB_GRAPHICS, "FSR 4 model", &opts.fsr4_model, 0, ur::kFsr4Models - 1, 1, tx_fsr4_model, // ((Triforce)) "The FSR 4 network: Auto lets AMD pick for this GPU, Lite is the faster INT8 network.", hn_fsr4_model, false, true}, // (Triforce: read once, at the start (host/nn_vi.c): Auto -> 100% in game left the 3D at the dynamic path's size) {TAB_GRAPHICS, "Render resolution", &opts.resolution, 0, ur::kValues - 1, 1, tx_resolution, "The size the 3D is drawn at; the upscaler fills in the rest. Applies after a restart.", hn_resolution, true}, // (Triforce, 11-13: vk_temporal.cpp pre_wanted. Shown with DLSS or FSR: row_shown) {TAB_GRAPHICS, "Upscale before bloom", &opts.upscale_pre, 0, 1, 1, tx_onoff, "On: the upscaler works on the scene before the game's glow and tone mapping, which are then made at full size. " "Applies after a restart.", nullptr, true, true}, {TAB_GRAPHICS, "Sharpness", &opts.sharpness, 0, 100, 10, tx_percent, "With DLSS, DLAA or AMD FSR as the Upscaler, the 3D before the HUD (FSR's own sharpening; AMD's RCAS for DLSS); with " "the game's own upscaler, the picture at the window. 0 is off. Too much shows halos around edges.", hn_sharpness}, // (Triforce, after NX2navi's aa setting: aa_rows.h, vk_aa.cpp. Taken at each frame. Shown with the game's own upscaler: // DLSS and FSR smooth the edges themselves) MENU_HEADING(TAB_GRAPHICS, "Anti-aliasing"), {TAB_GRAPHICS, "Anti-aliasing", &opts.aa, 0, aa_rows::kValues - 1, 1, tx_aa, "How the 3D's edges are smoothed: the game's own SMAA, none, FXAA, or SMAA at its Ultra preset. Changes at once.", hn_aa, false, true}, // ((Triforce, 11-22, N64 Classic, step 5) the 1998 look (n64_rules.h, vk_n64.cpp): Off, Faithful (fixed), Remembered (its // page). Taken at each frame; F7 turns it between Off and the last preset (n64_classic_last); RX_VK_N64 over it MENU_HEADING(TAB_GRAPHICS, "N64 Classic"), {TAB_GRAPHICS, "N64 Classic", &opts.n64_classic, 0, n64_rules::kPresets - 1, 1, tx_n64, "The game as the 1998 cartridge on a TV of then. F7 turns it on and off. Changes at once.", hn_n64, false, true}, {TAB_GRAPHICS, "Remembered settings", nullptr, 0, 0, 0, nullptr, // (opens the Remembered page, the TAB_N64 rows) "Remembered's frame rate, its 3D and its TV, each to your taste."}, // (the Remembered page (TAB_N64), which Remembered settings opens: Remembered's own look and pace, every row taken at // once. N64_ROW takes each row's range, step and key from n64_rules.h kSpec; row_fixed greys those with nothing to do) MENU_HEADING(TAB_N64, "Pace"), N64_ROW(FPS, "Frame rate", tx_n64_fps, "How many frames a second the game runs at with Remembered: the Frame rate cap's, or fewer. 20 is the 1998 " "cartridge's, 17 its own on a 50 Hz TV. Movies keep the cap's."), MENU_HEADING(TAB_N64, "The 3D"), N64_ROW(LINES, "3D resolution", tx_n64_lines, "How many lines the 3D is drawn on. 240 is the console's; more is sharper."), N64_ROW(COLOUR, "Colour", tx_n64_colour, "How many colours the 3D has. 15-bit is the console's 16-bit picture."), N64_ROW(DITHER, "Dither", tx_n64_dither, "The fine pattern that hides the steps between fewer colours. Nothing to dither with full colour."), N64_ROW(BLUR, "Texture blur", tx_n64_blur, "How much less detail the textures show, in steps of half a mip level, as the console's small textures did."), MENU_HEADING(TAB_N64, "The TV"), N64_ROW(TV, "CRT TV", tx_onoff, "The TV over the picture. Off: the 3D's look alone, for a real CRT or a capture card."), N64_ROW(SCANLINES, "Scanlines", tx_percent, "How dark the gaps between the TV's lines are."), N64_ROW(MASK, "Mask", tx_n64_mask, "The pattern of the TV's red, green and blue phosphors. Auto: the slot mask on a picture 1440 lines tall or more, " "none on smaller screens."), N64_ROW(MASK_STRENGTH, "Mask strength", tx_percent, "How strongly the mask shows."), N64_ROW(BLEED, "Colour bleed", tx_n64_bleed, "Colour smeared sideways, as a composite cable carried it; brightness stays sharp."), N64_ROW(GLOW, "Glow", tx_percent, "Light glowing around the bright parts of the picture."), N64_ROW(CURVATURE, "Curvature", tx_n64_curve, "How curved the screen is. A curved one has darker, rounded corners."), N64_ROW(SATURATION, "Colour saturation", tx_percent, "How rich the colours are. 100% is the game's."), MENU_HEADING(TAB_N64, "Start again"), {TAB_N64, "Copy Faithful", nullptr, 0, 0, 0, nullptr, "Remembered set to Faithful's values: a start for your own."}, {TAB_N64, "Reset to defaults", nullptr, 0, 0, 0, nullptr, "Remembered as it was at first."}, // ((Triforce, 11-24) the Simulated turf page (TAB_SIM_TURF), which Simulated turf opens: each area's own values, or // multipliers of every area's. Each change at once, kept in sim_turf_settings.ini (vk_sim_turf.cpp takes the rows' changes) {TAB_SIM_TURF, "Use global multipliers", &sim_turf_settings::global, 0, 1, 1, tx_onoff, "On: every area's own simulated turf scaled by the four multipliers below (1.0x is the area's own). Off: this area's own " "values, set one by one.", nullptr, false, true}, {TAB_SIM_TURF, "Fade start multiplier", &sim_turf_settings::multipliers[0], 0, 100, 1, sim_turf_text_multiplier, "Scales each area's fade start within the game's fade range.", nullptr, false, true}, {TAB_SIM_TURF, "Turf density multiplier", &sim_turf_settings::multipliers[1], 0, 100, 1, sim_turf_text_multiplier, "Scales each area's simulated turf density. 0.0x leaves almost none.", nullptr, false, true}, {TAB_SIM_TURF, "Minimum blades multiplier", &sim_turf_settings::multipliers[2], 0, 100, 1, sim_turf_text_multiplier, "Scales each area's fewest simulated turf blades, rounded to a whole blade.", nullptr, false, true}, {TAB_SIM_TURF, "Far power multiplier", &sim_turf_settings::multipliers[3], 0, 100, 1, sim_turf_text_multiplier, "Scales how quickly each area's simulated turf thins with distance.", nullptr, false, true}, {TAB_SIM_TURF, "Fade start", &sim_turf_settings::values[0], 0, 649, 1, sim_turf_text_fade, "How far away the simulated turf begins to fade. 0 with Minimum blades 0: none in this area, for a slower PC.", hn_sim_turf_area, false, true}, {TAB_SIM_TURF, "Turf density", &sim_turf_settings::values[1], 1, 500, 1, sim_turf_text_count, "How densely the simulated turf is laid. The game divides by it: lower is denser.", hn_sim_turf_area, false, true}, {TAB_SIM_TURF, "Minimum blades", &sim_turf_settings::values[2], 0, 128, 1, sim_turf_text_count, "The fewest blades the simulated turf keeps as it thins with distance.", hn_sim_turf_area, false, true}, {TAB_SIM_TURF, "Far power", &sim_turf_settings::values[3], 0, 400, 5, sim_turf_text_power, "How the simulated turf's density falls with distance.", hn_sim_turf_area, false, true}, {TAB_SIM_TURF, "Reset current area", nullptr, 0, 0, 0, nullptr, "This area's edits gone: the game's own simulated turf here again.", hn_sim_turf_reset}, MENU_HEADING(TAB_GRAPHICS, "Frame generation"), // (Frame generation and DLSS frame generation in one row, merged_rows.h: the renderer's own, AMD FSR 4 where its library // makes the frames, NVIDIA DLSS where it can run (vk_dlssg.cpp: read at the start, so it takes a restart)) {TAB_GRAPHICS, "Frame generation", &merged.framegen, 0, mr7::FG_DLSS_LAST, 1, tx_framegen_row, "Makes frames between the game's own, for smoother motion, at a little input delay. Fast motion and camera cuts can " "show artifacts. NVIDIA DLSS applies after a restart.", hn_framegen_row, true, true}, // ((Triforce) 11-24) who makes them at Auto and 2x to 8x: the renderer's own (the default, as before) or AMD FSR 3.1's frame // interpolation, vk_fsr3fi.h. Shown with those values alone (row_shown) {TAB_GRAPHICS, "Frame generation by", &opts.fg_by, 0, framegen_rows::kByMax, 1, tx_fg_by, "Who makes the frames at Auto and 2x to 8x.", hn_fg_by, false, true}, MENU_HEADING(TAB_GRAPHICS, "Frame rate & latency"), {TAB_GRAPHICS, "Frame rate cap", &opts.fps_cap, -3, 7, 1, tx_fps_cap, // (6: Monitor's rate, 7: Uncapped, fps_cap.h) "The most frames the game renders a second; made frames come on top. 60 is the safe choice: past it some cutscenes and " "bosses can misbehave. 30, 40 and 45 are for a PC that holds one of them where 60 swings. Monitor's rate: the refresh " "rate of the screen the game starts on. Uncapped: as fast as the PC can, still at real time; with VSync on, the screen's " "refresh rate is the limit. Changes at once.", nullptr, false, true}, // (Triforce, after NX2navi's VSync switch: the swapchain's present mode, made again at once. present_mode.h, vk_main.cpp) {TAB_GRAPHICS, "VSync", &opts.vsync, 0, 2, 1, tx_vsync, "Whether a finished frame waits for the screen's next refresh. Off: a little less delay, and the picture can tear. " "Every refresh: always the screen's own pacing (FIFO), for a display that tears or stutters otherwise. Changes at once.", hn_vsync, false, true}, // (Frame pacing and Steady frame rate in one row, merged_rows.h: host/pace_steady.h, host/nn_vi.c steady_period) {TAB_GRAPHICS, "Frame pacing", &merged.pacing, 0, 3, 1, tx_pacing, "When each frame is shown. Steady paces the game to a rate this PC holds where you are: steadier, at some frame rate.", hn_pacing, true}, // (NVIDIA Reflex and AMD Anti-Lag 2 in one row, by the card's maker, merged_rows.h; none where neither runs) {TAB_GRAPHICS, "Low latency", &merged.latency, 0, 2, 1, tx_latency, "Each frame starts as late as it can, for less input delay: NVIDIA Reflex on NVIDIA cards, AMD Anti-Lag 2 on AMD ones.", hn_latency}, MENU_HEADING(TAB_GRAPHICS, "Textures"), {TAB_GRAPHICS, "Texture filtering", &opts.aniso, 0, 4, 1, tx_aniso, // (Triforce: vk_draw.cpp sampler_for) "Keeps ground, paths and walls sharp where they slope away from the camera. Game: what the game asks for; 16x is the " "sharpest, at a small cost.", hn_aniso}, // (Triforce, after NX2navi's texture_detail: tex_detail.h, vk_texture.cpp texture_detail_level. Read at the first texture) {TAB_GRAPHICS, "Texture detail", &opts.tex_detail, 0, 3, 1, tx_tex_detail, "How large the game's textures are kept in video memory. Automatic suits the graphics card. Applies after a restart.", hn_tex_detail, true}, // ((Triforce) 11-24) the ReShade presets (reshade_menu.h, reshade/fx_runtime.cpp): Off, the default, runs nothing. The User // preset file and Rescan rows with User chosen (row_shown); the file itself is the game folder's reshade/selected.txt MENU_HEADING(TAB_GRAPHICS, "Post-processing"), {TAB_GRAPHICS, "ReShade preset", &opts.reshade, 0, reshade::last_builtin_preset, 1, reshade_menu::tx_preset, "Native HDR supports built-in and LinearHDR presets. Use Expanded HDR for imported SDR presets.", reshade_menu::hn_preset, false, true}, {TAB_GRAPHICS, kReshadeCompare, nullptr, 0, 0, 0, nullptr, "Preview presets. Back restores your saved selection."}, {TAB_GRAPHICS, "User preset file", &reshade_menu::user_pick, 0, 0, 1, reshade_menu::tx_user, "Copy INI files to reshade/presets and FX and FXH files to reshade/shaders, then rescan.", nullptr, false, true}, {TAB_GRAPHICS, kReshadeRescan, nullptr, 0, 0, 0, nullptr, "Refreshes the user preset list and reloads the selected file."}, // ((Triforce) 11-24) how far and how fine the scene's details go: the short grass's reach (vk_draw.cpp grass_reach) and the // sun's shadow maps (host/oot_shadow.c, HOS_OPT_SHADOW_RES). Both taken at once; Game's, the default, is as shipped MENU_HEADING(TAB_GRAPHICS, "Detail"), {TAB_GRAPHICS, "Grass distance", &opts.grass_distance, 0, 3, 1, tx_grass_distance, "How far away short grass blades reach, such as Kokiri Forest's tufts and the moss on its stones. The game stops them at " "about 20 m. Higher extends their reach for some GPU time. Changes at once."}, // ((Triforce, 11-24) opens the Simulated turf page, the TAB_SIM_TURF rows: vk_sim_turf.cpp, sim_turf_settings.h) {TAB_GRAPHICS, "Simulated turf", nullptr, 0, 0, 0, nullptr, "The broad field grass the game's wind and fluid simulation moves: the dense carpet that bends and ripples around Link. " "Its fade, density and blades, area by area. Grass distance is the separate short blades."}, {TAB_GRAPHICS, "Shadow resolution", &opts.shadow_res, 0, 2, 1, tx_shadow_res, "The size of the sun's shadow maps: higher keeps the shadows of thin things near you, such as chains, fences and leaves, " "smooth instead of stair-stepped, for more video memory and a little GPU time. Highest also makes them shimmer less while " "the camera moves. Changes at once.", hn_shadow_res}, // ((Triforce, 11-18, v0.5.1) a player's RX 7700S: glowing doors and walls with native mesh shaders, gone with the compute // fallback (#bug-tracker). The row's key, mesh_shaders, is read where the device is made: vk_main.cpp. Its own group, as // v0.5.1's Advanced section had it, after the picture's) MENU_HEADING(TAB_GRAPHICS, "Advanced"), {TAB_GRAPHICS, "Mesh shaders", &opts.mesh_mode, 0, 1, 1, tx_mesh, "How the game's mesh-shader draws run. Try Compute fallback on an AMD card that shows glowing walls or loses the GPU. " "Applies after a restart.", hn_mesh, true}, // ---- System ---- // ((Triforce) 11-23, his "can we move [achievements] to a more pronounced place for people to find (and disable or // enable)": a group of their own, the tab's first. The list's page (host/achievements.c's list; shown once the host has // named it), whether anything is earned, and whether one earned shows its notice. They were a row under Saves & // reports, and off only by HOS_ACHIEVEMENTS=0 in triforce_env.txt) MENU_HEADING(TAB_SYSTEM, "Achievements"), {TAB_SYSTEM, "View achievements", nullptr, 0, 0, 0, nullptr, // (kAchRow) "Every achievement, and the ones you have earned. They are earned as you play; nothing is set here."}, {TAB_SYSTEM, "Achievements", &opts.achievements, 0, 1, 1, tx_onoff, "Whether things you do in the game are marked as earned. Off: nothing is checked or earned, and what you have earned " "is kept.", nullptr, false, true}, {TAB_SYSTEM, "Achievement notices", &opts.achievement_notices, 0, 1, 1, tx_onoff, "Whether a notice and a sound tell you when you earn one. Off: they are still earned, and listed under View " "achievements.", nullptr, false, true}, // ---- System: the game's ---- MENU_HEADING(TAB_SYSTEM, "Game"), // (Triforce: language.txt's choice, not the options file's. Its entries are counted when the file is read: lang_load) {TAB_SYSTEM, "Game language", &opts.language, 0, 0, 1, tx_language, "The language of the game's texts, of those your game has (language.txt in the game folder). Applies after a restart.", hn_language, true, true}, // ((Triforce) this menu's own language: English by default, as before the row; the texts its tables lack stay English) {TAB_SYSTEM, "Menu language", &opts.menu_lang, 0, i18n::lang_count(), 1, tx_menu_lang, "The language of this menu.", hn_menu_lang, false, true}, {TAB_SYSTEM, "Text speed", &opts.text_speed, 0, 3, 1, tx_text_speed, "How fast the letters of dialogue and other messages appear.", hn_text_speed}, // (Triforce: host/oot_text_size.c, the text panes' own scale; taken at once) {TAB_SYSTEM, "Text size", &opts.text_size, 0, 4, 1, tx_text_size, "How large the text of dialogue, Navi and signs is drawn.", hn_text_size, false, true}, // (host/nn_vi.c realtime_step, hos_vi_native_interval: Per frame is the console's, paced to the game's own interval) {TAB_SYSTEM, "Game speed", &opts.realtime, 0, 1, 1, tx_speed, "How the game keeps time when it runs below 60 fps.", hn_speed}, // (Triforce: host/oot_fov.c, the camera's angle as the game builds its projection; taken at once) {TAB_SYSTEM, "Field of view", &opts.fov, 50, 150, 5, tx_fov, "How much of the world the camera shows while you play: higher is wider. Cutscenes keep their own view.", nullptr, false, true}, // (Triforce: host/oot_damage.c, Link's life as the game writes it after a hit; taken at once) {TAB_SYSTEM, "Damage taken", &opts.damage_taken, 0, 3, 1, tx_damage_taken, "How much of his hearts Link loses from a hit. Half rounds up to the next quarter heart. Healing stays as it is.", nullptr, false, true}, // (Triforce: host/oot_autoload.c, the title's list and the file select pressed through as benchmark mode does; read once, // when the title's list first shows, so a change is the next start's) {TAB_SYSTEM, "Skip title screen", &opts.skip_title, 0, 1, 1, tx_onoff, "Starts the game straight on your newest save: Continue and Load are pressed for you, unless you press something " "first. From the game's next start.", nullptr, false, true}, // (Triforce: host/oot_opening.c, the opening's two movies not started; for a new game started with it on) {TAB_SYSTEM, "Skip opening", &opts.skip_opening, 0, 1, 1, tx_onoff, "A new game starts without its opening, the story movie and Navi waking Link. Every later cutscene plays as it does.", nullptr, false, true}, // ---- Audio ---- MENU_HEADING(TAB_AUDIO, "Sound"), // (Triforce, after NX2navi's volume row: over the game's own mix, host/nn_audio.c; the game's own Options have none) {TAB_AUDIO, "Master volume", &opts.volume, 0, 100, 5, tx_volume, "How loud the game is, in percent of its own volume.", nullptr, false, true}, // (Triforce, after NX2navi's menu_sound_volume: the options' own sounds, host/menu_sound.c; under the Master volume) {TAB_AUDIO, "Menu sounds", &opts.menu_sounds, 0, 100, 5, tx_menu_sounds, "How loud these options' own sounds are, the game's interface sounds from your game files.", nullptr, false, true}, // (Triforce: host/nn_audio.c master_volume, the Master volume's gain 0 while another window is in front; taken at once) {TAB_AUDIO, "Mute in background", &opts.mute_background, 0, 1, 1, tx_onoff, "No sound while another window has the focus.", nullptr, false, true}, {TAB_AUDIO, "Audio output", &opts.audio_output, 0, 3, 1, tx_audio_output, "The speakers the game mixes its sound for. Applies after a restart; Stereo and Mono change at once.", hn_audio_output, true, true}, // ((Triforce) 11-24: host/audio_output_devices.c, host/nn_audio.c output_route_update; taken at once. Shown where the host // lists devices: row_shown. Saved by the device's id, not its number: save) {TAB_AUDIO, "Output device", &output_pick, 0, 0, 1, tx_output_device, "The device the game plays its sound on: the system's default, or one you choose.", hn_output_device, false, true}, MENU_HEADING(TAB_AUDIO, "Microphone"), {TAB_AUDIO, "Microphone", &opts.mic, 0, 2 + kMaxMics, 1, tx_mic, "What the ocarina hears when the game's microphone option is on (playing an instrument, or humming).", hn_mic, false, true}, // (Triforce: host/nn_audio_in.c pump, the microphone's samples scaled before the game's streams get them; taken at once. // Shown with a microphone chosen: row_shown) {TAB_AUDIO, "Microphone gain", &opts.mic_gain, 25, 400, 25, tx_percent, "How loud the microphone is for the ocarina, in percent of what it gives. Raise it if your notes are not heard.", nullptr, false, true}, // ((Triforce) 11-24: an action; the meter in its cell while on: mic_testing. Shown with a microphone chosen: row_shown) {TAB_AUDIO, kTestMic, nullptr, 0, 0, 0, nullptr, "Listens to the microphone while you set its gain, and shows how loud it is. Nothing is played back or recorded; the " "test stops when you leave the Audio tab."}, // ((Triforce) 11-24) a DualSense's own speaker and headphones (host/pad_speaker.c, host/audio_source.c; the host reads // them packed: HOS_OPT_PAD_SPEAKER_*). Every kind Off and the headphones Off by default: nothing opens, as before MENU_HEADING(TAB_AUDIO, "Controller speaker"), {TAB_AUDIO, "Speaker volume", &opts.pad_speaker_volume, 0, 200, 10, tx_percent, "How loud a DualSense's own speaker plays the sounds sent to it below (the controller on a USB cable). A short tone " "plays on it when you change this.", nullptr, false, true}, {TAB_AUDIO, "Controller sync", &opts.pad_speaker_sync, -100, 150, 10, tx_pad_sync, "Lines up the sounds set to Controller + TV. If the controller plays later than the TV, go below 0: the TV waits. If " "the TV plays later, go above 0: the controller waits.", nullptr, false, true}, {TAB_AUDIO, "Headphones on the controller", &opts.pad_speaker_headphones, 0, 2, 1, tx_pad_headphones, "With headphones in a DualSense's jack (on a USB cable). All sound: the whole game plays on them and the TV is silent, " "as on the console. Controller sounds: only the sounds set to play on the controller go to them. Off: they are left " "out.", nullptr, false, true}, {TAB_AUDIO, "Headphone volume", &opts.pad_speaker_headphone_volume, 0, 100, 10, tx_percent, "How loud the headphones in the controller's jack play.", nullptr, false, true}, {TAB_AUDIO, "Navi's voice", &opts.pad_speaker[0], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Navi's flight sounds", &opts.pad_speaker[1], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Z-targeting", &opts.pad_speaker[2], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Ocarina", &opts.pad_speaker[3], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Pick-ups", &opts.pad_speaker[4], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Items", &opts.pad_speaker[5], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Fairies", &opts.pad_speaker[6], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Interface sounds", &opts.pad_speaker[7], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Stone of Agony", &opts.pad_speaker[8], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Low health alarm", &opts.pad_speaker[9], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Fishing", &opts.pad_speaker[10], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, {TAB_AUDIO, "Bottles", &opts.pad_speaker[11], 0, 2, 1, tx_pad_speaker, "Where this kind of sound plays with a DualSense on a USB cable. Off: with the rest of the game's sound. Controller " "only: on the controller's speaker, and no longer on the TV. Controller + TV: on both.", nullptr, false, true}, MENU_HEADING(TAB_SYSTEM, "Saves & reports"), // (Triforce, after NX2navi's save rows: they act on a press, share_row; the host does the work, host/save_share.c) {TAB_SYSTEM, "Export save", nullptr, 0, 0, 0, nullptr, "Writes your save as a zip into your Downloads folder: to keep, or to give to someone. No game file is in it."}, {TAB_SYSTEM, "Export save for a bug report", nullptr, 0, 0, 0, nullptr, "The same zip with the game's logs, its settings and its freeze report added: what to send with a problem report."}, {TAB_SYSTEM, "Import a save", nullptr, 0, 0, 0, nullptr, "Takes a save export of Triforce or NX2navi that you put into the game folder's save-import folder. It becomes your " "save at the next start; the save it replaces is kept. For an emulator's save: Convert saves in Triforce Setup."}, // (Triforce, after NX2navi's F8: host/bug_capture.c writes the folder, vk_bugshot.cpp its picture) {TAB_SYSTEM, "Bug capture (F8)", nullptr, 0, 0, 0, nullptr, "Writes what a problem report needs into a folder of its own under captures in the game folder: a picture, your " "settings, the end of the log and your save. F8 does the same while you play."}, // (Triforce: host/save_files.c's files, the title's file select again; shown once the host has named them) {TAB_SYSTEM, "Save files", nullptr, 0, 0, 0, nullptr, // (kFilesRow) "Your save files: each is a playthrough of its own, with its own saves and autosaves. Choosing another restarts the game " "on it, so save first."}, // (Triforce: host/oot_autosave.c, the save requests of a crossing answered "not queued"; taken at once. // The group's last row: the rows that act on a press stand together after Microphone, tests/test_save_rows.py) {TAB_SYSTEM, "Autosave", &opts.autosave, 0, 1, 1, tx_onoff, "Whether the game saves by itself as you go from one area to another. Off skips those saves; saving from the pause " "menu still works.", nullptr, false, true}, // ((Triforce) 11-24: NFC: opens the Scan amiibo page, menu_tick) MENU_HEADING(TAB_SYSTEM, "NFC"), {TAB_SYSTEM, kNfcTag, nullptr, 0, 0, 0, nullptr, "Hold one of your own amiibo to the game's reader: choose a dump (.bin, or a Flipper .nfc) from the folder \"amiibo\" in the game folder, " "then use amiibo in the game. Choose it again to take it off."}, MENU_HEADING(TAB_SYSTEM, "Online"), {TAB_SYSTEM, "Discord status", &opts.discord, 0, 1, 1, tx_onoff, "Shows \"Playing Triforce\" and the time played in your Discord status, while Discord runs on this PC.", nullptr, false, true}, // (Triforce, after NX2navi's Cheats tab: the cheats of the mods' cheat files, a row each once the host has named them) MENU_HEADING(TAB_SYSTEM, "Mod cheats"), // (kModCheatHeading) MOD_CHEAT_ROWS8(0) MOD_CHEAT_ROWS8(8) MOD_CHEAT_ROWS8(16) MOD_CHEAT_ROWS8(24) MOD_CHEAT_ROWS8(32) MOD_CHEAT_ROWS8(40) MOD_CHEAT_ROWS8(48) MOD_CHEAT_ROWS8(56) MOD_CHEAT_ROWS8(64) MOD_CHEAT_ROWS8(72) MOD_CHEAT_ROWS8(80) MOD_CHEAT_ROWS8(88) // ---- Controls (Motion opens the 6 TAB_MOTION rows, Controls its page with the 2 TAB_PAGE rows) ---- MENU_HEADING(TAB_CONTROLS, "Controller"), {TAB_CONTROLS, "Controller in background", &opts.pad_background, 0, 1, 1, tx_onoff, "Whether the controller plays the game while another window has the focus.", hn_background}, // (Triforce, after NX2navi's lstick_deadzone and rstick_deadzone: host/nn_hid.c hos_stick_axis_own) {TAB_CONTROLS, "Left stick dead zone", &opts.lstick_dead_zone, -1, 50, 1, tx_own_dead_zone, "How far the left stick moves from its centre before the game sees it, in percent of its travel: lower for a precise " "stick, higher for one that drifts. The game's own dead zone still follows.", nullptr, false, true}, {TAB_CONTROLS, "Right stick dead zone", &opts.rstick_dead_zone, -1, 50, 1, tx_own_dead_zone, "How far the right stick moves from its centre before the game sees it, in percent of its travel: lower for a precise " "stick, higher for one that drifts. The game's own dead zone still follows.", nullptr, false, true}, // (Triforce: host/prompts.c build_camera) {TAB_CONTROLS, "Camera speed", &opts.camera_speed, 25, 300, 5, tx_sens, "How fast the right stick turns the camera, times the game's own speed. Applies after a restart.", nullptr, true, true}, {TAB_CONTROLS, "Invert camera X", &opts.invert_cam_x, 0, 1, 1, tx_onoff, "Swaps left and right for the right stick's camera.", nullptr, false, true}, {TAB_CONTROLS, "Invert camera Y", &opts.invert_cam_y, 0, 1, 1, tx_onoff, "Swaps up and down for the right stick's camera.", nullptr, false, true}, MENU_HEADING(TAB_CONTROLS, "Mouse & keyboard"), {TAB_CONTROLS, "Mouse camera", &opts.mouse_native, 0, 2, 1, tx_mousecam, "How the captured mouse turns the camera.", hn_mousecam, false, true}, {TAB_CONTROLS, "Mouse sensitivity", &opts.mouse_sens, 10, 500, 10, tx_sens, "How far the camera turns for a mouse movement. The - and = keys change it in game too.", nullptr, false, true}, {TAB_CONTROLS, "Invert mouse vertical", &opts.mouse_invert, 0, 1, 1, tx_onoff, "Swaps up and down for the mouse.", hn_mouse_invert, false, true}, // ((Triforce) 11-24: with Mouse camera on Native the game's own camera inversion, and Invert camera X, which turn the // right stick around, never reach the mouse: this row swaps its left and right, in both modes) {TAB_CONTROLS, "Invert mouse horizontal", &opts.mouse_invert_x, 0, 1, 1, tx_onoff, "Swaps left and right for the mouse.", nullptr, false, true}, // (Triforce, after NX2navi's walk_key and walk_scale: host/nn_hid.c walk_key_code, walk_keys) {TAB_CONTROLS, "Walk key", &opts.walk_key, 0, 4, 1, tx_walk_key, "A key that makes Link walk: held with the movement keys, they push the stick only as far as Walk scale. While it is " "chosen the key presses nothing else.", hn_walk_key, false, true}, {TAB_CONTROLS, "Walk scale", &opts.walk_scale, 20, 90, 1, tx_sens, "How far the movement keys push the stick while the Walk key is held: 1.00 would be all the way.", nullptr, false, true}, {TAB_CONTROLS, "Menu shortcut", &opts.menu_shortcut, 0, 4, 1, tx_menu_shortcut, "Which keys open and close these options from anywhere. F1 always does; F1 only leaves Insert free for an overlay. With " "Esc, Esc opens them too, as a PC game's pause menu (open, Esc still goes back a page or closes them). With touchpad, a " "DualShock 4's or DualSense's touchpad click opens and closes them as F1 does.", nullptr, false, true}, MENU_HEADING(TAB_CONTROLS, "Rumble"), // (Triforce: to 300 as NX2navi's rumble_strength, 150 before) {TAB_CONTROLS, "Rumble strength", &opts.rumble, 0, 300, 25, tx_rumble, "How strongly the controller rumbles, in percent of the game's rumble. Off turns it off.", nullptr, false, true}, // (Triforce, after NX2navi's rumble_curve: host/pad_sdl.c rumble_curve) {TAB_CONTROLS, "Vibration curve", &opts.rumble_curve, 20, 150, 5, tx_sens, "Shapes the rumble: 1.00 is the game's. Lower makes the many weak rumbles easier to feel; higher quiets them. A Switch " "controller's HD rumble is not changed.", nullptr, false, true}, // (Triforce, after NX2navi's rumble_triggers: host/pad_sdl.c trigger_poll) {TAB_CONTROLS, "Trigger vibration", &opts.rumble_triggers, 0, 1, 1, tx_onoff, "Xbox One and Series controllers: the motors in the triggers rumble too.", nullptr, false, true}, // ((Triforce) 11-24) Vibration (host/vibration.h) and RenHDrum's HD Haptics (host/rumble_renhdrum.c). Without // renhdrum.dll beside the game, Auto plays as before: a Switch controller's own HD rumble, every other one's motors {TAB_CONTROLS, "Vibration", &opts.vibration, 0, 2, 1, tx_vibration, "How the controller vibrates. Auto plays the best it can: with RenHDrum beside the game a DualSense its voice coils, a " "Switch controller and an Xbox controller RenHDrum's HD rumble, a Steam Controller (2026) its grips; without it a " "Switch controller its own HD rumble and every other controller its motors. Basic plays the motors on every " "controller. Off stops it. The line below says what plays the controller used last.", hn_vibration, false, true}, {TAB_CONTROLS, "DualSense HD Haptics", &opts.ds_hd_haptics, 0, 1, 1, tx_onoff, "A DualSense that RenHDrum plays also taps its speaker and kicks back on L2 and R2 while you hold them, from the " "game's vibration, with deeper heavy hits. Off: its fine haptics alone.", nullptr, false, true}, MENU_HEADING(TAB_CONTROLS, "Gameplay"), // (Triforce, after NX2navi's sprint button: host/oot_sprint.h) {TAB_CONTROLS, "Sprint button", &opts.sprint_button, 0, 2, 1, tx_sprint, "Link sprints from a button press, without rolling first. Left stick click: the game has no other use for it. B: " "sprints while Link moves (with the game's Swap Jump Controls B is the jump: use the stick's click).", nullptr, false, true}, {TAB_CONTROLS, "Sprint mode", &opts.sprint_mode, 0, 1, 1, tx_sprint_mode, "Toggle: a press starts the sprint, the next press or stopping ends it. Hold: Link sprints while the button is held.", nullptr, false, true}, // (Triforce: nx2/oot_patches.py patch_camera_centering, host/mouse_native.c hos_disable_camera_centering; taken at once) {TAB_CONTROLS, "Camera centering", &opts.camera_centering, 0, 1, 1, tx_onoff, "Whether the camera turns by itself the way Link moves. Off: it stays where you put it, which suits the mouse; the " "game's own recentring still works.", nullptr, false, true}, {TAB_MOTION, "Motion controls", &opts.gyro, 0, 1, 1, tx_gyro, "Aims and looks with the controller's gyroscope where the game uses motion, as on the Switch: Switch Pro controllers " "and pads in Switch mode, DualSense and DualShock 4.", hn_gyro, false, true}, {TAB_MOTION, "Motion sensitivity X", &opts.gyro_sens_x, 10, 600, 10, tx_percent, "How far the aim moves left and right for a turn of the controller. 100% is the console's.", nullptr, false, true}, {TAB_MOTION, "Motion sensitivity Y", &opts.gyro_sens_y, 10, 300, 10, tx_percent, "How far the aim moves up and down for a tilt of the controller. 100% is the console's.", nullptr, false, true}, {TAB_MOTION, "Invert motion X", &opts.gyro_inv_x, 0, 1, 1, tx_onoff, "Swaps the motion aim's left and right.", nullptr, false, true}, {TAB_MOTION, "Invert motion Y", &opts.gyro_inv_y, 0, 1, 1, tx_onoff, "Swaps the motion aim's up and down.", nullptr, false, true}, {TAB_MOTION, "Motion deadzone", &opts.gyro_deadzone, 0, 2, 1, tx_deadzone, "How slow a turn counts as none, the console's three settings: Standard is its own. High steadies a pad that jitters; " "Low keeps the smallest movements.", nullptr, false, true}, // ((Triforce) 11-24: hold-to-toggle, for players who cannot keep a button held: a row for each of the Switch's buttons // that the game holds (not Plus, Minus or the directions). The rows' names are their keys, toggle_