diff --git a/README.md b/README.md index 799521b5..4ab8b555 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Progress |:---:|:---:|:---:|:---:| | 98.90% | 86.34% | 60.34% | 90.92% | -units 902/1027 complete, functions 12136/12563 matched. +units 902/1027 complete, functions 12138/12563 matched. decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data diff --git a/libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h b/libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h index 140d777d..1beb801f 100644 --- a/libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h +++ b/libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h @@ -48,10 +48,14 @@ namespace EGG { virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, u32 id) { return mSoundArchivePlayer.PrepareSound(pHandle, id); } // 0x44 virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, unsigned int id) { return mSoundArchivePlayer.PrepareSound(pHandle, id); } // 0x44 virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, const char* pName) { +#ifdef IPL_SOUND_MATCHING + u32 id = changeNameToId(pName); +#else u32 id = nw4r::snd::SoundArchive::INVALID_ID; if (mpArchive != NULL) { id = changeNameToId(pName); } +#endif return mSoundArchivePlayer.PrepareSound(pHandle, id); } // 0x48 diff --git a/libs/EGG/include/egg/core/eggAudioHeapMgr.h b/libs/EGG/include/egg/core/eggAudioHeapMgr.h index 1602326d..1522ca15 100644 --- a/libs/EGG/include/egg/core/eggAudioHeapMgr.h +++ b/libs/EGG/include/egg/core/eggAudioHeapMgr.h @@ -20,9 +20,13 @@ namespace EGG { ~SoundHeapMgr() { destroySoundHeap(); } virtual bool loadState(s32 id) { +#ifdef IPL_SOUND_MATCHING + if (id > 0 && mHeap.GetCurrentLevel() >= id) { +#else s32 level = mHeap.GetCurrentLevel(); if (id > 0 && level >= id) { +#endif mHeap.LoadState(id); return true; } diff --git a/libs/NW4R/include/nw4r/snd/SoundHeap.h b/libs/NW4R/include/nw4r/snd/SoundHeap.h index c1616aea..3e1315d3 100644 --- a/libs/NW4R/include/nw4r/snd/SoundHeap.h +++ b/libs/NW4R/include/nw4r/snd/SoundHeap.h @@ -31,7 +31,14 @@ namespace nw4r { ut::detail::AutoLock lock(mMutex); return mFrameHeap.SaveState(); } +#ifdef IPL_SOUND_MATCHING + void LoadState(int id) { + ut::detail::AutoLock lock(mMutex); + mFrameHeap.LoadState(id); + } +#else void LoadState(int id); +#endif bool IsValid() { return mFrameHeap.IsValid(); } diff --git a/src/sound/iplSound.cpp b/src/sound/iplSound.cpp index e492edfa..c167ec95 100644 --- a/src/sound/iplSound.cpp +++ b/src/sound/iplSound.cpp @@ -1,5 +1,6 @@ #define AutoLock(x) AutoLock(x) NO_INLINE #define IPL_SOUND_RECT_OUT_OF_LINE +#define IPL_SOUND_MATCHING #include "iplSound.h" #include "sound/iplSound.h"