Triforce v0.8.5

A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-28 10:54:41 -06:00
parent 2df08c751e
commit b527e29adb
203 changed files with 18821 additions and 2051 deletions

View File

@@ -1800,6 +1800,11 @@ static struct {
sleep (NX2navi's "core grant to run", runtime/kernel.c grant_at) */
int64_t spun, slept, spin_ns, spin_capped, run_spin_ns, run_spin_n, run_sleep_ns, run_sleep_n, run_max_ns;
int64_t pin_waits; /* ((Triforce, 11-23) waits past esc_eq kept to their one core behind a better holder: vc_acquire */
/* (Triforce, the AMD limits work) who the longest wait was: the waiter and the holders of the cores it may use, read a
millisecond into the wait (vc_acquire). The 5 s line says how long the longest wait was, not whose: the title screen's
hitches (frames of 50-250 ms "outside the replay and the present" while the movie plays) had waits of 70-190 ms with
no name on them */
char max_who[224];
} vc_st;
/* ((Triforce, 11-22, the performance audit's OS-51) the waits since the last present, beside vc_st's 5 s: their time summed
over the threads, how many, the longest. Added to with vc_lock held, taken by the present's look without it
@@ -1899,6 +1904,8 @@ static void vc_stats_locked(int64_t now) {
if (vc_st.pin_waits) /* ((Triforce, 11-23) vc_acquire: the escapes the one-core rule held back) */
hos_log("vcores: %lld waits held to their one core past the escape, behind a holder of better priority there "
"(HOS_VCORE_PIN_ESCAPE_MS=0: they escape at HOS_VCORE_ESCAPE_EQ_US, as before)", (long long)vc_st.pin_waits);
if (vc_st.max_ns >= 20000000 && vc_st.max_who[0]) /* (20 ms: more than a frame at 60 fps) */
hos_log("vcores: the longest wait, %.1f ms: %s", vc_st.max_ns / 1e6, vc_st.max_who);
memset(&vc_st, 0, sizeof vc_st);
vc_st.since = now;
}
@@ -1988,6 +1995,7 @@ static void vc_acquire(HosThread *t) {
vc_st.waits++;
int spun = 0, slept = 0, ended = 0; /* ((Triforce) the spin tried, a sleep taken, the wait ended in the spin) */
int pin_noted = 0; /* ((Triforce, 11-23) this wait counted in vc_st.pin_waits */
char holders[160] = ""; /* ((Triforce) the holders of t's cores, a millisecond into the wait) */
for (;;) {
/* the worst holder worse than t on a core t may use gives it up at its next checkpoint; after
HOS_VCORE_SLICE_US (2000) of waiting, a holder as good as t does too (a time slice: Horizon would leave
@@ -2039,6 +2047,13 @@ static void vc_acquire(HosThread *t) {
vc_take(t, c);
break;
}
if (!holders[0]) {
int len = 0;
for (int k = 0; k < vc_cores() && len < 120; k++)
if ((m >> k & 1) && vc_owner[k])
len += snprintf(holders + len, sizeof holders - len, " core %d: %s (%d)%s;", k, vc_owner[k]->name,
vc_owner[k]->priority, vc_owner[k]->vc_kick ? " asked" : "");
}
const int64_t waited = hos_now_ns() - t0;
/* ((Triforce, 11-23) A waiter held to one core, behind a holder of better priority there, does not escape at
esc_eq: Horizon never runs it then, and the game pins threads to another's core so the two never overlap.
@@ -2079,7 +2094,11 @@ static void vc_acquire(HosThread *t) {
const int64_t now = hos_now_ns(), waited = now - t0;
HOS_CHAIN(HOS_CHAIN_WOKE, vc_chain_key(t));
vc_st.wait_ns += waited;
if (waited > vc_st.max_ns) vc_st.max_ns = waited;
if (waited > vc_st.max_ns) {
vc_st.max_ns = waited;
if (holders[0]) snprintf(vc_st.max_who, sizeof vc_st.max_who, "%s (priority %d) waited for%s", t->name, t->priority, holders);
else vc_st.max_who[0] = 0;
}
__atomic_add_fetch(&vc_gap.ns, waited, __ATOMIC_RELAXED), __atomic_add_fetch(&vc_gap.n, 1, __ATOMIC_RELAXED); /* ((Triforce, OS-51)) */
if (waited > __atomic_load_n(&vc_gap.longest, __ATOMIC_RELAXED)) __atomic_store_n(&vc_gap.longest, waited, __ATOMIC_RELAXED);
if (ended) vc_st.spun++; /* ((Triforce) every wait ends in the spin or after a sleep) */