diff options
| author | robojumper <robojumper@gmail.com> | 2025-05-24 23:53:38 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-05-25 08:53:24 +0200 |
| commit | a22eb87c36a5cb38ed544ba35bd3d15394e500a7 (patch) | |
| tree | 0b7f44bcdc91cfd3c479e53ab4cf76187449c88a /src | |
| parent | 04d5527ebab1a17348c5030dc21df481ed49b1c6 (diff) | |
make it build
Diffstat (limited to 'src')
64 files changed, 459 insertions, 518 deletions
diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cstdarg b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cstdarg new file mode 100644 index 00000000..b596d426 --- /dev/null +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cstdarg @@ -0,0 +1,11 @@ +#ifndef MSL_CPP_CSTDARG_H +#define MSL_CPP_CSTDARG_H +#include <__va_arg.h> +#ifdef __cplusplus + +namespace std { +using ::va_list; +} // namespace std + +#endif +#endif diff --git a/src/d/d_cursor_hit_check.cpp b/src/d/d_cursor_hit_check.cpp index 9446db18..160c6c28 100644 --- a/src/d/d_cursor_hit_check.cpp +++ b/src/d/d_cursor_hit_check.cpp @@ -234,7 +234,7 @@ void dCursorHitCheckLyt_c::countBoundings(nw4r::lyt::Pane *pane) { mNumBoundings++; } - for (nw4r::lyt::Pane::ChildList::RevIterator it = pane->GetChildList()->GetEndReverseIter(); + for (nw4r::lyt::Pane::ChildList::ReverseIterator it = pane->GetChildList()->GetEndReverseIter(); it != pane->GetChildList()->GetBeginIter(); ++it) { countBoundings(&*it); } @@ -247,7 +247,7 @@ void dCursorHitCheckLyt_c::gatherBoundings(dCsCheckLyt_BoundingData **pEnd, nw4r (*pEnd)->mpPane = pane; } - for (nw4r::lyt::Pane::ChildList::RevIterator it = pane->GetChildList()->GetEndReverseIter(); + for (nw4r::lyt::Pane::ChildList::ReverseIterator it = pane->GetChildList()->GetEndReverseIter(); it != pane->GetChildList()->GetBeginIter(); ++it) { gatherBoundings(pEnd, &*it); } diff --git a/src/egg/core/eggDvdFile.cpp b/src/egg/core/eggDvdFile.cpp index 2f92ab08..b4b2d2dd 100644 --- a/src/egg/core/eggDvdFile.cpp +++ b/src/egg/core/eggDvdFile.cpp @@ -84,7 +84,7 @@ s32 DvdFile::writeData(const void *buffer, s32 length, s32 offset) { s32 DvdFile::sync() { OSMessage msg; OSLockMutex(&mMutex); - OSReceiveMessage(&mMsgQueue, &msg, OS_MSG_PERSISTENT); + OSReceiveMessage(&mMsgQueue, &msg, OS_MESSAGE_FLAG_PERSISTENT); mThread = nullptr; OSUnlockMutex(&mMutex); return (s32)(msg); diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index 524da018..de514c8b 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -1,9 +1,9 @@ /* Only implemented to the extent necessary to match data sections. */ -#include <types.h> // nullptr +#include "common.h" // nullptr #include <decomp.h> -#include "nw4r/snd/Util.h" +#include "nw4r/snd/snd_Util.h" DECOMP_FORCE(nw4r::snd::detail::Util::GetDataRefAddress0( *static_cast<nw4r::snd::detail::Util::DataRef<char> const *>(nullptr), diff --git a/src/nw4r/snd/snd_AxManager.cpp b/src/nw4r/snd/snd_AxManager.cpp index 5d87fb3b..1acaeb7c 100644 --- a/src/nw4r/snd/snd_AxManager.cpp +++ b/src/nw4r/snd/snd_AxManager.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/AxManager.h" +#include "nw4r/snd/snd_AxManager.h" /* Original source: * kiwi515/ogws @@ -11,28 +11,23 @@ #include <cstring> // std::memset -#include <macros.h> -#include <types.h> - -#include "nw4r/snd/BiquadFilterPreset.h" -#include "nw4r/snd/FxBase.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/MoveValue.h" -#include "nw4r/snd/Voice.h" -#include "nw4r/snd/VoiceManager.h" - -#include "nw4r/ut/inlines.h" // ut::Clamp -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock - -#if 0 -#include <revolution/OS/OSCache.h> // DCFlushRange -#include <revolution/AI/ai.h> // AICheckInit -#include <revolution/AX/AXAux.h> -#include <revolution/AX/AXCL.h> -#include <revolution/AX/AXOut.h> -#else -#include <context_rvl.h> -#endif +#include "common.h" + +#include "nw4r/snd/snd_BiquadFilterPreset.h" +#include "nw4r/snd/snd_FxBase.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/snd/snd_Voice.h" +#include "nw4r/snd/snd_VoiceManager.h" + +#include "nw4r/ut/ut_algorithm.h" // ut::Clamp +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock + +#include <rvl/OS/OSCache.h> // DCFlushRange +#include <rvl/AI/ai.h> // AICheckInit +#include <rvl/AX/AXAux.h> +#include <rvl/AX/AXCL.h> +#include <rvl/AX/AXOut.h> #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_AxVoice.cpp b/src/nw4r/snd/snd_AxVoice.cpp index e87e1562..be050bd3 100644 --- a/src/nw4r/snd/snd_AxVoice.cpp +++ b/src/nw4r/snd/snd_AxVoice.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/AxVoice.h" +#include "nw4r/snd/snd_AxVoice.h" /* Original source: * kiwi515/ogws @@ -12,26 +12,22 @@ #include <cstdarg> #include <cstring> -#include <macros.h> // BOOLIFY_TERNARY -#include <types.h> +#include "common.h" -#include "nw4r/snd/adpcm.h" // DecodeDspAdpcm -#include "nw4r/snd/AxManager.h" -#include "nw4r/snd/AxVoiceManager.h" -#include "nw4r/snd/BiquadFilterCallback.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Util.h" // Util::GetRemoteFilterCoefs +#include "nw4r/snd/snd_adpcm.h" // DecodeDspAdpcm +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_AxVoiceManager.h" +#include "nw4r/snd/snd_BiquadFilterCallback.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Util.h" // Util::GetRemoteFilterCoefs -#include "nw4r/ut/inlines.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_algorithm.h" +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock -#if 0 -#include <revolution/AX/AX.h> -#include <revolution/AX/AXVPB.h> -#include <revolution/OS/OSAddress.h> -#else -#include <context_rvl.h> -#endif +#include <rvl/AX/AX.h> +#include <rvl/AX/AXCL.h> +#include <rvl/AX/AXVPB.h> +#include <rvl/OS/OSAddress.h> #include "nw4r/NW4RAssert.hpp" @@ -871,14 +867,14 @@ void AxVoice::CalcOffsetAdpcmParam(u16 *outPredScale, u16 *outYn1, u16 *outYn2, if (currentPos % AX_ADPCM_NIBBLES_PER_FRAME == 0) { byte_t byte = *static_cast<byte_t *>(OSPhysicalToCached( - reinterpret_cast<void *>(currentPos / sizeof(u16)))); + currentPos / sizeof(u16))); adpcm.pred_scale = byte; currentPos += sizeof(u16); } byte_t byte = *static_cast<byte_t *>(OSPhysicalToCached( - reinterpret_cast<void *>(currentPos / sizeof(u16)))); + currentPos / sizeof(u16))); u8 nibble; if (currentPos % sizeof(u16) != 0) @@ -1016,7 +1012,7 @@ void AxVoiceParamBlock::SetVoiceMix(AXPBMIX const &mix, bool immediatelySync) u16 *src = const_cast<u16 *>(reinterpret_cast<u16 const *>(&mix)); u16 *dst = reinterpret_cast<u16 *>(&mVpb->pb.mix); - byte4_t mixerCtrl = 0; + u32 mixerCtrl = 0; if ((*dst++ = *src++)) // vL mixerCtrl |= AX_MIXER_CTRL_L; diff --git a/src/nw4r/snd/snd_AxVoiceManager.cpp b/src/nw4r/snd/snd_AxVoiceManager.cpp index f617a11c..b28623ca 100644 --- a/src/nw4r/snd/snd_AxVoiceManager.cpp +++ b/src/nw4r/snd/snd_AxVoiceManager.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/AxVoiceManager.h" +#include "nw4r/snd/snd_AxVoiceManager.h" /* Original source: * kiwi515/ogws @@ -11,18 +11,14 @@ #include <new> -#include <types.h> +#include "common.h" -#include "nw4r/snd/AxVoice.h" +#include "nw4r/snd/snd_AxVoice.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock -#if 0 -#include <revolution/AX/AXAlloc.h> -#include <revolution/AX/AXVPB.h> -#else -#include <context_rvl.h> -#endif +#include <rvl/AX/AXAlloc.h> +#include <rvl/AX/AXVPB.h> #include "nw4r/NW4RAssert.hpp" @@ -179,7 +175,7 @@ AxVoice *AxVoiceManager::AcquireAxVoice(u32 priority, return nullptr; AXVPB *vpb = AXAcquireVoice(priority, &AxVoice::VoiceCallback, - reinterpret_cast<register_t>(voice)); + reinterpret_cast<u32>(voice)); if (!vpb) { Free(voice); diff --git a/src/nw4r/snd/snd_Bank.cpp b/src/nw4r/snd/snd_Bank.cpp index 02e25094..937616c2 100644 --- a/src/nw4r/snd/snd_Bank.cpp +++ b/src/nw4r/snd/snd_Bank.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Bank.h" +#include "nw4r/snd/snd_Bank.h" /* Original source: * kiwi515/ogws @@ -9,14 +9,14 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/BankFile.h" // InstInfo -#include "nw4r/snd/Channel.h" -#include "nw4r/snd/NoteOnCallback.h" // NoteOnInfo -#include "nw4r/snd/WaveFile.h" // WaveInfo +#include "nw4r/snd/snd_BankFile.h" // InstInfo +#include "nw4r/snd/snd_Channel.h" +#include "nw4r/snd/snd_NoteOnCallback.h" // NoteOnInfo +#include "nw4r/snd/snd_WaveFile.h" // WaveInfo -#include "nw4r/ut/inlines.h" // ut::Min +#include "nw4r/ut/ut_algorithm.h" // ut::Min /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_BankFile.cpp b/src/nw4r/snd/snd_BankFile.cpp index 971efb1e..349c5e37 100644 --- a/src/nw4r/snd/snd_BankFile.cpp +++ b/src/nw4r/snd/snd_BankFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/BankFile.h" +#include "nw4r/snd/snd_BankFile.h" /* Original source: * kiwi515/ogws @@ -9,15 +9,14 @@ * headers */ -#include <macros.h> // NW4R_FILE_VERSION -#include <types.h> +#include "common.h" -#include "nw4r/snd/Util.h" -#include "nw4r/snd/WaveArchive.h" // WaveArchiveReader -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_Util.h" +#include "nw4r/snd/snd_WaveArchive.h" // WaveArchiveReader +#include "nw4r/snd/snd_WaveFile.h" -#include "nw4r/ut/binaryFileFormat.h" // ut::BinaryFileHeader -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_binaryFileFormat.h" // ut::BinaryFileHeader +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_BasicPlayer.cpp b/src/nw4r/snd/snd_BasicPlayer.cpp index bcac6152..e5695e31 100644 --- a/src/nw4r/snd/snd_BasicPlayer.cpp +++ b/src/nw4r/snd/snd_BasicPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/BasicPlayer.h" +#include "nw4r/snd/snd_BasicPlayer.h" /* Original source: * kiwi515/ogws @@ -9,11 +9,10 @@ * headers */ -#include <macros.h> // ARRAY_LENGTH -#include <types.h> // f32 +#include "common.h" // f32 -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/global.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_global.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp index 69bb2e1f..0aacd888 100644 --- a/src/nw4r/snd/snd_BasicSound.cpp +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/BasicSound.h" +#include "nw4r/snd/snd_BasicSound.h" /* Original source: * kiwi515/ogws @@ -12,19 +12,18 @@ #include <climits> // ULONG_MAX #include <cstring> -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicPlayer.h" -#include "nw4r/snd/ExternalSoundPlayer.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/MoveValue.h" -#include "nw4r/snd/SoundActor.h" -#include "nw4r/snd/SoundHandle.h" -#include "nw4r/snd/SoundPlayer.h" +#include "nw4r/snd/snd_BasicPlayer.h" +#include "nw4r/snd/snd_ExternalSoundPlayer.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/snd/snd_SoundActor.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundPlayer.h" -#include "nw4r/ut/inlines.h" // ut::Clamp -#include "nw4r/ut/RuntimeTypeInfo.h" +#include "nw4r/ut/ut_algorithm.h" // ut::Clamp +#include "nw4r/ut/ut_RuntimeTypeInfo.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_BiquadFilterPreset.cpp b/src/nw4r/snd/snd_BiquadFilterPreset.cpp index 4f1d8374..7d00bfb3 100644 --- a/src/nw4r/snd/snd_BiquadFilterPreset.cpp +++ b/src/nw4r/snd/snd_BiquadFilterPreset.cpp @@ -1,15 +1,14 @@ -#include "nw4r/snd/BiquadFilterPreset.h" +#include "nw4r/snd/snd_BiquadFilterPreset.h" /******************************************************************************* * headers */ -#include <macros.h> // ATTR_UNUSED -#include <types.h> // f32 +#include "common.h" // f32 -#include "nw4r/snd/BiquadFilterCallback.h" +#include "nw4r/snd/snd_BiquadFilterCallback.h" -#include "nw4r/ut/inlines.h" // ut::Clamp +#include "nw4r/ut/ut_algorithm.h" // ut::Clamp /******************************************************************************* * variables diff --git a/src/nw4r/snd/snd_Channel.cpp b/src/nw4r/snd/snd_Channel.cpp index 07622a08..c55d4321 100644 --- a/src/nw4r/snd/snd_Channel.cpp +++ b/src/nw4r/snd/snd_Channel.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Channel.h" +#include "nw4r/snd/snd_Channel.h" /* Original source: * kiwi515/ogws @@ -9,20 +9,19 @@ * headers */ -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/EnvGenerator.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/InstancePool.h" -#include "nw4r/snd/Lfo.h" -#include "nw4r/snd/MoveValue.h" -#include "nw4r/snd/Util.h" -#include "nw4r/snd/Voice.h" -#include "nw4r/snd/VoiceManager.h" -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_EnvGenerator.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_InstancePool.h" +#include "nw4r/snd/snd_Lfo.h" +#include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/snd/snd_Util.h" +#include "nw4r/snd/snd_Voice.h" +#include "nw4r/snd/snd_VoiceManager.h" +#include "nw4r/snd/snd_WaveFile.h" -#include "nw4r/ut/Lock.h" +#include "nw4r/ut/ut_Lock.h" #include "nw4r/NW4RAssert.hpp" @@ -117,7 +116,7 @@ Channel::Channel() : Channel::~Channel() {} -void Channel::InitParam(Callback *callback, register_t callbackData) +void Channel::InitParam(Callback *callback, u32 callbackData) { mNextLink = nullptr; mCallback = callback; @@ -433,7 +432,7 @@ void Channel::VoiceCallbackFunc(Voice *voice, Voice::VoiceCallbackStatus status, Channel *Channel::AllocChannel(int voiceChannelCount, int voiceOutCount, int priority, Callback *callback, - register_t callbackData) + u32 callbackData) { NW4RAssertHeaderClampedLRValue_Line(606, priority, 0, 255); diff --git a/src/nw4r/snd/snd_DisposeCallbackManager.cpp b/src/nw4r/snd/snd_DisposeCallbackManager.cpp index be384d69..060bc6fc 100644 --- a/src/nw4r/snd/snd_DisposeCallbackManager.cpp +++ b/src/nw4r/snd/snd_DisposeCallbackManager.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/DisposeCallbackManager.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" /* Original source: * kiwi515/ogws @@ -9,12 +9,11 @@ * headers */ -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_SoundThread.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_DvdSoundArchive.cpp b/src/nw4r/snd/snd_DvdSoundArchive.cpp index 7b9adf2a..17187007 100644 --- a/src/nw4r/snd/snd_DvdSoundArchive.cpp +++ b/src/nw4r/snd/snd_DvdSoundArchive.cpp @@ -1,6 +1,6 @@ /* Only implemented to the extent necessary to match data sections. */ -#include "nw4r/snd/DvdSoundArchive.h" +#include "nw4r/snd/snd_DvdSoundArchive.h" nw4r::snd::DvdSoundArchive::DvdSoundArchive() {} nw4r::snd::DvdSoundArchive::DvdFileStream::DvdFileStream() {} diff --git a/src/nw4r/snd/snd_EnvGenerator.cpp b/src/nw4r/snd/snd_EnvGenerator.cpp index fe40431b..07f7809e 100644 --- a/src/nw4r/snd/snd_EnvGenerator.cpp +++ b/src/nw4r/snd/snd_EnvGenerator.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/EnvGenerator.h" +#include "nw4r/snd/snd_EnvGenerator.h" /* Original source: * kiwi515/ogws @@ -9,7 +9,7 @@ * headers */ -#include <types.h> +#include "common.h" #include <nw4r/NW4RAssert.hpp> diff --git a/src/nw4r/snd/snd_ExternalSoundPlayer.cpp b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp index afb6f117..af7c95f3 100644 --- a/src/nw4r/snd/snd_ExternalSoundPlayer.cpp +++ b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/ExternalSoundPlayer.h" +#include "nw4r/snd/snd_ExternalSoundPlayer.h" /* Original source: * kiwi515/ogws @@ -10,11 +10,10 @@ */ #include <decomp.h> -#include <macros.h> // NW4R_RANGE_FOR -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundThread.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_InstancePool.cpp b/src/nw4r/snd/snd_InstancePool.cpp index e81c5f4c..50b4fecd 100644 --- a/src/nw4r/snd/snd_InstancePool.cpp +++ b/src/nw4r/snd/snd_InstancePool.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/InstancePool.h" +#include "nw4r/snd/snd_InstancePool.h" /* Original source: * kiwi515/ogws @@ -9,10 +9,10 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock -#include "nw4r/ut/inlines.h" // ut::RoundUp +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_algorithm.h" // ut::RoundUp #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_Lfo.cpp b/src/nw4r/snd/snd_Lfo.cpp index a02b717d..1c848667 100644 --- a/src/nw4r/snd/snd_Lfo.cpp +++ b/src/nw4r/snd/snd_Lfo.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Lfo.h" +#include "nw4r/snd/snd_Lfo.h" /* Original source: * kiwi515/ogws @@ -9,7 +9,7 @@ * headers */ -#include <types.h> +#include "common.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_McsSoundArchive.cpp b/src/nw4r/snd/snd_McsSoundArchive.cpp index b2e0d36e..9d2c4d3a 100644 --- a/src/nw4r/snd/snd_McsSoundArchive.cpp +++ b/src/nw4r/snd/snd_McsSoundArchive.cpp @@ -2,7 +2,7 @@ * inline functions and data sections. */ -#include "nw4r/snd/McsSoundArchive.h" +#include "nw4r/snd/snd_McsSoundArchive.h" nw4r::snd::McsSoundArchive::McsSoundArchive() {} nw4r::snd::McsSoundArchive::McsFileStream::McsFileStream() {} diff --git a/src/nw4r/snd/snd_MemorySoundArchive.cpp b/src/nw4r/snd/snd_MemorySoundArchive.cpp index a1cf5406..5faa944c 100644 --- a/src/nw4r/snd/snd_MemorySoundArchive.cpp +++ b/src/nw4r/snd/snd_MemorySoundArchive.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/MemorySoundArchive.h" +#include "nw4r/snd/snd_MemorySoundArchive.h" /* Original source: * kiwi515/ogws @@ -12,14 +12,14 @@ #include <cstring> // std::memcpy #include <new> -#include <types.h> +#include "common.h" -#include "nw4r/snd/SoundArchive.h" -#include "nw4r/snd/SoundArchiveFile.h" // SoundArchiveFileReader +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchiveFile.h" // SoundArchiveFileReader -#include "nw4r/ut/FileStream.h" -#include "nw4r/ut/inlines.h" -#include "nw4r/ut/RuntimeTypeInfo.h" // IWYU pragma: keep (need the complete type) +#include "nw4r/ut/ut_FileStream.h" +#include "nw4r/ut/ut_algorithm.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" // IWYU pragma: keep (need the complete type) #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_MidiSeqPlayer.cpp b/src/nw4r/snd/snd_MidiSeqPlayer.cpp index 29f85f4f..6da97c92 100644 --- a/src/nw4r/snd/snd_MidiSeqPlayer.cpp +++ b/src/nw4r/snd/snd_MidiSeqPlayer.cpp @@ -1,6 +1,6 @@ /* Only implemented to the extent necessary to match early instantiations of * inline functions and data sections. */ -#include "nw4r/snd/MidiSeqPlayer.h" +#include "nw4r/snd/snd_MidiSeqPlayer.h" nw4r::snd::detail::MidiSeqPlayer::MidiSeqPlayer() {} diff --git a/src/nw4r/snd/snd_MidiSeqTrack.cpp b/src/nw4r/snd/snd_MidiSeqTrack.cpp index fa4c1c11..b4f970bd 100644 --- a/src/nw4r/snd/snd_MidiSeqTrack.cpp +++ b/src/nw4r/snd/snd_MidiSeqTrack.cpp @@ -1,6 +1,6 @@ /* Only implemented to the extent necessary to match early instantiations of * inline functions and data sections. */ -#include "nw4r/snd/MidiSeqTrack.h" +#include "nw4r/snd/snd_MidiSeqTrack.h" nw4r::snd::detail::MidiSeqTrack::MidiSeqTrack() {} diff --git a/src/nw4r/snd/snd_MidiSeqTrackAllocator.cpp b/src/nw4r/snd/snd_MidiSeqTrackAllocator.cpp index c21af6d6..72ed61c3 100644 --- a/src/nw4r/snd/snd_MidiSeqTrackAllocator.cpp +++ b/src/nw4r/snd/snd_MidiSeqTrackAllocator.cpp @@ -1,6 +1,6 @@ /* Only implemented to the extent necessary to match early instantiations of * inline functions and data sections. */ -#include "nw4r/snd/MidiSeqTrackAllocator.h" +#include "nw4r/snd/snd_MidiSeqTrackAllocator.h" nw4r::snd::detail::MidiSeqTrackAllocator::MidiSeqTrackAllocator() {} diff --git a/src/nw4r/snd/snd_MmlParser.cpp b/src/nw4r/snd/snd_MmlParser.cpp index ab336e35..d481920f 100644 --- a/src/nw4r/snd/snd_MmlParser.cpp +++ b/src/nw4r/snd/snd_MmlParser.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/MmlParser.h" +#include "nw4r/snd/snd_MmlParser.h" /* Original source: * kiwi515/ogws @@ -9,24 +9,19 @@ * headers */ -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Lfo.h" // LfoParam -#include "nw4r/snd/MmlSeqTrack.h" -#include "nw4r/snd/MoveValue.h" -#include "nw4r/snd/SeqPlayer.h" -#include "nw4r/snd/SeqTrack.h" -#include "nw4r/snd/Util.h" // Util::CalcRandom +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Lfo.h" // LfoParam +#include "nw4r/snd/snd_MmlSeqTrack.h" +#include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/snd/snd_SeqPlayer.h" +#include "nw4r/snd/snd_SeqTrack.h" +#include "nw4r/snd/snd_Util.h" // Util::CalcRandom -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_algorithm.h" -#if 0 -#include <revolution/OS/OSReport.h> -#else -#include <context_rvl.h> -#endif +#include <rvl/OS/OSError.h> #include "nw4r/NW4RAssert.hpp" @@ -846,9 +841,9 @@ Channel *MmlParser::NoteOnCommandProc(MmlSeqTrack *track, int key, int velocity, return track->NoteOn(key, velocity, length, tieFlag); } -byte2_t MmlParser::Read16(byte_t const **ptr) const +u16 MmlParser::Read16(byte_t const **ptr) const { - byte2_t ret = ReadByte(ptr); + u16 ret = ReadByte(ptr); ret <<= 8; ret |= ReadByte(ptr); @@ -856,9 +851,9 @@ byte2_t MmlParser::Read16(byte_t const **ptr) const return ret; } -byte4_t MmlParser::Read24(byte_t const **ptr) const +u32 MmlParser::Read24(byte_t const **ptr) const { - byte4_t ret = ReadByte(ptr); + u32 ret = ReadByte(ptr); ret <<= 8; ret |= ReadByte(ptr); @@ -955,7 +950,7 @@ s16 volatile *MmlParser::GetVariablePtr(SeqPlayer *player, SeqTrack *track, } u32 MmlParser::ParseAllocTrack(void const *baseAddress, u32 seqOffset, - byte4_t *allocTrack) + u32 *allocTrack) { NW4RAssertPointerNonnull_Line(1051, baseAddress); NW4RAssertPointerNonnull_Line(1052, allocTrack); diff --git a/src/nw4r/snd/snd_MmlSeqTrack.cpp b/src/nw4r/snd/snd_MmlSeqTrack.cpp index e2eee4ce..569a2302 100644 --- a/src/nw4r/snd/snd_MmlSeqTrack.cpp +++ b/src/nw4r/snd/snd_MmlSeqTrack.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/MmlSeqTrack.h" +#include "nw4r/snd/snd_MmlSeqTrack.h" /* Original source: * kiwi515/ogws @@ -9,7 +9,7 @@ * headers */ -#include "nw4r/snd/MmlParser.h" +#include "nw4r/snd/snd_MmlParser.h" /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp b/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp index 3363143a..db3cffbe 100644 --- a/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp +++ b/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/MmlSeqTrackAllocator.h" +#include "nw4r/snd/snd_MmlSeqTrackAllocator.h" /* Original source: * kiwi515/ogws @@ -9,11 +9,11 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/InstancePool.h" -#include "nw4r/snd/MmlSeqTrack.h" -#include "nw4r/snd/SeqTrack.h" +#include "nw4r/snd/snd_InstancePool.h" +#include "nw4r/snd/snd_MmlSeqTrack.h" +#include "nw4r/snd/snd_SeqTrack.h" #include <nw4r/NW4RAssert.hpp> diff --git a/src/nw4r/snd/snd_PlayerHeap.cpp b/src/nw4r/snd/snd_PlayerHeap.cpp index 677b4f37..2d397baf 100644 --- a/src/nw4r/snd/snd_PlayerHeap.cpp +++ b/src/nw4r/snd/snd_PlayerHeap.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/PlayerHeap.h" +#include "nw4r/snd/snd_PlayerHeap.h" /******************************************************************************* * headers @@ -6,12 +6,12 @@ #include <cstddef> // NULL -#include <types.h> +#include "common.h" -#include "nw4r/snd/DisposeCallbackManager.h" -#include "nw4r/snd/SoundThread.h" // SoundThread::AutoLock +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_SoundThread.h" // SoundThread::AutoLock -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SeqFile.cpp b/src/nw4r/snd/snd_SeqFile.cpp index 027a3343..6dd78c3d 100644 --- a/src/nw4r/snd/snd_SeqFile.cpp +++ b/src/nw4r/snd/snd_SeqFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SeqFile.h" +#include "nw4r/snd/snd_SeqFile.h" /* Original source: * kiwi515/ogws @@ -11,13 +11,12 @@ #include <cstring> -#include <macros.h> // NW4R_FILE_VERSION -#include <types.h> +#include "common.h" -#include "nw4r/snd/Util.h" +#include "nw4r/snd/snd_Util.h" -#include "nw4r/ut/binaryFileFormat.h" -#include "nw4r/ut/inlines.h" // ut::AddOffsetToPtr +#include "nw4r/ut/ut_binaryFileFormat.h" +#include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SeqPlayer.cpp b/src/nw4r/snd/snd_SeqPlayer.cpp index 8ed60033..d9195d5c 100644 --- a/src/nw4r/snd/snd_SeqPlayer.cpp +++ b/src/nw4r/snd/snd_SeqPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SeqPlayer.h" +#include "nw4r/snd/snd_SeqPlayer.h" /* Original source: * kiwi515/ogws @@ -10,16 +10,16 @@ */ #include <decomp.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicPlayer.h" -#include "nw4r/snd/DisposeCallbackManager.h" -#include "nw4r/snd/NoteOnCallback.h" -#include "nw4r/snd/SeqTrack.h" -#include "nw4r/snd/SeqTrackAllocator.h" -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_BasicPlayer.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_NoteOnCallback.h" +#include "nw4r/snd/snd_SeqTrack.h" +#include "nw4r/snd/snd_SeqTrackAllocator.h" +#include "nw4r/snd/snd_SoundThread.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SeqSound.cpp b/src/nw4r/snd/snd_SeqSound.cpp index 15152a92..c398e9ee 100644 --- a/src/nw4r/snd/snd_SeqSound.cpp +++ b/src/nw4r/snd/snd_SeqSound.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SeqSound.h" +#include "nw4r/snd/snd_SeqSound.h" /* Original source: * kiwi515/ogws @@ -10,24 +10,20 @@ */ #include <decomp.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/PlayerHeap.h" -#include "nw4r/snd/SeqFile.h" -#include "nw4r/snd/SeqPlayer.h" -#include "nw4r/snd/SeqSoundHandle.h" -#include "nw4r/snd/SoundInstanceManager.h" -#include "nw4r/snd/TaskManager.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_PlayerHeap.h" +#include "nw4r/snd/snd_SeqFile.h" +#include "nw4r/snd/snd_SeqPlayer.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundInstanceManager.h" +#include "nw4r/snd/snd_TaskManager.h" -#include "nw4r/ut/FileStream.h" -#include "nw4r/ut/RuntimeTypeInfo.h" +#include "nw4r/ut/ut_FileStream.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" -#if 0 -#include <revolution/DVD/dvd.h> // DVD_ECANCELED -#else -#include <context_rvl.h> -#endif +#include <rvl/DVD/dvd.h> // DVD_ECANCELED #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SeqSoundHandle.cpp b/src/nw4r/snd/snd_SeqSoundHandle.cpp index d8b8d8f3..b5562bd7 100644 --- a/src/nw4r/snd/snd_SeqSoundHandle.cpp +++ b/src/nw4r/snd/snd_SeqSoundHandle.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SeqSoundHandle.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" /* Original source: * kiwi515/ogws @@ -9,9 +9,9 @@ * headers */ -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/SeqSound.h" +#include "nw4r/snd/snd_SeqSound.h" /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_SeqTrack.cpp b/src/nw4r/snd/snd_SeqTrack.cpp index 09904026..81b2cb69 100644 --- a/src/nw4r/snd/snd_SeqTrack.cpp +++ b/src/nw4r/snd/snd_SeqTrack.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SeqTrack.h" +#include "nw4r/snd/snd_SeqTrack.h" /* Original source: * kiwi515/ogws @@ -10,17 +10,17 @@ */ #include <decomp.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/Channel.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Lfo.h" -#include "nw4r/snd/MoveValue.h" -#include "nw4r/snd/NoteOnCallback.h" -#include "nw4r/snd/SeqPlayer.h" -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_Channel.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Lfo.h" +#include "nw4r/snd/snd_MoveValue.h" +#include "nw4r/snd/snd_NoteOnCallback.h" +#include "nw4r/snd/snd_SeqPlayer.h" +#include "nw4r/snd/snd_SoundThread.h" -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" @@ -370,7 +370,7 @@ void SeqTrack::FreeAllChannel() void SeqTrack::ChannelCallbackFunc(Channel *dropChannel, Channel::ChannelCallbackStatus status, - register_t userData) + u32 userData) { SoundThread::AutoLock lock; @@ -571,7 +571,7 @@ Channel *SeqTrack::NoteOn(int key, int velocity, s32 length, bool tieFlag) playerParam.priority + GetParserTrackParam().priority, mSeqPlayer->GetVoiceOutCount(), &ChannelCallbackFunc, - reinterpret_cast<register_t>(this) + reinterpret_cast<u32>(this) }; channel = mSeqPlayer->NoteOn(mParserTrackParam.bankNo, info); diff --git a/src/nw4r/snd/snd_SoundActor.cpp b/src/nw4r/snd/snd_SoundActor.cpp index 04bbfb04..c390dc15 100644 --- a/src/nw4r/snd/snd_SoundActor.cpp +++ b/src/nw4r/snd/snd_SoundActor.cpp @@ -2,11 +2,11 @@ * inline functions and data sections. */ -#include "nw4r/snd/SoundActor.h" +#include "nw4r/snd/snd_SoundActor.h" -#include <types.h> +#include "common.h" -#include "nw4r/snd/SoundArchivePlayer.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" nw4r::snd::SoundActor::SoundActor() : mSoundArchivePlayer (*new SoundArchivePlayer) diff --git a/src/nw4r/snd/snd_SoundArchive.cpp b/src/nw4r/snd/snd_SoundArchive.cpp index 8d3b5cc3..d8f98a2c 100644 --- a/src/nw4r/snd/snd_SoundArchive.cpp +++ b/src/nw4r/snd/snd_SoundArchive.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundArchive.h" +#include "nw4r/snd/snd_SoundArchive.h" /* Original source: * kiwi515/ogws @@ -11,9 +11,9 @@ #include <cstring> -#include <types.h> +#include "common.h" -#include "nw4r/snd/SoundArchiveFile.h" // detail::SoundArchiveFileReader +#include "nw4r/snd/snd_SoundArchiveFile.h" // detail::SoundArchiveFileReader #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SoundArchiveFile.cpp b/src/nw4r/snd/snd_SoundArchiveFile.cpp index 8c244dd0..802422aa 100644 --- a/src/nw4r/snd/snd_SoundArchiveFile.cpp +++ b/src/nw4r/snd/snd_SoundArchiveFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundArchiveFile.h" +#include "nw4r/snd/snd_SoundArchiveFile.h" /* Original source: * kiwi515/ogws @@ -12,15 +12,14 @@ #include <cstring> #include <decomp.h> -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/SoundArchive.h" -#include "nw4r/snd/Util.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_Util.h" -#include "nw4r/ut/binaryFileFormat.h" // ut::BinaryFileHeader -#include "nw4r/ut/inlines.h" // ut::AddOffsetToPtr +#include "nw4r/ut/ut_binaryFileFormat.h" // ut::BinaryFileHeader +#include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr #include <nw4r/NW4RAssert.hpp> @@ -247,7 +246,7 @@ bool SoundArchiveFileReader::ReadStrmSoundInfo( info->allocChannelCount = 0; // is this meant to be src->allocTrackFlag? - for (byte2_t bitflag = src->allocChannelCount; bitflag; bitflag >>= 1) + for (u16 bitflag = src->allocChannelCount; bitflag; bitflag >>= 1) { if (bitflag & 1) info->allocChannelCount++; diff --git a/src/nw4r/snd/snd_SoundArchivePlayer.cpp b/src/nw4r/snd/snd_SoundArchivePlayer.cpp index 6d0e8eae..44eeed9e 100644 --- a/src/nw4r/snd/snd_SoundArchivePlayer.cpp +++ b/src/nw4r/snd/snd_SoundArchivePlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundArchivePlayer.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" /* Original source: * kiwi515/ogws @@ -12,39 +12,38 @@ #include <new> #include <decomp.h> -#include <macros.h> -#include <types.h> - -#include "nw4r/snd/Bank.h" -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/debug.h" -#include "nw4r/snd/DisposeCallbackManager.h" -#include "nw4r/snd/ExternalSoundPlayer.h" -#include "nw4r/snd/MmlParser.h" -#include "nw4r/snd/MmlSeqTrack.h" -#include "nw4r/snd/MmlSeqTrackAllocator.h" -#include "nw4r/snd/PlayerHeap.h" -#include "nw4r/snd/SeqFile.h" -#include "nw4r/snd/SeqPlayer.h" -#include "nw4r/snd/SeqSound.h" -#include "nw4r/snd/SoundActor.h" -#include "nw4r/snd/SoundArchive.h" -#include "nw4r/snd/SoundHandle.h" -#include "nw4r/snd/SoundInstanceManager.h" -#include "nw4r/snd/SoundPlayer.h" -#include "nw4r/snd/SoundStartable.h" -#include "nw4r/snd/SoundSystem.h" -#include "nw4r/snd/SoundThread.h" -#include "nw4r/snd/StrmChannel.h" -#include "nw4r/snd/StrmPlayer.h" -#include "nw4r/snd/StrmSound.h" -#include "nw4r/snd/WaveFile.h" -#include "nw4r/snd/WaveSound.h" -#include "nw4r/snd/WsdFile.h" -#include "nw4r/snd/WsdPlayer.h" - -#include "nw4r/ut/FileStream.h" -#include "nw4r/ut/inlines.h" +#include "common.h" + +#include "nw4r/snd/snd_Bank.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_debug.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_ExternalSoundPlayer.h" +#include "nw4r/snd/snd_MmlParser.h" +#include "nw4r/snd/snd_MmlSeqTrack.h" +#include "nw4r/snd/snd_MmlSeqTrackAllocator.h" +#include "nw4r/snd/snd_PlayerHeap.h" +#include "nw4r/snd/snd_SeqFile.h" +#include "nw4r/snd/snd_SeqPlayer.h" +#include "nw4r/snd/snd_SeqSound.h" +#include "nw4r/snd/snd_SoundActor.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundInstanceManager.h" +#include "nw4r/snd/snd_SoundPlayer.h" +#include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_SoundSystem.h" +#include "nw4r/snd/snd_SoundThread.h" +#include "nw4r/snd/snd_StrmChannel.h" +#include "nw4r/snd/snd_StrmPlayer.h" +#include "nw4r/snd/snd_StrmSound.h" +#include "nw4r/snd/snd_WaveFile.h" +#include "nw4r/snd/snd_WaveSound.h" +#include "nw4r/snd/snd_WsdFile.h" +#include "nw4r/snd/snd_WsdPlayer.h" + +#include "nw4r/ut/ut_FileStream.h" +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" @@ -1417,7 +1416,7 @@ detail::Channel *SoundArchivePlayer::SeqNoteOnCallback::NoteOn( bool SoundArchivePlayer::WsdCallback::GetWaveSoundData( detail::WaveSoundInfo *info, detail::WaveSoundNoteInfo *noteInfo, detail::WaveInfo *waveData, void const *waveSoundData, int index, - int noteIndex, register_t userData) const + int noteIndex, u32 userData) const { u32 fileID = userData; diff --git a/src/nw4r/snd/snd_SoundHandle.cpp b/src/nw4r/snd/snd_SoundHandle.cpp index 4483355d..249815da 100644 --- a/src/nw4r/snd/snd_SoundHandle.cpp +++ b/src/nw4r/snd/snd_SoundHandle.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundHandle.h" +#include "nw4r/snd/snd_SoundHandle.h" /* Original source: * kiwi515/ogws @@ -9,9 +9,9 @@ * headers */ -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/BasicSound.h" +#include "nw4r/snd/snd_BasicSound.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SoundPlayer.cpp b/src/nw4r/snd/snd_SoundPlayer.cpp index 6f195226..81e1f800 100644 --- a/src/nw4r/snd/snd_SoundPlayer.cpp +++ b/src/nw4r/snd/snd_SoundPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundPlayer.h" +#include "nw4r/snd/snd_SoundPlayer.h" /* Original source: * kiwi515/ogws @@ -12,15 +12,14 @@ #include <climits> // INT_MAX #include <decomp.h> -#include <macros.h> -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/global.h" // AUX_BUS_NUM -#include "nw4r/snd/PlayerHeap.h" -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_global.h" // AUX_BUS_NUM +#include "nw4r/snd/snd_PlayerHeap.h" +#include "nw4r/snd/snd_SoundThread.h" -#include "nw4r/ut/inlines.h" // ut::Clamp +#include "nw4r/ut/ut_algorithm.h" // ut::Clamp #include <nw4r/NW4RAssert.hpp> diff --git a/src/nw4r/snd/snd_SoundStartable.cpp b/src/nw4r/snd/snd_SoundStartable.cpp index 236a1220..4488ef60 100644 --- a/src/nw4r/snd/snd_SoundStartable.cpp +++ b/src/nw4r/snd/snd_SoundStartable.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundStartable.h" +#include "nw4r/snd/snd_SoundStartable.h" /* Original source: * kiwi515/ogws @@ -9,10 +9,10 @@ * headers */ -#include <types.h> // u32 +#include "common.h" // u32 -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/SoundHandle.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundHandle.h" /******************************************************************************* * functions @@ -21,7 +21,7 @@ namespace nw4r { namespace snd { SoundStartable::StartResult SoundStartable::detail_StartSound( - SoundHandle *handle, u32 soundId, StartInfo const *startInfo) + SoundHandle *handle, u32 soundId, const StartInfo *startInfo) { StartResult result = detail_SetupSound(handle, soundId, false, startInfo); if (result != START_SUCCESS) diff --git a/src/nw4r/snd/snd_SoundSystem.cpp b/src/nw4r/snd/snd_SoundSystem.cpp index 9a6d592a..01afc6d4 100644 --- a/src/nw4r/snd/snd_SoundSystem.cpp +++ b/src/nw4r/snd/snd_SoundSystem.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundSystem.h" +#include "nw4r/snd/snd_SoundSystem.h" /* Original source: * kiwi515/ogws @@ -10,27 +10,22 @@ */ #include <decomp.h> -#include <macros.h> // STR -#include <types.h> - -#include "nw4r/snd/AxVoiceManager.h" -#include "nw4r/snd/AxManager.h" -#include "nw4r/snd/Channel.h" // ChannelManager -#include "nw4r/snd/global.h" -#include "nw4r/snd/SeqPlayer.h" -#include "nw4r/snd/SoundThread.h" -#include "nw4r/snd/TaskManager.h" -#include "nw4r/snd/TaskThread.h" -#include "nw4r/snd/VoiceManager.h" - -#if 0 -#include <revolution/OS/OS.h> // OSRegisterVersion -#include <revolution/AX/AXVPB.h> // AXGetMaxVoices -#include <revolution/SC/scsystem.h> -#include <revolution/SC/scapi.h> -#else -#include <context_rvl.h> -#endif +#include "common.h" + +#include "nw4r/snd/snd_AxVoiceManager.h" +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_Channel.h" // ChannelManager +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_SeqPlayer.h" +#include "nw4r/snd/snd_SoundThread.h" +#include "nw4r/snd/snd_TaskManager.h" +#include "nw4r/snd/snd_TaskThread.h" +#include "nw4r/snd/snd_VoiceManager.h" + +#include <rvl/OS/OS.h> // OSRegisterVersion +#include <rvl/AX/AXVPB.h> // AXGetMaxVoices +#include <rvl/SC/scsystem.h> +#include <rvl/SC/scapi.h> #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_SoundThread.cpp b/src/nw4r/snd/snd_SoundThread.cpp index 7477deb2..2a8ca309 100644 --- a/src/nw4r/snd/snd_SoundThread.cpp +++ b/src/nw4r/snd/snd_SoundThread.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/SoundThread.h" +#include "nw4r/snd/snd_SoundThread.h" /* Original source: * kiwi515/ogws @@ -10,25 +10,20 @@ */ #include <decomp.h> -#include <macros.h> -#include <types.h> - -#include "nw4r/snd/AxManager.h" -#include "nw4r/snd/AxVoiceManager.h" -#include "nw4r/snd/Channel.h" // ChannelManager -#include "nw4r/snd/Util.h" // Util::CalcRandom -#include "nw4r/snd/VoiceManager.h" - -#include "nw4r/ut/Lock.h" // ut::detail::AutoLock - -#if 0 -#include <revolution/OS/OSMessage.h> -#include <revolution/OS/OSMutex.h> -#include <revolution/OS/OSThread.h> -#include <revolution/OS/OSTime.h> -#else -#include <context_rvl.h> -#endif +#include "common.h" + +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_AxVoiceManager.h" +#include "nw4r/snd/snd_Channel.h" // ChannelManager +#include "nw4r/snd/snd_Util.h" // Util::CalcRandom +#include "nw4r/snd/snd_VoiceManager.h" + +#include "nw4r/ut/ut_Lock.h" // ut::detail::AutoLock + +#include <rvl/OS/OSMessage.h> +#include <rvl/OS/OSMutex.h> +#include <rvl/OS/OSThread.h> +#include <rvl/OS/OSTime.h> #include "nw4r/NW4RAssert.hpp" @@ -65,7 +60,7 @@ bool SoundThread::Create(s32 priority, void *stack, u32 stackSize) return true; mCreateFlag = true; - mStackEnd = static_cast<byte4_t *>(stack); + mStackEnd = static_cast<u32 *>(stack); BOOL result = OSCreateThread(&mThread, &SoundThreadFunc, &GetInstance(), static_cast<byte_t *>(stack) + stackSize, @@ -162,7 +157,7 @@ void SoundThread::SoundThreadProc() { OSReceiveMessage(&mMsgQueue, &message, OS_MESSAGE_FLAG_PERSISTENT); - if (reinterpret_cast<register_t>(message) == MESSAGE_AX_CALLBACK) + if (reinterpret_cast<u32>(message) == MESSAGE_AX_CALLBACK) { ut::detail::AutoLock<OSMutex> lock(mMutex); @@ -201,7 +196,7 @@ void SoundThread::SoundThreadProc() curItr->at_0x10(); } } - else if (reinterpret_cast<register_t>(message) == MESSAGE_SHUTDOWN) + else if (reinterpret_cast<u32>(message) == MESSAGE_SHUTDOWN) { break; } diff --git a/src/nw4r/snd/snd_StrmChannel.cpp b/src/nw4r/snd/snd_StrmChannel.cpp index 6aa4db99..dbd47c31 100644 --- a/src/nw4r/snd/snd_StrmChannel.cpp +++ b/src/nw4r/snd/snd_StrmChannel.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/StrmChannel.h" +#include "nw4r/snd/snd_StrmChannel.h" /* Original source: * kiwi515/ogws @@ -11,10 +11,10 @@ #include <cstring> // std::memset -#include <types.h> +#include "common.h" -#include "nw4r/ut/inlines.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_algorithm.h" +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_StrmFile.cpp b/src/nw4r/snd/snd_StrmFile.cpp index 8283cf45..b5766358 100644 --- a/src/nw4r/snd/snd_StrmFile.cpp +++ b/src/nw4r/snd/snd_StrmFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/StrmFile.h" +#include "nw4r/snd/snd_StrmFile.h" /* Original source: * kiwi515/ogws @@ -9,17 +9,16 @@ * headers */ -#include <macros.h> -#include <types.h> +#include "common.h" -#include "nw4r/snd/adpcm.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Util.h" -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_adpcm.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Util.h" +#include "nw4r/snd/snd_WaveFile.h" -#include "nw4r/ut/binaryFileFormat.h" -#include "nw4r/ut/FileStream.h" -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_binaryFileFormat.h" +#include "nw4r/ut/ut_FileStream.h" +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" @@ -342,7 +341,7 @@ bool StrmFileLoader::ReadAdpcBlockData(u16 *yn1, u16 *yn2, int blockIndex, u32 readDataSize = channelCount * (sizeof(u16) * 2); NW4RAssert_Line(499, readDataSize <= 32); - alignas(32) u16 buffer[2 * 8]; + ALIGN_DECL(32) u16 buffer[2 * 8]; int readSize = mStream.Read(buffer, sizeof buffer); if (readSize != 32u) diff --git a/src/nw4r/snd/snd_StrmPlayer.cpp b/src/nw4r/snd/snd_StrmPlayer.cpp index 51b04a81..0a6f74d1 100644 --- a/src/nw4r/snd/snd_StrmPlayer.cpp +++ b/src/nw4r/snd/snd_StrmPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/StrmPlayer.h" +#include "nw4r/snd/snd_StrmPlayer.h" /* Original source: * kiwi515/ogws @@ -13,36 +13,31 @@ #include <cstring> // std::memcpy #include <decomp.h> -#include <macros.h> // ATTR_UNUSED -#include <types.h> - -#include "nw4r/snd/StrmSound.h" -#include "nw4r/snd/adpcm.h" -#include "nw4r/snd/AxVoice.h" -#include "nw4r/snd/BasicPlayer.h" -#include "nw4r/snd/Channel.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/InstancePool.h" -#include "nw4r/snd/SoundThread.h" -#include "nw4r/snd/StrmChannel.h" -#include "nw4r/snd/StrmFile.h" -#include "nw4r/snd/TaskManager.h" -#include "nw4r/snd/Voice.h" -#include "nw4r/snd/VoiceManager.h" -#include "nw4r/snd/WaveFile.h" - -#include "nw4r/ut/DvdFileStream.h" -#include "nw4r/ut/FileStream.h" -#include "nw4r/ut/inlines.h" -#include "nw4r/ut/Lock.h" -#include "nw4r/ut/RuntimeTypeInfo.h" - -#if 0 -#include <revolution/OS/OSCache.h> -#include <revolution/DVD/dvd.h> -#else -#include <context_rvl.h> -#endif +#include "common.h" + +#include "nw4r/snd/snd_StrmSound.h" +#include "nw4r/snd/snd_adpcm.h" +#include "nw4r/snd/snd_AxVoice.h" +#include "nw4r/snd/snd_BasicPlayer.h" +#include "nw4r/snd/snd_Channel.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_InstancePool.h" +#include "nw4r/snd/snd_SoundThread.h" +#include "nw4r/snd/snd_StrmChannel.h" +#include "nw4r/snd/snd_StrmFile.h" +#include "nw4r/snd/snd_TaskManager.h" +#include "nw4r/snd/snd_Voice.h" +#include "nw4r/snd/snd_VoiceManager.h" +#include "nw4r/snd/snd_WaveFile.h" + +#include "nw4r/ut/ut_DvdFileStream.h" +#include "nw4r/ut/ut_FileStream.h" +#include "nw4r/ut/ut_algorithm.h" +#include "nw4r/ut/ut_Lock.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" + +#include <rvl/OS/OSCache.h> +#include <rvl/DVD/dvd.h> #include "nw4r/NW4RAssert.hpp" @@ -90,7 +85,7 @@ StrmPlayer::~StrmPlayer() StrmPlayer::SetupResult StrmPlayer::Setup(StrmBufferPool *bufferPool, int allocChannelCount, - byte2_t allocTrackFlag, + u16 allocTrackFlag, int voiceOutCount) { SoundThread::AutoLock lock; @@ -103,7 +98,7 @@ StrmPlayer::SetupResult StrmPlayer::Setup(StrmBufferPool *bufferPool, InitParam(); mChannelCount = ut::Min(allocChannelCount, STRM_CHANNEL_NUM); - byte4_t bitMask = allocTrackFlag; + u32 bitMask = allocTrackFlag; int trackIndex; for (trackIndex = 0; bitMask; bitMask >>= 1, trackIndex++) @@ -285,7 +280,7 @@ bool StrmPlayer::Start() return true; } -u32 StrmPlayer::GetSampleByByte(byte4_t byte, SampleFormat format) +u32 StrmPlayer::GetSampleByByte(u32 byte, SampleFormat format) { u32 samples = 0; @@ -1344,7 +1339,7 @@ StrmChannel *StrmPlayer::GetTrackChannel(StrmTrack const &track, return &mChannels[index]; } -void StrmPlayer::SetTrackVolume(byte4_t trackBitFlag, f32 volume) +void StrmPlayer::SetTrackVolume(u32 trackBitFlag, f32 volume) { ut::AutoInterruptLock lock; diff --git a/src/nw4r/snd/snd_StrmSound.cpp b/src/nw4r/snd/snd_StrmSound.cpp index 8c5675ed..480e0957 100644 --- a/src/nw4r/snd/snd_StrmSound.cpp +++ b/src/nw4r/snd/snd_StrmSound.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/StrmSound.h" +#include "nw4r/snd/snd_StrmSound.h" /* Original source: * kiwi515/ogws @@ -9,16 +9,15 @@ * headers */ -#include <macros.h> // ARRAY_LENGTH -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/SoundInstanceManager.h" -#include "nw4r/snd/StrmPlayer.h" -#include "nw4r/snd/StrmSoundHandle.h" -#include "nw4r/snd/MoveValue.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundInstanceManager.h" +#include "nw4r/snd/snd_StrmPlayer.h" +#include "nw4r/snd/snd_StrmSoundHandle.h" +#include "nw4r/snd/snd_MoveValue.h" -#include "nw4r/ut/RuntimeTypeInfo.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" #include "nw4r/NW4RAssert.hpp" @@ -69,7 +68,7 @@ void StrmSound::InitParam() StrmPlayer::SetupResult StrmSound::Setup(StrmBufferPool *bufferPool, int allocChannelCount, - byte2_t allocTrackFlag) + u16 allocTrackFlag) { NW4RAssertPointerNonnull_Line(90, bufferPool); diff --git a/src/nw4r/snd/snd_StrmSoundHandle.cpp b/src/nw4r/snd/snd_StrmSoundHandle.cpp index ff419896..09c687d8 100644 --- a/src/nw4r/snd/snd_StrmSoundHandle.cpp +++ b/src/nw4r/snd/snd_StrmSoundHandle.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/StrmSoundHandle.h" +#include "nw4r/snd/snd_StrmSoundHandle.h" /* Original source: * kiwi515/ogws @@ -9,9 +9,9 @@ * headers */ -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/StrmSound.h" +#include "nw4r/snd/snd_StrmSound.h" /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_Task.cpp b/src/nw4r/snd/snd_Task.cpp index 2e54241e..7f60a639 100644 --- a/src/nw4r/snd/snd_Task.cpp +++ b/src/nw4r/snd/snd_Task.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Task.h" +#include "nw4r/snd/snd_Task.h" /* Original source: * kiwi515/ogws diff --git a/src/nw4r/snd/snd_TaskManager.cpp b/src/nw4r/snd/snd_TaskManager.cpp index 6b324c25..cebd4dfb 100644 --- a/src/nw4r/snd/snd_TaskManager.cpp +++ b/src/nw4r/snd/snd_TaskManager.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/TaskManager.h" +#include "nw4r/snd/snd_TaskManager.h" /* Original source: * kiwi515/ogws @@ -10,18 +10,14 @@ */ #include <decomp.h> -#include <macros.h> // NW4R_RANGE_FOR_NO_AUTO_INC -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/Task.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Task.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock -#if 0 -#include <revolution/OS/OSThread.h> -#else -#include <context_rvl.h> -#endif +#include <rvl/OS/OSThread.h> #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_TaskThread.cpp b/src/nw4r/snd/snd_TaskThread.cpp index 1cb40c79..05543d1f 100644 --- a/src/nw4r/snd/snd_TaskThread.cpp +++ b/src/nw4r/snd/snd_TaskThread.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/TaskThread.h" +#include "nw4r/snd/snd_TaskThread.h" /* Original source: * kiwi515/ogws @@ -9,15 +9,11 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/TaskManager.h" +#include "nw4r/snd/snd_TaskManager.h" -#if 0 -#include <revolution/OS/OSThread.h> -#else -#include <context_rvl.h> -#endif +#include <rvl/OS/OSThread.h> #include "nw4r/NW4RAssert.hpp" @@ -54,7 +50,7 @@ bool TaskThread::Create(s32 priority, void *stack, u32 stackSize) if (!result) return false; - mStackEnd = static_cast<byte4_t *>(stack); + mStackEnd = static_cast<u32 *>(stack); mFinishFlag = false; mCreateFlag = true; diff --git a/src/nw4r/snd/snd_Util.cpp b/src/nw4r/snd/snd_Util.cpp index a697c541..1571ee1a 100644 --- a/src/nw4r/snd/snd_Util.cpp +++ b/src/nw4r/snd/snd_Util.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Util.h" +#include "nw4r/snd/snd_Util.h" /* Original source: * kiwi515/ogws @@ -9,10 +9,9 @@ * headers */ -#include <macros.h> // ARRAY_LENGTH -#include <types.h> +#include "common.h" -#include "nw4r/ut/inlines.h" +#include "nw4r/ut/ut_algorithm.h" #include "nw4r/NW4RAssert.hpp" @@ -607,9 +606,9 @@ namespace nw4r { namespace snd { namespace detail // clang-format off f32 const *Util::PanTableTable[PAN_CURVE_NUM] = { - [PAN_CURVE_SQRT] = Pan2RatioTableSqrt, - [PAN_CURVE_SINCOS] = Pan2RatioTableSinCos, - [PAN_CURVE_LINEAR] = Pan2RatioTableLinear, + /*[PAN_CURVE_SQRT] = */Pan2RatioTableSqrt, + /*[PAN_CURVE_SINCOS] =*/ Pan2RatioTableSinCos, + /*[PAN_CURVE_LINEAR] =*/ Pan2RatioTableLinear, }; // clang-format on }}} // namespace nw4r::snd::detail @@ -745,7 +744,7 @@ u16 Util::CalcRandom() return u >> 16; } -void const *Util::GetDataRefAddressImpl(RefType refType, byte4_t value, +void const *Util::GetDataRefAddressImpl(RefType refType, u32 value, void const *baseAddress) { if (refType == REFTYPE_OFFSET) diff --git a/src/nw4r/snd/snd_Voice.cpp b/src/nw4r/snd/snd_Voice.cpp index 498cf8b3..dde56c19 100644 --- a/src/nw4r/snd/snd_Voice.cpp +++ b/src/nw4r/snd/snd_Voice.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/Voice.h" +#include "nw4r/snd/snd_Voice.h" /* Original source: * kiwi515/ogws @@ -10,26 +10,21 @@ */ #include <decomp.h> -#include <macros.h> -#include <types.h> - -#include "nw4r/snd/AxManager.h" -#include "nw4r/snd/AxVoiceManager.h" -#include "nw4r/snd/AxVoice.h" -#include "nw4r/snd/adpcm.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Util.h" -#include "nw4r/snd/VoiceManager.h" -#include "nw4r/snd/WaveFile.h" - -#include "nw4r/ut/inlines.h" -#include "nw4r/ut/Lock.h" - -#if 0 -#include <revolution/AX/AXAlloc.h> // AX_MAX_VOLUME -#else -#include <context_rvl.h> -#endif +#include "common.h" + +#include "nw4r/snd/snd_AxManager.h" +#include "nw4r/snd/snd_AxVoiceManager.h" +#include "nw4r/snd/snd_AxVoice.h" +#include "nw4r/snd/snd_adpcm.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Util.h" +#include "nw4r/snd/snd_VoiceManager.h" +#include "nw4r/snd/snd_WaveFile.h" + +#include "nw4r/ut/ut_algorithm.h" +#include "nw4r/ut/ut_Lock.h" + +#include <rvl/AX/AXAlloc.h> // AX_MAX_VOLUME #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_VoiceManager.cpp b/src/nw4r/snd/snd_VoiceManager.cpp index 720c5c03..5e9cae1e 100644 --- a/src/nw4r/snd/snd_VoiceManager.cpp +++ b/src/nw4r/snd/snd_VoiceManager.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/VoiceManager.h" +#include "nw4r/snd/snd_VoiceManager.h" /* Original source: * kiwi515/ogws @@ -11,13 +11,12 @@ #include <new> -#include <macros.h> // NW4R_RANGE_FOR_NO_AUTO_INC -#include <types.h> +#include "common.h" -#include "nw4r/snd/DisposeCallbackManager.h" -#include "nw4r/snd/Voice.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_Voice.h" -#include "nw4r/ut/Lock.h" // ut::AutoInterruptLock +#include "nw4r/ut/ut_Lock.h" // ut::AutoInterruptLock #include "nw4r/NW4RAssert.hpp" @@ -225,7 +224,7 @@ void VoiceManager::UpdateEachVoicePriority( } } -void VoiceManager::UpdateAllVoicesSync(byte4_t syncFlag) +void VoiceManager::UpdateAllVoicesSync(u32 syncFlag) { ut::AutoInterruptLock lock; diff --git a/src/nw4r/snd/snd_WaveArchive.cpp b/src/nw4r/snd/snd_WaveArchive.cpp index 9d351503..e3255fe6 100644 --- a/src/nw4r/snd/snd_WaveArchive.cpp +++ b/src/nw4r/snd/snd_WaveArchive.cpp @@ -1,16 +1,16 @@ -#include "nw4r/snd/WaveArchive.h" +#include "nw4r/snd/snd_WaveArchive.h" /******************************************************************************* * headers */ -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/Util.h" -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_Util.h" +#include "nw4r/snd/snd_WaveFile.h" #include "nw4r/ut/binaryFileFormat.h" // ut::BinaryFileHeader -#include "nw4r/ut/inlines.h" // ut::AddOffsetToPtr +#include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr #include <nw4r/NW4RAssert.hpp> diff --git a/src/nw4r/snd/snd_WaveFile.cpp b/src/nw4r/snd/snd_WaveFile.cpp index 0501d052..0cf73612 100644 --- a/src/nw4r/snd/snd_WaveFile.cpp +++ b/src/nw4r/snd/snd_WaveFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_WaveFile.h" /* Original source: * kiwi515/ogws @@ -9,14 +9,14 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/AxVoice.h" -#include "nw4r/snd/Channel.h" -#include "nw4r/snd/global.h" +#include "nw4r/snd/snd_AxVoice.h" +#include "nw4r/snd/snd_Channel.h" +#include "nw4r/snd/snd_global.h" -#include "nw4r/ut/inlines.h" // ut::AddOffsetToPtr -#include "nw4r/ut/binaryFileFormat.h" +#include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr +#include "nw4r/ut/ut_binaryFileFormat.h" #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_WaveSound.cpp b/src/nw4r/snd/snd_WaveSound.cpp index 5ac7eb7f..345500a2 100644 --- a/src/nw4r/snd/snd_WaveSound.cpp +++ b/src/nw4r/snd/snd_WaveSound.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/WaveSound.h" +#include "nw4r/snd/snd_WaveSound.h" /* Original source: * kiwi515/ogws @@ -9,14 +9,14 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/SoundInstanceManager.h" -#include "nw4r/snd/WaveSoundHandle.h" -#include "nw4r/snd/WsdPlayer.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundInstanceManager.h" +#include "nw4r/snd/snd_WaveSoundHandle.h" +#include "nw4r/snd/snd_WsdPlayer.h" -#include "nw4r/ut/RuntimeTypeInfo.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" #include "nw4r/NW4RAssert.hpp" @@ -49,7 +49,7 @@ WaveSound::WaveSound(SoundInstanceManager<WaveSound> *manager, int priority, bool WaveSound::Prepare(void const *waveSoundBase, s32 waveSoundOffset, WsdPlayer::StartOffsetType startOffsetType, s32 offset, WsdPlayer::WsdCallback const *callback, - register_t callbackData) + u32 callbackData) { NW4RAssertPointerNonnull_Line(74, waveSoundBase); NW4RAssertPointerNonnull_Line(75, callback); diff --git a/src/nw4r/snd/snd_WaveSoundHandle.cpp b/src/nw4r/snd/snd_WaveSoundHandle.cpp index cb032182..4d1774f1 100644 --- a/src/nw4r/snd/snd_WaveSoundHandle.cpp +++ b/src/nw4r/snd/snd_WaveSoundHandle.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/WaveSoundHandle.h" +#include "nw4r/snd/snd_WaveSoundHandle.h" /* Original source: * kiwi515/ogws @@ -9,13 +9,13 @@ * headers */ -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/BasicSound.h" -#include "nw4r/snd/SoundHandle.h" -#include "nw4r/snd/WaveSound.h" +#include "nw4r/snd/snd_BasicSound.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_WaveSound.h" -#include "nw4r/ut/RuntimeTypeInfo.h" // ut::DynamicCast +#include "nw4r/ut/ut_RuntimeTypeInfo.h" // ut::DynamicCast #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_WsdFile.cpp b/src/nw4r/snd/snd_WsdFile.cpp index b8f22d37..a33421f8 100644 --- a/src/nw4r/snd/snd_WsdFile.cpp +++ b/src/nw4r/snd/snd_WsdFile.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/WsdFile.h" +#include "nw4r/snd/snd_WsdFile.h" /* Original source: * kiwi515/ogws @@ -9,15 +9,14 @@ * headers */ -#include <macros.h> // NW4R_FILE_VERSION -#include <types.h> // nullptr +#include "common.h" // nullptr -#include "nw4r/snd/Util.h" // Util::GetDataRefAddress0 -#include "nw4r/snd/WaveFile.h" -#include "nw4r/snd/WaveArchive.h" // WaveArchiveReader +#include "nw4r/snd/snd_Util.h" // Util::GetDataRefAddress0 +#include "nw4r/snd/snd_WaveFile.h" +#include "nw4r/snd/snd_WaveArchive.h" // WaveArchiveReader -#include "nw4r/ut/binaryFileFormat.h" // ut::BinaryFileHeader -#include "nw4r/ut/inlines.h" // ut::AddOffsetToPtr +#include "nw4r/ut/ut_binaryFileFormat.h" // ut::BinaryFileHeader +#include "nw4r/ut/ut_algorithm.h" // ut::AddOffsetToPtr #include "nw4r/NW4RAssert.hpp" diff --git a/src/nw4r/snd/snd_WsdPlayer.cpp b/src/nw4r/snd/snd_WsdPlayer.cpp index d6b9fea7..c7f60adc 100644 --- a/src/nw4r/snd/snd_WsdPlayer.cpp +++ b/src/nw4r/snd/snd_WsdPlayer.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/WsdPlayer.h" +#include "nw4r/snd/snd_WsdPlayer.h" /* Original source: * kiwi515/ogws @@ -9,17 +9,17 @@ * headers */ -#include <types.h> +#include "common.h" -#include "nw4r/snd/BasicPlayer.h" -#include "nw4r/snd/Channel.h" -#include "nw4r/snd/DisposeCallbackManager.h" -#include "nw4r/snd/global.h" -#include "nw4r/snd/Voice.h" -#include "nw4r/snd/SoundThread.h" -#include "nw4r/snd/WaveFile.h" +#include "nw4r/snd/snd_BasicPlayer.h" +#include "nw4r/snd/snd_Channel.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_global.h" +#include "nw4r/snd/snd_Voice.h" +#include "nw4r/snd/snd_SoundThread.h" +#include "nw4r/snd/snd_WaveFile.h" -#include "nw4r/ut/inlines.h" // ut::Min +#include "nw4r/ut/ut_algorithm.h" // ut::Min #include "nw4r/NW4RAssert.hpp" @@ -35,7 +35,7 @@ WsdPlayer::WsdPlayer() : } void WsdPlayer::InitParam(int voiceOutCount, WsdCallback const *callback, - register_t callbackData) + u32 callbackData) { BasicPlayer::InitParam(); @@ -66,7 +66,7 @@ void WsdPlayer::InitParam(int voiceOutCount, WsdCallback const *callback, bool WsdPlayer::Prepare(void const *waveSoundBase, int index, StartOffsetType startOffsetType, int startOffset, int voiceOutCount, WsdCallback const *callback, - register_t callbackData) + u32 callbackData) { SoundThread::AutoLock lock; @@ -202,7 +202,7 @@ void WsdPlayer::Update() } bool WsdPlayer::StartChannel(WsdCallback const *callback, - register_t callbackData) + u32 callbackData) { SoundThread::AutoLock lock; @@ -234,7 +234,7 @@ bool WsdPlayer::StartChannel(WsdCallback const *callback, Channel *channel = Channel::AllocChannel( ut::Min(waveData.numChannels, Channel::CHANNEL_MAX), GetVoiceOutCount(), - priority, ChannelCallbackFunc, reinterpret_cast<register_t>(this)); + priority, ChannelCallbackFunc, reinterpret_cast<u32>(this)); if (!channel) return false; @@ -357,7 +357,7 @@ void WsdPlayer::UpdateChannel() void WsdPlayer::ChannelCallbackFunc(Channel *dropChannel, Channel::ChannelCallbackStatus status, - register_t userData) + u32 userData) { SoundThread::AutoLock lock; diff --git a/src/nw4r/snd/snd_adpcm.cpp b/src/nw4r/snd/snd_adpcm.cpp index 433e8467..04f7d55a 100644 --- a/src/nw4r/snd/snd_adpcm.cpp +++ b/src/nw4r/snd/snd_adpcm.cpp @@ -1,4 +1,4 @@ -#include "nw4r/snd/adpcm.h" +#include "nw4r/snd/snd_adpcm.h" /* Original source: * kiwi515/ogws @@ -11,13 +11,9 @@ #include <climits> -#include <types.h> +#include "common.h" -#if 0 -#include <revolution/AX/AXVPB.h> // AXPBADPCM -#else -#include <context_rvl.h> -#endif +#include <rvl/AX/AXVPB.h> // AXPBADPCM /******************************************************************************* * functions diff --git a/src/nw4r/snd/snd_debug.cpp b/src/nw4r/snd/snd_debug.cpp index fbd4d3f9..d87a1556 100644 --- a/src/nw4r/snd/snd_debug.cpp +++ b/src/nw4r/snd/snd_debug.cpp @@ -1,10 +1,10 @@ -#include "nw4r/snd/debug.h" +#include "nw4r/snd/snd_debug.h" /******************************************************************************* * headers */ -#include <types.h> // byte4_t +#include "common.h" // u32 #include <nw4r/NW4RAssert.hpp> @@ -40,7 +40,7 @@ namespace nw4r { namespace snd { namespace namespace nw4r { namespace snd { namespace { - byte4_t GetWarningBitFlag(DebugWarningFlag warning); + u32 GetWarningBitFlag(DebugWarningFlag warning); }}} // namespace nw4r::snd::(unnamed) /******************************************************************************* @@ -49,7 +49,7 @@ namespace nw4r { namespace snd { namespace namespace nw4r { namespace snd { namespace { - byte4_t gWarningFlag = DEBUG_WARNING_BIT_FLAG_NOT_ENOUGH_INSTANCE; + u32 gWarningFlag = DEBUG_WARNING_BIT_FLAG_NOT_ENOUGH_INSTANCE; }}} // namespace nw4r::snd::(unnamed) /******************************************************************************* @@ -62,7 +62,7 @@ namespace detail { bool Debug_GetWarningFlag(DebugWarningFlag warning) { - byte4_t bitFlag = GetWarningBitFlag(warning); + u32 bitFlag = GetWarningBitFlag(warning); return (gWarningFlag & bitFlag) == bitFlag; } @@ -109,9 +109,9 @@ char const *Debug_GetSoundTypeString(DebugSoundType type) namespace { -byte4_t GetWarningBitFlag(DebugWarningFlag warning) +u32 GetWarningBitFlag(DebugWarningFlag warning) { - byte4_t bitFlag = 0; + u32 bitFlag = 0; switch (warning) { diff --git a/src/nw4r/ut/ut_ResFont.cpp b/src/nw4r/ut/ut_ResFont.cpp index 3323afb5..589ec9ec 100644 --- a/src/nw4r/ut/ut_ResFont.cpp +++ b/src/nw4r/ut/ut_ResFont.cpp @@ -34,7 +34,7 @@ bool ResFont::SetResource(void *buffer) { return false; } - if (header->magic == MAGIC_UNPACKED) { + if (header->signature == MAGIC_UNPACKED) { BinaryBlockHeader *block = reinterpret_cast<BinaryBlockHeader *>(reinterpret_cast<char *>(header) + header->headerSize); @@ -115,7 +115,7 @@ FontInformation *ResFont::Rebuild(BinaryFileHeader *header) { block = reinterpret_cast<BinaryBlockHeader *>(reinterpret_cast<char *>(block) + block->length); } - header->magic = MAGIC_UNPACKED; + header->signature = MAGIC_UNPACKED; return info; } diff --git a/src/nw4r/ut/ut_binaryFileFormat.cpp b/src/nw4r/ut/ut_binaryFileFormat.cpp index 30e6a89d..9b5f9181 100644 --- a/src/nw4r/ut/ut_binaryFileFormat.cpp +++ b/src/nw4r/ut/ut_binaryFileFormat.cpp @@ -5,7 +5,7 @@ namespace ut { /* 8042a9e0 */ bool IsValidBinaryFile(const BinaryFileHeader *header, u32 magic, u16 version, u16 numBlocks) { - if (header->magic != magic) { + if (header->signature != magic) { return false; } if (header->byteOrder != 0xFEFF) { diff --git a/src/toBeSorted/nand_request_thread.cpp b/src/toBeSorted/nand_request_thread.cpp index ac506a09..286a522f 100644 --- a/src/toBeSorted/nand_request_thread.cpp +++ b/src/toBeSorted/nand_request_thread.cpp @@ -74,7 +74,7 @@ NandRequestWrite *NandRequestThread::writeRequest(const char *filePath, void *da } bool NandRequestThread::waitForMessage() { - return OSReceiveMessage(&mMessageQueue, nullptr, OS_MSG_PERSISTENT); + return OSReceiveMessage(&mMessageQueue, nullptr, OS_MESSAGE_FLAG_PERSISTENT); } void NandRequestThread::sendMessage() { |
