diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 9bb5b2ac6..35c633896 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -3,7 +3,14 @@ #include "JAZelAudio/JAIZelBasic.h" -class JAIZelInst; +class JAIZelInst { +public: + f32 getMelodyPattern(s32, s32, s32*); + +public: + /* 0x00 */ u8 pad[0x1F]; + /* 0x1F */ u8 mMelodyNum; +}; class mDoAud_zelAudio_c : public JAIZelBasic { public: @@ -114,4 +121,8 @@ inline void mDoAud_rainPlay(s32 param_0) { mDoAud_zelAudio_c::getInterface()->rainPlay(param_0); } +inline f32 mDoAud_tact_getMelodyPattern(s32 melody_no, s32 note_no, s32 * pattern) { + return mDoAud_zelAudio_c::mTact.getMelodyPattern(melody_no, note_no, pattern); +} + #endif /* M_DO_AUDIO_H */ diff --git a/src/d/d_metronome.cpp b/src/d/d_metronome.cpp index 6e2a2d927..81c5aff7e 100644 --- a/src/d/d_metronome.cpp +++ b/src/d/d_metronome.cpp @@ -15,15 +15,6 @@ #include "JSystem/JUtility/TColor.h" #include "JSystem/JParticle/JPAEmitter.h" -class JAIZelInst { -public: - f32 getMelodyPattern(s32, s32, s32*); - -public: - /* 0x00 */ u8 pad[0x1F]; - /* 0x1F */ u8 mMelodyNum; -}; - class dMetronome_c : public dDlst_base_c { public: void screenSet(); @@ -472,17 +463,15 @@ void dMetronome_c::melodyShow() { /* 80222C4C-80222DB4 .text melodyDemo__12dMetronome_cFv */ void dMetronome_c::melodyDemo() { - /* Nonmatching */ if (pane_wn[4].mUserArea != 0) { s32 note[6]; s16 frames[7]; - s32 melody_no = daPy_getPlayerLinkActorClass()->getTactMusic(); + u32 melody_no = daPy_getPlayerLinkActorClass()->getTactMusic(); frames[0] = 1; for (s32 i = 0; i < mMelodyNum; i++) { - f32 gframes = mDoAud_zelAudio_c::mTact.getMelodyPattern(melody_no, i, ¬e[i]); - frames[i + 1] = gframes + frames[i]; + frames[i + 1] = frames[i] + mDoAud_tact_getMelodyPattern(melody_no, i, ¬e[i]); } if (mMelodyNum > pane_wn[5].mUserArea) {