mirror of
https://git.triforceproject.com/triforce/source
synced 2026-12-01 05:18:50 -04:00
Triforce v0.9.0
Character tab, faster renderer defaults, HD rumble shipped, and the 11-30 bug pass: ending softlock below 60 fps, adult first-night lock, Intel Arc robust buffers, adult map, randomizer load order.
This commit is contained in:
100
host/hos_main.c
100
host/hos_main.c
@@ -883,6 +883,7 @@ static const unsigned char oot_item_kinds[] = {OOT_CHEAT_ITEMS(OOT_NO_SECTION, O
|
||||
static int oot_gamedata_bool(Ctx *c, uint32_t hash, int *value);
|
||||
static int oot_gamedata_string(Ctx *c, uint32_t hash, char *buf, size_t size);
|
||||
static int oot_first_night_fix(Ctx *c, const char *map); /* (below, after the tools it uses) */
|
||||
static int oot_adult_map_fix(Ctx *c, const char *map); /* (below too) */
|
||||
|
||||
static void oot_inventory_refresh(Ctx *c, int64_t now) {
|
||||
void rx_option_set(int id, int value);
|
||||
@@ -891,9 +892,10 @@ static void oot_inventory_refresh(Ctx *c, int64_t now) {
|
||||
next = now + 500000000LL;
|
||||
/* (a save is loaded once the pouch answers: before that GameData holds a new game's values, shown as unknown) */
|
||||
const int loaded = oot_pouch_count(c, oot_item_names[0]) >= 0;
|
||||
{ /* (the map Link is in, Sequence_CurrentBanc: the first night's time lock is Hyrule Field's alone) */
|
||||
{ /* (the map Link is in, Sequence_CurrentBanc: the first night's time lock is repaired by it) */
|
||||
char map[80] = "";
|
||||
if (loaded && oot_gamedata_string(c, 0x1d6189dau, map, sizeof map) && map[0]) oot_first_night_fix(c, map);
|
||||
if (loaded && oot_gamedata_string(c, 0x1d6189dau, map, sizeof map) && map[0])
|
||||
oot_first_night_fix(c, map), oot_adult_map_fix(c, map); /* ((Triforce, 11-30) and the adult's maps, #1576602300313506086) */
|
||||
/* ((Triforce) the map and Link's age, logged when either changes: the window after a crash says "while you were
|
||||
playing" from these lines (host/hos_crash_dialog.h), and a log's reader sees where a problem happened */
|
||||
static char logged[100];
|
||||
@@ -1286,28 +1288,6 @@ static int oot_gamedata_set_bool(Ctx *c, uint32_t hash, int value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The first adult night's time lock: f_8347c020 holds the clock at 20:00 while the saved Bool
|
||||
HrlField_isFirstNightTime_Adult (0x8592aa82) is 1 and quest 0x4dbca27f is not Ready. The flag belongs to Hyrule
|
||||
Field's first night only. A save in any other map that still holds it cannot leave night (the Sun's Song and the Debug
|
||||
tab's time are overwritten, the clock snaps back): clear it there with the game's own Bool, once, and say so, never
|
||||
while an event (the escape's cutscene) is running. HOS_OOT_FIRST_NIGHT_FIX=0 turns the repair off for a run. Returns 1
|
||||
when it cleared the flag. Asked by oot_inventory_refresh, twice a second while a save is loaded. */
|
||||
static int oot_first_night_fix(Ctx *c, const char *map) {
|
||||
static int on = -1;
|
||||
if (on < 0) {
|
||||
const char *e = getenv("HOS_OOT_FIRST_NIGHT_FIX");
|
||||
on = !(e && *e && atoi(e) == 0);
|
||||
}
|
||||
if (!on || !map[0] || !strncmp(map, "HyruleField", 11)) return 0;
|
||||
const uint64_t events = oot_singleton(c, OOT_EVENTMGR_SLOT);
|
||||
if (events && recomp_load64(c, events + 104)) return 0; /* (the Main sequence's "Event" test: an event is playing) */
|
||||
int set = 0;
|
||||
if (!oot_gamedata_bool(c, 0x8592aa82u, &set) || !set) return 0;
|
||||
if (!oot_gamedata_set_bool(c, 0x8592aa82u, 0)) return 0;
|
||||
hos_log("oot: cleared the first adult night's time lock (the save was in %s, outside Hyrule Field)", map);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ---- (Triforce, 11-13) The inventory in GameData ----
|
||||
The items are GameData: struct "Pouch" (0x3da094e3) has a struct for each item, whose member "Stock" (0x22344481) is an
|
||||
Int, the item's count; struct 0xade0ef78 has a Bool for each item, "got it once". The names' hashes are MurmurHash3
|
||||
@@ -1393,6 +1373,78 @@ static int oot_gd_set(Ctx *c, uint64_t mgr, uint32_t hash, uint32_t value, int i
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The first adult night's time lock. f_8347c020, which the clock's update f_803edf70 asks twice a frame, holds the clock
|
||||
(zeroes its step and puts it back at the hour, before a time request is taken: the Sun's Song's 06:00 lasts one frame) while
|
||||
quest Meet_DekuTree (0x4dbca27f) is past its step Ready, the game's first quest, so from the opening on, and either the Bool
|
||||
HyruleField_ArriveEntrance (0x804aec99) is 0, at 06:00 (the child's morning until Goto_HyruleCastle sets it), or
|
||||
HrlField_HasEnteredFirstTime_Adult (0x8592aa82) is 1, at 20:00 (f_8347c450's hours at 0x83ca34e8). ((Triforce, 11-30)
|
||||
0x8592aa82 is HrlField_HasEnteredFirstTime_Adult by its MurmurHash3; this said HrlField_isFirstNightTime_Adult, which is
|
||||
0xf1024b60 and no hold reads.) Two event flows in the whole romfs name it: the first time Link becomes an adult Sheik's
|
||||
cutscene sets it (Dm_TimeTemple_0055, its Event252), and the adult Market's gate into Hyrule Field, whose arrival is
|
||||
Dm_SY_BancChangeArrive's entry Dm_SY_BancChangeArrive_HyruleField_02 (Banc/Market/Market_Adult_Static), clears it as its
|
||||
first event (Event257, Event434). So the night is the adult Temple of Time's and Market's until Link first walks out of
|
||||
the gate, and that is left to the game. What the game never clears is repaired here, once no event plays, through the
|
||||
game's own Bool setter (oot_gd_set: the live value and the save's copy; the live byte alone, as this wrote it before,
|
||||
came back as 1 at the next load, and the gate's clear saw 0 and skipped):
|
||||
- a child holding it (became an adult and went back before the gate: no child's way out clears it, #1064), anywhere;
|
||||
- an adult holding it in Hyrule Field's map (HyruleField_Adult, with Lon Lon Ranch and Lake Hylia): out without the
|
||||
gate's arrival, or a save the earlier live-only clear left with 1 saved, which is held at 20:00 for good there.
|
||||
An adult in any other map (the Market and Temple of Time: the first night itself) keeps it. HOS_OOT_FIRST_NIGHT_FIX=0
|
||||
turns the repair off for a run. Returns 1 when it cleared the flag. Asked by oot_inventory_refresh, twice a second while
|
||||
a save is loaded. */
|
||||
static int oot_first_night_fix(Ctx *c, const char *map) {
|
||||
static int on = -1;
|
||||
if (on < 0) {
|
||||
const char *e = getenv("HOS_OOT_FIRST_NIGHT_FIX");
|
||||
on = !(e && *e && atoi(e) == 0);
|
||||
}
|
||||
if (!on || !map[0]) return 0;
|
||||
const uint64_t events = oot_singleton(c, OOT_EVENTMGR_SLOT);
|
||||
if (events && recomp_load64(c, events + 104)) return 0; /* (the Main sequence's "Event" test: an event is playing) */
|
||||
int set = 0, child = 0;
|
||||
if (!oot_gamedata_bool(c, 0x8592aa82u, &set) || !set) return 0;
|
||||
if (!oot_gamedata_bool(c, 0xcea220d3u, &child)) return 0; /* (Sequence_IsChildhood) */
|
||||
const int field = !strncmp(map, "HyruleField", 11);
|
||||
if (!child && !field) return 0; /* (the adult Market and Temple of Time: the game's first night, its gate clears it) */
|
||||
if (!oot_gd_set(c, oot_singleton(c, OOT_GAMEDATA_SLOT), 0x8592aa82u, 0, 1)) return 0;
|
||||
hos_log("oot: cleared the first adult night's time lock (HrlField_HasEnteredFirstTime_Adult) for %s in %s, where "
|
||||
"the game's own clear at the Market's gate cannot come", child ? "a child" : "an adult", map);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ((Triforce, 11-30) #1576602300313506086) The adult's maps. Both of them ask the same thing of an adult: the pause menu's
|
||||
Map page (f_80b47d70, from UIMapMenuScreen f_834012c0; "Unavailable right now.", MapMessage_01, when it answers no) and
|
||||
the HUD's minimap (f_805a2cf0) say yes for the child (the player's PlayerGameParam IsChild, kept at +0x5c0 of the player's
|
||||
info) and, for the adult, only once HavePlayedEvent.Dm_TimeTemple_0065 (Bool 0xc1b29b0a, saved; struct HavePlayedEvent
|
||||
0x2b05cbb9, member 0xc367dcdc) is 1. Dm_TimeTemple_0065 is the adult's first step out of the Temple of Time into the
|
||||
ruined Market (Navi, the Market's name): Market_Adult_Static places a 2 x 2.5 x 3 m Area at the temple's door, there while
|
||||
the flag is 0, and Market_Adult_Prefab_50e3's logic asks for the event when Link is in it (and challenge AllSage is at its
|
||||
step Step01). Nothing else in the romfs plays it or sets the flag. An adult who leaves the temple any other way (a teleport
|
||||
or the age switch of the Debug tab, the no-clip flight) never has it: no map page and no minimap as an adult, in every
|
||||
area, for good, and a save made from then on keeps it. Repaired here once no event plays, through the game's own Bool
|
||||
setter (oot_gd_set: the live value and the save's copy), for an adult in any map but the Market (the Temple of Time is in
|
||||
it: the game's own first walk out, still to come), the Chamber of Sages (where the first adult wakes) and the dream world
|
||||
(Sequence_IsInDreamWorld hides the maps there by itself). HOS_OOT_ADULT_MAP_FIX=0 turns it off for a run. Returns 1 when
|
||||
it set the flag. Asked by oot_inventory_refresh, twice a second while a save is loaded. */
|
||||
static int oot_adult_map_fix(Ctx *c, const char *map) {
|
||||
static int on = -1;
|
||||
if (on < 0) {
|
||||
const char *e = getenv("HOS_OOT_ADULT_MAP_FIX");
|
||||
on = !(e && *e && atoi(e) == 0);
|
||||
}
|
||||
if (!on || !map[0]) return 0;
|
||||
if (!strncmp(map, "Market", 6) || !strncmp(map, "SageRoom", 8) || !strncmp(map, "DreamWorld", 10)) return 0;
|
||||
const uint64_t events = oot_singleton(c, OOT_EVENTMGR_SLOT);
|
||||
if (events && recomp_load64(c, events + 104)) return 0; /* (the Main sequence's "Event" test: an event is playing) */
|
||||
int child = 1, played = 1;
|
||||
if (!oot_gamedata_bool(c, 0xcea220d3u, &child) || child) return 0; /* (Sequence_IsChildhood) */
|
||||
if (!oot_gamedata_bool(c, 0xc1b29b0au, &played) || played) return 0; /* HavePlayedEvent.Dm_TimeTemple_0065 */
|
||||
if (!oot_gd_set(c, oot_singleton(c, OOT_GAMEDATA_SLOT), 0xc1b29b0au, 1, 1)) return 0;
|
||||
hos_log("oot: the adult's map and minimap: set HavePlayedEvent.Dm_TimeTemple_0065 in %s (the first walk out of the Temple "
|
||||
"of Time, which opens them, was never made)", map);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* A map-hiding area sets the saved flag MapIconDeactivateByAreaActor while Link is in it and shows the minimap again as he
|
||||
walks out. The teleport's map change takes him out without that: the flag stayed set, and no area had a minimap from then
|
||||
on, in that save and every one made from it. oot_teleport clears it once its request is taken; the map he arrives in sets it
|
||||
|
||||
Reference in New Issue
Block a user