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:
@@ -1734,6 +1734,36 @@ def patch_autosave(s):
|
||||
return s, 1
|
||||
|
||||
|
||||
# ((Triforce) Unlimited amiibo uses (host/oot_amiibo_uses.c; the System tab's NFC group), the supported build's function:
|
||||
# f_8328cd30 answers whether the figure the game has just read was used today (x0 the figure's ids and serial number's hash;
|
||||
# its answer in x0, bit 0 "used today"), by the save's amiibo history and today's date. At its head the host is asked first:
|
||||
# with the row On it answers 1, x0 is 0 ("not used today") and the function returns; with it Off it answers 0 and the
|
||||
# function runs as it is. The function is taken as this one only when its body makes the two calls read here: today's date
|
||||
# (f_83290a50) and the history's test of one of its figures (f_8328ee40)
|
||||
AMIIBO_DAY_HEAD = "void f_8328cd30(Ctx *__restrict A64_NOESC c) {\n"
|
||||
AMIIBO_DAY_HOOK = " if (hos_oot_amiibo_used_today(c)) return; /* (nx2/oot_patches.py: the Unlimited amiibo uses row) */\n"
|
||||
AMIIBO_DAY_DECL = "extern int hos_oot_amiibo_used_today(Ctx *c);\n"
|
||||
AMIIBO_DAY_CALLS = (" f_83290a50(c);\n", " f_8328ee40(c);\n")
|
||||
|
||||
|
||||
def patch_amiibo_uses(s):
|
||||
"""The Unlimited amiibo uses row's call: (s, 1) when f_8328cd30 is in s, the function read here, with the call at its head
|
||||
(made now or before), else (s, 0)"""
|
||||
if s.count(AMIIBO_DAY_HEAD) != 1:
|
||||
return s, 0
|
||||
start, end = _function(s, AMIIBO_DAY_HEAD)
|
||||
if not all(call in s[start:end] for call in AMIIBO_DAY_CALLS): # (another build's function at that address)
|
||||
return s, 0
|
||||
if AMIIBO_DAY_HEAD + AMIIBO_DAY_HOOK in s:
|
||||
return s, 1
|
||||
if AMIIBO_DAY_HOOK in s:
|
||||
return s, 0
|
||||
s = s.replace(AMIIBO_DAY_HEAD, AMIIBO_DAY_HEAD + AMIIBO_DAY_HOOK, 1)
|
||||
if AMIIBO_DAY_DECL not in s:
|
||||
s = s.replace('#include "a64.h"\n', '#include "a64.h"\n' + AMIIBO_DAY_DECL, 1)
|
||||
return s, 1
|
||||
|
||||
|
||||
# Movement speed (the Debug tab's tool, host/hos_main.c hos_oot_cct_speed): a character controller's forward speed (s0), on its
|
||||
# way to *(controller+40)+472, which the physics step moves the body by with its collisions. The host scales it for Link's
|
||||
# controller while the tool is above 1x. Four places set it: f_809552f0, the move Link's own walk, run and swim go through (a
|
||||
@@ -2115,6 +2145,7 @@ def apply(gen, *, protect_hearts=False, required=False):
|
||||
damage_sites = 0 # ((Triforce) patch_damage: the Damage taken row's one call)
|
||||
opening_sites = 0 # ((Triforce) patch_opening: the Skip opening row's three calls)
|
||||
autosave_sites = 0 # ((Triforce) patch_autosave: the Autosave row's one call)
|
||||
amiibo_sites = 0 # ((Triforce) patch_amiibo_uses: the Unlimited amiibo uses row's one call)
|
||||
speed_sites = 0 # ((Triforce) patch_cct_speed: the Movement speed tool's four calls)
|
||||
barrier_sites = 0 # ((Triforce) 11-24: patch_barrier_wait: the three job functions, the supported build's alone)
|
||||
for path in sorted(glob.glob(os.path.join(glob.escape(gen), "code_*.c"))):
|
||||
@@ -2384,6 +2415,11 @@ def apply(gen, *, protect_hearts=False, required=False):
|
||||
if autosaved != out:
|
||||
print("oot_patches: the Autosave row's call in", os.path.basename(path))
|
||||
out = autosaved
|
||||
unlimited, found = patch_amiibo_uses(out)
|
||||
amiibo_sites += found
|
||||
if unlimited != out:
|
||||
print("oot_patches: the Unlimited amiibo uses row's call in", os.path.basename(path))
|
||||
out = unlimited
|
||||
sped, found = patch_cct_speed(out)
|
||||
speed_sites += found
|
||||
if sped != out:
|
||||
@@ -2460,6 +2496,8 @@ def apply(gen, *, protect_hearts=False, required=False):
|
||||
print("oot_patches: WARNING: the Skip opening row's functions were found at %d of %d places" % (opening_sites, len(OPENING_SITES)))
|
||||
if protect_hearts and autosave_sites != 1: # (without it the Autosave row does nothing: host/oot_autosave.c)
|
||||
print("oot_patches: WARNING: the save request for the Autosave row was found at %d of 1 place" % autosave_sites)
|
||||
if protect_hearts and amiibo_sites != 1: # (without it the Unlimited amiibo uses row does nothing: host/oot_amiibo_uses.c)
|
||||
print("oot_patches: WARNING: the amiibo's once-a-day check for the Unlimited amiibo uses row was found at %d of 1 place" % amiibo_sites)
|
||||
if protect_hearts and speed_sites != len(SPEED_PLACES): # (without them the Debug tab's Movement speed does nothing, or part)
|
||||
print("oot_patches: WARNING: the Movement speed tool's places were found %d times, not %d" % (speed_sites, len(SPEED_PLACES)))
|
||||
if protect_hearts and tex_ask_sites != 1: # (without it the compaction may be asked for every frame: host/oot_tex_compact.c)
|
||||
|
||||
Reference in New Issue
Block a user