P2: decode mask-accumulator combine kernels from raw bytes — combine3(0x8d60)=sub, acc_add(0x5a20)=dst+=src, acc_fma(0x3c40)=dst+=a·b; implement + levelpath_check ALL OK

This commit is contained in:
2026-08-20 01:30:33 +03:00
parent d3db772121
commit 22e4599e0a
4 changed files with 57 additions and 2 deletions
+19 -2
View File
@@ -156,9 +156,26 @@ void band_lut_apply(void* ctx) {
}
}
// ---- mask-accumulator combine kernels (FUN_180529fe0, CRT thunks) ----
// Signatures recovered from raw bytes in the rt snap (objdump of 0x180008d60/5a20/3c40).
//
// 0x8d60 combine3: out[i] = a[i] - b[i] (vsubpd, 3 pointers; dst is the 3rd arg)
// In the per-band loop: 0x5406f8[i] = 0x540678[i] - 0x5407c8[i]
void combine_sub(double* out, const double* a, const double* b, int n) {
for (int i = 0; i < n; i++) out[i] = a[i] - b[i];
}
// 0x5a20: dst[i] += src[i] (double; kernel 0x18001a5a0)
void acc_add(double* dst, const double* src, int n) {
for (int i = 0; i < n; i++) dst[i] += src[i];
}
// 0x3c40: dst[i] += a[i] * b[i] (double; vfmadd213pd)
void acc_fma(double* dst, const double* a, const double* b, int n) {
for (int i = 0; i < n; i++) dst[i] += a[i] * b[i];
}
// FUN_180529fe0: coefficient setup (from decomp_funs.txt)
// Generates per-band coefficients via PRNG, applies depth scaling
// This is the vtable method for Soothe2Module
void coefficient_setup(void* ctx, int band_idx, int param3, int param4) {
auto* base = static_cast<uint8_t*>(ctx);