mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-20 12:45:57 +00:00
Send an empty charged-attack hit list to the game's own count == 0 check
The weapon's hit-record pool holds 10 records, and one charged swing above 60 fps fills it: the insert fails, and the list of hits made this frame stays empty. main+0x2906de0 then reads the empty list's slot, which holds a stale stack value, and passes it to the hit handler before the game's own count == 0 check would return; the stale value here pointed at the temp hit map and the read at main+0x870158 faulted reading 0x100000000a. Both count == 0 branches now go to main+0x2906df0, the game's check, under the realtime set. A non-empty list is unchanged, and below 60 fps the pool never fills. Verified on 1.4.3: a charged spear attack on an enemy at 120 and 144 fps no longer faults, and the damage at 60 and 120 fps matches the build without this patch.
This commit is contained in:
1 parent
97d12240f4
commit
f3efc5806c
1 file changed
+7
@@ -42,6 +42,13 @@ site realtime main 2daa78 1e210800 d503201f # fmul s0, s0, s1 -> nop
|
||||
# keeps equipment locked until a load. Stepping while above 0 takes the remainder below 0 like any other last step.
|
||||
site realtime main 2b036c 0f016681 0f000401 # movi v1.2s, #0x34, lsl #24 (FLT_EPSILON) -> movi v1.2s, #0
|
||||
|
||||
# Charged-attack hit records above 60 fps: the weapon's hit pool holds 10 records and one charged swing at a high
|
||||
# frame rate fills it; the insert then fails and the list of hits made this frame stays empty. The game reads the
|
||||
# empty list's slot (main+0x2906de0) and dereferences it before its own count == 0 check, which faults. Send both
|
||||
# count == 0 branches to that check (main+0x2906df0) instead; a non-empty list is unchanged.
|
||||
site realtime main 2906d98 34000248 340002c8 # cbz w8, 0x2906de0 -> 0x2906df0 (first loop's empty check)
|
||||
site realtime main 2906dc0 34000108 34000188 # cbz w8, 0x2906de0 -> 0x2906df0 (second loop's empty check)
|
||||
|
||||
# Hair and cloth: the actor animation update builds a second clock {seconds = factor / 30, ratio = factor} per
|
||||
# rendered frame. 1.4.3 inlines it in two actor paths, where the factor was just stored to the ratio slot: the
|
||||
# replacement stores measured ratio * factor there and computes measured seconds * factor. Two other callers share the
|
||||
|
||||
Reference in new issue
Block a user