From c8a6b91c61df6331ba8140f73380dab9e780b536 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Sun, 15 Nov 2026 09:04:34 +0300 Subject: [PATCH] The empty hit list sites' comment names the functions, the stale slot and the registers the skipped path reads Co-Authored-By: Claude Opus 5.5 --- recomp/patches-v143.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recomp/patches-v143.txt b/recomp/patches-v143.txt index 1a2ac31a..0b05ab02 100644 --- a/recomp/patches-v143.txt +++ b/recomp/patches-v143.txt @@ -49,10 +49,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. +# Attack hit processing (main+0x2906a24) builds a list of this frame's hit records on its stack (count at [sp], slots +# at [sp+8] -> an inline array that is never cleared). The record insert (main+0x86e1d8) returns null when the +# attacker's record map (+0x190) is full, so a full map leaves the list empty. After its two loops the function +# passes slot 0 to the hit handler (main+0x870158, which dereferences it) unconditionally at main+0x2906de0 and only +# then checks count == 0 at main+0x2906df0; with an empty list slot 0 is stale stack data and the handler faults. +# Charged spear hits above 60 fps fill the map. Both count == 0 branches go to the check instead, which reloads the +# count and leaves through main+0x2906ce8; x19 and x20 are the only registers read there. 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)