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

@@ -86,6 +86,11 @@ static int on_last = 1;
static int64_t now_ns = 1000000000LL; /* (a read each 16 ms: read_once) */
int64_t hos_now_ns(void) { return now_ns; }
int hos_oot_mods_down(void) { return on_last; }
/* ((Triforce) the title's tabs: what the host's own presses of this read are, and whether the title's list is there (1, and 2
with the save files on) */
static uint64_t script_now;
static int title_tabs;
int hos_oot_title_tabs(void) { return title_tabs; }
%(enum)s;
%(func)s
/* one read: the buttons and stick the devices and the script give; what the game is given */
@@ -147,7 +152,35 @@ static void down_held_from_above(int above_ms, int ms, int stick, int want_ms) {
CHECK(!(presses & HOS_MODS_PRESS_DOWN)); /* (the repeat's Down onto Mods is no press of the entry's: the menu repeats on) */
}
}
/* ((Triforce) the title's tabs, Mods and Save Select at the top left: a scripted X is Mods' (the word 6) and a scripted Y Save
Select's (7), told once a press and not given to the game; off the title, with the save files off (Y), or pressed by a
device (not a host's own press: the renderer reads the pad itself) they are the game's as they were */
static void scripted_tabs(void) {
reset();
on_last = 0, title_tabs = 3;
script_now = 1ULL << B_X, read_once(1ULL << B_X, 0);
CHECK(entered == 6 && !(game >> B_X & 1));
entered = 0, read_once(1ULL << B_X, 0); /* (held: no second word) */
CHECK(entered == 0);
script_now = 0, read_once(0, 0);
script_now = 1ULL << B_Y, read_once(1ULL << B_Y, 0);
CHECK(entered == 7 && !(game >> B_Y & 1));
entered = 0, script_now = 0, read_once(0, 0);
title_tabs = 1; /* (no save files: Y is the game's) */
script_now = 1ULL << B_Y, read_once(1ULL << B_Y, 0);
CHECK(entered == 0 && (game >> B_Y & 1));
script_now = 0, read_once(0, 0);
title_tabs = 0; /* (not the title) */
script_now = 1ULL << B_X, read_once(1ULL << B_X, 0);
CHECK(entered == 0 && (game >> B_X & 1));
script_now = 0, read_once(0, 0);
title_tabs = 3; /* (a key or a pad's button, not the script's: not told here) */
read_once(1ULL << B_X | 1ULL << B_Y, 0);
CHECK(entered == 0 && (game >> B_X & 1) && (game >> B_Y & 1));
read_once(0, 0), title_tabs = 0;
}
int main(void) {
scripted_tabs();
down_held_from_above(500, 1000, 0, 500 + 83); /* (the game's repeat onto the last button at 500 ms: a step after it) */
down_held_from_above(500, 1000, 1, 500 + 83); /* (the stick's) */
down_held_from_above(16, 300, 0, -1); /* (a 300 ms press from the button above: the game's move only) */
@@ -246,6 +279,8 @@ static int fails;
static int64_t now = 9000000000LL;
int64_t prof_now() { return now; }
std::atomic<int64_t> mods_list_ns{0}, mods_list_frame{0};
static bool title_list = true; // ((Triforce, 11-26) the title's list first, as before)
bool mods_title_list() { return title_list; }
%(state)s
%(age)s
%(fresh)s
@@ -265,6 +300,17 @@ int main() {
CHECK(mods_list_fresh() && mods_list_age() == 100000000);
now += 60000000;
CHECK(!mods_list_fresh());
// ((Triforce, 11-26) the pause menu's System list: gone at the third game frame without a report, however soon (the
// owner's Mods and Quit left on the game after the menu closed); a slow frame of its is no list gone, as before)
title_list = false;
mods_list_frame.store(game_frames.load()), mods_list_ns.store(now);
game_frames += 2, now += 8000000;
CHECK(mods_list_fresh());
game_frames += 1, now += 4000000;
CHECK(!mods_list_fresh() && mods_list_age() == 12000000);
mods_list_frame.store(game_frames.load()), mods_list_ns.store(now);
now += 235000000, game_frames += 1;
CHECK(mods_list_fresh() && mods_list_age() == 0);
if (!fails) std::puts("the list's age");
return fails ? 1 : 0;
}
@@ -362,14 +408,15 @@ def main():
block(win, "static void mods_list_tick(uint64_t screen, int title, ModsCall *call) {"),
"the list's frame does not note the game's presents")
age = block(menu, "int64_t mods_list_age() {")
fresh = re.search(r"^bool mods_list_fresh\(\) \{[^\n]*\}$", menu, re.M)
check(fresh is not None, "mods_list_fresh is not the list's age against 150 ms")
fresh = block(menu, "bool mods_list_fresh() {")
check("return mods_list_age() < 150000000LL;" in fresh and "if (!mods_title_list() && mods_list_ns.load(std::memory_order_relaxed) &&" in fresh,
"mods_list_fresh is not the list's age against 150 ms, the pause menu's list gone at its third frame without a report")
game_frames = re.search(r"^std::atomic<int64_t> game_frames\{0\};", menu, re.M)
check(game_frames is not None, "game_frames is not where mods_list_age reads it")
with tempfile.TemporaryDirectory(prefix="mods-entry-input-") as tmp:
run(args.cxx, fill(HID_FIXTURE, enum=enum, func=func), "hid", tmp, "c")
run(args.cxx, fill(MENU_HOST_FIXTURE, state=state, func=down), "oot", tmp, "c")
run(args.cxx, fill(AGE_FIXTURE, state=game_frames.group(0), age=age, fresh=fresh.group(0)), "age", tmp, "c++")
run(args.cxx, fill(AGE_FIXTURE, state=game_frames.group(0), age=age, fresh=fresh), "age", tmp, "c++")
run(args.cxx, KEYS_FIXTURE, "keys", tmp, "c++")
# the menu: the host's report of the directions held (each read), repeated as a pad's held direction
@@ -382,7 +429,10 @@ def main():
check("const bool mods_here = page == kModsRowPage || page == kModsPage;" in rep and "(host_held >> (i - 1) & 1)" in rep and
"t - mods_held_ns.load(std::memory_order_relaxed) < 250000000LL" in rep,
"a direction a test's script holds on Mods is not repeated as a pad's")
check("next_repeat[i] = t + 350000000LL" in rep and "33000000LL : 83000000LL" in rep, "the repeat's rate changed")
# ((Triforce, 11-26) Up and Down at the game's own pace, 330 ms then each 135 ms (the owner's clip); Left and Right as before)
check("next_repeat[i] = t + first_ns(i)" in rep and "dir <= 2 ? kNavFirstNs : 350000000LL" in rep and
"dir <= 2 ? kNavStepNs : held > 1500000000LL ? 33000000LL : 83000000LL" in rep and
"constexpr int64_t kNavFirstNs = 330000000LL, kNavStepNs = 135000000LL;" in menu, "the repeat's rate changed")
# (the keys bound to the game's D-pad, movement and A on the entries: pressed and held as the menu's own, the Down that
# came onto Mods taken away with the pad's)
keys = tick[tick.index("uint32_t game_keys = 0, game_keys_new = 0;"):tick.index("// holding an arrow or the D-pad repeats it")]
@@ -403,7 +453,7 @@ def main():
"the game keys are read after the tabs are taken from the menu's keys")
# ((a review of beb9b9e) the held Down's repeat onto Mods, word 5: the menu repeats on from it at the step)
check("entered_by_down = enter == 1 || enter == 5;" in tick and "mods_down_repeat_ns = enter == 5 ? prof_now() : 0;" in tick and
"held_since[i] = t - 350000000LL, next_repeat[i] = t + 83000000LL, mods_down_repeat_ns = 0;" in rep,
"held_since[i] = t - first_ns(i), next_repeat[i] = t + step_ns(i, first_ns(i)), mods_down_repeat_ns = 0;" in rep,
"the menu does not go on repeating a held Down that came onto Mods by repeat")
check("held[i] || (game_keys >> i & 1) ||" in rep, "a game key held on Mods does not repeat")
check(tick.index("press[i] |= (game_keys_new >> i & 1) != 0;") < tick.index("if (entered_by_down) press[2] = false;"),