Skip to content

Implement missing methods for GameAudio::Parameters - #75

Open
joakim-d wants to merge 1 commit into
doldecomp:mainfrom
joakim-d:end_gameaudioparam_reversing
Open

Implement missing methods for GameAudio::Parameters#75
joakim-d wants to merge 1 commit into
doldecomp:mainfrom
joakim-d:end_gameaudioparam_reversing

Conversation

@joakim-d

Copy link
Copy Markdown
Contributor
  • Implement GameAudio::Parameters::setPlayerMode
  • Implement GameAudio::Parameters::setRaceMode
  • Set "Matching" for GameAudioParam.cpp

@decomp-dev

decomp-dev Bot commented Aug 14, 2026

Copy link
Copy Markdown

Report for MarioClub_us (55b9b9f - 10043e6)

📈 Matched code: 46.66% (+0.05%, +1688 bytes)
📈 Linked code: 41.33% (+0.09%, +2984 bytes)
📈 Matched data: 24.47% (+0.04%, +348 bytes)
📈 Linked data: 31.86% (+0.05%, +476 bytes)

✅ 7 new matches
Unit Item Bytes Before After
main/Inagaki/GameAudioParam GameAudio::Parameters::setPlayerMode(unsigned char) +554 19.07% 100.00%
main/Inagaki/GameAudioParam GameAudio::Parameters::setRaceMode(unsigned char) +508 0.78% 100.00%
main/Inagaki/GameAudioParam __sinit_GameAudioParam_cpp +492 0.00% 100.00%
main/Inagaki/GameAudioParam .bss +96 0.00% 100.00%
main/Inagaki/GameAudioParam .sdata2 +50 44.25% 100.00%
main/Inagaki/GameAudioParam .rodata +13 91.89% 100.00%
main/Inagaki/GameAudioParam .ctors +4 0.00% 100.00%

Comment on lines +120 to +121
f32 _04; // 04 (referenceDistance)
f32 _08; // 08 (nearDistance)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FYI I did not rename those variables because another CPP file was being impacted and a LOT (+50) of unused symbols were preventing the build to pass.
I thought it was out of scope so I left it like so

Comment thread src/Inagaki/GameAudioParam.cpp Outdated
Comment on lines +147 to +174
const f32& minVolume = audience[0].setting_.minVolume;
const f32& refDistance = audience[0].setting_._04;
const f32& nearDistance = audience[0].setting_._08;

f32 fullVolume = 1.0f;
f32 volume2x = 2.0f;
f32 volume3x = 3.0f;
f32 volume4x = 4.0f;
f32 volumeHalf = 0.5f;
f32 volumeQuarter = 0.25f;
f32 volumeSixth = 0.16666667f;
f32 volumeEighth = 0.125f;

audience[0].mVolumeSlope2x = (minVolume - fullVolume) / (( refDistance * volume2x) - nearDistance);
audience[0].mVolumeSlope3x = (minVolume - fullVolume) / (( refDistance * volume3x) - nearDistance);
audience[0].mVolumeSlope4x = (minVolume - fullVolume) / (( refDistance * volume4x) - nearDistance);
audience[0].mVolumeSlopeHalf = (minVolume - fullVolume) / (( refDistance * volumeHalf) - nearDistance);
audience[0].mVolumeSlopeQuarter = (minVolume - fullVolume) / (( refDistance * volumeQuarter) - nearDistance);
audience[0].mVolumeSlopeSixth = (minVolume - fullVolume) / (( refDistance * volumeSixth) - nearDistance);
audience[0].mVolumeSlopeEighth = (minVolume - fullVolume) / (( refDistance * volumeEighth) - nearDistance);

audience[0].mDistanceThreshold2x = volume2x * refDistance;
audience[0].mDistanceThreshold3x = volume3x * refDistance;
audience[0].mDistanceThreshold4x = volume4x * refDistance;
audience[0].mDistanceThresholdHalf = volumeHalf * refDistance;
audience[0].mDistanceThresholdQuarter = volumeQuarter * refDistance;
audience[0].mDistanceThresholdSixth = volumeSixth * refDistance;
audience[0].mDistanceThresholdEighth = volumeEighth * refDistance;

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.

This really looks like some inline to me, although i can't quite see how that'd look.
I believe the same code is in GameAudio::Main::init

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I moved the code into GameAudioAudience.cpp

@joakim-d
joakim-d force-pushed the end_gameaudioparam_reversing branch 2 times, most recently from d86e31a to 24c137c Compare August 16, 2026 17:54
@joakim-d
joakim-d force-pushed the end_gameaudioparam_reversing branch from 24c137c to 10043e6 Compare August 16, 2026 18:01
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.

2 participants