From 732a119127b8a5d53092c16f12a37b47e8248fd1 Mon Sep 17 00:00:00 2001 From: Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:55:25 -0400 Subject: [PATCH] Nw4r splits (#28) * snd / math / g3d --- config/SOUE01/splits.txt | 389 +++++ config/SOUE01/symbols.txt | 1291 ++++++++--------- configure.py | 157 +- include/MSL_C/climits | 4 + include/common.h | 3 + include/libc.h | 4 +- include/nw4r/g3d/g3d_anmshp.h | 2 +- include/nw4r/snd.h | 57 + include/nw4r/snd/snd_AxManager.h | 68 +- include/nw4r/snd/snd_AxVoice.h | 131 +- include/nw4r/snd/snd_AxVoiceManager.h | 37 +- include/nw4r/snd/snd_AxfxImpl.h | 22 +- include/nw4r/snd/snd_Bank.h | 57 +- include/nw4r/snd/snd_BankFile.h | 162 ++- include/nw4r/snd/snd_BasicPlayer.h | 19 +- include/nw4r/snd/snd_BasicSound.h | 194 +-- include/nw4r/snd/snd_Channel.h | 315 ++-- include/nw4r/snd/snd_ChannelManager.h | 37 +- include/nw4r/snd/snd_Common.h | 27 + include/nw4r/snd/snd_DisposeCallback.h | 24 +- include/nw4r/snd/snd_DisposeCallbackManager.h | 27 +- include/nw4r/snd/snd_DvdSoundArchive.h | 104 +- include/nw4r/snd/snd_EnvGenerator.h | 27 +- include/nw4r/snd/snd_ExternalSoundPlayer.h | 39 +- include/nw4r/snd/snd_FrameHeap.h | 107 +- include/nw4r/snd/snd_FxBase.h | 37 +- include/nw4r/snd/snd_FxChorus.h | 49 +- include/nw4r/snd/snd_FxDelay.h | 51 +- include/nw4r/snd/snd_FxReverbHi.h | 57 +- include/nw4r/snd/snd_FxReverbHiDpl2.h | 54 + include/nw4r/snd/snd_InstancePool.h | 85 +- include/nw4r/snd/snd_Lfo.h | 30 +- include/nw4r/snd/snd_MemorySoundArchive.h | 73 +- include/nw4r/snd/snd_MmlParser.h | 159 +- include/nw4r/snd/snd_MmlSeqTrack.h | 42 +- include/nw4r/snd/snd_MmlSeqTrackAllocator.h | 37 +- include/nw4r/snd/snd_MoveValue.h | 4 +- include/nw4r/snd/snd_NandSoundArchive.h | 101 +- include/nw4r/snd/snd_NoteOn.h | 29 - include/nw4r/snd/snd_NoteOnCallback.h | 38 + include/nw4r/snd/snd_PlayerHeap.h | 38 +- include/nw4r/snd/snd_RemoteSpeaker.h | 117 +- include/nw4r/snd/snd_RemoteSpeakerManager.h | 74 +- include/nw4r/snd/snd_SeqFile.h | 47 +- include/nw4r/snd/snd_SeqPlayer.h | 246 ++-- include/nw4r/snd/snd_SeqSound.h | 169 ++- include/nw4r/snd/snd_SeqSoundHandle.h | 46 +- include/nw4r/snd/snd_SeqTrack.h | 220 +-- include/nw4r/snd/snd_SeqTrackAllocator.h | 26 + include/nw4r/snd/snd_Sound3DActor.h | 76 +- include/nw4r/snd/snd_Sound3DListener.h | 45 +- include/nw4r/snd/snd_Sound3DManager.h | 128 +- include/nw4r/snd/snd_SoundActor.h | 115 +- include/nw4r/snd/snd_SoundArchive.h | 203 +-- include/nw4r/snd/snd_SoundArchiveFile.h | 407 +++--- include/nw4r/snd/snd_SoundArchiveLoader.h | 59 +- include/nw4r/snd/snd_SoundArchivePlayer.h | 226 ++- include/nw4r/snd/snd_SoundHandle.h | 101 +- include/nw4r/snd/snd_SoundHeap.h | 55 +- include/nw4r/snd/snd_SoundInstanceManager.h | 133 +- include/nw4r/snd/snd_SoundMemoryAllocatable.h | 14 +- include/nw4r/snd/snd_SoundPlayer.h | 118 +- include/nw4r/snd/snd_SoundStartable.h | 127 +- include/nw4r/snd/snd_SoundSystem.h | 73 +- include/nw4r/snd/snd_SoundThread.h | 115 +- include/nw4r/snd/snd_StrmChannel.h | 51 +- include/nw4r/snd/snd_StrmFile.h | 161 ++ include/nw4r/snd/snd_StrmPlayer.h | 241 ++- include/nw4r/snd/snd_StrmSound.h | 86 +- include/nw4r/snd/snd_StrmSoundHandle.h | 25 +- include/nw4r/snd/snd_Task.h | 27 +- include/nw4r/snd/snd_TaskManager.h | 72 +- include/nw4r/snd/snd_TaskThread.h | 29 +- include/nw4r/snd/snd_Util.h | 107 +- include/nw4r/snd/snd_Voice.h | 203 ++- include/nw4r/snd/snd_VoiceManager.h | 50 +- include/nw4r/snd/snd_WaveFile.h | 86 +- include/nw4r/snd/snd_WaveSound.h | 82 +- include/nw4r/snd/snd_WaveSoundHandle.h | 27 +- include/nw4r/snd/snd_WsdFile.h | 133 ++ include/nw4r/snd/snd_WsdPlayer.h | 155 +- include/nw4r/snd/snd_adpcm.h | 3 +- include/nw4r/ut/ut_FileStream.h | 4 +- include/nw4r/ut/ut_algorithm.h | 62 +- include/rvl/MEM.h | 10 +- include/rvl/MEM/mem_expHeap.h | 4 + include/rvl/MEM/mem_frameHeap.h | 10 +- include/rvl/MEM/mem_heapCommon.h | 14 +- include/rvl/WENC.h | 12 + include/rvl/WENC/wenc.h | 28 + src/nw4r/snd/snd_AnimSound.cpp | 1 + src/nw4r/snd/snd_AxManager.cpp | 1 + src/nw4r/snd/snd_AxVoice.cpp | 1 + src/nw4r/snd/snd_AxVoiceManager.cpp | 1 + src/nw4r/snd/snd_AxfxImpl.cpp | 1 + src/nw4r/snd/snd_Bank.cpp | 1 + src/nw4r/snd/snd_BankFile.cpp | 1 + src/nw4r/snd/snd_BasicPlayer.cpp | 1 + src/nw4r/snd/snd_BasicSound.cpp | 1 + src/nw4r/snd/snd_BiquadFilterPreset.cpp | 1 + src/nw4r/snd/snd_Channel.cpp | 1 + src/nw4r/snd/snd_DisposeCallbackManager.cpp | 1 + src/nw4r/snd/snd_DvdSoundArchive.cpp | 1 + src/nw4r/snd/snd_EnvGenerator.cpp | 1 + src/nw4r/snd/snd_ExternalSoundPlayer.cpp | 1 + src/nw4r/snd/snd_FrameHeap.cpp | 1 + src/nw4r/snd/snd_FxBase.cpp | 1 + src/nw4r/snd/snd_FxChorus.cpp | 1 + src/nw4r/snd/snd_FxDelay.cpp | 1 + src/nw4r/snd/snd_FxReverbHi.cpp | 1 + src/nw4r/snd/snd_FxReverbHiDpl2.cpp | 1 + src/nw4r/snd/snd_FxReverbStd.cpp | 1 + src/nw4r/snd/snd_FxReverbStdDpl2.cpp | 1 + src/nw4r/snd/snd_InstancePool.cpp | 1 + src/nw4r/snd/snd_Lfo.cpp | 1 + src/nw4r/snd/snd_MemorySoundArchive.cpp | 1 + src/nw4r/snd/snd_MidiSeqPlayer.cpp | 1 + src/nw4r/snd/snd_MmlParser.cpp | 1 + src/nw4r/snd/snd_MmlSeqTrack.cpp | 1 + src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp | 1 + src/nw4r/snd/snd_NandSoundArchive.cpp | 1 + src/nw4r/snd/snd_PlayerHeap.cpp | 1 + src/nw4r/snd/snd_RemoteSpeaker.cpp | 1 + src/nw4r/snd/snd_RemoteSpeakerManager.cpp | 1 + src/nw4r/snd/snd_SeqFile.cpp | 1 + src/nw4r/snd/snd_SeqPlayer.cpp | 1 + src/nw4r/snd/snd_SeqSound.cpp | 1 + src/nw4r/snd/snd_SeqSoundHandle.cpp | 1 + src/nw4r/snd/snd_SeqTrack.cpp | 1 + src/nw4r/snd/snd_Sound3DActor.cpp | 1 + src/nw4r/snd/snd_Sound3DCalculator.cpp | 1 + src/nw4r/snd/snd_Sound3DEngine.cpp | 1 + src/nw4r/snd/snd_Sound3DListener.cpp | 1 + src/nw4r/snd/snd_Sound3DManager.cpp | 1 + src/nw4r/snd/snd_SoundActor.cpp | 1 + src/nw4r/snd/snd_SoundArchive.cpp | 1 + src/nw4r/snd/snd_SoundArchiveFile.cpp | 1 + src/nw4r/snd/snd_SoundArchiveLoader.cpp | 1 + src/nw4r/snd/snd_SoundArchivePlayer.cpp | 1 + src/nw4r/snd/snd_SoundHandle.cpp | 1 + src/nw4r/snd/snd_SoundHeap.cpp | 1 + src/nw4r/snd/snd_SoundPlayer.cpp | 1 + src/nw4r/snd/snd_SoundStartable.cpp | 1 + src/nw4r/snd/snd_SoundSystem.cpp | 1 + src/nw4r/snd/snd_SoundThread.cpp | 1 + src/nw4r/snd/snd_StrmChannel.cpp | 1 + src/nw4r/snd/snd_StrmFile.cpp | 1 + src/nw4r/snd/snd_StrmPlayer.cpp | 1 + src/nw4r/snd/snd_StrmSound.cpp | 1 + src/nw4r/snd/snd_StrmSoundHandle.cpp | 1 + src/nw4r/snd/snd_Task.cpp | 1 + src/nw4r/snd/snd_TaskManager.cpp | 1 + src/nw4r/snd/snd_TaskThread.cpp | 1 + src/nw4r/snd/snd_Util.cpp | 1 + src/nw4r/snd/snd_Voice.cpp | 1 + src/nw4r/snd/snd_VoiceManager.cpp | 1 + src/nw4r/snd/snd_WaveArchive.cpp | 1 + src/nw4r/snd/snd_WaveFile.cpp | 1 + src/nw4r/snd/snd_WaveSound.cpp | 1 + src/nw4r/snd/snd_WaveSoundHandle.cpp | 1 + src/nw4r/snd/snd_WsdFile.cpp | 1 + src/nw4r/snd/snd_WsdPlayer.cpp | 1 + src/nw4r/snd/snd_adpcm.cpp | 1 + src/nw4r/snd/snd_debug.cpp | 1 + src/nw4r/ut/ut_DvdFileStream.cpp | 4 +- src/nw4r/ut/ut_FileStream.cpp | 6 +- src/nw4r/ut/ut_NandFileStream.cpp | 4 +- 167 files changed, 6183 insertions(+), 2715 deletions(-) create mode 100644 include/MSL_C/climits create mode 100644 include/nw4r/snd/snd_FxReverbHiDpl2.h delete mode 100644 include/nw4r/snd/snd_NoteOn.h create mode 100644 include/nw4r/snd/snd_NoteOnCallback.h create mode 100644 include/nw4r/snd/snd_SeqTrackAllocator.h create mode 100644 include/nw4r/snd/snd_StrmFile.h create mode 100644 include/nw4r/snd/snd_WsdFile.h create mode 100644 include/rvl/WENC.h create mode 100644 include/rvl/WENC/wenc.h create mode 100644 src/nw4r/snd/snd_AnimSound.cpp create mode 100644 src/nw4r/snd/snd_AxManager.cpp create mode 100644 src/nw4r/snd/snd_AxVoice.cpp create mode 100644 src/nw4r/snd/snd_AxVoiceManager.cpp create mode 100644 src/nw4r/snd/snd_AxfxImpl.cpp create mode 100644 src/nw4r/snd/snd_Bank.cpp create mode 100644 src/nw4r/snd/snd_BankFile.cpp create mode 100644 src/nw4r/snd/snd_BasicPlayer.cpp create mode 100644 src/nw4r/snd/snd_BasicSound.cpp create mode 100644 src/nw4r/snd/snd_BiquadFilterPreset.cpp create mode 100644 src/nw4r/snd/snd_Channel.cpp create mode 100644 src/nw4r/snd/snd_DisposeCallbackManager.cpp create mode 100644 src/nw4r/snd/snd_DvdSoundArchive.cpp create mode 100644 src/nw4r/snd/snd_EnvGenerator.cpp create mode 100644 src/nw4r/snd/snd_ExternalSoundPlayer.cpp create mode 100644 src/nw4r/snd/snd_FrameHeap.cpp create mode 100644 src/nw4r/snd/snd_FxBase.cpp create mode 100644 src/nw4r/snd/snd_FxChorus.cpp create mode 100644 src/nw4r/snd/snd_FxDelay.cpp create mode 100644 src/nw4r/snd/snd_FxReverbHi.cpp create mode 100644 src/nw4r/snd/snd_FxReverbHiDpl2.cpp create mode 100644 src/nw4r/snd/snd_FxReverbStd.cpp create mode 100644 src/nw4r/snd/snd_FxReverbStdDpl2.cpp create mode 100644 src/nw4r/snd/snd_InstancePool.cpp create mode 100644 src/nw4r/snd/snd_Lfo.cpp create mode 100644 src/nw4r/snd/snd_MemorySoundArchive.cpp create mode 100644 src/nw4r/snd/snd_MidiSeqPlayer.cpp create mode 100644 src/nw4r/snd/snd_MmlParser.cpp create mode 100644 src/nw4r/snd/snd_MmlSeqTrack.cpp create mode 100644 src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp create mode 100644 src/nw4r/snd/snd_NandSoundArchive.cpp create mode 100644 src/nw4r/snd/snd_PlayerHeap.cpp create mode 100644 src/nw4r/snd/snd_RemoteSpeaker.cpp create mode 100644 src/nw4r/snd/snd_RemoteSpeakerManager.cpp create mode 100644 src/nw4r/snd/snd_SeqFile.cpp create mode 100644 src/nw4r/snd/snd_SeqPlayer.cpp create mode 100644 src/nw4r/snd/snd_SeqSound.cpp create mode 100644 src/nw4r/snd/snd_SeqSoundHandle.cpp create mode 100644 src/nw4r/snd/snd_SeqTrack.cpp create mode 100644 src/nw4r/snd/snd_Sound3DActor.cpp create mode 100644 src/nw4r/snd/snd_Sound3DCalculator.cpp create mode 100644 src/nw4r/snd/snd_Sound3DEngine.cpp create mode 100644 src/nw4r/snd/snd_Sound3DListener.cpp create mode 100644 src/nw4r/snd/snd_Sound3DManager.cpp create mode 100644 src/nw4r/snd/snd_SoundActor.cpp create mode 100644 src/nw4r/snd/snd_SoundArchive.cpp create mode 100644 src/nw4r/snd/snd_SoundArchiveFile.cpp create mode 100644 src/nw4r/snd/snd_SoundArchiveLoader.cpp create mode 100644 src/nw4r/snd/snd_SoundArchivePlayer.cpp create mode 100644 src/nw4r/snd/snd_SoundHandle.cpp create mode 100644 src/nw4r/snd/snd_SoundHeap.cpp create mode 100644 src/nw4r/snd/snd_SoundPlayer.cpp create mode 100644 src/nw4r/snd/snd_SoundStartable.cpp create mode 100644 src/nw4r/snd/snd_SoundSystem.cpp create mode 100644 src/nw4r/snd/snd_SoundThread.cpp create mode 100644 src/nw4r/snd/snd_StrmChannel.cpp create mode 100644 src/nw4r/snd/snd_StrmFile.cpp create mode 100644 src/nw4r/snd/snd_StrmPlayer.cpp create mode 100644 src/nw4r/snd/snd_StrmSound.cpp create mode 100644 src/nw4r/snd/snd_StrmSoundHandle.cpp create mode 100644 src/nw4r/snd/snd_Task.cpp create mode 100644 src/nw4r/snd/snd_TaskManager.cpp create mode 100644 src/nw4r/snd/snd_TaskThread.cpp create mode 100644 src/nw4r/snd/snd_Util.cpp create mode 100644 src/nw4r/snd/snd_Voice.cpp create mode 100644 src/nw4r/snd/snd_VoiceManager.cpp create mode 100644 src/nw4r/snd/snd_WaveArchive.cpp create mode 100644 src/nw4r/snd/snd_WaveFile.cpp create mode 100644 src/nw4r/snd/snd_WaveSound.cpp create mode 100644 src/nw4r/snd/snd_WaveSoundHandle.cpp create mode 100644 src/nw4r/snd/snd_WsdFile.cpp create mode 100644 src/nw4r/snd/snd_WsdPlayer.cpp create mode 100644 src/nw4r/snd/snd_adpcm.cpp create mode 100644 src/nw4r/snd/snd_debug.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 8c2101d8..16976461 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -556,6 +556,395 @@ nw4r/db/db_assert.cpp: .text start:0x804373C0 end:0x804373D0 .sbss start:0x80576610 end:0x80576618 +nw4r/math/math_arithmetic.cpp: + .text start:0x804373D0 end:0x804375AC + +nw4r/math/math_triangular.cpp: + .text start:0x804375B0 end:0x804378D0 + +nw4r/math/math_types.cpp: + .text start:0x804378D0 end:0x80437D34 + +nw4r/math/math_geometry.cpp: + .text start:0x80437D40 end:0x80438F4C + +nw4r/g3d/res/g3d_rescommon.cpp: + .text start:0x80438F50 end:0x804390F4 + +nw4r/g3d/res/g3d_resdict.cpp: + .text start:0x80439100 end:0x80439420 + +nw4r/g3d/res/g3d_resfile.cpp: + .text start:0x80439420 end:0x80439FC4 + +nw4r/g3d/res/g3d_resmdl.cpp: + .text start:0x80439FD0 end:0x8043B244 + +nw4r/g3d/res/g3d_resshp.cpp: + .text start:0x8043B250 end:0x8043BD48 + +nw4r/g3d/res/g3d_restev.cpp: + .text start:0x8043BD50 end:0x8043C2B8 + +nw4r/g3d/res/g3d_resmat.cpp: + .text start:0x8043C2C0 end:0x8043E17C + +nw4r/g3d/res/g3d_resvtx.cpp: + .text start:0x8043E180 end:0x8043E5B8 + +nw4r/g3d/res/g3d_restex.cpp: + .text start:0x8043E5C0 end:0x8043E74C + +nw4r/g3d/res/g3d_resnode.cpp: + .text start:0x8043E750 end:0x8043EA58 + +nw4r/g3d/res/g3d_resanm.cpp: + .text start:0x8043EA60 end:0x8043ECB8 + +nw4r/g3d/res/g3d_resanmvis.cpp: + .text start:0x8043ECC0 end:0x8043EDE0 + +nw4r/g3d/res/g3d_resanmclr.cpp: + .text start:0x8043EDE0 end:0x8043EF4C + +nw4r/g3d/res/g3d_resanmtexpat.cpp: + .text start:0x8043EF50 end:0x8043F320 + +nw4r/g3d/res/g3d_resanmtexsrt.cpp: + .text start:0x8043F320 end:0x8043F734 + +nw4r/g3d/res/g3d_resanmchr.cpp: + .text start:0x8043F740 end:0x804419EC + +nw4r/g3d/res/g3d_reslightset.cpp: + .text start:0x804419F0 end:0x80441B5C + +nw4r/g3d/res/g3d_resanmamblight.cpp: + .text start:0x80441B60 end:0x80441C30 + +nw4r/g3d/res/g3d_resanmlight.cpp: + .text start:0x80441C30 end:0x80442018 + +nw4r/g3d/res/g3d_resanmcamera.cpp: + .text start:0x80442020 end:0x80442330 + +nw4r/g3d/res/g3d_resanmscn.cpp: + .text start:0x80442330 end:0x8044297C + +nw4r/g3d/res/g3d_resanmshp.cpp: + .text start:0x80442980 end:0x80442AE8 + +nw4r/g3d/g3d_transform.cpp: + .text start:0x80442AF0 end:0x80442DF4 + +nw4r/g3d/g3d_anmvis.cpp: + .text start:0x80442E00 end:0x8044358C + +nw4r/g3d/g3d_anmclr.cpp: + .text start:0x80443590 end:0x80444D5C + +nw4r/g3d/g3d_anmtexpat.cpp: + .text start:0x80444D60 end:0x8044635C + +nw4r/g3d/g3d_anmtexsrt.cpp: + .text start:0x80446360 end:0x804479AC + +nw4r/g3d/g3d_anmchr.cpp: + .text start:0x804479B0 end:0x804499CC + +nw4r/g3d/g3d_anmshp.cpp: + .text start:0x804499D0 end:0x8044A3BC + +nw4r/g3d/g3d_anmscn.cpp: + .text start:0x8044A3C0 end:0x8044A6E8 + +nw4r/g3d/g3d_obj.cpp: + .text start:0x8044A6F0 end:0x8044A85C + +nw4r/g3d/g3d_anmobj.cpp: + .text start:0x8044A860 end:0x8044A928 + +nw4r/g3d/platform/g3d_gpu.cpp: + .text start:0x8044A930 end:0x8044AE50 + +nw4r/g3d/platform/g3d_tmem.cpp: + .text start:0x8044AE50 end:0x8044B1B0 + +nw4r/g3d/platform/g3d_cpu.cpp: + .text start:0x8044B1B0 end:0x8044B35C + +nw4r/g3d/g3d_state.cpp: + .text start:0x8044B360 end:0x8044EAB0 + .ctors start:0x804DB954 end:0x804DB958 + +nw4r/g3d/g3d_draw1mat1shp.cpp: + .text start:0x8044EAB0 end:0x8044F7F4 + +nw4r/g3d/g3d_calcview.cpp: + .text start:0x8044F800 end:0x80451A9C + +nw4r/g3d/g3d_dcc.cpp: + .text start:0x80451AA0 end:0x80451B84 + +nw4r/g3d/g3d_workmem.cpp: + .text start:0x80451B90 end:0x80451BDC + +nw4r/g3d/g3d_calcworld.cpp: + .text start:0x80451BE0 end:0x8045274C + +nw4r/g3d/g3d_draw.cpp: + .text start:0x80452750 end:0x804545F0 + +nw4r/g3d/g3d_camera.cpp: + .text start:0x804545F0 end:0x804556AC + +nw4r/g3d/dcc/g3d_basic.cpp: + .text start:0x804556B0 end:0x80455978 + +nw4r/g3d/dcc/g3d_maya.cpp: + .text start:0x80455980 end:0x80456684 + +nw4r/g3d/dcc/g3d_xsi.cpp: + .text start:0x80456690 end:0x804572A4 + +nw4r/g3d/dcc/g3d_3dsmax.cpp: + .text start:0x804572B0 end:0x80457DCC + +nw4r/g3d/g3d_scnobj.cpp: + .text start:0x80457DD0 end:0x8045980C + +nw4r/g3d/g3d_scnroot.cpp: + .text start:0x80459810 end:0x8045B1BC + +nw4r/g3d/g3d_scnmdlsmpl.cpp: + .text start:0x8045B1C0 end:0x8045D25C + +nw4r/g3d/g3d_scnmdl.cpp: + .text start:0x8045D260 end:0x8045FDAC + +nw4r/g3d/g3d_calcmaterial.cpp: + .text start:0x8045FDB0 end:0x8045FFE4 + +nw4r/g3d/g3d_init.cpp: + .text start:0x8045FFF0 end:0x804600E8 + +nw4r/g3d/g3d_scnproc.cpp: + .text start:0x804600F0 end:0x804603F0 + +nw4r/g3d/g3d_fog.cpp: + .text start:0x804603F0 end:0x80460560 + +nw4r/g3d/g3d_light.cpp: + .text start:0x80460560 end:0x80460F68 + +nw4r/g3d/g3d_calcvtx.cpp: + .text start:0x80460F70 end:0x804616F8 + +nw4r/snd/snd_AnimSound.cpp: + .text start:0x80461700 end:0x804630D4 + +nw4r/snd/snd_AxManager.cpp: + .text start:0x804630E0 end:0x80464880 + .ctors start:0x804DB958 end:0x804DB95C + +nw4r/snd/snd_AxVoice.cpp: + .text start:0x80464880 end:0x80467634 + +nw4r/snd/snd_AxVoiceManager.cpp: + .text start:0x80467640 end:0x80467DC8 + +nw4r/snd/snd_AxfxImpl.cpp: + .text start:0x80467DD0 end:0x80467FC8 + +nw4r/snd/snd_Bank.cpp: + .text start:0x80467FD0 end:0x80468248 + +nw4r/snd/snd_BankFile.cpp: + .text start:0x80468250 end:0x8046890C + +nw4r/snd/snd_BasicPlayer.cpp: + .text start:0x80468910 end:0x80468B50 + +nw4r/snd/snd_BasicSound.cpp: + .text start:0x80468B50 end:0x8046A36C + .ctors start:0x804DB95C end:0x804DB960 + +nw4r/snd/snd_BiquadFilterPreset.cpp: + .text start:0x8046A370 end:0x8046A7B0 + +nw4r/snd/snd_Channel.cpp: + .text start:0x8046A7B0 end:0x8046B7C8 + +nw4r/snd/snd_DisposeCallbackManager.cpp: + .text start:0x8046B7D0 end:0x8046BB5C + +nw4r/snd/snd_DvdSoundArchive.cpp: + .text start:0x8046BB60 end:0x8046C1C8 + +nw4r/snd/snd_EnvGenerator.cpp: + .text start:0x8046C1D0 end:0x8046C5C0 + +nw4r/snd/snd_ExternalSoundPlayer.cpp: + .text start:0x8046C5C0 end:0x8046CB18 + +nw4r/snd/snd_FrameHeap.cpp: + .text start:0x8046CB20 end:0x8046D2E0 + +nw4r/snd/snd_FxReverbStdDpl2.cpp: + .text start:0x8046D2E0 end:0x8046DA10 + +nw4r/snd/snd_InstancePool.cpp: + .text start:0x8046DA10 end:0x8046DCF8 + +nw4r/snd/snd_Lfo.cpp: + .text start:0x8046DD00 end:0x8046DF08 + +nw4r/snd/snd_MemorySoundArchive.cpp: + .text start:0x8046DF10 end:0x8046E3B0 + +nw4r/snd/snd_MidiSeqPlayer.cpp: + .text start:0x8046E3B0 end:0x8046E458 + +nw4r/snd/snd_MmlParser.cpp: + .text start:0x8046E460 end:0x8046F63C + +nw4r/snd/snd_MmlSeqTrack.cpp: + .text start:0x8046F640 end:0x8046F6F8 + +nw4r/snd/snd_MmlSeqTrackAllocator.cpp: + .text start:0x8046F700 end:0x8046F850 + +nw4r/snd/snd_NandSoundArchive.cpp: + .text start:0x8046F850 end:0x804700B8 + +nw4r/snd/snd_PlayerHeap.cpp: + .text start:0x804700C0 end:0x804702DC + +nw4r/snd/snd_RemoteSpeaker.cpp: + .text start:0x804702E0 end:0x80470C90 + +nw4r/snd/snd_RemoteSpeakerManager.cpp: + .text start:0x80470C90 end:0x80470ED8 + +nw4r/snd/snd_SeqFile.cpp: + .text start:0x80470EE0 end:0x80471018 + +nw4r/snd/snd_SeqPlayer.cpp: + .text start:0x80471020 end:0x804727F8 + +nw4r/snd/snd_SeqSound.cpp: + .text start:0x80472800 end:0x8047316C + .ctors start:0x804DB960 end:0x804DB964 + +nw4r/snd/snd_SeqSoundHandle.cpp: + .text start:0x80473170 end:0x804732A8 + +nw4r/snd/snd_SeqTrack.cpp: + .text start:0x804732B0 end:0x80474818 + +nw4r/snd/snd_Sound3DActor.cpp: + .text start:0x80474820 end:0x80474BD8 + +nw4r/snd/snd_Sound3DCalculator.cpp: + .text start:0x80474BE0 end:0x804756B0 + +nw4r/snd/snd_Sound3DEngine.cpp: + .text start:0x804756E0 end:0x804759F8 + +nw4r/snd/snd_Sound3DListener.cpp: + .text start:0x80475A00 end:0x80475C88 + +nw4r/snd/snd_Sound3DManager.cpp: + .text start:0x80475C90 end:0x80475F78 + .ctors start:0x804DB964 end:0x804DB968 + +nw4r/snd/snd_SoundActor.cpp: + .text start:0x80475F80 end:0x80476264 + +nw4r/snd/snd_SoundArchive.cpp: + .text start:0x80476270 end:0x8047697C + +nw4r/snd/snd_SoundArchiveFile.cpp: + .text start:0x80476980 end:0x80477C90 + +nw4r/snd/snd_SoundArchiveLoader.cpp: + .text start:0x80477C90 end:0x8047855C + +nw4r/snd/snd_SoundArchivePlayer.cpp: + .text start:0x80478560 end:0x8047B018 + +nw4r/snd/snd_SoundHandle.cpp: + .text start:0x8047B020 end:0x8047B110 + +nw4r/snd/snd_SoundHeap.cpp: + .text start:0x8047B110 end:0x8047B418 + +nw4r/snd/snd_SoundPlayer.cpp: + .text start:0x8047B420 end:0x8047C050 + +nw4r/snd/snd_SoundStartable.cpp: + .text start:0x8047C050 end:0x8047C3AC + +nw4r/snd/snd_SoundSystem.cpp: + .text start:0x8047C3B0 end:0x8047C708 + .ctors start:0x804DB968 end:0x804DB96C + +nw4r/snd/snd_SoundThread.cpp: + .text start:0x8047C710 end:0x8047CD10 + +nw4r/snd/snd_StrmChannel.cpp: + .text start:0x8047CD10 end:0x8047CF50 + +nw4r/snd/snd_StrmFile.cpp: + .text start:0x8047CF50 end:0x8047D8D4 + +nw4r/snd/snd_StrmPlayer.cpp: + .text start:0x8047D8E0 end:0x80480588 + +nw4r/snd/snd_StrmSound.cpp: + .text start:0x80480590 end:0x80480D8C + .ctors start:0x804DB96C end:0x804DB970 + +nw4r/snd/snd_StrmSoundHandle.cpp: + .text start:0x80480D90 end:0x80480EC8 + +nw4r/snd/snd_Task.cpp: + .text start:0x80480ED0 end:0x80480F10 + +nw4r/snd/snd_TaskManager.cpp: + .text start:0x80480F10 end:0x804815D0 + +nw4r/snd/snd_TaskThread.cpp: + .text start:0x804815D0 end:0x80481798 + +nw4r/snd/snd_Voice.cpp: + .text start:0x804817A0 end:0x80484034 + +nw4r/snd/snd_VoiceManager.cpp: + .text start:0x80484040 end:0x804846F4 + +nw4r/snd/snd_Util.cpp: + .text start:0x80484700 end:0x80484BD4 + +nw4r/snd/snd_WaveFile.cpp: + .text start:0x80484BE0 end:0x80484F54 + +nw4r/snd/snd_WaveSound.cpp: + .text start:0x80484F60 end:0x8048531C + .ctors start:0x804DB970 end:0x804DB974 + +nw4r/snd/snd_WaveSoundHandle.cpp: + .text start:0x80485320 end:0x80485458 + +nw4r/snd/snd_WsdFile.cpp: + .text start:0x80485460 end:0x80485824 + +nw4r/snd/snd_WsdPlayer.cpp: + .text start:0x80485830 end:0x804869D8 + +nw4r/snd/snd_adpcm.cpp: + .text start:0x804869E0 end:0x80486A6C + nw4r/lyt/lyt_init.cpp: .text start:0x80486A70 end:0x80486AC4 .data start:0x8056E3E8 end:0x8056E430 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c0036660..c5379e54 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -24188,7 +24188,7 @@ Assertion_SetConsole__Q24nw4r2dbFPQ44nw4r2db6detail11ConsoleHead = .text:0x80437 FExp__Q34nw4r4math6detailFf = .text:0x804373D0; // type:function size:0xAC FLog__Q34nw4r4math6detailFf = .text:0x80437480; // type:function size:0xA4 FrSqrt__Q24nw4r4mathFf = .text:0x80437530; // type:function size:0x24 -fn_80437560 = .text:0x80437560; // type:function size:0x4C +Bezier__Q24nw4r4mathFfffff = .text:0x80437560; // type:function size:0x4C SinFIdx__Q24nw4r4mathFf = .text:0x804375B0; // type:function size:0x78 CosFIdx__Q24nw4r4mathFf = .text:0x80437630; // type:function size:0x68 SinCosFIdx__Q24nw4r4mathFPfPff = .text:0x804376A0; // type:function size:0x70 @@ -24259,7 +24259,7 @@ GetResVtxClr__Q34nw4r3g3d6ResMdlCFi = .text:0x8043A4B0; // type:function size:0x GetResVtxClr__Q34nw4r3g3d6ResMdlCFUl = .text:0x8043A510; // type:function size:0x54 GetResVtxClrNumEntries__Q34nw4r3g3d6ResMdlCFv = .text:0x8043A570; // type:function size:0x34 GetResVtxTexCoord__Q34nw4r3g3d6ResMdlCFi = .text:0x8043A5B0; // type:function size:0x54 -fn_8043A610 = .text:0x8043A610; // type:function size:0x54 +GetResVtxFurPos__Q34nw4r3g3d6ResMdlCFi = .text:0x8043A610; // type:function size:0x54 GetResMat__Q34nw4r3g3d6ResMdlCFPCc = .text:0x8043A670; // type:function size:0x44 GetResMat__Q34nw4r3g3d6ResMdlCFQ34nw4r3g3d7ResName = .text:0x8043A6C0; // type:function size:0x50 GetResMat__Q34nw4r3g3d6ResMdlCFi = .text:0x8043A710; // type:function size:0x54 @@ -24272,7 +24272,7 @@ GetResTexPlttInfoOffsetFromTexName__Q34nw4r3g3d6ResMdlCFi = .text:0x8043A910; // GetResTexPlttInfoOffsetFromTexNameNumEntries__Q34nw4r3g3d6ResMdlCFv = .text:0x8043A970; // type:function size:0x34 Bind__Q34nw4r3g3d6ResMdlFQ34nw4r3g3d7ResFile = .text:0x8043A9B0; // type:function size:0x10C Init__Q34nw4r3g3d6ResMdlFv = .text:0x8043AAC0; // type:function size:0x598 -fn_8043B060 = .text:0x8043B060; // type:function size:0xA8 +IsOpaque__Q34nw4r3g3d6ResMdlCFUl = .text:0x8043B060; // type:function size:0xA8 fn_8043B110 = .text:0x8043B110; // type:function size:0x1C fn_8043B130 = .text:0x8043B130; // type:function size:0x54 fn_8043B190 = .text:0x8043B190; // type:function size:0x40 @@ -24283,7 +24283,7 @@ GXSetVtxAttrFmtv__Q34nw4r3g3d6ResShpFPC17_GXVtxAttrFmtList = .text:0x8043B460; / GetResVtxPos__Q34nw4r3g3d6ResShpCFv = .text:0x8043B6D0; // type:function size:0x48 GetResVtxNrm__Q34nw4r3g3d6ResShpCFv = .text:0x8043B720; // type:function size:0x5C GetResVtxClr__Q34nw4r3g3d6ResShpCFUl = .text:0x8043B780; // type:function size:0x64 -fn_8043B7F0 = .text:0x8043B7F0; // type:function size:0x5C +GetResVtxFurPos__Q34nw4r3g3d6ResShpCFv = .text:0x8043B7F0; // type:function size:0x5C Init__Q34nw4r3g3d6ResShpFv = .text:0x8043B850; // type:function size:0x38C CallPrePrimitiveDisplayList__Q34nw4r3g3d6ResShpCFbb = .text:0x8043BBE0; // type:function size:0xD8 CallPrimitiveDisplayList__Q34nw4r3g3d6ResShpCFb = .text:0x8043BCC0; // type:function size:0x64 @@ -24323,577 +24323,576 @@ GXSetNumTexGens__Q34nw4r3g3d10ResGenModeFUc = .text:0x8043C960; // type:function GXSetNumTevStages__Q34nw4r3g3d10ResGenModeFUc = .text:0x8043C980; // type:function size:0x14 GXSetCullMode__Q34nw4r3g3d10ResGenModeF11_GXCullMode = .text:0x8043C9A0; // type:function size:0x14 CopyTo__Q34nw4r3g3d10ResGenModeCFPv = .text:0x8043C9C0; // type:function size:0x34 -fn_8043CA00 = .text:0x8043CA00; // type:function size:0x1C -fn_8043CA20 = .text:0x8043CA20; // type:function size:0x28 -fn_8043CA50 = .text:0x8043CA50; // type:function size:0x20 -fn_8043CA70 = .text:0x8043CA70; // type:function size:0x14 -fn_8043CA90 = .text:0x8043CA90; // type:function size:0x20 -fn_8043CAB0 = .text:0x8043CAB0; // type:function size:0x44 -fn_8043CB00 = .text:0x8043CB00; // type:function size:0x3C -fn_8043CB40 = .text:0x8043CB40; // type:function size:0xB8 -fn_8043CC00 = .text:0x8043CC00; // type:function size:0x24 -fn_8043CC30 = .text:0x8043CC30; // type:function size:0x20 +GXGetZCompLoc__Q34nw4r3g3d10ResMatMiscCFv = .text:0x8043CA00; // type:function size:0x1C +SetLightSetIdx__Q34nw4r3g3d10ResMatMiscFi = .text:0x8043CA20; // type:function size:0x28 +GetLightSetIdx__Q34nw4r3g3d10ResMatMiscCFv = .text:0x8043CA50; // type:function size:0x20 +SetFogIdx__Q34nw4r3g3d10ResMatMiscFi = .text:0x8043CA70; // type:function size:0x14 +GetFogIdx__Q34nw4r3g3d10ResMatMiscCFv = .text:0x8043CA90; // type:function size:0x20 +GetIndirectTexMtxCalcMethod__Q34nw4r3g3d10ResMatMiscF14_GXIndTexMtxIDPQ44nw4r3g3d14ResMatMiscData14IndirectMethodPSc = .text:0x8043CAB0; // type:function size:0x44 +CopyTo__Q34nw4r3g3d10ResMatMiscCFPv = .text:0x8043CB00; // type:function size:0x3C +GetLyrRate__Q34nw4r3g3d9ResMatFurCFUl = .text:0x8043CB40; // type:function size:0xB8 +GXSetAlphaCompare__Q34nw4r3g3d9ResMatPixF10_GXCompareUc10_GXAlphaOp10_GXCompareUc = .text:0x8043CC00; // type:function size:0x24 +GXSetZMode__Q34nw4r3g3d9ResMatPixFUc10_GXCompareUc = .text:0x8043CC30; // type:function size:0x20 GXSetBlendMode__Q34nw4r3g3d9ResMatPixF12_GXBlendMode14_GXBlendFactor14_GXBlendFactor10_GXLogicOp = .text:0x8043CC50; // type:function size:0xB0 -fn_8043CD00 = .text:0x8043CD00; // type:function size:0x74 -fn_8043CD80 = .text:0x8043CD80; // type:function size:0x18 -fn_8043CDA0 = .text:0x8043CDA0; // type:function size:0xBC +GXGetDstAlpha__Q34nw4r3g3d9ResMatPixCFPUcPUc = .text:0x8043CD00; // type:function size:0x74 +GXSetDstAlpha__Q34nw4r3g3d9ResMatPixFUcUc = .text:0x8043CD80; // type:function size:0x18 +GXGetTevColor__Q34nw4r3g3d14ResMatTevColorCF11_GXTevRegIDP8_GXColor = .text:0x8043CDA0; // type:function size:0xBC GXSetTevColor__Q34nw4r3g3d14ResMatTevColorF11_GXTevRegID8_GXColor = .text:0x8043CE60; // type:function size:0x94 -fn_8043CF00 = .text:0x8043CF00; // type:function size:0xB8 +GXGetTevKColor__Q34nw4r3g3d14ResMatTevColorCF14_GXTevKColorIDP8_GXColor = .text:0x8043CF00; // type:function size:0xB8 GXSetTevKColor__Q34nw4r3g3d14ResMatTevColorF14_GXTevKColorID8_GXColor = .text:0x8043CFC0; // type:function size:0x84 -fn_8043D050 = .text:0x8043D050; // type:function size:0x34 -fn_8043D090 = .text:0x8043D090; // type:function size:0x2B8 -fn_8043D350 = .text:0x8043D350; // type:function size:0x1E8 -fn_8043D540 = .text:0x8043D540; // type:function size:0x16C -fn_8043D6B0 = .text:0x8043D6B0; // type:function size:0x54 -fn_8043D710 = .text:0x8043D710; // type:function size:0x38 -fn_8043D750 = .text:0x8043D750; // type:function size:0xC0 -fn_8043D810 = .text:0x8043D810; // type:function size:0x5C -fn_8043D870 = .text:0x8043D870; // type:function size:0xD0 -fn_8043D940 = .text:0x8043D940; // type:function size:0x1AC -fn_8043DAF0 = .text:0x8043DAF0; // type:function size:0x1F8 -fn_8043DCF0 = .text:0x8043DCF0; // type:function size:0x18 -fn_8043DD10 = .text:0x8043DD10; // type:function size:0xC8 -fn_8043DDE0 = .text:0x8043DDE0; // type:function size:0x24 -fn_8043DE10 = .text:0x8043DE10; // type:function size:0x48 -fn_8043DE60 = .text:0x8043DE60; // type:function size:0x20 -fn_8043DE80 = .text:0x8043DE80; // type:function size:0x20 -fn_8043DEA0 = .text:0x8043DEA0; // type:function size:0x20 -fn_8043DEC0 = .text:0x8043DEC0; // type:function size:0x2BC -fn_8043E180 = .text:0x8043E180; // type:function size:0x34 -fn_8043E1C0 = .text:0x8043E1C0; // type:function size:0x40 -fn_8043E200 = .text:0x8043E200; // type:function size:0x5C -fn_8043E260 = .text:0x8043E260; // type:function size:0x34 -fn_8043E2A0 = .text:0x8043E2A0; // type:function size:0x40 -fn_8043E2E0 = .text:0x8043E2E0; // type:function size:0x5C -fn_8043E340 = .text:0x8043E340; // type:function size:0x40 -fn_8043E380 = .text:0x8043E380; // type:function size:0x40 -fn_8043E3C0 = .text:0x8043E3C0; // type:function size:0x5C -fn_8043E420 = .text:0x8043E420; // type:function size:0x40 -fn_8043E460 = .text:0x8043E460; // type:function size:0x74 -fn_8043E4E0 = .text:0x8043E4E0; // type:function size:0x18 -fn_8043E500 = .text:0x8043E500; // type:function size:0x18 -fn_8043E520 = .text:0x8043E520; // type:function size:0x18 -fn_8043E540 = .text:0x8043E540; // type:function size:0x18 -fn_8043E560 = .text:0x8043E560; // type:function size:0x18 -fn_8043E580 = .text:0x8043E580; // type:function size:0x18 -fn_8043E5A0 = .text:0x8043E5A0; // type:function size:0x18 -fn_8043E5C0 = .text:0x8043E5C0; // type:function size:0xBC -fn_8043E680 = .text:0x8043E680; // type:function size:0xBC -fn_8043E740 = .text:0x8043E740; // type:function size:0xC -fn_8043E750 = .text:0x8043E750; // type:function size:0x19C -fn_8043E8F0 = .text:0x8043E8F0; // type:function size:0x168 -fn_8043EA60 = .text:0x8043EA60; // type:function size:0x144 -fn_8043EBB0 = .text:0x8043EBB0; // type:function size:0x108 -fn_8043ECC0 = .text:0x8043ECC0; // type:function size:0x120 -fn_8043EDE0 = .text:0x8043EDE0; // type:function size:0x16C -fn_8043EF50 = .text:0x8043EF50; // type:function size:0xC4 -fn_8043F020 = .text:0x8043F020; // type:function size:0x188 -fn_8043F1B0 = .text:0x8043F1B0; // type:function size:0x170 -fn_8043F320 = .text:0x8043F320; // type:function size:0x414 -fn_8043F740 = .text:0x8043F740; // type:function size:0x2A8 -fn_8043F9F0 = .text:0x8043F9F0; // type:function size:0x13C -fn_8043FB30 = .text:0x8043FB30; // type:function size:0x18C -fn_8043FCC0 = .text:0x8043FCC0; // type:function size:0x210 -fn_8043FED0 = .text:0x8043FED0; // type:function size:0xAC4 -fn_804409A0 = .text:0x804409A0; // type:function size:0x260 -fn_80440C00 = .text:0x80440C00; // type:function size:0x18 -fn_80440C20 = .text:0x80440C20; // type:function size:0x8C -fn_80440CB0 = .text:0x80440CB0; // type:function size:0x6C -fn_80440D20 = .text:0x80440D20; // type:function size:0x40 -fn_80440D60 = .text:0x80440D60; // type:function size:0xA8 -fn_80440E10 = .text:0x80440E10; // type:function size:0x9C -fn_80440EB0 = .text:0x80440EB0; // type:function size:0x98 -fn_80440F50 = .text:0x80440F50; // type:function size:0xB8 -fn_80441010 = .text:0x80441010; // type:function size:0x80 -fn_80441090 = .text:0x80441090; // type:function size:0x3C -fn_804410D0 = .text:0x804410D0; // type:function size:0x194 -fn_80441270 = .text:0x80441270; // type:function size:0x3C -fn_804412B0 = .text:0x804412B0; // type:function size:0xA4 -fn_80441360 = .text:0x80441360; // type:function size:0x54 -fn_804413C0 = .text:0x804413C0; // type:function size:0x98 -fn_80441460 = .text:0x80441460; // type:function size:0x140 -fn_804415A0 = .text:0x804415A0; // type:function size:0x84 -fn_80441630 = .text:0x80441630; // type:function size:0x18C -fn_804417C0 = .text:0x804417C0; // type:function size:0x22C -fn_804419F0 = .text:0x804419F0; // type:function size:0x16C -fn_80441B60 = .text:0x80441B60; // type:function size:0xD0 -fn_80441C30 = .text:0x80441C30; // type:function size:0x3E8 -fn_80442020 = .text:0x80442020; // type:function size:0x310 -fn_80442330 = .text:0x80442330; // type:function size:0x60 -fn_80442390 = .text:0x80442390; // type:function size:0x60 -fn_804423F0 = .text:0x804423F0; // type:function size:0x88 -fn_80442480 = .text:0x80442480; // type:function size:0xAC -fn_80442530 = .text:0x80442530; // type:function size:0x88 -fn_804425C0 = .text:0x804425C0; // type:function size:0xAC -fn_80442670 = .text:0x80442670; // type:function size:0xAC -fn_80442720 = .text:0x80442720; // type:function size:0x4C -fn_80442770 = .text:0x80442770; // type:function size:0x4C -fn_804427C0 = .text:0x804427C0; // type:function size:0x4C -fn_80442810 = .text:0x80442810; // type:function size:0x16C -fn_80442980 = .text:0x80442980; // type:function size:0x168 -fn_80442AF0 = .text:0x80442AF0; // type:function size:0xE4 -fn_80442BE0 = .text:0x80442BE0; // type:function size:0x108 -fn_80442CF0 = .text:0x80442CF0; // type:function size:0x104 -fn_80442E00 = .text:0x80442E00; // type:function size:0x40 -fn_80442E40 = .text:0x80442E40; // type:function size:0x8 -fn_80442E50 = .text:0x80442E50; // type:function size:0x8 -fn_80442E60 = .text:0x80442E60; // type:function size:0x40 -fn_80442EA0 = .text:0x80442EA0; // type:function size:0x40 +CallDisplayList__Q34nw4r3g3d20ResMatIndMtxAndScaleCFUcb = .text:0x8043D050; // type:function size:0x34 +GXGetIndTexMtx__Q34nw4r3g3d20ResMatIndMtxAndScaleCF14_GXIndTexMtxIDPQ34nw4r4math5MTX34 = .text:0x8043D090; // type:function size:0x2B8 +GXGetIndTexMtx__Q34nw4r3g3d20ResMatIndMtxAndScaleCF14_GXIndTexMtxIDPQ34nw4r4math5MTX34PSc = .text:0x8043D350; // type:function size:0x1E8 +GXSetIndTexMtx__Q34nw4r3g3d20ResMatIndMtxAndScaleF14_GXIndTexMtxIDRCQ34nw4r4math5MTX34Sc = .text:0x8043D540; // type:function size:0x16C +GXSetChanAmbColor__Q34nw4r3g3d10ResMatChanF12_GXChannelID8_GXColor = .text:0x8043D6B0; // type:function size:0x54 +GXGetChanMatColor__Q34nw4r3g3d10ResMatChanCF12_GXChannelIDP8_GXColor = .text:0x8043D710; // type:function size:0x38 +GXGetChanCtrl__Q34nw4r3g3d10ResMatChanCF12_GXChannelIDPUcP11_GXColorSrcP11_GXColorSrcP10_GXLightIDP12_GXDiffuseFnP9_GXAttnFn = .text:0x8043D750; // type:function size:0xC0 +CopyTo__Q34nw4r3g3d10ResMatChanCFPv = .text:0x8043D810; // type:function size:0x5C +CallDisplayList__Q34nw4r3g3d17ResMatTexCoordGenCFUcb = .text:0x8043D870; // type:function size:0xD0 +GXGetTexCoordGen2__Q34nw4r3g3d17ResMatTexCoordGenCF13_GXTexCoordIDP13_GXTexGenTypeP12_GXTexGenSrcPUcPUl = .text:0x8043D940; // type:function size:0x1AC +GXSetTexCoordGen2__Q34nw4r3g3d17ResMatTexCoordGenF13_GXTexCoordID13_GXTexGenType12_GXTexGenSrcUcUl = .text:0x8043DAF0; // type:function size:0x1F8 +Disable__Q34nw4r3g3d17ResMatTexCoordGenF13_GXTexCoordID = .text:0x8043DCF0; // type:function size:0x18 +Bind__Q34nw4r3g3d6ResMatFQ34nw4r3g3d7ResFile = .text:0x8043DD10; // type:function size:0xC8 +Init__Q34nw4r3g3d6ResMatFv = .text:0x8043DDE0; // type:function size:0x24 +IsOpaque__Q34nw4r3g3d6ResMatCFv = .text:0x8043DE10; // type:function size:0x48 +GetResTev__Q34nw4r3g3d6ResMatFv = .text:0x8043DE60; // type:function size:0x20 +GetResMatFur__Q34nw4r3g3d6ResMatFv = .text:0x8043DE80; // type:function size:0x20 +GetResUserData__Q34nw4r3g3d6ResMatFv = .text:0x8043DEA0; // type:function size:0x20 +Bind__Q34nw4r3g3d14ResTexPlttInfoFQ34nw4r3g3d7ResFileQ34nw4r3g3d9ResTexObjQ34nw4r3g3d10ResTlutObj = .text:0x8043DEC0; // type:function size:0x2BC +SetArray__Q34nw4r3g3d9ResVtxPosFv = .text:0x8043E180; // type:function size:0x34 +GetArray__Q34nw4r3g3d9ResVtxPosCFPPCvPUc = .text:0x8043E1C0; // type:function size:0x40 +CopyTo__Q34nw4r3g3d9ResVtxPosCFPv = .text:0x8043E200; // type:function size:0x5C +SetArray__Q34nw4r3g3d9ResVtxNrmFv = .text:0x8043E260; // type:function size:0x34 +GetArray__Q34nw4r3g3d9ResVtxNrmCFPPCvPUc = .text:0x8043E2A0; // type:function size:0x40 +CopyTo__Q34nw4r3g3d9ResVtxNrmCFPv = .text:0x8043E2E0; // type:function size:0x5C +SetArray__Q34nw4r3g3d9ResVtxClrF7_GXAttr = .text:0x8043E340; // type:function size:0x40 +GetArray__Q34nw4r3g3d9ResVtxClrCFPPCvPUc = .text:0x8043E380; // type:function size:0x40 +CopyTo__Q34nw4r3g3d9ResVtxClrCFPv = .text:0x8043E3C0; // type:function size:0x5C +GetArray__Q34nw4r3g3d14ResVtxTexCoordCFPPCvPUc = .text:0x8043E420; // type:function size:0x40 +SetArray__Q34nw4r3g3d12ResVtxFurPosFUs = .text:0x8043E460; // type:function size:0x74 +DCStore__Q34nw4r3g3d9ResVtxPosFb = .text:0x8043E4E0; // type:function size:0x18 +DCStore__Q34nw4r3g3d9ResVtxNrmFb = .text:0x8043E500; // type:function size:0x18 +DCStore__Q34nw4r3g3d9ResVtxClrFb = .text:0x8043E520; // type:function size:0x18 +DCStore__Q34nw4r3g3d14ResVtxTexCoordFb = .text:0x8043E540; // type:function size:0x18 +DCStore__Q34nw4r3g3d12ResVtxFurVecFb = .text:0x8043E560; // type:function size:0x18 +DCStore__Q34nw4r3g3d12ResVtxFurPosFb = .text:0x8043E580; // type:function size:0x18 +DCStore__Q34nw4r3g3d7ResPlttFb = .text:0x8043E5A0; // type:function size:0x18 +GetTexObjParam__Q34nw4r3g3d6ResTexCFPPvPUsPUsP9_GXTexFmtPfPfPUc = .text:0x8043E5C0; // type:function size:0xBC +GetTexObjCIParam__Q34nw4r3g3d6ResTexCFPPvPUsPUsP11_GXCITexFmtPfPfPUc = .text:0x8043E680; // type:function size:0xBC +Init__Q34nw4r3g3d6ResTexFv = .text:0x8043E740; // type:function size:0xC +PatchChrAnmResult__Q34nw4r3g3d7ResNodeCFPQ34nw4r3g3d12ChrAnmResult = .text:0x8043E750; // type:function size:0x19C +CalcChrAnmResult__Q34nw4r3g3d7ResNodeCFPQ34nw4r3g3d12ChrAnmResult = .text:0x8043E8F0; // type:function size:0x168 +GetResKeyFrameAnmResult__Q34nw4r3g3d6detailFPCQ34nw4r3g3d18ResKeyFrameAnmDataf = .text:0x8043EA60; // type:function size:0x144 +GetResColorAnmResult__Q34nw4r3g3d6detailFPCQ34nw4r3g3d21ResColorAnmFramesDataf = .text:0x8043EBB0; // type:function size:0x108 +GetAnmResult__Q34nw4r3g3d9ResAnmVisCFUlf = .text:0x8043ECC0; // type:function size:0x120 +GetAnmResult__Q34nw4r3g3d9ResAnmClrCFPQ34nw4r3g3d12ClrAnmResultUlf = .text:0x8043EDE0; // type:function size:0x16C +SearchFrame__Q34nw4r3g3d30@unnamed@g3d_resanmtexpat_cpp@FPCQ34nw4r3g3d19ResAnmTexPatAnmDataf = .text:0x8043EF50; // type:function size:0xC4 scope:local +GetAnmResult__Q34nw4r3g3d12ResAnmTexPatCFPQ34nw4r3g3d15TexPatAnmResultUlf = .text:0x8043F020; // type:function size:0x188 +Bind__Q34nw4r3g3d12ResAnmTexPatFQ34nw4r3g3d7ResFile = .text:0x8043F1B0; // type:function size:0x170 +GetAnmResult__Q34nw4r3g3d12ResAnmTexSrtCFPQ34nw4r3g3d15TexSrtAnmResultUlf = .text:0x8043F320; // type:function size:0x414 +GetAnmScale__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r4math4VEC3PCQ34nw4r3g3d17ResAnmChrNodeDataPCQ44nw4r3g3d17ResAnmChrNodeData7AnmDataf = .text:0x8043F740; // type:function size:0x2A8 +CalcAnimationFVS>__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPCQ34nw4r3g3d16ResAnmChrFVSDataf_f = .text:0x8043F9F0; // type:function size:0x13C +CalcAnimationFVS>__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPCQ34nw4r3g3d16ResAnmChrFVSDataf_f = .text:0x8043FB30; // type:function size:0x18C +CalcAnimationFVS>__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPCQ34nw4r3g3d16ResAnmChrFVSDataf_f = .text:0x8043FCC0; // type:function size:0x210 +GetAnmRotation__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r4math5MTX34PQ34nw4r4math4VEC3RCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataPCQ44nw4r3g3d17ResAnmChrNodeData7AnmDataf = .text:0x8043FED0; // type:function size:0xAC4 +GetAnmTranslation__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r4math4VEC3PCQ34nw4r3g3d17ResAnmChrNodeDataPCQ44nw4r3g3d17ResAnmChrNodeData7AnmDataf = .text:0x804409A0; // type:function size:0x260 +GetAnmResult___Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440C00; // type:function size:0x18 +GetAnmResult_T__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440C20; // type:function size:0x8C +GetAnmResult_R__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440CB0; // type:function size:0x6C +GetAnmResult_S__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440D20; // type:function size:0x40 +GetAnmResult_RT__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440D60; // type:function size:0xA8 +GetAnmResult_SR__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440E10; // type:function size:0x9C +GetAnmResult_ST__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440EB0; // type:function size:0x98 +GetAnmResult_SRT__Q34nw4r3g3d27@unnamed@g3d_resanmchr_cpp@FPQ34nw4r3g3d12ChrAnmResultRCQ34nw4r3g3d17ResAnmChrInfoDataPCQ34nw4r3g3d17ResAnmChrNodeDataf = .text:0x80440F50; // type:function size:0xB8 +GetAnmResult__Q34nw4r3g3d9ResAnmChrCFPQ34nw4r3g3d12ChrAnmResultUlf = .text:0x80441010; // type:function size:0x80 +GetScale__Q34nw4r3g3d12ChrAnmResultCFPQ34nw4r4math4VEC3 = .text:0x80441090; // type:function size:0x3C +GetRotateDeg__Q34nw4r3g3d12ChrAnmResultCFPQ34nw4r4math4VEC3 = .text:0x804410D0; // type:function size:0x194 +GetTranslate__Q34nw4r3g3d12ChrAnmResultCFPQ34nw4r4math4VEC3 = .text:0x80441270; // type:function size:0x3C +GetRotTrans__Q34nw4r3g3d12ChrAnmResultCFPQ34nw4r4math5MTX34 = .text:0x804412B0; // type:function size:0xA4 +GetMtx__Q34nw4r3g3d12ChrAnmResultCFPQ34nw4r4math5MTX34 = .text:0x80441360; // type:function size:0x54 +SetScale__Q34nw4r3g3d12ChrAnmResultFPCQ34nw4r4math4VEC3 = .text:0x804413C0; // type:function size:0x98 +SetRotateDeg__Q34nw4r3g3d12ChrAnmResultFPCQ34nw4r4math4VEC3 = .text:0x80441460; // type:function size:0x140 +SetTranslate__Q34nw4r3g3d12ChrAnmResultFPCQ34nw4r4math4VEC3 = .text:0x804415A0; // type:function size:0x84 +SetRotTrans__Q34nw4r3g3d12ChrAnmResultFPCQ34nw4r4math5MTX34 = .text:0x80441630; // type:function size:0x18C +SetMtx__Q34nw4r3g3d12ChrAnmResultFPCQ34nw4r4math5MTX34 = .text:0x804417C0; // type:function size:0x22C +Bind__Q34nw4r3g3d11ResLightSetFQ34nw4r3g3d9ResAnmScn = .text:0x804419F0; // type:function size:0x16C +GetAnmResult__Q34nw4r3g3d14ResAnmAmbLightCFPQ34nw4r3g3d17AmbLightAnmResultf = .text:0x80441B60; // type:function size:0xD0 +GetAnmResult__Q34nw4r3g3d11ResAnmLightCFPQ34nw4r3g3d14LightAnmResultf = .text:0x80441C30; // type:function size:0x3E8 +GetAnmResult__Q34nw4r3g3d12ResAnmCameraCFPQ34nw4r3g3d15CameraAnmResultf = .text:0x80442020; // type:function size:0x310 +HasResAnmAmbLight__Q34nw4r3g3d9ResAnmScnCFv = .text:0x80442330; // type:function size:0x60 +HasResAnmLight__Q34nw4r3g3d9ResAnmScnCFv = .text:0x80442390; // type:function size:0x60 +GetResAnmAmbLight__Q34nw4r3g3d9ResAnmScnCFQ34nw4r3g3d7ResName = .text:0x804423F0; // type:function size:0x88 +GetResAnmAmbLight__Q34nw4r3g3d9ResAnmScnCFUl = .text:0x80442480; // type:function size:0xAC +GetResAnmLight__Q34nw4r3g3d9ResAnmScnCFQ34nw4r3g3d7ResName = .text:0x80442530; // type:function size:0x88 +GetResAnmLight__Q34nw4r3g3d9ResAnmScnCFUl = .text:0x804425C0; // type:function size:0xAC +GetResAnmCamera__Q34nw4r3g3d9ResAnmScnCFUl = .text:0x80442670; // type:function size:0xAC +GetResLightSetByRefNumber__Q34nw4r3g3d9ResAnmScnCFi = .text:0x80442720; // type:function size:0x4C +GetResAnmAmbLightByRefNumber__Q34nw4r3g3d9ResAnmScnCFUl = .text:0x80442770; // type:function size:0x4C +GetResAnmLightByRefNumber__Q34nw4r3g3d9ResAnmScnCFi = .text:0x804427C0; // type:function size:0x4C +Bind__Q34nw4r3g3d9ResAnmScnFQ34nw4r3g3d9ResAnmScn = .text:0x80442810; // type:function size:0x16C +GetAnmResult__Q34nw4r3g3d9ResAnmShpCFPQ34nw4r3g3d12ShpAnmResultUlfPCQ34nw4r3g3d12ShpAnmVtxSet = .text:0x80442980; // type:function size:0x168 +CalcViewNrmMtx__Q34nw4r3g3d6detailFPQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34 = .text:0x80442AF0; // type:function size:0xE4 +CalcViewTexMtx__Q34nw4r3g3d6detailFPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34 = .text:0x80442BE0; // type:function size:0x108 +CalcInvWorldMtx__Q34nw4r3g3d6detailFPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34 = .text:0x80442CF0; // type:function size:0x104 +Release__Q34nw4r3g3d9AnmObjVisFv = .text:0x80442E00; // type:function size:0x40 +Attach__Q34nw4r3g3d9AnmObjVisFiPQ34nw4r3g3d12AnmObjVisRes = .text:0x80442E40; // type:function size:0x8 +Detach__Q34nw4r3g3d9AnmObjVisFi = .text:0x80442E50; // type:function size:0x8 +G3dProc__Q34nw4r3g3d9AnmObjVisFUlUlPv = .text:0x80442E60; // type:function size:0x40 +__dt__Q34nw4r3g3d6AnmObjFv = .text:0x80442EA0; // type:function size:0x40 Construct__Q34nw4r3g3d12AnmObjVisResFP12MEMAllocatorPUlQ34nw4r3g3d9ResAnmVisQ34nw4r3g3d6ResMdl = .text:0x80442EE0; // type:function size:0x150 -fn_80443030 = .text:0x80443030; // type:function size:0x64 -fn_804430A0 = .text:0x804430A0; // type:function size:0x8 -fn_804430B0 = .text:0x804430B0; // type:function size:0x8 -fn_804430C0 = .text:0x804430C0; // type:function size:0x8 -fn_804430D0 = .text:0x804430D0; // type:function size:0x84 -fn_80443160 = .text:0x80443160; // type:function size:0x104 -fn_80443270 = .text:0x80443270; // type:function size:0x34 -fn_804432B0 = .text:0x804432B0; // type:function size:0xBC -fn_80443370 = .text:0x80443370; // type:function size:0x8C -fn_80443400 = .text:0x80443400; // type:function size:0x68 -fn_80443470 = .text:0x80443470; // type:function size:0x50 -fn_804434C0 = .text:0x804434C0; // type:function size:0x30 -fn_804434F0 = .text:0x804434F0; // type:function size:0xC -fn_80443500 = .text:0x80443500; // type:function size:0x44 -fn_80443550 = .text:0x80443550; // type:function size:0x30 -fn_80443580 = .text:0x80443580; // type:function size:0xC -fn_80443590 = .text:0x80443590; // type:function size:0x1C -fn_804435B0 = .text:0x804435B0; // type:function size:0x40 -fn_804435F0 = .text:0x804435F0; // type:function size:0x8 -fn_80443600 = .text:0x80443600; // type:function size:0x8 -fn_80443610 = .text:0x80443610; // type:function size:0x4 -fn_80443620 = .text:0x80443620; // type:function size:0x40 -fn_80443660 = .text:0x80443660; // type:function size:0x64 -fn_804436D0 = .text:0x804436D0; // type:function size:0xEC -fn_804437C0 = .text:0x804437C0; // type:function size:0x11C -fn_804438E0 = .text:0x804438E0; // type:function size:0x60 -fn_80443940 = .text:0x80443940; // type:function size:0x78 -fn_804439C0 = .text:0x804439C0; // type:function size:0x88 -fn_80443A50 = .text:0x80443A50; // type:function size:0x54 -fn_80443AB0 = .text:0x80443AB0; // type:function size:0x88 -fn_80443B40 = .text:0x80443B40; // type:function size:0x54 -fn_80443BA0 = .text:0x80443BA0; // type:function size:0xF4 -fn_80443CA0 = .text:0x80443CA0; // type:function size:0xB8 -fn_80443D60 = .text:0x80443D60; // type:function size:0x7C +SetFrame__Q34nw4r3g3d12AnmObjVisResFf = .text:0x80443030; // type:function size:0x64 +GetFrame__Q34nw4r3g3d12AnmObjVisResCFv = .text:0x804430A0; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d12AnmObjVisResFf = .text:0x804430B0; // type:function size:0x8 +GetUpdateRate__Q34nw4r3g3d12AnmObjVisResCFv = .text:0x804430C0; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d12AnmObjVisResFv = .text:0x804430D0; // type:function size:0x84 +Bind__Q34nw4r3g3d12AnmObjVisResFQ34nw4r3g3d6ResMdl = .text:0x80443160; // type:function size:0x104 +GetResult__Q34nw4r3g3d12AnmObjVisResFUl = .text:0x80443270; // type:function size:0x34 +ApplyVisAnmResult__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPQ34nw4r3g3d9AnmObjVis = .text:0x804432B0; // type:function size:0xBC +ApplyVisAnmResult__Q24nw4r3g3dFPUcQ34nw4r3g3d6ResMdlPQ34nw4r3g3d9AnmObjVis = .text:0x80443370; // type:function size:0x8C +IsDerivedFrom__Q34nw4r3g3d12AnmObjVisResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80443400; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d9AnmObjVisCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80443470; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d12AnmObjVisResCFv = .text:0x804434C0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjVisResCFv = .text:0x804434F0; // type:function size:0xC +__dt__Q34nw4r3g3d12AnmObjVisResFv = .text:0x80443500; // type:function size:0x44 +GetTypeName__Q34nw4r3g3d9AnmObjVisCFv = .text:0x80443550; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d9AnmObjVisCFv = .text:0x80443580; // type:function size:0xC +TestExistence__Q34nw4r3g3d12AnmObjMatClrCFUl = .text:0x80443590; // type:function size:0x1C +Release__Q34nw4r3g3d12AnmObjMatClrFv = .text:0x804435B0; // type:function size:0x40 +Attach__Q34nw4r3g3d12AnmObjMatClrFiPQ34nw4r3g3d15AnmObjMatClrRes = .text:0x804435F0; // type:function size:0x8 +Detach__Q34nw4r3g3d12AnmObjMatClrFi = .text:0x80443600; // type:function size:0x8 +DetachAll__Q34nw4r3g3d12AnmObjMatClrFv = .text:0x80443610; // type:function size:0x4 +__dt__Q34nw4r3g3d12AnmObjMatClrFv = .text:0x80443620; // type:function size:0x40 +__dt__Q34nw4r3g3d16AnmObjMatClrNodeFv = .text:0x80443660; // type:function size:0x64 +Attach__Q34nw4r3g3d16AnmObjMatClrNodeFiPQ34nw4r3g3d15AnmObjMatClrRes = .text:0x804436D0; // type:function size:0xEC +Detach__Q34nw4r3g3d16AnmObjMatClrNodeFi = .text:0x804437C0; // type:function size:0x11C +DetachAll__Q34nw4r3g3d16AnmObjMatClrNodeFv = .text:0x804438E0; // type:function size:0x60 +UpdateFrame__Q34nw4r3g3d16AnmObjMatClrNodeFv = .text:0x80443940; // type:function size:0x78 +SetFrame__Q34nw4r3g3d16AnmObjMatClrNodeFf = .text:0x804439C0; // type:function size:0x88 +GetFrame__Q34nw4r3g3d16AnmObjMatClrNodeCFv = .text:0x80443A50; // type:function size:0x54 +SetUpdateRate__Q34nw4r3g3d16AnmObjMatClrNodeFf = .text:0x80443AB0; // type:function size:0x88 +GetUpdateRate__Q34nw4r3g3d16AnmObjMatClrNodeCFv = .text:0x80443B40; // type:function size:0x54 +Bind__Q34nw4r3g3d16AnmObjMatClrNodeFQ34nw4r3g3d6ResMdl = .text:0x80443BA0; // type:function size:0xF4 +Release__Q34nw4r3g3d16AnmObjMatClrNodeFv = .text:0x80443CA0; // type:function size:0xB8 +G3dProc__Q34nw4r3g3d16AnmObjMatClrNodeFUlUlPv = .text:0x80443D60; // type:function size:0x7C Construct__Q34nw4r3g3d20AnmObjMatClrOverrideFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdli = .text:0x80443DE0; // type:function size:0x134 -fn_80443F20 = .text:0x80443F20; // type:function size:0xB0 +GetResult__Q34nw4r3g3d20AnmObjMatClrOverrideFPQ34nw4r3g3d12ClrAnmResultUl = .text:0x80443F20; // type:function size:0xB0 Construct__Q34nw4r3g3d15AnmObjMatClrResFP12MEMAllocatorPUlQ34nw4r3g3d9ResAnmClrQ34nw4r3g3d6ResMdlb = .text:0x80443FD0; // type:function size:0x1F0 -fn_804441C0 = .text:0x804441C0; // type:function size:0xC0 -fn_80444280 = .text:0x80444280; // type:function size:0x8 -fn_80444290 = .text:0x80444290; // type:function size:0xB4 -fn_80444350 = .text:0x80444350; // type:function size:0x8 -fn_80444360 = .text:0x80444360; // type:function size:0xE0 -fn_80444440 = .text:0x80444440; // type:function size:0xF8 -fn_80444540 = .text:0x80444540; // type:function size:0x74 -fn_804445C0 = .text:0x804445C0; // type:function size:0x44 -fn_80444610 = .text:0x80444610; // type:function size:0x3D4 -fn_804449F0 = .text:0x804449F0; // type:function size:0x68 -fn_80444A60 = .text:0x80444A60; // type:function size:0x50 -fn_80444AB0 = .text:0x80444AB0; // type:function size:0x30 -fn_80444AE0 = .text:0x80444AE0; // type:function size:0xC -fn_80444AF0 = .text:0x80444AF0; // type:function size:0x44 -fn_80444B40 = .text:0x80444B40; // type:function size:0x7C -fn_80444BC0 = .text:0x80444BC0; // type:function size:0x68 -fn_80444C30 = .text:0x80444C30; // type:function size:0x30 -fn_80444C60 = .text:0x80444C60; // type:function size:0xC -fn_80444C70 = .text:0x80444C70; // type:function size:0x68 -fn_80444CE0 = .text:0x80444CE0; // type:function size:0x30 -fn_80444D10 = .text:0x80444D10; // type:function size:0xC -fn_80444D20 = .text:0x80444D20; // type:function size:0x30 -fn_80444D50 = .text:0x80444D50; // type:function size:0xC -fn_80444D60 = .text:0x80444D60; // type:function size:0x1C -fn_80444D80 = .text:0x80444D80; // type:function size:0x40 -fn_80444DC0 = .text:0x80444DC0; // type:function size:0x8 -fn_80444DD0 = .text:0x80444DD0; // type:function size:0x8 -fn_80444DE0 = .text:0x80444DE0; // type:function size:0x4 -fn_80444DF0 = .text:0x80444DF0; // type:function size:0x40 -fn_80444E30 = .text:0x80444E30; // type:function size:0x64 -fn_80444EA0 = .text:0x80444EA0; // type:function size:0xEC -fn_80444F90 = .text:0x80444F90; // type:function size:0x11C -fn_804450B0 = .text:0x804450B0; // type:function size:0x60 -fn_80445110 = .text:0x80445110; // type:function size:0x78 -fn_80445190 = .text:0x80445190; // type:function size:0x88 -fn_80445220 = .text:0x80445220; // type:function size:0x54 -fn_80445280 = .text:0x80445280; // type:function size:0x88 -fn_80445310 = .text:0x80445310; // type:function size:0x54 -fn_80445370 = .text:0x80445370; // type:function size:0xF4 -fn_80445470 = .text:0x80445470; // type:function size:0xB8 -fn_80445530 = .text:0x80445530; // type:function size:0x7C +SetFrame__Q34nw4r3g3d15AnmObjMatClrResFf = .text:0x804441C0; // type:function size:0xC0 +GetFrame__Q34nw4r3g3d15AnmObjMatClrResCFv = .text:0x80444280; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d15AnmObjMatClrResFf = .text:0x80444290; // type:function size:0xB4 +GetUpdateRate__Q34nw4r3g3d15AnmObjMatClrResCFv = .text:0x80444350; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d15AnmObjMatClrResFv = .text:0x80444360; // type:function size:0xE0 +Bind__Q34nw4r3g3d15AnmObjMatClrResFQ34nw4r3g3d6ResMdl = .text:0x80444440; // type:function size:0xF8 +GetResult__Q34nw4r3g3d15AnmObjMatClrResFPQ34nw4r3g3d12ClrAnmResultUl = .text:0x80444540; // type:function size:0x74 +G3dProc__Q34nw4r3g3d15AnmObjMatClrResFUlUlPv = .text:0x804445C0; // type:function size:0x44 +ApplyClrAnmResult__Q24nw4r3g3dFQ34nw4r3g3d10ResMatChanQ34nw4r3g3d14ResMatTevColorPCQ34nw4r3g3d12ClrAnmResult = .text:0x80444610; // type:function size:0x3D4 +IsDerivedFrom__Q34nw4r3g3d15AnmObjMatClrResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804449F0; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d12AnmObjMatClrCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80444A60; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d15AnmObjMatClrResCFv = .text:0x80444AB0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d15AnmObjMatClrResCFv = .text:0x80444AE0; // type:function size:0xC +__dt__Q34nw4r3g3d15AnmObjMatClrResFv = .text:0x80444AF0; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d20AnmObjMatClrOverrideCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80444B40; // type:function size:0x7C +IsDerivedFrom__Q34nw4r3g3d16AnmObjMatClrNodeCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80444BC0; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d20AnmObjMatClrOverrideCFv = .text:0x80444C30; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d20AnmObjMatClrOverrideCFv = .text:0x80444C60; // type:function size:0xC +__dt__Q34nw4r3g3d20AnmObjMatClrOverrideFv = .text:0x80444C70; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d16AnmObjMatClrNodeCFv = .text:0x80444CE0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d16AnmObjMatClrNodeCFv = .text:0x80444D10; // type:function size:0xC +GetTypeName__Q34nw4r3g3d12AnmObjMatClrCFv = .text:0x80444D20; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjMatClrCFv = .text:0x80444D50; // type:function size:0xC +TestExistence__Q34nw4r3g3d12AnmObjTexPatCFUl = .text:0x80444D60; // type:function size:0x1C +Release__Q34nw4r3g3d12AnmObjTexPatFv = .text:0x80444D80; // type:function size:0x40 +Attach__Q34nw4r3g3d12AnmObjTexPatFiPQ34nw4r3g3d15AnmObjTexPatRes = .text:0x80444DC0; // type:function size:0x8 +Detach__Q34nw4r3g3d12AnmObjTexPatFi = .text:0x80444DD0; // type:function size:0x8 +DetachAll__Q34nw4r3g3d12AnmObjTexPatFv = .text:0x80444DE0; // type:function size:0x4 +__dt__Q34nw4r3g3d12AnmObjTexPatFv = .text:0x80444DF0; // type:function size:0x40 +__dt__Q34nw4r3g3d16AnmObjTexPatNodeFv = .text:0x80444E30; // type:function size:0x64 +Attach__Q34nw4r3g3d16AnmObjTexPatNodeFiPQ34nw4r3g3d15AnmObjTexPatRes = .text:0x80444EA0; // type:function size:0xEC +Detach__Q34nw4r3g3d16AnmObjTexPatNodeFi = .text:0x80444F90; // type:function size:0x11C +DetachAll__Q34nw4r3g3d16AnmObjTexPatNodeFv = .text:0x804450B0; // type:function size:0x60 +UpdateFrame__Q34nw4r3g3d16AnmObjTexPatNodeFv = .text:0x80445110; // type:function size:0x78 +SetFrame__Q34nw4r3g3d16AnmObjTexPatNodeFf = .text:0x80445190; // type:function size:0x88 +GetFrame__Q34nw4r3g3d16AnmObjTexPatNodeCFv = .text:0x80445220; // type:function size:0x54 +SetUpdateRate__Q34nw4r3g3d16AnmObjTexPatNodeFf = .text:0x80445280; // type:function size:0x88 +GetUpdateRate__Q34nw4r3g3d16AnmObjTexPatNodeCFv = .text:0x80445310; // type:function size:0x54 +Bind__Q34nw4r3g3d16AnmObjTexPatNodeFQ34nw4r3g3d6ResMdl = .text:0x80445370; // type:function size:0xF4 +Release__Q34nw4r3g3d16AnmObjTexPatNodeFv = .text:0x80445470; // type:function size:0xB8 +G3dProc__Q34nw4r3g3d16AnmObjTexPatNodeFUlUlPv = .text:0x80445530; // type:function size:0x7C Construct__Q34nw4r3g3d20AnmObjTexPatOverrideFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdli = .text:0x804455B0; // type:function size:0x134 -fn_804456F0 = .text:0x804456F0; // type:function size:0xC0 +GetResult__Q34nw4r3g3d20AnmObjTexPatOverrideFPQ34nw4r3g3d15TexPatAnmResultUl = .text:0x804456F0; // type:function size:0xC0 Construct__Q34nw4r3g3d15AnmObjTexPatResFP12MEMAllocatorPUlQ34nw4r3g3d12ResAnmTexPatQ34nw4r3g3d6ResMdlb = .text:0x804457B0; // type:function size:0x1F0 -fn_804459A0 = .text:0x804459A0; // type:function size:0xC0 -fn_80445A60 = .text:0x80445A60; // type:function size:0x8 -fn_80445A70 = .text:0x80445A70; // type:function size:0xB4 -fn_80445B30 = .text:0x80445B30; // type:function size:0x8 -fn_80445B40 = .text:0x80445B40; // type:function size:0xE0 -fn_80445C20 = .text:0x80445C20; // type:function size:0xF8 -fn_80445D20 = .text:0x80445D20; // type:function size:0x78 -fn_80445DA0 = .text:0x80445DA0; // type:function size:0x44 -fn_80445DF0 = .text:0x80445DF0; // type:function size:0x1F4 -fn_80445FF0 = .text:0x80445FF0; // type:function size:0x68 -fn_80446060 = .text:0x80446060; // type:function size:0x50 -fn_804460B0 = .text:0x804460B0; // type:function size:0x30 -fn_804460E0 = .text:0x804460E0; // type:function size:0xC -fn_804460F0 = .text:0x804460F0; // type:function size:0x44 -fn_80446140 = .text:0x80446140; // type:function size:0x7C -fn_804461C0 = .text:0x804461C0; // type:function size:0x68 -fn_80446230 = .text:0x80446230; // type:function size:0x30 -fn_80446260 = .text:0x80446260; // type:function size:0xC -fn_80446270 = .text:0x80446270; // type:function size:0x68 -fn_804462E0 = .text:0x804462E0; // type:function size:0x30 -fn_80446310 = .text:0x80446310; // type:function size:0xC -fn_80446320 = .text:0x80446320; // type:function size:0x30 -fn_80446350 = .text:0x80446350; // type:function size:0xC -fn_80446360 = .text:0x80446360; // type:function size:0x1C -fn_80446380 = .text:0x80446380; // type:function size:0x40 -fn_804463C0 = .text:0x804463C0; // type:function size:0x8 -fn_804463D0 = .text:0x804463D0; // type:function size:0x8 -fn_804463E0 = .text:0x804463E0; // type:function size:0x4 -fn_804463F0 = .text:0x804463F0; // type:function size:0x40 -fn_80446430 = .text:0x80446430; // type:function size:0x64 -fn_804464A0 = .text:0x804464A0; // type:function size:0xEC -fn_80446590 = .text:0x80446590; // type:function size:0x11C -fn_804466B0 = .text:0x804466B0; // type:function size:0x60 -fn_80446710 = .text:0x80446710; // type:function size:0x78 -fn_80446790 = .text:0x80446790; // type:function size:0x88 -fn_80446820 = .text:0x80446820; // type:function size:0x54 -fn_80446880 = .text:0x80446880; // type:function size:0x88 -fn_80446910 = .text:0x80446910; // type:function size:0x54 -fn_80446970 = .text:0x80446970; // type:function size:0xF4 -fn_80446A70 = .text:0x80446A70; // type:function size:0xB8 -fn_80446B30 = .text:0x80446B30; // type:function size:0x7C +SetFrame__Q34nw4r3g3d15AnmObjTexPatResFf = .text:0x804459A0; // type:function size:0xC0 +GetFrame__Q34nw4r3g3d15AnmObjTexPatResCFv = .text:0x80445A60; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d15AnmObjTexPatResFf = .text:0x80445A70; // type:function size:0xB4 +GetUpdateRate__Q34nw4r3g3d15AnmObjTexPatResCFv = .text:0x80445B30; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d15AnmObjTexPatResFv = .text:0x80445B40; // type:function size:0xE0 +Bind__Q34nw4r3g3d15AnmObjTexPatResFQ34nw4r3g3d6ResMdl = .text:0x80445C20; // type:function size:0xF8 +GetResult__Q34nw4r3g3d15AnmObjTexPatResFPQ34nw4r3g3d15TexPatAnmResultUl = .text:0x80445D20; // type:function size:0x78 +G3dProc__Q34nw4r3g3d15AnmObjTexPatResFUlUlPv = .text:0x80445DA0; // type:function size:0x44 +ApplyTexPatAnmResult__Q24nw4r3g3dFQ34nw4r3g3d9ResTexObjQ34nw4r3g3d10ResTlutObjPCQ34nw4r3g3d15TexPatAnmResult = .text:0x80445DF0; // type:function size:0x1F4 +IsDerivedFrom__Q34nw4r3g3d15AnmObjTexPatResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80445FF0; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d12AnmObjTexPatCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80446060; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d15AnmObjTexPatResCFv = .text:0x804460B0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d15AnmObjTexPatResCFv = .text:0x804460E0; // type:function size:0xC +__dt__Q34nw4r3g3d15AnmObjTexPatResFv = .text:0x804460F0; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d20AnmObjTexPatOverrideCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80446140; // type:function size:0x7C +IsDerivedFrom__Q34nw4r3g3d16AnmObjTexPatNodeCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804461C0; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d20AnmObjTexPatOverrideCFv = .text:0x80446230; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d20AnmObjTexPatOverrideCFv = .text:0x80446260; // type:function size:0xC +__dt__Q34nw4r3g3d20AnmObjTexPatOverrideFv = .text:0x80446270; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d16AnmObjTexPatNodeCFv = .text:0x804462E0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d16AnmObjTexPatNodeCFv = .text:0x80446310; // type:function size:0xC +GetTypeName__Q34nw4r3g3d12AnmObjTexPatCFv = .text:0x80446320; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjTexPatCFv = .text:0x80446350; // type:function size:0xC +TestExistence__Q34nw4r3g3d12AnmObjTexSrtCFUl = .text:0x80446360; // type:function size:0x1C +Release__Q34nw4r3g3d12AnmObjTexSrtFv = .text:0x80446380; // type:function size:0x40 +Attach__Q34nw4r3g3d12AnmObjTexSrtFiPQ34nw4r3g3d15AnmObjTexSrtRes = .text:0x804463C0; // type:function size:0x8 +Detach__Q34nw4r3g3d12AnmObjTexSrtFi = .text:0x804463D0; // type:function size:0x8 +DetachAll__Q34nw4r3g3d12AnmObjTexSrtFv = .text:0x804463E0; // type:function size:0x4 +__dt__Q34nw4r3g3d12AnmObjTexSrtFv = .text:0x804463F0; // type:function size:0x40 +__dt__Q34nw4r3g3d16AnmObjTexSrtNodeFv = .text:0x80446430; // type:function size:0x64 +Attach__Q34nw4r3g3d16AnmObjTexSrtNodeFiPQ34nw4r3g3d15AnmObjTexSrtRes = .text:0x804464A0; // type:function size:0xEC +Detach__Q34nw4r3g3d16AnmObjTexSrtNodeFi = .text:0x80446590; // type:function size:0x11C +DetachAll__Q34nw4r3g3d16AnmObjTexSrtNodeFv = .text:0x804466B0; // type:function size:0x60 +UpdateFrame__Q34nw4r3g3d16AnmObjTexSrtNodeFv = .text:0x80446710; // type:function size:0x78 +SetFrame__Q34nw4r3g3d16AnmObjTexSrtNodeFf = .text:0x80446790; // type:function size:0x88 +GetFrame__Q34nw4r3g3d16AnmObjTexSrtNodeCFv = .text:0x80446820; // type:function size:0x54 +SetUpdateRate__Q34nw4r3g3d16AnmObjTexSrtNodeFf = .text:0x80446880; // type:function size:0x88 +GetUpdateRate__Q34nw4r3g3d16AnmObjTexSrtNodeCFv = .text:0x80446910; // type:function size:0x54 +Bind__Q34nw4r3g3d16AnmObjTexSrtNodeFQ34nw4r3g3d6ResMdl = .text:0x80446970; // type:function size:0xF4 +Release__Q34nw4r3g3d16AnmObjTexSrtNodeFv = .text:0x80446A70; // type:function size:0xB8 +G3dProc__Q34nw4r3g3d16AnmObjTexSrtNodeFUlUlPv = .text:0x80446B30; // type:function size:0x7C Construct__Q34nw4r3g3d20AnmObjTexSrtOverrideFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdli = .text:0x80446BB0; // type:function size:0x134 -fn_80446CF0 = .text:0x80446CF0; // type:function size:0xC0 +GetResult__Q34nw4r3g3d20AnmObjTexSrtOverrideFPQ34nw4r3g3d15TexSrtAnmResultUl = .text:0x80446CF0; // type:function size:0xC0 Construct__Q34nw4r3g3d15AnmObjTexSrtResFP12MEMAllocatorPUlQ34nw4r3g3d12ResAnmTexSrtQ34nw4r3g3d6ResMdlb = .text:0x80446DB0; // type:function size:0x1F0 -fn_80446FA0 = .text:0x80446FA0; // type:function size:0xC0 -fn_80447060 = .text:0x80447060; // type:function size:0x8 -fn_80447070 = .text:0x80447070; // type:function size:0xB4 -fn_80447130 = .text:0x80447130; // type:function size:0x8 -fn_80447140 = .text:0x80447140; // type:function size:0xE0 -fn_80447220 = .text:0x80447220; // type:function size:0xF8 -fn_80447320 = .text:0x80447320; // type:function size:0x78 -fn_804473A0 = .text:0x804473A0; // type:function size:0x44 -fn_804473F0 = .text:0x804473F0; // type:function size:0xA0 -fn_80447490 = .text:0x80447490; // type:function size:0x1AC -fn_80447640 = .text:0x80447640; // type:function size:0x68 -fn_804476B0 = .text:0x804476B0; // type:function size:0x50 -fn_80447700 = .text:0x80447700; // type:function size:0x30 -fn_80447730 = .text:0x80447730; // type:function size:0xC -fn_80447740 = .text:0x80447740; // type:function size:0x44 -fn_80447790 = .text:0x80447790; // type:function size:0x7C -fn_80447810 = .text:0x80447810; // type:function size:0x68 -fn_80447880 = .text:0x80447880; // type:function size:0x30 -fn_804478B0 = .text:0x804478B0; // type:function size:0xC -fn_804478C0 = .text:0x804478C0; // type:function size:0x68 -fn_80447930 = .text:0x80447930; // type:function size:0x30 -fn_80447960 = .text:0x80447960; // type:function size:0xC -fn_80447970 = .text:0x80447970; // type:function size:0x30 -fn_804479A0 = .text:0x804479A0; // type:function size:0xC -fn_804479B0 = .text:0x804479B0; // type:function size:0x40 -fn_804479F0 = .text:0x804479F0; // type:function size:0x8 -fn_80447A00 = .text:0x80447A00; // type:function size:0x8 -fn_80447A10 = .text:0x80447A10; // type:function size:0x4 -fn_80447A20 = .text:0x80447A20; // type:function size:0x8 -fn_80447A30 = .text:0x80447A30; // type:function size:0x4 -fn_80447A40 = .text:0x80447A40; // type:function size:0x40 -fn_80447A80 = .text:0x80447A80; // type:function size:0x64 -fn_80447AF0 = .text:0x80447AF0; // type:function size:0xEC -fn_80447BE0 = .text:0x80447BE0; // type:function size:0x11C -fn_80447D00 = .text:0x80447D00; // type:function size:0x60 -fn_80447D60 = .text:0x80447D60; // type:function size:0x78 -fn_80447DE0 = .text:0x80447DE0; // type:function size:0x88 -fn_80447E70 = .text:0x80447E70; // type:function size:0x54 -fn_80447ED0 = .text:0x80447ED0; // type:function size:0x88 -fn_80447F60 = .text:0x80447F60; // type:function size:0x54 -fn_80447FC0 = .text:0x80447FC0; // type:function size:0xF4 -fn_804480C0 = .text:0x804480C0; // type:function size:0x104 -fn_804481D0 = .text:0x804481D0; // type:function size:0xB8 -fn_80448290 = .text:0x80448290; // type:function size:0x148 -fn_804483E0 = .text:0x804483E0; // type:function size:0x7C +SetFrame__Q34nw4r3g3d15AnmObjTexSrtResFf = .text:0x80446FA0; // type:function size:0xC0 +GetFrame__Q34nw4r3g3d15AnmObjTexSrtResCFv = .text:0x80447060; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d15AnmObjTexSrtResFf = .text:0x80447070; // type:function size:0xB4 +GetUpdateRate__Q34nw4r3g3d15AnmObjTexSrtResCFv = .text:0x80447130; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d15AnmObjTexSrtResFv = .text:0x80447140; // type:function size:0xE0 +Bind__Q34nw4r3g3d15AnmObjTexSrtResFQ34nw4r3g3d6ResMdl = .text:0x80447220; // type:function size:0xF8 +GetResult__Q34nw4r3g3d15AnmObjTexSrtResFPQ34nw4r3g3d15TexSrtAnmResultUl = .text:0x80447320; // type:function size:0x78 +G3dProc__Q34nw4r3g3d15AnmObjTexSrtResFUlUlPv = .text:0x804473A0; // type:function size:0x44 +ApplyTexSrtAnmResult__Q24nw4r3g3dFQ34nw4r3g3d9ResTexSrtPCQ34nw4r3g3d15TexSrtAnmResult = .text:0x804473F0; // type:function size:0xA0 +ApplyTexSrtAnmResult__Q24nw4r3g3dFQ34nw4r3g3d9ResTexSrtQ34nw4r3g3d20ResMatIndMtxAndScalePCQ34nw4r3g3d15TexSrtAnmResult = .text:0x80447490; // type:function size:0x1AC +IsDerivedFrom__Q34nw4r3g3d15AnmObjTexSrtResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80447640; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d12AnmObjTexSrtCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804476B0; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d15AnmObjTexSrtResCFv = .text:0x80447700; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d15AnmObjTexSrtResCFv = .text:0x80447730; // type:function size:0xC +__dt__Q34nw4r3g3d15AnmObjTexSrtResFv = .text:0x80447740; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d20AnmObjTexSrtOverrideCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80447790; // type:function size:0x7C +IsDerivedFrom__Q34nw4r3g3d16AnmObjTexSrtNodeCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80447810; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d20AnmObjTexSrtOverrideCFv = .text:0x80447880; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d20AnmObjTexSrtOverrideCFv = .text:0x804478B0; // type:function size:0xC +__dt__Q34nw4r3g3d20AnmObjTexSrtOverrideFv = .text:0x804478C0; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d16AnmObjTexSrtNodeCFv = .text:0x80447930; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d16AnmObjTexSrtNodeCFv = .text:0x80447960; // type:function size:0xC +GetTypeName__Q34nw4r3g3d12AnmObjTexSrtCFv = .text:0x80447970; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjTexSrtCFv = .text:0x804479A0; // type:function size:0xC +Release__Q34nw4r3g3d9AnmObjChrFv = .text:0x804479B0; // type:function size:0x40 +Attach__Q34nw4r3g3d9AnmObjChrFiPQ34nw4r3g3d12AnmObjChrRes = .text:0x804479F0; // type:function size:0x8 +Detach__Q34nw4r3g3d9AnmObjChrFi = .text:0x80447A00; // type:function size:0x8 +SetWeight__Q34nw4r3g3d9AnmObjChrFif = .text:0x80447A10; // type:function size:0x4 +GetWeight__Q34nw4r3g3d9AnmObjChrCFi = .text:0x80447A20; // type:function size:0x8 +DetachAll__Q34nw4r3g3d9AnmObjChrFv = .text:0x80447A30; // type:function size:0x4 +__dt__Q34nw4r3g3d9AnmObjChrFv = .text:0x80447A40; // type:function size:0x40 +__dt__Q34nw4r3g3d13AnmObjChrNodeFv = .text:0x80447A80; // type:function size:0x64 +Attach__Q34nw4r3g3d13AnmObjChrNodeFiPQ34nw4r3g3d12AnmObjChrRes = .text:0x80447AF0; // type:function size:0xEC +Detach__Q34nw4r3g3d13AnmObjChrNodeFi = .text:0x80447BE0; // type:function size:0x11C +DetachAll__Q34nw4r3g3d13AnmObjChrNodeFv = .text:0x80447D00; // type:function size:0x60 +UpdateFrame__Q34nw4r3g3d13AnmObjChrNodeFv = .text:0x80447D60; // type:function size:0x78 +SetFrame__Q34nw4r3g3d13AnmObjChrNodeFf = .text:0x80447DE0; // type:function size:0x88 +GetFrame__Q34nw4r3g3d13AnmObjChrNodeCFv = .text:0x80447E70; // type:function size:0x54 +SetUpdateRate__Q34nw4r3g3d13AnmObjChrNodeFf = .text:0x80447ED0; // type:function size:0x88 +GetUpdateRate__Q34nw4r3g3d13AnmObjChrNodeCFv = .text:0x80447F60; // type:function size:0x54 +Bind__Q34nw4r3g3d13AnmObjChrNodeFQ34nw4r3g3d6ResMdl = .text:0x80447FC0; // type:function size:0xF4 +Bind__Q34nw4r3g3d13AnmObjChrNodeFQ34nw4r3g3d6ResMdlUlQ44nw4r3g3d9AnmObjChr10BindOption = .text:0x804480C0; // type:function size:0x104 +Release__Q34nw4r3g3d13AnmObjChrNodeFv = .text:0x804481D0; // type:function size:0xB8 +Release__Q34nw4r3g3d13AnmObjChrNodeFQ34nw4r3g3d6ResMdlUlQ44nw4r3g3d9AnmObjChr10BindOption = .text:0x80448290; // type:function size:0x148 +G3dProc__Q34nw4r3g3d13AnmObjChrNodeFUlUlPv = .text:0x804483E0; // type:function size:0x7C Construct__Q34nw4r3g3d14AnmObjChrBlendFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdli = .text:0x80448460; // type:function size:0x178 -fn_804485E0 = .text:0x804485E0; // type:function size:0x640 -fn_80448C20 = .text:0x80448C20; // type:function size:0x10 -fn_80448C30 = .text:0x80448C30; // type:function size:0x10 +GetResult__Q34nw4r3g3d14AnmObjChrBlendFPQ34nw4r3g3d12ChrAnmResultUl = .text:0x804485E0; // type:function size:0x640 +SetWeight__Q34nw4r3g3d14AnmObjChrBlendFif = .text:0x80448C20; // type:function size:0x10 +GetWeight__Q34nw4r3g3d14AnmObjChrBlendCFi = .text:0x80448C30; // type:function size:0x10 Construct__Q34nw4r3g3d12AnmObjChrResFP12MEMAllocatorPUlQ34nw4r3g3d9ResAnmChrQ34nw4r3g3d6ResMdlb = .text:0x80448C40; // type:function size:0x1F0 -fn_80448E30 = .text:0x80448E30; // type:function size:0xC0 -fn_80448EF0 = .text:0x80448EF0; // type:function size:0x8 -fn_80448F00 = .text:0x80448F00; // type:function size:0xB4 -fn_80448FC0 = .text:0x80448FC0; // type:function size:0x8 -fn_80448FD0 = .text:0x80448FD0; // type:function size:0xE0 -fn_804490B0 = .text:0x804490B0; // type:function size:0x104 -fn_804491C0 = .text:0x804491C0; // type:function size:0x1F4 -fn_804493C0 = .text:0x804493C0; // type:function size:0x1C8 -fn_80449590 = .text:0x80449590; // type:function size:0x74 -fn_80449610 = .text:0x80449610; // type:function size:0x44 -fn_80449660 = .text:0x80449660; // type:function size:0x68 -fn_804496D0 = .text:0x804496D0; // type:function size:0x50 -fn_80449720 = .text:0x80449720; // type:function size:0x30 -fn_80449750 = .text:0x80449750; // type:function size:0xC -fn_80449760 = .text:0x80449760; // type:function size:0x44 -fn_804497B0 = .text:0x804497B0; // type:function size:0x7C -fn_80449830 = .text:0x80449830; // type:function size:0x68 -fn_804498A0 = .text:0x804498A0; // type:function size:0x30 -fn_804498D0 = .text:0x804498D0; // type:function size:0xC -fn_804498E0 = .text:0x804498E0; // type:function size:0x68 -fn_80449950 = .text:0x80449950; // type:function size:0x30 -fn_80449980 = .text:0x80449980; // type:function size:0xC -fn_80449990 = .text:0x80449990; // type:function size:0x30 -fn_804499C0 = .text:0x804499C0; // type:function size:0xC -fn_804499D0 = .text:0x804499D0; // type:function size:0x1C -fn_804499F0 = .text:0x804499F0; // type:function size:0x40 -fn_80449A30 = .text:0x80449A30; // type:function size:0x8 -fn_80449A40 = .text:0x80449A40; // type:function size:0x8 -fn_80449A50 = .text:0x80449A50; // type:function size:0x4 -fn_80449A60 = .text:0x80449A60; // type:function size:0x8 -fn_80449A70 = .text:0x80449A70; // type:function size:0x4 -fn_80449A80 = .text:0x80449A80; // type:function size:0x40 -Construct__Q34nw4r3g3d12AnmObjShpResFP12MEMAllocatorPUlQ34nw4r3g3d9ResAnmShpQ34nw4r3g3d6ResMdli = .text:0x80449AC0; // type:function size:0x240 -fn_80449D00 = .text:0x80449D00; // type:function size:0xC4 -fn_80449DD0 = .text:0x80449DD0; // type:function size:0x8 -fn_80449DE0 = .text:0x80449DE0; // type:function size:0xB8 -fn_80449EA0 = .text:0x80449EA0; // type:function size:0x8 -fn_80449EB0 = .text:0x80449EB0; // type:function size:0xE4 -fn_80449FA0 = .text:0x80449FA0; // type:function size:0x1B4 -fn_8044A160 = .text:0x8044A160; // type:function size:0x78 -fn_8044A1E0 = .text:0x8044A1E0; // type:function size:0x44 -fn_8044A230 = .text:0x8044A230; // type:function size:0x68 -fn_8044A2A0 = .text:0x8044A2A0; // type:function size:0x50 -fn_8044A2F0 = .text:0x8044A2F0; // type:function size:0x30 -fn_8044A320 = .text:0x8044A320; // type:function size:0xC -fn_8044A330 = .text:0x8044A330; // type:function size:0x44 -fn_8044A380 = .text:0x8044A380; // type:function size:0x30 -fn_8044A3B0 = .text:0x8044A3B0; // type:function size:0xC -fn_8044A3C0 = .text:0x8044A3C0; // type:function size:0x328 -fn_8044A6F0 = .text:0x8044A6F0; // type:function size:0x4C +SetFrame__Q34nw4r3g3d12AnmObjChrResFf = .text:0x80448E30; // type:function size:0xC0 +GetFrame__Q34nw4r3g3d12AnmObjChrResCFv = .text:0x80448EF0; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d12AnmObjChrResFf = .text:0x80448F00; // type:function size:0xB4 +GetUpdateRate__Q34nw4r3g3d12AnmObjChrResCFv = .text:0x80448FC0; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d12AnmObjChrResFv = .text:0x80448FD0; // type:function size:0xE0 +Bind__Q34nw4r3g3d12AnmObjChrResFQ34nw4r3g3d6ResMdl = .text:0x804490B0; // type:function size:0x104 +Bind__Q34nw4r3g3d12AnmObjChrResFQ34nw4r3g3d6ResMdlUlQ44nw4r3g3d9AnmObjChr10BindOption = .text:0x804491C0; // type:function size:0x1F4 +Release__Q34nw4r3g3d12AnmObjChrResFQ34nw4r3g3d6ResMdlUlQ44nw4r3g3d9AnmObjChr10BindOption = .text:0x804493C0; // type:function size:0x1C8 +GetResult__Q34nw4r3g3d12AnmObjChrResFPQ34nw4r3g3d12ChrAnmResultUl = .text:0x80449590; // type:function size:0x74 +G3dProc__Q34nw4r3g3d12AnmObjChrResFUlUlPv = .text:0x80449610; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d12AnmObjChrResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80449660; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d9AnmObjChrCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804496D0; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d12AnmObjChrResCFv = .text:0x80449720; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjChrResCFv = .text:0x80449750; // type:function size:0xC +__dt__Q34nw4r3g3d12AnmObjChrResFv = .text:0x80449760; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d14AnmObjChrBlendCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804497B0; // type:function size:0x7C +IsDerivedFrom__Q34nw4r3g3d13AnmObjChrNodeCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80449830; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d14AnmObjChrBlendCFv = .text:0x804498A0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d14AnmObjChrBlendCFv = .text:0x804498D0; // type:function size:0xC +__dt__Q34nw4r3g3d14AnmObjChrBlendFv = .text:0x804498E0; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d13AnmObjChrNodeCFv = .text:0x80449950; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d13AnmObjChrNodeCFv = .text:0x80449980; // type:function size:0xC +GetTypeName__Q34nw4r3g3d9AnmObjChrCFv = .text:0x80449990; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d9AnmObjChrCFv = .text:0x804499C0; // type:function size:0xC +TestExistence__Q34nw4r3g3d9AnmObjShpCFUl = .text:0x804499D0; // type:function size:0x1C +Release__Q34nw4r3g3d9AnmObjShpFv = .text:0x804499F0; // type:function size:0x40 +Attach__Q34nw4r3g3d9AnmObjShpFiPQ34nw4r3g3d12AnmObjShpRes = .text:0x80449A30; // type:function size:0x8 +Detach__Q34nw4r3g3d9AnmObjShpFi = .text:0x80449A40; // type:function size:0x8 +SetWeight__Q34nw4r3g3d9AnmObjShpFif = .text:0x80449A50; // type:function size:0x4 +GetWeight__Q34nw4r3g3d9AnmObjShpCFi = .text:0x80449A60; // type:function size:0x8 +DetachAll__Q34nw4r3g3d9AnmObjShpFv = .text:0x80449A70; // type:function size:0x4 +__dt__Q34nw4r3g3d9AnmObjShpFv = .text:0x80449A80; // type:function size:0x40 +Construct__Q34nw4r3g3d12AnmObjShpResFP12MEMAllocatorPUlQ34nw4r3g3d9ResAnmShpQ34nw4r3g3d6ResMdlb = .text:0x80449AC0; // type:function size:0x240 +SetFrame__Q34nw4r3g3d12AnmObjShpResFf = .text:0x80449D00; // type:function size:0xC4 +GetFrame__Q34nw4r3g3d12AnmObjShpResCFv = .text:0x80449DD0; // type:function size:0x8 +SetUpdateRate__Q34nw4r3g3d12AnmObjShpResFf = .text:0x80449DE0; // type:function size:0xB8 +GetUpdateRate__Q34nw4r3g3d12AnmObjShpResCFv = .text:0x80449EA0; // type:function size:0x8 +UpdateFrame__Q34nw4r3g3d12AnmObjShpResFv = .text:0x80449EB0; // type:function size:0xE4 +Bind__Q34nw4r3g3d12AnmObjShpResFQ34nw4r3g3d6ResMdl = .text:0x80449FA0; // type:function size:0x1B4 +GetResult__Q34nw4r3g3d12AnmObjShpResFPQ34nw4r3g3d12ShpAnmResultUl = .text:0x8044A160; // type:function size:0x78 +G3dProc__Q34nw4r3g3d12AnmObjShpResFUlUlPv = .text:0x8044A1E0; // type:function size:0x44 +IsDerivedFrom__Q34nw4r3g3d12AnmObjShpResCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x8044A230; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d9AnmObjShpCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x8044A2A0; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d12AnmObjShpResCFv = .text:0x8044A2F0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12AnmObjShpResCFv = .text:0x8044A320; // type:function size:0xC +__dt__Q34nw4r3g3d12AnmObjShpResFv = .text:0x8044A330; // type:function size:0x44 +GetTypeName__Q34nw4r3g3d9AnmObjShpCFv = .text:0x8044A380; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d9AnmObjShpCFv = .text:0x8044A3B0; // type:function size:0xC +GetLightSetting__Q34nw4r3g3d6AnmScnFPQ34nw4r3g3d12LightSetting = .text:0x8044A3C0; // type:function size:0x328 +__dt__Q34nw4r3g3d6G3dObjFv = .text:0x8044A6F0; // type:function size:0x4C Destroy__Q34nw4r3g3d6G3dObjFv = .text:0x8044A740; // type:function size:0x78 DetachFromParent__Q34nw4r3g3d6G3dObjFv = .text:0x8044A7C0; // type:function size:0x58 -fn_8044A820 = .text:0x8044A820; // type:function size:0x30 -fn_8044A850 = .text:0x8044A850; // type:function size:0xC -fn_8044A860 = .text:0x8044A860; // type:function size:0x8 -fn_8044A870 = .text:0x8044A870; // type:function size:0x70 -fn_8044A8E0 = .text:0x8044A8E0; // type:function size:0x28 +GetTypeName__Q34nw4r3g3d6G3dObjCFv = .text:0x8044A820; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d6G3dObjCFv = .text:0x8044A850; // type:function size:0xC +PlayPolicy_Onetime__Q24nw4r3g3dFfff = .text:0x8044A860; // type:function size:0x8 +PlayPolicy_Loop__Q24nw4r3g3dFfff = .text:0x8044A870; // type:function size:0x70 +SetAnmFlag__Q34nw4r3g3d6AnmObjFQ44nw4r3g3d6AnmObj7AnmFlagb = .text:0x8044A8E0; // type:function size:0x28 TestAnmFlag__Q34nw4r3g3d6AnmObjCFQ44nw4r3g3d6AnmObj7AnmFlag = .text:0x8044A910; // type:function size:0x18 -fn_8044A930 = .text:0x8044A930; // type:function size:0x80 -fn_8044A9B0 = .text:0x8044A9B0; // type:function size:0x30 -fn_8044A9E0 = .text:0x8044A9E0; // type:function size:0x70 -fn_8044AA50 = .text:0x8044AA50; // type:function size:0x29C -fn_8044ACF0 = .text:0x8044ACF0; // type:function size:0x5C -fn_8044AD50 = .text:0x8044AD50; // type:function size:0x7C -fn_8044ADD0 = .text:0x8044ADD0; // type:function size:0x80 -fn_8044AE50 = .text:0x8044AE50; // type:function size:0xF8 -fn_8044AF50 = .text:0x8044AF50; // type:function size:0xC4 -fn_8044B020 = .text:0x8044B020; // type:function size:0x28 -fn_8044B050 = .text:0x8044B050; // type:function size:0x160 -fn_8044B1B0 = .text:0x8044B1B0; // type:function size:0xDC -fn_8044B290 = .text:0x8044B290; // type:function size:0xCC -fn_8044B360 = .text:0x8044B360; // type:function size:0x3D8 -fn_8044B740 = .text:0x8044B740; // type:function size:0x110 -fn_8044B850 = .text:0x8044B850; // type:function size:0x440 -fn_8044BC90 = .text:0x8044BC90; // type:function size:0x10 -fn_8044BCA0 = .text:0x8044BCA0; // type:function size:0x70 -fn_8044BD10 = .text:0x8044BD10; // type:function size:0x40 -fn_8044BD50 = .text:0x8044BD50; // type:function size:0xC -fn_8044BD60 = .text:0x8044BD60; // type:function size:0xF4 -fn_8044BE60 = .text:0x8044BE60; // type:function size:0x42C -fn_8044C290 = .text:0x8044C290; // type:function size:0x98 -fn_8044C330 = .text:0x8044C330; // type:function size:0x70 -fn_8044C3A0 = .text:0x8044C3A0; // type:function size:0x268 -fn_8044C610 = .text:0x8044C610; // type:function size:0x154 -fn_8044C770 = .text:0x8044C770; // type:function size:0x1CC -fn_8044C940 = .text:0x8044C940; // type:function size:0x210 -fn_8044CB50 = .text:0x8044CB50; // type:function size:0xAC -fn_8044CC00 = .text:0x8044CC00; // type:function size:0xAC -fn_8044CCB0 = .text:0x8044CCB0; // type:function size:0xB8 -fn_8044CD70 = .text:0x8044CD70; // type:function size:0x1D0 -fn_8044CF40 = .text:0x8044CF40; // type:function size:0x614 -fn_8044D560 = .text:0x8044D560; // type:function size:0x90 -fn_8044D5F0 = .text:0x8044D5F0; // type:function size:0x2AC -fn_8044D8A0 = .text:0x8044D8A0; // type:function size:0x1A4 -fn_8044DA50 = .text:0x8044DA50; // type:function size:0x2F0 -fn_8044DD40 = .text:0x8044DD40; // type:function size:0x88 -fn_8044DDD0 = .text:0x8044DDD0; // type:function size:0x88 -fn_8044DE60 = .text:0x8044DE60; // type:function size:0x64 -fn_8044DED0 = .text:0x8044DED0; // type:function size:0x54 -fn_8044DF30 = .text:0x8044DF30; // type:function size:0x40 -fn_8044DF70 = .text:0x8044DF70; // type:function size:0x8 -fn_8044DF80 = .text:0x8044DF80; // type:function size:0x9C -fn_8044E020 = .text:0x8044E020; // type:function size:0xB8 -fn_8044E0E0 = .text:0x8044E0E0; // type:function size:0x10 -fn_8044E0F0 = .text:0x8044E0F0; // type:function size:0x28 +GDSetGenMode2__Q34nw4r3g3d4fifoFUcUcUcUc11_GXCullMode = .text:0x8044A930; // type:function size:0x80 +GDSetCullMode__Q34nw4r3g3d4fifoF11_GXCullMode = .text:0x8044A9B0; // type:function size:0x30 +GDSetTexCoordScale2__Q34nw4r3g3d4fifoF13_GXTexCoordIDUsUcUcUsUcUc = .text:0x8044A9E0; // type:function size:0x70 +GDSetIndTexMtx__Q34nw4r3g3d4fifoFUlRCQ34nw4r4math5MTX34 = .text:0x8044AA50; // type:function size:0x29C +GDResetCurrentMtx__Q34nw4r3g3d4fifoFv = .text:0x8044ACF0; // type:function size:0x5C +GDSetCurrentMtx__Q34nw4r3g3d4fifoFPCUl = .text:0x8044AD50; // type:function size:0x7C +GDLoadTexMtxImm3x3__Q34nw4r3g3d4fifoFRCQ34nw4r4math5MTX33Ul = .text:0x8044ADD0; // type:function size:0x80 +SetTMemLayout__Q34nw4r3g3d4tmemFQ44nw4r3g3d4tmem10TMemLayout = .text:0x8044AE50; // type:function size:0xF8 +TexRegionCallback__FPC9_GXTexObj11_GXTexMapID = .text:0x8044AF50; // type:function size:0xC4 +TlutRegionCallback__FUl = .text:0x8044B020; // type:function size:0x28 +setTexRegion___F13TMemCachePlan = .text:0x8044B050; // type:function size:0x160 +Copy32ByteBlocks__Q34nw4r3g3d6detailFPvPCvUl = .text:0x8044B1B0; // type:function size:0xDC +ZeroMemory32ByteBlocks__Q34nw4r3g3d6detailFPvUl = .text:0x8044B290; // type:function size:0xCC +EnvironmentMapping__Q44nw4r3g3d6detail19ScnDependentMtxFuncFPQ34nw4r4math5MTX34ScSc = .text:0x8044B360; // type:function size:0x3D8 +ProjectionMapping__Q44nw4r3g3d6detail19ScnDependentMtxFuncFPQ34nw4r4math5MTX34ScSc = .text:0x8044B740; // type:function size:0x110 +EnvironmentSpecularMapping__Q44nw4r3g3d6detail19ScnDependentMtxFuncFPQ34nw4r4math5MTX34ScSc = .text:0x8044B850; // type:function size:0x440 +DefaultMapping__Q44nw4r3g3d6detail19ScnDependentMtxFuncFPQ34nw4r4math5MTX34ScSc = .text:0x8044BC90; // type:function size:0x10 +FifoSend__Q44nw4r3g3d8G3DState13IndTexMtxInfoCFv = .text:0x8044BCA0; // type:function size:0x70 +__dt__Q34nw4r3g3d8LightObjFv = .text:0x8044BD10; // type:function size:0x40 +__ct__Q34nw4r3g3d8LightObjFv = .text:0x8044BD50; // type:function size:0xC +SetLightSetting__Q54nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@10LightStateFRCQ34nw4r3g3d12LightSetting = .text:0x8044BD60; // type:function size:0xF4 +LoadLightSet__Q54nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@10LightStateFiPUlPUlPUlPUlPQ34nw4r3g3d11AmbLightObj = .text:0x8044BE60; // type:function size:0x42C +__ct__Q54nw4r3g3d8G3DState23@unnamed@g3d_state_cpp@14CameraMtxStateFv = .text:0x8044C290; // type:function size:0x98 +LoadResMatMisc__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d10ResMatMisc = .text:0x8044C330; // type:function size:0x70 +LoadResTexObj__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d9ResTexObj = .text:0x8044C3A0; // type:function size:0x268 +LoadResTlutObj__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d10ResTlutObj = .text:0x8044C610; // type:function size:0x154 +LoadResGenMode__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d10ResGenMode = .text:0x8044C770; // type:function size:0x1CC +LoadResTev__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d6ResTev = .text:0x8044C940; // type:function size:0x210 +LoadResMatPix__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d9ResMatPix = .text:0x8044CB50; // type:function size:0xAC +LoadResMatTevColor__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d14ResMatTevColor = .text:0x8044CC00; // type:function size:0xAC +LoadResMatIndMtxAndScale__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d20ResMatIndMtxAndScale = .text:0x8044CCB0; // type:function size:0xB8 +LoadResMatIndMtxAndScale__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d20ResMatIndMtxAndScaleRQ44nw4r3g3d8G3DState8IndMtxOp = .text:0x8044CD70; // type:function size:0x1D0 +LoadResMatChan__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d10ResMatChanUlUlUlUl8_GXColorb = .text:0x8044CF40; // type:function size:0x614 +LoadResMatTexCoordGen__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d17ResMatTexCoordGen = .text:0x8044D560; // type:function size:0x90 +LoadResTexSrt__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d9ResTexSrt = .text:0x8044D5F0; // type:function size:0x2AC +LoadResShpPrePrimitive__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d6ResShp = .text:0x8044D8A0; // type:function size:0x1A4 +LoadResShpPrimitive__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d6ResShpPCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34 = .text:0x8044DA50; // type:function size:0x2F0 +SetViewPosNrmMtxArray__Q34nw4r3g3d8G3DStateFPCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34 = .text:0x8044DD40; // type:function size:0x88 +GetViewNrmMtxPtr__Q34nw4r3g3d8G3DStateFUl = .text:0x8044DDD0; // type:function size:0x88 +SetScnDependentTexMtxFunc__Q34nw4r3g3d8G3DStateFUlPFPQ34nw4r4math5MTX34ScSc_vQ44nw4r3g3d8G3DState26ScnDependentTexMtxFuncType = .text:0x8044DE60; // type:function size:0x64 +GetScnDependentTexMtxFunc__Q34nw4r3g3d8G3DStateFUlPPFPQ34nw4r4math5MTX34ScSc_vPQ44nw4r3g3d8G3DState26ScnDependentTexMtxFuncType = .text:0x8044DED0; // type:function size:0x54 +__dt__Q44nw4r3g3d8G3DState11IndMtxOpStdFv = .text:0x8044DF30; // type:function size:0x40 +GetIndMtxOp__Q34nw4r3g3d8G3DStateFv = .text:0x8044DF70; // type:function size:0x8 +SetFog__Q34nw4r3g3d8G3DStateFQ34nw4r3g3d3Fogi = .text:0x8044DF80; // type:function size:0x9C +LoadFog__Q34nw4r3g3d8G3DStateFi = .text:0x8044E020; // type:function size:0xB8 +SetLightSetting__Q34nw4r3g3d8G3DStateFRCQ34nw4r3g3d12LightSetting = .text:0x8044E0E0; // type:function size:0x10 +GetLightObj__Q34nw4r3g3d8G3DStateFi = .text:0x8044E0F0; // type:function size:0x28 LoadLightSet__Q34nw4r3g3d8G3DStateFiPUlPUlPUlPUlPQ34nw4r3g3d11AmbLightObj = .text:0x8044E120; // type:function size:0x5C -fn_8044E180 = .text:0x8044E180; // type:function size:0xA4 -fn_8044E230 = .text:0x8044E230; // type:function size:0x1C -fn_8044E250 = .text:0x8044E250; // type:function size:0x68 +SetCameraProjMtx__Q34nw4r3g3d8G3DStateFRCQ34nw4r3g3d6Cameraib = .text:0x8044E180; // type:function size:0xA4 +GetCameraMtxPtr__Q34nw4r3g3d8G3DStateFv = .text:0x8044E230; // type:function size:0x1C +GetInvCameraMtxPtr__Q34nw4r3g3d8G3DStateFv = .text:0x8044E250; // type:function size:0x68 SetRenderModeObj__Q34nw4r3g3d8G3DStateFRC16_GXRenderModeObj = .text:0x8044E2C0; // type:function size:0xD4 -fn_8044E3A0 = .text:0x8044E3A0; // type:function size:0xC +GetRenderModeObj__Q34nw4r3g3d8G3DStateFv = .text:0x8044E3A0; // type:function size:0xC Invalidate__Q34nw4r3g3d8G3DStateFUl = .text:0x8044E3B0; // type:function size:0x16C -fn_8044E520 = .text:0x8044E520; // type:function size:0x15C -fn_8044E680 = .text:0x8044E680; // type:function size:0x50 -fn_8044E6D0 = .text:0x8044E6D0; // type:function size:0x16C -fn_8044E840 = .text:0x8044E840; // type:function size:0x270 -fn_8044EAB0 = .text:0x8044EAB0; // type:function size:0x494 +SetNrmMapMtx__Q44nw4r3g3d8G3DState11IndMtxOpStdF14_GXIndTexMtxIDPCQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34Q44nw4r3g3d14ResMatMiscData14IndirectMethod = .text:0x8044E520; // type:function size:0x15C +Reset__Q44nw4r3g3d8G3DState11IndMtxOpStdFv = .text:0x8044E680; // type:function size:0x50 +__cl__Q44nw4r3g3d8G3DState11IndMtxOpStdFPQ44nw4r3g3d8G3DState13IndTexMtxInfo = .text:0x8044E6D0; // type:function size:0x16C +__sinit_\g3d_state_cpp = .text:0x8044E840; // type:function size:0x270 +LoadMaterial__Q34nw4r3g3d6detailFQ34nw4r3g3d6ResMatUlPQ34nw4r3g3d16Draw1Mat1ShpSwapPQ44nw4r3g3d8G3DState8IndMtxOpb = .text:0x8044EAB0; // type:function size:0x494 Draw1Mat1ShpDirectly__Q24nw4r3g3dFQ34nw4r3g3d6ResMatQ34nw4r3g3d6ResShpPCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34UlPQ34nw4r3g3d16Draw1Mat1ShpSwapPQ44nw4r3g3d8G3DState8IndMtxOp = .text:0x8044EF50; // type:function size:0x8A4 -fn_8044F800 = .text:0x8044F800; // type:function size:0xC0 -fn_8044F8C0 = .text:0x8044F8C0; // type:function size:0xD8 -fn_8044F9A0 = .text:0x8044F9A0; // type:function size:0x260 -fn_8044FC00 = .text:0x8044FC00; // type:function size:0x368 -fn_8044FF70 = .text:0x8044FF70; // type:function size:0x30C -fn_80450280 = .text:0x80450280; // type:function size:0x408 -fn_80450690 = .text:0x80450690; // type:function size:0x304 -fn_804509A0 = .text:0x804509A0; // type:function size:0x334 -fn_80450CE0 = .text:0x80450CE0; // type:function size:0x33C -fn_80451020 = .text:0x80451020; // type:function size:0x4DC -fn_80451500 = .text:0x80451500; // type:function size:0x59C -fn_80451AA0 = .text:0x80451AA0; // type:function size:0x88 -fn_80451B30 = .text:0x80451B30; // type:function size:0x54 -fn_80451B90 = .text:0x80451B90; // type:function size:0xC -fn_80451BA0 = .text:0x80451BA0; // type:function size:0x10 -fn_80451BB0 = .text:0x80451BB0; // type:function size:0xC -fn_80451BC0 = .text:0x80451BC0; // type:function size:0xC -fn_80451BD0 = .text:0x80451BD0; // type:function size:0xC -fn_80451BE0 = .text:0x80451BE0; // type:function size:0x80 -fn_80451C60 = .text:0x80451C60; // type:function size:0x5C4 -fn_80452230 = .text:0x80452230; // type:function size:0x30 -fn_80452260 = .text:0x80452260; // type:function size:0x4EC -fn_80452750 = .text:0x80452750; // type:function size:0x51C -fn_80452C70 = .text:0x80452C70; // type:function size:0x1C8 -fn_80452E40 = .text:0x80452E40; // type:function size:0x140 -fn_80452F80 = .text:0x80452F80; // type:function size:0x1C4 -fn_80453150 = .text:0x80453150; // type:function size:0x110 -fn_80453260 = .text:0x80453260; // type:function size:0x160 -fn_804533C0 = .text:0x804533C0; // type:function size:0x164 -fn_80453530 = .text:0x80453530; // type:function size:0x228 -fn_80453760 = .text:0x80453760; // type:function size:0x3C -fn_804537A0 = .text:0x804537A0; // type:function size:0x64 -fn_80453810 = .text:0x80453810; // type:function size:0x5BC -fn_80453DD0 = .text:0x80453DD0; // type:function size:0x5BC -fn_80454390 = .text:0x80454390; // type:function size:0x260 -fn_804545F0 = .text:0x804545F0; // type:function size:0x8 -fn_80454600 = .text:0x80454600; // type:function size:0x50 -fn_80454650 = .text:0x80454650; // type:function size:0x11C -fn_80454770 = .text:0x80454770; // type:function size:0x28 -fn_804547A0 = .text:0x804547A0; // type:function size:0x21C -fn_804549C0 = .text:0x804549C0; // type:function size:0x48 -fn_80454A10 = .text:0x80454A10; // type:function size:0x38 -fn_80454A50 = .text:0x80454A50; // type:function size:0x40 -fn_80454A90 = .text:0x80454A90; // type:function size:0x4C -fn_80454AE0 = .text:0x80454AE0; // type:function size:0x20 -fn_80454B00 = .text:0x80454B00; // type:function size:0x20 -fn_80454B20 = .text:0x80454B20; // type:function size:0x18 -fn_80454B40 = .text:0x80454B40; // type:function size:0x9C -fn_80454BE0 = .text:0x80454BE0; // type:function size:0x18 -fn_80454C00 = .text:0x80454C00; // type:function size:0x70 -fn_80454C70 = .text:0x80454C70; // type:function size:0x1DC +GetModelLocalAxisY2__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34 = .text:0x8044F800; // type:function size:0xC0 +GetModelLocalAxisY3__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34 = .text:0x8044F8C0; // type:function size:0xD8 +Calc_BILLBOARD_STD__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x8044F9A0; // type:function size:0x260 +Calc_BILLBOARD_PERSP_STD__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x8044FC00; // type:function size:0x368 +Calc_BILLBOARD_ROT__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x8044FF70; // type:function size:0x30C +Calc_BILLBOARD_PERSP_ROT__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x80450280; // type:function size:0x408 +Calc_BILLBOARD_Y__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x80450690; // type:function size:0x304 +Calc_BILLBOARD_PERSP_Y__Q34nw4r3g3d26@unnamed@g3d_calcview_cpp@FPQ34nw4r4math5MTX34PCQ34nw4r4math5MTX34bPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlUl = .text:0x804509A0; // type:function size:0x334 +CalcView__Q24nw4r3g3dFPQ34nw4r4math5MTX34PQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34PCUlUlPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r4math5MTX34 = .text:0x80450CE0; // type:function size:0x33C +CalcView_LC__Q24nw4r3g3dFPQ34nw4r4math5MTX34PQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34PCUlUlPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r4math5MTX34 = .text:0x80451020; // type:function size:0x4DC +CalcView_LC_DMA_ModelMtx__Q24nw4r3g3dFPQ34nw4r4math5MTX34PQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34PCUlUlPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r4math5MTX34 = .text:0x80451500; // type:function size:0x59C +CalcTexMtx__Q24nw4r3g3dFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4FlagQ44nw4r3g3d13TexSrtTypedef13TexMatrixMode = .text:0x80451AA0; // type:function size:0x88 +CalcTexMtx__Q24nw4r3g3dFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4Flag = .text:0x80451B30; // type:function size:0x54 +GetScaleTemporary__Q44nw4r3g3d6detail7workmemFv = .text:0x80451B90; // type:function size:0xC +GetMtxIDTemporary__Q44nw4r3g3d6detail7workmemFv = .text:0x80451BA0; // type:function size:0x10 +GetMdlZTemporary__Q44nw4r3g3d6detail7workmemFv = .text:0x80451BB0; // type:function size:0xC +GetSkinningMtxTemporary__Q44nw4r3g3d6detail7workmemFv = .text:0x80451BC0; // type:function size:0xC +GetBillboardMtxTemporary__Q44nw4r3g3d6detail7workmemFv = .text:0x80451BD0; // type:function size:0xC +SetScale__Q34nw4r3g3d13WorldMtxManipFfff = .text:0x80451BE0; // type:function size:0x80 +CalcWorld__Q24nw4r3g3dFPQ34nw4r4math5MTX34PUlPCUcPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r3g3d9AnmObjChrPQ34nw4r3g3d16FuncObjCalcWorldUl = .text:0x80451C60; // type:function size:0x5C4 +CalcWorld__Q24nw4r3g3dFPQ34nw4r4math5MTX34PUlPCUcPCQ34nw4r4math5MTX34Q34nw4r3g3d6ResMdlPQ34nw4r3g3d9AnmObjChrPQ34nw4r3g3d16FuncObjCalcWorld = .text:0x80452230; // type:function size:0x30 +CalcSkinning__Q24nw4r3g3dFPQ34nw4r4math5MTX34PUlQ34nw4r3g3d6ResMdlPCUc = .text:0x80452260; // type:function size:0x4EC +GetIndMtxOp__Q34nw4r3g3d6detailFQ34nw4r3g3d6ResMatQ34nw4r3g3d7ResNodeQ34nw4r3g3d6ResShp = .text:0x80452750; // type:function size:0x51C +SetupDraw1Mat1ShpSwap__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FPQ34nw4r3g3d16Draw1Mat1ShpSwapPQ34nw4r3g3d21DrawResMdlReplacementUl = .text:0x80452C70; // type:function size:0x1C8 +DrawResMdlLoop__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FQ34nw4r3g3d6ResMdlPCUcUl = .text:0x80452E40; // type:function size:0x140 +DrawResMdlLoop__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FQ34nw4r3g3d6ResMdlPCUcPQ34nw4r3g3d21DrawResMdlReplacementUl = .text:0x80452F80; // type:function size:0x1C4 +DrawResMdlLoop__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FQ34nw4r3g3d6ResMdlPCQ54nw4r3g3d6detail7workmem4MdlZUlUl = .text:0x80453150; // type:function size:0x110 +DrawResMdlLoop__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FQ34nw4r3g3d6ResMdlPCQ54nw4r3g3d6detail7workmem4MdlZUlPQ34nw4r3g3d21DrawResMdlReplacementUl = .text:0x80453260; // type:function size:0x160 +SetUpMdlZ__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FPUlQ34nw4r3g3d6ResMdlPCQ34nw4r4math5MTX34PCUcPQ34nw4r3g3d21DrawResMdlReplacement = .text:0x804533C0; // type:function size:0x164 +DrawResMdlDirectly__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPCQ34nw4r4math5MTX34PCQ34nw4r4math5MTX33PCQ34nw4r4math5MTX34PCUcPCUcPQ34nw4r3g3d21DrawResMdlReplacementUl = .text:0x80453530; // type:function size:0x228 +FrontToBack__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FRCQ54nw4r3g3d6detail7workmem4MdlZRCQ54nw4r3g3d6detail7workmem4MdlZ = .text:0x80453760; // type:function size:0x3C +BackToFront__Q34nw4r3g3d22@unnamed@g3d_draw_cpp@FRCQ54nw4r3g3d6detail7workmem4MdlZRCQ54nw4r3g3d6detail7workmem4MdlZ = .text:0x804537A0; // type:function size:0x64 +sort__3stdFPQ54nw4r3g3d6detail7workmem4MdlZPQ54nw4r3g3d6detail7workmem4MdlZPFRCQ54nw4r3g3d6detail7workmem4MdlZRCQ54nw4r3g3d6detail7workmem4MdlZ_b_v = .text:0x80453810; // type:function size:0x5BC +sort__3stdFPQ54nw4r3g3d6detail7workmem4MdlZPQ54nw4r3g3d6detail7workmem4MdlZRPFRCQ54nw4r3g3d6detail7workmem4MdlZRCQ54nw4r3g3d6detail7workmem4MdlZ_b_v = .text:0x80453DD0; // type:function size:0x5BC +__sort132__3stdFPQ54nw4r3g3d6detail7workmem4MdlZPQ54nw4r3g3d6detail7workmem4MdlZPQ54nw4r3g3d6detail7workmem4MdlZRPFRCQ54nw4r3g3d6detail7workmem4MdlZRCQ54nw4r3g3d6detail7workmem4MdlZ_b_v = .text:0x80454390; // type:function size:0x260 +__ct__Q34nw4r3g3d6CameraFPQ34nw4r3g3d10CameraData = .text:0x804545F0; // type:function size:0x8 +Init__Q34nw4r3g3d6CameraFv = .text:0x80454600; // type:function size:0x50 +Init__Q34nw4r3g3d6CameraFUsUsUsUsUsUs = .text:0x80454650; // type:function size:0x11C +SetPosition__Q34nw4r3g3d6CameraFfff = .text:0x80454770; // type:function size:0x28 +SetPosture__Q34nw4r3g3d6CameraFRCQ44nw4r3g3d6Camera11PostureInfo = .text:0x804547A0; // type:function size:0x21C +SetCameraMtxDirectly__Q34nw4r3g3d6CameraFRCQ34nw4r4math5MTX34 = .text:0x804549C0; // type:function size:0x48 +SetPerspective__Q34nw4r3g3d6CameraFffff = .text:0x80454A10; // type:function size:0x38 +SetOrtho__Q34nw4r3g3d6CameraFffffff = .text:0x80454A50; // type:function size:0x40 +SetProjectionMtxDirectly__Q34nw4r3g3d6CameraFPCQ34nw4r4math5MTX44 = .text:0x80454A90; // type:function size:0x4C +SetTexMtxParam__Q34nw4r3g3d6CameraFffff = .text:0x80454AE0; // type:function size:0x20 +SetScissor__Q34nw4r3g3d6CameraFUlUlUlUl = .text:0x80454B00; // type:function size:0x20 +SetScissorBoxOffset__Q34nw4r3g3d6CameraFll = .text:0x80454B20; // type:function size:0x18 +SetViewport__Q34nw4r3g3d6CameraFffff = .text:0x80454B40; // type:function size:0x9C +SetViewportZRange__Q34nw4r3g3d6CameraFff = .text:0x80454BE0; // type:function size:0x18 +GetViewport__Q34nw4r3g3d6CameraCFPfPfPfPfPfPf = .text:0x80454C00; // type:function size:0x70 +Project__Q34nw4r3g3d6CameraCFPQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3 = .text:0x80454C70; // type:function size:0x1DC GetCameraMtx__Q34nw4r3g3d6CameraCFPQ34nw4r4math5MTX34 = .text:0x80454E50; // type:function size:0x60 -fn_80454EB0 = .text:0x80454EB0; // type:function size:0xDC -fn_80454F90 = .text:0x80454F90; // type:function size:0xD0 -fn_80455060 = .text:0x80455060; // type:function size:0x80 -fn_804550E0 = .text:0x804550E0; // type:function size:0x84 -fn_80455170 = .text:0x80455170; // type:function size:0xC8 -fn_80455240 = .text:0x80455240; // type:function size:0x24 -fn_80455270 = .text:0x80455270; // type:function size:0x1C -fn_80455290 = .text:0x80455290; // type:function size:0x41C -fn_804556B0 = .text:0x804556B0; // type:function size:0x15C -fn_80455810 = .text:0x80455810; // type:function size:0x168 -fn_80455980 = .text:0x80455980; // type:function size:0x38 -fn_804559C0 = .text:0x804559C0; // type:function size:0x94 -fn_80455A60 = .text:0x80455A60; // type:function size:0x38 -fn_80455AA0 = .text:0x80455AA0; // type:function size:0xBC -fn_80455B60 = .text:0x80455B60; // type:function size:0xB0 -fn_80455C10 = .text:0x80455C10; // type:function size:0x50 -fn_80455C60 = .text:0x80455C60; // type:function size:0xDC -fn_80455D40 = .text:0x80455D40; // type:function size:0x78 -fn_80455DC0 = .text:0x80455DC0; // type:function size:0x130 -fn_80455EF0 = .text:0x80455EF0; // type:function size:0x28 -fn_80455F20 = .text:0x80455F20; // type:function size:0x194 -fn_804560C0 = .text:0x804560C0; // type:function size:0x150 -fn_80456210 = .text:0x80456210; // type:function size:0x88 -fn_804562A0 = .text:0x804562A0; // type:function size:0x1A8 -fn_80456450 = .text:0x80456450; // type:function size:0x9C -fn_804564F0 = .text:0x804564F0; // type:function size:0x194 -fn_80456690 = .text:0x80456690; // type:function size:0x38 -fn_804566D0 = .text:0x804566D0; // type:function size:0x88 -fn_80456760 = .text:0x80456760; // type:function size:0x38 -fn_804567A0 = .text:0x804567A0; // type:function size:0xA0 -fn_80456840 = .text:0x80456840; // type:function size:0xC8 -fn_80456910 = .text:0x80456910; // type:function size:0x50 -fn_80456960 = .text:0x80456960; // type:function size:0xC8 -fn_80456A30 = .text:0x80456A30; // type:function size:0x78 -fn_80456AB0 = .text:0x80456AB0; // type:function size:0x110 -fn_80456BC0 = .text:0x80456BC0; // type:function size:0x24 -fn_80456BF0 = .text:0x80456BF0; // type:function size:0x13C -fn_80456D30 = .text:0x80456D30; // type:function size:0x12C -fn_80456E60 = .text:0x80456E60; // type:function size:0x88 -fn_80456EF0 = .text:0x80456EF0; // type:function size:0x15C -fn_80457050 = .text:0x80457050; // type:function size:0x9C -fn_804570F0 = .text:0x804570F0; // type:function size:0x1B4 -fn_804572B0 = .text:0x804572B0; // type:function size:0x48 -fn_80457300 = .text:0x80457300; // type:function size:0xAC -fn_804573B0 = .text:0x804573B0; // type:function size:0x38 -fn_804573F0 = .text:0x804573F0; // type:function size:0xB4 -fn_804574B0 = .text:0x804574B0; // type:function size:0xCC -fn_80457580 = .text:0x80457580; // type:function size:0x58 -fn_804575E0 = .text:0x804575E0; // type:function size:0xCC -fn_804576B0 = .text:0x804576B0; // type:function size:0x80 -fn_80457730 = .text:0x80457730; // type:function size:0x124 -fn_80457860 = .text:0x80457860; // type:function size:0x24 -fn_80457890 = .text:0x80457890; // type:function size:0x144 -fn_804579E0 = .text:0x804579E0; // type:function size:0x140 -fn_80457B20 = .text:0x80457B20; // type:function size:0x94 -fn_80457BC0 = .text:0x80457BC0; // type:function size:0x164 -fn_80457D30 = .text:0x80457D30; // type:function size:0x9C -fn_80457DD0 = .text:0x80457DD0; // type:function size:0xA8 -fn_80457E80 = .text:0x80457E80; // type:function size:0x14 -fn_80457EA0 = .text:0x80457EA0; // type:function size:0xEC -fn_80457F90 = .text:0x80457F90; // type:function size:0x80 -fn_80458010 = .text:0x80458010; // type:function size:0x198 -fn_804581B0 = .text:0x804581B0; // type:function size:0xD0 +GetProjectionMtx__Q34nw4r3g3d6CameraCFPQ34nw4r4math5MTX44 = .text:0x80454EB0; // type:function size:0xDC +GetProjectionTexMtx__Q34nw4r3g3d6CameraCFPQ34nw4r4math5MTX34 = .text:0x80454F90; // type:function size:0xD0 +GetEnvironmentTexMtx__Q34nw4r3g3d6CameraCFPQ34nw4r4math5MTX34 = .text:0x80455060; // type:function size:0x80 +GXSetViewport__Q34nw4r3g3d6CameraCFv = .text:0x804550E0; // type:function size:0x84 +GXSetProjection__Q34nw4r3g3d6CameraCFv = .text:0x80455170; // type:function size:0xC8 +GXSetScissor__Q34nw4r3g3d6CameraCFv = .text:0x80455240; // type:function size:0x24 +GXSetScissorBoxOffset__Q34nw4r3g3d6CameraCFv = .text:0x80455270; // type:function size:0x1C +UpdateCameraMtx__Q34nw4r3g3d6CameraCFv = .text:0x80455290; // type:function size:0x41C +CalcTexMtx_Basic__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4Flag = .text:0x804556B0; // type:function size:0x15C +CalcWorldMtx_Basic__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34PQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34PCQ34nw4r4math4VEC3UlPCQ34nw4r3g3d12ChrAnmResult = .text:0x80455810; // type:function size:0x168 +MakeTexSrtMtx_S__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455980; // type:function size:0x38 +MakeTexSrtMtx_R__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804559C0; // type:function size:0x94 +MakeTexSrtMtx_T__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455A60; // type:function size:0x38 +MakeTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455AA0; // type:function size:0xBC +MakeTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455B60; // type:function size:0xB0 +MakeTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455C10; // type:function size:0x50 +MakeTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455C60; // type:function size:0xDC +ProductTexSrtMtx_S__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455D40; // type:function size:0x78 +ProductTexSrtMtx_R__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455DC0; // type:function size:0x130 +ProductTexSrtMtx_T__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455EF0; // type:function size:0x28 +ProductTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80455F20; // type:function size:0x194 +ProductTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804560C0; // type:function size:0x150 +ProductTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456210; // type:function size:0x88 +ProductTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc22@unnamed@g3d_maya_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804562A0; // type:function size:0x1A8 +CalcTexMtx_Maya__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4Flag = .text:0x80456450; // type:function size:0x9C +CalcWorldMtx_Maya_SSC_Apply__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34PQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34PCQ34nw4r4math4VEC3UlPCQ34nw4r3g3d12ChrAnmResult = .text:0x804564F0; // type:function size:0x194 +MakeTexSrtMtx_S__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456690; // type:function size:0x38 +MakeTexSrtMtx_R__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804566D0; // type:function size:0x88 +MakeTexSrtMtx_T__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456760; // type:function size:0x38 +MakeTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804567A0; // type:function size:0xA0 +MakeTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456840; // type:function size:0xC8 +MakeTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456910; // type:function size:0x50 +MakeTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456960; // type:function size:0xC8 +ProductTexSrtMtx_S__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456A30; // type:function size:0x78 +ProductTexSrtMtx_R__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456AB0; // type:function size:0x110 +ProductTexSrtMtx_T__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456BC0; // type:function size:0x24 +ProductTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456BF0; // type:function size:0x13C +ProductTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456D30; // type:function size:0x12C +ProductTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456E60; // type:function size:0x88 +ProductTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc21@unnamed@g3d_xsi_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80456EF0; // type:function size:0x15C +CalcTexMtx_Xsi__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4Flag = .text:0x80457050; // type:function size:0x9C +CalcWorldMtx_Xsi__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34PQ34nw4r4math4VEC3PCQ34nw4r4math5MTX34PCQ34nw4r4math4VEC3UlPCQ34nw4r3g3d12ChrAnmResult = .text:0x804570F0; // type:function size:0x1B4 +MakeTexSrtMtx_S__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804572B0; // type:function size:0x48 +MakeTexSrtMtx_R__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457300; // type:function size:0xAC +MakeTexSrtMtx_T__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804573B0; // type:function size:0x38 +MakeTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804573F0; // type:function size:0xB4 +MakeTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804574B0; // type:function size:0xCC +MakeTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457580; // type:function size:0x58 +MakeTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804575E0; // type:function size:0xCC +ProductTexSrtMtx_S__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804576B0; // type:function size:0x80 +ProductTexSrtMtx_R__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457730; // type:function size:0x124 +ProductTexSrtMtx_T__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457860; // type:function size:0x24 +ProductTexSrtMtx_SR__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457890; // type:function size:0x144 +ProductTexSrtMtx_RT__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x804579E0; // type:function size:0x140 +ProductTexSrtMtx_ST__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457B20; // type:function size:0x94 +ProductTexSrtMtx_SRT__Q54nw4r3g3d6detail3dcc24@unnamed@g3d_3dsmax_cpp@FPQ34nw4r4math5MTX34RCQ34nw4r3g3d6TexSrt = .text:0x80457BC0; // type:function size:0x164 +CalcTexMtx_3dsmax__Q44nw4r3g3d6detail3dccFPQ34nw4r4math5MTX34bRCQ34nw4r3g3d6TexSrtQ44nw4r3g3d6TexSrt4Flag = .text:0x80457D30; // type:function size:0x9C +CalcWorldMtx__Q34nw4r3g3d6ScnObjFPCQ34nw4r4math5MTX34PUl = .text:0x80457DD0; // type:function size:0xA8 +CalcViewMtx__Q34nw4r3g3d6ScnObjFPCQ34nw4r4math5MTX34 = .text:0x80457E80; // type:function size:0x14 +__ct__Q34nw4r3g3d6ScnObjFP12MEMAllocator = .text:0x80457EA0; // type:function size:0xEC +__dt__Q34nw4r3g3d6ScnObjFv = .text:0x80457F90; // type:function size:0x80 +SetScnObjOption__Q34nw4r3g3d6ScnObjFUlUl = .text:0x80458010; // type:function size:0x198 +GetScnObjOption__Q34nw4r3g3d6ScnObjCFUlPUl = .text:0x804581B0; // type:function size:0xD0 SetMtx__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj13ScnObjMtxTypePCQ34nw4r4math5MTX34 = .text:0x80458280; // type:function size:0x8C -fn_80458310 = .text:0x80458310; // type:function size:0x5C +SetMtx__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj13ScnObjMtxTypeRCQ34nw4r4math5MTX34 = .text:0x80458310; // type:function size:0x5C GetMtx__Q34nw4r3g3d6ScnObjCFQ44nw4r3g3d6ScnObj13ScnObjMtxTypePQ34nw4r4math5MTX34 = .text:0x80458370; // type:function size:0x4C -fn_804583C0 = .text:0x804583C0; // type:function size:0xC -fn_804583D0 = .text:0x804583D0; // type:function size:0x8 +GetValueForSortOpa__Q34nw4r3g3d6ScnObjCFv = .text:0x804583C0; // type:function size:0xC +GetValueForSortXlu__Q34nw4r3g3d6ScnObjCFv = .text:0x804583D0; // type:function size:0x8 SetPriorityDrawOpa__Q34nw4r3g3d6ScnObjFi = .text:0x804583E0; // type:function size:0x24 SetPriorityDrawXlu__Q34nw4r3g3d6ScnObjFi = .text:0x80458410; // type:function size:0x24 EnableScnObjCallbackTiming__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj6Timing = .text:0x80458440; // type:function size:0x40 -fn_80458480 = .text:0x80458480; // type:function size:0x40 +DisableScnObjCallbackTiming__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj6Timing = .text:0x80458480; // type:function size:0x40 EnableScnObjCallbackExecOp__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj6ExecOp = .text:0x804584C0; // type:function size:0x14 -fn_804584E0 = .text:0x804584E0; // type:function size:0x80 -fn_80458560 = .text:0x80458560; // type:function size:0x4 -fn_80458570 = .text:0x80458570; // type:function size:0x60 -fn_804585D0 = .text:0x804585D0; // type:function size:0x38 -fn_80458610 = .text:0x80458610; // type:function size:0x40 -fn_80458650 = .text:0x80458650; // type:function size:0x44 -fn_804586A0 = .text:0x804586A0; // type:function size:0xF4 -fn_804587A0 = .text:0x804587A0; // type:function size:0x40 -fn_804587E0 = .text:0x804587E0; // type:function size:0x2DC -fn_80458AC0 = .text:0x80458AC0; // type:function size:0x138 -fn_80458C00 = .text:0x80458C00; // type:function size:0x118 -fn_80458D20 = .text:0x80458D20; // type:function size:0x3C -fn_80458D60 = .text:0x80458D60; // type:function size:0x464 -fn_804591D0 = .text:0x804591D0; // type:function size:0x18C -fn_80459360 = .text:0x80459360; // type:function size:0xC0 -fn_80459420 = .text:0x80459420; // type:function size:0x88 -fn_804594B0 = .text:0x804594B0; // type:function size:0x70 -fn_80459520 = .text:0x80459520; // type:function size:0xB8 -fn_804595E0 = .text:0x804595E0; // type:function size:0x50 -fn_80459630 = .text:0x80459630; // type:function size:0x38 -fn_80459670 = .text:0x80459670; // type:function size:0x30 -fn_804596A0 = .text:0x804596A0; // type:function size:0xC -fn_804596B0 = .text:0x804596B0; // type:function size:0x50 -fn_80459700 = .text:0x80459700; // type:function size:0x30 -fn_80459730 = .text:0x80459730; // type:function size:0xC -fn_80459740 = .text:0x80459740; // type:function size:0x84 -fn_804597D0 = .text:0x804597D0; // type:function size:0x30 -fn_80459800 = .text:0x80459800; // type:function size:0xC +SetBoundingVolume__Q34nw4r3g3d6ScnObjFQ44nw4r3g3d6ScnObj24ScnObjBoundingVolumeTypePCQ34nw4r4math4AABB = .text:0x804584E0; // type:function size:0x80 +GetBoundingVolume__Q34nw4r3g3d6ScnObjCFQ44nw4r3g3d6ScnObj24ScnObjBoundingVolumeTypePQ34nw4r4math4AABB = .text:0x80458570; // type:function size:0x60 +ForEach__Q34nw4r3g3d7ScnLeafFPFPQ34nw4r3g3d6ScnObjPv_Q44nw4r3g3d6ScnObj13ForEachResultPvb = .text:0x804585D0; // type:function size:0x38 +SetScnObjOption__Q34nw4r3g3d7ScnLeafFUlUl = .text:0x80458610; // type:function size:0x40 +GetScnObjOption__Q34nw4r3g3d7ScnLeafCFUlPUl = .text:0x80458650; // type:function size:0x44 +CalcWorldMtx__Q34nw4r3g3d7ScnLeafFPCQ34nw4r4math5MTX34PUl = .text:0x804586A0; // type:function size:0xF4 +GetScaleProperty__Q34nw4r3g3d7ScnLeafCFv = .text:0x804587A0; // type:function size:0x40 +DefG3dProcScnLeaf__Q34nw4r3g3d7ScnLeafFUlUlPv = .text:0x804587E0; // type:function size:0x2DC +ForEach__Q34nw4r3g3d8ScnGroupFPFPQ34nw4r3g3d6ScnObjPv_Q44nw4r3g3d6ScnObj13ForEachResultPvb = .text:0x80458AC0; // type:function size:0x138 +ScnGroup_G3DPROC_GATHER_SCNOBJ__Q34nw4r3g3d8ScnGroupFUlPQ34nw4r3g3d13IScnObjGather = .text:0x80458C00; // type:function size:0x118 +G3dProc__Q34nw4r3g3d8ScnGroupFUlUlPv = .text:0x80458D20; // type:function size:0x3C +DefG3dProcScnGroup__Q34nw4r3g3d8ScnGroupFUlUlPv = .text:0x80458D60; // type:function size:0x464 +Insert__Q34nw4r3g3d8ScnGroupFUlPQ34nw4r3g3d6ScnObj = .text:0x804591D0; // type:function size:0x18C +Remove__Q34nw4r3g3d8ScnGroupFUl = .text:0x80459360; // type:function size:0xC0 +Remove__Q34nw4r3g3d8ScnGroupFPQ34nw4r3g3d6ScnObj = .text:0x80459420; // type:function size:0x88 +__ct__Q34nw4r3g3d8ScnGroupFP12MEMAllocatorPPQ34nw4r3g3d6ScnObjUl = .text:0x804594B0; // type:function size:0x70 +__dt__Q34nw4r3g3d8ScnGroupFv = .text:0x80459520; // type:function size:0xB8 +IsDerivedFrom__Q34nw4r3g3d8ScnGroupCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804595E0; // type:function size:0x50 +IsDerivedFrom__Q34nw4r3g3d6ScnObjCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80459630; // type:function size:0x38 +GetTypeName__Q34nw4r3g3d8ScnGroupCFv = .text:0x80459670; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d8ScnGroupCFv = .text:0x804596A0; // type:function size:0xC +IsDerivedFrom__Q34nw4r3g3d7ScnLeafCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x804596B0; // type:function size:0x50 +GetTypeName__Q34nw4r3g3d7ScnLeafCFv = .text:0x80459700; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d7ScnLeafCFv = .text:0x80459730; // type:function size:0xC +__dt__Q34nw4r3g3d7ScnLeafFv = .text:0x80459740; // type:function size:0x84 +GetTypeName__Q34nw4r3g3d6ScnObjCFv = .text:0x804597D0; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d6ScnObjCFv = .text:0x80459800; // type:function size:0xC Construct__Q34nw4r3g3d7ScnRootFP12MEMAllocatorPUlUlUlUlUl = .text:0x80459810; // type:function size:0x138 -fn_80459950 = .text:0x80459950; // type:function size:0xA8 +G3dProc__Q34nw4r3g3d7ScnRootFUlUlPv = .text:0x80459950; // type:function size:0xA8 GetCamera__Q34nw4r3g3d7ScnRootFi = .text:0x80459A00; // type:function size:0x5C GetCurrentCamera__Q34nw4r3g3d7ScnRootFv = .text:0x80459A60; // type:function size:0x3C SetCurrentCamera__Q34nw4r3g3d7ScnRootFi = .text:0x80459AA0; // type:function size:0x8 -fn_80459AB0 = .text:0x80459AB0; // type:function size:0x5C -fn_80459B10 = .text:0x80459B10; // type:function size:0x234 -fn_80459D50 = .text:0x80459D50; // type:function size:0x188 +GetFog__Q34nw4r3g3d7ScnRootFi = .text:0x80459AB0; // type:function size:0x5C +SetGlbSettings__Q34nw4r3g3d7ScnRootFv = .text:0x80459B10; // type:function size:0x234 +CalcAnmScn__Q34nw4r3g3d7ScnRootFv = .text:0x80459D50; // type:function size:0x188 CalcWorld__Q34nw4r3g3d7ScnRootFv = .text:0x80459EE0; // type:function size:0x4C CalcMaterial__Q34nw4r3g3d7ScnRootFv = .text:0x80459F30; // type:function size:0x1C CalcView__Q34nw4r3g3d7ScnRootFv = .text:0x80459F50; // type:function size:0x78 @@ -24901,118 +24900,118 @@ GatherDrawScnObj__Q34nw4r3g3d7ScnRootFv = .text:0x80459FD0; // type:function siz ZSort__Q34nw4r3g3d7ScnRootFv = .text:0x8045A0C0; // type:function size:0x60 DrawOpa__Q34nw4r3g3d7ScnRootFv = .text:0x8045A120; // type:function size:0x74 DrawXlu__Q34nw4r3g3d7ScnRootFv = .text:0x8045A1A0; // type:function size:0x74 -fn_8045A220 = .text:0x8045A220; // type:function size:0xFC -fn_8045A320 = .text:0x8045A320; // type:function size:0x7C -fn_8045A3A0 = .text:0x8045A3A0; // type:function size:0x120 -fn_8045A4C0 = .text:0x8045A4C0; // type:function size:0x60 -fn_8045A520 = .text:0x8045A520; // type:function size:0x40 -fn_8045A560 = .text:0x8045A560; // type:function size:0x40 -fn_8045A5A0 = .text:0x8045A5A0; // type:function size:0x380 -fn_8045A920 = .text:0x8045A920; // type:function size:0x380 -fn_8045ACA0 = .text:0x8045ACA0; // type:function size:0x100 -fn_8045ADA0 = .text:0x8045ADA0; // type:function size:0x60 -fn_8045AE00 = .text:0x8045AE00; // type:function size:0x90 -fn_8045AE90 = .text:0x8045AE90; // type:function size:0x90 -fn_8045AF20 = .text:0x8045AF20; // type:function size:0x64 -fn_8045AF90 = .text:0x8045AF90; // type:function size:0x88 -fn_8045B020 = .text:0x8045B020; // type:function size:0x88 -fn_8045B0B0 = .text:0x8045B0B0; // type:function size:0x8 -fn_8045B0C0 = .text:0x8045B0C0; // type:function size:0x10 -fn_8045B0D0 = .text:0x8045B0D0; // type:function size:0x40 -fn_8045B110 = .text:0x8045B110; // type:function size:0x68 -fn_8045B180 = .text:0x8045B180; // type:function size:0x30 -fn_8045B1B0 = .text:0x8045B1B0; // type:function size:0xC +__ct__Q34nw4r3g3d7ScnRootFP12MEMAllocatorPQ34nw4r3g3d13IScnObjGatherPPQ34nw4r3g3d6ScnObjUlUlUlPQ34nw4r3g3d8LightObjPQ34nw4r3g3d11AmbLightObjPQ34nw4r3g3d12LightSetData = .text:0x8045A220; // type:function size:0xFC +__dt__Q34nw4r3g3d7ScnRootFv = .text:0x8045A320; // type:function size:0x7C +Add__Q34nw4r3g3d12ScnObjGatherFPQ34nw4r3g3d6ScnObjbb = .text:0x8045A3A0; // type:function size:0x120 +ZSort__Q34nw4r3g3d12ScnObjGatherFv = .text:0x8045A4C0; // type:function size:0x60 +LessZSortOpa__Q34nw4r3g3d25@unnamed@g3d_scnroot_cpp@FPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj = .text:0x8045A520; // type:function size:0x40 +LessZSortXlu__Q34nw4r3g3d25@unnamed@g3d_scnroot_cpp@FPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj = .text:0x8045A560; // type:function size:0x40 +sort__3stdFPPQ34nw4r3g3d6ScnObjPPQ34nw4r3g3d6ScnObjPFPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj_b_v = .text:0x8045A5A0; // type:function size:0x380 +sort__3stdFPPQ34nw4r3g3d6ScnObjPPQ34nw4r3g3d6ScnObjRPFPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj_b_v = .text:0x8045A920; // type:function size:0x380 +__sort132__3stdFPPQ34nw4r3g3d6ScnObjPPQ34nw4r3g3d6ScnObjPPQ34nw4r3g3d6ScnObjRPFPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj_b_v = .text:0x8045ACA0; // type:function size:0x100 +Sort__Q34nw4r3g3d12ScnObjGatherFv = .text:0x8045ADA0; // type:function size:0x60 +LessByGetValueForSortOpa__Q34nw4r3g3d25@unnamed@g3d_scnroot_cpp@FPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj = .text:0x8045AE00; // type:function size:0x90 +LessByGetValueForSortXlu__Q34nw4r3g3d25@unnamed@g3d_scnroot_cpp@FPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj = .text:0x8045AE90; // type:function size:0x90 +Sort__Q34nw4r3g3d12ScnObjGatherFPFPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj_bPFPCQ34nw4r3g3d6ScnObjPCQ34nw4r3g3d6ScnObj_b = .text:0x8045AF20; // type:function size:0x64 +DrawOpa__Q34nw4r3g3d12ScnObjGatherFPQ34nw4r3g3d14ResMdlDrawMode = .text:0x8045AF90; // type:function size:0x88 +DrawXlu__Q34nw4r3g3d12ScnObjGatherFPQ34nw4r3g3d14ResMdlDrawMode = .text:0x8045B020; // type:function size:0x88 +CheckScnObj__Q34nw4r3g3d12ScnObjGatherFPQ34nw4r3g3d6ScnObj = .text:0x8045B0B0; // type:function size:0x8 +Clear__Q34nw4r3g3d12ScnObjGatherFv = .text:0x8045B0C0; // type:function size:0x10 +__dt__Q34nw4r3g3d12ScnObjGatherFv = .text:0x8045B0D0; // type:function size:0x40 +IsDerivedFrom__Q34nw4r3g3d7ScnRootCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x8045B110; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d7ScnRootCFv = .text:0x8045B180; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d7ScnRootCFv = .text:0x8045B1B0; // type:function size:0xC Construct__Q34nw4r3g3d12ScnMdlSimpleFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdli = .text:0x8045B1C0; // type:function size:0x194 -fn_8045B360 = .text:0x8045B360; // type:function size:0x258 -fn_8045B5C0 = .text:0x8045B5C0; // type:function size:0x34 -fn_8045B600 = .text:0x8045B600; // type:function size:0x34C -fn_8045B950 = .text:0x8045B950; // type:function size:0x890 -fn_8045C1E0 = .text:0x8045C1E0; // type:function size:0x40 -fn_8045C220 = .text:0x8045C220; // type:function size:0x38 +ScnMdlSmpl_CalcPosture__Q34nw4r3g3d12ScnMdlSimpleFUlPCQ34nw4r4math5MTX34 = .text:0x8045B360; // type:function size:0x258 +ScnMdlSmpl_G3DPROC_GATHER_SCNOBJ__Q34nw4r3g3d12ScnMdlSimpleFUlPQ34nw4r3g3d13IScnObjGather = .text:0x8045B5C0; // type:function size:0x34 +ScnMdlSmpl_G3DPROC_CALC_VIEW__Q34nw4r3g3d12ScnMdlSimpleFUlPCQ34nw4r4math5MTX34 = .text:0x8045B600; // type:function size:0x34C +G3dProc__Q34nw4r3g3d12ScnMdlSimpleFUlUlPv = .text:0x8045B950; // type:function size:0x890 +SetScnObjOption__Q34nw4r3g3d12ScnMdlSimpleFUlUl = .text:0x8045C1E0; // type:function size:0x40 +GetScnObjOption__Q34nw4r3g3d12ScnMdlSimpleCFUlPUl = .text:0x8045C220; // type:function size:0x38 GetScnMtxPos__Q34nw4r3g3d12ScnMdlSimpleCFPQ34nw4r4math5MTX34Q44nw4r3g3d6ScnObj13ScnObjMtxTypeUl = .text:0x8045C260; // type:function size:0xE0 -fn_8045C340 = .text:0x8045C340; // type:function size:0x610 -fn_8045C950 = .text:0x8045C950; // type:function size:0x178 -fn_8045CAD0 = .text:0x8045CAD0; // type:function size:0xE0 -fn_8045CBB0 = .text:0x8045CBB0; // type:function size:0x5C -fn_8045CC10 = .text:0x8045CC10; // type:function size:0x5C -fn_8045CC70 = .text:0x8045CC70; // type:function size:0xB8 +SetAnmObj__Q34nw4r3g3d12ScnMdlSimpleFPQ34nw4r3g3d6AnmObjQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045C340; // type:function size:0x610 +RemoveAnmObj__Q34nw4r3g3d12ScnMdlSimpleFPQ34nw4r3g3d6AnmObj = .text:0x8045C950; // type:function size:0x178 +RemoveAnmObj__Q34nw4r3g3d12ScnMdlSimpleFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045CAD0; // type:function size:0xE0 +GetAnmObj__Q34nw4r3g3d12ScnMdlSimpleFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045CBB0; // type:function size:0x5C +GetAnmObj__Q34nw4r3g3d12ScnMdlSimpleCFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045CC10; // type:function size:0x5C +UpdateFrame__Q34nw4r3g3d12ScnMdlSimpleFv = .text:0x8045CC70; // type:function size:0xB8 EnableScnMdlCallbackTiming__Q34nw4r3g3d12ScnMdlSimpleFQ44nw4r3g3d6ScnObj6Timing = .text:0x8045CD30; // type:function size:0x40 -fn_8045CD70 = .text:0x8045CD70; // type:function size:0x24 -fn_8045CDA0 = .text:0x8045CDA0; // type:function size:0x34 -fn_8045CDE0 = .text:0x8045CDE0; // type:function size:0x34 -fn_8045CE20 = .text:0x8045CE20; // type:function size:0x4C -fn_8045CE70 = .text:0x8045CE70; // type:function size:0x218 -fn_8045D090 = .text:0x8045D090; // type:function size:0x120 -fn_8045D1B0 = .text:0x8045D1B0; // type:function size:0x68 -fn_8045D220 = .text:0x8045D220; // type:function size:0x30 -fn_8045D250 = .text:0x8045D250; // type:function size:0xC -fn_8045D260 = .text:0x8045D260; // type:function size:0x48 -fn_8045D2B0 = .text:0x8045D2B0; // type:function size:0x48 +GetViewPosMtxArray__Q34nw4r3g3d12ScnMdlSimpleFv = .text:0x8045CD70; // type:function size:0x24 +GetViewNrmMtxArray__Q34nw4r3g3d12ScnMdlSimpleFv = .text:0x8045CDA0; // type:function size:0x34 +GetViewTexMtxArray__Q34nw4r3g3d12ScnMdlSimpleFv = .text:0x8045CDE0; // type:function size:0x34 +GetByteCode__Q34nw4r3g3d12ScnMdlSimpleCFQ44nw4r3g3d12ScnMdlSimple12ByteCodeType = .text:0x8045CE20; // type:function size:0x4C +__ct__Q34nw4r3g3d12ScnMdlSimpleFP12MEMAllocatorQ34nw4r3g3d6ResMdlPQ34nw4r4math5MTX34PUlPQ34nw4r4math5MTX34PQ34nw4r4math5MTX33PQ34nw4r4math5MTX34ii = .text:0x8045CE70; // type:function size:0x218 +__dt__Q34nw4r3g3d12ScnMdlSimpleFv = .text:0x8045D090; // type:function size:0x120 +IsDerivedFrom__Q34nw4r3g3d12ScnMdlSimpleCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x8045D1B0; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d12ScnMdlSimpleCFv = .text:0x8045D220; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d12ScnMdlSimpleCFv = .text:0x8045D250; // type:function size:0xC +GetResTexObj__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D260; // type:function size:0x48 +GetResTexSrt__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D2B0; // type:function size:0x48 GetResGenMode__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D300; // type:function size:0x48 -fn_8045D350 = .text:0x8045D350; // type:function size:0x48 +GetResMatMisc__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D350; // type:function size:0x48 GetResMatPix__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D3A0; // type:function size:0x48 GetResMatTevColor__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D3F0; // type:function size:0x48 -fn_8045D440 = .text:0x8045D440; // type:function size:0x48 -fn_8045D490 = .text:0x8045D490; // type:function size:0x60 -fn_8045D4F0 = .text:0x8045D4F0; // type:function size:0x60 +GetResTev__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFb = .text:0x8045D440; // type:function size:0x48 +GetResTexObjEx__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFv = .text:0x8045D490; // type:function size:0x60 +GetResMatChanEx__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFv = .text:0x8045D4F0; // type:function size:0x60 __ct__Q44nw4r3g3d6ScnMdl15CopiedMatAccessFPQ34nw4r3g3d6ScnMdlUl = .text:0x8045D550; // type:function size:0x280 -fn_8045D7D0 = .text:0x8045D7D0; // type:function size:0x7C -fn_8045D850 = .text:0x8045D850; // type:function size:0xD0 -fn_8045D920 = .text:0x8045D920; // type:function size:0xBC -fn_8045D9E0 = .text:0x8045D9E0; // type:function size:0xBC -fn_8045DAA0 = .text:0x8045DAA0; // type:function size:0xBC +SetVisibility__Q44nw4r3g3d6ScnMdl15CopiedVisAccessFb = .text:0x8045D7D0; // type:function size:0x7C +SetVisibilityEx__Q44nw4r3g3d6ScnMdl15CopiedVisAccessFb = .text:0x8045D850; // type:function size:0xD0 +__ct__Q44nw4r3g3d6ScnMdl15CopiedVisAccessFPQ34nw4r3g3d6ScnMdlUl = .text:0x8045D920; // type:function size:0xBC +GetResVtxPos__Q44nw4r3g3d6ScnMdl15CopiedVtxAccessFUl = .text:0x8045D9E0; // type:function size:0xBC +GetResVtxNrm__Q44nw4r3g3d6ScnMdl15CopiedVtxAccessFUl = .text:0x8045DAA0; // type:function size:0xBC Construct__Q34nw4r3g3d6ScnMdlFP12MEMAllocatorPUlQ34nw4r3g3d6ResMdlUli = .text:0x8045DB60; // type:function size:0xB88 -fn_8045E6F0 = .text:0x8045E6F0; // type:function size:0x57C -fn_8045EC70 = .text:0x8045EC70; // type:function size:0x4B0 -fn_8045F120 = .text:0x8045F120; // type:function size:0x40 -fn_8045F160 = .text:0x8045F160; // type:function size:0x40 -fn_8045F1A0 = .text:0x8045F1A0; // type:function size:0x39C -fn_8045F540 = .text:0x8045F540; // type:function size:0x334 -fn_8045F880 = .text:0x8045F880; // type:function size:0x164 -fn_8045F9F0 = .text:0x8045F9F0; // type:function size:0x1F8 -fn_8045FBF0 = .text:0x8045FBF0; // type:function size:0x50 -fn_8045FC40 = .text:0x8045FC40; // type:function size:0x18 -fn_8045FC60 = .text:0x8045FC60; // type:function size:0x18 -fn_8045FC80 = .text:0x8045FC80; // type:function size:0x68 -fn_8045FCF0 = .text:0x8045FCF0; // type:function size:0x80 -fn_8045FD70 = .text:0x8045FD70; // type:function size:0x30 -fn_8045FDA0 = .text:0x8045FDA0; // type:function size:0xC -fn_8045FDB0 = .text:0x8045FDB0; // type:function size:0x234 +ScnMdl_G3DPROC_CALC_MAT__Q34nw4r3g3d6ScnMdlFUlPv = .text:0x8045E6F0; // type:function size:0x57C +G3dProc__Q34nw4r3g3d6ScnMdlFUlUlPv = .text:0x8045EC70; // type:function size:0x4B0 +SetScnObjOption__Q34nw4r3g3d6ScnMdlFUlUl = .text:0x8045F120; // type:function size:0x40 +GetScnObjOption__Q34nw4r3g3d6ScnMdlCFUlPUl = .text:0x8045F160; // type:function size:0x40 +InitBuffer__Q34nw4r3g3d6ScnMdlFv = .text:0x8045F1A0; // type:function size:0x39C +CleanMatBuffer__Q34nw4r3g3d6ScnMdlFUlUl = .text:0x8045F540; // type:function size:0x334 +SetAnmObj__Q34nw4r3g3d6ScnMdlFPQ34nw4r3g3d6AnmObjQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045F880; // type:function size:0x164 +RemoveAnmObj__Q34nw4r3g3d6ScnMdlFPQ34nw4r3g3d6AnmObj = .text:0x8045F9F0; // type:function size:0x1F8 +RemoveAnmObj__Q34nw4r3g3d6ScnMdlFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045FBF0; // type:function size:0x50 +GetAnmObj__Q34nw4r3g3d6ScnMdlFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045FC40; // type:function size:0x18 +GetAnmObj__Q34nw4r3g3d6ScnMdlCFQ44nw4r3g3d12ScnMdlSimple10AnmObjType = .text:0x8045FC60; // type:function size:0x18 +__dt__Q34nw4r3g3d6ScnMdlFv = .text:0x8045FC80; // type:function size:0x68 +IsDerivedFrom__Q34nw4r3g3d6ScnMdlCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x8045FCF0; // type:function size:0x80 +GetTypeName__Q34nw4r3g3d6ScnMdlCFv = .text:0x8045FD70; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d6ScnMdlCFv = .text:0x8045FDA0; // type:function size:0xC +CalcMaterialDirectly__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPQ34nw4r3g3d12AnmObjTexPatPQ34nw4r3g3d12AnmObjTexSrtPQ34nw4r3g3d12AnmObjMatClr = .text:0x8045FDB0; // type:function size:0x234 G3dInit__Q24nw4r3g3dFb = .text:0x8045FFF0; // type:function size:0xF0 G3dReset__Q24nw4r3g3dFv = .text:0x804600E0; // type:function size:0x8 Construct__Q34nw4r3g3d7ScnProcFP12MEMAllocatorPUlPFPQ34nw4r3g3d7ScnProcb_vbbUl = .text:0x804600F0; // type:function size:0x110 -fn_80460200 = .text:0x80460200; // type:function size:0x100 -fn_80460300 = .text:0x80460300; // type:function size:0x68 -fn_80460370 = .text:0x80460370; // type:function size:0x30 -fn_804603A0 = .text:0x804603A0; // type:function size:0xC -fn_804603B0 = .text:0x804603B0; // type:function size:0x40 -fn_804603F0 = .text:0x804603F0; // type:function size:0x8 -fn_80460400 = .text:0x80460400; // type:function size:0x70 -fn_80460470 = .text:0x80460470; // type:function size:0x54 -fn_804604D0 = .text:0x804604D0; // type:function size:0x20 -fn_804604F0 = .text:0x804604F0; // type:function size:0x70 -fn_80460560 = .text:0x80460560; // type:function size:0x14 -fn_80460580 = .text:0x80460580; // type:function size:0x30 -fn_804605B0 = .text:0x804605B0; // type:function size:0x3C -fn_804605F0 = .text:0x804605F0; // type:function size:0x40 -fn_80460630 = .text:0x80460630; // type:function size:0x40 -fn_80460670 = .text:0x80460670; // type:function size:0x40 -fn_804606B0 = .text:0x804606B0; // type:function size:0x40 -fn_804606F0 = .text:0x804606F0; // type:function size:0x40 -fn_80460730 = .text:0x80460730; // type:function size:0x40 -fn_80460770 = .text:0x80460770; // type:function size:0x60 -fn_804607D0 = .text:0x804607D0; // type:function size:0x1C -fn_804607F0 = .text:0x804607F0; // type:function size:0x1C -fn_80460810 = .text:0x80460810; // type:function size:0x3FC -fn_80460C10 = .text:0x80460C10; // type:function size:0x15C -fn_80460D70 = .text:0x80460D70; // type:function size:0x120 -fn_80460E90 = .text:0x80460E90; // type:function size:0x70 -fn_80460F00 = .text:0x80460F00; // type:function size:0x68 -fn_80460F70 = .text:0x80460F70; // type:function size:0x788 -FUN_80461700 = .text:0x80461700; // type:function size:0x80 -FUN_80461780 = .text:0x80461780; // type:function size:0xC8 -FUN_80461850 = .text:0x80461850; // type:function size:0xE8 -FUN_80461940 = .text:0x80461940; // type:function size:0xA0 +G3dProc__Q34nw4r3g3d7ScnProcFUlUlPv = .text:0x80460200; // type:function size:0x100 +IsDerivedFrom__Q34nw4r3g3d7ScnProcCFQ44nw4r3g3d6G3dObj7TypeObj = .text:0x80460300; // type:function size:0x68 +GetTypeName__Q34nw4r3g3d7ScnProcCFv = .text:0x80460370; // type:function size:0x30 +GetTypeObj__Q34nw4r3g3d7ScnProcCFv = .text:0x804603A0; // type:function size:0xC +__dt__Q34nw4r3g3d7ScnProcFv = .text:0x804603B0; // type:function size:0x40 +__ct__Q34nw4r3g3d3FogFPQ34nw4r3g3d7FogData = .text:0x804603F0; // type:function size:0x8 +Init__Q34nw4r3g3d3FogFv = .text:0x80460400; // type:function size:0x70 +CopyTo__Q34nw4r3g3d3FogCFPv = .text:0x80460470; // type:function size:0x54 +SetFogRangeAdjParam__Q34nw4r3g3d3FogFUsUsRCQ34nw4r4math5MTX44 = .text:0x804604D0; // type:function size:0x20 +SetGP__Q34nw4r3g3d3FogCFv = .text:0x804604F0; // type:function size:0x70 +Clear__Q34nw4r3g3d8LightObjFv = .text:0x80460560; // type:function size:0x14 +InitLightColor__Q34nw4r3g3d8LightObjF8_GXColor = .text:0x80460580; // type:function size:0x30 +InitLightPos__Q34nw4r3g3d8LightObjFfff = .text:0x804605B0; // type:function size:0x3C +InitLightDir__Q34nw4r3g3d8LightObjFfff = .text:0x804605F0; // type:function size:0x40 +InitLightSpot__Q34nw4r3g3d8LightObjFf9_GXSpotFn = .text:0x80460630; // type:function size:0x40 +InitLightAttnA__Q34nw4r3g3d8LightObjFfff = .text:0x80460670; // type:function size:0x40 +InitLightDistAttn__Q34nw4r3g3d8LightObjFff13_GXDistAttnFn = .text:0x804606B0; // type:function size:0x40 +InitLightAttnK__Q34nw4r3g3d8LightObjFfff = .text:0x804606F0; // type:function size:0x40 +InitSpecularDir__Q34nw4r3g3d8LightObjFfff = .text:0x80460730; // type:function size:0x40 +InitLightShininess__Q34nw4r3g3d8LightObjFf = .text:0x80460770; // type:function size:0x60 +GetLightPos__Q34nw4r3g3d8LightObjCFPQ34nw4r4math4VEC3 = .text:0x804607D0; // type:function size:0x1C +GetLightDir__Q34nw4r3g3d8LightObjCFPQ34nw4r4math4VEC3 = .text:0x804607F0; // type:function size:0x1C +__ct__Q34nw4r3g3d12LightSettingFPQ34nw4r3g3d8LightObjPQ34nw4r3g3d11AmbLightObjUlPQ34nw4r3g3d12LightSetDataUl = .text:0x80460810; // type:function size:0x3FC +Import__Q34nw4r3g3d12LightSettingFRCQ34nw4r3g3d12LightSetting = .text:0x80460C10; // type:function size:0x15C +ApplyViewMtx__Q34nw4r3g3d12LightSettingFRCQ34nw4r4math5MTX34Ul = .text:0x80460D70; // type:function size:0x120 +SelectLightObj__Q34nw4r3g3d8LightSetFUli = .text:0x80460E90; // type:function size:0x70 +SelectAmbLightObj__Q34nw4r3g3d8LightSetFi = .text:0x80460F00; // type:function size:0x68 +CalcVtx__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPQ34nw4r3g3d9AnmObjShpPPQ34nw4r3g3d13ResVtxPosDataPPQ34nw4r3g3d13ResVtxNrmDataPPQ34nw4r3g3d13ResVtxClrData = .text:0x80460F70; // type:function size:0x788 +__ct__Q44nw4r3snd6detail13AnimSoundImplFRQ34nw4r3snd14SoundStartablePQ44nw4r3snd6detail15AnimEventPlayeri = .text:0x80461700; // type:function size:0x80 +__dt__Q44nw4r3snd6detail13AnimSoundImplFv = .text:0x80461780; // type:function size:0xC8 +Setup__Q44nw4r3snd6detail13AnimSoundImplFPCv = .text:0x80461850; // type:function size:0xE8 +Shutdown__Q44nw4r3snd6detail13AnimSoundImplFv = .text:0x80461940; // type:function size:0xA0 FUN_804619e0 = .text:0x804619E0; // type:function size:0x1C FUN_80461a00 = .text:0x80461A00; // type:function size:0x14C FUN_80461b50 = .text:0x80461B50; // type:function size:0x220 diff --git a/configure.py b/configure.py index 0b84efef..ab91a5b6 100644 --- a/configure.py +++ b/configure.py @@ -188,7 +188,7 @@ "-i include", "-i include/MSL_C", f"-i build/{config.version}/include", - f"-DVERSION={version_num}", + f"-DGAME_VERSION={version_num}", ] # Debug flags @@ -460,6 +460,161 @@ def nw4rLib(lib_name, objects, extra_cflags=[]): Object(Matching, "nw4r/ut/ut_TextWriterBase.cpp"), ], ), + nw4rLib( + "math", + [ + Object(NonMatching, "nw4r/math/math_arithmetic.cpp"), + Object(NonMatching, "nw4r/math/math_triangular.cpp"), + Object(NonMatching, "nw4r/math/math_types.cpp"), + Object(NonMatching, "nw4r/math/math_geometry.cpp"), + ] + ), + nw4rLib( + "g3d", + [ + Object(NonMatching, "nw4r/g3d/res/g3d_rescommon.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resdict.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resfile.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resmdl.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resshp.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_restev.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resmat.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resvtx.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_restex.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resnode.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanm.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmvis.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmclr.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmtexpat.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmtexsrt.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmchr.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_reslightset.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmamblight.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmlight.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmfog.cpp: .tex"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmcamera.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmscn.cpp"), + Object(NonMatching, "nw4r/g3d/res/g3d_resanmshp.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_transform.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmvis.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmclr.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmtexpat.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmtexsrt.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmchr.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmshp.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmscn.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_obj.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_anmobj.cpp"), + Object(NonMatching, "nw4r/g3d/platform/g3d_gpu.cpp"), + Object(NonMatching, "nw4r/g3d/platform/g3d_tmem.cpp"), + Object(NonMatching, "nw4r/g3d/platform/g3d_cpu.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_state.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_draw1mat1shp.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_calcview.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_dcc.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_workmem.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_calcworld.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_draw.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_camera.cpp"), + Object(NonMatching, "nw4r/g3d/dcc/g3d_basic.cpp"), + Object(NonMatching, "nw4r/g3d/dcc/g3d_maya.cpp"), + Object(NonMatching, "nw4r/g3d/dcc/g3d_xsi.cpp"), + Object(NonMatching, "nw4r/g3d/dcc/g3d_3dsmax.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnobj.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnroot.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnmdlsmpl.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnmdl.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnchoice.cpp: .tex"), + Object(NonMatching, "nw4r/g3d/g3d_scngroupex.cpp: .tex"), + Object(NonMatching, "nw4r/g3d/g3d_scnmdl1mat1shp.cpp: .tex"), + Object(NonMatching, "nw4r/g3d/g3d_scnmdlexpand.cpp: .tex"), + Object(NonMatching, "nw4r/g3d/g3d_calcmaterial.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_init.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_scnproc.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_fog.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_light.cpp"), + Object(NonMatching, "nw4r/g3d/g3d_calcvtx.cpp"), + ] + ), + nw4rLib( + "snd", + [ + Object(NonMatching, "nw4r/snd/snd_AnimSound.cpp"), + Object(NonMatching, "nw4r/snd/snd_AxManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_AxVoice.cpp"), + Object(NonMatching, "nw4r/snd/snd_AxVoiceManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_AxfxImpl.cpp"), + Object(NonMatching, "nw4r/snd/snd_Bank.cpp"), + Object(NonMatching, "nw4r/snd/snd_BankFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_BasicPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_BasicSound.cpp"), + Object(NonMatching, "nw4r/snd/snd_BiquadFilterPreset.cpp"), + Object(NonMatching, "nw4r/snd/snd_Channel.cpp"), + Object(NonMatching, "nw4r/snd/snd_DisposeCallbackManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_debug.cpp"), + Object(NonMatching, "nw4r/snd/snd_DvdSoundArchive.cpp"), + Object(NonMatching, "nw4r/snd/snd_EnvGenerator.cpp"), + Object(NonMatching, "nw4r/snd/snd_ExternalSoundPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_FrameHeap.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxBase.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxChorus.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxDelay.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxReverbHi.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxReverbHiDpl2.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxReverbStd.cpp"), + Object(NonMatching, "nw4r/snd/snd_FxReverbStdDpl2.cpp"), + Object(NonMatching, "nw4r/snd/snd_InstancePool.cpp"), + Object(NonMatching, "nw4r/snd/snd_Lfo.cpp"), + Object(NonMatching, "nw4r/snd/snd_MemorySoundArchive.cpp"), + Object(NonMatching, "nw4r/snd/snd_MidiSeqPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_MmlParser.cpp"), + Object(NonMatching, "nw4r/snd/snd_MmlSeqTrack.cpp"), + Object(NonMatching, "nw4r/snd/snd_MmlSeqTrackAllocator.cpp"), + Object(NonMatching, "nw4r/snd/snd_NandSoundArchive.cpp"), + Object(NonMatching, "nw4r/snd/snd_PlayerHeap.cpp"), + Object(NonMatching, "nw4r/snd/snd_RemoteSpeaker.cpp"), + Object(NonMatching, "nw4r/snd/snd_RemoteSpeakerManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_SeqFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_SeqPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_SeqSound.cpp"), + Object(NonMatching, "nw4r/snd/snd_SeqSoundHandle.cpp"), + Object(NonMatching, "nw4r/snd/snd_SeqTrack.cpp"), + Object(NonMatching, "nw4r/snd/snd_Sound3DActor.cpp"), + Object(NonMatching, "nw4r/snd/snd_Sound3DCalculator.cpp"), + Object(NonMatching, "nw4r/snd/snd_Sound3DEngine.cpp"), + Object(NonMatching, "nw4r/snd/snd_Sound3DListener.cpp"), + Object(NonMatching, "nw4r/snd/snd_Sound3DManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundActor.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundArchive.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundArchiveFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundArchiveLoader.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundArchivePlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundHandle.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundHeap.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundStartable.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundSystem.cpp"), + Object(NonMatching, "nw4r/snd/snd_SoundThread.cpp"), + Object(NonMatching, "nw4r/snd/snd_StrmChannel.cpp"), + Object(NonMatching, "nw4r/snd/snd_StrmFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_StrmPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_StrmSound.cpp"), + Object(NonMatching, "nw4r/snd/snd_StrmSoundHandle.cpp"), + Object(NonMatching, "nw4r/snd/snd_Task.cpp"), + Object(NonMatching, "nw4r/snd/snd_TaskManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_TaskThread.cpp"), + Object(NonMatching, "nw4r/snd/snd_Voice.cpp"), + Object(NonMatching, "nw4r/snd/snd_VoiceManager.cpp"), + Object(NonMatching, "nw4r/snd/snd_Util.cpp"), + Object(NonMatching, "nw4r/snd/snd_WaveArchive.cpp"), + Object(NonMatching, "nw4r/snd/snd_WaveFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_WaveSound.cpp"), + Object(NonMatching, "nw4r/snd/snd_WaveSoundHandle.cpp"), + Object(NonMatching, "nw4r/snd/snd_WsdFile.cpp"), + Object(NonMatching, "nw4r/snd/snd_WsdPlayer.cpp"), + Object(NonMatching, "nw4r/snd/snd_adpcm.cpp"), + ] + ), nw4rLib( "lyt", [ diff --git a/include/MSL_C/climits b/include/MSL_C/climits new file mode 100644 index 00000000..7510db74 --- /dev/null +++ b/include/MSL_C/climits @@ -0,0 +1,4 @@ +#ifndef MSL_CPP_CLIMITS_H +#define MSL_CPP_CLIMITS_H +#include +#endif diff --git a/include/common.h b/include/common.h index 07356462..7abfcc28 100644 --- a/include/common.h +++ b/include/common.h @@ -21,6 +21,9 @@ #define DECL_WEAK __declspec(weak) #define DONT_INLINE __attribute__((never_inline)) +// TODO - Fix MSL (stddef.h) +#define offsetof(ST, M) ((size_t) & (((ST*)0)->M)) + // Codewarrior tricks for matching decomp // (Functions are given prototypes for -requireprotos) #ifdef __MWERKS__ diff --git a/include/libc.h b/include/libc.h index e2d00635..a02dbfbd 100644 --- a/include/libc.h +++ b/include/libc.h @@ -5,8 +5,8 @@ extern "C" { -void *memset(void *dest, s32 value, u32 count); -void *memcpy(void *dest, const void *src, u32 count); +// void *memset(void *dest, s32 value, u32 count); +// void *memcpy(void *dest, const void *src, u32 count); void *checkedMemcpy(void *dest, u16 destLen, const void *src, u16 count); } diff --git a/include/nw4r/g3d/g3d_anmshp.h b/include/nw4r/g3d/g3d_anmshp.h index e5d798c9..abc2bc09 100644 --- a/include/nw4r/g3d/g3d_anmshp.h +++ b/include/nw4r/g3d/g3d_anmshp.h @@ -86,7 +86,7 @@ class AnmObjShpRes : public AnmObjShp, public FrameCtrl { return TypeObj(TYPE_NAME); } - static AnmObjShpRes *Construct(MEMAllocator *, u32 *, ResAnmShp, ResMdl, int); + static AnmObjShpRes *Construct(MEMAllocator *, u32 *, ResAnmShp, ResMdl, bool); private: ResAnmShp mResAnmShp; // at 0x2C diff --git a/include/nw4r/snd.h b/include/nw4r/snd.h index 9faa65ed..321e51ff 100644 --- a/include/nw4r/snd.h +++ b/include/nw4r/snd.h @@ -5,17 +5,74 @@ #include #include #include +#include +#include #include #include +#include +#include #include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include +#include +#include +#include #include #endif diff --git a/include/nw4r/snd/snd_AxManager.h b/include/nw4r/snd/snd_AxManager.h index a51ae25e..8ac7c0a3 100644 --- a/include/nw4r/snd/snd_AxManager.h +++ b/include/nw4r/snd/snd_AxManager.h @@ -1,10 +1,13 @@ #ifndef NW4R_SND_AX_MANAGER_H #define NW4R_SND_AX_MANAGER_H +#include + #include #include #include -#include + #include + #include #include @@ -22,32 +25,30 @@ class AxManager { NW4R_UT_LIST_TYPEDEF_DECL(CallbackListNode); public: - static AxManager &GetInstance(); + static AxManager& GetInstance(); - AxManager(); - ~AxManager() {} + void Init(); + void Shutdown(); + void Update(); + void PrepareReset(); bool CheckInit() { return mInitialized; } + bool IsDiskError() const { return mDiskError; } - s32 GetResetReadyTimer() const { - return mResetReadyTimer; - } - FxBaseList &GetEffectList(AuxBus bus) { - return mFxList[bus]; + + bool IsResetReady() const { + return mResetReadyCounter == 0; } - void Init(); - void Shutdown(); f32 GetOutputVolume() const; - void Update(); - void *GetZeroBufferAddress(); + void* GetZeroBufferAddress(); - void RegisterCallback(CallbackListNode *node, AXOutCallback callback); - void UnregisterCallback(CallbackListNode *node); + void RegisterCallback(CallbackListNode* pNode, AXOutCallback pCallback); + void UnregisterCallback(CallbackListNode* pNode); void SetOutputMode(OutputMode mode); OutputMode GetOutputMode(); @@ -57,38 +58,51 @@ class AxManager { } void SetMasterVolume(f32 volume, int frame); - bool AppendEffect(AuxBus bus, FxBase *fx); + bool AppendEffect(AuxBus bus, FxBase* pFx); void ClearEffect(AuxBus bus, int frame); void ShutdownEffect(AuxBus bus); - void PrepareReset(); + FxBaseList& GetEffectList(AuxBus bus) { + return mFxList[bus]; + } + +private: + static const u8 AUX_CALLBACK_WAIT_FRAME = 6; + + static const int FX_SAMPLE_RATE = AX_SAMPLE_RATE; + static const SampleFormat FX_SAMPLE_FORMAT = SAMPLE_FORMAT_PCM_S32; + static const int FX_BUFFER_SIZE = AX_FRAME_SIZE; + + static const int ZERO_BUFFER_SIZE = 256; private: + AxManager(); + static void AxCallbackFunc(); - static void AuxCallbackFunc(void *chans, void *context); + static void AuxCallbackFunc(void* pChans, void* pContext); static void AiDmaCallbackFunc(); private: - static u8 sZeroBuffer[0x100]; - OutputMode mOutputMode; // at 0x0 - void *mZeroBuffer; // at 0x4 + void* mZeroBufferAddress; // at 0x4 CallbackListNodeList mCallbackList; // at 0x8 - AXOutCallback mOldAxCallback; // at 0x14 + AXOutCallback mNextAxRegisterCallback; // at 0x14 bool mInitialized; // at 0x18 - bool mUpdateVoicePrio; // at 0x19 + bool mUpdateVoicePrioFlag; // at 0x19 bool mDiskError; // at 0x1A MoveValue mMasterVolume; // at 0x1C MoveValue mMainOutVolume; // at 0x2C MoveValue mVolumeForReset; // at 0x3C - AIDMACallback mOldAiCallback; // at 0x4C - s32 mResetReadyTimer; // at 0x50 + AIDMACallback mOldAidCallback; // at 0x4C + volatile s32 mResetReadyCounter; // at 0x50 MoveValue mAuxFadeVolume[AUX_BUS_NUM]; // at 0x54 MoveValue mAuxUserVolume[AUX_BUS_NUM]; // at 0x84 FxBaseList mFxList[AUX_BUS_NUM]; // at 0xB4 AXAuxCallback mAuxCallback[AUX_BUS_NUM]; // at 0xD8 - void *mAuxCallbackContext[AUX_BUS_NUM]; // at 0xE4 - u8 mAuxCallbackWait[AUX_BUS_NUM]; // at 0xF0 + void* mAuxCallbackContext[AUX_BUS_NUM]; // at 0xE4 + u8 mAuxCallbackWaitCounter[AUX_BUS_NUM]; // at 0xF0 + + static u8 sZeroBuffer[ZERO_BUFFER_SIZE]; }; } // namespace detail diff --git a/include/nw4r/snd/snd_AxVoice.h b/include/nw4r/snd/snd_AxVoice.h index f9796e23..61d171a0 100644 --- a/include/nw4r/snd/snd_AxVoice.h +++ b/include/nw4r/snd/snd_AxVoice.h @@ -1,22 +1,22 @@ #ifndef NW4R_SND_AX_VOICE_H #define NW4R_SND_AX_VOICE_H #include + +#include + #include + #include namespace nw4r { namespace snd { namespace detail { -inline int CalcAxvpbDelta(u16 init, u16 target) { - return (target - init) / AX_SAMPLES_PER_FRAME; -} - class AxVoiceParamBlock { public: AxVoiceParamBlock(); - operator AXVPB *() { + operator AXVPB*() { return mVpb; } @@ -41,7 +41,8 @@ class AxVoiceParamBlock { return 0; } - return (mVpb->pb.addr.currentAddressHi << 16) + mVpb->pb.addr.currentAddressLo; + return (mVpb->pb.addr.currentAddressHi << 16) + + mVpb->pb.addr.currentAddressLo; } u32 GetLoopAddress() const { @@ -49,7 +50,8 @@ class AxVoiceParamBlock { return 0; } - return (mVpb->pb.addr.loopAddressHi << 16) + mVpb->pb.addr.loopAddressLo; + return (mVpb->pb.addr.loopAddressHi << 16) + + mVpb->pb.addr.loopAddressLo; } u32 GetEndAddress() const { @@ -60,16 +62,16 @@ class AxVoiceParamBlock { return (mVpb->pb.addr.endAddressHi << 16) + mVpb->pb.addr.endAddressLo; } - void SetVoiceAddr(const AXPBADDR &addr) { + void SetVoiceAddr(const AXPBADDR& rAddr) { if (IsAvailable()) { // AXSetVoiceAddr doesn't actually modify the object - AXSetVoiceAddr(mVpb, const_cast(&addr)); + AXSetVoiceAddr(mVpb, const_cast(&rAddr)); } } - void SetVoicePriority(u32 prio) { + void SetVoicePriority(u32 priority) { if (IsAvailable()) { - AXSetVoicePriority(mVpb, prio); + AXSetVoicePriority(mVpb, priority); } } @@ -88,43 +90,50 @@ class AxVoiceParamBlock { void Sync(); bool IsRmtIirEnable() const; - void Set(AXVPB *vpb); + void Set(AXVPB* pVpb); void Clear(); void SetVoiceType(u16 type); void SetVoiceVe(u16 volume, u16 initVolume); - void SetVoiceMix(const AXPBMIX &mix, bool syncNow); + void SetVoiceMix(const AXPBMIX& rMix, bool syncNow); void SetVoiceLoop(u16 loop); void SetVoiceLoopAddr(u32 addr); void SetVoiceEndAddr(u32 addr); - void SetVoiceAdpcm(const AXPBADPCM &adpcm); + void SetVoiceAdpcm(const AXPBADPCM& rAdpcm); void SetVoiceSrcType(u32 type); - void SetVoiceSrc(const AXPBSRC &src); + void SetVoiceSrc(const AXPBSRC& rSrc); void SetVoiceSrcRatio(f32 ratio); - void SetVoiceAdpcmLoop(const AXPBADPCMLOOP &loop); - void SetVoiceLpf(const AXPBLPF &lpf); + void SetVoiceAdpcmLoop(const AXPBADPCMLOOP& rLoop); + void SetVoiceLpf(const AXPBLPF& rLpf); void SetVoiceLpfCoefs(u16 a0, u16 b0); void SetVoiceRmtOn(u16 on); - void SetVoiceRmtMix(const AXPBRMTMIX &mix); - void SetVoiceRmtIIR(const AXPBRMTIIR &iir); + void SetVoiceRmtMix(const AXPBRMTMIX& rMix); + void SetVoiceRmtIIR(const AXPBRMTIIR& rIir); void SetVoiceRmtIIRCoefs(u16 type, ...); void UpdateDelta(); private: - AXVPB *mVpb; // at 0x0 - u32 mSync; // at 0x4 - volatile AXPBVE mVePrev; // at 0x8 - bool mFirstVeUpdate; // at 0xC - u16 mVolume; // at 0xE + static const u16 DEFAULT_VOLUME = AX_MAX_VOLUME; + +private: + AXVPB* mVpb; // at 0x0 + u32 mSync; // at 0x4 + volatile AXPBVE mPrevVeSetting; // at 0x8 + bool mFirstVeUpdateFlag; // at 0xC + u16 mVolume; // at 0xE }; class AxVoice { friend class AxVoiceManager; public: - enum AxVoiceCallbackStatus { CALLBACK_STATUS_CANCEL, CALLBACK_STATUS_DROP_DSP }; + enum AxVoiceCallbackStatus { + CALLBACK_STATUS_CANCEL, + CALLBACK_STATUS_DROP_DSP + }; - typedef void (*Callback)(AxVoice *voice, AxVoiceCallbackStatus status, void *arg); + typedef void (*AxVoiceCallback)(AxVoice* pDropVoice, + AxVoiceCallbackStatus status, void* pArg); enum Format { FORMAT_ADPCM = 0, @@ -173,12 +182,6 @@ class AxVoice { }; public: - static u32 GetDspAddressBySample(const void *base, u32 samples, Format fmt); - static u32 GetSampleByDspAddress(const void *base, u32 addr, Format fmt); - static u32 GetSampleByByte(u32 addr, Format fmt); - static void CalcOffsetAdpcmParam(u16 *outPredScale, u16 *outYn1, u16 *outYn2, u32 offset, const void *data, - const AdpcmParam ¶m); - AxVoice(); ~AxVoice(); @@ -199,55 +202,65 @@ class AxVoice { return mFormat; } - void SetBaseAddress(const void *base) { - mWaveData = base; + void SetBaseAddress(const void* pBase) { + mWaveData = pBase; } f32 GetDspRatio(f32 ratio) const { return (ratio * mSampleRate) / AX_SAMPLE_RATE; } - void Setup(const void *wave, Format fmt, int rate); + void Setup(const void* pWave, Format fmt, int rate); bool IsPlayFinished() const; - void SetLoopStart(const void *base, u32 samples); - void SetLoopEnd(const void *base, u32 samples); + void SetLoopStart(const void* pBase, u32 samples); + void SetLoopEnd(const void* pBase, u32 samples); void SetLoopFlag(bool loop); - void StopAtPoint(const void *base, u32 samples); + void StopAtPoint(const void* pBase, u32 samples); - bool IsDataAddressCoverd(const void *begin, const void *end) const; + bool IsDataAddressCoverd(const void* pBegin, const void* pEnd) const; u32 GetCurrentPlayingSample() const; u32 GetCurrentPlayingDspAddress() const; u32 GetLoopEndDspAddress() const; - void SetPriority(u32 prio); + void SetPriority(u32 priority); void SetVoiceType(VoiceType type); void EnableRemote(bool enable); void ResetDelta(); - void SetAddr(bool loop, const void *wave, u32 offset, u32 loopStart, u32 loopEnd); + void SetAddr(bool loop, const void* pWave, u32 offset, u32 loopStart, + u32 loopEnd); void SetSrcType(SrcType type, f32 pitch); - void SetAdpcm(const AdpcmParam *param); - void SetAdpcmLoop(const AdpcmLoopParam *param); - bool SetMix(const MixParam ¶m); - void SetRmtMix(const RemoteMixParam ¶m); + void SetAdpcm(const AdpcmParam* pParam); + void SetAdpcmLoop(const AdpcmLoopParam* pParam); + bool SetMix(const MixParam& rParam); + void SetRmtMix(const RemoteMixParam& rParam); void SetSrc(f32 ratio, bool initial); void SetVe(f32 volume, f32 initVolume); void SetLpf(u16 freq); void SetRemoteFilter(u8 filter); + static u32 GetDspAddressBySample(const void* pBase, u32 samples, + Format fmt); + static u32 GetSampleByDspAddress(const void* pBase, u32 addr, Format fmt); + static u32 GetSampleByByte(u32 addr, Format fmt); + + static void CalcOffsetAdpcmParam(u16* pPredScale, u16* pYN1, u16* pYN2, + u32 offset, const void* pData, + const AdpcmParam& rParam); + private: - static void VoiceCallback(void *arg); + static void VoiceCallback(void* pArg); private: - AxVoiceParamBlock mVpb; // at 0x0 - const void *mWaveData; // at 0x10 - Format mFormat; // at 0x14 - int mSampleRate; // at 0x18 - bool mFirstMixUpdate; // at 0x1C - bool mReserveForFree; // at 0x1D - MixParam mMixPrev; // at 0x1E - Callback mCallback; // at 0x38 - void *mCallbackArg; // at 0x3C + AxVoiceParamBlock mVpb; // at 0x0 + const void* mWaveData; // at 0x10 + Format mFormat; // at 0x14 + int mSampleRate; // at 0x18 + bool mFirstMixUpdateFlag; // at 0x1C + bool mReserveForFreeFlag; // at 0x1D + MixParam mMixPrev; // at 0x1E + AxVoiceCallback mCallback; // at 0x38 + void* mCallbackData; // at 0x3C public: NW4R_UT_LIST_NODE_DECL(); // at 0x40 @@ -255,6 +268,14 @@ class AxVoice { NW4R_UT_LIST_TYPEDEF_DECL(AxVoice); +inline int CalcAxvpbDelta(u16 init, u16 target) { + return (target - init) / AX_SAMPLES_PER_FRAME; +} + +inline u16 CalcMixVolume(f32 volume) { + return ut::Min(0xFFFF, AX_MAX_VOLUME * volume); +} + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_AxVoiceManager.h b/include/nw4r/snd/snd_AxVoiceManager.h index d492bfb2..74d1e701 100644 --- a/include/nw4r/snd/snd_AxVoiceManager.h +++ b/include/nw4r/snd/snd_AxVoiceManager.h @@ -1,39 +1,46 @@ #ifndef NW4R_SND_AX_VOICE_MANAGER_H #define NW4R_SND_AX_VOICE_MANAGER_H -#include #include +#include + namespace nw4r { namespace snd { namespace detail { class AxVoiceManager { public: - static AxVoiceManager& GetInstance(); + static const int VOICE_MARGIN = 16; + static const int VOICE_MAX = AX_VOICE_MAX + VOICE_MARGIN; + static const int WORK_SIZE_MAX = VOICE_MAX * sizeof(AxVoice); - AxVoiceManager(); - ~AxVoiceManager() {} +public: + static AxVoiceManager& GetInstance(); u32 GetRequiredMemSize(); - void Setup(void* work, u32 size); + void Setup(void* pBuffer, u32 size); void Shutdown(); - AxVoice* AcquireAxVoice(u32 prio, AxVoice::Callback callback, void* arg); - void FreeAxVoice(AxVoice* voice); - void ReserveForFreeAxVoice(AxVoice* voice); + AxVoice* AcquireAxVoice(u32 priority, AxVoice::AxVoiceCallback pCallback, + void* pArg); + void FreeAxVoice(AxVoice* pVoice); + + void ReserveForFreeAxVoice(AxVoice* pVoice); void FreeAllReservedAxVoice(); private: + AxVoiceManager(); + AxVoice* Alloc(); - void Free(AxVoice* voice); - void ReserveForFree(AxVoice* voice); + void Free(AxVoice* pVoice); + void ReserveForFree(AxVoice* pVoice); private: - AxVoiceList mActiveList; // at 0x0 - AxVoiceList mFreeList; // at 0xC - AxVoiceList mFreeReservedList; // at 0x18 - bool mInitialized; // at 0x24 - int mVoiceCount; // at 0x28 + AxVoiceList mActiveVoiceList; // at 0x0 + AxVoiceList mFreeVoiceList; // at 0xC + AxVoiceList mFreeReservedVoiceList; // at 0x18 + bool mInitialized; // at 0x24 + int mVoiceCount; // at 0x28 }; } // namespace detail diff --git a/include/nw4r/snd/snd_AxfxImpl.h b/include/nw4r/snd/snd_AxfxImpl.h index 751d6210..34734cb2 100644 --- a/include/nw4r/snd/snd_AxfxImpl.h +++ b/include/nw4r/snd/snd_AxfxImpl.h @@ -1,6 +1,7 @@ #ifndef NW4R_SND_AXFX_IMPL_H #define NW4R_SND_AXFX_IMPL_H #include + #include #include @@ -9,11 +10,17 @@ namespace snd { namespace detail { struct AxfxImpl { - static void *Alloc(u32 size); - static void Free(void *block); + bool mIsActive; // at 0x0 + MEMiHeapHead* mHeap; // at 0x4 + u32 mAllocCount; // at 0x8 + + static const u32 HEAP_SIZE_MIN = MEM_FRM_HEAP_MIN_SIZE + 32; AxfxImpl() : mIsActive(false), mHeap(NULL), mAllocCount(0) {} + bool CreateHeap(void* pBuffer, u32 size); + void DestroyHeap(); + u32 GetHeapTotalSize() { if (mHeap == NULL) { return 0; @@ -22,16 +29,13 @@ struct AxfxImpl { return MEMGetHeapTotalSize(mHeap); } - bool CreateHeap(void *buffer, u32 size); - void DestroyHeap(); - void HookAlloc(AXFXAllocHook *allocHook, AXFXFreeHook *freeHook); + void HookAlloc(AXFXAllocHook* pAllocHook, AXFXFreeHook* pFreeHook); void RestoreAlloc(AXFXAllocHook allocHook, AXFXFreeHook freeHook); - bool mIsActive; // at 0x0 - MEMiHeapHead *mHeap; // at 0x4 - u32 mAllocCount; // at 0x8 + static void* Alloc(u32 size); + static void Free(void* pBlock); - static AxfxImpl *mCurrentFx; + static AxfxImpl* mCurrentFx; static u32 mAllocatedSize; }; diff --git a/include/nw4r/snd/snd_Bank.h b/include/nw4r/snd/snd_Bank.h index 8b6e7d4d..78444132 100644 --- a/include/nw4r/snd/snd_Bank.h +++ b/include/nw4r/snd/snd_Bank.h @@ -1,26 +1,35 @@ #ifndef NW4R_SND_BANK_H #define NW4R_SND_BANK_H -#include "snd_BankFile.h" -#include "snd_Channel.h" -#include "snd_NoteOn.h" - -namespace nw4r -{ - namespace snd - { - namespace detail - { - struct Bank - { - Bank(const void *); - ~Bank(); - Channel * NoteOn(const NoteOnInfo &) const; - - BankFileReader mFileReader; // at 0x0 - const UNKTYPE * PTR_0xC; - }; - } - } -} - -#endif \ No newline at end of file +#include + +#include +#include + +namespace nw4r { +namespace snd { +namespace detail { + +// Forward declarations +class Channel; + +class Bank { +public: + explicit Bank(const void* pBankBin); + ~Bank(); + + Channel* NoteOn(const NoteOnInfo& rInfo) const; + + void SetWaveDataAddress(const void* pData) { + mWaveDataAddress = pData; + } + +private: + BankFileReader mBankReader; // at 0x0 + const void* mWaveDataAddress; // at 0xC +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_BankFile.h b/include/nw4r/snd/snd_BankFile.h index b7bfacc1..89ce5ccf 100644 --- a/include/nw4r/snd/snd_BankFile.h +++ b/include/nw4r/snd/snd_BankFile.h @@ -1,88 +1,106 @@ #ifndef NW4R_SND_BANK_FILE_H #define NW4R_SND_BANK_FILE_H -#include "common.h" -#include "snd_Util.h" -#include "snd_WaveFile.h" -#include "ut_algorithm.h" -#include "ut_binaryFileFormat.h" +#include + +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct InstInfo { - int WORD_0x0; - u8 mAttack; // at 0x4 - u8 mDecay; // at 0x5 - u8 mSustain; // at 0x6 - u8 mRelease; // at 0x7 - - u8 BYTE_0x8; - u8 BYTE_0x9; - u8 BYTE_0xA; - float FLOAT_0xC; +namespace BankFile { + +struct InstParam { + s32 waveIndex; // at 0x0 + u8 attack; // at 0x4 + u8 decay; // at 0x5 + u8 sustain; // at 0x6 + u8 release; // at 0x7 + char UNK_0x8[0x4]; + u8 originalKey; // at 0xC + u8 volume; // at 0xD + u8 pan; // at 0xE + f32 tune; // at 0x10 +}; + +struct RangeTable { + u8 tableSize; // at 0x0 + u8 key[]; // at 0x1 }; -struct BankFile { - struct InstParam { - int WORD_0x0; - u8 mAttack; // at 0x4 - u8 mDecay; // at 0x5 - u8 mSustain; // at 0x6 - u8 mRelease; // at 0x7 - - char UNK_0x8[0x4]; - - char BYTE_0xC; - u8 BYTE_0xD; - char BYTE_0xE; - float FLOAT_0x10; - }; - - struct RangeTable { - u8 BYTE_0x0; - u8 BYTES_0x1[]; - }; - - struct IndexTable { - u8 BYTE_0x0; - u8 BYTE_0x1; - }; - - ut::BinaryFileHeader mHeader; // at 0x0 - u32 OFFSET_0x10; - char UNK_0x14[0x4]; - u32 OFFSET_0x18; - - typedef Util::DataRef Region; +struct IndexTable { + u8 min; // at 0x0 + u8 max; // at 0x1 + u16 reserved; // at 0x2 + u8 ref[]; // at 0x4 }; -struct BankFileReader { - struct UNKBLOCK_DATA { - ut::BinaryBlockHeader mHeader; // at 0x0 - int INT_0x8; - BankFile::Region ARR_0xC[]; - }; - - struct UNKBLOCK_WAVE { - ut::BinaryBlockHeader mHeader; // at 0x0 - u32 INT_0x8; - WaveFile::Region ARR_0xC[]; - }; - - bool IsValidFileHeader(const void *); - BankFileReader(const void *); - bool ReadInstInfo(InstInfo *, int, int, int) const; - const BankFile::Region *GetReferenceToSubRegion(const BankFile::Region *, int) const; - bool ReadWaveParam(WaveData *, int, const void *) const; - - const BankFile *mFile; // at 0x0 - const UNKBLOCK_DATA *PTR_0x4; - const UNKBLOCK_WAVE *PTR_0x8; +typedef Util::DataRef DataRegion; +typedef Util::DataRef WaveRegion; + +struct Header { + ut::BinaryFileHeader fileHeader; // at 0x0 + u32 dataBlockOffset; // at 0x10 + u32 dataBlockSize; // at 0x14 + u32 waveBlockOffset; // at 0x18 + u32 waveBlockSize; // at 0x1C +}; + +struct DataBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + Util::Table instTable; // at 0x8 }; -inline u8 ReadByte(const void *ptr) { - return *static_cast(ptr); +struct WaveBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + Util::Table waveInfoTable; // at 0x8 +}; + +} // namespace BankFile + +struct InstInfo { + s32 waveIndex; // at 0x0 + u8 attack; // at 0x4 + u8 decay; // at 0x5 + u8 sustain; // at 0x6 + u8 release; // at 0x7 + u8 originalKey; // at 0x8 + u8 pan; // at 0x9 + u8 volume; // at 0xA + f32 tune; // at 0xC +}; + +inline u8 ReadByte(const void* pAddr) { + return *static_cast(pAddr); } + +class BankFileReader { +public: + static const u32 SIGNATURE = 'RBNK'; + static const int VERSION = NW4R_VERSION(1, 1); + +public: + explicit BankFileReader(const void* pBankBin); + + bool IsValidFileHeader(const void* pBankBin); + + bool ReadInstInfo(InstInfo* pInfo, int prgNo, int key, int velocity) const; + bool ReadWaveParam(WaveData* pData, int waveIndex, + const void* pWaveAddr) const; + +private: + const BankFile::DataRegion* + GetReferenceToSubRegion(const BankFile::DataRegion* pRef, + int splitKey) const; + +private: + const BankFile::Header* mHeader; // at 0x0 + const BankFile::DataBlock* mDataBlock; // at 0x4 + const BankFile::WaveBlock* mWaveBlock; // at 0x8 +}; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_BasicPlayer.h b/include/nw4r/snd/snd_BasicPlayer.h index 968a50d9..9ec09aee 100644 --- a/include/nw4r/snd/snd_BasicPlayer.h +++ b/include/nw4r/snd/snd_BasicPlayer.h @@ -1,7 +1,11 @@ #ifndef NW4R_SND_BASIC_PLAYER_H #define NW4R_SND_BASIC_PLAYER_H -#include #include + +#include + +#include + #include namespace nw4r { @@ -88,18 +92,17 @@ class BasicPlayer { void SetFxSend(AuxBus bus, f32 send); f32 GetFxSend(AuxBus bus) const; - void SetRemoteOutVolume(int remote, f32 vol); + void SetRemoteOutVolume(int remote, f32 volume); f32 GetRemoteOutVolume(int remote) const; f32 GetRemoteSend(int remote) const; - f32 GetRemoteFxSend(int remote) const; int GetRemoteFilter() const { return mRemoteFilter; } void SetRemoteFilter(int filter) { - mRemoteFilter = ut::Clamp(filter, FILTER_MIN, FILTER_MAX); + mRemoteFilter = ut::Clamp(filter, 0, REMOTE_FILTER_MAX); } PanMode GetPanMode() const { @@ -116,18 +119,16 @@ class BasicPlayer { mPanCurve = curve; } -public: - static const int FILTER_MIN = 0; - static const int FILTER_MAX = 127; - private: - u32 mId; // at 0x4 + u32 mId; // at 0x4 + f32 mVolume; // at 0x8 f32 mPitch; // at 0xC f32 mPan; // at 0x10 f32 mSurroundPan; // at 0x14 f32 mLpfFreq; // at 0x18 char UNK_0x1C[0x4]; + int mOutputLine; // at 0x20 f32 mMainOutVolume; // at 0x24 f32 mMainSend; // at 0x28 diff --git a/include/nw4r/snd/snd_BasicSound.h b/include/nw4r/snd/snd_BasicSound.h index 59cae0be..b1f88f4c 100644 --- a/include/nw4r/snd/snd_BasicSound.h +++ b/include/nw4r/snd/snd_BasicSound.h @@ -1,9 +1,12 @@ #ifndef NW4R_SND_BASIC_SOUND_H #define NW4R_SND_BASIC_SOUND_H +#include + #include #include -#include + #include + #include namespace nw4r { @@ -17,26 +20,42 @@ class BasicSound { NW4R_UT_RTTI_DECL(BasicSound); struct AmbientParamUpdateCallback { - virtual void detail_Update(SoundParam *param, u32 id, BasicSound *sound, const void *arg, u32 flags) = 0; + enum ParamUpdateFlags { + PARAM_UPDATE_VOLUME = (1 << 0), + PARAM_UPDATE_PAN = (1 << 1), + PARAM_UPDATE_SURROUND_PAN = (1 << 2), + PARAM_UPDATE_PRIORITY = (1 << 3), + }; + + virtual void detail_Update(SoundParam* pParam, u32 id, + BasicSound* pSound, const void* pArg, + u32 flags) = 0; // at 0xC }; struct AmbientArgUpdateCallback { - virtual void detail_Update(void *arg, const BasicSound *sound) = 0; + virtual void detail_Update(void* pArg, + const BasicSound* pSound) = 0; // at 0xC }; struct AmbientArgAllocaterCallback { - virtual void *detail_AllocAmbientArg(u32 size) = 0; - virtual void detail_FreeAmbientArg(void *arg, const BasicSound *sound) = 0; + virtual void* detail_AllocAmbientArg(u32 size) = 0; // at 0xC + + virtual void + detail_FreeAmbientArg(void* pArg, + const BasicSound* pSound) = 0; // at 0x10 }; struct AmbientArgInfo { - AmbientParamUpdateCallback *mParamUpdateCallback; // at 0x0 - AmbientArgUpdateCallback *mArgUpdateCallback; // at 0x4 - AmbientArgAllocaterCallback *mArgAllocaterCallback; // at 0x8 - void *arg; // at 0xC - u32 argSize; // at 0x10 + AmbientParamUpdateCallback* paramUpdateCallback; // at 0x0 + AmbientArgUpdateCallback* argUpdateCallback; // at 0x4 + AmbientArgAllocaterCallback* argAllocaterCallback; // at 0x8 + void* arg; // at 0xC + u32 argSize; // at 0x10 }; + static const u32 INVALID_ID = 0xFFFFFFFF; + static const int PRIORITY_MAX = 127; + public: BasicSound(); virtual ~BasicSound() {} // at 0xC @@ -51,27 +70,29 @@ class BasicSound { virtual bool IsPrepared() const = 0; // at 0x2C virtual bool IsPause() const; // at 0x30 - virtual void SetInitialVolume(f32 vol); // at 0x34 - virtual void SetVolume(f32 vol, int frames); // at 0x38 - virtual void SetPitch(f32 pitch); // at 0x3C - virtual void SetPan(f32 pan); // at 0x40 - virtual void SetSurroundPan(f32 pan); // at 0x44 - virtual void SetLpfFreq(f32 freq); // at 0x48 - virtual void SetPlayerPriority(int prio); // at 0x4C - virtual void SetRemoteFilter(int filter); // at 0x50 - virtual void SetPanMode(PanMode mode); // at 0x54 - virtual void SetPanCurve(PanCurve curve); // at 0x58 - virtual bool IsAttachedTempSpecialHandle() = 0; // at 0x5C - virtual void DetachTempSpecialHandle() = 0; // at 0x60 + virtual void SetInitialVolume(f32 vol); // at 0x34 + virtual void SetVolume(f32 vol, int frames); // at 0x38 + virtual void SetPitch(f32 pitch); // at 0x3C + virtual void SetPan(f32 pan); // at 0x40 + virtual void SetSurroundPan(f32 pan); // at 0x44 + virtual void SetLpfFreq(f32 freq); // at 0x48 + virtual void SetPlayerPriority(int priority); // at 0x4C + virtual void SetRemoteFilter(int filter); // at 0x50 + virtual void SetPanMode(PanMode mode); // at 0x54 + virtual void SetPanCurve(PanCurve curve); // at 0x58 + + virtual bool IsAttachedTempSpecialHandle() = 0; // at 0x5C + virtual void DetachTempSpecialHandle() = 0; // at 0x60 + virtual void InitParam(); // at 0x64 - virtual BasicPlayer *GetBasicPlayer() = 0; // at 0x68 - virtual const BasicPlayer *GetBasicPlayer() const = 0; // at 0x6C + virtual BasicPlayer& GetBasicPlayer() = 0; // at 0x68 + virtual const BasicPlayer& GetBasicPlayer() const = 0; // at 0x6C - PlayerHeap *GetPlayerHeap() { - return mPlayerHeap; + PlayerHeap* GetPlayerHeap() { + return mHeap; } - void SetPlayerHeap(PlayerHeap *heap) { - mPlayerHeap = heap; + void SetPlayerHeap(PlayerHeap* pHeap) { + mHeap = pHeap; } bool IsAttachedGeneralHandle(); @@ -80,45 +101,51 @@ class BasicSound { bool IsAttachedTempGeneralHandle(); void DetachTempGeneralHandle(); - SoundPlayer *GetSoundPlayer() { + SoundPlayer* GetSoundPlayer() { return mSoundPlayer; } - void SetSoundPlayer(SoundPlayer *player) { - mSoundPlayer = player; + void SetSoundPlayer(SoundPlayer* pPlayer) { + mSoundPlayer = pPlayer; } - ExternalSoundPlayer *GetExternalSoundPlayer() { + ExternalSoundPlayer* GetExternalSoundPlayer() { return mExtSoundPlayer; } - void SetExternalSoundPlayer(ExternalSoundPlayer *player) { - mExtSoundPlayer = player; + void SetExternalSoundPlayer(ExternalSoundPlayer* pExtPlayer) { + mExtSoundPlayer = pExtPlayer; } - AmbientParamUpdateCallback *GetAmbientParamUpdateCallback() { - return mParamUpdateCallback; + AmbientParamUpdateCallback* GetAmbientParamUpdateCallback() { + return mAmbientParamUpdateCallback; } - AmbientArgUpdateCallback *GetAmbientArgUpdateCallback() { - return mArgUpdateCallback; + AmbientArgUpdateCallback* GetAmbientArgUpdateCallback() { + return mAmbientArgUpdateCallback; } void ClearAmbientArgUpdateCallback() { - mArgUpdateCallback = NULL; + mAmbientArgUpdateCallback = NULL; } - AmbientArgAllocaterCallback *GetAmbientArgAllocaterCallback() { - return mArgAllocCallback; + AmbientArgAllocaterCallback* GetAmbientArgAllocaterCallback() { + return mAmbientArgAllocaterCallback; } - void *GetAmbientArg() { - return mCallbackArg; + void* GetAmbientArg() { + return mAmbientArg; } - SoundParam &GetAmbientParam() { + SoundParam& GetAmbientParam() { return mAmbientParam; } - void SetAmbientParamCallback(AmbientParamUpdateCallback *paramUpdate, AmbientArgUpdateCallback *argUpdate, - AmbientArgAllocaterCallback *argAlloc, void *arg); + void SetAmbientParamCallback(AmbientParamUpdateCallback* pParamUpdate, + AmbientArgUpdateCallback* pArgUpdate, + AmbientArgAllocaterCallback* pArgAlloc, + void* pArg); + + void SetPriority(int priority) { + mPriority = priority; + } u32 GetId() const { return mId; @@ -126,7 +153,7 @@ class BasicSound { void SetId(u32 id); f32 GetMoveVolume() { - return mExtVolume.GetValue(); + return mExtMoveVolume.GetValue(); } f32 GetInitialVolume() const; @@ -147,45 +174,46 @@ class BasicSound { void SetFxSend(AuxBus bus, f32 send); int CalcCurrentPlayerPriority() const { - return ut::Clamp(mPriority + mAmbientParam.priority, PRIORITY_MIN, PRIORITY_MAX); + return ut::Clamp(mPriority + mAmbientParam.priority, 0, PRIORITY_MAX); } -public: - static const int PRIORITY_MIN = 0; - static const int PRIORITY_MAX = 127; - private: - PlayerHeap *mPlayerHeap; // at 0x4 - SoundHandle *mGeneralHandle; // at 0x8 - SoundHandle *mTempGeneralHandle; // at 0xC - SoundPlayer *mSoundPlayer; // at 0x10 - ExternalSoundPlayer *mExtSoundPlayer; // at 0x14 - AmbientParamUpdateCallback *mParamUpdateCallback; // at 0x18 - AmbientArgUpdateCallback *mArgUpdateCallback; // at 0x1C - AmbientArgAllocaterCallback *mArgAllocCallback; // at 0x20 - void *mCallbackArg; // at 0x24 - SoundParam mAmbientParam; // at 0x28 - MoveValue mFadeVolume; // at 0x44 - MoveValue mPauseFadeVolume; // at 0x54 - bool mIsStarting; // at 0x64 - bool mIsStarted; // at 0x65 - bool mIsAutoStop; // at 0x66 - bool mIsPause; // at 0x67 - bool mIsPauseFade; // at 0x68 - bool mIsFadeOut; // at 0x69 - int mAutoStopCounter; // at 0x6C - u32 mUpdateCounter; // at 0x70 - u8 mPriority; // at 0x74 - u32 mId; // at 0x78 - MoveValue mExtVolume; // at 0x7C - f32 mInitVolume; // at 0x8C - f32 mExtPan; // at 0x90 - f32 mExtSurroundPan; // at 0x94 - f32 mExtPitch; // at 0x98 - bool mEnableOutputLine; // at 0x9C - int mOutputLine; // at 0xA0 - f32 mMainOutVolume; // at 0xA4 - f32 mRemoteOutVolumes[WPAD_MAX_CONTROLLERS]; // at 0xA8 + PlayerHeap* mHeap; // at 0x4 + SoundHandle* mGeneralHandle; // at 0x8 + SoundHandle* mTempGeneralHandle; // at 0xC + SoundPlayer* mSoundPlayer; // at 0x10 + ExternalSoundPlayer* mExtSoundPlayer; // at 0x14 + + AmbientParamUpdateCallback* mAmbientParamUpdateCallback; // at 0x18 + AmbientArgUpdateCallback* mAmbientArgUpdateCallback; // at 0x1C + AmbientArgAllocaterCallback* mAmbientArgAllocaterCallback; // at 0x20 + void* mAmbientArg; // at 0x24 + SoundParam mAmbientParam; // at 0x28 + + MoveValue mFadeVolume; // at 0x44 + MoveValue mPauseFadeVolume; // at 0x54 + bool mStartFlag; // at 0x64 + bool mStartedFlag; // at 0x65 + bool mAutoStopFlag; // at 0x66 + bool mPauseFlag; // at 0x67 + bool mPauseFadeFlag; // at 0x68 + bool mFadeOutFlag; // at 0x69 + int mAutoStopCounter; // at 0x6C + u32 mUpdateCounter; // at 0x70 + + u8 mPriority; // at 0x74 + u32 mId; // at 0x78 + + MoveValue mExtMoveVolume; // at 0x7C + f32 mInitVolume; // at 0x8C + f32 mExtPan; // at 0x90 + f32 mExtSurroundPan; // at 0x94 + f32 mExtPitch; // at 0x98 + + bool mOutputLineFlagEnable; // at 0x9C + int mOutputLineFlag; // at 0xA0 + f32 mMainOutVolume; // at 0xA4 + f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0xA8 public: NW4R_UT_LIST_NODE_DECL_EX(Prio); // at 0xB8 diff --git a/include/nw4r/snd/snd_Channel.h b/include/nw4r/snd/snd_Channel.h index ce5c8e35..8a89fa00 100644 --- a/include/nw4r/snd/snd_Channel.h +++ b/include/nw4r/snd/snd_Channel.h @@ -1,143 +1,254 @@ #ifndef NW4R_SND_CHANNEL_H #define NW4R_SND_CHANNEL_H -#include "common.h" -#include "snd_EnvGenerator.h" -#include "snd_InstancePool.h" -#include "snd_Lfo.h" -#include "snd_MoveValue.h" -#include "snd_Voice.h" -#include "snd_WaveFile.h" -#include "ut_LinkList.h" +#include + +#include +#include +#include +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct Channel { - enum ChannelCallbackStatus { CALLBACK_STATUS_0, CALLBACK_STATUS_1, CALLBACK_STATUS_2, CALLBACK_STATUS_3 }; - typedef void (*ChannelCallback)(Channel *, ChannelCallbackStatus, u32); +class Channel { +public: + enum ChannelCallbackStatus { + CALLBACK_STATUS_STOPPED, + CALLBACK_STATUS_DROP, + CALLBACK_STATUS_FINISH, + CALLBACK_STATUS_CANCEL + }; - static void VoiceCallbackFunc(Voice *, Voice::VoiceCallbackStatus, void *); + typedef void (*ChannelCallback)(Channel* pDropChannel, + ChannelCallbackStatus status, + u32 callbackArg); - static Channel *AllocChannel(int, int, int, ChannelCallback, u32); - static void FreeChannel(Channel *); - Channel(); + enum LfoTarget { LFO_TARGET_PITCH, LFO_TARGET_VOLUME, LFO_TARGET_PAN }; - UNKTYPE InitParam(ChannelCallback, u32); - void Update(bool); - UNKTYPE Start(const WaveData &, int, u32); - UNKTYPE Release(); - UNKTYPE Stop(); - - float GetSweepValue() const; - void UpdateSweep(int); - void SetSweepParam(float, int, bool); - - EnvGenerator mEnvGenerator; // at 0x0 - Lfo mLfo; // at 0x18 - u8 BYTE_0x30; - bool mPauseFlag; // at 0x31 - bool mActiveFlag; // at 0x32 - bool BOOL_0x33; - bool mAutoUpdateSweepFlag; // at 0x34 - bool mReleasePriorityFixFlag; // at 0x35 +public: + Channel(); + ~Channel(); - float FLOAT_0x38; - float FLOAT_0x3C; - float FLOAT_0x40; - float FLOAT_0x44; - float FLOAT_0x48; + void InitParam(ChannelCallback pCallback, u32 callbackArg); + void Update(bool periodic); + void Start(const WaveData& rData, int length, u32 offset); + void Release(); + void Stop(); - int mRemoteFilter; // at 0x4c - int mOutputLine; // at 0x50 + void SetAttack(int attack) { + mEnvelope.SetAttack(attack); + } + void SetDecay(int decay) { + mEnvelope.SetDecay(decay); + } + void SetSustain(int sustain) { + mEnvelope.SetSustain(sustain); + } + void SetRelease(int release) { + mEnvelope.SetRelease(release); + } + bool IsRelease() const { + return mEnvelope.GetStatus() == EnvGenerator::STATUS_RELEASE; + } - float FLOAT_0x54; - float FLOAT_0x58; + void SetLfoParam(const LfoParam& rParam) { + mLfo.SetParam(rParam); + } + void SetLfoTarget(LfoTarget target) { + mLfoTarget = target; + } - float ARR_0x5C[3]; + void Pause(bool pause) { + mPauseFlag = pause; + mVoice->Pause(pause); + } + void SetReleasePriorityFix(bool fix) { + mReleasePriorityFixFlag = fix; + } - float mRemoteOutVolumes[4]; // at 0x68 - float ARR_0x78[4]; - float ARR_0x88[4]; + bool IsPause() const { + return mPauseFlag != false; + } + bool IsActive() const { + return mActiveFlag; + } + bool IsAutoUpdateSweep() const { + return mAutoSweep; + } - float FLOAT_0x98; - float FLOAT_0x9C; + void SetUserVolume(f32 volume) { + mUserVolume = volume; + } + void SetUserPitch(f32 pitch) { + mUserPitch = pitch; + } + void SetUserPitchRatio(f32 ratio) { + mUserPitchRatio = ratio; + } + void SetUserPan(f32 pan) { + mUserPan = pan; + } + void SetUserSurroundPan(f32 pan) { + mUserSurroundPan = pan; + } + void SetUserLpfFreq(f32 freq) { + mUserLpfFreq = freq; + } - int INT_0xA0; - int INT_0xA4; + void SetRemoteFilter(int filter) { + mRemoteFilter = filter; + } + void SetOutputLine(int flag) { + mOutputLineFlag = flag; + } - float FLOAT_0xA8; - float FLOAT_0xAC; - float FLOAT_0xB0; - float FLOAT_0xB4; - MoveValue MV_0xB8; - UNKWORD INT_0xC0; - UNKWORD INT_0xC4; - int mLength; // at 0xc8 + void SetMainOutVolume(f32 volume) { + mMainOutVolume = volume; + } + void SetMainSend(f32 send) { + mMainSend = send; + } + void SetFxSend(AuxBus bus, f32 send) { + mFxSend[bus] = send; + } - PanMode mPanMode; // at 0xcc - PanCurve mPanCurve; // at 0xd0 + void SetRemoteOutVolume(int remote, f32 volume) { + mRemoteOutVolume[remote] = volume; + } + void SetRemoteSend(int remote, f32 send) { + mRemoteSend[remote] = send; + } + void SetRemoteFxSend(int remote, f32 send) { + mRemoteFxSend[remote] = send; + } - ChannelCallback mCallback; // at 0xd4 - u32 INT_0xD8; - Voice *mVoice; // at 0xdc - Channel *mNext; // at 0xe0 - ut::LinkListNode mNode; // at 0xe4 + void UpdateSweep(int count); + void SetSweepParam(f32 pitch, int time, bool autoUpdate); + f32 GetSweepValue() const; - inline bool IsActive() const { - return mActiveFlag; + void SetInitVolume(f32 volume) { + mInitVolume = volume; + } + void SetInitPan(f32 pan) { + mInitPan = pan; + } + void SetInitSurroundPan(f32 pan) { + mInitSurroundPan = pan; + } + void SetTune(f32 tune) { + mTune = tune; + } + void SetSilence(bool silence, int fadeTime) { + mSilenceVolume.SetTarget(silence ? 0 : SILENCE_VOLUME_MAX, fadeTime); } - inline void SetRelease(int release) { - if (release >= 0) { - mEnvGenerator.SetRelease(release); - } + void SetKey(int key) { + mKey = key; + } + void SetOriginalKey(int key) { + mOriginalKey = key; + } - Release(); + s32 GetLength() const { + return mLength; + } + void SetLength(s32 length) { + mLength = length; } - inline bool IsAutoUpdateSweep() const { - return mAutoUpdateSweepFlag; + void SetPanMode(PanMode mode) { + mPanMode = mode; + } + void SetPanCurve(PanCurve curve) { + mPanCurve = curve; } - inline bool IsPause() const { - return mPauseFlag; + Channel* GetNextTrackChannel() const { + return mNextLink; + } + void SetNextTrackChannel(Channel* pChannel) { + mNextLink = pChannel; } - inline void Pause(bool flag) { - mPauseFlag = flag; + static Channel* AllocChannel(int channels, int voices, int priority, + ChannelCallback pCallback, u32 callbackArg); + static void FreeChannel(Channel* pChannel); - mVoice->Pause(flag); - } +private: + static const u8 SILENCE_VOLUME_MAX = 255; - inline void SetLfoParam(const LfoParam &lfoParam) { - mLfo.SetParam(lfoParam); - } + static const int KEY_INIT = 60; + static const int ORIGINAL_KEY_INIT = 60; - inline void SetSilence(bool silentFlag, int time) { - MV_0xB8.SetTarget(silentFlag ? 0 : 0xFF, time); - } -}; + static const int PRIORITY_RELEASE = 1; + +private: + static void VoiceCallbackFunc(Voice* pDropVoice, + Voice::VoiceCallbackStatus status, + void* pCallbackArg); + +private: + EnvGenerator mEnvelope; // at 0x0 + Lfo mLfo; // at 0x18 + u8 mLfoTarget; // at 0x30 + + bool mPauseFlag; // at 0x31 + bool mActiveFlag; // at 0x32 + bool mAllocFlag; // at 0x33 + bool mAutoSweep; // at 0x34 + bool mReleasePriorityFixFlag; // at 0x35 + + f32 mUserVolume; // at 0x38 + f32 mUserPitchRatio; // at 0x3C + f32 mUserPan; // at 0x40 + f32 mUserSurroundPan; // at 0x44 + f32 mUserLpfFreq; // at 0x48 + + int mRemoteFilter; // at 0x4C + int mOutputLineFlag; // at 0x50 -struct ChannelManager { - ChannelManager(); + f32 mMainOutVolume; // at 0x54 + f32 mMainSend; // at 0x58 + f32 mFxSend[AUX_BUS_NUM]; // at 0x5C - u32 GetRequiredMemSize(); - void Setup(void *, u32); - void Shutdown(); - UNKTYPE UpdateAllChannel(); - static void Free(Channel *); // inlined - Channel *Alloc(); // inlined - static ChannelManager *GetInstance(); + f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0x68 + f32 mRemoteSend[WPAD_MAX_CONTROLLERS]; // at 0x78 + f32 mRemoteFxSend[WPAD_MAX_CONTROLLERS]; // at 0x88 - InstancePool mPool; // at 0x0 - ut::LinkList mList; // at 0x4 + f32 mUserPitch; // at 0x98 + f32 mSweepPitch; // at 0x9C + int mSweepCounter; // at 0xA0 + int mSweepLength; // at 0xA4 - bool BOOL_0x10; - u32 INT_0x14; - UNKTYPE *PTR_0x18; - u32 INT_0x1C; + f32 mInitVolume; // at 0xA8 + f32 mInitPan; // at 0xAC + f32 mInitSurroundPan; // at 0xB0 + f32 mTune; // at 0xB4 + MoveValue mSilenceVolume; // at 0xB8 + + int mKey; // at 0xC0 + int mOriginalKey; // at 0xC4 + int mLength; // at 0xC8 + + PanMode mPanMode; // at 0xCC + PanCurve mPanCurve; // at 0xD0 + + ChannelCallback mCallback; // at 0xD4 + u32 mCallbackData; // at 0xD8 + + Voice* mVoice; // at 0xDC + Channel* mNextLink; // at 0xE0 + +public: + NW4R_UT_LIST_NODE_DECL(); // at 0xE4 }; + +NW4R_UT_LIST_TYPEDEF_DECL(Channel); + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_ChannelManager.h b/include/nw4r/snd/snd_ChannelManager.h index 7bb2f56d..bc050d6e 100644 --- a/include/nw4r/snd/snd_ChannelManager.h +++ b/include/nw4r/snd/snd_ChannelManager.h @@ -1,15 +1,46 @@ #ifndef NW4R_SND_CHANNEL_MANAGER_H #define NW4R_SND_CHANNEL_MANAGER_H -#include "common.h" +#include + +#include +#include namespace nw4r { namespace snd { namespace detail { -struct ChannelManager { - static ChannelManager *GetInstance(); +class ChannelManager { + friend class Channel; // Alloc/Free intended through Channel only + +public: + static const int VOICE_MARGIN = 1; + static const int VOICE_MAX = AX_VOICE_MAX + VOICE_MARGIN; + static const int WORK_SIZE_MAX = VOICE_MAX * sizeof(Channel); + +public: + static ChannelManager& GetInstance(); + + u32 GetRequiredMemSize(); + + void Setup(void* pWork, u32 workSize); + void Shutdown(); void UpdateAllChannel(); + +private: + ChannelManager(); + + Channel* Alloc(); + void Free(Channel* pChannel); + +private: + InstancePool mPool; // at 0x0 + ChannelList mChannelList; // at 0x4 + bool mInitialized; // at 0x10 + u32 mChannelCount; // at 0x14 + void* mMem; // at 0x18 + u32 mMemSize; // at 0x1C }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_Common.h b/include/nw4r/snd/snd_Common.h index 9bf11875..4b352a90 100644 --- a/include/nw4r/snd/snd_Common.h +++ b/include/nw4r/snd/snd_Common.h @@ -5,6 +5,26 @@ namespace nw4r { namespace snd { +static const int CHANNEL_MIN = 1; +static const int CHANNEL_MAX = 2; + +static const int REMOTE_FILTER_MAX = 127; + +// 12 notes each with 256 microtones +static const int SEMITONE_MAX = 12; +static const int MICROTONE_MAX = 256; + +// Volume in range [-90.4db, 6.0db] +static const f32 VOLUME_MIN_DB = -90.4f; +static const f32 VOLUME_MAX_DB = 6.0f; +static const f32 VOLUME_RANGE_DB = -(VOLUME_MIN_DB - VOLUME_MAX_DB); +static const int VOLUME_RANGE_MB = static_cast(10 * VOLUME_RANGE_DB); + +enum OutputLineFlag { + OUTPUT_LINE_MAIN = (1 << 0), + OUTPUT_LINE_REMOTE_N = (1 << 1), +}; + enum AuxBus { AUX_A, AUX_B, AUX_C, AUX_BUS_NUM }; enum OutputMode { @@ -30,6 +50,7 @@ enum PanMode { PAN_MODE_DUAL, PAN_MODE_BALANCE, }; + enum PanCurve { PAN_CURVE_SQRT, PAN_CURVE_SQRT_0DB, @@ -56,6 +77,12 @@ struct AdpcmLoopParam { u16 loop_yn2; // at 0x4 }; +struct AdpcmInfo { + AdpcmParam param; // at 0x0 + AdpcmLoopParam loopParam; // at 0x28 + u16 padding; +}; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_DisposeCallback.h b/include/nw4r/snd/snd_DisposeCallback.h index 69234cc5..3d6c0360 100644 --- a/include/nw4r/snd/snd_DisposeCallback.h +++ b/include/nw4r/snd/snd_DisposeCallback.h @@ -1,18 +1,28 @@ #ifndef NW4R_SND_DISPOSE_CALLBACK_H #define NW4R_SND_DISPOSE_CALLBACK_H -#include "common.h" -#include "ut_LinkList.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct DisposeCallback { - ut::LinkListNode mNode; // at 0x0 - inline virtual ~DisposeCallback() {} // at 0x8 - virtual void InvalidateData(const void *, const void *) = 0; // at 0xc - virtual void InvalidateWaveData(const void *, const void *) = 0; // at 0x10 +class DisposeCallback { +public: + NW4R_UT_LIST_NODE_DECL(); // at 0x0 + +public: + virtual ~DisposeCallback() {} // at 0x8 + + virtual void InvalidateData(const void* pStart, + const void* pEnd) = 0; // at 0xC + virtual void InvalidateWaveData(const void* pStart, + const void* pEnd) = 0; // at 0x10 }; + +NW4R_UT_LIST_TYPEDEF_DECL(DisposeCallback); + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_DisposeCallbackManager.h b/include/nw4r/snd/snd_DisposeCallbackManager.h index 26547a6a..4940f3b5 100644 --- a/include/nw4r/snd/snd_DisposeCallbackManager.h +++ b/include/nw4r/snd/snd_DisposeCallbackManager.h @@ -1,23 +1,30 @@ #ifndef NW4R_SND_DISPOSE_CALLBACK_MANAGER_H #define NW4R_SND_DISPOSE_CALLBACK_MANAGER_H -#include "common.h" -#include "snd_DisposeCallback.h" -#include "ut_LinkList.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct DisposeCallbackManager { - static DisposeCallbackManager *GetInstance(); - ut::LinkList mList; // at 0x0 +class DisposeCallbackManager { +public: + static DisposeCallbackManager& GetInstance(); + + void RegisterDisposeCallback(DisposeCallback* pCallback); + void UnregisterDisposeCallback(DisposeCallback* pCallback); - UNKTYPE RegisterDisposeCallback(DisposeCallback *); - UNKTYPE UnregisterDisposeCallback(DisposeCallback *); + void Dispose(void* pData, u32 size, void* pArg); + void DisposeWave(void* pData, u32 size, void* pArg); - UNKTYPE Dispose(void *, u32, void *); - UNKTYPE DisposeWave(void *, u32, void *); +private: + DisposeCallbackManager(); + +private: + DisposeCallbackList mCallbackList; // at 0x0 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_DvdSoundArchive.h b/include/nw4r/snd/snd_DvdSoundArchive.h index 257b026b..a8d18988 100644 --- a/include/nw4r/snd/snd_DvdSoundArchive.h +++ b/include/nw4r/snd/snd_DvdSoundArchive.h @@ -1,41 +1,67 @@ #ifndef NW4R_SND_DVD_SOUND_ARCHIVE_H #define NW4R_SND_DVD_SOUND_ARCHIVE_H -#include -#include "ut_DvdLockedFileStream.h" -#include "snd_SoundArchive.h" -#include "snd_SoundArchiveFile.h" - -namespace nw4r -{ - namespace snd - { - struct DvdSoundArchive : SoundArchive - { - struct DvdFileStream; - - detail::SoundArchiveFileReader mFileReader; // at 0x108 - DVDFileInfo mFileInfo; // at 0x14c - bool mOpenFlag; // at 0x188 - - DvdSoundArchive(); - - virtual ~DvdSoundArchive(); // at 0x8 - virtual const void * detail_GetFileAddress(u32) const; // at 0xC - virtual const void * detail_GetWaveDataFileAddress(u32) const; // at 0x10 - virtual int detail_GetRequiredStreamBufferSize() const; // at 0x14 - virtual ut::FileStream * OpenStream(void *, int, u32, u32) const; // at 0x18 - virtual ut::FileStream * OpenExtStream(void *, int, const char *, u32, u32) const; // at 0x1c - - bool Open(s32); //inlined - bool Open(const char *); - - void Close(); - - bool LoadFileHeader(); //inlined - bool LoadHeader(void *, u32); - bool LoadLabelStringData(void *, u32); - }; - } -} - -#endif \ No newline at end of file +#include + +#include +#include + +#include + +#include + +namespace nw4r { +namespace snd { + +class DvdSoundArchive : public SoundArchive { +private: + class DvdFileStream; + +public: + DvdSoundArchive(); + virtual ~DvdSoundArchive(); // at 0x8 + + virtual const void* detail_GetFileAddress(u32 /* id */) const { + return NULL; + } // at 0xC + + virtual const void* detail_GetWaveDataFileAddress(u32 /* id */) const { + return NULL; + } // at 0x10 + + virtual int detail_GetRequiredStreamBufferSize() const; // at 0x14 + + virtual ut::FileStream* OpenStream(void* pBuffer, int size, u32 offset, + u32 length) const; // at 0x18 + + virtual ut::FileStream* OpenExtStream(void* pBuffer, int size, + const char* pExtPath, u32 offset, + u32 length) const; // at 0x1C + + bool Open(s32 entrynum); + bool Open(const char* pPath); + + void Close(); + + bool LoadHeader(void* pBuffer, u32 size); + bool LoadLabelStringData(void* pBuffer, u32 size); + + u32 GetHeaderSize() const { + return mFileReader.GetInfoChunkSize(); + } + u32 GetLabelStringDataSize() const { + return mFileReader.GetLabelStringChunkSize(); + } + +private: + bool LoadFileHeader(); + +private: + detail::SoundArchiveFileReader mFileReader; // at 0x108 + DVDFileInfo mFileInfo; // at 0x14C + bool mOpen; // at 0x188 +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_EnvGenerator.h b/include/nw4r/snd/snd_EnvGenerator.h index a102ef96..f98a8721 100644 --- a/include/nw4r/snd/snd_EnvGenerator.h +++ b/include/nw4r/snd/snd_EnvGenerator.h @@ -13,32 +13,45 @@ class EnvGenerator { public: EnvGenerator(); - void Init(f32 db); - void Reset(f32 db); + void Init(f32 db = VOLUME_INIT); + void Reset(f32 db = VOLUME_INIT); f32 GetValue() const; void Update(int msec); - Status GetStatus() const { return mStatus; } - void SetStatus(Status status) { mStatus = status; } + Status GetStatus() const { + return mStatus; + } + void SetStatus(Status status) { + mStatus = status; + } void SetAttack(int attack); void SetDecay(int decay); void SetSustain(int sustain); void SetRelease(int release); +private: + static const int DECIBEL_SQUARE_TABLE_SIZE = 128; + + static const volatile f32 VOLUME_INIT; + static const int ATTACK_INIT = 127; + static const int DECAY_INIT = 127; + static const int SUSTAIN_INIT = 127; + static const int RELEASE_INIT = 127; + +private: f32 CalcRelease(int release); int CalcDecibelSquare(int scale); private: - static const volatile f32 VOLUME_INIT; - static const s16 DecibelSquareTable[128]; - Status mStatus; // at 0x0 f32 mValue; // at 0x4 f32 mDecay; // at 0x8 f32 mRelease; // at 0xC f32 mAttack; // at 0x10 u8 mSustain; // at 0x14 + + static const s16 DecibelSquareTable[DECIBEL_SQUARE_TABLE_SIZE]; }; } // namespace detail diff --git a/include/nw4r/snd/snd_ExternalSoundPlayer.h b/include/nw4r/snd/snd_ExternalSoundPlayer.h index b3a288ca..0316e37a 100644 --- a/include/nw4r/snd/snd_ExternalSoundPlayer.h +++ b/include/nw4r/snd/snd_ExternalSoundPlayer.h @@ -1,8 +1,9 @@ #ifndef NW4R_SND_EXTERNAL_SOUND_PLAYER_H #define NW4R_SND_EXTERNAL_SOUND_PLAYER_H -#include #include +#include + namespace nw4r { namespace snd { namespace detail { @@ -12,19 +13,25 @@ class ExternalSoundPlayer { ExternalSoundPlayer(); ~ExternalSoundPlayer(); - int GetPlayableSoundCount() const { return mPlayableSoundCount; } + int GetPlayableSoundCount() const { + return mPlayableCount; + } void SetPlayableSoundCount(int count); - int GetPlayingSoundCount() const { return mSoundList.GetSize(); } + int GetPlayingSoundCount() const { + return mSoundList.GetSize(); + } - f32 detail_GetVolume() const { return mVolume; } + f32 detail_GetVolume() const { + return mVolume; + } BasicSound* GetLowestPrioritySound(); - void InsertSoundList(BasicSound* sound); - void RemoveSoundList(BasicSound* sound); + void InsertSoundList(BasicSound* pSound); + void RemoveSoundList(BasicSound* pSound); template - TForEachFunc ForEachSound(TForEachFunc func, bool reverse) { + TForEachFunc ForEachSound(TForEachFunc pFunction, bool reverse) { if (reverse) { BasicSoundExtPlayList::RevIterator it = mSoundList.GetBeginReverseIter(); @@ -34,30 +41,26 @@ class ExternalSoundPlayer { SoundHandle handle; handle.detail_AttachSoundAsTempHandle(&*curr); - func(handle); + pFunction(handle); if (handle.IsAttachedSound()) { ++it; } } } else { - BasicSoundExtPlayList::Iterator it = mSoundList.GetBeginIter(); - - while (it != mSoundList.GetEndIter()) { - BasicSoundExtPlayList::Iterator curr = it++; - + NW4R_UT_LIST_SAFE_FOREACH(mSoundList, SoundHandle handle; - handle.detail_AttachSoundAsTempHandle(&*curr); - func(handle); - } + handle.detail_AttachSoundAsTempHandle(&*it); + pFunction(handle); + ); } - return func; + return pFunction; } private: BasicSoundExtPlayList mSoundList; // at 0x0 - u16 mPlayableSoundCount; // at 0xC + u16 mPlayableCount; // at 0xC f32 mVolume; // at 0x10 }; diff --git a/include/nw4r/snd/snd_FrameHeap.h b/include/nw4r/snd/snd_FrameHeap.h index fcab561b..ab4d3faf 100644 --- a/include/nw4r/snd/snd_FrameHeap.h +++ b/include/nw4r/snd/snd_FrameHeap.h @@ -1,73 +1,92 @@ #ifndef NW4R_SND_FRAME_HEAP_H #define NW4R_SND_FRAME_HEAP_H -#include "common.h" -#include "ut_LinkList.h" -#include "ut_algorithm.h" +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct FrameHeap { - typedef void (*AllocCallback)(void *, u32, void *); +class FrameHeap { +public: + typedef void (*FreeCallback)(void* pBuffer, u32 size, void* pCallbackArg); + +public: + FrameHeap(); + ~FrameHeap(); + + bool Create(void* pBase, u32 size); + void Destroy(); + void Clear(); + void* Alloc(u32 size, FreeCallback pCallback, void* pCallbackArg); + + int SaveState(); + void LoadState(int id); + + int GetCurrentLevel() const; + u32 GetFreeSize() const; + + bool IsValid() const { + return mHandle != NULL; + } + +private: struct Block { - ut::LinkListNode mNode; // at 0x0 - u32 mSize; // at 0x8 - AllocCallback mCallback; // at 0xc - void *PTR_0x10; + NW4R_UT_LIST_NODE_DECL(); // at 0x0 + u32 mSize; // at 0x8 + FreeCallback mCallback; // at 0xc + void* mCallbackArg; // at 0x10 - inline Block(u32 size, AllocCallback callback, void *ptr) : mSize(size), mCallback(callback), PTR_0x10(ptr) {} + Block(u32 size, FreeCallback pCallback, void* pCallbackArg) + : mSize(size), mCallback(pCallback), mCallbackArg(pCallbackArg) {} - inline void *GetBufferAddr() { - return reinterpret_cast(this) + ut::RoundUp(sizeof(Block), 0x20); + ~Block() { + if (mCallback != NULL) { + mCallback(GetBufferAddr(), mSize, mCallbackArg); + } } - inline ~Block() { - if (mCallback) { - mCallback(PTR_0x10, mSize, GetBufferAddr()); - } + void* GetBufferAddr() { + return ut::AddOffsetToPtr(this, BLOCK_BUFFER_SIZE); } }; - struct Section { - ut::LinkListNode mNode; // at 0x0 - ut::LinkList mList; // at 0x8 + NW4R_UT_LIST_TYPEDEF_DECL(Block); - inline void AppendBlock(Block *pBlock) { - mList.PushBack(pBlock); - } + struct Section { + NW4R_UT_LIST_NODE_DECL(); // at 0x0 + BlockList mBlockList; // at 0x8 - inline ~Section() { - ut::LinkList::Iterator iter = mList.GetEndIter(); + ~Section() { + for (BlockList::Iterator it = mBlockList.GetEndIter(); + it != mBlockList.GetBeginIter();) { - while (iter != mList.GetBeginIter()) { - (--iter)->~Block(); + (--it)->~Block(); } } + + void AppendBlock(Block* pBlock) { + mBlockList.PushBack(pBlock); + } }; - bool NewSection(); // inlined - UNKTYPE ClearSection(); // inlined + NW4R_UT_LIST_TYPEDEF_DECL(Section); - FrameHeap(); - ~FrameHeap(); + static const int BLOCK_BUFFER_SIZE = ROUND_UP(sizeof(Block), 32); + static const int HEAP_ALIGN = 32; - bool Create(void *, u32); - UNKTYPE Destroy(); - void Clear(); - void *Alloc(u32, AllocCallback, void *); - int SaveState(); - void LoadState(int); - int GetCurrentLevel() const; - u32 GetFreeSize() const; +private: + bool NewSection(); + void ClearSection(); - UNKTYPE *PTR_0x0; - ut::LinkList mList; // at 0x4 - - inline bool IsValid() const { - return mList.GetSize(); - } +private: + MEMiHeapHead* mHandle; // at 0x0 + SectionList mSectionList; // at 0x4 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_FxBase.h b/include/nw4r/snd/snd_FxBase.h index 12d71cef..31b6e448 100644 --- a/include/nw4r/snd/snd_FxBase.h +++ b/include/nw4r/snd/snd_FxBase.h @@ -1,23 +1,42 @@ #ifndef NW4R_SND_FX_BASE_H #define NW4R_SND_FX_BASE_H -#include "common.h" -#include "snd_Common.h" -#include "ut_LinkList.h" +#include + +#include + +#include namespace nw4r { namespace snd { -enum SampleFormat { SAMPLE_FORMAT_PCM_S32, SAMPLE_FORMAT_PCM_S16, SAMPLE_FORMAT_PCM_S8, SAMPLE_FORMAT_DSP_ADPCM }; -struct FxBase { - inline virtual ~FxBase() {} // at 0x8 - inline virtual bool StartUp() {} // at 0xc - inline virtual UNKTYPE Shutdown() {} // at 0x10 - inline virtual UNKTYPE UpdateBuffer(int, void **, u32, SampleFormat, float, OutputMode) {} // at 0x14 +enum SampleFormat { + SAMPLE_FORMAT_PCM_S32, + SAMPLE_FORMAT_PCM_S16, + SAMPLE_FORMAT_PCM_S8, + SAMPLE_FORMAT_DSP_ADPCM +}; + +class FxBase : private ut::NonCopyable { +public: + virtual ~FxBase() {} // at 0x8 + virtual bool StartUp() { + return true; + } // at 0xC + + virtual void Shutdown() {} // at 0x10 + + virtual void UpdateBuffer(int /* channels */, void** /* ppBuffer */, + u32 /* size */, SampleFormat /* format */, + f32 /* sampleRate */, OutputMode /* mode */) { + } // at 0x14 + +public: NW4R_UT_LIST_NODE_DECL(); // at 0x4 }; NW4R_UT_LIST_TYPEDEF_DECL(FxBase); + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_FxChorus.h b/include/nw4r/snd/snd_FxChorus.h index d39be6be..3ef2144c 100644 --- a/include/nw4r/snd/snd_FxChorus.h +++ b/include/nw4r/snd/snd_FxChorus.h @@ -1,41 +1,50 @@ #ifndef NW4R_SND_FX_CHORUS_H #define NW4R_SND_FX_CHORUS_H -#include "snd_AxfxImpl.h" -#include "snd_FxBase.h" -#include #include "common.h" +#include +#include +#include + +#include namespace nw4r { namespace snd { -struct FxChorus : FxBase { - // sizeof(ChorusParam) = 0xc + +class FxChorus : public FxBase { +public: struct ChorusParam { - float FLOAT_0x0; - float FLOAT_0x4; - float FLOAT_0x8; + f32 delayTime; // at 0x0 + f32 depth; // at 0x4 + f32 rate; // at 0x8 }; +public: FxChorus(); - inline ~FxChorus() { + virtual ~FxChorus() { Shutdown(); ReleaseWorkBuffer(); - } + } // at 0x8 - u32 GetRequiredMemSize(); - virtual UNKTYPE AssignWorkBuffer(void *, u32); // at 0x18 - virtual UNKTYPE ReleaseWorkBuffer(); // at 0x1c + virtual bool StartUp(); // at 0xC + virtual void Shutdown(); // at 0x10 - bool StartUp(); // at 0xc - UNKTYPE Shutdown(); // at 0x10 - bool SetParam(const ChorusParam &); - UNKTYPE UpdateBuffer(int, void **, u32, SampleFormat, float, OutputMode); // at 0x14 + virtual void UpdateBuffer(int channels, void** ppBuffer, u32 size, + SampleFormat format, f32 sampleRate, + OutputMode mode); // at 0x14 - detail::AxfxImpl mAxfxImpl; + virtual bool AssignWorkBuffer(void* pBuffer, u32 size); // at 0x18 + virtual void ReleaseWorkBuffer(); // at 0x1C - ChorusParam mParam; // at 0x18 - AXFX_CHORUS mAXFXChorus; // 0x24 + u32 GetRequiredMemSize(); + bool SetParam(const ChorusParam& rParam); + +private: + detail::AxfxImpl mImpl; // at 0xC + ChorusParam mParam; // at 0x18 + AXFX_CHORUS mAxfxParam; // at 0x24 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_FxDelay.h b/include/nw4r/snd/snd_FxDelay.h index 1ad7f26b..a91eecf0 100644 --- a/include/nw4r/snd/snd_FxDelay.h +++ b/include/nw4r/snd/snd_FxDelay.h @@ -1,41 +1,50 @@ #ifndef NW4R_SND_FX_DELAY_H #define NW4R_SND_FX_DELAY_H -#include "common.h" -#include "snd_AxfxImpl.h" -#include "snd_FxBase.h" -#include +#include + +#include +#include + +#include namespace nw4r { namespace snd { -struct FxDelay : FxBase { - // sizeof(FxDelayParam) = 0xc + +class FxDelay : public FxBase { +public: struct DelayParam { - float FLOAT_0x0; - float FLOAT_0x4; - float FLOAT_0x8; + f32 delay; // at 0x0 + f32 feedback; // at 0x4 + f32 outGain; // at 0x8 }; +public: FxDelay(); - inline ~FxDelay() { + virtual ~FxDelay() { Shutdown(); ReleaseWorkBuffer(); - } + } // at 0x8 - u32 GetRequiredMemSize(); - virtual UNKTYPE AssignWorkBuffer(void *, u32); // at 0x18 - virtual UNKTYPE ReleaseWorkBuffer(); // at 0x1c + virtual bool StartUp(); // at 0xC + virtual void Shutdown(); // at 0x10 - bool StartUp(); // at 0xc - UNKTYPE Shutdown(); // at 0x10 - bool SetParam(const DelayParam &); - UNKTYPE UpdateBuffer(int, void **, u32, SampleFormat, float, OutputMode); // at 0x14 + virtual void UpdateBuffer(int channels, void** ppBuffer, u32 size, + SampleFormat format, f32 sampleRate, + OutputMode mode); // at 0x14 - detail::AxfxImpl mAxfxImpl; // at 0xc - DelayParam mParam; // at 0x18 + virtual bool AssignWorkBuffer(void* pBuffer, u32 size); // at 0x18 + virtual void ReleaseWorkBuffer(); // at 0x1C - AXFX_DELAY mAXFXDelay; // at 0x24 + u32 GetRequiredMemSize(); + bool SetParam(const DelayParam& rParam); + +private: + detail::AxfxImpl mImpl; // at 0xC + DelayParam mParam; // at 0x18 + AXFX_DELAY mAxfxParam; // at 0x24 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_FxReverbHi.h b/include/nw4r/snd/snd_FxReverbHi.h index fcbb0cf5..12d9be52 100644 --- a/include/nw4r/snd/snd_FxReverbHi.h +++ b/include/nw4r/snd/snd_FxReverbHi.h @@ -1,44 +1,53 @@ #ifndef NW4R_SND_FX_REVERB_HI_H #define NW4R_SND_FX_REVERB_HI_H -#include "common.h" -#include "snd_AxfxImpl.h" -#include "snd_FxBase.h" -#include +#include + +#include +#include + +#include namespace nw4r { namespace snd { -struct FxReverbHi : FxBase { - // sizeof(ReverbHiParam) = 0x18 + +class FxReverbHi : public FxBase { +public: struct ReverbHiParam { - float FLOAT_0x0; - float FLOAT_0x4; - float FLOAT_0x8; - float FLOAT_0xC; - float FLOAT_0x10; - float FLOAT_0x14; + f32 preDelayTime; // at 0x0 + f32 fusedTime; // at 0x4 + f32 coloration; // at 0x8 + f32 damping; // at 0xC + f32 crossTalk; // at 0x10 + f32 outGain; // at 0x14 }; +public: FxReverbHi(); - inline ~FxReverbHi() { + virtual ~FxReverbHi() { Shutdown(); ReleaseWorkBuffer(); - } + } // at 0x8 - u32 GetRequiredMemSize(); - virtual UNKTYPE AssignWorkBuffer(void *, u32); // at 0x18 - virtual UNKTYPE ReleaseWorkBuffer(); // at 0x1c + virtual bool StartUp(); // at 0xC + virtual void Shutdown(); // at 0x10 - bool StartUp(); // at 0xc - UNKTYPE Shutdown(); // at 0x10 - bool SetParam(const ReverbHiParam &); - UNKTYPE UpdateBuffer(int, void **, u32, SampleFormat, float, OutputMode); // at 0x14 + virtual void UpdateBuffer(int channels, void** ppBuffer, u32 size, + SampleFormat format, f32 sampleRate, + OutputMode mode); // at 0x14 - detail::AxfxImpl mAxfxImpl; // at 0xc - ReverbHiParam mParam; // at 0x18 + virtual bool AssignWorkBuffer(void* pBuffer, u32 size); // at 0x18 + virtual void ReleaseWorkBuffer(); // at 0x1C - AXFX_REVERBHI mAXFXReverbHi; // at 0x30 + u32 GetRequiredMemSize(); + bool SetParam(const ReverbHiParam& rParam); + +private: + detail::AxfxImpl mImpl; // at 0xC + ReverbHiParam mParam; // at 0x18 + AXFX_REVERBHI mAxfxParam; // at 0x30 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_FxReverbHiDpl2.h b/include/nw4r/snd/snd_FxReverbHiDpl2.h new file mode 100644 index 00000000..8c3124f0 --- /dev/null +++ b/include/nw4r/snd/snd_FxReverbHiDpl2.h @@ -0,0 +1,54 @@ +#ifndef NW4R_SND_FX_REVERB_HI_DPL2_H +#define NW4R_SND_FX_REVERB_HI_DPL2_H +#include + +#include +#include + +#include + +namespace nw4r { +namespace snd { + +class FxReverbHiDpl2 : public FxBase { +public: + struct ReverbHiDpl2Param { + f32 preDelayTime; // at 0x0 + f32 fusedTime; // at 0x4 + f32 coloration; // at 0x8 + f32 damping; // at 0xC + f32 crossTalk; // at 0x10 + f32 outGain; // at 0x14 + }; + +public: + FxReverbHiDpl2(); + + virtual ~FxReverbHiDpl2() { + Shutdown(); + ReleaseWorkBuffer(); + } // at 0x8 + + virtual bool StartUp(); // at 0xC + virtual void Shutdown(); // at 0x10 + + virtual void UpdateBuffer(int channels, void** ppBuffer, u32 size, + SampleFormat format, f32 sampleRate, + OutputMode mode); // at 0x14 + + virtual bool AssignWorkBuffer(void* pBuffer, u32 size); // at 0x18 + virtual void ReleaseWorkBuffer(); // at 0x1C + + u32 GetRequiredMemSize(); + bool SetParam(const ReverbHiDpl2Param& rParam); + +private: + detail::AxfxImpl mImpl; // at 0xC + ReverbHiDpl2Param mParam; // at 0x18 + AXFX_REVERBHI_DPL2 mAxfxParam; // at 0x30 +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_InstancePool.h b/include/nw4r/snd/snd_InstancePool.h index a074fe5e..12618f4c 100644 --- a/include/nw4r/snd/snd_InstancePool.h +++ b/include/nw4r/snd/snd_InstancePool.h @@ -1,68 +1,81 @@ #ifndef NW4R_SND_INSTANCE_POOL_H #define NW4R_SND_INSTANCE_POOL_H -#include "common.h" -#include +#include namespace nw4r { namespace snd { namespace detail { -struct PoolImpl { - struct Member { - Member *mNext; // at 0x0 - }; - u32 CreateImpl(void *, u32, u32); - void DestroyImpl(void *, u32); - u32 CountImpl() const; - void *AllocImpl(); - void FreeImpl(void *); +class PoolImpl { +public: + PoolImpl() : mNext(NULL) {} - Member mHead; // at 0x0 +protected: + u32 CreateImpl(void* pBuffer, u32 size, u32 stride); + void DestroyImpl(void* pBuffer, u32 size); + int CountImpl() const; - inline PoolImpl() { - mHead.mNext = NULL; - } + void* AllocImpl(); + void FreeImpl(void* pElem); + +private: + PoolImpl* mNext; // at 0x0 }; -template -struct InstancePool : PoolImpl { - inline u32 Create(void *ptr, u32 num) { - return CreateImpl(ptr, num, sizeof(T)); +template class InstancePool : private PoolImpl { +public: + u32 Create(void* pBuffer, u32 size) { + return CreateImpl(pBuffer, size, sizeof(T)); } - inline T *Alloc() { - void *ptr = AllocImpl(); + void Destroy(void* pPtr, u32 size) { + DestroyImpl(pPtr, size); + } - if (!ptr) { + int Count() const { + return CountImpl(); + } + + T* Alloc() { + void* pPtr = AllocImpl(); + if (pPtr == NULL) { return NULL; } - return new (ptr) T; + return new (pPtr) T; } - inline void Free(T *ptr) { - if (ptr) { - ptr->~T(); - FreeImpl(ptr); + void Free(T* pElem) { + if (pElem != NULL) { + pElem->~T(); + FreeImpl(pElem); } } +}; - inline void Destroy(void *ptr, u32 num) { - DestroyImpl(ptr, num); +template class MemoryPool : private PoolImpl { +public: + u32 Create(void* pBuffer, u32 size) { + return CreateImpl(pBuffer, size, sizeof(T)); } - inline u32 Count() const { + void Destroy(void* pPtr, u32 size) { + DestroyImpl(pPtr, size); + } + + int Count() const { return CountImpl(); } -}; -template -struct MemoryPool : PoolImpl { - inline void Free(T *ptr) { - ptr->~T(); - FreeImpl(ptr); + T* Alloc() { + return static_cast(AllocImpl()); + } + + void Free(T* pElem) { + FreeImpl(pElem); } }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_Lfo.h b/include/nw4r/snd/snd_Lfo.h index 88efbec8..6b33e5c5 100644 --- a/include/nw4r/snd/snd_Lfo.h +++ b/include/nw4r/snd/snd_Lfo.h @@ -7,29 +7,41 @@ namespace snd { namespace detail { struct LfoParam { - LfoParam() { Init(); } + LfoParam() { + Init(); + } + void Init(); - f32 depth; // at 0x0 - f32 speed; // at 0x4 - u32 delay; // at 0x8 - u8 range; // at 0xC + f32 depth; // at 0x0 + f32 speed; // at 0x4 + u32 delay; // at 0x8 + u8 range; // at 0xC + u8 padding[3]; // at 0xD }; class Lfo { public: - static s8 GetSinIdx(int i); - Lfo() : mDelayCounter(0), mCounter(0.0f) {} - LfoParam& GetParam() { return mParam; } - void SetParam(const LfoParam& param) { mParam = param; } + LfoParam& GetParam() { + return mParam; + } + void SetParam(const LfoParam& rParam) { + mParam = rParam; + } void Reset(); void Update(int msec); f32 GetValue() const; +private: + static const int TABLE_SIZE = 32; + +private: + static s8 GetSinIdx(int i); + private: LfoParam mParam; // at 0x0 u32 mDelayCounter; // at 0x10 diff --git a/include/nw4r/snd/snd_MemorySoundArchive.h b/include/nw4r/snd/snd_MemorySoundArchive.h index d850fe86..447b4d80 100644 --- a/include/nw4r/snd/snd_MemorySoundArchive.h +++ b/include/nw4r/snd/snd_MemorySoundArchive.h @@ -1,33 +1,44 @@ #ifndef NW4R_SND_MEMORY_SOUND_ARCHIVE_H #define NW4R_SND_MEMORY_SOUND_ARCHIVE_H -#include "ut_FileStream.h" -#include "snd_SoundArchive.h" -#include "snd_SoundArchiveFile.h" - -namespace nw4r -{ - namespace snd - { - struct MemorySoundArchive : SoundArchive - { - struct MemoryFileStream; - - const void * mMemory; // at 0x108 - detail::SoundArchiveFileReader mFileReader; // at 0x10c - - MemorySoundArchive(); - virtual ~MemorySoundArchive(); // at 0x8 - - bool Setup(const void *); - void Shutdown(); - - virtual const void * detail_GetFileAddress(u32) const; - virtual const void * detail_GetWaveDataFileAddress(u32) const; - virtual int detail_GetRequiredStreamBufferSize() const; - virtual ut::FileStream * OpenStream(void *, int, u32, u32) const; // at 0x18 - virtual ut::FileStream * OpenExtStream(void *, int, const char *, u32, u32) const; // at 0x1c - }; - } -} - -#endif \ No newline at end of file +#include + +#include +#include + +#include + +namespace nw4r { +namespace snd { + +class MemorySoundArchive : public SoundArchive { +private: + class MemoryFileStream; + +public: + MemorySoundArchive(); + virtual ~MemorySoundArchive(); // at 0x8 + + virtual const void* detail_GetFileAddress(u32 id) const; // at 0xC + virtual const void* detail_GetWaveDataFileAddress(u32 id) const; // at 0x10 + + virtual int detail_GetRequiredStreamBufferSize() const; // at 0x14 + + virtual ut::FileStream* OpenStream(void* pBuffer, int size, u32 offset, + u32 length) const; // at 0x18 + + virtual ut::FileStream* OpenExtStream(void* pBuffer, int size, + const char* pExtPath, u32 offset, + u32 length) const; // at 0x1C + + bool Setup(const void* pBuffer); + void Shutdown(); + +private: + const void* mData; // at 0x108 + detail::SoundArchiveFileReader mFileReader; // at 0x10C +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_MmlParser.h b/include/nw4r/snd/snd_MmlParser.h index 9abd7f0b..7795649b 100644 --- a/include/nw4r/snd/snd_MmlParser.h +++ b/include/nw4r/snd/snd_MmlParser.h @@ -1,38 +1,159 @@ #ifndef NW4R_SND_MML_PARSER_H #define NW4R_SND_MML_PARSER_H -#include "common.h" -#include "snd_MmlSeqTrack.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct MmlParser { - u16 Read16(const u8 **) const; // inlined - u32 Read24(const u8 **) const; // inlined - u32 ReadVar(const u8 **) const; // inlined - - volatile s16 *GetVariablePtr(SeqPlayer *, SeqTrack *, int) const; - UNKWORD Parse(MmlSeqTrack *, bool) const; - virtual void CommandProc(MmlSeqTrack *, u32, s32, s32) const; // at 0x8 - virtual Channel *NoteOnCommandProc(MmlSeqTrack *, int, int, s32, bool) const; // at 0xc +// Forward declarations +class MmlSeqTrack; +class SeqPlayer; +class MmlParser { +public: enum SeqArgType { - SEQ_ARG_TYPE_IMMEDIATE_BYTE, - SEQ_ARG_TYPE_IMMEDIATE_16, - SEQ_ARG_TYPE_IMMEDIATE_VAR, - SEQ_ARG_TYPE_RANDOM, - SEQ_ARG_TYPE_VARIABLE + SEQ_ARG_U8, + SEQ_ARG_S16, + SEQ_ARG_VMIDI, + SEQ_ARG_RANDOM, + SEQ_ARG_VARIABLE }; - s32 ReadArg(const u8 **, SeqPlayer *, SeqTrack *, SeqArgType) const; + static const int CALL_STACK_MAX_DEPTH = 3; + +public: + virtual void CommandProc(MmlSeqTrack* pTrack, u32 command, s32 arg1, + s32 arg2) const; // at 0x8 + + virtual Channel* NoteOnCommandProc(MmlSeqTrack* pTrack, int key, + int velocity, s32 length, + bool tie) const; // at 0xC + + ParseResult Parse(MmlSeqTrack* pTrack, bool doNoteOn) const; + + volatile s16* GetVariablePtr(SeqPlayer* pPlayer, SeqTrack* pTrack, + int i) const; + + static void EnablePrintVar(bool enable) { + mPrintVarEnabledFlag = enable; + } + +private: + enum MmlSeqData { + MML_CMD_MIN = 0x80, // <80 -> MML note, not a command + + MML_WAIT = 0x80, // 0x80 + MML_SET_PRGNO, // 0x81 + MML_OPENTRACK = 0x88, // 0x88 + MML_JUMP, // 0x89 + MML_CALL, // 0x8A + + MML_RNDPARAM = 0xA0, // 0xA0 + MML_INDPARAM, // 0xA1 + MML_EXECIF, // 0xA2 + + MML_SET_TIMEBASE = 0xB0, // 0xB0 + + MML_SET_PAN = 0xC0, // 0xC0 + MML_SET_TRACK_VOLUME, // 0xC1 + MML_SET_PLAYER_VOLUME, // 0xC2 + MML_SET_TRANSPOSE, // 0xC3 + MML_SET_PITCHBEND, // 0xC4 + MML_SET_BENDRANGE, // 0xC5 + MML_SET_PRIORITY, // 0xC6 + MML_SET_NOTEWAIT, // 0xC7 + MML_SET_TIE, // 0xC8 + MML_SET_PORTAMENTO, // 0xC9 + MML_SET_LFODEPTH, // 0xCA + MML_SET_LFOSPEED, // 0xCB + MML_SET_LFOTARGET, // 0xCC + MML_SET_LFORANGE, // 0xCD + MML_SET_PORTASPEED, // 0xCE + MML_SET_PORTATIME, // 0xCF - inline u8 ReadByte(const u8 **pPointer) const { - return *(*pPointer)++; + MML_SET_ATTACK = 0xD0, // 0xD0 + MML_SET_DECAY, // 0xD1 + MML_SET_SUSTAIN, // 0xD2 + MML_SET_RELEASE, // 0xD3 + MML_LOOP_START, // 0xD4 + MML_SET_TRACK_VOLUME2, // 0xD5 + MML_PRINTVAR, // 0xD6 + MML_SET_SURROUNDPAN, // 0xD7 + MML_SET_LPFFREQ, // 0xD8 + MML_SET_FXSEND_A, // 0xD9 + MML_SET_FXSEND_B, // 0xDA + MML_SET_MAINSEND, // 0xDB + MML_SET_INITPAN, // 0xDC + MML_SET_MUTE, // 0xDD + MML_SET_FXSEND_C, // 0xDE + MML_SET_DAMPER, // 0xDF + + MML_SET_LFODELAY = 0xE0, // 0xE0 + MML_SET_TEMPO, // 0xE1 + MML_CMD_E2h, // 0xE2 + MML_SET_SWEEPPITCH, // 0xE3 + + MML_LOOP_END = 0xFC, // 0xFC + MML_RET, // 0xFD + MML_ALLOCTRACK, // 0xFE + MML_EOF, // 0xFF + + MML_CMD_MASK = 0x80, + MML_CMD_SET_MASK = 0xF0, + + MML_CMD_MAX = 0xFF, // >FF -> EX command + + // (MML_EX_COMMAND << 8) | Command + MML_EX_COMMAND = 0xF0, + + // MML EX arithmetic command set + MML_EX_ARITHMETIC = 0x80, // 0xF0 0x8X + MML_EX_SET = 0x80, // 0xF0 0x80 + MML_EX_APL, // 0xF0 0x81 + MML_EX_AMI, // 0xF0 0x82 + MML_EX_AMU, // 0xF0 0x83 + MML_EX_ADV, // 0xF0 0x84 + MML_EX_ALS, // 0xF0 0x85 + MML_EX_RND, // 0xF0 0x86 + MML_EX_AAD, // 0xF0 0x87 + MML_EX_AOR, // 0xF0 0x88 + MML_EX_AER, // 0xF0 0x89 + MML_EX_ACO, // 0xF0 0x8A + MML_EX_AMD, // 0xF0 0x8B + + // MML EX logic command set + MML_EX_LOGIC = 0x90, // 0xF0 0x9X + MML_EX_EQ = 0x90, // 0xF0 0x90 + MML_EX_GE, // 0xF0 0x91 + MML_EX_GT, // 0xF0 0x92 + MML_EX_LE, // 0xF0 0x93 + MML_EX_LT, // 0xF0 0x94 + MML_EX_NE, // 0xF0 0x95 + + // MML EX userproc callback + MML_EX_USERPROC = 0xE0, // 0xF0 0xE0 + + MML_EX_CMD_MAX = 0xFFFF, // >FFFF -> Invalid command + }; + +private: + u8 ReadByte(const u8** ppData) const { + return *(*ppData)++; } + u16 Read16(const u8** ppData) const; + u32 Read24(const u8** ppData) const; + s32 ReadVar(const u8** ppData) const; + s32 ReadArg(const u8** ppData, SeqPlayer* pPlayer, SeqTrack* pTrack, + SeqArgType type) const; + +private: static bool mPrintVarEnabledFlag; }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_MmlSeqTrack.h b/include/nw4r/snd/snd_MmlSeqTrack.h index 0975a3a6..a5c9c114 100644 --- a/include/nw4r/snd/snd_MmlSeqTrack.h +++ b/include/nw4r/snd/snd_MmlSeqTrack.h @@ -1,31 +1,45 @@ #ifndef NW4R_SND_MML_SEQ_TRACK_H #define NW4R_SND_MML_SEQ_TRACK_H -#include "common.h" -#include "snd_SeqTrack.h" +#include +#include +#include namespace nw4r { namespace snd { namespace detail { -struct MmlSeqTrack : SeqTrack { - enum { STACK_FRAME_COUNT = 3 }; +// Forward declarations +class MmlParser; + +class MmlSeqTrack : public SeqTrack { +public: struct MmlParserParam { - bool mPredicate; // at 0x0 - bool BOOL_0x1; - bool BOOL_0x2; - u8 mLoopCounters[STACK_FRAME_COUNT]; // at 0x3 - u8 mStackIndex; // at 0x6 - const u8 *mReturnAddresses[STACK_FRAME_COUNT]; // at 0x8 + bool cmpFlag; // at 0x0 + bool noteWaitFlag; // at 0x1 + bool tieFlag; // at 0x2 + u8 loopCount[MmlParser::CALL_STACK_MAX_DEPTH]; // at 0x3 + u8 callStackDepth; // at 0x6 + const u8* callStack[MmlParser::CALL_STACK_MAX_DEPTH]; // at 0x8 }; - MmlParser *mParser; // at 0xc0 - MmlParserParam mMmlParserParam; // at 0xc4 - +public: MmlSeqTrack(); + virtual ParseResult Parse(bool doNoteOn); // at 0xC + + void SetMmlParser(const MmlParser* pParser) { + mParser = pParser; + } - UNKWORD Parse(bool); // at 0xc + MmlParserParam& GetMmlParserParam() { + return mMmlParserParam; + } + +private: + const MmlParser* mParser; // at 0xC0 + MmlParserParam mMmlParserParam; // at 0xC4 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_MmlSeqTrackAllocator.h b/include/nw4r/snd/snd_MmlSeqTrackAllocator.h index f92b4043..4cc7e274 100644 --- a/include/nw4r/snd/snd_MmlSeqTrackAllocator.h +++ b/include/nw4r/snd/snd_MmlSeqTrackAllocator.h @@ -1,25 +1,38 @@ #ifndef NW4R_SND_MML_SEQ_TRACK_ALLOCATOR_H #define NW4R_SND_MML_SEQ_TRACK_ALLOCATOR_H -#include "common.h" -#include "snd_InstancePool.h" -#include "snd_MmlParser.h" -#include "snd_MmlSeqTrack.h" +#include + +#include +#include namespace nw4r { namespace snd { namespace detail { -struct MmlSeqTrackAllocator : SeqTrackAllocator { - MmlParser *mParser; - InstancePool mPool; // at 0x8 - SeqTrack *AllocTrack(SeqPlayer *); // at 0xc - void FreeTrack(SeqTrack *); // at 0x10 +// Forward declarations +class MmlParser; +class SeqPlayer; +class SeqTrack; + +class MmlSeqTrackAllocator : public SeqTrackAllocator { +public: + MmlSeqTrackAllocator(MmlParser* pParser) : mParser(pParser) {} + + virtual SeqTrack* AllocTrack(SeqPlayer* pPlayer); // at 0xC + virtual void FreeTrack(SeqTrack* pTrack); // at 0x10 - u32 Create(void *, u32); - void Destroy(void *, u32); + virtual int GetAllocatableTrackCount() const { + return mTrackPool.Count(); + } // at 0x14 - int GetAllocatableTrackCount() const; // at 0x14 + u32 Create(void* pBuffer, u32 size); + void Destroy(void* pBuffer, u32 size); + +private: + MmlParser* mParser; // at 0x4 + InstancePool mTrackPool; // at 0x8 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_MoveValue.h b/include/nw4r/snd/snd_MoveValue.h index c9b0f96b..750a5e79 100644 --- a/include/nw4r/snd/snd_MoveValue.h +++ b/include/nw4r/snd/snd_MoveValue.h @@ -21,7 +21,9 @@ template class MoveValue { mCounter = 0; } - bool IsFinished() const { return mCounter >= mFrame; } + bool IsFinished() const { + return mCounter >= mFrame; + } TValue GetValue() const { if (IsFinished()) { diff --git a/include/nw4r/snd/snd_NandSoundArchive.h b/include/nw4r/snd/snd_NandSoundArchive.h index d1e9dba6..d7ae910e 100644 --- a/include/nw4r/snd/snd_NandSoundArchive.h +++ b/include/nw4r/snd/snd_NandSoundArchive.h @@ -1,40 +1,65 @@ #ifndef NW4R_SND_NAND_SOUND_ARCHIVE_H #define NW4R_SND_NAND_SOUND_ARCHIVE_H -#include -#include "ut_NandFileStream.h" -#include "snd_SoundArchive.h" -#include "snd_SoundArchiveFile.h" - -namespace nw4r -{ - namespace snd - { - struct NandSoundArchive : SoundArchive - { - struct NandFileStream; - - detail::SoundArchiveFileReader mFileReader; // at 0x108 - NANDFileInfo mFileInfo; // at 0x14c - bool mOpenFlag; // at 0x1d8 - - NandSoundArchive(); - - virtual ~NandSoundArchive(); // at 0x8 - virtual const void * detail_GetFileAddress(u32) const; // at 0xC - virtual const void * detail_GetWaveDataFileAddress(u32) const; // at 0x10 - virtual int detail_GetRequiredStreamBufferSize() const; // at 0x14 - virtual ut::FileStream * OpenStream(void *, int, u32, u32) const; // at 0x18 - virtual ut::FileStream * OpenExtStream(void *, int, const char *, u32, u32) const; // at 0x1c - - bool Open(const char *); - - void Close(); - - bool LoadFileHeader(); - bool LoadHeader(void *, u32); - bool LoadLabelStringData(void *, u32); - }; - } -} - -#endif \ No newline at end of file +#include + +#include +#include + +#include + +#include + +namespace nw4r { +namespace snd { + +class NandSoundArchive : public SoundArchive { +private: + struct NandFileStream; + +public: + NandSoundArchive(); + virtual ~NandSoundArchive(); // at 0x8 + + virtual const void* detail_GetFileAddress(u32 /* id */) const { + return NULL; + } // at 0xC + + virtual const void* detail_GetWaveDataFileAddress(u32 /* id */) const { + return NULL; + } // at 0x10 + + virtual int detail_GetRequiredStreamBufferSize() const; // at 0x14 + + virtual ut::FileStream* OpenStream(void* pBuffer, int size, u32 offset, + u32 length) const; // at 0x18 + + virtual ut::FileStream* OpenExtStream(void* pBuffer, int size, + const char* pExtPath, u32 offset, + u32 length) const; // at 0x1C + + bool Open(const char* pPath); + void Close(); + + bool LoadHeader(void* pBuffer, u32 size); + bool LoadLabelStringData(void* pBuffer, u32 size); + + u32 GetHeaderSize() const { + return mFileReader.GetInfoChunkSize(); + } + u32 GetLabelStringDataSize() const { + return mFileReader.GetLabelStringChunkSize(); + } + +private: + bool LoadFileHeader() DECOMP_DONT_INLINE; + +private: + detail::SoundArchiveFileReader mFileReader; // at 0x108 + NANDFileInfo mFileInfo; // at 0x14C + bool mOpen; // at 0x1D8 +}; + +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_NoteOn.h b/include/nw4r/snd/snd_NoteOn.h deleted file mode 100644 index 9e04ce8b..00000000 --- a/include/nw4r/snd/snd_NoteOn.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef NW4R_SND_NOTE_ON_H -#define NW4R_SND_NOTE_ON_H -#include "common.h" -#include "snd_Channel.h" - -namespace nw4r { -namespace snd { -namespace detail { -struct NoteOnInfo { - int INT_0x0; - int INT_0x4; - int INT_0x8; - int INT_0xC; - int INT_0x10; - int INT_0x14; - int INT_0x18; - Channel::ChannelCallback mChannelCallback; // at 0x1c - u32 INT_0x20; -}; - -struct NoteOnCallback { - virtual ~NoteOnCallback(); // at 0x8 - virtual bool NoteOn(SeqPlayer *, int, const NoteOnInfo &) = 0; // at 0xc -}; -} // namespace detail -} // namespace snd -} // namespace nw4r - -#endif diff --git a/include/nw4r/snd/snd_NoteOnCallback.h b/include/nw4r/snd/snd_NoteOnCallback.h new file mode 100644 index 00000000..258520f7 --- /dev/null +++ b/include/nw4r/snd/snd_NoteOnCallback.h @@ -0,0 +1,38 @@ +#ifndef NW4R_SND_NOTE_ON_CALLBACK_H +#define NW4R_SND_NOTE_ON_CALLBACK_H +#include + +#include + +namespace nw4r { +namespace snd { +namespace detail { + +// Forward declarations +class SeqPlayer; + +struct NoteOnInfo { + int prgNo; // at 0x0 + int key; // at 0x4 + int velocity; // at 0x8 + int length; // at 0xC + int initPan; // at 0x10 + int priority; // at 0x14 + int voiceOutCount; // at 0x18 + Channel::ChannelCallback channelCallback; // at 0x1C + u32 channelCallbackData; // at 0x20 +}; + +class NoteOnCallback { +public: + virtual ~NoteOnCallback() {} // at 0x8 + + virtual Channel* NoteOn(SeqPlayer* pPlayer, int bankNo, + const NoteOnInfo& rInfo) = 0; // at 0xC +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_PlayerHeap.h b/include/nw4r/snd/snd_PlayerHeap.h index ef3874ea..38fc2334 100644 --- a/include/nw4r/snd/snd_PlayerHeap.h +++ b/include/nw4r/snd/snd_PlayerHeap.h @@ -1,15 +1,43 @@ #ifndef NW4R_SND_PLAYER_HEAP_H #define NW4R_SND_PLAYER_HEAP_H -#include "common.h" -#include "snd_SoundHeap.h" +#include + +#include namespace nw4r { namespace snd { + +// Forward declarations +class SoundPlayer; + namespace detail { -struct PlayerHeap : SoundHeap { - ~PlayerHeap(); - UNKTYPE *Alloc(u32); + +// Forward declarations +class BasicSound; + +class PlayerHeap : public SoundHeap { +public: + PlayerHeap() : mSound(NULL), mPlayer(NULL) {} + virtual ~PlayerHeap() {} // at 0x8 + + void SetSound(BasicSound* pSound) { + mSound = pSound; + } + + void SetSoundPlayer(SoundPlayer* pPlayer) { + mPlayer = pPlayer; + } + +public: + NW4R_UT_LIST_NODE_DECL(); // at 0x2C + +private: + BasicSound* mSound; // at 0x34 + SoundPlayer* mPlayer; // at 0x38 }; + +NW4R_UT_LIST_TYPEDEF_DECL(PlayerHeap); + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_RemoteSpeaker.h b/include/nw4r/snd/snd_RemoteSpeaker.h index b63f3dc9..10e9f037 100644 --- a/include/nw4r/snd/snd_RemoteSpeaker.h +++ b/include/nw4r/snd/snd_RemoteSpeaker.h @@ -1,68 +1,97 @@ #ifndef NW4R_SND_REMOTE_SPEAKER_H #define NW4R_SND_REMOTE_SPEAKER_H -#include -#include #include "common.h" +#include + +#include +#include +#include namespace nw4r { namespace snd { -struct RemoteSpeaker { - typedef void (*RemoteSpeakerCallback)(s32, s32); + +class RemoteSpeaker { +public: + enum SpeakerState { + STATE_INVALID, + STATE_EXEC_SPEAKER_ON, + STATE_SPEAKER_ON, + STATE_EXEC_SPEAKER_PLAY, + STATE_SPEAKER_PLAY, + STATE_EXEC_SPEAKER_OFF, + STATE_SPEAKER_OFF + }; enum SpeakerCommand { - SpeakerCommand_None, - SpeakerCommand_On, - SpeakerCommand_Play, - SpeakerCommand_Off, + COMMAND_NONE, + COMMAND_SPEAKER_ON, + COMMAND_SPEAKER_PLAY, + COMMAND_SPEAKER_OFF }; - bool mPoweredFlag; // at 0x0 - bool BOOL_0x1; - bool mEnabledOutputFlag; // at 0x2 - bool BOOL_0x3; - bool BOOL_0x4; - bool BOOL_0x5; - bool BOOL_0x6; - bool BOOL_0x7; - volatile bool BOOL_0x8; - - UNKWORD WORD_0xC; - SpeakerCommand CMD_0x10; - SpeakerCommand CMD_0x14; - char UNK_0x18[0x20]; - s32 mChannelIndex; // at 0x38 - RemoteSpeakerCallback mCallback; // at 0x3c - OSAlarm ALARM_0x40; - OSAlarm ALARM_0x70; - s64 mTime; // at 0xa0 + static const int SAMPLES_PER_AUDIO_PACKET = 40; +public: RemoteSpeaker(); - void ClearParam(); // inlined - void InitParam(); // inlined - bool Setup(RemoteSpeakerCallback); - void Shutdown(RemoteSpeakerCallback); + void InitParam(); + bool Setup(WPADCallback pCallback); + void Shutdown(WPADCallback pCallback); - bool EnableOutput(bool); + bool EnableOutput(bool enable); bool IsEnabledOutput() const; void Update(); - void ExecCommand(SpeakerCommand); + void UpdateStreamData(const s16* pRmtSamples); - bool IsAllSampleZero(const s16 *); // inlined - void UpdateStreamData(const s16 *); + bool IsAvailable() const { + return mState == STATE_SPEAKER_PLAY; + } - void NotifyCallback(s32, s32); // inlined - static void SpeakerOnCallback(s32, s32); - static void SpeakerPlayCallback(s32, s32); - static void SpeakerOffCallback(s32, s32); + void SetChannelIndex(int index) { + mChannelIndex = index; + } - static void ContinueAlarmHandler(OSAlarm *, OSContext *); - static void IntervalAlarmHandler(OSAlarm *, OSContext *); +private: + static const int SAMPLES_PER_ENCODED_PACKET = + (SAMPLES_PER_AUDIO_PACKET + 1) / 2; - inline void SetChannelIndex(int channelIndex) { - mChannelIndex = channelIndex; - } + static const int CONTINUOUS_PLAY_INTERVAL_MINUTES = 8; + +private: + void ClearParam(); + void ExecCommand(SpeakerCommand command); + + bool IsAllSampleZero(const s16* pRmtSamples); + void NotifyCallback(s32 chan, s32 result); + + static void SpeakerOnCallback(s32 chan, s32 result); + static void SpeakerPlayCallback(s32 chan, s32 result); + static void SpeakerOffCallback(s32 chan, s32 result); + + static void ContinueAlarmHandler(OSAlarm* pAlarm, OSContext* pCtx); + static void IntervalAlarmHandler(OSAlarm* pAlarm, OSContext* pCtx); + +private: + bool mInitFlag; // at 0x0 + bool mPlayFlag; // at 0x1 + bool mEnableFlag; // at 0x2 + bool mFirstEncodeFlag; // at 0x3 + bool mValidCallbackFlag; // at 0x4 + bool mCommandBusyFlag; // at 0x5 + bool mForceResumeFlag; // at 0x6 + bool mContinueFlag; // at 0x7 + volatile bool mIntervalFlag; // at 0x8 + SpeakerState mState; // at 0xC + SpeakerCommand mUserCommand; // at 0x10 + SpeakerCommand mInternalCommand; // at 0x14 + WENCInfo mEncodeInfo; // at 0x18 + int mChannelIndex; // at 0x38 + WPADCallback mWpadCallback; // at 0x3C + OSAlarm mContinueAlarm; // at 0x40 + OSAlarm mIntervalAlarm; // at 0x70 + s64 mContinueBeginTime; // at 0xA0 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_RemoteSpeakerManager.h b/include/nw4r/snd/snd_RemoteSpeakerManager.h index b440efad..100541d9 100644 --- a/include/nw4r/snd/snd_RemoteSpeakerManager.h +++ b/include/nw4r/snd/snd_RemoteSpeakerManager.h @@ -1,34 +1,44 @@ #ifndef NW4R_SND_REMOTE_SPEAKER_MANAGER_H #define NW4R_SND_REMOTE_SPEAKER_MANAGER_H -#include -#include "snd_RemoteSpeaker.h" - -namespace nw4r -{ - namespace snd - { - namespace detail - { - struct RemoteSpeakerManager - { - bool mPoweredFlag; // at 0x0 - char UNK_0x4[4]; - OSAlarm mAlarm; // at 0x8 - RemoteSpeaker mRemoteSpeakers[4]; - - RemoteSpeakerManager(); //inlined - - static RemoteSpeakerManager * GetInstance(); - - RemoteSpeaker * GetRemoteSpeaker(int); - - void Setup(); - void Shutdown(); - - static void RemoteSpeakerAlarmProc(OSAlarm *, OSContext *); - }; - } - } -} - -#endif \ No newline at end of file +#include + +#include + +#include +#include + +namespace nw4r { +namespace snd { +namespace detail { + +class RemoteSpeakerManager { +public: + static RemoteSpeakerManager& GetInstance(); + + RemoteSpeaker& GetRemoteSpeaker(int i); + + void Setup(); + void Shutdown(); + +private: + static const int SPEAKER_ALARM_HZ = 150; + + static const int SPEAKER_ALARM_PERIOD_NSEC = + static_cast(1.0f / SPEAKER_ALARM_HZ * 1000 * 1000 * 1000); + +private: + RemoteSpeakerManager(); + + static void RemoteSpeakerAlarmProc(OSAlarm* pAlarm, OSContext* pCtx); + +private: + bool mInitialized; // at 0x0 + OSAlarm mRemoteSpeakerAlarm; // at 0x8 + RemoteSpeaker mSpeaker[WPAD_MAX_CONTROLLERS]; // at 0x38 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_SeqFile.h b/include/nw4r/snd/snd_SeqFile.h index f03e48c9..ae50d756 100644 --- a/include/nw4r/snd/snd_SeqFile.h +++ b/include/nw4r/snd/snd_SeqFile.h @@ -1,29 +1,46 @@ #ifndef NW4R_SND_SEQ_FILE_H #define NW4R_SND_SEQ_FILE_H -#include "common.h" -#include "ut_binaryFileFormat.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct SeqFile { - ut::BinaryFileHeader mHeader; // at 0x0 - u32 OFFSET_0x10; // at 0x10 +namespace SeqFile { + +struct Header { + ut::BinaryFileHeader fileHeader; // at 0x0 + u32 dataBlockOffset; // at 0x10 + u32 dataBlockSize; // at 0x14 + u32 labelBlockOffset; // at 0x18 + u32 labelBlockSize; // at 0x1C +}; + +struct DataBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + u32 baseOffset; // at 0x8 }; -struct SeqFileReader { - struct UNKBLOCK { - ut::BinaryBlockHeader mHeader; // at 0x0 - u32 OFFSET_0x8; - }; +} // namespace SeqFile - const SeqFile *mFile; // at 0x0 - const UNKBLOCK *PTR_0x4; +class SeqFileReader { +public: + static const u32 SIGNATURE = 'RSEQ'; + static const int VERSION = NW4R_VERSION(1, 0); - bool IsValidFileHeader(const void *); - SeqFileReader(const void *); - const void *GetBaseAddress() const; +public: + explicit SeqFileReader(const void* pSeqBin); + + bool IsValidFileHeader(const void* pSeqBin); + + const void* GetBaseAddress() const; + +private: + const SeqFile::Header* mHeader; // at 0x0 + const SeqFile::DataBlock* mDataBlock; // at 0x4 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SeqPlayer.h b/include/nw4r/snd/snd_SeqPlayer.h index 7fda47b1..34062af2 100644 --- a/include/nw4r/snd/snd_SeqPlayer.h +++ b/include/nw4r/snd/snd_SeqPlayer.h @@ -1,119 +1,191 @@ #ifndef NW4R_SND_SEQ_PLAYER_H #define NW4R_SND_SEQ_PLAYER_H -#include "common.h" -#include "snd_BasicPlayer.h" -#include "snd_DisposeCallback.h" -#include "snd_InstancePool.h" -#include "snd_NoteOn.h" -#include "snd_SoundThread.h" -#include "ut_lock.h" +#include + +#include +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { -// Used an anonymous enum instead of a macro -// because I wanted the magic number to have -// namespace scope -enum { SEQ_TRACKS_PER_PLAYER = 0x10, SEQ_VARIABLE_COUNT = 0x10 }; - -// sizeof(SeqPlayer) = 0x11C -struct SeqPlayer : BasicPlayer, DisposeCallback, SoundThread::PlayerCallback { - enum OffsetType { OFFSET_TYPE_0, OFFSET_TYPE_1 }; - - bool Start(); // at 0xc - void Stop(); // at 0x10 - void Pause(bool); // at 0x14 - bool IsActive() const; // at 0x18 - bool IsStarted() const; // at 0x1c - bool IsPause() const; // at 0x20 - - void InvalidateData(const void *, const void *); - inline void InvalidateWaveData(const void *, const void *) {} - inline virtual void ChannelCallback(Channel *) {} - - bool mActiveFlag; // at 0x8c - bool mStartedFlag; // at 0x8d - bool mPauseFlag; // at 0x8e - - bool mReleasePriorityFixFlag; // at 0x8f - float FLOAT_0x90; - float mTempoRatio; // at 0x94 - float FLOAT_0x98; - int OFFSET_0x9C; - float OFFSET_0xA0; - int INT_0xA4; - char BYTE_0xA8; - u8 mChannelPriority; // at 0xa9 - u8 BYTE_0xAA; - u16 SHORT_0xAC; - - NoteOnCallback *mNoteOnCallback; // at 0xb0 - SeqTrackAllocator *mTrackAllocator; // at 0xb4 - SeqTrack *mPlayerTracks[SEQ_TRACKS_PER_PLAYER]; // at 0xb8 - volatile s16 mLocalVariables[SEQ_VARIABLE_COUNT]; // at 0xf8 - - int INT_0x118; +// Forward declarations +class Channel; +class NoteOnInfo; +class NoteOnCallback; +class SeqTrack; +class SeqTrackAllocator; + +class SeqPlayer : public BasicPlayer, + public DisposeCallback, + public SoundThread::PlayerCallback { +public: + struct ParserPlayerParam { + u8 volume; // at 0x0 + u8 priority; // at 0x1 + u8 timebase; // at 0x2 + u16 tempo; // at 0x4 + NoteOnCallback* callback; // at 0x8 + }; + + enum OffsetType { OFFSET_TYPE_TICK, OFFSET_TYPE_MILLISEC }; + + enum SetupResult { + SETUP_SUCCESS, + SETUP_ERR_CANNOT_ALLOCATE_TRACK, + SETUP_ERR_UNKNOWN + }; + + static const int LOCAL_VARIABLE_NUM = 16; + static const int GLOBAL_VARIABLE_NUM = 16; + static const int VARIABLE_NUM = LOCAL_VARIABLE_NUM + GLOBAL_VARIABLE_NUM; + + static const int TRACK_NUM = 16; + +public: SeqPlayer(); - ~SeqPlayer(); + virtual ~SeqPlayer(); // at 0x8 + + virtual bool Start(); // at 0xC + virtual void Stop(); // at 0x10 + virtual void Pause(bool flag); // at 0x14 + + virtual bool IsActive() const { + return mActiveFlag; + } // at 0x18 + + virtual bool IsStarted() const { + return mStartedFlag; + } // at 0x1C + + virtual bool IsPause() const { + return mPauseFlag; + } // at 0x20 + + virtual void InvalidateData(const void* pStart, + const void* pEnd); // at 0x50 + + virtual void InvalidateWaveData(const void* /* pStart */, + const void* /* pEnd */) {} // at 0x54 + + virtual void ChannelCallback(Channel* /* pChannel */) {} // at 0x58 + + virtual void OnUpdateFrameSoundThread() { + Update(); + } // at 0x5C + + virtual void OnShutdownSoundThread() { + Stop(); + } // at 0x60 + + void InitParam(int voices, NoteOnCallback* pCallback); - UNKTYPE InitParam(int, NoteOnCallback *); - void CloseTrack(int); - void FinishPlayer(); // inlined + SetupResult Setup(SeqTrackAllocator* pAllocator, u32 allocTrackFlags, + int voices, NoteOnCallback* pCallback); + void SetSeqData(const void* pBase, s32 offset); - bool Setup(SeqTrackAllocator *, u32, int, NoteOnCallback *); - void SetSeqData(const void *, s32); - void Skip(OffsetType, int); + void Skip(OffsetType type, int offset); - void SetTempoRatio(float); - void SetChannelPriority(int); - void SetReleasePriorityFix(bool); - void SetLocalVariable(int, short); - static void InitGlobalVariable(); // inline - static void SetGlobalVariable(int, short); + void SetTempoRatio(f32 tempo); + void SetChannelPriority(int priority); + void SetReleasePriorityFix(bool flag); + + void SetLocalVariable(int i, s16 value); + static void SetGlobalVariable(int i, s16 value); + + void SetTrackVolume(u32 trackFlags, f32 volume); + void SetTrackPitch(u32 trackFlags, f32 pitch); + + SeqTrack* GetPlayerTrack(int i); + volatile s16* GetVariablePtr(int i); + void Update(); + + Channel* NoteOn(int bankNo, const NoteOnInfo& rInfo); template - inline void SetTrackParam(u32 flags, void (SeqTrack::*pSetter)(T), T param) { + void SetTrackParam(u32 trackFlags, void (SeqTrack::*pSetter)(T), T param) { ut::AutoInterruptLock lock; - for (int i = 0; i < SEQ_TRACKS_PER_PLAYER && flags; flags >>= 1, i++) { - if (flags & 1) { - SeqTrack *pPlayerTrack = GetPlayerTrack(i); + for (int i = 0; i < TRACK_NUM && trackFlags != 0; + trackFlags >>= 1, i++) { + + if (trackFlags & 1) { + SeqTrack* pTrack = GetPlayerTrack(i); - if (pPlayerTrack) { - (pPlayerTrack->*pSetter)(param); + if (pTrack != NULL) { + (pTrack->*pSetter)(param); } } } } - void SetTrackVolume(u32, float); - void SetTrackPitch(u32, float); + bool IsReleasePriorityFix() const { + return mReleasePriorityFixFlag; + } - void SetPlayerTrack(int, SeqTrack *); // inlined - SeqTrack *GetPlayerTrack(int); - bool ParseNextTick(bool); - volatile s16 *GetVariablePtr(int); - void UpdateChannelParam(); // inlined - void Update(); - void UpdateTick(); - void UpdateTick(int); - bool NoteOn(int, const NoteOnInfo &); - inline void OnUpdateFrameSoundThread() { - Update(); + f32 GetPanRange() const { + return mPanRange; } - inline void OnShutdownSoundThread() { - Stop(); + f32 GetBaseTempo() const { + return mTempoRatio * (mParserParam.timebase * mParserParam.tempo) / + 60000.0f; } - inline float GetBaseTempo() const { - return mTempoRatio * (BYTE_0xAA * SHORT_0xAC) / 60000.0f; + int GetVoiceOutCount() const { + return mVoiceOutCount; } - static volatile s16 mGlobalVariable[SEQ_VARIABLE_COUNT]; - static bool mGobalVariableInitialized; // typo + ParserPlayerParam& GetParserPlayerParam() { + return mParserParam; + } + +private: + static const int DEFAULT_TEMPO = 120; + static const int DEFAULT_TIMEBASE = 48; + static const int DEFAULT_PRIORITY = 64; + static const int DEFAULT_VARIABLE_VALUE = -1; + + static const int MAX_SKIP_TICK_PER_FRAME = 768; + +private: + void CloseTrack(int i); + void SetPlayerTrack(int i, SeqTrack* pTrack); + + void FinishPlayer(); + void UpdateChannelParam(); + int ParseNextTick(bool doNoteOn); + + void UpdateTick(int msec); + void SkipTick(); + + static void InitGlobalVariable(); + +private: + bool mActiveFlag; // at 0x8C + bool mStartedFlag; // at 0x8D + bool mPauseFlag; // at 0x8E + bool mReleasePriorityFixFlag; // at 0x8F + + f32 mPanRange; // at 0x90 + f32 mTempoRatio; // at 0x94 + f32 mTickFraction; // at 0x98 + u32 mSkipTickCounter; // at 0x9C + f32 mSkipTimeCounter; // at 0xA0 + int mVoiceOutCount; // at 0xA4 + ParserPlayerParam mParserParam; // at 0xA8 + SeqTrackAllocator* mSeqTrackAllocator; // at 0xB4 + SeqTrack* mTracks[TRACK_NUM]; // at 0xB8 + volatile s16 mLocalVariable[LOCAL_VARIABLE_NUM]; // at 0xF8 + u32 mTickCounter; // at 0x118 + + static volatile s16 mGlobalVariable[LOCAL_VARIABLE_NUM]; + static bool mGobalVariableInitialized; // TYPO }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SeqSound.h b/include/nw4r/snd/snd_SeqSound.h index b1f8f72f..28be96b9 100644 --- a/include/nw4r/snd/snd_SeqSound.h +++ b/include/nw4r/snd/snd_SeqSound.h @@ -1,93 +1,128 @@ #ifndef NW4R_SND_SEQ_SOUND_H #define NW4R_SND_SEQ_SOUND_H -#include "snd_BasicSound.h" -#include "snd_NoteOn.h" -#include "snd_SeqPlayer.h" -#include "snd_SoundInstanceManager.h" -#include "snd_Task.h" -#include "ut_FileStream.h" -#include #include "common.h" +#include +#include +#include +#include + +#include + +#include namespace nw4r { namespace snd { + +// Forward declarations +class SeqSoundHandle; + namespace detail { -struct SeqSound : BasicSound { - typedef void (*SeqLoadCallback)(bool, const void *, void *); - - // sizeof(SeqLoadTask) = 0x24 - struct SeqLoadTask : Task { - ut::FileStream *mFileStream; // at 0x10 - void *mData; // at 0x14 - int mSize; // at 0x18 - SeqLoadCallback mCallback; // at 0x1c - SeqSound *mSound; // at 0x20 - - inline SeqLoadTask() : mFileStream(NULL), mData(NULL), mCallback(NULL), mSound(NULL) {} - - void Execute(); - void Cancel(); - void OnCancel(); - }; - static ut::detail::RuntimeTypeInfo typeInfo; +// Forward declarations +template class SoundInstanceManager; - SeqPlayer mPlayer; // at 0xd8 - SeqSoundHandle *mTempSpecialHandle; // at 0x1f4 - SoundInstanceManager *mManager; // at 0x1f8 - s32 INT_0x1FC; - SeqPlayer::OffsetType mOffsetType; // at 0x200 - int mOffset; // at 0x204 - bool mLoadingFlag; // at 0x208 - volatile bool mPreparedFlag; // at 0x209 - ut::FileStream *mFileStream; // at 0x20c - char UNK_0x210[0x200]; - SeqLoadTask mLoadTask; // at 0x410 - OSMutex MUTEX_0x434; // at 0x434 +class SeqSound : public BasicSound { + friend class SeqSoundHandle; - SeqSound(SoundInstanceManager *); - UNKTYPE InitParam(); - UNKTYPE Setup(SeqTrackAllocator *, u32, int, NoteOnCallback *); +public: + NW4R_UT_RTTI_DECL(SeqSound); - UNKTYPE Skip(SeqPlayer::OffsetType, int); // inlined - bool LoadData(SeqLoadCallback, void *); // inlined - void Prepare(const void *, s32, SeqPlayer::OffsetType, int); - void Prepare(ut::FileStream *, s32, SeqPlayer::OffsetType, int); - static void NotifyLoadAsyncEndSeqData(bool, const void *, void *); +public: + explicit SeqSound(SoundInstanceManager* pManager); - void Shutdown(); + virtual void Shutdown(); // at 0x28 + virtual bool IsPrepared() const { + return mPreparedFlag; + } // at 0x2C - UNKTYPE SetTempoRatio(float); - UNKTYPE SetChannelPriority(int); - UNKTYPE SetReleasePriorityFix(bool); + virtual void SetPlayerPriority(int priority); // at 0x4C - UNKTYPE SetPlayerPriority(int); + virtual bool IsAttachedTempSpecialHandle(); // at 0x5C + virtual void DetachTempSpecialHandle(); // at 0x60 - UNKTYPE SetTrackVolume(u32, float); - UNKTYPE SetTrackPitch(u32, float); + virtual void InitParam(); // at 0x64 - bool WriteVariable(int, short); - static bool WriteGlobalVariable(int, short); + virtual BasicPlayer& GetBasicPlayer() { + return mSeqPlayer; + } // at 0x68 + virtual const BasicPlayer& GetBasicPlayer() const { + return mSeqPlayer; + } // at 0x6C - bool IsAttachedTempSpecialHandle(); - UNKTYPE DetachTempSpecialHandle(); + SeqPlayer::SetupResult Setup(SeqTrackAllocator* pAllocator, + u32 allocTrackFlags, int voices, + NoteOnCallback* pCallback); - inline const BasicPlayer *GetBasicPlayer() const { - return &mPlayer; - } + void Prepare(const void* pBase, s32 seqOffset, + SeqPlayer::OffsetType startType, int startOffset); - inline BasicPlayer *GetBasicPlayer() { - return &mPlayer; - } + void Prepare(ut::FileStream* pStream, s32 seqOffset, + SeqPlayer::OffsetType startType, int startOffset); - inline bool IsPrepared() const { - return mPreparedFlag; - } + void Skip(SeqPlayer::OffsetType offsetType, int offset); + + void SetTempoRatio(f32 tempo); + void SetChannelPriority(int priority); + void SetReleasePriorityFix(bool flag); - inline const ut::detail::RuntimeTypeInfo *GetRuntimeTypeInfo() const { - return &typeInfo; + void SetTrackVolume(u32 trackFlags, f32 volume); + void SetTrackPitch(u32 trackFlags, f32 pitch); + + bool WriteVariable(int i, s16 value); + static bool WriteGlobalVariable(int i, s16 value); + + void* GetFileStreamBuffer() { + return mFileStreamBuffer; + } + s32 GetFileStreamBufferSize() { + return sizeof(mFileStreamBuffer); } + +private: + typedef void (*SeqLoadCallback)(bool success, const void* pBase, + void* pCallbackArg); + + struct SeqLoadTask : public Task { + SeqLoadTask(); + + virtual void Execute(); // at 0xC + virtual void Cancel(); // at 0x10 + virtual void OnCancel(); // at 0x14 + + ut::FileStream* fileStream; // at 0x10 + void* buffer; // at 0x14 + int bufferSize; // at 0x18 + SeqLoadCallback callback; // at 0x1C + SeqSound* callbackData; // at 0x20 + }; + + static const int FILE_STREAM_BUFFER_SIZE = 512; + +private: + bool LoadData(SeqLoadCallback pCalllback, void* pCallbackArg); + + static void NotifyLoadAsyncEndSeqData(bool success, const void* pBase, + void* pCallbackArg); + +private: + SeqPlayer mSeqPlayer; // at 0xD8 + SeqSoundHandle* mTempSpecialHandle; // at 0x1F4 + SoundInstanceManager* mManager; // at 0x1F8 + + s32 mSeqOffset; // at 0x1FC + SeqPlayer::OffsetType mStartOffsetType; // at 0x200 + int mStartOffset; // at 0x204 + + bool mLoadingFlag; // at 0x208 + volatile bool mPreparedFlag; // at 0x209 + + ut::FileStream* mFileStream; // at 0x20C + char mFileStreamBuffer[FILE_STREAM_BUFFER_SIZE]; // at 0x210 + + SeqLoadTask mSeqLoadTask; // at 0x410 + mutable OSMutex mMutex; // at 0x434 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SeqSoundHandle.h b/include/nw4r/snd/snd_SeqSoundHandle.h index 9580e45e..afafb6a5 100644 --- a/include/nw4r/snd/snd_SeqSoundHandle.h +++ b/include/nw4r/snd/snd_SeqSoundHandle.h @@ -1,18 +1,52 @@ #ifndef NW4R_SND_SEQ_SOUND_HANDLE_H #define NW4R_SND_SEQ_SOUND_HANDLE_H -#include "common.h" -#include "snd_SoundHandle.h" +#include + +#include + +#include namespace nw4r { namespace snd { -using namespace detail; -struct SeqSoundHandle { - detail::SeqSound *mSound; // at 0x0 +// Forward declarations +class SoundHandle; + +class SeqSoundHandle : private ut::NonCopyable { +public: + explicit SeqSoundHandle(SoundHandle* pHandle); + ~SeqSoundHandle() { + DetachSound(); + } + + bool IsAttachedSound() const { + return mSound != NULL; + } - SeqSoundHandle(SoundHandle *); void DetachSound(); + + void SetTempoRatio(f32 tempo) { + if (IsAttachedSound()) { + mSound->SetTempoRatio(tempo); + } + } + + void SetTrackVolume(u32 trackFlags, f32 volume) { + if (IsAttachedSound()) { + mSound->SetTrackVolume(trackFlags, volume); + } + } + + void WriteVariable(int i, s16 value) { + if (IsAttachedSound()) { + mSound->WriteVariable(i, value); + } + } + +private: + detail::SeqSound* mSound; // at 0x0 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SeqTrack.h b/include/nw4r/snd/snd_SeqTrack.h index 2e50ea01..714d61d0 100644 --- a/include/nw4r/snd/snd_SeqTrack.h +++ b/include/nw4r/snd/snd_SeqTrack.h @@ -1,117 +1,161 @@ #ifndef NW4R_SND_SEQ_TRACK_H #define NW4R_SND_SEQ_TRACK_H -#include "common.h" -#include "snd_Channel.h" -#include "snd_Lfo.h" +#include + +#include +#include + +#include namespace nw4r { namespace snd { -enum SeqMute { SEQ_MUTE_0, SEQ_MUTE_1, SEQ_MUTE_2, SEQ_MUTE_3 }; + +enum SeqMute { MUTE_OFF, MUTE_NO_STOP, MUTE_RELEASE, MUTE_STOP }; + +enum ParseResult { PARSE_RESULT_CONTINUE, PARSE_RESULT_FINISH }; namespace detail { -struct SeqTrack { - virtual ~SeqTrack(); - virtual UNKWORD Parse(bool) = 0; - u8 mPlayerTrackNo; // at 0x4 - bool mOpenFlag; // at 0x5 +class SeqTrack { +public: + static const int VARIABLE_NUM = 16; + static const int PRGNO_MAX = 0xFFFF; + + struct ParserTrackParam { + const u8* baseAddr; // at 0x0 + const u8* currentAddr; // at 0x4 + s32 wait; // at 0x8 + + bool muteFlag; // at 0xC + bool silenceFlag; // at 0xD + bool noteFinishWait; // at 0xE + bool portaFlag; // at 0xF + bool damperFlag; // at 0x10 + + int bankNo; // at 0x14 + int prgNo; // at 0x18 + + LfoParam lfoParam; // at 0x1C - float mVolume; // at 0x8 - float mPitch; // at 0xc - float FLOAT_0x10; - float FLOAT_0x14; - float FLOAT_0x18; - float FLOAT_0x1C; - float FLOAT_0x20; - float FLOATS_0x24[3]; - float FLOATS_0x30[4]; - float FLOATS_0x40[4]; - - const u8 *PTR_0x50; - const u8 *PTR_0x54; - - int TIMER_0x58; - - bool BOOL_0x5C; - char BYTE_0x5D; - bool BOOL_0x5E; - bool BOOL_0x5F; - bool BOOL_0x60; - - int INT_0x64; - UNKWORD WORD_0x68; - - LfoParam mLfoParam; // at 0x6c - - u8 BYTE_0x7C; - float FLOAT_0x80; - u8 BYTE_0x84; - u8 BYTE_0x85; - s8 BYTE_0x86; - u8 BYTE_0x87; - s8 BYTE_0x88; - s8 BYTE_0x89; - s8 BYTE_0x8A; - char BYTE_0x8B; - u8 BYTE_0x8C; - char BYTE_0x8D; - u8 BYTE_0x8E; - - u8 mAttack; // at 0x8f - u8 mDecay; // at 0x90 - u8 mSustain; // at 0x91 - u8 mRelease; // at 0x92 - - u8 BYTE_0x93; - u8 BYTES_0x94[3]; - char BYTE_0x97; - - s16 mVariables[0x10]; // at 0x98 - - SeqPlayer *mPlayer; // at 0xb8 - Channel *mChannel; // at 0xbc - - void SetPlayerTrackNo(int); + u8 lfoTarget; // at 0x2C + f32 sweepPitch; // at 0x30 + u8 volume; // at 0x34 + u8 volume2; // at 0x35 + + s8 pitchBend; // at 0x36 + u8 bendRange; // at 0x37 + + s8 pan; // at 0x38 + s8 initPan; // at 0x39 + s8 surroundPan; // at 0x3A + + s8 transpose; // at 0x3B + u8 priority; // at 0x3C + + u8 portaKey; // at 0x3D + u8 portaTime; // at 0x3E + + u8 attack; // at 0x3F + u8 decay; // at 0x40 + u8 sustain; // at 0x41 + u8 release; // at 0x42 + + u8 mainSend; // at 0x43 + u8 fxSend[AUX_BUS_NUM]; // at 0x44 + u8 lpfFreq; // at 0x47 + }; + +public: SeqTrack(); + virtual ~SeqTrack(); // at 0x8 - UNKTYPE InitParam(); + virtual ParseResult Parse(bool doNoteOn) = 0; // at 0xC - void SetSeqData(const void *, s32); + bool IsOpened() const { + return mOpenFlag; + } + + void SetPlayerTrackNo(int no); + u8 GetPlayerTrackNo() const { + return mPlayerTrackNo; + } + + void InitParam(); + void SetSeqData(const void* pBase, s32 offset); void Open(); void Close(); - void UpdateChannelRelease(Channel *); // inlined void UpdateChannelLength(); - UNKWORD ParseNextTick(bool); - void ReleaseAllChannel(int); - UNKTYPE PauseAllChannel(bool); + void UpdateChannelRelease(Channel* pChannel); + + int ParseNextTick(bool doNoteOn); + + void StopAllChannel(); + void ReleaseAllChannel(int release); + void PauseAllChannel(bool flag); + void AddChannel(Channel* pChannel); void UpdateChannelParam(); - UNKTYPE FreeAllChannel(); + void FreeAllChannel(); + + void SetMute(SeqMute mute); + void SetVolume(f32 volume); + void SetPitch(f32 pitch); - static void ChannelCallbackFunc(Channel *, Channel::ChannelCallbackStatus, u32); + ParserTrackParam& GetParserTrackParam() { + return mParserTrackParam; + } - void StopAllChannel(); // inlined - void SetMute(SeqMute); - void SetVolume(float); - void SetPitch(float); - s16 *GetVariablePtr(int); - void AddChannel(Channel *); // inlined - Channel *NoteOn(int, int, s32, bool); + volatile s16* GetVariablePtr(int i); - inline bool IsOpened() const { - return mOpenFlag; + SeqPlayer* GetSeqPlayer() { + return mPlayer; + } + void SetSeqPlayer(SeqPlayer* pPlayer) { + mPlayer = pPlayer; } -}; -struct SeqTrackAllocator { - inline virtual ~SeqTrackAllocator() {} - virtual SeqTrack *AllocTrack(SeqPlayer *) = 0; - virtual void FreeTrack(SeqTrack *) = 0; - virtual int GetAllocatableTrackCount() const = 0; + Channel* GetLastChannel() const { + return mChannelList; + } + + Channel* NoteOn(int key, int velocity, s32 length, bool tie); + +private: + static const int DEFAULT_PRIORITY = 64; + static const int DEFAULT_BENDRANGE = 2; + static const int DEFAULT_PORTA_KEY = 60; + static const int DEFAULT_VARIABLE_VALUE = -1; + +private: + static void ChannelCallbackFunc(Channel* pDropChannel, + Channel::ChannelCallbackStatus status, + u32 callbackArg); + +private: + u8 mPlayerTrackNo; // at 0x4 + bool mOpenFlag; // at 0x5 + + f32 mExtVolume; // at 0x8 + f32 mExtPitch; // at 0xC + f32 mExtPan; // at 0x10 + f32 mExtSurroundPan; // at 0x14 + f32 mPanRange; // at 0x18 + f32 mExtLpfFreq; // at 0x1C + f32 mExtMainSend; // at 0x20 + f32 mExtFxSend[AUX_BUS_NUM]; // at 0x24 + f32 mExtRemoteSend[WPAD_MAX_CONTROLLERS]; // at 0x30 + f32 mExtRemoteFxSend[WPAD_MAX_CONTROLLERS]; // at 0x40 + + ParserTrackParam mParserTrackParam; // at 0x50 + volatile s16 mTrackVariable[VARIABLE_NUM]; // at 0x98 + SeqPlayer* mPlayer; // at 0xB8 + Channel* mChannelList; // at 0xBC }; + } // namespace detail } // namespace snd } // namespace nw4r + #endif diff --git a/include/nw4r/snd/snd_SeqTrackAllocator.h b/include/nw4r/snd/snd_SeqTrackAllocator.h new file mode 100644 index 00000000..92413ce0 --- /dev/null +++ b/include/nw4r/snd/snd_SeqTrackAllocator.h @@ -0,0 +1,26 @@ +#ifndef NW4R_SND_SEQ_TRACK_ALLOCATOR_H +#define NW4R_SND_SEQ_TRACK_ALLOCATOR_H +#include + +namespace nw4r { +namespace snd { +namespace detail { + +// Forward declarations +class SeqPlayer; +class SeqTrack; + +class SeqTrackAllocator { +public: + virtual ~SeqTrackAllocator() {} // at 0x8 + + virtual SeqTrack* AllocTrack(SeqPlayer* pPlayer) = 0; // at 0xC + virtual void FreeTrack(SeqTrack* pTrack) = 0; // at 0x10 + virtual int GetAllocatableTrackCount() const = 0; // at 0x14 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_Sound3DActor.h b/include/nw4r/snd/snd_Sound3DActor.h index 7cc15cc2..43e61537 100644 --- a/include/nw4r/snd/snd_Sound3DActor.h +++ b/include/nw4r/snd/snd_Sound3DActor.h @@ -1,40 +1,44 @@ + #ifndef NW4R_SND_SOUND_3D_ACTOR_H #define NW4R_SND_SOUND_3D_ACTOR_H -#include "snd_BasicSound.h" -#include "snd_SoundActor.h" -#include "nw4r/math/math_types.h" - -namespace nw4r -{ - namespace snd - { - struct Sound3DActor : - detail::SoundActor, - detail::BasicSound::AmbientArgUpdateCallback - { - Sound3DManager & mManager; // at 0xac - SoundArchivePlayer & mArchivePlayer; // at 0xb0 - UNKWORD WORD_0xB4; - math::VEC3 mPosition; // at 0xb8 - - Sound3DActor(SoundArchivePlayer &, Sound3DManager &); - - ~Sound3DActor(); - - UNKWORD detail_SetupSound(SoundHandle *, - u32, - detail::BasicSound::AmbientArgInfo *, - detail::ExternalSoundPlayer *, - bool, - const SoundStartable::StartInfo *); - - void SetPosition(const math::VEC3 &); - - void detail_Update(void *, const detail::BasicSound *); - - static void ClearUpdateCallback(SoundHandle& handle); - }; - } -} +#include + +#include +#include + +#include + +namespace nw4r { +namespace snd { + +class Sound3DActor : public detail::SoundActor, + public detail::BasicSound::AmbientArgUpdateCallback { +public: + Sound3DActor(SoundArchivePlayer& rPlayer, Sound3DManager& rManager); + virtual ~Sound3DActor(); // at 0x8 + + virtual StartResult + detail_SetupSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, bool hold, + const StartInfo* pStartInfo); // at 0xC + + virtual void detail_Update(void* pArg, + const detail::BasicSound* pSound); // at 0xC + + void SetPosition(const math::VEC3& rPosition); + +private: + static void ClearUpdateCallback(SoundHandle& rHandle); + +private: + Sound3DManager& m3DManager; // at 0xAC + SoundArchivePlayer& mSoundArchivePlayer; // at 0xB0 + u32 mUserParam; // at 0xB4 + math::VEC3 mPosition; // at 0xB8 +}; + +} // namespace snd +} // namespace nw4r #endif diff --git a/include/nw4r/snd/snd_Sound3DListener.h b/include/nw4r/snd/snd_Sound3DListener.h index b770f6d4..d2bf333b 100644 --- a/include/nw4r/snd/snd_Sound3DListener.h +++ b/include/nw4r/snd/snd_Sound3DListener.h @@ -1,19 +1,48 @@ #ifndef NW4R_SND_SOUND_3D_LISTENER_H #define NW4R_SND_SOUND_3D_LISTENER_H -#include "common.h" -#include "nw4r/math/math_types.h" +#include + +#include namespace nw4r { namespace snd { -struct Sound3DListener { - math::MTX34 mMatrix; // at 0x0 - - float mInteriorSize; // at 0x30 - float mMaxVolumeDistance; // at 0x34 - float mUnitDistance; // at 0x38 +class Sound3DListener { +public: Sound3DListener(); + + const math::MTX34& GetMatrix() const { + return mMtx; + } + + f32 GetInteriorSize() const { + return mInteriorSize; + } + void SetInteriorSize(f32 size) { + mInteriorSize = size; + } + + f32 GetMaxVolumeDistance() const { + return mMaxVolumeDistance; + } + void SetMaxVolumeDistance(f32 distance) { + mMaxVolumeDistance = distance; + } + + f32 GetUnitDistance() const { + return mUnitDistance; + } + void SetUnitDistance(f32 distance) { + mUnitDistance = distance; + } + +private: + math::MTX34 mMtx; // at 0x0 + f32 mInteriorSize; // at 0x30 + f32 mMaxVolumeDistance; // at 0x34 + f32 mUnitDistance; // at 0x38 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_Sound3DManager.h b/include/nw4r/snd/snd_Sound3DManager.h index 529a471f..337e1eb4 100644 --- a/include/nw4r/snd/snd_Sound3DManager.h +++ b/include/nw4r/snd/snd_Sound3DManager.h @@ -1,53 +1,83 @@ #ifndef NW4R_SND_SOUND_3D_MANAGER_H #define NW4R_SND_SOUND_3D_MANAGER_H -#include "snd_BasicSound.h" -#include "snd_SoundArchive.h" -#include "snd_SoundActor.h" -#include "snd_InstancePool.h" -#include "nw4r/math/math_types.h" - -namespace nw4r -{ - namespace snd - { - struct Sound3DManager : - detail::BasicSound::AmbientParamUpdateCallback, - detail::BasicSound::AmbientArgAllocaterCallback - { - struct Sound3DActorParam - { - u32 WORD_0x0; - - SoundArchive::Sound3DParam mSound3DParam; // at 0x4 - - math::VEC3 mPosition; // at 0xc - - Sound3DActorParam(); - }; - - detail::InstancePool mPool; // at 0x8 - Sound3DListener * mListener; // at 0xc - int INT_0x10; - float FLOAT_0x14; - float FLOAT_0x18; - float FLOAT_0x1C; - float FLOAT_0x20; - float FLOAT_0x24; - - Sound3DManager(); - - u32 GetRequiredMemSize(const SoundArchive *); - - bool Setup(const SoundArchive *, void *, u32); - - void detail_Update(SoundParam *, u32, detail::BasicSound *, const void *, u32); - - virtual void Update(SoundParam *, u32, SoundHandle *, const void *, u32); - - void * detail_AllocAmbientArg(u32); - void detail_FreeAmbientArg(void *, const detail::BasicSound *); - }; - } -} +#include + +#include +#include +#include + +#include + +namespace nw4r { +namespace snd { + +class Sound3DManager : public detail::BasicSound::AmbientParamUpdateCallback, + public detail::BasicSound::AmbientArgAllocaterCallback { +public: + struct Sound3DActorParam { + u32 userParam; // at 0x0 + SoundArchive::Sound3DParam soundParam; // at 0x4 + math::VEC3 position; // at 0xC + + Sound3DActorParam(); + }; + +public: + Sound3DManager(); + + virtual void detail_Update(SoundParam* pParam, u32 id, + detail::BasicSound* pSound, const void* pArg, + u32 flags); // at 0x8 + + virtual void Update(SoundParam* pParam, u32 id, SoundHandle* pHandle, + const void* pArg, + u32 flags); // at 0x10 + + virtual void* detail_AllocAmbientArg(u32 size); // at 0x14 + + virtual void + detail_FreeAmbientArg(void* pArg, + const detail::BasicSound* pSound); // at 0x18 + + u32 GetRequiredMemSize(const SoundArchive* pArchive); + bool Setup(const SoundArchive* pArchive, void* pBuffer, u32 size); + + Sound3DListener* GetListener() const { + return mListener; + } + + int GetMaxPriorityReduction() const { + return mMaxPriorityReduction; + } + void SetMaxPriorityReduction(int max) { + mMaxPriorityReduction = max; + } + + f32 GetPanRange() const { + return mPanRange; + } + +private: + enum ParamDecayCurve { + DECAY_CURVE_NONE, + DECAY_CURVE_LOGARITHMIC, + DECAY_CURVE_LINEAR, + }; + +private: + detail::InstancePool mParamPool; // at 0x8 + Sound3DListener* mListener; // at 0xC + s32 mMaxPriorityReduction; // at 0x10 + + f32 mSpeakerAngleStereo; // at 0x14 + f32 mFrontSpeakerAngleDpl2; // at 0x18 + f32 mRearSpeakerAngleDpl2; // at 0x1C + + f32 mInitPan; // at 0x20 + f32 mPanRange; // at 0x24 +}; + +} // namespace snd +} // namespace nw4r #endif diff --git a/include/nw4r/snd/snd_SoundActor.h b/include/nw4r/snd/snd_SoundActor.h index bca4d68c..280df27f 100644 --- a/include/nw4r/snd/snd_SoundActor.h +++ b/include/nw4r/snd/snd_SoundActor.h @@ -1,56 +1,63 @@ #ifndef NW4R_SND_SOUND_ACTOR_H #define NW4R_SND_SOUND_ACTOR_H -#include "snd_SoundStartable.h" -#include "snd_ExternalSoundPlayer.h" - -namespace nw4r -{ - namespace snd - { - namespace detail - { - enum - { - SOUND_PLAYERS_PER_ACTOR = 8 - }; - - struct SoundActor : SoundStartable - { - SoundStartable & mStartable; // at 0x4 - ExternalSoundPlayer mPlayers[SOUND_PLAYERS_PER_ACTOR]; // at 0x8 - - inline SoundActor(SoundStartable & startable) : mStartable(startable) - { - mPlayers[0].SetPlayableSoundCount(0x7FFFFFFF); - } - - inline UNKWORD detail_ConvertLabelStringToSoundId(const char * labelString) - { - return mStartable.detail_ConvertLabelStringToSoundId(labelString); - } - - template - TForEachFunc ForEachSound(TForEachFunc func, bool reverse) { - int i; - ExternalSoundPlayer* player = mPlayers; - - for (i = 0; i < SOUND_PLAYERS_PER_ACTOR; i++) { - player->ForEachSound(func, reverse); - player++; - } - - return func; - } - - virtual UNKWORD detail_SetupSound(SoundHandle *, - u32, - detail::BasicSound::AmbientArgInfo *, - detail::ExternalSoundPlayer *, - bool, - const StartInfo *); - }; - } - } -} - -#endif \ No newline at end of file +#include + +#include +#include + +#include + +namespace nw4r { +namespace snd { +namespace detail { + +class SoundActor : public SoundStartable { +public: + explicit SoundActor(SoundStartable& rStartable) : mStartable(rStartable) { + detail_GetActorSoundPlayer(0)->SetPlayableSoundCount(INT_MAX); + } + + virtual StartResult + detail_SetupSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, bool hold, + const StartInfo* pStartInfo); // at 0xC + + virtual u32 detail_ConvertLabelStringToSoundId(const char* pLabel) { + return mStartable.detail_ConvertLabelStringToSoundId(pLabel); + } // at 0x10 + + ExternalSoundPlayer* detail_GetActorSoundPlayer(int i) { + if (i < 0 || i >= ACTOR_PLAYER_COUNT) { + return NULL; + } + + return &mActorPlayer[i]; + } + + template + TForEachFunc ForEachSound(TForEachFunc pFunction, bool reverse) { + int i; + ExternalSoundPlayer* pPlayer = detail_GetActorSoundPlayer(0); + + for (i = 0; i < ACTOR_PLAYER_COUNT; i++) { + pPlayer->ForEachSound(pFunction, reverse); + pPlayer++; + } + + return pFunction; + } + +private: + static const int ACTOR_PLAYER_COUNT = 8; + +private: + SoundStartable& mStartable; // at 0x4 + ExternalSoundPlayer mActorPlayer[ACTOR_PLAYER_COUNT]; // at 0x8 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_SoundArchive.h b/include/nw4r/snd/snd_SoundArchive.h index 4745ab93..50ef8cc9 100644 --- a/include/nw4r/snd/snd_SoundArchive.h +++ b/include/nw4r/snd/snd_SoundArchive.h @@ -1,146 +1,177 @@ #ifndef NW4R_SND_SOUND_ARCHIVE_H #define NW4R_SND_SOUND_ARCHIVE_H -#include "common.h" -#include "ut_FileStream.h" +#include +#include + +#include namespace nw4r { namespace snd { -struct SoundArchive { - struct Sound3DParam { - UNKWORD WORD_0x0; - u8 BYTE_0x4; - u8 BYTE_0x5; - }; - struct SoundArchivePlayerInfo { - u32 SIZE_0x0; - UNKWORD WORD_0x4; - u32 SIZE_0x8; - UNKWORD WORD_0xC; - UNKWORD WORD_0x10; - u32 SIZE_0x14; - UNKWORD WORD_0x18; - }; +enum SoundType { + SOUND_TYPE_INVALID, + SOUND_TYPE_SEQ, + SOUND_TYPE_STRM, + SOUND_TYPE_WAVE +}; +class SoundArchive { +public: struct SoundInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - UNKWORD WORD_0x8; - UNKWORD WORD_0xC; - UNKWORD WORD_0x10; - UNKWORD WORD_0x14; - UNKWORD WORD_0x18; + u32 fileId; // at 0x0 + u32 playerId; // at 0x4 + int playerPriority; // at 0x8 + int volume; // at 0xC + int remoteFilter; // at 0x10 + detail::PanMode panMode; // at 0x14 + detail::PanCurve panCurve; // at 0x18 }; struct SeqSoundInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - UNKWORD WORD_0x8; - UNKWORD WORD_0xC; - bool BOOL_0x10; + u32 dataOffset; // at 0x0 + u32 bankId; // at 0x4 + u32 allocTrack; // at 0x8 + int channelPriority; // at 0xC + bool releasePriorityFixFlag; // at 0x10 }; struct StrmSoundInfo {}; struct WaveSoundInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - bool BOOL_0x8; + int subNo; // at 0x0 + int channelPriority; // at 0x4 + bool releasePriorityFixFlag; // at 0x8 + }; + + struct Sound3DParam { + u32 flags; // at 0x0 + u8 decayCurve; // at 0x4 + u8 decayRatio; // at 0x5 }; struct BankInfo { - UNKWORD WORD_0x0; + u32 fileId; // at 0x0 }; struct PlayerInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; + int playableSoundCount; // at 0x0 + u32 heapSize; // at 0x4 }; struct GroupInfo { - u32 mCount; // at 0x0 - const char *mExternalFileName; // at 0x4 - u32 INT_0x8; - u32 INT_0xC; - u32 INT_0x10; - u32 INT_0x14; + u32 itemCount; // at 0x0 + const char* extFilePath; // at 0x4 + u32 offset; // at 0x8 + u32 size; // at 0xC + u32 waveDataOffset; // at 0x10 + u32 waveDataSize; // at 0x14 }; - struct GroupItemInfo { - UNKWORD WORD_0x0; - u32 INT_0x4; - u32 INT_0x8; - u32 INT_0xC; - UNKWORD WORD_0x10; + u32 fileId; // at 0x0 + u32 offset; // at 0x4 + u32 size; // at 0x8 + u32 waveDataOffset; // at 0xC + u32 waveDataSize; // at 0x10 }; struct FileInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - const char *mExternalFileName; // at 0x8 - u32 SIZE_0xC; + u32 fileSize; // at 0x0 + u32 waveDataFileSize; // at 0x4 + const char* extFilePath; // at 0x8 + u32 filePosCount; // at 0xC }; - struct FilePos { - u32 mGroupIndex; // at 0x0 - u32 mGroupItemIndex; // at 0x4 + u32 groupId; // at 0x0 + u32 index; // at 0x4 }; - virtual ~SoundArchive(); // at 0x8 - virtual const void *detail_GetFileAddress(u32) const = 0; // at 0xc - virtual const void *detail_GetWaveDataFileAddress(u32) const = 0; // at 0x10 - virtual int detail_GetRequiredStreamBufferSize() const = 0; // at 0x14 - virtual ut::FileStream *OpenStream(void *, int, u32, u32) const = 0; // at 0x18 - virtual ut::FileStream *OpenExtStream(void *, int, const char *, u32, u32) const = 0; // at 0x1c + struct SoundArchivePlayerInfo { + int seqSoundCount; // at 0x0 + int seqTrackCount; // at 0x4 + int strmSoundCount; // at 0x8 + int strmTrackCount; // at 0xC + int strmChannelCount; // at 0x10 + int waveSoundCount; // at 0x14 + int waveTrackCount; // at 0x18 + }; - detail::SoundArchiveFileReader *mFileReader; // at 0x4 - char mExternalFileRoot[0x100]; // at 0x8 + static const u32 INVALID_ID = 0xFFFFFFFF; +public: SoundArchive(); + virtual ~SoundArchive(); // at 0x8 + + virtual const void* detail_GetFileAddress(u32 id) const = 0; // at 0xC + + virtual const void* + detail_GetWaveDataFileAddress(u32 id) const = 0; // at 0x10 + + virtual int detail_GetRequiredStreamBufferSize() const = 0; // at 0x14 + + virtual ut::FileStream* OpenStream(void* pBuffer, int bufferSize, + u32 offset, + u32 length) const = 0; // at 0x18 + + virtual ut::FileStream* OpenExtStream(void* pBuffer, int bufferSize, + const char* pExtPath, u32 offset, + u32 length) const = 0; // at 0x1C bool IsAvailable() const; - void Setup(detail::SoundArchiveFileReader *); + void Setup(detail::SoundArchiveFileReader* pReader); void Shutdown(); u32 GetPlayerCount() const; u32 GetGroupCount() const; - const char *GetSoundLabelString(u32) const; + const char* GetSoundLabelString(u32 id) const; + u32 ConvertLabelStringToSoundId(const char* pLabel) const; + u32 ConvertLabelStringToPlayerId(const char* pLabel) const; + u32 ConvertLabelStringToGroupId(const char* pLabel) const; - u32 ConvertLabelStringToSoundId(const char *) const; - u32 ConvertLabelStringToPlayerId(const char *) const; - u32 ConvertLabelStringToGroupId(const char *) const; + u32 GetSoundUserParam(u32 id) const; + SoundType GetSoundType(u32 id) const; - UNKWORD GetSoundUserParam(u32) const; - UNKWORD GetSoundType(u32) const; + bool ReadSoundInfo(u32 id, SoundInfo* pInfo) const; + bool detail_ReadSeqSoundInfo(u32 id, SeqSoundInfo* pInfo) const; + bool detail_ReadStrmSoundInfo(u32 id, StrmSoundInfo* pInfo) const; + bool detail_ReadWaveSoundInfo(u32 id, WaveSoundInfo* pInfo) const; - bool ReadSoundInfo(u32, SoundInfo *) const; + bool ReadPlayerInfo(u32 id, PlayerInfo* pInfo) const; + bool ReadSoundArchivePlayerInfo(SoundArchivePlayerInfo* pInfo) const; - bool detail_ReadSeqSoundInfo(u32, SeqSoundInfo *) const; - bool detail_ReadStrmSoundInfo(u32, StrmSoundInfo *) const; - bool detail_ReadWaveSoundInfo(u32, WaveSoundInfo *) const; + bool detail_ReadSound3DParam(u32 id, Sound3DParam* pParam) const; + bool detail_ReadBankInfo(u32 id, BankInfo* pInfo) const; + bool detail_ReadGroupInfo(u32 id, GroupInfo* pInfo) const; + bool detail_ReadGroupItemInfo(u32 groupId, u32 itemId, + GroupItemInfo* pInfo) const; - bool ReadPlayerInfo(u32, PlayerInfo *) const; + bool detail_ReadFileInfo(u32 id, FileInfo* pInfo) const; + bool detail_ReadFilePos(u32 fileId, u32 posId, FilePos* pPos) const; - bool ReadSoundArchivePlayerInfo(SoundArchivePlayerInfo *) const; + ut::FileStream* detail_OpenFileStream(u32 id, void* pBuffer, + int bufferSize) const; + ut::FileStream* detail_OpenGroupStream(u32 id, void* pBuffer, + int bufferSize) const; + ut::FileStream* detail_OpenGroupWaveDataStream(u32 id, void* pBuffer, + int bufferSize) const; - bool detail_ReadSound3DParam(u32, Sound3DParam *) const; + void SetExternalFileRoot(const char* pExtFileRoot); - bool detail_ReadBankInfo(u32, BankInfo *) const; - bool detail_ReadGroupInfo(u32, GroupInfo *) const; - bool detail_ReadGroupItemInfo(u32, u32, GroupItemInfo *) const; - bool detail_ReadFileInfo(u32, FileInfo *) const; - bool detail_ReadFilePos(u32, u32, FilePos *) const; +protected: + static const int FILE_PATH_MAX = 256; - ut::FileStream *OpenExtStreamImpl(void *, int, const char *, u32, u32) const; // inlined - ut::FileStream *detail_OpenFileStream(u32, void *, int) const; - ut::FileStream *detail_OpenGroupStream(u32, void *, int) const; - ut::FileStream *detail_OpenGroupWaveDataStream(u32, void *, int) const; +private: + ut::FileStream* OpenExtStreamImpl(void* pBuffer, int bufferSize, + const char* pExtPath, u32 offset, + u32 size) const; - UNKTYPE SetExternalFileRoot(const char *); +private: + detail::SoundArchiveFileReader* mFileReader; // at 0x4 + char mExtFileRoot[FILE_PATH_MAX]; // at 0x8 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundArchiveFile.h b/include/nw4r/snd/snd_SoundArchiveFile.h index d3af2f18..b025f9d1 100644 --- a/include/nw4r/snd/snd_SoundArchiveFile.h +++ b/include/nw4r/snd/snd_SoundArchiveFile.h @@ -1,243 +1,300 @@ #ifndef NW4R_SND_SOUND_ARCHIVE_FILE_H #define NW4R_SND_SOUND_ARCHIVE_FILE_H -#include "common.h" -#include "snd_SoundArchive.h" -#include "snd_Util.h" -#include "ut_binaryFileFormat.h" +#include + +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { namespace SoundArchiveFile { -struct Header { - ut::BinaryFileHeader mHeader; // at 0x0 - u32 mLabelStringChunkOffset; // at 0x10 - u32 mLabelStringChunkSize; // at 0x14 - u32 mInfoChunkOffset; // at 0x18 - u32 mInfoChunkSize; // at 0x1c - UNKWORD UNK_0x20[0x8 / sizeof(UNKWORD)]; // at 0x20 + +/****************************************************************************** + * + * Symbol (SYMB) block + * + ******************************************************************************/ +struct StringTreeNode { + u16 flags; // at 0x0 + u16 bit; // at 0x2 + u32 leftIdx; // at 0x4 + u32 rightIdx; // at 0x8 + u32 strIdx; // at 0xC + u32 id; // at 0x10 }; -struct Sound3DParam { - UNKWORD WORD_0x0; - u8 BYTE_0x4; - u8 BYTE_0x5; +struct StringTree { + u32 rootIdx; // at 0x0 + Util::Table nodeTable; // at 0x4 +}; + +struct StringTable { + Util::Table offsetTable; // at 0x0 +}; + +struct StringChunk { + u32 tableOffset; // at 0x0 + u32 soundTreeOffset; // at 0x4 + u32 playerTreeOffset; // at 0x8 + u32 groupTreeOffset; // at 0xC + u32 bankTreeOffset; // at 0x10 +}; + +struct StringBlock { + union { + StringTable stringTable; + StringChunk stringChunk; + }; // at 0x0 +}; + +struct SymbolBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + StringBlock stringBlock; // at 0x8 }; +/****************************************************************************** + * + * Info (INFO) block + * + ******************************************************************************/ struct SeqSoundInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - UNKWORD WORD_0x8; - u8 BYTE_0xC; - u8 BYTE_0xD; + u32 dataOffset; // at 0x0 + u32 bankId; // at 0x4 + u32 allocTrack; // at 0x8 + u8 channelPriority; // at 0xC + u8 releasePriorityFix; // at 0xD }; struct StrmSoundInfo {}; struct WaveSoundInfo { - UNKWORD WORD_0x0; - char UNK_0x4[0x4]; - u8 BYTE_0x8; - u8 BYTE_0x9; + s32 subNo; // at 0x0 + u32 allocTrack; // at 0x4 + u8 channelPriority; // at 0x8 + u8 releasePriorityFix; // at 0x9 }; +typedef Util::DataRef + SoundInfoOffset; -typedef Util::DataRef SoundInfoOffset; +struct Sound3DParam { + u32 flags; // at 0x0 + u8 decayCurve; // at 0x4 + u8 decayRatio; // at 0x5 +}; struct SoundCommonInfo { - u32 mSoundStringId; // at 0x0 - UNKWORD WORD_0x4; - UNKWORD WORD_0x8; - Util::DataRef mSound3DParam; // at 0xc - u8 BYTE_0x14; - u8 BYTE_0x15; - u8 mType; // at 0x16 - u8 BYTE_0x17; - SoundInfoOffset mSoundInfoOffset; // at 0x18 - UNKWORD mSoundUserParam; // at 0x20 - char UNK_0x24[0x4]; - u8 BYTE_0x28; - u8 BYTE_0x29; -}; - -typedef Util::Table> SoundCommonTable; + u32 stringId; // at 0x0 + u32 fileId; // at 0x4 + u32 playerId; // at 0x8 + Util::DataRef param3dRef; // at 0xC + u8 volume; // at 0x14 + u8 playerPriority; // at 0x15 + u8 soundType; // at 0x16 + u8 remoteFilter; // at 0x17 + SoundInfoOffset soundInfoRef; // at 0x18 + u32 userParam[2]; // at 0x20 + u8 panMode; // at 0x28 + u8 panCurve; // at 0x29 +}; +typedef Util::Table > SoundCommonTable; struct BankInfo { - char UNK_0x0[0x4]; - UNKWORD WORD_0x4; + u32 stringId; // at 0x0 + u32 fileId; // at 0x4 }; - -typedef Util::Table> BankTable; +typedef Util::Table > BankTable; struct PlayerInfo { - char UNK_0x0[0x4]; - u8 BYTE_0x4; - UNKWORD WORD_0x8; + u32 stringId; // at 0x0 + u8 playableSoundCount; // at 0x4 + u32 heapSize; // at 0x8 }; +typedef Util::Table > PlayerTable; -typedef Util::Table> PlayerTable; +typedef Util::Table > FilePosTable; -struct GroupItemInfo { - UNKWORD WORD_0x0; - u32 INT_0x4; - u32 INT_0x8; - u32 INT_0xC; - UNKWORD WORD_0x10; +struct FileInfo { + u32 fileSize; // at 0x0 + u32 waveDataSize; // at 0x4 + s32 entryNum; // at 0x8 + Util::DataRef extFilePathRef; // at 0xC + Util::DataRef filePosTableRef; // at 0x14 }; +typedef Util::Table > FileTable; -typedef Util::Table> GroupItemTable; +struct GroupItemInfo { + u32 fileId; // at 0x0 + u32 offset; // at 0x4 + u32 size; // at 0x8 + u32 waveDataOffset; // at 0xC + u32 waveDataSize; // at 0x10 +}; +typedef Util::Table > GroupItemTable; struct GroupInfo { - char UNK_0x0[0x8]; - Util::DataRef mExternalFileName; // at 0x8 - u32 INT_0x10; - u32 INT_0x14; - u32 INT_0x18; - u32 INT_0x1C; - Util::DataRef mGroupItemTable; // at 0x20 + u32 stringId; // at 0x0 + s32 entryNum; // at 0x4 + Util::DataRef extFilePathRef; // at 0x8 + u32 offset; // at 0x10 + u32 size; // at 0x14 + u32 waveDataOffset; // at 0x18 + u32 waveDataSize; // at 0x1C + Util::DataRef itemTableRef; // at 0x20 }; - -typedef Util::Table> GroupTable; +typedef Util::Table > GroupTable; struct SoundArchivePlayerInfo { - u16 SIZE_0x0; - u16 SHORT_0x2; - u16 SIZE_0x4; - u16 SHORT_0x6; - u16 SHORT_0x8; - u16 SIZE_0xA; - u16 SHORT_0xC; + u16 seqSoundCount; // at 0x0 + u16 seqTrackCount; // at 0x2 + u16 strmSoundCount; // at 0x4 + u16 strmTrackCount; // at 0x6 + u16 strmChannelCount; // at 0x8 + u16 waveSoundCount; // at 0xA + u16 waveTrackCount; // at 0xC }; -typedef Util::Table> FilePosTable; - -struct FileInfo { - UNKWORD WORD_0x0; - UNKWORD WORD_0x4; - char UNK_0x8[0x4]; - Util::DataRef mExternalFileName; // at 0xc - Util::DataRef TABLE_0x14; +struct Info { + Util::DataRef soundTableRef; // at 0x0 + Util::DataRef bankTableRef; // at 0x8 + Util::DataRef playerTableRef; // at 0x10 + Util::DataRef fileTableRef; // at 0x18 + Util::DataRef groupTableRef; // at 0x20 + Util::DataRef soundArchivePlayerInfoRef; // at 0x28 }; -typedef Util::Table> FileTable; - -struct StringNode { - enum { FLAG_LEAF = 0x0001 }; - - u16 mFlags; // at 0x0 - u16 SHORT_0x2; - u32 mLeftIndex; // at 0x4 - u32 mRightIndex; // at 0x8 - u32 mStringId; // at 0xc - u32 mId; // at 0x10 +struct InfoBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + Info info; // at 0x8 }; -struct StringTree { - u32 mRootIndex; // at 0x0 - u32 INT_0x4; - StringNode mNodes[]; // at 0x8 +/****************************************************************************** + * + * File header + * + ******************************************************************************/ +struct Header { + ut::BinaryFileHeader fileHeader; // at 0x0 + u32 symbolDataOffset; // at 0x10 + u32 symbolDataSize; // at 0x14 + u32 infoOffset; // at 0x18 + u32 infoSize; // at 0x1C + u32 fileImageOffset; // at 0x20 + u32 fileImageSize; // at 0x24 }; -struct StringChunk { - u32 mTableOffset; // at 0x0 - u32 mSoundTreeOffset; // at 0x4 - u32 mPlayerTreeOffset; // at 0x8 - u32 mGroupTreeOffset; // at 0xc - u32 OFFSET_0x10; -}; - -struct InfoChunk { - Util::DataRef mSoundCommonTable; // at 0x0 - Util::DataRef mBankTable; // at 0x8 - Util::DataRef mPlayerTable; // at 0x10 - Util::DataRef mFileTable; // at 0x18 - Util::DataRef mGroupTable; // at 0x20 - Util::DataRef mSoundArchivePlayerInfo; // at 0x28 -}; -}; // namespace SoundArchiveFile - -struct SoundArchiveFileReader { - struct StringBlock { - ut::BinaryBlockHeader mHeader; // at 0x0 - SoundArchiveFile::StringChunk mChunk; // at 0x8 - }; - - struct InfoBlock { - ut::BinaryBlockHeader mHeader; // at 0x0 - SoundArchiveFile::InfoChunk mChunk; // at 0x8 - }; - - SoundArchiveFile::Header mHeader; // at 0x0 - - const SoundArchiveFile::InfoChunk *mInfoChunk; // at 0x28 - const SoundArchiveFile::StringChunk *mStringChunk; // at 0x2c - const Util::Table *mStringTable; // at 0x30 - const SoundArchiveFile::StringTree *mSoundStringTree; // at 0x34 - const SoundArchiveFile::StringTree *mPlayerStringTree; // at 0x38 - const SoundArchiveFile::StringTree *mGroupStringTree; // at 0x3c - const UNKTYPE *PTR_0x40; - - SoundArchiveFileReader(); +// TODO: How is this calculated? +static const int HEADER_AREA_SIZE = ROUND_UP(sizeof(Header), 32) + 40; - bool IsValidFileHeader(const void *); // inlined - void Init(const void *); +} // namespace SoundArchiveFile - const void *GetPtrConst(const void *, u32) const; // inlined +class SoundArchiveFileReader { +public: + static const u32 SIGNATURE = 'RSAR'; + static const int VERSION = NW4R_VERSION(1, 3); - void SetStringChunk(const void *, u32); - void SetInfoChunk(const void *, u32); - - UNKWORD GetSoundType(u32) const; - - const SoundArchiveFile::SoundCommonInfo *impl_GetSoundInfo(u32) const; // inlined - bool ReadSoundInfo(u32, SoundArchive::SoundInfo *) const; - bool ReadSound3DParam(u32, SoundArchive::Sound3DParam *) const; - bool ReadSeqSoundInfo(u32, SoundArchive::SeqSoundInfo *) const; - bool ReadStrmSoundInfo(u32, SoundArchive::StrmSoundInfo *) const; - bool ReadWaveSoundInfo(u32, SoundArchive::WaveSoundInfo *) const; - const SoundArchiveFile::BankInfo *impl_GetBankInfo(u32) const; // inlined - bool ReadBankInfo(u32, SoundArchive::BankInfo *) const; - const SoundArchiveFile::PlayerInfo *impl_GetPlayerInfo(u32) const; // inlined - bool ReadPlayerInfo(u32, SoundArchive::PlayerInfo *) const; - const SoundArchiveFile::GroupInfo *impl_GetGroupInfo(u32) const; // inlined - bool ReadGroupInfo(u32, SoundArchive::GroupInfo *) const; - bool ReadGroupItemInfo(u32, u32, SoundArchive::GroupItemInfo *) const; - bool ReadSoundArchivePlayerInfo(SoundArchive::SoundArchivePlayerInfo *) const; +public: + SoundArchiveFileReader(); + void Init(const void* pSoundArchiveBin); + bool IsValidFileHeader(const void* pSoundArchiveBin); + + void SetStringChunk(const void* pChunk, u32 size); + void SetInfoChunk(const void* pChunk, u32 size); + + SoundType GetSoundType(u32 id) const; + bool ReadSoundInfo(u32 id, SoundArchive::SoundInfo* pInfo) const; + bool ReadSound3DParam(u32 id, SoundArchive::Sound3DParam* pParam) const; + bool ReadSeqSoundInfo(u32 id, SoundArchive::SeqSoundInfo* pInfo) const; + bool ReadStrmSoundInfo(u32 id, SoundArchive::StrmSoundInfo* pInfo) const; + bool ReadWaveSoundInfo(u32 id, SoundArchive::WaveSoundInfo* pInfo) const; + bool ReadBankInfo(u32 id, SoundArchive::BankInfo* pInfo) const; + bool ReadPlayerInfo(u32 id, SoundArchive::PlayerInfo* pInfo) const; + bool ReadGroupInfo(u32 id, SoundArchive::GroupInfo* pInfo) const; + bool ReadGroupItemInfo(u32 groupId, u32 itemId, + SoundArchive::GroupItemInfo* pInfo) const; + bool ReadSoundArchivePlayerInfo( + SoundArchive::SoundArchivePlayerInfo* pInfo) const; + + u32 GetSoundStringId(u32 id) const; u32 GetPlayerCount() const; u32 GetGroupCount() const; - u32 GetSoundStringId(u32) const; // inlined - const char *GetString(u32) const; // inlined - const char *GetSoundLabelString(u32) const; - UNKWORD GetSoundUserParam(u32) const; + const char* GetSoundLabelString(u32 id) const; + u32 GetSoundUserParam(u32 id) const; - bool ReadFileInfo(u32, SoundArchive::FileInfo *) const; - bool ReadFilePos(u32, u32, SoundArchive::FilePos *) const; + bool ReadFileInfo(u32 id, SoundArchive::FileInfo* pInfo) const; + bool ReadFilePos(u32 fileId, u32 id, SoundArchive::FilePos* pPos) const; - u32 ConvertLabelStringToId(const SoundArchiveFile::StringTree *, const char *) const; + const char* GetString(u32 id) const; - SoundArchiveFile::SoundInfoOffset impl_GetSoundInfoOffset(u32) const; + u32 ConvertLabelStringToSoundId(const char* pLabel) const { + return ConvertLabelStringToId(mStringTreeSound, pLabel); + } + u32 ConvertLabelStringToPlayerId(const char* pLabel) const { + return ConvertLabelStringToId(mStringTreePlayer, pLabel); + } + u32 ConvertLabelStringToGroupId(const char* pLabel) const { + return ConvertLabelStringToId(mStringTreeGroup, pLabel); + } - inline u16 GetVersion() const { - return mHeader.mHeader.version; + u16 GetVersion() const { + return mHeader.fileHeader.version; } - inline u32 GetLabelStringChunkOffset() const { - return mHeader.mLabelStringChunkOffset; + u32 GetLabelStringChunkOffset() const { + return mHeader.symbolDataOffset; } - inline u32 GetLabelStringChunkSize() const { - return mHeader.mLabelStringChunkSize; + u32 GetLabelStringChunkSize() const { + return mHeader.symbolDataSize; } - inline u32 GetInfoChunkOffset() const { - return mHeader.mInfoChunkOffset; + u32 GetInfoChunkOffset() const { + return mHeader.infoOffset; } - inline u32 GetInfoChunkSize() const { - return mHeader.mInfoChunkSize; + u32 GetInfoChunkSize() const { + return mHeader.infoSize; + } + +private: + u32 ConvertLabelStringToId(const SoundArchiveFile::StringTree* pTree, + const char* pLabel) const; + + const SoundArchiveFile::SoundCommonInfo* impl_GetSoundInfo(u32 id) const; + SoundArchiveFile::SoundInfoOffset impl_GetSoundInfoOffset(u32 id) const + DECOMP_DONT_INLINE; + + const SoundArchiveFile::SeqSoundInfo* impl_GetSeqSoundInfo(u32 id) const; + const SoundArchiveFile::StrmSoundInfo* impl_GetStrmSoundInfo(u32 id) const; + const SoundArchiveFile::WaveSoundInfo* impl_GetWaveSoundInfo(u32 id) const; + + const SoundArchiveFile::BankInfo* impl_GetBankInfo(u32 id) const; + const SoundArchiveFile::PlayerInfo* impl_GetPlayerInfo(u32 id) const; + const SoundArchiveFile::GroupInfo* impl_GetGroupInfo(u32 id) const; + + const void* GetPtrConst(const void* pBase, u32 offset) const { + if (offset == 0) { + return NULL; + } + + return ut::AddOffsetToPtr(pBase, offset); } + +private: + SoundArchiveFile::Header mHeader; // at 0x0 + const SoundArchiveFile::Info* mInfo; // at 0x28 + const void* mStringBase; // at 0x2C + const SoundArchiveFile::StringTable* mStringTable; // at 0x30 + const SoundArchiveFile::StringTree* mStringTreeSound; // at 0x34 + const SoundArchiveFile::StringTree* mStringTreePlayer; // at 0x38 + const SoundArchiveFile::StringTree* mStringTreeGroup; // at 0x3C + const SoundArchiveFile::StringTree* mStringTreeBank; // at 0x40 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundArchiveLoader.h b/include/nw4r/snd/snd_SoundArchiveLoader.h index ab33776e..38ca99de 100644 --- a/include/nw4r/snd/snd_SoundArchiveLoader.h +++ b/include/nw4r/snd/snd_SoundArchiveLoader.h @@ -1,45 +1,60 @@ #ifndef NW4R_SND_SOUND_ARCHIVE_LOADER_H #define NW4R_SND_SOUND_ARCHIVE_LOADER_H -#include "common.h" -#include "snd_SoundMemoryAllocatable.h" -#include "ut_FileStream.h" -#include +#include +#include + +#include namespace nw4r { namespace snd { + +// Forward declarations +class SoundMemoryAllocatable; + namespace detail { -struct FileStreamHandle { - ut::FileStream *mFileStream; - inline FileStreamHandle(ut::FileStream *pFileStream) : mFileStream(pFileStream) {} +class FileStreamHandle { +public: + FileStreamHandle(ut::FileStream* pFileStream) : mStream(pFileStream) {} - inline ~FileStreamHandle() { - if (mFileStream) { - mFileStream->Close(); + ~FileStreamHandle() { + if (mStream != NULL) { + mStream->Close(); } } - inline operator bool() const { - return mFileStream; + ut::FileStream* GetFileStream() { + return mStream; } - inline ut::FileStream *operator->() { - return mFileStream; + ut::FileStream* operator->() { + return mStream; } -}; -struct SoundArchiveLoader { - OSMutex mMutex; // at 0x0 - const SoundArchive &mArchive; // at 0x18 - u8 mBuffer[0x200]; // at 0x1c - ut::FileStream *mFileStream; // at 0x21c + operator bool() const { + return mStream; + } - SoundArchiveLoader(const SoundArchive &); +private: + ut::FileStream* mStream; // at 0x0 +}; + +class SoundArchiveLoader { +public: + explicit SoundArchiveLoader(const SoundArchive& rArchive); ~SoundArchiveLoader(); - void *LoadGroup(u32, SoundMemoryAllocatable *, void **, u32); + void* LoadGroup(u32 id, SoundMemoryAllocatable* pAllocatable, + void** ppWaveBuffer, u32 blockSize); + +private: + mutable OSMutex mMutex; // at 0x0 + const SoundArchive& mArc; // at 0x18 + u8 mStreamArea[512]; // at 0x1C + ut::FileStream* mStream; // at 0x21C }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundArchivePlayer.h b/include/nw4r/snd/snd_SoundArchivePlayer.h index 50378b9c..6c776e7e 100644 --- a/include/nw4r/snd/snd_SoundArchivePlayer.h +++ b/include/nw4r/snd/snd_SoundArchivePlayer.h @@ -1,45 +1,223 @@ #ifndef NW4R_SND_SOUND_ARCHIVE_PLAYER_H #define NW4R_SND_SOUND_ARCHIVE_PLAYER_H -#include "common.h" -#include "snd_DisposeCallback.h" -#include "snd_SoundHandle.h" -#include "snd_SoundMemoryAllocatable.h" -#include "snd_SoundStartable.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace nw4r { namespace snd { -struct SoundArchivePlayer : detail::DisposeCallback, SoundStartable { + +// Forward declarations +namespace detail { +class SeqTrackAllocator; +} +class SoundMemoryAllocatable; +class SoundPlayer; + +class SoundArchivePlayer_FileManager { +public: + virtual const void* GetFileAddress(u32 id) = 0; // at 0x8 + virtual const void* GetFileWaveDataAddress(u32 id) = 0; // at 0x8 +}; + +class SoundArchivePlayer : public detail::DisposeCallback, + public SoundStartable { +public: SoundArchivePlayer(); - ~SoundArchivePlayer(); + virtual ~SoundArchivePlayer(); // at 0x8 + + virtual void InvalidateData(const void* pStart, + const void* pEnd); // at 0xC + + virtual void InvalidateWaveData(const void* pStart, + const void* pEnd); // at 0x10 + + virtual StartResult + detail_SetupSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, bool hold, + const StartInfo* pStartInfo); // at 0x28 + + virtual u32 detail_ConvertLabelStringToSoundId(const char* pLabel) { + return mSoundArchive->ConvertLabelStringToSoundId(pLabel); + } // at 0x2C bool IsAvailable() const; - bool Setup(const SoundArchive *, void *, u32, void *, u32); + + bool Setup(const SoundArchive* pArchive, void* pMramBuffer, + u32 mramBufferSize, void* pStrmBuffer, u32 strmBufferSize); void Shutdown(); - u32 GetRequiredMemSize(const SoundArchive *); - u32 GetRequiredStrmBufferSize(const SoundArchive *); + + u32 GetRequiredMemSize(const SoundArchive* pArchive); + u32 GetRequiredStrmBufferSize(const SoundArchive* pArchive); void Update(); - SoundArchive *GetSoundArchive() const; - SoundPlayer *GetSoundPlayer(u32); + const SoundArchive& GetSoundArchive() const; + + SoundPlayer& GetSoundPlayer(u32 i); + SoundPlayer& GetSoundPlayer(int i) { + return GetSoundPlayer(static_cast(i)); + } + + const void* detail_GetFileAddress(u32 id) const; + const void* detail_GetFileWaveDataAddress(u32 id) const; + + const void* GetGroupAddress(u32 id) const; + void SetGroupAddress(u32 id, const void* pAddr); + + const void* GetGroupWaveDataAddress(u32 id) const; + void SetGroupWaveDataAddress(u32 id, const void* pAddr); + + bool LoadGroup(u32 id, SoundMemoryAllocatable* pAllocatable, u32 blockSize); + bool LoadGroup(const char* pLabel, SoundMemoryAllocatable* pAllocatable, + u32 blockSize); + + bool LoadGroup(int id, SoundMemoryAllocatable* pAllocatable, + u32 blockSize) { + return LoadGroup(static_cast(id), pAllocatable, blockSize); + } + bool LoadGroup(unsigned int id, SoundMemoryAllocatable* pAllocatable, + u32 blockSize) { + return LoadGroup(static_cast(id), pAllocatable, blockSize); + } + + u32 GetSoundPlayerCount() const { + return mSoundPlayerCount; + } + + u32 GetFreeSeqSoundCount() const { + return mSeqSoundInstanceManager.GetFreeCount(); + } + u32 GetFreeStrmSoundCount() const { + return mStrmSoundInstanceManager.GetFreeCount(); + } + u32 GetFreeWaveSoundCount() const { + return mWaveSoundInstanceManager.GetFreeCount(); + } + +private: + struct Group { + const void* address; // at 0x0 + const void* waveDataAddress; // at 0x4 + }; - UNKWORD detail_SetupSound(SoundHandle *, u32, detail::BasicSound::AmbientArgInfo *, detail::ExternalSoundPlayer *, - bool, const StartInfo *); + typedef detail::Util::Table GroupTable; - UNKWORD LoadGroup(u32, SoundMemoryAllocatable *, u32); - UNKWORD LoadGroup(const char *, SoundMemoryAllocatable *, u32); + class SeqNoteOnCallback : public detail::NoteOnCallback { + public: + explicit SeqNoteOnCallback(const SoundArchivePlayer& rPlayer) + : mSoundArchivePlayer(rPlayer) {} - virtual void InvalidateData(const void *, const void *); - virtual void InvalidateWaveData(const void *, const void *); - virtual UNKWORD detail_ConvertLabelStringToSoundId(const char *); + virtual detail::Channel* + NoteOn(detail::SeqPlayer* pPlayer, int bankNo, + const detail::NoteOnInfo& rInfo); // at 0xC - char UNK_0x4[0x8]; - SoundHandle mHandle; // at 0xC - char UNK_0x1C[0x14]; - u32 WORD_0x30; - char UNK_0x34[0xAC]; + private: + const SoundArchivePlayer& mSoundArchivePlayer; // at 0x0 + }; + + class WsdCallback : public detail::WsdPlayer::WsdCallback { + public: + explicit WsdCallback(const SoundArchivePlayer& rPlayer) + : mSoundArchivePlayer(rPlayer) {} + + virtual bool GetWaveSoundData(detail::WaveSoundInfo* pSoundInfo, + detail::WaveSoundNoteInfo* pNoteInfo, + detail::WaveData* pWaveData, + const void* pWsdData, int index, + int noteIndex, + u32 callbackArg) const; // at 0xC + + private: + const SoundArchivePlayer& mSoundArchivePlayer; // at 0x0 + }; + +private: + bool SetupMram(const SoundArchive* pArchive, void* pBuffer, u32 bufferSize); + + detail::PlayerHeap* CreatePlayerHeap(void* pBuffer, u32 bufferSize); + + bool SetupSoundPlayer(const SoundArchive* pArchive, void** ppBuffer, + void* pEnd); + + bool CreateGroupAddressTable(const SoundArchive* pArchive, void** ppBuffer, + void* pEnd); + + bool SetupSeqSound(const SoundArchive* pArchive, int sounds, + void** ppBuffer, void* pEnd); + bool SetupWaveSound(const SoundArchive* pArchive, int sounds, + void** ppBuffer, void* pEnd); + bool SetupStrmSound(const SoundArchive* pArchive, int sounds, + void** ppBuffer, void* pEnd); + bool SetupSeqTrack(const SoundArchive* pArchive, int tracks, + void** ppBuffer, void* pEnd); + bool SetupStrmBuffer(const SoundArchive* pArchive, void* pBuffer, + u32 bufferSize); + + StartResult + PrepareSeqImpl(detail::SeqSound* pSound, + const SoundArchive::SoundInfo* pSndInfo, + const SoundArchive::SeqSoundInfo* pSeqInfo, + SoundStartable::StartInfo::StartOffsetType startType, + int startOffset, int voices); + + StartResult + PrepareStrmImpl(detail::StrmSound* pSound, + const SoundArchive::SoundInfo* pSndInfo, + const SoundArchive::StrmSoundInfo* pStrmInfo, + SoundStartable::StartInfo::StartOffsetType startType, + int startOffset, int voices); + + StartResult + PrepareWaveSoundImpl(detail::WaveSound* pSound, + const SoundArchive::SoundInfo* pSndInfo, + const SoundArchive::WaveSoundInfo* pWsdInfo, + SoundStartable::StartInfo::StartOffsetType startType, + int startOffset, int voices); + +private: + const SoundArchive* mSoundArchive; // at 0x10 + GroupTable* mGroupTable; // at 0x14 + SoundArchivePlayer_FileManager* mFileManager; // at 0x18 + + detail::SeqTrackAllocator* mSeqTrackAllocator; // at 0x1C + SeqNoteOnCallback mSeqCallback; // at 0x20 + WsdCallback mWsdCallback; // at 0x28 + + u32 mSoundPlayerCount; // at 0x30 + SoundPlayer* mSoundPlayers; // at 0x34 + + detail::SoundInstanceManager + mSeqSoundInstanceManager; // at 0x38 + + detail::SoundInstanceManager + mStrmSoundInstanceManager; // at 0x60 + + detail::SoundInstanceManager + mWaveSoundInstanceManager; // at 0x88 + + detail::MmlSeqTrackAllocator mMmlSeqTrackAllocator; // at 0xB0 + detail::StrmBufferPool mStrmBufferPool; // at 0xBC + detail::MmlParser mMmlParser; // at 0xD4 + + void* mSetupBufferAddress; // at 0xD8 + u32 mSetupBufferSize; // at 0xDC }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundHandle.h b/include/nw4r/snd/snd_SoundHandle.h index 7ded3e2f..f616781b 100644 --- a/include/nw4r/snd/snd_SoundHandle.h +++ b/include/nw4r/snd/snd_SoundHandle.h @@ -1,41 +1,110 @@ #ifndef NW4R_SND_SOUND_HANDLE_H #define NW4R_SND_SOUND_HANDLE_H -#include "common.h" -#include "snd_BasicSound.h" +#include + +#include + +#include namespace nw4r { namespace snd { -struct SoundHandle { - detail::BasicSound *mSound; // at 0x0 - void detail_AttachSound(detail::BasicSound *); - void detail_AttachSoundAsTempHandle(detail::BasicSound *); - void DetachSound(); +class SoundHandle : private ut::NonCopyable { +public: + SoundHandle() : mSound(NULL) {} + ~SoundHandle() { + DetachSound(); + } - inline SoundHandle() : mSound(NULL) {} + void detail_AttachSound(detail::BasicSound* pSound); + void detail_AttachSoundAsTempHandle(detail::BasicSound* pSound); - inline ~SoundHandle() { - DetachSound(); + bool IsAttachedSound() const { + return mSound != NULL; } - inline detail::BasicSound *detail_GetAttachedSound() { + detail::BasicSound* detail_GetAttachedSound() { return mSound; } - inline bool IsAttachedSound() const { - return mSound != NULL; + void DetachSound(); + + bool IsPrepared() const { + if (IsAttachedSound()) { + return mSound->IsPrepared(); + } + + return false; } - inline void StartPrepared() { + u32 GetId() const { + if (IsAttachedSound()) { + return mSound->GetId(); + } + + return -1; + } + + void StartPrepared() { if (IsAttachedSound()) { mSound->StartPrepared(); } } + void Stop(int frames) { + if (IsAttachedSound()) { + mSound->Stop(frames); + } + } + + void Pause(bool flag, int frames) { + if (IsAttachedSound()) { + mSound->Pause(flag, frames); + } + } - inline u32 GetId() const { - return IsAttachedSound() ? mSound->GetId() : -1; + void SetVolume(f32 volume, int frames) { + if (IsAttachedSound()) { + mSound->SetVolume(volume, frames); + } } + void SetPan(f32 pan) { + if (IsAttachedSound()) { + mSound->SetPan(pan); + } + } + void SetPitch(f32 pitch) { + if (IsAttachedSound()) { + mSound->SetPitch(pitch); + } + } + + void SetOutputLine(int flag) { + if (IsAttachedSound()) { + mSound->SetOutputLine(flag); + } + } + + void SetMainOutVolume(f32 volume) { + if (IsAttachedSound()) { + mSound->SetMainOutVolume(volume); + } + } + void SetRemoteOutVolume(int remote, f32 volume) { + if (IsAttachedSound()) { + mSound->SetRemoteOutVolume(remote, volume); + } + } + + void SetFxSend(AuxBus bus, f32 send) { + if (IsAttachedSound()) { + mSound->SetFxSend(bus, send); + } + } + +private: + detail::BasicSound* mSound; // at 0x0 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundHeap.h b/include/nw4r/snd/snd_SoundHeap.h index 7c809994..1b399f2c 100644 --- a/include/nw4r/snd/snd_SoundHeap.h +++ b/include/nw4r/snd/snd_SoundHeap.h @@ -1,31 +1,58 @@ #ifndef NW4R_SND_SOUND_HEAP_H #define NW4R_SND_SOUND_HEAP_H -#include "common.h" -#include "snd_FrameHeap.h" -#include "snd_SoundMemoryAllocatable.h" -#include +#include + +#include +#include + +#include + +#include namespace nw4r { namespace snd { -struct SoundHeap : SoundMemoryAllocatable { + +class SoundHeap : public SoundMemoryAllocatable { +public: SoundHeap(); - virtual ~SoundHeap(); // VMT 0x8 - bool Create(void *, u32); + virtual ~SoundHeap(); // at 0x8 + + virtual void* Alloc(u32 size); // at 0xC + + void* Alloc(u32 size, detail::FrameHeap::FreeCallback pCallback, + void* pCallbackArg); + + bool Create(void* pBase, u32 size); void Destroy(); - virtual void *Alloc(u32); // VMT 0xC - void *Alloc(u32, detail::FrameHeap::AllocCallback, void *); + void Clear(); + int SaveState(); - void LoadState(int); - static void DisposeCallbackFunc(void *, u32, void *); + void LoadState(int id); bool IsValid() { - return mFrameHeap.PTR_0x0 != NULL; + return mFrameHeap.IsValid(); + } + + int GetCurrentLevel() const { + ut::detail::AutoLock lock(mMutex); + return mFrameHeap.GetCurrentLevel(); } - OSMutex mMutex; // 0x00 - detail::FrameHeap mFrameHeap; // 0x1C + u32 GetFreeSize() const { + ut::detail::AutoLock lock(mMutex); + return mFrameHeap.GetFreeSize(); + } + +private: + static void DisposeCallbackFunc(void* pBuffer, u32 size, + void* pCallbackArg); + +private: + mutable OSMutex mMutex; // at 0x0 + detail::FrameHeap mFrameHeap; // at 0x1C }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundInstanceManager.h b/include/nw4r/snd/snd_SoundInstanceManager.h index 0786dbd2..fab721a9 100644 --- a/include/nw4r/snd/snd_SoundInstanceManager.h +++ b/include/nw4r/snd/snd_SoundInstanceManager.h @@ -1,55 +1,142 @@ #ifndef NW4R_SND_SOUND_INSTANCE_MANAGER_H #define NW4R_SND_SOUND_INSTANCE_MANAGER_H -#include "snd_InstancePool.h" -#include "ut_LinkList.h" -#include "ut_lock.h" -#include #include "common.h" +#include +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { -template -struct SoundInstanceManager { - MemoryPool mPool; // at 0x0 - ut::LinkList mPriorityList; // at 0x4 - OSMutex mMutex; // at 0x10 - inline void Free(T *pInstance) { +template class SoundInstanceManager { +private: + NW4R_UT_LIST_TYPEDEF_DECL_EX(T, Prio); + +public: + SoundInstanceManager() { + OSInitMutex(&mMutex); + } + + u32 Create(void* pBuffer, u32 size) { + ut::detail::AutoLock lock(mMutex); + return mPool.Create(pBuffer, size); + } + + void Destroy(void* pBuffer, u32 size) { + ut::detail::AutoLock lock(mMutex); + mPool.Destroy(pBuffer, size); + } + + T* Alloc(int priority) { + ut::detail::AutoLock lock(mMutex); + T* pSound = NULL; + + while (pSound == NULL) { + void* pBuffer = mPool.Alloc(); + + if (pBuffer != NULL) { + pSound = new (pBuffer) T(this); + } else { + T* pLowest = GetLowestPrioritySound(); + + if (pLowest == NULL) { + return NULL; + } + + if (priority < pLowest->CalcCurrentPlayerPriority()) { + return NULL; + } + + OSUnlockMutex(&mMutex); + pLowest->Stop(0); + OSLockMutex(&mMutex); + } + } + + InsertPriorityList(pSound, priority); + return pSound; + } + + void Free(T* pSound) { ut::detail::AutoLock lock(mMutex); if (mPriorityList.IsEmpty()) { return; } - mPriorityList.Erase(pInstance); - mPool.Free(pInstance); + RemovePriorityList(pSound); + pSound->~T(); + mPool.Free(pSound); + } + + u32 GetActiveCount() const { + return mPriorityList.GetSize(); + } + + u32 GetFreeCount() const { + return mPool.Count(); } - inline void InsertPriorityList(T *pInstance, int priority) { - ut::LinkList::Iterator iter = mPriorityList.GetBeginIter(); - int curPriority; + T* GetLowestPrioritySound() { + if (mPriorityList.IsEmpty()) { + return NULL; + } - while (iter != mPriorityList.GetEndIter()) { - curPriority = iter->CalcCurrentPlayerPriority(); + return static_cast(&mPriorityList.GetFront()); + } - if (priority < curPriority) { + void InsertPriorityList(T* pSound, int priority) { + TPrioList::Iterator it = mPriorityList.GetBeginIter(); + + for (; it != mPriorityList.GetEndIter(); ++it) { + if (priority < it->CalcCurrentPlayerPriority()) { break; } + } - iter++; + mPriorityList.Insert(it, pSound); + } + + void RemovePriorityList(T* pSound) { + mPriorityList.Erase(pSound); + } + + void SortPriorityList() { + TPrioList listsByPrio[T::PRIORITY_MAX + 1]; + ut::detail::AutoLock lock(mMutex); + + while (!mPriorityList.IsEmpty()) { + T& rSound = mPriorityList.GetFront(); + mPriorityList.PopFront(); + listsByPrio[rSound.CalcCurrentPlayerPriority()].PushBack(&rSound); } - mPriorityList.Insert(iter, pInstance); + for (int i = 0; i < T::PRIORITY_MAX + 1; i++) { + while (!listsByPrio[i].IsEmpty()) { + T& rSound = listsByPrio[i].GetFront(); + listsByPrio[i].PopFront(); + mPriorityList.PushBack(&rSound); + } + } } - inline void UpdatePriority(T *pInstance, int priority) { + void UpdatePriority(T* pSound, int priority) { ut::detail::AutoLock lock(mMutex); - mPriorityList.Erase(pInstance); - InsertPriorityList(pInstance, priority); + RemovePriorityList(pSound); + InsertPriorityList(pSound, priority); } + +private: + MemoryPool mPool; // at 0x0 + TPrioList mPriorityList; // at 0x4 + mutable OSMutex mMutex; // at 0x10 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundMemoryAllocatable.h b/include/nw4r/snd/snd_SoundMemoryAllocatable.h index b9701464..ae51eb9d 100644 --- a/include/nw4r/snd/snd_SoundMemoryAllocatable.h +++ b/include/nw4r/snd/snd_SoundMemoryAllocatable.h @@ -1,13 +1,17 @@ -#ifndef NW4R_SOUND_MEMORY_ALLOCATABLE_H -#define NW4R_SOUND_MEMORY_ALLOCATABLE_H -#include "common.h" +#ifndef NW4R_SND_SOUND_MEMORY_ALLOCATABLE_H +#define NW4R_SND_SOUND_MEMORY_ALLOCATABLE_H +#include namespace nw4r { namespace snd { -struct SoundMemoryAllocatable { + +class SoundMemoryAllocatable { +public: virtual ~SoundMemoryAllocatable() {} // at 0x8 - virtual void *Alloc(u32) = 0; // at 0xc + + virtual void* Alloc(u32 size) = 0; // at 0xC }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundPlayer.h b/include/nw4r/snd/snd_SoundPlayer.h index ec55a461..540b7722 100644 --- a/include/nw4r/snd/snd_SoundPlayer.h +++ b/include/nw4r/snd/snd_SoundPlayer.h @@ -1,35 +1,123 @@ #ifndef NW4R_SND_SOUND_PLAYER_H #define NW4R_SND_SOUND_PLAYER_H -#include "common.h" +#include + +#include +#include + +#include +#include namespace nw4r { namespace snd { + +// Forward declarations +namespace detail { +class ExternalSoundPlayer; +class SeqSound; +class StrmSound; +class WaveSound; +template class SoundInstanceManager; +} // namespace detail + class SoundPlayer { public: + SoundPlayer(); + ~SoundPlayer(); + + void InitParam(); + void Update(); + + void StopAllSound(int frames); + void PauseAllSound(bool flag, int frames); + + void SetVolume(f32 volume); + + int detail_GetOutputLine() const; + bool detail_IsEnabledOutputLine() const; + + f32 detail_GetRemoteOutVolume(int i) const; + + void detail_InsertSoundList(detail::BasicSound* pSound); + void detail_RemoveSoundList(detail::BasicSound* pSound); + + void detail_InsertPriorityList(detail::BasicSound* pSound); + void detail_RemovePriorityList(detail::BasicSound* pSound); + + void detail_SortPriorityList(); + + detail::SeqSound* detail_AllocSeqSound( + int priority, int startPriority, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pExtPlayer, u32 id, + detail::SoundInstanceManager* pManager); + + detail::StrmSound* detail_AllocStrmSound( + int priority, int startPriority, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pExtPlayer, u32 id, + detail::SoundInstanceManager* pManager); + + detail::WaveSound* detail_AllocWaveSound( + int priority, int startPriority, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pExtPlayer, u32 id, + detail::SoundInstanceManager* pManager); + + int CalcPriorityReduction(detail::BasicSound::AmbientArgInfo* pArgInfo, + u32 id); + + void InitAmbientArg(detail::BasicSound* pSound, + detail::BasicSound::AmbientArgInfo* pArgInfo); + + void SetPlayableSoundCount(int count); + void detail_SetPlayableSoundLimit(int limit); + + bool CheckPlayableSoundCount(int startPriority, + detail::ExternalSoundPlayer* pExtPlayer); + + void detail_AppendPlayerHeap(detail::PlayerHeap* pHeap); + detail::PlayerHeap* detail_AllocPlayerHeap(detail::BasicSound* pSound); + void detail_FreePlayerHeap(detail::BasicSound* pSound); + + int GetPlayingSoundCount() const { + return mSoundList.GetSize(); + } + int GetPlayableSoundCount() const { + return mPlayableCount; + } + f32 GetVolume() const { return mVolume; } + + detail::BasicSound* detail_GetLowestPrioritySound() { + // @bug UB when the list is empty + return &mPriorityList.GetFront(); + } + f32 detail_GetMainOutVolume() const { return mMainOutVolume; } - void StopAllSound(int); +private: + detail::BasicSoundPlayerPlayList mSoundList; // at 0x0 + detail::BasicSoundPlayerPrioList mPriorityList; // at 0xC + detail::PlayerHeapList mHeapList; // at 0x18 - bool detail_IsEnabledOutputLine() const; - int detail_GetOutputLine() const; - f32 detail_GetRemoteOutVolume(int) const; - UNKTYPE detail_FreePlayerHeap(detail::BasicSound *); - UNKTYPE detail_InsertPriorityList(detail::BasicSound *); - UNKTYPE detail_RemoveSoundList(detail::BasicSound *); - UNKTYPE detail_RemovePriorityList(detail::BasicSound *); + u16 mPlayableCount; // at 0x24 + u16 mPlayableLimit; // at 0x26 -private: - char UNK_0x0[0x28]; - f32 mVolume; // at 0x28 - bool mEnableOutputLine; // at 0x2C - int mOutputLine; // at 0x30 - f32 mMainOutVolume; // at 0x34 + f32 mVolume; // at 0x28 + bool mOutputLineFlagEnable; // at 0x2C + bool mUsePlayerHeap; // at 0x2D + int mOutputLineFlag; // at 0x30 + f32 mMainOutVolume; // at 0x34 + f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0x38 + + mutable OSMutex mMutex; // at 0x48 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundStartable.h b/include/nw4r/snd/snd_SoundStartable.h index 99c9f700..71f701bd 100644 --- a/include/nw4r/snd/snd_SoundStartable.h +++ b/include/nw4r/snd/snd_SoundStartable.h @@ -1,30 +1,125 @@ #ifndef NW4R_SND_SOUND_STARTABLE_H #define NW4R_SND_SOUND_STARTABLE_H -#include "common.h" -#include "snd_BasicSound.h" +#include +#include namespace nw4r { namespace snd { -struct SoundStartable { - struct StartInfo {}; - inline SoundStartable() {} - inline virtual ~SoundStartable() {} // at 0x8 - virtual UNKWORD detail_SetupSound(SoundHandle *, u32, detail::BasicSound::AmbientArgInfo *, - detail::ExternalSoundPlayer *, bool, - const StartInfo *) = 0; // at 0xc - virtual UNKWORD detail_ConvertLabelStringToSoundId(const char *) = 0; // at 0x10 +// Forward declarations +class SoundHandle; +namespace detail { +class ExternalSoundPlayer; +} - UNKWORD detail_StartSound(SoundHandle *, u32, detail::BasicSound::AmbientArgInfo *, detail::ExternalSoundPlayer *, - const StartInfo *); +class SoundStartable { +public: + enum StartResult { + START_SUCCESS, + START_ERR_LOW_PRIORITY, + START_ERR_INVALID_LABEL_STRING, + START_ERR_INVALID_SOUNDID, + START_ERR_NOT_DATA_LOADED, + START_ERR_NOT_ENOUGH_PLAYER_HEAP, + START_ERR_CANNOT_OPEN_FILE, + START_ERR_NOT_AVAILABLE, + START_ERR_CANNOT_ALLOCATE_TRACK, + START_ERR_NOT_ENOUGH_INSTANCE, + START_ERR_INVALID_PARAMETER, + START_ERR_INVALID_SEQ_START_LOCATION_LABEL, - UNKWORD detail_HoldSound(SoundHandle *, u32, detail::BasicSound::AmbientArgInfo *, detail::ExternalSoundPlayer *, - const StartInfo *); + START_ERR_USER = 128, + START_ERR_UNKNOWN = 255, + }; - UNKWORD detail_PrepareSound(SoundHandle *, u32, detail::BasicSound::AmbientArgInfo *, detail::ExternalSoundPlayer *, - const StartInfo *); + struct StartInfo { + enum EnableFlag { + ENABLE_START_OFFSET = (1 << 0), + ENABLE_PLAYER_ID = (1 << 1), + ENABLE_PLAYER_PRIORITY = (1 << 2) + }; + + enum StartOffsetType { + START_OFFSET_TYPE_MILLISEC, + START_OFFSET_TYPE_TICK, + START_OFFSET_TYPE_SAMPLE + }; + + u32 enableFlag; // at 0x0 + StartOffsetType startOffsetType; // at 0x4 + int startOffset; // at 0x8 + u32 playerId; // at 0xC + int playerPriority; // at 0x10 + int voiceOutCount; // at 0x14 + }; + +public: + virtual ~SoundStartable() {} // at 0x8 + + virtual StartResult + detail_SetupSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, bool hold, + const StartInfo* pStartInfo) = 0; // at 0xC + + virtual u32 + detail_ConvertLabelStringToSoundId(const char* pLabel) = 0; // at 0x10 + + bool StartSound(SoundHandle* pHandle, u32 id) { + return detail_StartSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + bool StartSound(SoundHandle* pHandle, unsigned int id) { + return detail_StartSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + bool StartSound(SoundHandle* pHandle, int id) { + return detail_StartSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + + bool HoldSound(SoundHandle* pHandle, u32 id) { + return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + } + bool HoldSound(SoundHandle* pHandle, unsigned int id) { + return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + } + bool HoldSound(SoundHandle* pHandle, int id) { + return detail_HoldSound(pHandle, id, NULL, NULL, NULL) == START_SUCCESS; + } + + bool PrepareSound(SoundHandle* pHandle, u32 id) { + return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + bool PrepareSound(SoundHandle* pHandle, unsigned int id) { + return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + bool PrepareSound(SoundHandle* pHandle, int id) { + return detail_PrepareSound(pHandle, id, NULL, NULL, NULL) == + START_SUCCESS; + } + +private: + StartResult detail_StartSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, + const StartInfo* pStartInfo); + + StartResult detail_HoldSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, + const StartInfo* pStartInfo); + + StartResult + detail_PrepareSound(SoundHandle* pHandle, u32 id, + detail::BasicSound::AmbientArgInfo* pArgInfo, + detail::ExternalSoundPlayer* pPlayer, + const StartInfo* pStartInfo); }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundSystem.h b/include/nw4r/snd/snd_SoundSystem.h index 4aa4da4c..ca8c8c22 100644 --- a/include/nw4r/snd/snd_SoundSystem.h +++ b/include/nw4r/snd/snd_SoundSystem.h @@ -1,27 +1,76 @@ #ifndef NW4R_SND_SOUND_SYSTEM_H #define NW4R_SND_SOUND_SYSTEM_H -#include "common.h" -#include "snd_AxManager.h" +#include + +#include +#include +#include namespace nw4r { namespace snd { -struct SoundSystem { - struct SoundSystemParam {}; - static inline f32 GetMasterVolume() { +class SoundSystem { +public: + struct SoundSystemParam { + s32 soundThreadPriority; // at 0x0 + u32 soundThreadStackSize; // at 0x4 + s32 dvdThreadPriority; // at 0x8 + u32 dvdThreadStackSize; // at 0xC + + SoundSystemParam() + : soundThreadPriority(DEFAULT_SOUND_THREAD_PRIORITY), + soundThreadStackSize(DEFAULT_SOUND_THREAD_STACK_SIZE), + dvdThreadPriority(DEFAULT_DVD_THREAD_PRIORITY), + dvdThreadStackSize(DEFAULT_DVD_THREAD_STACK_SIZE) {} + }; + +public: + static void InitSoundSystem(s32 soundThreadPrio, s32 dvdThreadPriority); + static u32 GetRequiredMemSize(const SoundSystemParam& rParam); + + static void InitSoundSystem(const SoundSystemParam& rParam, void* pWork, + u32 workSize); + + static void ShutdownSoundSystem(); + static void WaitForResetReady(); + + static void PrepareReset() { + detail::AxManager::GetInstance().PrepareReset(); + } + + static void SetOutputMode(OutputMode mode) { + detail::AxManager::GetInstance().SetOutputMode(mode); + } + + static f32 GetMasterVolume() { return detail::AxManager::GetInstance().GetMasterVolume(); } + static void SetMasterVolume(f32 volume, int frame) { + detail::AxManager::GetInstance().SetMasterVolume(volume, frame); + } - static inline void PrepareReset() { - detail::AxManager::GetInstance().PrepareReset(); + static RemoteSpeaker& GetRemoteSpeaker(int i) { + return detail::RemoteSpeakerManager::GetInstance().GetRemoteSpeaker(i); } - void InitSoundSystem(s32, s32); - void InitSoundSystem(const SoundSystemParam &, void *, u32); - static void ShutdownSoundSystem(); - static void WaitForResetReady(); - UNKWORD GetRequiredMemSize(const SoundSystemParam &); + static void AppendEffect(AuxBus bus, FxBase* pFx) { + detail::AxManager::GetInstance().AppendEffect(bus, pFx); + } + static void ClearEffect(AuxBus bus, int frame) { + detail::AxManager::GetInstance().ClearEffect(bus, frame); + } + +private: + static const int DEFAULT_DVD_THREAD_PRIORITY = 3; + static const int DEFAULT_DVD_THREAD_STACK_SIZE = 0x4000; + + static const int DEFAULT_SOUND_THREAD_PRIORITY = 4; + static const int DEFAULT_SOUND_THREAD_STACK_SIZE = 0x4000; + +private: + static detail::TaskThread sTaskThread; }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SoundThread.h b/include/nw4r/snd/snd_SoundThread.h index 5e5699a9..45eaba8a 100644 --- a/include/nw4r/snd/snd_SoundThread.h +++ b/include/nw4r/snd/snd_SoundThread.h @@ -1,49 +1,81 @@ #ifndef NW4R_SND_SOUND_THREAD_H #define NW4R_SND_SOUND_THREAD_H -#include "common.h" -#include "snd_AxManager.h" -#include "ut_LinkList.h" -#include -#include -#include +#include +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { + class SoundThread { + friend class AutoLock; // Prevent locking without AutoLock + public: - struct SoundThreadCallback { - ut::LinkListNode mNode; // at 0x0 + class SoundFrameCallback { + public: + NW4R_UT_LIST_NODE_DECL(); // at 0x0 - inline virtual ~SoundThreadCallback() {} // at 0x8 - inline virtual void VF_0xC() {} // at 0xC - inline virtual void VF_0x10() {} // at 0x10 + virtual ~SoundFrameCallback() {} // at 0x8 + virtual void OnBeginSoundFrame() {} // at 0xC + virtual void OnEndSoundFrame() {} // at 0x10 }; - struct PlayerCallback { - ut::LinkListNode mNode; // at 0x0 + NW4R_UT_LIST_TYPEDEF_DECL(SoundFrameCallback); - inline virtual ~PlayerCallback() {} // at 0x8 - inline virtual void OnUpdateFrameSoundThread() {} // at 0xc - inline virtual void OnUpdateVoiceSoundThread() {} // at 0x10 - inline virtual void OnShutdownSoundThread() {} // at 0x14 + class PlayerCallback { + public: + NW4R_UT_LIST_NODE_DECL(); // at 0x0 + + virtual ~PlayerCallback() {} // at 0x8 + virtual void OnUpdateFrameSoundThread() {} // at 0xC + virtual void OnUpdateVoiceSoundThread() {} // at 0x10 + virtual void OnShutdownSoundThread() {} // at 0x14 }; - struct AutoLock { - inline AutoLock() { - GetInstance()->Lock(); + NW4R_UT_LIST_TYPEDEF_DECL(PlayerCallback); + + class AutoLock : private ut::NonCopyable { + public: + AutoLock() { + SoundThread::GetInstance().Lock(); } - inline ~AutoLock() { - GetInstance()->Unlock(); + + ~AutoLock() { + SoundThread::GetInstance().Unlock(); } }; public: - static SoundThread *GetInstance(); + static SoundThread& GetInstance(); + + bool Create(s32 priority, void* pStack, u32 stackSize); + void Shutdown(); + + void RegisterPlayerCallback(PlayerCallback* pCallback); + void UnregisterPlayerCallback(PlayerCallback* pCallback); + +private: + enum ThreadMessage { + MSG_NONE, + MSG_AX_CALLBACK, + MSG_SHUTDOWN, + }; + + static const int MSG_QUEUE_CAPACITY = 4; +private: SoundThread(); - ~SoundThread() {} + + static void AxCallbackFunc(); + void AxCallbackProc(); + + static void* SoundThreadFunc(void* pArg); + void SoundThreadProc(); void Lock() { OSLockMutex(&mMutex); @@ -52,29 +84,22 @@ class SoundThread { OSUnlockMutex(&mMutex); } - bool Create(s32, void *, u32); - void Shutdown(); - static void AxCallbackFunc(); - void AxCallbackProc(); - static void *SoundThreadFunc(void *); - void RegisterPlayerCallback(PlayerCallback *); - void UnregisterPlayerCallback(PlayerCallback *); - void SoundThreadProc(); - private: - OSThread mThread; // at 0x0 - OSThreadQueue mThreadQueue; // at 0x318 - OSMessageQueue mMesgQueue; // at 0x320 - OSMessage mMesgBuffer; // at 0x340 - char UNK_0x344[0x350 - 0x344]; - void *mStackEnd; // at 0x350 - OSMutex mMutex; // at 0x354 - AxManager::CallbackListNode mAxNode; // at 0x36C - ut::LinkList mThreadCbList; // at 0x378 - ut::LinkList mPlayerCbList; // at 0x384 - s32 mLastUpdateTime; // at 0x390 - bool mIsCreated; // at 0x394 + OSThread mThread; // at 0x0 + OSThreadQueue mThreadQueue; // at 0x318 + OSMessageQueue mMsgQueue; // at 0x320 + OSMessage mMsgBuffer[MSG_QUEUE_CAPACITY]; // at 0x340 + void* mStackEnd; // at 0x350 + mutable OSMutex mMutex; // at 0x354 + + AxManager::CallbackListNode mAxCallbackNode; // at 0x36C + SoundFrameCallbackList mSoundFrameCallbackList; // at 0x378 + PlayerCallbackList mPlayerCallbackList; // at 0x384 + + u32 mProcessTick; // at 0x390 + bool mCreateFlag; // at 0x394 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_StrmChannel.h b/include/nw4r/snd/snd_StrmChannel.h index ab6e3fb0..9d31a4ae 100644 --- a/include/nw4r/snd/snd_StrmChannel.h +++ b/include/nw4r/snd/snd_StrmChannel.h @@ -1,25 +1,46 @@ -#ifndef NW4R_SND_STRMCHANNEL_H -#define NW4R_SND_STRMCHANNEL_H -#include "common.h" +#ifndef NW4R_SND_STRM_CHANNEL_H +#define NW4R_SND_STRM_CHANNEL_H +#include -#define BLOCK_MAX 0x20 +#include namespace nw4r { namespace snd { namespace detail { -struct StrmBufferPool { - void Setup(void *, u32, int); + +struct StrmChannel { + void* bufferAddress; // at 0x0 + u32 bufferSize; // at 0x4 + AdpcmInfo adpcmInfo; // at 0x8 +}; + +class StrmBufferPool { +public: + void Setup(void* pBase, u32 size, int count); void Shutdown(); - void *Alloc(); - void Free(void *); - - void *mBuffer; // at 0x0 - u32 mStrmBufferSize; // at 0x4 - u32 mBlockSize; // at 0x8 - s32 mBlockCount; // at 0xC (< BLOCK_MAX) - s32 mAllocCount; // at 0x10 - u8 mAllocFlags[4]; // at 0x14 (1 bit per block) + + void* Alloc(); + void Free(void* pBuffer); + + u32 GetBlockSize() const { + return mBlockSize; + } + +private: + static const int BLOCK_MAX = 32; + static const int BITS_PER_BYTE = 8; + +private: + void* mBuffer; // at 0x0 + u32 mBufferSize; // at 0x4 + + u32 mBlockSize; // at 0x8 + int mBlockCount; // at 0xC + + int mAllocCount; // at 0x10 + u8 mAllocFlags[BLOCK_MAX / BITS_PER_BYTE]; // at 0x14 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_StrmFile.h b/include/nw4r/snd/snd_StrmFile.h new file mode 100644 index 00000000..a4f47eb3 --- /dev/null +++ b/include/nw4r/snd/snd_StrmFile.h @@ -0,0 +1,161 @@ +#ifndef NW4R_SND_STRM_FILE_H +#define NW4R_SND_STRM_FILE_H +#include + +#include +#include + +#include + +namespace nw4r { +namespace snd { +namespace detail { +namespace StrmFile { + +struct StrmDataInfo { + u8 format; // at 0x0 + u8 loopFlag; // at 0x1 + u8 numChannels; // at 0x2 + u8 sampleRate24; // at 0x3 + u16 sampleRate; // at 0x4 + u16 blockHeaderOffset; // at 0x6 + u32 loopStart; // at 0x8 + u32 loopEnd; // at 0xC + u32 dataOffset; // at 0x10 + u32 numBlocks; // at 0x14 + u32 blockSize; // at 0x18 + u32 blockSamples; // at 0x1C + u32 lastBlockSize; // at 0x20 + u32 lastBlockSamples; // at 0x24 + u32 lastBlockPaddedSize; // at 0x28 + u32 adpcmDataInterval; // at 0x2C + u32 adpcmDataSize; // at 0x30 +}; + +struct TrackInfo { + u8 channelCount; // at 0x0 + u8 channelIndexTable[]; // at 0x1 +}; + +struct TrackTable { + u8 trackCount; // at 0x0 + u8 trackDataType; // at 0x1 + Util::DataRef refTrackHeader[]; // at 0x4 +}; + +struct ChannelInfo { + Util::DataRef refAdpcmInfo; // at 0x0 +}; + +struct ChannelTable { + u8 channelCount; // at 0x0 + Util::DataRef refChannelHeader[]; // at 0x4 +}; + +struct Header { + ut::BinaryFileHeader fileHeader; // at 0x0 + u32 headBlockOffset; // at 0x10 + u32 headBlockSize; // at 0x14 + u32 adpcBlockOffset; // at 0x18 + u32 adpcBlockSize; // at 0x1C + u32 dataBlockOffset; // at 0x20 + u32 dataBlockSize; // at 0x24 +}; + +struct HeadBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + Util::DataRef refDataHeader; // at 0x8 + Util::DataRef refTrackTable; // at 0x10 + Util::DataRef refChannelTable; // at 0x18 +}; + +} // namespace StrmFile + +struct StrmInfo { + u8 format; // at 0x0 + u8 loopFlag; // at 0x1 + u8 numChannels; // at 0x2 + int sampleRate; // at 0x4 + u16 blockHeaderOffset; // at 0x8 + u32 loopStart; // at 0xC + u32 loopEnd; // at 0x10 + u32 dataOffset; // at 0x14 + u32 numBlocks; // at 0x18 + u32 blockSize; // at 0x1C + u32 blockSamples; // at 0x20 + u32 lastBlockSize; // at 0x24 + u32 lastBlockSamples; // at 0x28 + u32 lastBlockPaddedSize; // at 0x2C + u32 adpcmDataInterval; // at 0x30 + u32 adpcmDataSize; // at 0x34 +}; + +class StrmFileReader { +public: + static const u32 SIGNATURE = 'RSTM'; + static const int VERSION = NW4R_VERSION(1, 0); + +public: + StrmFileReader(); + + bool IsAvailable() const { + return mHeader != NULL; + } + + bool IsValidFileHeader(const void* pStrmBin); + void Setup(const void* pStrmBin); + + bool ReadStrmInfo(StrmInfo* pStrmInfo) const; + bool ReadAdpcmInfo(AdpcmInfo* pAdpcmInfo, int channels) const; + + u32 GetAdpcBlockOffset() const { + if (IsAvailable()) { + return mHeader->adpcBlockOffset; + } + + return 0; + } + +private: + const StrmFile::Header* mHeader; // at 0x0 + const StrmFile::HeadBlock* mHeadBlock; // at 0x4 +}; + +class StrmFileLoader { +public: + explicit StrmFileLoader(ut::FileStream& rFileStream) + : mStream(rFileStream) {} + + bool LoadFileHeader(void* pStrmBin, u32 size); + bool ReadAdpcBlockData(u16* pYN1, u16* pYN2, int block, int channels); + + bool ReadStrmInfo(StrmInfo* pStrmInfo) const { + if (!mReader.IsAvailable()) { + return false; + } + + return mReader.ReadStrmInfo(pStrmInfo); + } + + bool ReadAdpcmInfo(AdpcmInfo* pAdpcmInfo, int channel) const { + if (!mReader.IsAvailable()) { + return false; + } + + return mReader.ReadAdpcmInfo(pAdpcmInfo, channel); + } + +private: + static const int HEADER_ALIGNED_SIZE = + ROUND_UP(sizeof(StrmFile::Header), 32); + +private: + ut::FileStream& mStream; // at 0x0 + StrmFileReader mReader; // at 0x4 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_StrmPlayer.h b/include/nw4r/snd/snd_StrmPlayer.h index 0bb90337..c1979bf1 100644 --- a/include/nw4r/snd/snd_StrmPlayer.h +++ b/include/nw4r/snd/snd_StrmPlayer.h @@ -1,56 +1,223 @@ -#ifndef NW4R_SND_STRMPLAYER_H -#define NW4R_SND_STRMPLAYER_H -#include "common.h" -#include "snd_BasicPlayer.h" -#include "snd_SoundThread.h" +#ifndef NW4R_SND_STRM_PLAYER_H +#define NW4R_SND_STRM_PLAYER_H +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct StrmPlayer : BasicPlayer, SoundThread::PlayerCallback { - enum StartOffsetType { - }; +class StrmPlayer : public BasicPlayer, public SoundThread::PlayerCallback { + friend class StrmHeaderLoadTask; + friend class StrmDataLoadTask; - virtual ~StrmPlayer(); // at 0x8 - virtual bool Start(); // at 0xc - virtual void Stop(); // at 0x10 - virtual void Pause(bool); // at 0x14 - virtual bool IsActive() const; // at 0x18 - virtual bool IsStarted() const; // at 0x1c - virtual bool IsPause() const; // at 0x20 - - virtual void OnUpdateFrameSoundThread(); // at 0xc - virtual void OnUpdateVoiceSoundThread(); // at 0x10 - virtual void OnShutdownSoundThread(); // at 0x14 - - struct StrmDataLoadTask { - virtual ~StrmDataLoadTask(); - virtual UNKTYPE Execute(); - virtual UNKTYPE Cancel(); - virtual UNKTYPE OnCancel(); +public: + enum StartOffsetType { + START_OFFSET_TYPE_SAMPLE, + START_OFFSET_TYPE_MILLISEC }; - struct StrmHeaderLoadTask { - virtual ~StrmHeaderLoadTask(); - virtual UNKTYPE Execute(); - virtual UNKTYPE Cancel(); - virtual UNKTYPE OnCancel(); + struct StrmHeader { + // TODO: Why 8 if the player only supports 2??? + static const int STRM_CHANNEL_MAX = 8; + + StrmInfo strmInfo; // at 0x0 + AdpcmInfo adpcmInfo[STRM_CHANNEL_MAX]; // at 0x38 + u16 loopYn1[STRM_CHANNEL_MAX]; // at 0x1B8 + u16 loopYn2[STRM_CHANNEL_MAX]; // at 0x1D8 }; +public: + StrmPlayer(); + virtual ~StrmPlayer(); // at 0x8 + + virtual bool Start(); // at 0xc + virtual void Stop(); // at 0x10 + virtual void Pause(bool flag); // at 0x14 + + virtual bool IsActive() const { + return mActiveFlag; + } // at 0x18 + virtual bool IsStarted() const { + return mStartedFlag; + } // at 0x1c + virtual bool IsPause() const { + return mPauseFlag; + }; // at 0x20 + + virtual void OnUpdateFrameSoundThread() { + Update(); + } // at 0xc + virtual void OnUpdateVoiceSoundThread() { + UpdateBuffer(); + } // at 0x10 + virtual void OnShutdownSoundThread() { + Stop(); + } // at 0x14 + bool IsPrepared() const { - return mIsPrepared; + return mPreparedFlag; } - StrmPlayer(); - bool Setup(StrmBufferPool *); - bool Prepare(ut::FileStream *, int, StartOffsetType, int); + void SetTaskErrorFlag() { + mTaskErrorFlag = true; + } + void SetTaskCancelFlag() { + mTaskCancelFlag = true; + } + + bool Setup(StrmBufferPool* pBufferPool); void Shutdown(); - char UNK_D8[0x113 - 0xD8]; - bool mIsPrepared; // at 0x113 - char UNK_120[0x78C]; + bool Prepare(ut::FileStream* pFileStream, int voices, + StartOffsetType offsetType, int offset); + void InitParam(); + + void Update(); + +private: + struct StrmHeaderLoadTask : public Task { + StrmHeaderLoadTask(); + + virtual void Execute(); // at 0xC + virtual void Cancel(); // at 0x10 + virtual void OnCancel(); // at 0x14 + + StrmPlayer* strmPlayer; // at 0x10 + ut::FileStream* fileStream; // at 0x14 + StartOffsetType startOffsetType; // at 0x18 + s32 startOffset; // at 0x1C + }; + + struct StrmDataLoadTask : public Task { + StrmDataLoadTask(); + + virtual void Execute(); // at 0xC + virtual void Cancel(); // at 0x10 + virtual void OnCancel(); // at 0x14 + + StrmPlayer* strmPlayer; // at 0x10 + ut::FileStream* fileStream; // at 0x14 + u32 size; // at 0x18 + s32 offset; // at 0x1C + u32 blockSize; // at 0x20 + s32 bufferBlockIndex; // at 0x24 + bool needUpdateAdpcmLoop; // at 0x28 + + NW4R_UT_LIST_NODE_DECL(); // at 0x2C + }; + + NW4R_UT_LIST_TYPEDEF_DECL(StrmDataLoadTask); + + static const int DATA_BLOCK_COUNT_MIN = 4; + static const int DATA_BLOCK_COUNT_MAX = 32; + static const int DATA_BLOCK_SIZE_MAX = 0x2000; + + // TODO: How is this calculated? + static const int LOAD_BUFFER_SIZE = 0x4000 + 32; + +private: + bool LoadHeader(ut::FileStream* pFileStream, StartOffsetType offsetType, + int offset); + bool LoadStreamData(ut::FileStream* pFileStream, int offset, u32 size, + u32 blockSize, int blockIndex, + bool needUpdateAdpcmLoop); + + bool SetupPlayer(const StrmHeader* pStrmHeader); + + bool AllocChannels(int channels, int voices); + void FreeChannels(); + + void UpdateBuffer(); + void UpdateLoopAddress(u32 startSample, u32 endSample); + void UpdatePlayingBlockIndex(); + void UpdateDataLoopAddress(s32 endBlock); + void SetLoopEndToZeroBuffer(int endBlock); + void UpdateLoadingBlockIndex(); + void UpdatePauseStatus(); + + int CalcLoadingBufferBlockCount() const; + bool CalcStartOffset(s32* pBlockIndex, u32* pBlockOffset, s32* pLoopCount); + + static void VoiceCallbackFunc(Voice* pDropVoice, + Voice::VoiceCallbackStatus status, + void* pCallbackArg); + + void SetAdpcmLoopContext(int channels, u16* pPredScale); + +private: + StrmInfo mStrmInfo; // at 0x80 + + bool mSetupFlag; // at 0xB8 + bool mActiveFlag; // at 0xB9 + bool mStartedFlag; // at 0xBA + bool mPreparedFlag; // at 0xBB + bool mTaskErrorFlag; // at 0xBC + bool mTaskCancelFlag; // at 0xBD + bool mLoadingDelayFlag; // at 0xBE + bool mPauseFlag; // at 0xBF + bool mPauseStatus; // at 0xC0 + bool mLoadWaitFlag; // at 0xC1 + bool mNoRealtimeLoadFlag; // at 0xC2 + bool mSkipUpdateAdpcmLoop; // at 0xC3 + bool mValidAdpcmLoop; // at 0xC4 + bool mPlayFinishFlag; // at 0xC5 + bool mLoadFinishFlag; // at 0xC6 + + s32 mLoopCounter; // at 0xC8 + int mPrepareCounter; // at 0xCC + + int mChangeNumBlocks; // at 0xD0 + int mDataBlockSize; // at 0xD4 + int mBufferBlockCount; // at 0xD8 + int mBufferBlockCountBase; // at 0xDC + + int mLoadingBufferBlockCount; // at 0xE0 + int mLoadingBufferBlockIndex; // at 0xE4 + int mLoadingDataBlockIndex; // at 0xE8 + + int mPlayingBufferBlockCount; // at 0xEC + int mPlayingBufferBlockIndex; // at 0xF0 + int mPlayingDataBlockIndex; // at 0xF4 + int mLoopStartBlockIndex; // at 0xF8 + int mLastBlockIndex; // at 0xFC + + StartOffsetType mStartOffsetType; // at 0x100 + int mStartOffset; // at 0x104 + + StrmHeaderLoadTask mStrmHeaderLoadTask; // at 0x108 + StrmDataLoadTaskList mStrmDataLoadTaskList; // at 0x128 + InstancePool mStrmDataLoadTaskPool; // at 0x134 + StrmDataLoadTask mStrmDataLoadTaskArea[DATA_BLOCK_COUNT_MAX]; // at 0x138 + + StrmBufferPool* mBufferPool; // at 0x7B8 + ut::FileStream* mFileStream; // at 0x7BC + Voice* mVoice; // at 0x7C0 + s32 mChannelCount; // at 0x7C4 + s32 mVoiceOutCount; // at 0x7C8 + + StrmChannel mChannels[CHANNEL_MAX]; // at 0x7CC + u16 mAdpcmLoopPredScale[CHANNEL_MAX]; // at 0x83C + u16 mAdpcmLoopYn1[CHANNEL_MAX]; // at 0x840 + u16 mAdpcmLoopYn2[CHANNEL_MAX]; // at 0x844 + + static u8 sLoadBuffer[LOAD_BUFFER_SIZE] ALIGN(32); + static OSMutex sLoadBufferMutex; + + static bool sStaticInitFlag; }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_StrmSound.h b/include/nw4r/snd/snd_StrmSound.h index cb84045e..edbca21a 100644 --- a/include/nw4r/snd/snd_StrmSound.h +++ b/include/nw4r/snd/snd_StrmSound.h @@ -1,33 +1,69 @@ -#ifndef NW4R_SND_STRMSOUND_H -#define NW4R_SND_STRMSOUND_H -#include "common.h" -#include "snd_BasicSound.h" -#include "snd_StrmPlayer.h" -#include "ut_RuntimeTypeInfo.h" +#ifndef NW4R_SND_STRM_SOUND_H +#define NW4R_SND_STRM_SOUND_H +#include + +#include +#include + +#include namespace nw4r { namespace snd { + +// Forward declarations +class StrmSoundHandle; + namespace detail { -struct StrmSound : BasicSound { - StrmPlayer mPlayer; // at 0xD8 - StrmSoundHandle *mTempSpecialHandle; // at 0x920 - SoundInstanceManager *mManager; // at 0x924 - - StrmSound(SoundInstanceManager *); - bool Prepare(StrmBufferPool *, StrmPlayer::StartOffsetType, s32, int, ut::FileStream *); - - static ut::detail::RuntimeTypeInfo typeInfo; - - virtual const ut::detail::RuntimeTypeInfo *GetRuntimeTypeInfo() const; // at 0x8 - virtual ~StrmSound(); // at 0xc - virtual UNKTYPE Shutdown(); // at 0x28 - virtual bool IsPrepared() const; // at 0x2c - virtual void SetPlayerPriority(int); // at 0x4c - virtual bool IsAttachedTempSpecialHandle(); // at 0x5c - virtual UNKTYPE DetachTempSpecialHandle(); // at 0x60 - virtual BasicPlayer *GetBasicPlayer(); // at 0x68 - virtual const BasicPlayer *GetBasicPlayer() const; // at 0x6c + +// Forward declarations +template class SoundInstanceManager; + +class StrmSound : public BasicSound { + friend class StrmSoundHandle; + +public: + NW4R_UT_RTTI_DECL(StrmSound); + +public: + explicit StrmSound(SoundInstanceManager* pManager); + + virtual void Shutdown(); // at 0x28 + virtual bool IsPrepared() const { + return mStrmPlayer.IsPrepared(); + } // at 0x2C + + virtual void SetPlayerPriority(int priority); // at 0x4C + virtual bool IsAttachedTempSpecialHandle(); // at 0x5C + virtual void DetachTempSpecialHandle(); // at 0x60 + + virtual BasicPlayer& GetBasicPlayer() { + return mStrmPlayer; + } // at 0x68 + virtual const BasicPlayer& GetBasicPlayer() const { + return mStrmPlayer; + } // at 0x6C + + bool Prepare(StrmBufferPool* pPool, StrmPlayer::StartOffsetType offsetType, + s32 offset, int voices, ut::FileStream* pStream); + + void* GetFileStreamBuffer() { + return mFileStreamBuffer; + } + s32 GetFileStreamBufferSize() { + return sizeof(mFileStreamBuffer); + } + +private: + static const int FILE_STREAM_BUFFER_SIZE = 512; + +private: + StrmPlayer mStrmPlayer; // at 0xD8 + StrmSoundHandle* mTempSpecialHandle; // at 0x920 + SoundInstanceManager* mManager; // at 0x924 + char UNK_0x928[0x93C - 0x928]; + char mFileStreamBuffer[FILE_STREAM_BUFFER_SIZE]; // at 0x93C }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_StrmSoundHandle.h b/include/nw4r/snd/snd_StrmSoundHandle.h index dfafb738..98a876c3 100644 --- a/include/nw4r/snd/snd_StrmSoundHandle.h +++ b/include/nw4r/snd/snd_StrmSoundHandle.h @@ -1,19 +1,26 @@ -#ifndef NW4R_SND_STRMSOUNDHANDLE_H -#define NW4R_SND_STRMSOUNDHANDLE_H -#include "common.h" +#ifndef NW4R_SND_STRM_SOUND_HANDLE_H +#define NW4R_SND_STRM_SOUND_HANDLE_H +#include + +#include + +#include namespace nw4r { namespace snd { -struct StrmSoundHandle { - detail::StrmSound *mStrmSound; // at 0x0 - inline StrmSoundHandle() : mStrmSound(NULL) {} - inline bool IsAttachedSound() { - return mStrmSound != NULL; +class StrmSoundHandle : private ut::NonCopyable { +public: + void DetachSound(); + + bool IsAttachedSound() { + return mSound != NULL; } - void DetachSound(); +private: + detail::StrmSound* mSound; // at 0x0 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_Task.h b/include/nw4r/snd/snd_Task.h index 6752b996..ae69e660 100644 --- a/include/nw4r/snd/snd_Task.h +++ b/include/nw4r/snd/snd_Task.h @@ -1,22 +1,33 @@ #ifndef NW4R_SND_TASK_H #define NW4R_SND_TASK_H -#include "common.h" -#include "ut_LinkList.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct Task { - virtual ~Task(); // at 0x8 - virtual void Execute() = 0; // at 0xc + +class Task : private ut::NonCopyable { + friend class TaskManager; + +public: + Task() : mBusyFlag(false) {} + virtual ~Task(); // at 0x8 + + virtual void Execute() = 0; // at 0xC virtual void Cancel() = 0; // at 0x10 virtual void OnCancel() = 0; // at 0x14 - ut::LinkListNode mNode; // at 0x4 - char BYTE_0xC; +public: + NW4R_UT_LIST_NODE_DECL(); // at 0x4 - inline Task() : BYTE_0xC() {} +private: + bool mBusyFlag; // at 0xC }; + +NW4R_UT_LIST_TYPEDEF_DECL(Task); + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_TaskManager.h b/include/nw4r/snd/snd_TaskManager.h index 1ef6f72d..fd31489e 100644 --- a/include/nw4r/snd/snd_TaskManager.h +++ b/include/nw4r/snd/snd_TaskManager.h @@ -1,46 +1,54 @@ #ifndef NW4R_SND_TASK_MANAGER_H #define NW4R_SND_TASK_MANAGER_H -#include "common.h" -#include "snd_Task.h" -#include "ut_LinkList.h" -#include "ut_lock.h" -#include +#include +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct TaskManager { + +class TaskManager { +public: enum TaskPriority { - PRIORITY_0 = 0, - PRIORITY_1 = 1, - PRIORITY_2 = 2 - // PRIORITY_MAX = 3 + PRIORITY_LOW = 0, + PRIORITY_MIDDLE = 1, + PRIORITY_HIGH = 2, + + PRIORITY_MAX }; - inline TaskManager() : mTaskStacks(), WORD_0x24(0), BYTE_0x28(0) { - OSInitThreadQueue(&mQueue_0x2C); - OSInitThreadQueue(&mQueue_0x34); - } - - static TaskManager *GetInstance(); - - ~TaskManager(); - void AppendTask(Task *, TaskPriority); - Task *PopTask(); - UNKTYPE GetNextTask(); - UNKTYPE ExecuteTask(); - UNKTYPE CancelTask(Task *); - UNKTYPE CancelAllTask(); - UNKTYPE WaitTask(); - UNKTYPE CancelWaitTask(); - - ut::LinkList mTaskStacks[3]; - u32 WORD_0x24; - u8 BYTE_0x28; - OSThreadQueue mQueue_0x2C; - OSThreadQueue mQueue_0x34; +public: + static TaskManager& GetInstance(); + + void AppendTask(Task* pTask, TaskPriority priority = PRIORITY_MIDDLE); + + Task* ExecuteTask(); + void CancelTask(Task* pTask); + void CancelAllTask(); + + void WaitTask(); + void CancelWaitTask(); + +private: + TaskManager(); + + Task* PopTask(); + Task* GetNextTask(); + Task* GetNextTask(TaskPriority priority, bool remove); + +private: + TaskList mTaskList[PRIORITY_MAX]; // at 0x0 + Task* volatile mCurrentTask; // at 0x24 + bool mCancelWaitTaskFlag; // at 0x28 + OSThreadQueue mAppendThreadQueue; // at 0x2C + OSThreadQueue mDoneThreadQueue; // at 0x34 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_TaskThread.h b/include/nw4r/snd/snd_TaskThread.h index b966af2a..deb9a641 100644 --- a/include/nw4r/snd/snd_TaskThread.h +++ b/include/nw4r/snd/snd_TaskThread.h @@ -1,24 +1,33 @@ -#ifndef NW4R_SND_TASKTHREAD_H -#define NW4R_SND_TASKTHREAD_H -#include "common.h" -#include +#ifndef NW4R_SND_TASK_THREAD_H +#define NW4R_SND_TASK_THREAD_H +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct TaskThread { - static void *ThreadFunc(void *); +class TaskThread { +public: TaskThread(); ~TaskThread(); - bool Create(s32, void *, u32); + + bool Create(s32 priority, void* pStack, u32 stackSize); void Destroy(); +private: + static void* ThreadFunc(void* pArg); + void ThreadProc(); + +private: OSThread mThread; // at 0x0 - void *mStackEnd; // at 0x318 - bool mIsExiting; // at 0x31C - bool mIsAlive; // at 0x31D + u32* mStackEnd; // at 0x318 + + volatile bool mFinishFlag; // at 0x31C + bool mCreateFlag; // at 0x31D }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_Util.h b/include/nw4r/snd/snd_Util.h index a3c086d7..58b30414 100644 --- a/include/nw4r/snd/snd_Util.h +++ b/include/nw4r/snd/snd_Util.h @@ -1,63 +1,112 @@ #ifndef NW4R_SND_UTIL_H #define NW4R_SND_UTIL_H -#include "common.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { namespace Util { + +enum PanCurve { + PAN_CURVE_SQRT, + PAN_CURVE_SINCOS, + PAN_CURVE_LINEAR, +}; + +struct PanInfo { + PanCurve curve; // at 0x0 + bool centerZero; // at 0x4 + bool zeroClamp; // at 0x5 + + PanInfo() : curve(PAN_CURVE_SQRT), centerZero(false), zeroClamp(false) {} +}; + enum RefType { REFTYPE_ADDRESS, REFTYPE_OFFSET, }; -template -struct DataRef { - u8 mType; // at 0x0 - u8 BYTE_0x1; - u32 INT_0x4; +enum DataType { + DATATYPE_T0, + DATATYPE_T1, + DATATYPE_T2, + DATATYPE_T3, + DATATYPE_INVALID }; -template -struct Table { - u32 mCount; // at 0x0 - T mEntries[]; // at 0x4 +template +struct DataRef { + u8 refType; // at 0x0 + u8 dataType; // at 0x1 + u16 reserved; // at 0x2 + u32 value; // at 0x4 }; -struct PanInfo { - u32 mPanTableID; // 0x0, (PanTableTable) - bool BOOL_0x4; - bool BOOL_0x5; +template struct Table { + u32 count; // at 0x0 + T items[]; // at 0x4 }; template -inline const T0 *GetDataRefAddress0(const DataRef &dataRef, const void *ptr) { - return (const T0 *)GetDataRefAddressImpl((RefType)dataRef.mType, dataRef.INT_0x4, ptr); +inline const T0* GetDataRefAddress0(const DataRef& rRef, + const void* pBase) { + return static_cast(GetDataRefAddressImpl( + static_cast(rRef.refType), rRef.value, pBase)); } template -inline const T1 *GetDataRefAddress1(const DataRef &dataRef, const void *ptr) { - return (const T1 *)GetDataRefAddressImpl((RefType)dataRef.mType, dataRef.INT_0x4, ptr); +inline const T1* GetDataRefAddress1(const DataRef& rRef, + const void* pBase) { + return static_cast(GetDataRefAddressImpl( + static_cast(rRef.refType), rRef.value, pBase)); } template -inline const T2 *GetDataRefAddress2(const DataRef &dataRef, const void *ptr) { - return (const T2 *)GetDataRefAddressImpl((RefType)dataRef.mType, dataRef.INT_0x4, ptr); +inline const T2* GetDataRefAddress2(const DataRef& rRef, + const void* pBase) { + return static_cast(GetDataRefAddressImpl( + static_cast(rRef.refType), rRef.value, pBase)); } template -inline const T3 *GetDataRefAddress3(const DataRef &dataRef, const void *ptr) { - return (const T3 *)GetDataRefAddressImpl((RefType)dataRef.mType, dataRef.INT_0x4, ptr); +inline const T3* GetDataRefAddress3(const DataRef& rRef, + const void* pBase) { + return static_cast(GetDataRefAddressImpl( + static_cast(rRef.refType), rRef.value, pBase)); +} + +#ifdef NW4R_LITLE_ENDIAN +inline u16 ReadBigEndian(u16 x) { + return x >> 8 | x << 8; +} + +inline u32 ReadBigEndian(u32 x) { + return (x >> 24) & 0x000000FF | (x >> 8) & 0x0000FF00 | + (x << 8) & 0x00FF0000 | (x << 24) & 0xFF000000; +} +#else +inline u16 ReadBigEndian(u16 x) { + return x; } -f32 CalcPitchRatio(int); -f32 CalcVolumeRatio(f32); -f32 CalcPanRatio(f32, const PanInfo &); -f32 CalcSurroundPanRatio(f32, const PanInfo &); -int CalcLpfFreq(f32); -void GetRemoteFilterCoefs(int, u16 *, u16 *, u16 *, u16 *, u16 *); +inline u32 ReadBigEndian(u32 x) { + return x; +} +#endif + +f32 CalcPitchRatio(int pitch); +f32 CalcVolumeRatio(f32 db); +f32 CalcPanRatio(f32 pan, const PanInfo& rInfo); +f32 CalcSurroundPanRatio(f32 pan, const PanInfo& rInfo); +int CalcLpfFreq(f32 scale); +void GetRemoteFilterCoefs(int filter, u16* pB0, u16* pB1, u16* pB2, u16* pA1, + u16* pA2); u16 CalcRandom(); -const void *GetDataRefAddressImpl(RefType, u32, const void *); +const void* GetDataRefAddressImpl(RefType type, u32 value, const void* pBase); + } // namespace Util } // namespace detail } // namespace snd diff --git a/include/nw4r/snd/snd_Voice.h b/include/nw4r/snd/snd_Voice.h index 7052e7cf..acfca5d5 100644 --- a/include/nw4r/snd/snd_Voice.h +++ b/include/nw4r/snd/snd_Voice.h @@ -1,15 +1,35 @@ #ifndef NW4R_SND_VOICE_H #define NW4R_SND_VOICE_H -#include "common.h" -#include "snd_AxManager.h" -#include "snd_Common.h" -#include "snd_WaveFile.h" +#include + +#include +#include +#include + +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct Voice { - enum VoiceCallbackStatus { STATUS_0, STATUS_1, STATUS_2, STATUS_3 }; + +// Forward declarations +class WaveData; + +class Voice : public DisposeCallback { + friend class VoiceManager; + +public: + enum VoiceCallbackStatus { + CALLBACK_STATUS_FINISH_WAVE, + CALLBACK_STATUS_CANCEL, + CALLBACK_STATUS_DROP_VOICE, + CALLBACK_STATUS_DROP_DSP, + }; + + typedef void (*VoiceCallback)(Voice* pDropVoice, VoiceCallbackStatus status, + void* pCallbackArg); enum VoiceSyncFlag { SYNC_AX_SRC_INITIAL = (1 << 0), @@ -22,34 +42,151 @@ struct Voice { SYNC_AX_BIQUAD = (1 << 8), }; - typedef void (*VoiceCallback)(Voice *, VoiceCallbackStatus, void *); - - UNKTYPE Start(); - UNKTYPE Setup(const WaveData &, u32); - UNKTYPE SetPriority(int); - UNKTYPE Stop(); - UNKTYPE Free(); - UNKTYPE SetPanMode(PanMode); - UNKTYPE SetPanCurve(PanCurve); - UNKTYPE SetVolume(float); - UNKTYPE SetVeVolume(float, float); - UNKTYPE SetPitch(float); - UNKTYPE SetPan(float); - UNKTYPE SetSurroundPan(float); - UNKTYPE SetLpfFreq(float); - UNKTYPE SetRemoteFilter(int); - UNKTYPE SetOutputLine(int); - UNKTYPE SetMainOutVolume(float); - UNKTYPE SetMainSend(float); - - UNKTYPE SetFxSend(AuxBus, float); - - UNKTYPE SetRemoteOutVolume(int, float); - UNKTYPE SetRemoteSend(int, float); - UNKTYPE SetRemoteFxSend(int, float); - - UNKTYPE Pause(bool); + static const int PRIORITY_MAX = 255; + +public: + Voice(); + virtual ~Voice(); // at 0x8 + + virtual void InvalidateData(const void* /* pStart */, + const void* /* pEnd */) {} // at 0xC + + virtual void InvalidateWaveData(const void* pStart, + const void* pEnd); // at 0x10 + + int GetPriority() const { + return mPriority; + } + int GetAxVoiceCount() const { + return mChannelCount * mVoiceOutCount; + } + + bool IsActive() const { + return mAxVoice[0][0] != NULL; + } + bool IsPlayFinished() const { + return IsActive() && mAxVoice[0][0]->IsPlayFinished(); + } + + void InitParam(int channels, int voices, VoiceCallback pCallback, + void* pCallbackArg); + void StopFinished(); + + void Calc(); + void Update(); + + bool Acquire(int channels, int voices, int priority, + VoiceCallback pCallback, void* pCallbackArg); + void Free(); + + void Setup(const WaveData& rData, u32 offset); + + void Start(); + void Stop(); + void Pause(bool flag); + + AxVoice::Format GetFormat() const; + + void SetVolume(f32 volume); + void SetVeVolume(f32 target, f32 init); + void SetPitch(f32 pitch); + + void SetPanMode(PanMode mode); + void SetPanCurve(PanCurve curve); + void SetPan(f32 pan); + void SetSurroundPan(f32 pan); + + void SetLpfFreq(f32 freq); + void SetRemoteFilter(int filter); + void SetOutputLine(int flag); + + void SetMainOutVolume(f32 volume); + void SetMainSend(f32 send); + void SetFxSend(AuxBus bus, f32 send); + + void SetRemoteOutVolume(int remote, f32 volume); + void SetRemoteSend(int remote, f32 send); + void SetRemoteFxSend(int remote, f32 send); + + void SetPriority(int priority); + void UpdateVoicesPriority(); + + void SetAdpcmLoop(int channel, const AdpcmLoopParam* pParam); + u32 GetCurrentPlayingSample() const; + void SetLoopStart(int channel, const void* pBase, u32 samples); + void SetLoopEnd(int channel, const void* pBase, u32 samples); + void SetLoopFlag(bool loop); + void StopAtPoint(int channel, const void* pBase, u32 samples); + void SetVoiceType(AxVoice::VoiceType type); + + void CalcAxSrc(bool initial); + void CalcAxVe(); + bool CalcAxMix(); + void CalcAxLpf(); + void CalcAxRemoteFilter(); + +private: + static const int VOICES_MIN = 1; + static const int VOICES_MAX = 4; + +private: + void SyncAxVoice(); + void ResetDelta(); + + static void AxVoiceCallbackFunc(AxVoice* pVoice, + AxVoice::AxVoiceCallbackStatus status, + void* pCallbackArg); + + void TransformDpl2Pan(f32* pPan, f32* pSurroundPan, f32 pan, + f32 surroundPan); + void CalcMixParam(int channel, int voice, AxVoice::MixParam* pMix, + AxVoice::RemoteMixParam* pRmtMix); + + void RunAllAxVoice(); + void StopAllAxVoice(); + +private: + AxVoice* mAxVoice[CHANNEL_MAX][VOICES_MAX]; // at 0xC + SoundParam mVoiceOutParam[VOICES_MAX]; // at 0x2C + int mChannelCount; // at 0x9C + int mVoiceOutCount; // at 0xA0 + + VoiceCallback mCallback; // at 0xA4 + void* mCallbackArg; // at 0xA8 + + bool mIsActive; // at 0xAC + bool mIsStarting; // at 0xAD + bool mIsStarted; // at 0xAE + bool mIsPause; // at 0xAF + bool mIsPausing; // at 0xB0 + + u8 mSyncFlag; // at 0xB1 + u8 mRemoteFilter; // at 0xB2 + u8 mBiquadType; // at 0xB3 + int mPriority; // at 0xB4 + f32 mPan; // at 0xB8 + f32 mSurroundPan; // at 0xBC + f32 mLpfFreq; // at 0xC0 + int mOutputLineFlag; // at 0xC4 + f32 mMainOutVolume; // at 0xC8 + f32 mMainSend; // at 0xCC + f32 mFxSend[AUX_BUS_NUM]; // at 0xD0 + f32 mRemoteOutVolume[WPAD_MAX_CONTROLLERS]; // at 0xDC + f32 mRemoteSend[WPAD_MAX_CONTROLLERS]; // at 0xEC + f32 mRemoteFxSend[WPAD_MAX_CONTROLLERS]; // at 0xFC + f32 mPitch; // at 0x10C + f32 mVolume; // at 0x110 + f32 mVeInitVolume; // at 0x114 + f32 mVeTargetVolume; // at 0x118 + PanMode mPanMode; // at 0x11C + PanCurve mPanCurve; // at 0x120 + +public: + NW4R_UT_LIST_NODE_DECL(); // at 0x124 }; + +NW4R_UT_LIST_TYPEDEF_DECL(Voice); + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_VoiceManager.h b/include/nw4r/snd/snd_VoiceManager.h index 36affe50..e416a20c 100644 --- a/include/nw4r/snd/snd_VoiceManager.h +++ b/include/nw4r/snd/snd_VoiceManager.h @@ -1,19 +1,57 @@ #ifndef NW4R_SND_VOICE_MANAGER_H #define NW4R_SND_VOICE_MANAGER_H -#include "common.h" -#include "snd_Voice.h" +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct VoiceManager { - static VoiceManager &GetInstance(); - Voice *AllocVoice(int, int, int, Voice::VoiceCallback, void *); +class VoiceManager { +public: + static const int VOICE_MAX = AX_VOICE_MAX; + static const int WORK_SIZE_MAX = VOICE_MAX * sizeof(Voice); + +public: + static VoiceManager& GetInstance(); + + u32 GetRequiredMemSize(); + + void Setup(void* pBuffer, u32 size); + void Shutdown(); + void StopAllVoices(); + + Voice* AllocVoice(int channels, int voices, int priority, + Voice::VoiceCallback pCallback, void* pCallbackArg); + void FreeVoice(Voice* pVoice); + void UpdateAllVoices(); void NotifyVoiceUpdate(); - UNKTYPE UpdateAllVoicesSync(u32); + void ChangeVoicePriority(Voice* pVoice); + void UpdateAllVoicesSync(u32 syncFlag); + + const VoiceList& GetVoiceList() const { + return mPrioVoiceList; + } + +private: + VoiceManager(); + + void AppendVoiceList(Voice* pVoice); + void RemoveVoiceList(Voice* pVoice); + + void UpdateEachVoicePriority(const VoiceList::Iterator& rBegin, + const VoiceList::Iterator& rEnd); + + int DropLowestPriorityVoice(int priority); + +private: + bool mInitialized; // at 0x0 + VoiceList mPrioVoiceList; // at 0x4 + VoiceList mFreeVoiceList; // at 0x10 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_WaveFile.h b/include/nw4r/snd/snd_WaveFile.h index 0ec8ceda..7c309ef4 100644 --- a/include/nw4r/snd/snd_WaveFile.h +++ b/include/nw4r/snd/snd_WaveFile.h @@ -1,28 +1,88 @@ #ifndef NW4R_SND_WAVE_FILE_H #define NW4R_SND_WAVE_FILE_H -#include "common.h" -#include "snd_Util.h" -#include "ut_binaryFileFormat.h" +#include + +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct WaveData { - char UNK_0x0[0x2]; - u8 BYTE_0x2; - char UNK_0x4[0x90]; +namespace WaveFile { + +enum Format { FORMAT_PCM8, FORMAT_PCM16, FORMAT_ADPCM }; + +struct WaveInfo { + u8 format; // at 0x0 + u8 loopFlag; // at 0x1 + u8 numChannels; // at 0x2 + u8 sampleRate24; // at 0x3 + u16 sampleRate; // at 0x4 + u16 padding2; // at 0x6 + u32 loopStart; // at 0x8 + u32 loopEnd; // at 0xC + u32 channelInfoTableOffset; // at 0x10 + u32 dataOffset; // at 0x14 + u32 reserved; // at 0x18 }; -struct WaveFile { - struct WaveInfo {}; +struct WaveChannelInfo { + u32 channelDataOffset; // at 0x0 + u32 adpcmOffset; // at 0x4 + u32 volumeFrontLeft; // at 0x8 + u32 volumeFrontRight; // at 0xC + u32 volumeRearLeft; // at 0x10 + u32 volumeRearRight; // at 0x14 + u32 reserved; // at 0x18 +}; + +}; // namespace WaveFile - typedef Util::DataRef Region; +struct ChannelParam { + void* dataAddr; // at 0x0 + u32 volumeFrontLeft; // at 0x4 + u32 volumeFrontRight; // at 0x8 + u32 volumeRearLeft; // at 0xC + u32 volumeRearRight; // at 0x10 + AdpcmInfo adpcmInfo; // at 0x14 }; -struct WaveFileReader { - WaveFileReader(const WaveFile::WaveInfo *); - bool ReadWaveParam(WaveData *, const void *) const; +struct WaveData { + u8 sampleFormat; // at 0x0 + u8 loopFlag; // at 0x1 + u8 numChannels; // at 0x2 + u32 sampleRate; // at 0x4 + u32 loopStart; // at 0x8 + u32 loopEnd; // at 0xC + ChannelParam channelParam[CHANNEL_MAX]; // at 0x10 }; + +class WaveFileReader { +public: + explicit WaveFileReader(const WaveFile::WaveInfo* pWaveInfo); + + bool ReadWaveParam(WaveData* pWaveData, const void* pWaveAddr) const; + + static AxVoice::Format GetAxVoiceFormatFromWaveFileFormat(u32 format); + +private: + const WaveFile::WaveInfo* mWaveInfo; // at 0x0 +}; + +inline AxVoice::Format WaveFormatToAxFormat(u32 format) { + if (format == WaveFile::FORMAT_PCM16) { + return AxVoice::FORMAT_PCM16; + } + + if (format == WaveFile::FORMAT_PCM8) { + return AxVoice::FORMAT_PCM8; + } + + return AxVoice::FORMAT_ADPCM; +} + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_WaveSound.h b/include/nw4r/snd/snd_WaveSound.h index 2d588bea..8ea92f2f 100644 --- a/include/nw4r/snd/snd_WaveSound.h +++ b/include/nw4r/snd/snd_WaveSound.h @@ -1,37 +1,63 @@ -#ifndef NW4R_SND_WAVESOUND_H -#define NW4R_SND_WAVESOUND_H -#include "common.h" -#include "snd_BasicSound.h" -#include "snd_WsdPlayer.h" -#include "ut_RuntimeTypeInfo.h" +#ifndef NW4R_SND_WAVE_SOUND_H +#define NW4R_SND_WAVE_SOUND_H +#include +#include +#include + +#include namespace nw4r { namespace snd { + +// Forward declarations +class WaveSoundHandle; + namespace detail { -struct WaveSound : BasicSound { - WsdPlayer mPlayer; // at 0xD8 - WaveSoundHandle *mTempSpecialHandle; // at 0x1B0 - SoundInstanceManager *mManager; // at 0x1B4 - bool mIsPrepared; // at 0x1B8 - - WaveSound(SoundInstanceManager *); - bool Prepare(const void *, s32, WsdPlayer::StartOffsetType, s32, int, const WsdPlayer::WsdCallback *, u32); - void SetChannelPriority(int); - void SetReleasePriorityFix(bool); - - static ut::detail::RuntimeTypeInfo typeInfo; - - virtual const ut::detail::RuntimeTypeInfo *GetRuntimeTypeInfo() const; // at 0x8 - virtual ~WaveSound(); // at 0xc - virtual UNKTYPE Shutdown(); // at 0x28 - virtual bool IsPrepared() const; // at 0x2c - virtual void SetPlayerPriority(int); // at 0x4c - virtual bool IsAttachedTempSpecialHandle(); // at 0x5c - virtual UNKTYPE DetachTempSpecialHandle(); // at 0x60 - virtual BasicPlayer *GetBasicPlayer(); // at 0x68 - virtual const BasicPlayer *GetBasicPlayer() const; // at 0x6c + +// Forward declarations +template class SoundInstanceManager; + +class WaveSound : public BasicSound { + friend class WaveSoundHandle; + +public: + NW4R_UT_RTTI_DECL(WaveSound); + +public: + explicit WaveSound(SoundInstanceManager* pManager); + + virtual void Shutdown(); // at 0x28 + virtual bool IsPrepared() const { + return mPreparedFlag; + } // at 0x2C + + virtual void SetPlayerPriority(int priority); // at 0x4C + virtual bool IsAttachedTempSpecialHandle(); // at 0x5C + virtual void DetachTempSpecialHandle(); // at 0x60 + + virtual BasicPlayer& GetBasicPlayer() { + return mWsdPlayer; + } // at 0x68 + virtual const BasicPlayer& GetBasicPlayer() const { + return mWsdPlayer; + } // at 0x6C + + bool Prepare(const void* pWsdData, s32 wsdOffset, + WsdPlayer::StartOffsetType startType, s32 startOffset, + int voices, const WsdPlayer::WsdCallback* pCallback, + u32 callbackArg); + + void SetChannelPriority(int priority); + void SetReleasePriorityFix(bool flag); + +private: + WsdPlayer mWsdPlayer; // at 0xD8 + WaveSoundHandle* mTempSpecialHandle; // at 0x1B0 + SoundInstanceManager* mManager; // at 0x1B4 + bool mPreparedFlag; // at 0x1B8 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_WaveSoundHandle.h b/include/nw4r/snd/snd_WaveSoundHandle.h index d6d178c8..2833b4a9 100644 --- a/include/nw4r/snd/snd_WaveSoundHandle.h +++ b/include/nw4r/snd/snd_WaveSoundHandle.h @@ -1,19 +1,30 @@ -#ifndef NW4R_SND_WAVESOUNDHANDLE_H -#define NW4R_SND_WAVESOUNDHANDLE_H -#include "common.h" +#ifndef NW4R_SND_WAVE_SOUND_HANDLE_H +#define NW4R_SND_WAVE_SOUND_HANDLE_H +#include + +#include + +#include namespace nw4r { namespace snd { -struct WaveSoundHandle { - detail::WaveSound *mWaveSound; // at 0x0 - inline WaveSoundHandle() : mWaveSound(NULL) {} - inline bool IsAttachedSound() { - return mWaveSound != NULL; +class WaveSoundHandle : private ut::NonCopyable { +public: + ~WaveSoundHandle() { + DetachSound(); } void DetachSound(); + + bool IsAttachedSound() const { + return mSound != NULL; + } + +private: + detail::WaveSound* mSound; // at 0x0 }; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_WsdFile.h b/include/nw4r/snd/snd_WsdFile.h new file mode 100644 index 00000000..dd1f01b1 --- /dev/null +++ b/include/nw4r/snd/snd_WsdFile.h @@ -0,0 +1,133 @@ +#ifndef NW4R_SND_WSD_FILE_H +#define NW4R_SND_WSD_FILE_H +#include + +#include + +namespace nw4r { +namespace snd { +namespace detail { +namespace WsdFile { + +struct WsdInfo { + f32 pitch; // at 0x0 + u8 pan; // at 0x4 + u8 surroundPan; // at 0x5 + u8 fxSendA; // at 0x6 + u8 fxSendB; // at 0x7 + u8 fxSendC; // at 0x8 + u8 mainSend; // at 0x9 + Util::DataRef graphEnvTableRef; // at 0xC + Util::DataRef randomizerTableRef; // at 0x14 + u32 reserved; // at 0x1C +}; + +struct TrackInfo {}; + +struct NoteInfo { + s32 waveIndex; // at 0x0 + u8 attack; // at 0x4 + u8 decay; // at 0x5 + u8 sustain; // at 0x6 + u8 release; // at 0x7 + u16 hold; // at 0x8 + u16 padding; // at 0xA + u8 originalKey; // at 0xC + u8 volume; // at 0xD + u8 pan; // at 0xE + u8 surroundPan; // at 0xF + f32 pitch; // at 0x10 + Util::DataRef lfoTableRef; // at 0x14 + Util::DataRef graphEnvTablevRef; // at 0x1C + Util::DataRef randomizerTableRef; // at 0x24 + u32 reserved; // at 0x2C +}; + +typedef Util::Table > TrackTable; + +typedef Util::Table > NoteTable; + +struct Wsd { + Util::DataRef refWsdInfo; // at 0x0 + Util::DataRef refTrackTable; // at 0x8 + Util::DataRef refNoteTable; // at 0x10 +}; + +struct Header { + ut::BinaryFileHeader fileHeader; // at 0x0 + u32 dataBlockOffset; // at 0x10 + u32 dataBlockSize; // at 0x14 + u32 waveBlockOffset; // at 0x18 + u32 waveBlockSize; // at 0x1C +}; + +struct DataBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + u32 wsdCount; // at 0x8 + Util::DataRef refWsd[]; // at 0xC +}; + +struct WaveBlock { + ut::BinaryBlockHeader blockHeader; // at 0x0 + u32 waveCount; // at 0x8 + u32 offsetTable[]; // at 0xC +}; + +// <= NW4R_VERSION(1, 0) +struct WaveBlockOld { + ut::BinaryBlockHeader blockHeader; // at 0x0 + u32 offsetTable[]; // at 0x8 +}; + +}; // namespace WsdFile + +struct WaveSoundInfo { + f32 pitch; // at 0x0 + u8 pan; // at 0x4 + u8 surroundPan; // at 0x5 + u8 fxSendA; // at 0x6 + u8 fxSendB; // at 0x7 + u8 fxSendC; // at 0x8 + u8 mainSend; // at 0x9 +}; + +struct WaveSoundNoteInfo { + s32 waveIndex; // at 0x0 + u8 attack; // at 0x4 + u8 decay; // at 0x6 + u8 sustain; // at 0x7 + u8 release; // at 0x8 + u8 originalKey; // at 0x9 + u8 pan; // at 0xA + u8 surroundPan; // at 0xB + u8 volume; // at 0xC + f32 pitch; // at 0x10 +}; + +class WsdFileReader { +public: + static const u32 SIGNATURE = 'RWSD'; + static const int VERSION = NW4R_VERSION(1, 2); + +public: + explicit WsdFileReader(const void* pWsdBin); + + bool IsValidFileHeader(const void* pWsdBin); + + bool ReadWaveSoundInfo(WaveSoundInfo* pSoundInfo, int id) const; + bool ReadWaveSoundNoteInfo(WaveSoundNoteInfo* pSoundNoteInfo, int id, + int note) const; + bool ReadWaveParam(int id, WaveData* pWaveData, + const void* pWaveAddr) const; + +private: + const WsdFile::Header* mHeader; // at 0x0 + const WsdFile::DataBlock* mDataBlock; // at 0x4 + const WsdFile::WaveBlock* mWaveBlock; // at 0x8 +}; + +} // namespace detail +} // namespace snd +} // namespace nw4r + +#endif diff --git a/include/nw4r/snd/snd_WsdPlayer.h b/include/nw4r/snd/snd_WsdPlayer.h index 67d94663..4d0d52f1 100644 --- a/include/nw4r/snd/snd_WsdPlayer.h +++ b/include/nw4r/snd/snd_WsdPlayer.h @@ -1,45 +1,142 @@ -#ifndef NW4R_SND_WSDPLAYER_H -#define NW4R_SND_WSDPLAYER_H -#include "common.h" -#include "snd_BasicPlayer.h" -#include "snd_DisposeCallback.h" -#include "snd_Lfo.h" -#include "snd_SoundThread.h" +#ifndef NW4R_SND_WSD_PLAYER_H +#define NW4R_SND_WSD_PLAYER_H +#include + +#include +#include +#include +#include +#include +#include + +#include namespace nw4r { namespace snd { namespace detail { -struct WsdPlayer : BasicPlayer, DisposeCallback, SoundThread::PlayerCallback { - enum StartOffsetType { +class WsdPlayer : public BasicPlayer, + public DisposeCallback, + public SoundThread::PlayerCallback { +public: + class WsdCallback { + public: + virtual ~WsdCallback() {} // at 0x8 + + virtual bool GetWaveSoundData(WaveSoundInfo* pSoundInfo, + WaveSoundNoteInfo* pNoteInfo, + WaveData* pWaveData, const void* pWsdData, + int index, int noteIndex, + u32 callbackArg) const = 0; // at 0xC }; - virtual ~WsdPlayer() {} // at 0x8 - virtual bool Start(); // at 0xc - virtual void Stop(); // at 0x10 - virtual void Pause(bool); // at 0x14 - virtual bool IsActive() const; // at 0x18 - virtual bool IsStarted() const; // at 0x1c - virtual bool IsPause() const; // at 0x20 + enum StartOffsetType { + START_OFFSET_TYPE_SAMPLE, + START_OFFSET_TYPE_MILLISEC + }; - virtual void OnUpdateFrameSoundThread(); // at 0xc - virtual void OnUpdateVoiceSoundThread(); // at 0x10 - virtual void OnShutdownSoundThread(); // at 0x14 +public: + WsdPlayer(); - virtual void InvalidateData(const void *, const void *); // at 0xc - virtual void InvalidateWaveData(const void *, const void *); // at 0x10 + virtual bool Start(); // at 0xC + virtual void Stop(); // at 0x10 + virtual void Pause(bool flag); // at 0x14 - struct WsdCallback { - virtual ~WsdCallback(); - }; + virtual bool IsActive() const { + return mActiveFlag != 0; + } // at 0x18 - WsdPlayer(); - bool Prepare(const void *, int, WsdPlayer::StartOffsetType, int, int, const WsdPlayer::WsdCallback *, u32); - void SetChannelPriority(int); - void SetReleasePriorityFix(bool); + virtual bool IsStarted() const { + return mStartedFlag != 0; + } // at 0x1C + + virtual bool IsPause() const { + return mPauseFlag != 0; + } // at 0x20 + + virtual void InvalidateData(const void* pStart, + const void* pEnd); // at 0x50 + + virtual void InvalidateWaveData(const void* /* pStart */, + const void* /* pEnd */) {} // at 0x54 + + virtual void OnUpdateFrameSoundThread() { + Update(); + } // at 0x58 + + virtual void OnShutdownSoundThread() { + Stop(); + } // at 0x60 + + void InitParam(int voices, const WsdCallback* pCallback, u32 callbackArg); + + bool Prepare(const void* pWsdData, int index, StartOffsetType startType, + int startOffset, int voices, const WsdCallback* pCallback, + u32 callbackArg); - char UNK_0xE4[0x4C]; + void SetChannelPriority(int priority); + void SetReleasePriorityFix(bool flag); + + f32 GetPanRange() const { + return mPanRange; + } + + int GetVoiceOutCount() const { + return mVoiceOutCount; + } + + int GetChannelPriority() const { + return mPriority; + } + + const void* GetWsdDataAddress() const { + return mWsdData; + } + + bool IsChannelActive() const { + return mChannel != NULL && mChannel->IsActive(); + } + +private: + static const int DEFAULT_PRIORITY = 64; + +private: + void FinishPlayer(); + void Update(); + + bool StartChannel(const WsdCallback* pCallback, u32 callbackArg); + void CloseChannel(); + void UpdateChannel(); + + static void ChannelCallbackFunc(Channel* pDropChannel, + Channel::ChannelCallbackStatus status, + u32 callbackArg); + +private: + bool mActiveFlag; // at 0x8C + bool mStartedFlag; // at 0x8D + bool mPauseFlag; // at 0x8E + bool mWavePlayFlag; // at 0x8F + bool mReleasePriorityFixFlag; // at 0x90 + + f32 mPanRange; // at 0x94 + int mVoiceOutCount; // at 0x98 + u8 mPriority; // at 0x9C + + const WsdCallback* mCallback; // at 0xA0 + u32 mCallbackData; // at 0xA4 + + const void* mWsdData; // at 0xA8 + int mWsdIndex; // at 0xAC + + StartOffsetType mStartOffsetType; // at 0xB0 + int mStartOffset; // at 0xB4 + + LfoParam mLfoParam; // at 0xB8 + WaveSoundInfo mWaveSoundInfo; // at 0xC8 + Channel* mChannel; // at 0xD4 }; + } // namespace detail } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_adpcm.h b/include/nw4r/snd/snd_adpcm.h index 368a3510..89980c0b 100644 --- a/include/nw4r/snd/snd_adpcm.h +++ b/include/nw4r/snd/snd_adpcm.h @@ -1,13 +1,14 @@ #ifndef NW4R_SND_ADPCM_H #define NW4R_SND_ADPCM_H #include + #include namespace nw4r { namespace snd { namespace detail { -s16 DecodeDspAdpcm(AXPBADPCM *adpcm, u8 bits); +s16 DecodeDspAdpcm(AXPBADPCM* pAdpcm, u8 bits); } // namespace detail } // namespace snd diff --git a/include/nw4r/ut/ut_FileStream.h b/include/nw4r/ut/ut_FileStream.h index 96a57ff8..71cf0fd8 100644 --- a/include/nw4r/ut/ut_FileStream.h +++ b/include/nw4r/ut/ut_FileStream.h @@ -9,8 +9,8 @@ namespace ut { class FileStream : public IOStream { public: NW4R_UT_RTTI_DECL(FileStream); - - enum SeekOrigin { SEEK_BEG, SEEK_CUR, SEEK_END }; + + enum SeekOrigin { SEEKORG_BEG, SEEKORG_CUR, SEEKORG_END }; class FilePosition { public: diff --git a/include/nw4r/ut/ut_algorithm.h b/include/nw4r/ut/ut_algorithm.h index 802d086f..b84f4247 100644 --- a/include/nw4r/ut/ut_algorithm.h +++ b/include/nw4r/ut/ut_algorithm.h @@ -9,29 +9,24 @@ namespace { /** * Value operations */ -template -inline T Max(T t1, T t2) { +template inline T Max(T t1, T t2) { return (t1 < t2) ? t2 : t1; } -template -inline T Min(T t1, T t2) { +template inline T Min(T t1, T t2) { return (t1 > t2) ? t2 : t1; } -template -inline T Clamp(T value, T min, T max) { +template inline T Clamp(T value, T min, T max) { return value > max ? max : (value < min ? min : value); } -template -inline T Abs(T x) { +template inline T Abs(T x) { // Static cast needed to break abs optimization during instruction selection return x < 0 ? static_cast(-x) : static_cast(x); } -template <> -f32 inline Abs(register f32 x) { +template <> f32 inline Abs(register f32 x) { register f32 ax; // clang-format off @@ -46,62 +41,59 @@ f32 inline Abs(register f32 x) { /** * Bit operations */ -template -inline T BitExtract(T bits, int pos, int len) { +template inline T BitExtract(T bits, int pos, int len) { T mask = (1 << len) - 1; return (bits >> pos) & mask; } -template -inline bool TestBit(T t, int bitIndexLSB) { - return BitExtract(t, sizeof(T), bitIndexLSB); +template inline bool TestBit(T t, int pos) { + return BitExtract(t, sizeof(T), pos); } /** * Pointer operations */ -inline u32 GetIntPtr(const void *ptr) { - return reinterpret_cast(ptr); +inline u32 GetIntPtr(const void* pPtr) { + return reinterpret_cast(pPtr); } template -inline const void *AddOffsetToPtr(const void *ptr, T offset) { - return reinterpret_cast(GetIntPtr(ptr) + offset); +inline const void* AddOffsetToPtr(const void* pBase, T offset) { + return reinterpret_cast(GetIntPtr(pBase) + offset); +} +template inline void* AddOffsetToPtr(void* pBase, T offset) { + return reinterpret_cast(GetIntPtr(pBase) + offset); } -inline s32 GetOffsetFromPtr(const void *start, const void *end) { - return static_cast(GetIntPtr(end) - GetIntPtr(start)); +inline s32 GetOffsetFromPtr(const void* pStart, const void* pEnd) { + return static_cast(GetIntPtr(pEnd) - GetIntPtr(pStart)); } -inline int ComparePtr(const void *p1, const void *p2) { - return static_cast(GetIntPtr(p1) - GetIntPtr(p2)); +inline int ComparePtr(const void* pPtr1, const void* pPtr2) { + return static_cast(GetIntPtr(pPtr1) - GetIntPtr(pPtr2)); } /** * Rounding */ -template -inline T RoundUp(T t, unsigned int alignment) { +template inline T RoundUp(T t, unsigned int alignment) { return (alignment + t - 1) & ~(alignment - 1); } -template -inline void *RoundUp(T *t, unsigned int alignment) { - u32 value = reinterpret_cast(t); +template inline void* RoundUp(T* pPtr, unsigned int alignment) { + u32 value = reinterpret_cast(pPtr); u32 rounded = (alignment + value - 1) & ~(alignment - 1); - return reinterpret_cast(rounded); + return reinterpret_cast(rounded); } -template -inline T RoundDown(T t, unsigned int alignment) { +template inline T RoundDown(T t, unsigned int alignment) { return t & ~(alignment - 1); } -template -inline void *RoundDown(T *t, unsigned int alignment) { - u32 value = reinterpret_cast(t); +template inline void* RoundDown(T* pPtr, unsigned int alignment) { + u32 value = reinterpret_cast(pPtr); u32 rounded = value & ~(alignment - 1); - return reinterpret_cast(rounded); + return reinterpret_cast(rounded); } } // namespace diff --git a/include/rvl/MEM.h b/include/rvl/MEM.h index 70cefb3d..18321f49 100644 --- a/include/rvl/MEM.h +++ b/include/rvl/MEM.h @@ -4,11 +4,11 @@ extern "C" { #endif -#include "rvl/MEM/mem_heapCommon.h" -#include "rvl/MEM/mem_allocator.h" -#include "rvl/MEM/mem_expHeap.h" -#include "rvl/MEM/mem_frameHeap.h" -#include "rvl/MEM/mem_list.h" +#include +#include +#include +#include +#include #ifdef __cplusplus } diff --git a/include/rvl/MEM/mem_expHeap.h b/include/rvl/MEM/mem_expHeap.h index bdf9e79a..be08516c 100644 --- a/include/rvl/MEM/mem_expHeap.h +++ b/include/rvl/MEM/mem_expHeap.h @@ -5,6 +5,10 @@ extern "C" { #endif +#define MEM_EXP_HEAP_MIN_SIZE \ + (sizeof(MEMiHeapHead) + sizeof(MEMiExpHeapHead) + \ + sizeof(MEMiExpHeapMBlock) + 4) + // Forward declarations typedef struct MEMiHeapHead; diff --git a/include/rvl/MEM/mem_frameHeap.h b/include/rvl/MEM/mem_frameHeap.h index a648fae5..e9c59c59 100644 --- a/include/rvl/MEM/mem_frameHeap.h +++ b/include/rvl/MEM/mem_frameHeap.h @@ -5,11 +5,19 @@ extern "C" { #endif +#define MEM_FRM_HEAP_MIN_SIZE (sizeof(MEMiHeapHead) + sizeof(MEMiFrmHeapHead)) + // Forward declarations typedef struct MEMiHeapHead; // Specify how to free memory -typedef enum { MEM_FRM_HEAP_FREE_TO_HEAD = (1 << 0), MEM_FRM_HEAP_FREE_TO_TAIL = (1 << 1) } MEMiFrmFreeFlag; +typedef enum { + MEM_FRM_HEAP_FREE_TO_HEAD = (1 << 0), + MEM_FRM_HEAP_FREE_TO_TAIL = (1 << 1), + MEM_FRM_HEAP_FREE_ALL = + MEM_FRM_HEAP_FREE_TO_HEAD | MEM_FRM_HEAP_FREE_TO_TAIL +} MEMiFrmFreeFlag; + typedef struct MEMiFrmHeapState { u32 id; // at 0x0 diff --git a/include/rvl/MEM/mem_heapCommon.h b/include/rvl/MEM/mem_heapCommon.h index 22b0b457..55a06524 100644 --- a/include/rvl/MEM/mem_heapCommon.h +++ b/include/rvl/MEM/mem_heapCommon.h @@ -2,7 +2,9 @@ #define RVL_SDK_MEM_HEAP_COMMON_H #include "rvl/MEM/mem_list.h" #include "rvl/OS.h" +#include #include + // #include "string.h" #ifdef __cplusplus extern "C" { @@ -73,12 +75,22 @@ static inline void LockHeap(MEMiHeapHead *heap) { } } -static inline void UnlockHeap(MEMiHeapHead *heap) { +static void UnlockHeap(MEMiHeapHead* heap) { if (GetOptForHeap(heap) & MEM_HEAP_OPT_CAN_LOCK) { OSUnlockMutex(&heap->mutex); } } +static void FillAllocMemory(MEMiHeapHead* heap, void* memBlock, u32 size) { + if (GetOptForHeap(heap) & MEM_HEAP_OPT_CLEAR_ALLOC) { + memset(memBlock, 0, size); + } +} + +static s32 MEMGetHeapTotalSize(MEMiHeapHead* heap) { + return GetOffsetFromPtr(heap, heap->end); +} + static void FillAllocMemory(MEMiHeapHead *heap, void *memBlock, u32 size); #ifdef __cplusplus diff --git a/include/rvl/WENC.h b/include/rvl/WENC.h new file mode 100644 index 00000000..aca777d1 --- /dev/null +++ b/include/rvl/WENC.h @@ -0,0 +1,12 @@ +#ifndef RVL_SDK_PUBLIC_WENC_H +#define RVL_SDK_PUBLIC_WENC_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/rvl/WENC/wenc.h b/include/rvl/WENC/wenc.h new file mode 100644 index 00000000..3e247ce8 --- /dev/null +++ b/include/rvl/WENC/wenc.h @@ -0,0 +1,28 @@ +#ifndef RVL_SDK_WENC_H +#define RVL_SDK_WENC_H +#include +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + WENC_FLAG_USER_INFO = (1 << 0), +} WENCFlag; + +typedef struct WENCInfo { + s32 xn; // at 0x0 + s32 dl; // at 0x4 + s32 qn; // at 0x8 + s32 dn; // at 0xC + s32 dlh; // at 0x10 + s32 dlq; // at 0x14 + u8 padding[8]; // at 0x18 +} WENCInfo; + +s32 WENCGetEncodeData(WENCInfo* info, u32 flag, const s16* pcmData, s32 samples, + u8* adpcmData); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp new file mode 100644 index 00000000..e09c9f25 --- /dev/null +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_AxManager.cpp b/src/nw4r/snd/snd_AxManager.cpp new file mode 100644 index 00000000..8dda5f6f --- /dev/null +++ b/src/nw4r/snd/snd_AxManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_AxVoice.cpp b/src/nw4r/snd/snd_AxVoice.cpp new file mode 100644 index 00000000..af1ef1b5 --- /dev/null +++ b/src/nw4r/snd/snd_AxVoice.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_AxVoiceManager.cpp b/src/nw4r/snd/snd_AxVoiceManager.cpp new file mode 100644 index 00000000..40cd94e6 --- /dev/null +++ b/src/nw4r/snd/snd_AxVoiceManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_AxfxImpl.cpp b/src/nw4r/snd/snd_AxfxImpl.cpp new file mode 100644 index 00000000..598b35bc --- /dev/null +++ b/src/nw4r/snd/snd_AxfxImpl.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Bank.cpp b/src/nw4r/snd/snd_Bank.cpp new file mode 100644 index 00000000..bc417748 --- /dev/null +++ b/src/nw4r/snd/snd_Bank.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_BankFile.cpp b/src/nw4r/snd/snd_BankFile.cpp new file mode 100644 index 00000000..5eb7fb71 --- /dev/null +++ b/src/nw4r/snd/snd_BankFile.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_BasicPlayer.cpp b/src/nw4r/snd/snd_BasicPlayer.cpp new file mode 100644 index 00000000..a857612d --- /dev/null +++ b/src/nw4r/snd/snd_BasicPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp new file mode 100644 index 00000000..6e555a0a --- /dev/null +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_BiquadFilterPreset.cpp b/src/nw4r/snd/snd_BiquadFilterPreset.cpp new file mode 100644 index 00000000..24f6e746 --- /dev/null +++ b/src/nw4r/snd/snd_BiquadFilterPreset.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_Channel.cpp b/src/nw4r/snd/snd_Channel.cpp new file mode 100644 index 00000000..7c9da7a9 --- /dev/null +++ b/src/nw4r/snd/snd_Channel.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_DisposeCallbackManager.cpp b/src/nw4r/snd/snd_DisposeCallbackManager.cpp new file mode 100644 index 00000000..c28dceff --- /dev/null +++ b/src/nw4r/snd/snd_DisposeCallbackManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_DvdSoundArchive.cpp b/src/nw4r/snd/snd_DvdSoundArchive.cpp new file mode 100644 index 00000000..ac765278 --- /dev/null +++ b/src/nw4r/snd/snd_DvdSoundArchive.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_EnvGenerator.cpp b/src/nw4r/snd/snd_EnvGenerator.cpp new file mode 100644 index 00000000..a145682a --- /dev/null +++ b/src/nw4r/snd/snd_EnvGenerator.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_ExternalSoundPlayer.cpp b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp new file mode 100644 index 00000000..01365145 --- /dev/null +++ b/src/nw4r/snd/snd_ExternalSoundPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FrameHeap.cpp b/src/nw4r/snd/snd_FrameHeap.cpp new file mode 100644 index 00000000..f7152e3f --- /dev/null +++ b/src/nw4r/snd/snd_FrameHeap.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FxBase.cpp b/src/nw4r/snd/snd_FxBase.cpp new file mode 100644 index 00000000..057ddd63 --- /dev/null +++ b/src/nw4r/snd/snd_FxBase.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FxChorus.cpp b/src/nw4r/snd/snd_FxChorus.cpp new file mode 100644 index 00000000..e09327a2 --- /dev/null +++ b/src/nw4r/snd/snd_FxChorus.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FxDelay.cpp b/src/nw4r/snd/snd_FxDelay.cpp new file mode 100644 index 00000000..458244c1 --- /dev/null +++ b/src/nw4r/snd/snd_FxDelay.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FxReverbHi.cpp b/src/nw4r/snd/snd_FxReverbHi.cpp new file mode 100644 index 00000000..27baa7d3 --- /dev/null +++ b/src/nw4r/snd/snd_FxReverbHi.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_FxReverbHiDpl2.cpp b/src/nw4r/snd/snd_FxReverbHiDpl2.cpp new file mode 100644 index 00000000..9f05b2d5 --- /dev/null +++ b/src/nw4r/snd/snd_FxReverbHiDpl2.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_FxReverbStd.cpp b/src/nw4r/snd/snd_FxReverbStd.cpp new file mode 100644 index 00000000..025c530d --- /dev/null +++ b/src/nw4r/snd/snd_FxReverbStd.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_FxReverbStdDpl2.cpp b/src/nw4r/snd/snd_FxReverbStdDpl2.cpp new file mode 100644 index 00000000..b3f2638e --- /dev/null +++ b/src/nw4r/snd/snd_FxReverbStdDpl2.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_InstancePool.cpp b/src/nw4r/snd/snd_InstancePool.cpp new file mode 100644 index 00000000..2da1bb1b --- /dev/null +++ b/src/nw4r/snd/snd_InstancePool.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Lfo.cpp b/src/nw4r/snd/snd_Lfo.cpp new file mode 100644 index 00000000..4bb4300a --- /dev/null +++ b/src/nw4r/snd/snd_Lfo.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_MemorySoundArchive.cpp b/src/nw4r/snd/snd_MemorySoundArchive.cpp new file mode 100644 index 00000000..b020a091 --- /dev/null +++ b/src/nw4r/snd/snd_MemorySoundArchive.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_MidiSeqPlayer.cpp b/src/nw4r/snd/snd_MidiSeqPlayer.cpp new file mode 100644 index 00000000..8325b2bd --- /dev/null +++ b/src/nw4r/snd/snd_MidiSeqPlayer.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_MmlParser.cpp b/src/nw4r/snd/snd_MmlParser.cpp new file mode 100644 index 00000000..b5321cdd --- /dev/null +++ b/src/nw4r/snd/snd_MmlParser.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_MmlSeqTrack.cpp b/src/nw4r/snd/snd_MmlSeqTrack.cpp new file mode 100644 index 00000000..6c86739c --- /dev/null +++ b/src/nw4r/snd/snd_MmlSeqTrack.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp b/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp new file mode 100644 index 00000000..b31f212a --- /dev/null +++ b/src/nw4r/snd/snd_MmlSeqTrackAllocator.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_NandSoundArchive.cpp b/src/nw4r/snd/snd_NandSoundArchive.cpp new file mode 100644 index 00000000..d16c4ac6 --- /dev/null +++ b/src/nw4r/snd/snd_NandSoundArchive.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_PlayerHeap.cpp b/src/nw4r/snd/snd_PlayerHeap.cpp new file mode 100644 index 00000000..75ea87b2 --- /dev/null +++ b/src/nw4r/snd/snd_PlayerHeap.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_RemoteSpeaker.cpp b/src/nw4r/snd/snd_RemoteSpeaker.cpp new file mode 100644 index 00000000..e0e6fb63 --- /dev/null +++ b/src/nw4r/snd/snd_RemoteSpeaker.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_RemoteSpeakerManager.cpp b/src/nw4r/snd/snd_RemoteSpeakerManager.cpp new file mode 100644 index 00000000..7be22856 --- /dev/null +++ b/src/nw4r/snd/snd_RemoteSpeakerManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SeqFile.cpp b/src/nw4r/snd/snd_SeqFile.cpp new file mode 100644 index 00000000..ef8da3d9 --- /dev/null +++ b/src/nw4r/snd/snd_SeqFile.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SeqPlayer.cpp b/src/nw4r/snd/snd_SeqPlayer.cpp new file mode 100644 index 00000000..28a95541 --- /dev/null +++ b/src/nw4r/snd/snd_SeqPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SeqSound.cpp b/src/nw4r/snd/snd_SeqSound.cpp new file mode 100644 index 00000000..201ba9d2 --- /dev/null +++ b/src/nw4r/snd/snd_SeqSound.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SeqSoundHandle.cpp b/src/nw4r/snd/snd_SeqSoundHandle.cpp new file mode 100644 index 00000000..2c69a9cf --- /dev/null +++ b/src/nw4r/snd/snd_SeqSoundHandle.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SeqTrack.cpp b/src/nw4r/snd/snd_SeqTrack.cpp new file mode 100644 index 00000000..14af5d5b --- /dev/null +++ b/src/nw4r/snd/snd_SeqTrack.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Sound3DActor.cpp b/src/nw4r/snd/snd_Sound3DActor.cpp new file mode 100644 index 00000000..e4460d7a --- /dev/null +++ b/src/nw4r/snd/snd_Sound3DActor.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Sound3DCalculator.cpp b/src/nw4r/snd/snd_Sound3DCalculator.cpp new file mode 100644 index 00000000..a5b89074 --- /dev/null +++ b/src/nw4r/snd/snd_Sound3DCalculator.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_Sound3DEngine.cpp b/src/nw4r/snd/snd_Sound3DEngine.cpp new file mode 100644 index 00000000..12765498 --- /dev/null +++ b/src/nw4r/snd/snd_Sound3DEngine.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_Sound3DListener.cpp b/src/nw4r/snd/snd_Sound3DListener.cpp new file mode 100644 index 00000000..9ba1c070 --- /dev/null +++ b/src/nw4r/snd/snd_Sound3DListener.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Sound3DManager.cpp b/src/nw4r/snd/snd_Sound3DManager.cpp new file mode 100644 index 00000000..4e71a6e6 --- /dev/null +++ b/src/nw4r/snd/snd_Sound3DManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundActor.cpp b/src/nw4r/snd/snd_SoundActor.cpp new file mode 100644 index 00000000..abac5894 --- /dev/null +++ b/src/nw4r/snd/snd_SoundActor.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundArchive.cpp b/src/nw4r/snd/snd_SoundArchive.cpp new file mode 100644 index 00000000..f0ef4889 --- /dev/null +++ b/src/nw4r/snd/snd_SoundArchive.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundArchiveFile.cpp b/src/nw4r/snd/snd_SoundArchiveFile.cpp new file mode 100644 index 00000000..6b6ee691 --- /dev/null +++ b/src/nw4r/snd/snd_SoundArchiveFile.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundArchiveLoader.cpp b/src/nw4r/snd/snd_SoundArchiveLoader.cpp new file mode 100644 index 00000000..9bdc00e1 --- /dev/null +++ b/src/nw4r/snd/snd_SoundArchiveLoader.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundArchivePlayer.cpp b/src/nw4r/snd/snd_SoundArchivePlayer.cpp new file mode 100644 index 00000000..8a1e2e48 --- /dev/null +++ b/src/nw4r/snd/snd_SoundArchivePlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundHandle.cpp b/src/nw4r/snd/snd_SoundHandle.cpp new file mode 100644 index 00000000..6562d142 --- /dev/null +++ b/src/nw4r/snd/snd_SoundHandle.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundHeap.cpp b/src/nw4r/snd/snd_SoundHeap.cpp new file mode 100644 index 00000000..349ca05c --- /dev/null +++ b/src/nw4r/snd/snd_SoundHeap.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundPlayer.cpp b/src/nw4r/snd/snd_SoundPlayer.cpp new file mode 100644 index 00000000..44105d1a --- /dev/null +++ b/src/nw4r/snd/snd_SoundPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundStartable.cpp b/src/nw4r/snd/snd_SoundStartable.cpp new file mode 100644 index 00000000..867e6b06 --- /dev/null +++ b/src/nw4r/snd/snd_SoundStartable.cpp @@ -0,0 +1 @@ +#include \ No newline at end of file diff --git a/src/nw4r/snd/snd_SoundSystem.cpp b/src/nw4r/snd/snd_SoundSystem.cpp new file mode 100644 index 00000000..5f240adc --- /dev/null +++ b/src/nw4r/snd/snd_SoundSystem.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_SoundThread.cpp b/src/nw4r/snd/snd_SoundThread.cpp new file mode 100644 index 00000000..0ed49fb7 --- /dev/null +++ b/src/nw4r/snd/snd_SoundThread.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_StrmChannel.cpp b/src/nw4r/snd/snd_StrmChannel.cpp new file mode 100644 index 00000000..6e101201 --- /dev/null +++ b/src/nw4r/snd/snd_StrmChannel.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_StrmFile.cpp b/src/nw4r/snd/snd_StrmFile.cpp new file mode 100644 index 00000000..19796df8 --- /dev/null +++ b/src/nw4r/snd/snd_StrmFile.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_StrmPlayer.cpp b/src/nw4r/snd/snd_StrmPlayer.cpp new file mode 100644 index 00000000..40ba5ba0 --- /dev/null +++ b/src/nw4r/snd/snd_StrmPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_StrmSound.cpp b/src/nw4r/snd/snd_StrmSound.cpp new file mode 100644 index 00000000..afd58488 --- /dev/null +++ b/src/nw4r/snd/snd_StrmSound.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_StrmSoundHandle.cpp b/src/nw4r/snd/snd_StrmSoundHandle.cpp new file mode 100644 index 00000000..46708077 --- /dev/null +++ b/src/nw4r/snd/snd_StrmSoundHandle.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Task.cpp b/src/nw4r/snd/snd_Task.cpp new file mode 100644 index 00000000..49d2abfe --- /dev/null +++ b/src/nw4r/snd/snd_Task.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_TaskManager.cpp b/src/nw4r/snd/snd_TaskManager.cpp new file mode 100644 index 00000000..14adc5a9 --- /dev/null +++ b/src/nw4r/snd/snd_TaskManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_TaskThread.cpp b/src/nw4r/snd/snd_TaskThread.cpp new file mode 100644 index 00000000..bd8371fb --- /dev/null +++ b/src/nw4r/snd/snd_TaskThread.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Util.cpp b/src/nw4r/snd/snd_Util.cpp new file mode 100644 index 00000000..28cfa88d --- /dev/null +++ b/src/nw4r/snd/snd_Util.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_Voice.cpp b/src/nw4r/snd/snd_Voice.cpp new file mode 100644 index 00000000..fa0846a8 --- /dev/null +++ b/src/nw4r/snd/snd_Voice.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_VoiceManager.cpp b/src/nw4r/snd/snd_VoiceManager.cpp new file mode 100644 index 00000000..2ab38dcb --- /dev/null +++ b/src/nw4r/snd/snd_VoiceManager.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_WaveArchive.cpp b/src/nw4r/snd/snd_WaveArchive.cpp new file mode 100644 index 00000000..8746f935 --- /dev/null +++ b/src/nw4r/snd/snd_WaveArchive.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_WaveFile.cpp b/src/nw4r/snd/snd_WaveFile.cpp new file mode 100644 index 00000000..ce520003 --- /dev/null +++ b/src/nw4r/snd/snd_WaveFile.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_WaveSound.cpp b/src/nw4r/snd/snd_WaveSound.cpp new file mode 100644 index 00000000..183cbb69 --- /dev/null +++ b/src/nw4r/snd/snd_WaveSound.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_WaveSoundHandle.cpp b/src/nw4r/snd/snd_WaveSoundHandle.cpp new file mode 100644 index 00000000..cd4eda6b --- /dev/null +++ b/src/nw4r/snd/snd_WaveSoundHandle.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_WsdFile.cpp b/src/nw4r/snd/snd_WsdFile.cpp new file mode 100644 index 00000000..2e9866c6 --- /dev/null +++ b/src/nw4r/snd/snd_WsdFile.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/snd/snd_WsdPlayer.cpp b/src/nw4r/snd/snd_WsdPlayer.cpp new file mode 100644 index 00000000..d48f49f3 --- /dev/null +++ b/src/nw4r/snd/snd_WsdPlayer.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_adpcm.cpp b/src/nw4r/snd/snd_adpcm.cpp new file mode 100644 index 00000000..e4e79102 --- /dev/null +++ b/src/nw4r/snd/snd_adpcm.cpp @@ -0,0 +1 @@ +#include diff --git a/src/nw4r/snd/snd_debug.cpp b/src/nw4r/snd/snd_debug.cpp new file mode 100644 index 00000000..dad0b031 --- /dev/null +++ b/src/nw4r/snd/snd_debug.cpp @@ -0,0 +1 @@ +// #include diff --git a/src/nw4r/ut/ut_DvdFileStream.cpp b/src/nw4r/ut/ut_DvdFileStream.cpp index 8c7b2d8a..249d1659 100644 --- a/src/nw4r/ut/ut_DvdFileStream.cpp +++ b/src/nw4r/ut/ut_DvdFileStream.cpp @@ -66,7 +66,7 @@ bool DvdFileStream::Open(s32 entrynum) { if (DVDFastOpen(entrynum, &mAsyncContext.info)) { mFilePosition.SetFileSize(mAsyncContext.info.size); - mFilePosition.Seek(0, SEEK_BEG); + mFilePosition.Seek(0, SEEKORG_BEG); mCloseOnDestroy = true; mAllowClose = true; @@ -85,7 +85,7 @@ bool DvdFileStream::Open(const DVDFileInfo *info, bool close) { mAsyncContext.info = *info; mFilePosition.SetFileSize(mAsyncContext.info.size); - mFilePosition.Seek(0, SEEK_BEG); + mFilePosition.Seek(0, SEEKORG_BEG); mCloseOnDestroy = false; mAllowClose = close; diff --git a/src/nw4r/ut/ut_FileStream.cpp b/src/nw4r/ut/ut_FileStream.cpp index e7329a50..da46710f 100644 --- a/src/nw4r/ut/ut_FileStream.cpp +++ b/src/nw4r/ut/ut_FileStream.cpp @@ -39,13 +39,13 @@ u32 FileStream::FilePosition::Append(s32 offset) { void FileStream::FilePosition::Seek(s32 offset, u32 origin) { switch (origin) { - case SEEK_BEG: + case SEEKORG_BEG: mFileOffset = 0; break; - case SEEK_END: + case SEEKORG_END: mFileOffset = mFileSize; break; - case SEEK_CUR: + case SEEKORG_CUR: default: break; } diff --git a/src/nw4r/ut/ut_NandFileStream.cpp b/src/nw4r/ut/ut_NandFileStream.cpp index 118e2941..4b2c7bb8 100644 --- a/src/nw4r/ut/ut_NandFileStream.cpp +++ b/src/nw4r/ut/ut_NandFileStream.cpp @@ -71,7 +71,7 @@ bool NandFileStream::Open(const char *path, u32 access) { mFilePosition.SetFileSize(fileSize); } - mFilePosition.Seek(0, SEEK_BEG); + mFilePosition.Seek(0, SEEKORG_BEG); mCloseOnDestroy = true; mAllowClose = true; @@ -100,7 +100,7 @@ bool NandFileStream::Open(const NANDFileInfo *info, u32 access, bool close) { } mFilePosition.SetFileSize(fileSize); } - mFilePosition.Seek(0, SEEK_BEG); + mFilePosition.Seek(0, SEEKORG_BEG); mCloseOnDestroy = false; mAllowClose = close;