Qualify dScMgAmida_c::Virtual88's six calls into its base - #2118
Conversation
The last hand-written mangled name in the minigame family was not a
definition but a declaration, in the one file that calls up into its own
base:
extern "C" {
extern void _ZN11dScMgBase_c9Virtual88Eiiii(Ctx* ctx, int cx, int cy,
int colour, int size);
}
...
_ZN11dScMgBase_c9Virtual88Eiiii(ctx, y, x, arg3, 4);
Six call sites, all in dScMgAmida_c::Virtual88. They become
dScMgBase_c::Virtual88(y, x, arg3, 4);
A qualified call suppresses virtual dispatch, so this is still the direct
`bl` the ROM has, not a vtable load -- and the implicit `this` needs no
adjustment because dScMgBase_c sits at offset 0 in dScMgAmida_c, which is
what makes passing `ctx` and passing `this` the same pointer. Both of those
are claims the bytes have to settle, not the type system:
build_pin.verify(_ZN12dScMgAmida_c9Virtual88Eiiii, 0x020d14c0, 0x498, ov006)
-> (True, '2004/b56')
The local `Ctx` typedef stays. It is still what the body reads its fields
through, and replacing it with named inherited members is a separate change
that needs its own byte proof.
VERIFIED: python tools/rombuild.py -j 16 --no-rom
11,088 / 11,088 reproducing, 0 mismatching
106/106 modules exact, 100.000000% of compared bytes
Nine static gates green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QhhAeJwXBnfPp7B5DNjCwh
✅ PR validation — PassedCommitted merge introduces no reconstruction or attribution regression. Full merge validation
Byte-verified means the range carries Per-file link-check detailAll 1 changed file(s) compile to the ROM byte-for-byte with correct relocation targets.
The private worker commits a test merge, builds the stock ROM profile, compares every executable module, measures matched and source-built code, checks contributor lineage, and verifies affected relocations. The mod profile is opt-in and is not part of this merge gate. |
After #2116 the minigame family has no free-function definitions left. The last hand-written mangled name in it was a declaration, in the one file that calls up into its own base:
Six call sites, all inside
dScMgAmida_c::Virtual88. They become:Two things have to be true for that to be the same code, and neither is settled by the type system:
bl.thismust need no adjustment — the old spelling passedctxexplicitly, which is(Ctx *)thisunadjusted. That is only the same pointer ifdScMgBase_csits at offset 0 indScMgAmida_c.The bytes settle both:
The local
Ctxtypedef stays — it is still how the body reads its fields, and replacing it with named inherited members is a separate change that needs its own byte proof.Verified:
rombuild.py -j 16 --no-rom→ 11,088/11,088, 0 mismatching, 106/106 exact, 100.000000%. Nine static gates green.Stacked on #2116.
attribution-override.