Make every settings menu row work for Ocarina and give the controls Ocarina's actions and keys.

The Screen tab hides Game resolution when the build has no output and scene patch sets, and the resolution code no
longer grows the memory pool for it. FSR sharpness now also runs when the game image is shrunk to the window, which is
always the case for Ocarina's 2560x1440 picture at 1920x1080, and the overlay drops NX2navi's fixed 3D scene size. A colour
profile set in nx2navi.ini now applies without the menu. The Game tab hides the frame limit in builds without frame-rate
patch sets and lists the game languages the RomFS ships, adding Polish and Brazilian Portuguese. 5.1 sound is reported to
the game's virtual output device. The remap page describes each button as Ocarina's controls screen does, gives each
D-pad direction its own description and drops NX2navi's shake row; the keyboard defaults follow Ocarina (Shift dashes on A,
Ctrl puts away on B, O and N for the ocarina and Navi, middle mouse resets the camera). docs/controls.md is updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-06 11:33:06 -05:00
parent 618b9ba4e5
commit 9a5b1163f3
18 changed files with 385 additions and 174 deletions

View File

@@ -113,6 +113,11 @@ int frame_step_realtime(void) { return step_word != NULL; }
#define LIMIT_MIN_HZ 30
#define LIMIT_MAX_HZ 240 // 1 / STEP_MIN_S
static int fps60_set = -2;
static int game_interval = 1; // the present interval of the newest frame (frame_step_present)
// The limit can change anything only with the fps60 or realtime patch set (NX2navi's builds). Without them (Ocarina) the
// game picks its own present interval and the pacer follows it (nvn_api_obj.c present_period).
int frame_limit_adjustable(void) { return rt_patch_set("fps60") >= 0 || rt_patch_set("realtime") >= 0; }
static unsigned limit_seen;
static int limit_read;
static int limit_hz = -1; // 0: display; -1 before the first read
@@ -141,6 +146,12 @@ static void frame_limit_live(void) {
int hz = limit_parse();
if (hz == limit_hz) return;
limit_hz = hz;
if (!frame_limit_adjustable()) {
if (hz != 60)
rt_log("frame rate: NX2NAVI_FPS_LIMIT=%s does nothing in this build (no fps60 or realtime patch set); the "
"game sets its own rate", cfg_value("NX2NAVI_FPS_LIMIT"));
return;
}
if (fps60_set == -2) fps60_set = rt_patch_set("fps60");
if (fps60_set >= 0) rt_patch_switch(fps60_set, hz != 30);
if ((hz > 60 || hz == 0) && !step_word)
@@ -159,8 +170,10 @@ uint64_t frame_step_cap_ns(void) {
}
// The frame rate the limit gives, for the performance overlay: the setting, the monitor's rate for "display", 60 at
// most without the real-time step; 0 before the first frame read the setting.
// most without the real-time step; the game's own rate (60 Hz over its present interval) in a build without the patch
// sets; 0 before the first frame read the setting.
double frame_step_limit_hz(void) {
if (!frame_limit_adjustable()) return 60.0 / game_interval;
int hz = limit_hz;
if (hz < 0) return 0;
double r = hz ? hz : gfx_window_refresh_hz();
@@ -265,6 +278,7 @@ static void world_clock(double dt, double step) {
}
void frame_step_present(uint64_t display_ns, int interval) {
game_interval = interval > 0 ? interval : 1;
frame_limit_live();
double step = 0, dt = last_ns ? (double)(display_ns - last_ns) * 1e-9 : 0;
if (step_word && last_ns) {