Correct float rounding and vector calculations - #213
Merged
Merged
Conversation
Report for GMSJ01 (eadd711 - 6f92035)📈 Matched data: 77.09% (+0.02%, +112 bytes) ✅ 1 new match
📈 16 improvements in unmatched items
Report for GMSP01 (eadd711 - 6f92035)📈 Matched data: 67.99% (+0.02%, +112 bytes) ✅ 1 new match
📈 15 improvements in unmatched items
|
Mrkol
requested changes
Sep 30, 2026
…ortAngle CLBIsPointInCube and CLBCalcPointInCubeRatio spelled out CLBRoundf<s16>(DEG2SHORTANGLE(x)) six times, which is the existing CLBDegToShortAngle helper. CLBCalcPointInCubeRatio 98.37% -> 98.88%, CLBIsPointInCube 98.46% -> 98.94%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ding Retail multiplies the BCK frame by a 1/63 constant (fmuls), where we divided (fdivs). TNerveAmenboTurn::execute 98.86% -> 99.88%, and the constant @2942 in .rodata now matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moveObject set the head's damage height from mSLBodyScale (+0x130). Retail reads +0x20c, which is mSLHeadHitH, the same way the line above reads mSLHeadHitR for the radius. THinokuri2::moveObject 99.85% -> 99.87%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comparison was inverted: the object reappeared while Mario was inside its damage radius. Retail (fcmpo dist, sum; ble skip) calls appear() only when the distance is greater than the radius sum. TMapObjGeneral::waitingToAppear 98.99% -> 99.22%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retail stores the cross product, up vector, and tongue direction as matrix columns. calcAnim stored them as rows. TYoshiTongue::calcAnim: 96.62 -> 98.01.
Multiply velocity by the rotation-speed range before scaling by 1/32, as retail does. Bind the sea-smoke particle to mFootprintPos (+0x1a8), rather than unk1B4. TMario::doSwimming: 98.03 -> 99.92.
The Z wall movements initialized the X component of the translation. Use the Z component. Reuse the negated limit in the downward X and Z clamps, as retail does. bumpDownX: 97.40 -> 98.64; bumpDownZ: 94.87 -> 98.62; bumpUpZ: 96.06 -> 98.56.
Retail halves the sight angle after computing the bearing difference. Move the half-angle calculation into inSightAngle and pass the full angle from each caller. doAttackDouble also reads mSLDoubleAttackLen (+0x20c), rather than mSLUnisonAttackLen (+0x220). Six functions improve; no function regresses.
KakarottoCake
force-pushed
the
vecmath-cleanup
branch
from
October 2, 2026 23:31
0f0cc48 to
6f92035
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct parameter reads, vector components and float operation order against the retail disassembly.
Use CLBDegToShortAngle for cube rotations, put Tongue's matrix basis vectors in columns, and correct the Mare walls' Z translations.
Correct swimming turn-speed calculation and smoke position, Gesso's sight-angle calculation and double-attack range, Hinokuri's head-height parameter, and MapObjGeneral's appearance condition.
Manta's distance check keeps main's distance inline; bossManta.cpp is no longer changed by this PR.
Rebased on main at eadd711.
Compared with that revision: 16 functions improve, none regress, and matched data increases by 112 bytes.
The GMSJ01 full build, all eight symbol checks against built main objects, review-lint and whole-tree clang-format pass locally.
Both formatting repairs are already on main; this PR changes eight game source files and no middleware files.
Both GMSJ01 and GMSP01 CI builds, symbol checks and formatting pass at 6f92035.