Skip to content

mkw: Match KartState wipe, reset, and collision functions - #10

Open
EricOhebshalom wants to merge 4 commits into
doldecomp:mainfrom
EricOhebshalom:kart-state
Open

EricOhebshalom wants to merge 4 commits into
doldecomp:mainfrom
EricOhebshalom:kart-state

Conversation

@EricOhebshalom

Copy link
Copy Markdown
Contributor
  • Decompile KartState::init (100.0% match)
  • Decompile KartState::reset (99.4% match)
  • Decompile KartState::resetOob (100.0% match)
  • Decompile KartState::updateWipe (100.0% match)
  • Decompile KartState::startWipe (100.0% match)
  • Decompile KartState::resetCollisionFlags (100.0% match)
  • Update symbol names in config/RMCP01/module/symbols.txt

- Decompile KartState::init (100.0% match)
- Decompile KartState::reset (99.4% match)
- Decompile KartState::resetOob (100.0% match)
- Decompile KartState::updateWipe (100.0% match)
- Decompile KartState::startWipe (100.0% match)
- Decompile KartState::resetCollisionFlags (100.0% match)
- Update symbol names in config/RMCP01/module/symbols.txt
@decomp-dev

decomp-dev Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Report for RMCP01 (386051f - 409adf2)

📈 Matched code: 5.79% (+0.02%, +1144 bytes)

✅ 8 new matches
Unit Item Bytes Before After
StaticR/kart/KartState Kart::KartState::applyStartBoost(int) +356 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::computeStartBoost() +292 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::updateWipe() +176 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::reset() +160 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::resetCollisionFlags() +72 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::init() +56 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::resetOob() +16 0.00% 100.00%
StaticR/kart/KartState Kart::KartState::startWipe(int) +16 0.00% 100.00%
📈 2 improvements in unmatched items
Unit Item Bytes Before After
StaticR/kart/KartState Kart::KartState::updateStartBoostCharge() +185 0.00% 98.72%
StaticR/kart/KartState .rodata +19 18.18% 66.67%

Comment thread src/kart/KartState.hpp Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change _84 to a u16 (or maybe a s16, whichever one makes more sense). That will avoid the casting in reset().

Comment thread src/kart/KartState.cpp Outdated
m_70 = 0;
mBoostRampType = -1;
mJumpPadType = -1;
*(u16*)_84 = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in the header

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To generalize, it's safe to assume that any code containing this is wrong: *(T *)

- Use u16 for _84 to eliminate cast in reset()
- Add missing KartFlags enum values (accelerate, brake, drift input, etc.)
- Use KART_FLAG_MASK in resetCollisionFlags() instead of hardcoded hex values
- Decompile KartState::updateStartBoostCharge
- Decompile KartState::computeStartBoost
- Decompile KartState::applyStartBoost
- Expose KartMove::mStartBoostCharge and setStartBoostCharge
- Update symbol names in config/RMCP01/module/symbols.txt
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.

3 participants