Unlock the frame rate, shorten cold starts, and describe the Ocarina build in the docs.

Ocarina steps its game by the clock (the same frame-numbered walk covers half the distance at 120 fps), so in a build
without the fps60 and realtime patch sets the pacer holds frames to the frame limit alone: any rate from 30 to 1000,
the monitor's rate, or unlimited (164 fps average in Kokiri Forest). The menu always shows the row, with 165, 240 and
Unlimited added. NX2NAVI_PACE_HZ sets the pacer's rate for tests.

A compute pipeline is compiled outside the pipeline lock, and one compile serves the replay and the boot prebuild
alike; the prebuild uses half the CPUs. The guest waits at most NX2NAVI_PREWARM_WAIT_MS (3000) for the boot prewarm,
which then goes on in the background (a cold start waited 9.8 s). NX2NAVI_TEST_PAD_AT attaches the test gamepad late
and presses it, to test a controller switched on in play.

README, docs/architecture.md, docs/controls.md and AGENTS.md describe the Ocarina build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-07 00:06:12 -05:00
parent f5e3322bf5
commit 4943b50ff2
14 changed files with 297 additions and 347 deletions

View File

@@ -366,8 +366,17 @@ void rt_boot(void) {
ipc_applet_event_init();
hostfn_seal();
uint64_t held = plat_now_ms();
if (warm) plat_thread_join(warm);
else vk_pipeline_prewarm();
// At most NX2NAVI_PREWARM_WAIT_MS (default 3000): a warm start is ready in about 0.3 s, but a cold one (a new
// translator, a new driver) translated 2,132 shaders and built 1,579 pipelines for 9.8 s while the window stayed
// black, for shaders the game first needs in play, well after its intro. Past the wait the prewarm goes on in the
// background; 0 waits for all of it. A --shot image waits for all of it, so that it does not depend on build timing.
const char *pw = cfg_get("NX2NAVI_PREWARM_WAIT_MS");
uint64_t wait_ms = pw && *pw ? strtoull(pw, NULL, 10) : 3000;
if (warm && (rt_config()->shot || !wait_ms)) plat_thread_join(warm);
else if (warm && !plat_thread_join_ns(warm, wait_ms * 1000000ull)) {
plat_thread_detach(warm);
rt_log("boot: the prewarm goes on in the background after %llu ms", (unsigned long long)wait_ms);
} else if (!warm) vk_pipeline_prewarm();
held = plat_now_ms() - held;
rt_log("boot: guest starts %llu ms after process start (%llu ms of it waiting for the prewarm)",
(unsigned long long)(plat_process_uptime_ns() / 1000000), (unsigned long long)held);