Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ def MatchingFor(*versions):
Object(NonMatching, "Inagaki/GameAudioMain.cpp"),
Object(Matching, "Inagaki/GameAudioMgr.cpp"),
Object(Matching, "Inagaki/GameAudioParam.cpp"),
Object(NonMatching, "Inagaki/KartSoundMgr.cpp"),
Object(Matching, "Inagaki/KartSoundMgr.cpp"),
Object(Matching, "Inagaki/NpcCarSoundMgr.cpp"),
Object(Matching, "Inagaki/ObjectSoundMgr.cpp"),
Object(Matching, "Inagaki/RockSoundMgr.cpp"),
Expand Down
15 changes: 13 additions & 2 deletions include/Inagaki/GameAudioMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ class Main
}

CustomMgr *getCustomMgr() { return mMgr; }

u32 getFrameCount() const {
return _80;
}

f32 getBgmVolume() const {
return _9c;
}
// } FABRICATED

CameraMgr *getCamera() {
Expand Down Expand Up @@ -145,9 +153,12 @@ class Main
JAISoundHandle _68; //
JAISoundHandle _6c; //
JAISoundHandle _70; //
u8 _74[0xa8 - 0x74]; //
u8 _74[0x80 - 0x74]; //
u32 _80; // mFrameCount?
JAISoundHandle _84[4]; //
u8 _94[0xa8 - 0x94]; //
u8 _94[0x9c - 0x94]; //
f32 _9c; // mBgmVolume?
u8 _a0[0xa8 - 0xa0]; //

}; // Size: 0xa8

Expand Down
185 changes: 132 additions & 53 deletions include/Inagaki/GameSoundMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class SoundMgr : public JAUDopplerSoundObject, public JKRDisposer
virtual void init();
virtual void setSe(u32 id);

void setEcho(JAISoundHandle *handlePtr, f32 mix);
JAISoundHandle *startSoundCustom(u32 soundID, u32 p2);
void setEcho(JAISoundHandle *handlePtr, f32 mix);
virtual void loop();

static void setKillSwAll(bool killSw);
Expand Down Expand Up @@ -181,68 +181,143 @@ void SoundWithEchoMgr<T>::setInitialEcho(JAISoundHandle *handlePtr) {
}
}

extern const f32 EngineKeisuuRaceUp[9];

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.

When looking at the asm it's really of size 9 apparently:

# .rodata:0x0 | 0x8036C580 | size: 0x24
# GameAudio::EngineKeisuuRaceUp
.obj EngineKeisuuRaceUp__9GameAudio, global
	.4byte 0x3BC49BA6
	.4byte 0x3BC49BA6
	.4byte 0x3BA3D70A
	.4byte 0x3B449BA6
	.4byte 0x3C75C28F
	.4byte 0x3C75C28F
	.4byte 0x3C54FDF4
	.4byte 0x3C343958
	.4byte 0x3CA3D70A
.endobj EngineKeisuuRaceUp__9GameAudio

Where did you see the other usage?
Maybe it works because the two arrays are contiguous?

@MB60893 MB60893 Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@joakim-d apologies for the confusion; this is absolutely fine, and I got thrown due to an error with my git configuration which, and I kid you not; decided to combine a past commit with the current one, producing the mismatch.

Sorry for the confusion. I blame insufficient sleep on my part. 😴

EDIT: Aaand now I can't resolve this comment. Not my day, apparently.

extern const f32 EngineKeisuuRaceDown[9];

class KartSoundMgr : public SoundMgr<KartSoundMgr>
{
public:
KartSoundMgr(Vec *, JKRHeap *, u8, u8); // 0x80123118
~KartSoundMgr(); // 0x80123328
void startSoundHandleNumber(u8, u32, u32); // 0x801233fc
virtual void dispose(); // 0x801236d0
virtual void init(); // 0x80123708
void changeDriver(bool); // 0x80123ad4
void frameWork(u8 rank); // 0x80123ad8
void checkAfterGoalVolume(); // 0x80123c50
void setWaterDepth(u8, f32); // 0x80123ee4
void setSlip(u8, u8, u8, f32); // 0x80123ef4
void setConductStatus(f32, f32, bool, bool, bool, u8, CrsArea *); // 0x80124400
void setWaterCutoffPort(u16); // 0x8012485c
void countGoalKart(); // 0x80124930
void setConductLocomotiveAccel(); // 0x8012495c
void setConductLocomotiveSpeed(bool); // 0x80124d9c
void setConductPressed(); // 0x80125194
void setConductSignal(); // 0x80125490
void setConductOutOfCourse(u8); // 0x80125b04
void setConductTrouble(f32, u8); // 0x80125f60
void setConductRace(bool); // 0x801263cc
void setConductAfterGoal(bool); // 0x80127188
void setCrushSe(CrsGround::EMat, f32); // 0x801271a8
void setCrushSe(u32, f32); // 0x801272e4
void setBrakeSe(u32); // 0x80127474
void setDashSe(u32); // 0x8012763c
void setMiniturboSe(u32); // 0x801276e4
void setJumpUpSe(u32); // 0x80127770
void setBoundSe(f32); // 0x801277dc
void setWheelSpinSe(); // 0x8012798c
void setSpinSe(); // 0x80127aa4
void setSpinTurnSe(); // 0x80127bb4
virtual void setSe(u32); // 0x80127ccc
void setChibiPitch(JAISoundHandle *); // 0x80127ec8
void adjustEngine(); // 0x80127fb8
void crushRenzokuTaisaku(); // 0x80128140
void slipParamSet(); // 0x8012816c
void checkEcho(); // 0x801288f8
void setInvincibleBgm(u8); // 0x80128aac
void clearInvincibleBgm(u8); // 0x80128c30
void setChibiFlag(bool, bool); // 0x80128e98
KartSoundMgr(Vec *pos, JKRHeap *heap, u8 kartNo, u8 kartType); // 0x80123118
~KartSoundMgr(); // 0x80123328
virtual void startSoundHandleNumber(u8 handleIndex, u32 soundID, u32 fadeCount); // 0x801233fc
virtual void dispose(); // 0x801236d0
virtual void init(); // 0x80123708
void changeDriver(bool); // 0x80123ad4
void frameWork(u8 rank); // 0x80123ad8
void checkAfterGoalVolume(); // 0x80123c50
void setWaterDepth(u8 wheel, f32 depth); // 0x80123ee4
void setSlip(u8 wheel, u8 attribute, u8 material, f32 slipDegree); // 0x80123ef4
void setConductStatus(f32 rpm, f32 speed, bool accelBtn, bool brakeBtn,
bool isBrake, u8 conductStatus, CrsArea *roofArea); // 0x80124400
void setWaterCutoffPort(u16 port); // 0x8012485c
void countGoalKart(); // 0x80124930
void setConductLocomotiveAccel(); // 0x8012495c
void setConductLocomotiveSpeed(bool isBrake); // 0x80124d9c
void setConductPressed(); // 0x80125194
void setConductSignal(); // 0x80125490
void setConductOutOfCourse(u8 conductStatus); // 0x80125b04
void setConductTrouble(f32 rpm, u8 conductStatus); // 0x80125f60
void setConductRace(bool isBrake); // 0x801263cc
void setConductAfterGoal(bool isBrake); // 0x80127188
void setCrushSe(CrsGround::EMat mat, f32 degree); // 0x801271a8
void setCrushSe(u32 soundID, f32 degree); // 0x801272e4
void setBrakeSe(u32 soundID); // 0x80127474
void setDashSe(u32 soundID); // 0x8012763c
void setMiniturboSe(u32 soundID); // 0x801276e4
void setJumpUpSe(u32 soundID); // 0x80127770
void setBoundSe(f32 degree); // 0x801277dc
void setWheelSpinSe(); // 0x8012798c
void setSpinSe(); // 0x80127aa4
void setSpinTurnSe(); // 0x80127bb4
virtual void setSe(u32 soundID); // 0x80127ccc
void setChibiPitch(JAISoundHandle *handle); // 0x80127ec8
void adjustEngine(); // 0x80127fb8
void crushRenzokuTaisaku(); // 0x80128140
void slipParamSet(); // 0x8012816c
void checkEcho(); // 0x801288f8
void setInvincibleBgm(u8 bit); // 0x80128aac
void clearInvincibleBgm(u8 bit); // 0x80128c30
void setChibiFlag(bool chibi, bool playSe); // 0x80128e98

// UNUSED {
void startSoundEngine(u8, u32);
void changeAttribute(u8);
void checkCourseSound(u8);
void setHandleVolume(JAISoundHandle&, f32);
void setWaterDepth(f32);
void getEngineIDOffsetAtt();
// } UNUSED

static u8 smKartCount;
static u8 smEntryKartCount;
static u8 smGoalKartCount;

static u8 smKartRankClassMem[7];
static u8 smDummy[4];

u8 _5c[0x61 - 0x5c];
u8 _61;
u8 mKartCount; // 62
u8 _63;
u8 _64;
u8 _65;
u8 _66;
u8 _67[0x6c - 0x67];
f32 _6c;
u8 _70[0x8d - 0x70];
u8 _8d;
u8 _8e[0x134 - 0x8e];
private:
// FABRICATED {
bool isGoalVolumeEqual(f32 volume) const {
return mGoalVolume == volume;
}

bool isCameraVolumeEqual(f32 volume) const {
return mCameraVolume == volume;
}

void startSoundFromID(u32 id);
// } FABRICATED
public:
u8 mEchoFixed; // 5c
u8 mChibiFlag; // 5d
u8 mGoalFlag; // 5e
u8 mSignalRevUp; // 5f
u8 mInvincibleBgmBits; // 60
u8 mKartIndex; // 61
u8 mPlayerIndex; // 62
u8 mPrevConductStatus; // 63
u8 mRankClass; // 64
u8 mRank; // 65
u8 mKartType; // 66
u8 _67; // unused
f32 mPrevRpm; // 68
f32 mEchoMix; // 6c
f32 mPrevEchoMix; // 70
u32 mLastCrushFrame; // 74
u32 mAfterGoalCounter; // 78
u32 mSceneMask; // 7c
u32 mEngineFadeCount; // 80
f32 mSpeed; // 84
f32 mRpm; // 88
u8 mAccelFlag; // 8c
u8 mConductStatus; // 8d
u16 mAccelTimer; // 8e
u16 mDecelTimer; // 90
u16 mEngineLevel; // 92
u16 mOutOfCourseLevel; // 94
s16 mEngineRevCount; // 96
f32 mPrevSpeed; // 98
u8 mCrushWait; // 9c
u8 _9d[3]; // padding
f32 mCrushDegree; // a0
f32 mSlipPans[4]; // a4
f32 mSlipVolumes[4]; // b4
f32 mSlipPitches[4]; // c4
f32 mWaterDepths[4]; // d4
u8 mSlipFlags[4]; // e4
u8 mGroundAttrs[4]; // e8
f32 _ec; // initialized, unused
f32 mEngineAdjust; // f0
u32 mAdjustSoundID; // f4
u16 mAdjustCounter; // f8
u8 _fa[2]; // padding
f32 mKarabukashiCount; // fc
u8 mLowSpeedCount; // 100
u8 mSlipSeCount; // 101
u8 mSlipSeInterval; // 102
u8 mSlipSeAlternator; // 103
u8 mSlipSeIndex; // 104
u8 mGroundSeIndex; // 105
u8 _106[0x110 - 0x106];
f32 mSignalTargetPitch; // 110
f32 mSignalPitch; // 114
f32 mSignalPitchStep; // 118
u32 mSignalPitchCounter; // 11c
f32 mGoalVolume; // 120
f32 mCameraVolume; // 124
f32 mDeltaVolume; // 128
u32 mGoalVolumeCounter; // 12c
CrsArea* mCourseArea; // 130
};

class CharacterSoundMgr : public SoundMgr<CharacterSoundMgr> {
Expand Down Expand Up @@ -345,6 +420,10 @@ class ShoreSoundMgr : public SoundMgr<ShoreSoundMgr> {
private:
static CustomAudience<4> *smAudience; // 0x80416278

JGeometry::TVec3f& getPlayPos(s32 index) { // fabricated
return _64[index];
}

u8 _5c;
u8 _5d;
u8 _5e[0x60 - 0x5e]; // padding?
Expand Down
15 changes: 15 additions & 0 deletions include/JSystem/JAudio/Interface/JAISound.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,21 @@ struct JAISoundFader
mIntensity = 0.0f;
fadeIn(fadeCount);
}

// Same as fadeInFromOut but branching order is inversed
// Needed by KartSoundMgr...
void fadeInFromOut2(u32 fadeCount)
{
mIntensity = 0.f;
if (fadeCount != 0) {
mTransition.set(1.0f, mIntensity, fadeCount);
}
else
{
forceIn();
}
}

bool isOut() { return (mTransition.mCount == 0 && mIntensity < 0.01f); }
void calc() { mIntensity = mTransition.apply(mIntensity); }
f32 getIntensity() { return mIntensity; }
Expand Down
20 changes: 20 additions & 0 deletions include/JSystem/JAudio/JASFakeMatch14.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef JAUDIO_JASFAKEMATCH14_H
#define JAUDIO_JASFAKEMATCH14_H

#ifdef MATCHING

#include "JSystem/JAudio/JASFakeMatch.h"

class JAIStream;
class JAISeq;
class JAISe;

typedef JAUDopplerAudible<4> TDopplerAudible4;

JASMemPool<TDopplerAudible4> JASPoolAllocObject<TDopplerAudible4>::memPool_;
JASMemPool<JAISeq> JASPoolAllocObject<JAISeq>::memPool_;
JASMemPool<JAISe> JASPoolAllocObject<JAISe>::memPool_;

#endif

#endif
13 changes: 13 additions & 0 deletions include/Kaneshige/Course/CrsGround.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ class CrsGround
{
// TODO
Mat_1 = 1,
Mat_5 = 5,
Mat_6 = 6,
Mat_7 = 7,
Mat_8 = 8,
Mat_9 = 9,
Mat_10 = 10,
Mat_15 = 15,
Mat_16 = 16,
Mat_17 = 17,
Mat_18 = 18,
Mat_19 = 19,
Mat_25 = 25,
Mat_27 = 27,
Mat_255 = 0xff,
};

Expand Down
Loading
Loading