Skip to content

Match RPGrpModelScene::DrawPrepare and RPBowManagerContext::UpdateNpcs - #176

Open
fh1599 wants to merge 2 commits into
doldecomp:masterfrom
fh1599:merlin-challenge
Open

fh1599 wants to merge 2 commits into
doldecomp:masterfrom
fh1599:merlin-challenge

Conversation

@fh1599

@fh1599 fh1599 commented Oct 7, 2026

Copy link
Copy Markdown

Summary

This PR contains two matching decompilation improvements for RSPE01_01.

  • Matches RPGrpModelScene::DrawPrepare(...).
  • Adds the RPGrpModelScene members required by the matched implementation.
  • Adjusts RPUtlRandom::getF32() so Bowling::RPBowManagerContext::UpdateNpcs() reaches a full project-report match without changing the helper's behavior.

The existing UpdateNpcs() implementation is prior work by Alex9303 from #149. My contribution there is limited to resolving the remaining code-generation mismatch through the shared random helper.

Verification

Built and verified with RSPE01_01.

  • Full build completes successfully.
  • build/RSPE01_01/main.dol: OK.
  • RPGrpModelScene::DrawPrepare(...): project report 100%; 80/80 .text bytes identical.
  • Bowling::RPBowManagerContext::UpdateNpcs(): project report 100%; 440/440 .text bytes and 110/110 instructions identical.
  • The shared getF32() change was checked against the full project progress report and produced no regressions in previously matched functions.
  • The final progress report is identical to the verified Tier 2 final snapshot.

A stricter relocation-aware objdiff comparison may display approximately 99.91% for UpdateNpcs() because of two data-relocation label differences. The generated .text is byte-identical, and the project's normal progress-report configuration reports the function at 100%.

AI disclosure

I used OpenAI Codex through Merlin Software's provided environment to assist with code inspection, hypothesis generation, and controlled matching experiments.

I reviewed the source changes and independently verified the results using the project's build, progress-report, and binary-comparison tooling. AI-assisted work was limited to Pack game code; no SDK code was modified.

@decomp-dev

decomp-dev Bot commented Oct 7, 2026

Copy link
Copy Markdown

Report for RSPE01_01 (27fa94a - 358f1d5)

📈 Matched code: 35.04% (+0.01%, +520 bytes)

✅ 2 new matches
Unit Item Bytes Before After
main/Pack/RPGraphics/RPGrpModelScene RPGrpModelScene::DrawPrepare(const RPGrpCamera*, const RPGrpScreen*) +80 0.00% 100.00%
main/Pack/RPSports/RPBowScene/RPBowManagerContext Bowling::RPBowManagerContext::UpdateNpcs() +1 99.77% 100.00%
📈 2 improvements in unmatched items
Unit Item Bytes Before After
main/Pack/RPSports/RPBowScene/RPBowBackgroundNpcManager Bowling::RPBowBackgroundNpcManager::UpdateMovement(nw4r::math::VEC3*, bool*) +20 96.55% 97.81%
main/Pack/RPKernel/RPSysKokeshi RPSysKokeshi::LoadResource(const RPSysKokeshiOverloadInfo*) +1 99.42% 99.55%

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