mirror of
https://github.com/jkdansereau/goldeneye-pc-port.git
synced 2026-10-23 15:52:42 +02:00
tools_pc/d88_propdefs.py had a per-type handler table plus a generic fallback. Six `inherits ObjectRecord` propDef types (47 TINTED_GLASS, 39 VEHICHLE, 40 AIRCRAFT, 45 TANK, then 13 AUTOGUN, 20 AMMO/MultiAmmoCrate) had no handler and fell through to the generic arm, which bswap32's N64 word 1. For an ObjectRecord that word is [s16 obj][s16 pad] and needs a half-swap, not a word-swap - so the model id `obj` landed in the wrong 16 bits, giving a garbage/OOB index into PitemZ_entries[] and a crash in modelLoad (loadobjectmodel.c:393) / modelInitRwData (model.c:6249). BUNKER1/Silo were unaffected because neither emits any of the six types. Fix (converter + matching walk stride, no game logic): - d88_propdefs.py: OBJ_TAIL_DESC handler - real 144B PC ObjectRecord prefix + typed tail (pointers widened 4->8B/8-aligned, [u16|u16] words half-swapped). PROPDEF_PC_BYTES 39/40 176/180->208, 45 224->248. - loadobjectmodel.c sizepropdef() #ifdef PORT arm: VEHICHLE/AIRCRAFT 44/45->52, TANK 56->62 words (N64 values in the #else sizeof switch). Verified: -level_33/34/35 clear the model-load chain (they now crash further in, in unrelated chr/fast3d code - separate blockers); -level_09 BUNKER1 and -level_20 Silo unregressed. Sidecars regenerated (d88_emit.py --regen, 21/21). Full write-up: PCPortResearch.md D122 (uncommitted, rides with the in-progress docs restructure).