Skip to content

model: 92.19% -> 92.29% (ObjModel_LoadModelData + modelLoadAnimations exact) - #40

Open
SirEnkido wants to merge 2 commits into
zcanann:mainfrom
SirEnkido:agent/model
Open

model: 92.19% -> 92.29% (ObjModel_LoadModelData + modelLoadAnimations exact)#40
SirEnkido wants to merge 2 commits into
zcanann:mainfrom
SirEnkido:agent/model

Conversation

@SirEnkido

Copy link
Copy Markdown

What changed

Two small plain-C changes in src/main/model.c (plus a prototype update in include/main/model.h):

  • ObjModel_LoadModelData — retail calls DCInvalidateRange(model, allocSize) on the freshly mmAlloc'd, 16-aligned model buffer before loadAndDecompressDataFile decompresses into it (the standard GC pattern before a DMA/decompress into a new buffer). The size is a named local allocSize = dataLen + amapSize + 0x1f4 reused for both calls. 93.48% → 100%
  • modelLoadAnimations — the animation write cursor is the u8* parameter advanced in place (buf += sz), while the model id lives in a local int id = modelId later reused for the amap data size — matching the surrounding style (hdr = model local copy). Only a register-order difference. 99.66% → 100%

Evidence

  • main/main/model fuzzy (report.json, GSAE01_rev1): 92.19% → 92.29%, matched functions 73 → 75 of 85
  • ninja all_source progress build/GSAE01_rev1/report.json exits 0
  • Independently re-audited against AGENTS.md: no pragmas, no asm, no hardcoded addresses, no debris; only the two intended files touched

Notes for review

  • Verified locally on the Rev 1 build (v1.01 is the dump I own); the changes are version-agnostic plain C and I'd expect the same result on v1.00 — CI will confirm.
  • The unit's remaining gap is essentially walled: 7 functions are hand-written asm in retail (modelApplyBoneTransform/modelBoneTransforms_next custom register convention, setGQR6/7 mtspr, the three paired-single ObjModel_Transform*Vertices* loops) — asm is banned outside src/dolphin/, so left as-is. modelInitBoneMtxs/ObjModel_Blend*Stream are pure nonvolatile register-order residue after ~10 clean-C shape experiments each.
  • clang-format --dry-run fails on model.c, but every violation is pre-existing on main (whole-TU brace style); this diff introduces none, and reformatting the whole TU is out of scope here.

Produced by Claude agents following AGENTS.md, operated by @SirEnkido.

🤖 Generated with Claude Code

SirEnkido and others added 2 commits August 15, 2026 18:25
…nge on the fresh model buffer, allocSize local)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cursor is the u8* param, model id kept in a local reused for the amap data size)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant