Files
BFM-decomp/cookbook/C0396.md
T

923 B

§355 — A REMAPPED SIBLING'S SOURCE BIAS IS NOT ITS EMITTED BIAS — DO NOT HAND-SHIFT OFFSETS TO MATCH THE ASM (P31 S68; byte-proven ov_SC07_007/func_8013DD68, 187/187 in 2 iterations)

Remapping a banked exemplar onto a sibling, the exemplar's C writes p + 0x18 / puVar16 + 8 while the TARGET emits $s0 + 0x16 / $s1 + 0xE. Both are correct. gcc-2.7.2 re-anchors reduced givs, so the emitted displacement need not equal the source displacement.

The trap: seeing the mismatch and "fixing" the source offsets to match the disassembly. That breaks a remap that was already right. When a remapped body differs only in displacement, suspect the anchor, not the arithmetic.

Also from this function: guard a draft's local typedefs with #ifndef BFM_ENGINE_TYPES_H to make it dual-safe — emitted in match_one's standalone probe, skipped in the real TU where engine_core.h already provides them.