Redraw the in-game menu with the game's own interface textures, and bring in the launcher's save import and faster builds.

In-game menu: the settings window, its tabs, rows, buttons and cursor, the performance overlay and the Preparing
shaders box are drawn with the game's interface textures where the RomFS holds them (runtime/ui/menu_skin.cpp,
perf_panel.cpp; plain shapes until they are decoded). Restart joins Continue and Quit, each behind a confirmation;
VSync is an on/off switch; DLSS is listed only on NVIDIA GPUs; the menu sounds are quieter; Picture shape is gone and
the setting descriptions are shorter; edge cases of input, layout and fonts are fixed. tools/menu_preview.py draws the
menu without the game.

Launcher: Import Saves takes a save from the game folder's saves/ folder or one the player picks; downloads fall back
to Windows' own certificate check when Python's refuses a server; updates are faster; the title bar is drawn in the
window and Navi is every icon. tools/make_game.py builds with CLANG64's clang where the launcher installed it, packs
the RomFS beside the lift and the compile, takes a prebuilt runtime, and compiles the game's resources without cmd.exe,
so a user folder with a space in its name builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-08 03:57:01 -05:00
parent 5b28da3a06
commit 8daedbd806
42 changed files with 4138 additions and 972 deletions

View File

@@ -2032,6 +2032,7 @@ static struct {
uint32_t left; // prebuild jobs queued or running
uint32_t built, failed, promoted;
double t0; // now_ms() when the prebuild started
double until; // now_ms() after which the boot builders stop (comment at prewarm_run); 0 none
} K = {.io = PLAT_MUTEX_INIT};
static uint64_t rec_hash(const KeyRec *r) {
@@ -2637,11 +2638,12 @@ VkPipeline vk_pipeline_graphics_async(const VkPipeState *s, const VkPipeInfo **i
static int id_cmp(const void *x, const void *y) { return memcmp(x, y, 32); }
// Builds queued prebuild jobs until the low queue is empty, beside the pipe_worker pool (same bookkeeping).
// Builds queued prebuild jobs until the low queue is empty or K.until passes, beside the pipe_worker pool (same
// bookkeeping). Jobs left queued at K.until stay for the pool.
static void warm_builder(void *arg) {
(void)arg;
plat_mutex_lock(&P.lock);
while (A.low) {
while (A.low && !(K.until && now_ms() >= K.until)) {
Job *j = A.low;
if ((A.low = j->next)) A.low->prev = NULL;
else A.low_tail = NULL;
@@ -2686,6 +2688,16 @@ void vk_pipeline_prewarm_progress(VkPrewarmProgress *p) {
static void prewarm_run(void);
// The boot's share of the pipeline prebuild with the graphics pipeline library. The boot builds the recorded
// pipelines in record order, so those met first in play (the title screen, the first places) come first, for at most
// this long after the shaders are ready; the rest stay queued for the pool workers, which build them below normal
// priority while the game runs. A draw that meets one of them before it is built gets a pipeline linked from stage
// libraries at once (gpl_link), as for any new pipeline in play. After a driver update, when every pipeline is built
// from nothing, the boot thus waits this long instead of for all of them (15 minutes and more with a long play
// history). Without the library a draw would have to wait for a whole build, so the boot waits for all; so it does
// with NX2NAVI_PREWARM_FULL=1.
#define PREWARM_PIPE_MS 20000.0
void vk_pipeline_prewarm(void) {
prewarm_run();
__atomic_store_n(&pw_phase, 3, __ATOMIC_RELEASE);
@@ -2777,6 +2789,8 @@ static void prewarm_run(void) {
__atomic_store_n(&pw_pipe_done, 0, __ATOMIC_RELAXED);
__atomic_store_n(&pw_pipe_total, (int64_t)queued, __ATOMIC_RELAXED);
__atomic_store_n(&pw_phase, 2, __ATOMIC_RELEASE);
const char *full = cfg_get("NX2NAVI_PREWARM_FULL");
K.until = P.gpl && !(full && !strcmp(full, "1")) ? now_ms() + PREWARM_PIPE_MS : 0; // before the builders start
PlatThread *t[64];
int nt = 0;
for (int i = 0; i < cpus && i < 64 && queued; i++)
@@ -2793,10 +2807,16 @@ static void prewarm_run(void) {
}
__atomic_store_n(&pw_pipe_done, (int64_t)queued, __ATOMIC_RELAXED);
plat_mutex_lock(&P.lock);
while (K.left) plat_cond_wait(&done_cv, &P.lock); // jobs a pool worker took
rt_log("vk_pipeline: prewarm: %zu records in %s: %u pipelines built, %u failed, %u already built, %u dropped "
"(shader neither cached nor stored); shaders %.0f ms, pipelines %.0f ms on %d threads, total %.0f ms",
n, K.path, K.built, K.failed, known, dropped, t1 - t0, now_ms() - t1, nt, now_ms() - t0);
uint32_t later = 0;
for (Job *j = A.low; j; j = j->next) later += j->prebuild;
if (!later) // all built: wait for those a pool worker took
while (K.left) plat_cond_wait(&done_cv, &P.lock);
else // the boot's time is up: the pool builds the rest while the game runs
plat_cond_broadcast(&work_cv);
rt_log("vk_pipeline: prewarm: %zu records in %s: %u pipelines built, %u left to build in the background, %u "
"failed, %u already built, %u dropped (shader neither cached nor stored); shaders %.0f ms, pipelines %.0f "
"ms on %d threads, total %.0f ms", n, K.path, K.built, later, K.failed, known, dropped, t1 - t0,
now_ms() - t1, nt, now_ms() - t0);
free(K.file);
K.file = NULL;
plat_mutex_unlock(&P.lock);