MoveBG: decompile MapObjRailBlock routines - #137
Conversation
Report for GMSJ01 (411f124 - a17dacb)📈 Matched code: 35.82% (+0.00%, +72 bytes) ✅ 2 new matches
📈 2 improvements in unmatched items
|
| unk15C.x = railNode->mPitch; | ||
| unk15C.y = railNode->mYaw; | ||
| unk15C.z = railNode->mRoll; | ||
| unk150 = (unk15C.x |
There was a problem hiding this comment.
This is MsAngleDiff, use that
There was a problem hiding this comment.
Fixed in 8b8607d: the three rotation deltas now use MsAngleDiff.
| while (angleX >= 360.0f) | ||
| angleX -= 360.0f; | ||
| while (angleX < 0.0f) | ||
| angleX += 360.0f; |
There was a problem hiding this comment.
Fixed in 8b8607d: the rotation normalization now uses MsWrap directly.
|
|
||
| s16 angle = unk138 * (65536.0f / 360.0f); | ||
| f32 sinV = jmaSinTable[(u16)angle >> jmaSinShift]; | ||
| f32 cosV = jmaCosTable[(u16)angle >> jmaSinShift]; |
There was a problem hiding this comment.
Fixed in 8b8607d: the raw table accesses are now JMASin/JMACos.
| { | ||
| self->TRailMapObj::load(stream); | ||
| } | ||
| #pragma dont_inline off |
There was a problem hiding this comment.
Pragma hacks should not be used
There was a problem hiding this comment.
Fixed in 8b8607d: the added pragma and helper shim were removed.
| col->setAllBGType(7); | ||
| col->setAllActor(this); | ||
| col->setAllData(unk154); | ||
| } |
There was a problem hiding this comment.
Manually inlining parent method is definitely not what the original code contained
There was a problem hiding this comment.
Fixed in 8b8607d: restored the TNormalLift::load call and removed the manually reproduced parent body; TWoodBlock::load is no longer changed by this PR.
d88fc1f to
a17dacb
Compare
Summary
TRailBlock::controlusing the project angle helpers.TRollBlock::calcRootMatrixusingJMASin/JMACos.TRailNode::mSpeedto the unsigned field type used by the target layout.Matching
TRailBlock::control: 88.4%TRollBlock::calcRootMatrix: 90.7%MsWrap<float>(float, float, float): 100.0%Verification
tools/decomp-diff.py -u mario/MoveBG/MapObjRailBlock.clang-format21 andgit diff --checklocally.