work on Z2SoundMgr and Z2SeMgr (#2055)

This commit is contained in:
Caroline Madsen
2024-01-30 19:08:37 -05:00
committed by GitHub
parent 1c891adeb8
commit 255cc868e4
49 changed files with 1341 additions and 980 deletions
+1 -1
View File
@@ -415,7 +415,7 @@ asm bool Z2AudioMgr::hasReset() const {
* startSound__10Z2AudioMgrF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
// vtable order
#ifdef NONMATCHING
int Z2AudioMgr::startSound(JAISoundID param_0, JAISoundHandle* param_1,
bool Z2AudioMgr::startSound(JAISoundID param_0, JAISoundHandle* param_1,
JGeometry::TVec3<f32> const* param_2) {
if (mResettingFlag) {
return 0;
+1 -1
View File
@@ -1145,7 +1145,7 @@ Z2SoundHandlePool* Z2CreatureOI::startCreatureSoundLevel(JAISoundID i_soundID, u
* startTentacleSound__12Z2CreatureOIF10JAISoundIDUcUlSc */
Z2SoundHandlePool* Z2CreatureOI::startTentacleSound(JAISoundID i_soundID, u8 param_1, u32 param_2,
s8 param_3) {
mTentacleSounds[param_1].startSound(i_soundID, param_2, param_3);
return mTentacleSounds[param_1].startSound(i_soundID, param_2, param_3);
}
/* 802C2CD4-802C2DE0 2BD614 010C+00 0/0 0/0 1/1 .text
+2 -2
View File
@@ -634,7 +634,7 @@ SECTION_SDATA2 static f32 lit_4399 = 9.0f / 10.0f;
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm int Z2LinkSoundStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
asm bool Z2LinkSoundStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
JGeometry::TVec3<f32> const* param_2, u32 param_3,
f32 param_4, f32 param_5, f32 param_6, f32 param_7,
f32 param_8, u32 param_9) {
@@ -697,7 +697,7 @@ Z2RideSoundStarter::Z2RideSoundStarter(Z2CreatureRide* ride) : Z2SoundStarter(fa
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm int Z2RideSoundStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
asm bool Z2RideSoundStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
JGeometry::TVec3<f32> const* param_2, u32 param_3,
f32 param_4, f32 param_5, f32 param_6, f32 param_7,
f32 param_8, u32 param_9) {
+7 -2
View File
@@ -160,8 +160,13 @@ f32 Z2Param::ENEMY_LASTHIT_MUTE_VOLUME;
/* 80451340 0001+00 data_80451340 None */
/* 80451341 0001+00 data_80451341 None */
/* 80451342 0006+00 data_80451342 None */
extern u8 struct_80451340[8];
u8 struct_80451340[8];
#pragma push
#pragma force_active on
u8 struct_80451340;
u8 struct_80451341;
u8 struct_80451342;
u8 pad_80451344[4];
#pragma pop
/* 80451348-80451350 000848 0008+00 0/0 4/4 0/0 .sbss None */
extern u8 data_80451348[8];
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -92,7 +92,7 @@ u16 Z2SoundInfo::getBgmSeqResourceID(JAISoundID param_0) const {
}
/* 802BB090-802BB0D8 2B59D0 0048+00 1/0 0/0 0/0 .text getSoundType__11Z2SoundInfoCF10JAISoundID */
u32 Z2SoundInfo::getSoundType(JAISoundID param_0) const {
int Z2SoundInfo::getSoundType(JAISoundID param_0) const {
switch (param_0.mId.mBytes.b0) {
case 0:
return 0;
+361 -88
View File
@@ -4,33 +4,17 @@
//
#include "Z2AudioLib/Z2SoundMgr.h"
#include "Z2AudioLib/Z2Param.h"
#include "Z2AudioLib/Z2SceneMgr.h"
#include "Z2AudioLib/Z2SeMgr.h"
#include "Z2AudioLib/Z2SeqMgr.h"
#include "Z2AudioLib/Z2SoundInfo.h"
#include "Z2AudioLib/Z2SpeechMgr2.h"
#include "JSystem/JAudio2/JASCalc.h"
#include "JSystem/JAudio2/JASDriverIF.h"
#include "JSystem/JAudio2/JAUSectionHeap.h"
#include "dol2asm.h"
//
// Types:
//
struct Z2SpeechMgr2 {
/* 802CC190 */ void speakOneWord(bool);
};
struct Z2SoundInfo {
/* 802BBAC8 */ void getSwBit(JAISoundID) const;
};
struct JAUSectionHeap {
/* 802A5EC0 */ void loadDynamicSeq(JAISoundID, bool);
/* 802A5EF8 */ void releaseIdleDynamicSeqDataBlock();
};
struct JASDriver {
/* 8029E188 */ void waitSubFrame();
};
struct JASCalc {
static u8 const CUTOFF_TO_IIR_TABLE[1024];
};
//
// Forward References:
//
@@ -53,6 +37,8 @@ extern "C" void multiVolumeSoundID__10Z2SoundMgrF10JAISoundIDf();
extern "C" void isPlayingSoundID__10Z2SoundMgrF10JAISoundID();
extern "C" extern char const* const Z2SoundMgr__stringBase0;
void dComIfGs_staffroll_next_go();
//
// External References:
//
@@ -106,7 +92,6 @@ extern "C" void _restgpr_25();
extern "C" void _restgpr_26();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void sprintf();
extern "C" u8 const CUTOFF_TO_IIR_TABLE__7JASCalc[1024];
extern "C" extern u8 data_80450B4C[4];
extern "C" extern u8 data_80450B70[4];
@@ -114,7 +99,6 @@ extern "C" extern u8 data_80450B80[4];
extern "C" extern u8 data_80450B84[4];
extern "C" extern u8 data_80450B88[4];
extern "C" extern u8 data_80450CC0[4 + 4 /* padding */];
extern "C" extern u8 struct_80451340[8];
extern "C" extern u8 __OSReport_disable;
//
@@ -155,6 +139,90 @@ SECTION_SDATA2 static f32 lit_3688 = 1.0f;
SECTION_SDATA2 static f32 lit_3689 = -1.0f;
/* 802A9BC8-802A9E80 2A4508 02B8+00 1/0 1/1 0/0 .text seqCallback__FP8JASTrackUs */
#ifdef NONMATCHING
// matches with literals
u16 seqCallback(JASTrack* i_track, u16 param_1) {
JSUList<JAISe>* list;
switch (param_1) {
case 0x1000:
Z2GetSeqMgr()->setChildTrackVolume(Z2GetSeqMgr()->getSubBgmHandle(),
3, 1.0f, 0, -1.0f, -1.0f);
Z2GetSoundMgr()->getSeqMgr()->calc();
Z2GetSoundMgr()->getSeqMgr()->mixOut();
break;
case 0x1001:
Z2GetSeqMgr()->onFieldBgmJumpStart();
break;
case 0x1002:
Z2GetSeqMgr()->onFieldBgmJumpEnd();
break;
case 0x1003:
Z2GetSpeechMgr2()->speakOneWord(true);
break;
case 0x1004:
Z2GetSeqMgr()->onVariantBgmJumpEnd(true);
break;
case 0x1005:
Z2GetSeqMgr()->onVariantBgmJumpEnd(false);
break;
case 0x1006:
list = Z2GetSoundMgr()->getSeMgr()->getCategory(5)->getSeList();
for (JSULink<JAISe>* link = list->getFirst(); link != NULL; link = link->getNext()) {
switch (link->getObject()->getID()) {
case Z2SE_GRO_MV_SINGING:
case Z2SE_GRR_MV_SINGING:
case Z2SE_CLERK_MV_SONG_HO:
case Z2SE_WAD_A_MV_DANCE:
case Z2SE_MCN_A_V_DANCE:
case Z2SE_WCN_A_V_DANCE:
link->getObject()->getTrack()->writePort(14, 1);
break;
}
}
break;
case 0x1015:
list = Z2GetSoundMgr()->getSeMgr()->getCategory(5)->getSeList();
for (JSULink<JAISe>* link = list->getFirst(); link != NULL; link = link->getNext()) {
switch (link->getObject()->getID()) {
case Z2SE_MCN_A_V_DANCE:
case Z2SE_WCN_A_V_DANCE:
link->getObject()->getTrack()->writePort(14, 1);
break;
}
}
break;
case 0x1007:
Z2GetSeqMgr()->changeBgmStatus(7);
break;
case 0x1008:
Z2GetSeqMgr()->changeBgmStatus(8);
break;
case 0x1014:
dComIfGs_staffroll_next_go();
break;
}
if (param_1 >= 0x1009 && param_1 <= 0x1013) {
JAISoundID sound_id = Z2SE_CSL_TOWN_BAND_VOCAL;
if (param_1 <= 0x100a) {
sound_id = Z2SE_CSL_TOWN_BAND_GT_1;
} else if (param_1 <= 0x100c) {
sound_id = Z2SE_CSL_TOWN_BAND_GT_2;
} else if (param_1 <= 0x100f) {
sound_id = Z2SE_CSL_TOWN_BAND_GT_3;
} else if (param_1 <= 0x1011) {
sound_id = Z2SE_CSL_TOWN_BAND_FLUTE;
}
list = Z2GetSoundMgr()->getSeMgr()->getCategory(6)->getSeList();
for (JSULink<JAISe>* link = list->getFirst(); link != NULL; link = link->getNext()) {
if (link->getObject()->getID() == sound_id) {
link->getObject()->getTrack()->writePort(14, param_1);
break;
}
}
}
return 0;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -163,6 +231,7 @@ asm u16 seqCallback(JASTrack* param_0, u16 param_1) {
#include "asm/Z2AudioLib/Z2SoundMgr/seqCallback__FP8JASTrackUs.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 803C9D70-803C9D80 026E90 000C+04 1/1 1/1 0/0 .data __vt__10Z2SoundMgr */
@@ -175,6 +244,17 @@ SECTION_DATA extern void* __vt__10Z2SoundMgr[3 + 1 /* padding */] = {
};
/* 802A9E80-802A9EE8 2A47C0 0068+00 0/0 1/1 0/0 .text __ct__10Z2SoundMgrFv */
#ifdef NONMATCHING
// matches but generates an extra weak function
Z2SoundMgr::Z2SoundMgr() :
JASGlobalInstance<Z2SoundMgr>(this),
mSeMgr(true),
mSeqMgr(true),
mStreamMgr(true)
{
mSoundID.setAnonymous();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -183,6 +263,7 @@ asm Z2SoundMgr::Z2SoundMgr() {
#include "asm/Z2AudioLib/Z2SoundMgr/__ct__10Z2SoundMgrFv.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 8039B9D0-8039B9D0 028030 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
@@ -209,6 +290,64 @@ SECTION_SDATA2 static f64 lit_3909 = 4503599627370496.0 /* cast u32 to float */;
/* 802A9EE8-802AA1B0 2A4828 02C8+00 1/0 0/0 0/0 .text
* startSound__10Z2SoundMgrF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
#ifdef NONMATCHING
// matches with literals
bool Z2SoundMgr::startSound(JAISoundID i_soundID, JAISoundHandle* i_handle,
JGeometry::TVec3<f32> const* i_pos) {
switch (Z2GetSoundInfo()->getSoundType(i_soundID)) {
case 0:
if (Z2GetSoundInfo()->getSwBit(i_soundID) & 8) {
Z2GetSeqMgr()->bgmAllMute(3, 0.3f);
mSoundID = i_soundID;
}
return mSeMgr.startSound(i_soundID, i_handle, i_pos);
case 1:
if (i_soundID == Z2BGM_LUTERA_DEMO) {
Z2GetSeqMgr()->bgmStart(Z2BGM_LUTERA2, 0, 0);
Z2GetSeqMgr()->i_unMuteSceneBgm(0);
Z2GetSeqMgr()->changeBgmStatus(0);
return mSeMgr.startSound(Z2SE_NO_SOUND, i_handle, i_pos);
} else {
bool loaded = false;
JAUSectionHeap* heap = JASGlobalInstance<JAUSectionHeap>::getInstance();
JAUSeqDataBlocks const& loaded_blocks =
heap->getSectionHeapData().seqDataBlocks.getLoadedBlocks();
JSULink<JAUSeqDataBlock>* link;
for (link = loaded_blocks.getFirst(); link != NULL; link = link->getNext()) {
if (link->getObject()->field_0x10 == i_soundID) {
loaded = true;
break;
}
}
if (!loaded) {
heap->releaseIdleDynamicSeqDataBlock();
if (!heap->loadDynamicSeq(i_soundID, true)) {
JAUSeqDataBlocks const& free_blocks =
heap->getSectionHeapData().seqDataBlocks.getFreeBlocks();
for (link = free_blocks.getFirst(); link != NULL; link = link->getNext()) {
}
}
}
return mSeqMgr.startSound(i_soundID, i_handle, i_pos);
}
case 2:
if (i_soundID == 0x2000001 || i_soundID == 0x200004d) {
mStreamMgr.stop(180);
return mSeMgr.startSound(Z2SE_NO_SOUND, i_handle, i_pos);
}
if (i_soundID == 0x2000005) {
mSeMgr.getCategory(9)->pause(false);
mSeMgr.getCategory(9)->getParams()->moveVolume(1.0f, 45);
}
return mStreamMgr.startSound(i_soundID, i_handle, i_pos);
default:
char error[32];
sprintf(error, "Unknown Sound-Type id :%08x\n", (u32)i_soundID);
return false;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -218,8 +357,22 @@ asm bool Z2SoundMgr::startSound(JAISoundID param_0, JAISoundHandle* param_1,
#include "asm/Z2AudioLib/Z2SoundMgr/func_802A9EE8.s"
}
#pragma pop
#endif
/* 802AA1B0-802AA270 2A4AF0 00C0+00 2/2 0/0 0/0 .text calc__10Z2SoundMgrFv */
#ifdef NONMATCHING
void Z2SoundMgr::calc() {
mSeMgr.calc();
if (!mSoundID.isAnonymous() && !isPlayingSoundID(mSoundID)) {
if (Z2GetSceneMgr()->isSceneExist()) {
Z2GetSeqMgr()->bgmAllUnMute(3);
}
mSoundID.setAnonymous();
}
mSeqMgr.calc();
mStreamMgr.calc();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -228,67 +381,148 @@ asm void Z2SoundMgr::calc() {
#include "asm/Z2AudioLib/Z2SoundMgr/calc__10Z2SoundMgrFv.s"
}
#pragma pop
#endif
/* 802AA270-802AA33C 2A4BB0 00CC+00 1/1 2/2 0/0 .text setIIR__10Z2SoundMgrFP8JAISoundPCs
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::setIIR(JAISound* param_0, s16 const* param_1) {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/setIIR__10Z2SoundMgrFP8JAISoundPCs.s"
void Z2SoundMgr::setIIR(JAISound* param_0, s16 const* param_1) {
if (param_0 != NULL) {
JASTrack* track = param_0->getTrack();
for (u32 i = 0; i < 4; i++) {
JASTrack* child = track->getChild(i);
if (child != NULL && child->getStatus() == 1) {
child->setIIR(param_1);
for (u32 j = 0; j < 4; j++) {
JASTrack* child2 = child->getChild(j);
if (child2 != NULL && child2->getStatus() == 1) {
child2->setIIR(param_1);
}
}
}
}
}
}
#pragma pop
/* ############################################################################################## */
/* 8039B9C0-8039B9D0 028020 0010+00 1/1 0/0 0/0 .rodata cResetFilterTable */
SECTION_RODATA static u8 const cResetFilterTable[16] = {
0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
static s16 const cResetFilterTable[8] = {
0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
COMPILER_STRIP_GATE(0x8039B9C0, &cResetFilterTable);
/* 802AA33C-802AA430 2A4C7C 00F4+00 1/1 0/0 0/0 .text setFilterOff__10Z2SoundMgrFP8JAISound */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::setFilterOff(JAISound* param_0) {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/setFilterOff__10Z2SoundMgrFP8JAISound.s"
void Z2SoundMgr::setFilterOff(JAISound* param_0) {
if (param_0 != NULL) {
JASTrack* track = param_0->getTrack();
for (u32 i = 0; i < 4; i++) {
JASTrack* child = track->getChild(i);
if (child != NULL && child->getStatus() == 1) {
child->setIIR(cResetFilterTable);
child->setFIR(cResetFilterTable);
for (u32 j = 0; j < 4; j++) {
JASTrack* child2 = child->getChild(j);
if (child2 != NULL && child2->getStatus() == 1) {
child2->setIIR(cResetFilterTable);
child2->setFIR(cResetFilterTable);
}
}
}
}
}
}
#pragma pop
/* 802AA430-802AA528 2A4D70 00F8+00 0/0 1/1 0/0 .text resetFilterAll__10Z2SoundMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::resetFilterAll() {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/resetFilterAll__10Z2SoundMgrFv.s"
void Z2SoundMgr::resetFilterAll() {
int i = 1;
if (struct_80451342 != 0) {
i = 0;
}
for (; i < 9; i++) {
JAISeCategoryMgr* category = mSeMgr.getCategory(i);
int se_count = category->getMaxActiveSe();
if (se_count > 0) {
for (JSULink<JAISe>* link = category->getSeList()->getFirst();
link != NULL && se_count > 0 && !link->getObject()->isFarAway();
link = link->getNext(), se_count--)
{
setFilterOff(link->getObject());
}
} else {
for (JSULink<JAISe>* link = category->getSeList()->getFirst();
link != NULL && !link->getObject()->isFarAway();
link = link->getNext())
{
setFilterOff(link->getObject());
}
}
}
}
#pragma pop
/* 802AA528-802AA67C 2A4E68 0154+00 2/2 0/0 0/0 .text mixOut__10Z2SoundMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::mixOut() {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/mixOut__10Z2SoundMgrFv.s"
void Z2SoundMgr::mixOut() {
if (struct_80451340 != 0 && Z2GetSceneMgr()->isInDarkness()) {
int i = 1;
if (struct_80451342 != 0) {
i = 0;
}
for (; i < 9; i++) {
JAISeCategoryMgr* category = mSeMgr.getCategory(i);
int se_count = category->getMaxActiveSe();
if (se_count > 0) {
for (JSULink<JAISe>* link = category->getSeList()->getFirst();
link != NULL && se_count > 0 && !link->getObject()->isFarAway();
link = link->getNext(), se_count--)
{
setIIR(link->getObject(), JASCalc::CUTOFF_TO_IIR_TABLE[struct_80451341]);
}
} else {
for (JSULink<JAISe>* link = category->getSeList()->getFirst();
link != NULL && !link->getObject()->isFarAway();
link = link->getNext())
{
setIIR(link->getObject(), JASCalc::CUTOFF_TO_IIR_TABLE[struct_80451341]);
}
}
}
}
mSeMgr.mixOut();
mSeqMgr.mixOut();
mStreamMgr.mixOut();
}
#pragma pop
/* 802AA67C-802AA6B0 2A4FBC 0034+00 0/0 1/1 0/0 .text framework__10Z2SoundMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::framework() {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/framework__10Z2SoundMgrFv.s"
void Z2SoundMgr::framework() {
calc();
mixOut();
}
#pragma pop
/* 802AA6B0-802AA7DC 2A4FF0 012C+00 0/0 1/1 0/0 .text pauseAllGameSound__10Z2SoundMgrFb
*/
#ifdef NONMATCHING
// matches with literals
void Z2SoundMgr::pauseAllGameSound(bool i_pause) {
mSeMgr.getCategory(0)->pause(i_pause);
mSeMgr.getCategory(1)->pause(i_pause);
mSeMgr.getCategory(2)->pause(i_pause);
mSeMgr.getCategory(3)->pause(i_pause);
mSeMgr.getCategory(4)->pause(i_pause);
mSeMgr.getCategory(5)->pause(i_pause);
mSeMgr.getCategory(6)->pause(i_pause);
mSeMgr.getCategory(7)->pause(i_pause);
mSeMgr.getCategory(8)->pause(i_pause);
mSeMgr.getCategory(9)->pause(i_pause);
mSeqMgr.pause(i_pause);
mStreamMgr.pause(i_pause);
if (i_pause) {
Z2GetSeMgr()->seMoveVolumeAll(0.0f, 10);
mSeqMgr.getParams()->moveVolume(0.0f, 10);
mStreamMgr.getParams()->moveVolume(0.0f, 10);
}
else {
Z2GetSeMgr()->seMoveVolumeAll(1.0f, 10);
mSeqMgr.getParams()->moveVolume(1.0f, 10);
mStreamMgr.getParams()->moveVolume(1.0f, 10);
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -297,36 +531,34 @@ asm void Z2SoundMgr::pauseAllGameSound(bool param_0) {
#include "asm/Z2AudioLib/Z2SoundMgr/pauseAllGameSound__10Z2SoundMgrFb.s"
}
#pragma pop
#endif
/* 802AA7DC-802AA84C 2A511C 0070+00 0/0 1/1 0/0 .text stopSoundID__10Z2SoundMgrF10JAISoundID */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::stopSoundID(JAISoundID param_0) {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/stopSoundID__10Z2SoundMgrF10JAISoundID.s"
void Z2SoundMgr::stopSoundID(JAISoundID i_soundID) {
mSeMgr.stopSoundID(i_soundID);
mSeqMgr.stopSoundID(i_soundID);
mStreamMgr.stopSoundID(i_soundID);
}
#pragma pop
/* 802AA84C-802AA8C8 2A518C 007C+00 0/0 1/1 0/0 .text stopSync__10Z2SoundMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::stopSync() {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/stopSync__10Z2SoundMgrFv.s"
void Z2SoundMgr::stopSync() {
stop();
while (mSeMgr.getNumActiveSe() > 0 || mSeqMgr.getNumActiveSeqs() > 0) {
calc();
if (mSeMgr.getNumActiveSe() == 0 && mSeqMgr.getNumActiveSeqs() == 0) {
break;
}
mixOut();
JASDriver::waitSubFrame();
}
}
#pragma pop
/* 802AA8C8-802AA908 2A5208 0040+00 1/1 0/0 0/0 .text stop__10Z2SoundMgrFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::stop() {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/stop__10Z2SoundMgrFv.s"
void Z2SoundMgr::stop() {
mSeMgr.stop();
mSeqMgr.stop();
mStreamMgr.stop();
}
#pragma pop
/* ############################################################################################## */
/* 80455850-80455858 003E50 0004+04 1/1 0/0 0/0 .sdata2 @4313 */
@@ -337,6 +569,14 @@ SECTION_SDATA2 static f32 lit_4313[1 + 1 /* padding */] = {
};
/* 802AA908-802AA9E8 2A5248 00E0+00 0/0 1/1 0/0 .text initParams__10Z2SoundMgrFv */
#ifdef NONMATCHING
// matches with literals
void Z2SoundMgr::initParams() {
mSeMgr.initParams();
mSeqMgr.getParams()->init();
mStreamMgr.getParams()->init();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -345,9 +585,23 @@ asm void Z2SoundMgr::initParams() {
#include "asm/Z2AudioLib/Z2SoundMgr/initParams__10Z2SoundMgrFv.s"
}
#pragma pop
#endif
/* 802AA9E8-802AAAC4 2A5328 00DC+00 0/0 1/1 0/0 .text
* multiVolumeSoundID__10Z2SoundMgrF10JAISoundIDf */
#ifdef NONMATCHING
void Z2SoundMgr::multiVolumeSoundID(JAISoundID i_soundID, f32 i_multi) {
if (!i_soundID.isAnonymous() && Z2GetSoundInfo()->getSoundType(i_soundID) == 0) {
JSUList<JAISe>* list =
mSeMgr.getCategory(Z2GetSoundInfo()->getCategory(i_soundID))->getSeList();
for (JSULink<JAISe>* link = list->getFirst(); link != NULL; link = link->getNext()) {
if (link->getObject()->getID() == i_soundID) {
link->getObject()->getAuxiliary().mParams.mVolume *= i_multi;
}
}
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -356,16 +610,35 @@ asm void Z2SoundMgr::multiVolumeSoundID(JAISoundID param_0, f32 param_1) {
#include "asm/Z2AudioLib/Z2SoundMgr/multiVolumeSoundID__10Z2SoundMgrF10JAISoundIDf.s"
}
#pragma pop
#endif
/* 802AAAC4-802AAB94 2A5404 00D0+00 1/1 0/0 0/0 .text isPlayingSoundID__10Z2SoundMgrF10JAISoundID
*/
#ifdef NONMATCHING
bool Z2SoundMgr::isPlayingSoundID(JAISoundID i_soundID) {
if (i_soundID.isAnonymous()) {
return 0;
}
if (Z2GetSoundInfo()->getSoundType(i_soundID) == 0) {
JSUList<JAISe>* list =
mSeMgr.getCategory(Z2GetSoundInfo()->getCategory(i_soundID))->getSeList();
for (JSULink<JAISe>* link = list->getFirst(); link != NULL; link = link->getNext()) {
if (link->getObject()->getID() == i_soundID) {
return true;
}
}
}
return false;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void Z2SoundMgr::isPlayingSoundID(JAISoundID param_0) {
asm bool Z2SoundMgr::isPlayingSoundID(JAISoundID param_0) {
nofralloc
#include "asm/Z2AudioLib/Z2SoundMgr/isPlayingSoundID__10Z2SoundMgrF10JAISoundID.s"
}
#pragma pop
#endif
/* 8039B9D0-8039B9D0 028030 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+28 -28
View File
@@ -13,66 +13,66 @@ Z2SoundStarter::Z2SoundStarter(bool param_0) : JAISoundStarter(param_0), JASGlob
/* 802AABF4-802AAC3C 2A5534 0048+00 1/0 5/0 0/0 .text
* startSound__14Z2SoundStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
int Z2SoundStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
JGeometry::TVec3<f32> const* param_2) {
return Z2SoundStarter::startSound(param_0, param_1, param_2, 0, 0.0f, 1.0f, 1.0f, -1.0f, -1.0f,
0);
bool Z2SoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* i_handlePtr,
JGeometry::TVec3<f32> const* i_pos) {
return Z2SoundStarter::startSound(i_soundID, i_handlePtr, i_pos,
0, 0.0f, 1.0f, 1.0f, -1.0f, -1.0f, 0);
}
/* 802AAC3C-802AAEDC 2A557C 02A0+00 2/1 2/2 0/0 .text
* startSound__14Z2SoundStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f>UlfffffUl */
int Z2SoundStarter::startSound(JAISoundID param_1, JAISoundHandle* handlePtr,
JGeometry::TVec3<f32> const* param_3, u32 param_4, f32 param_5,
f32 param_6, f32 param_7, f32 param_8, f32 param_9, u32 param_10) {
bool Z2SoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* handlePtr,
JGeometry::TVec3<f32> const* i_pos, u32 param_4, f32 i_fxMix,
f32 i_pitch, f32 i_volume, f32 i_pan, f32 i_dolby, u32 i_count) {
JUT_ASSERT(45, handlePtr);
if (param_4 == 6) {
switch (param_1) {
switch (i_soundID) {
case Z2SE_CM_BODYFALL_S:
param_1 = Z2SE_CM_BODYFALL_ASASE_S;
i_soundID = Z2SE_CM_BODYFALL_ASASE_S;
break;
case Z2SE_CM_BODYFALL_M:
param_1 = Z2SE_CM_BODYFALL_ASASE_M;
i_soundID = Z2SE_CM_BODYFALL_ASASE_M;
break;
case Z2SE_CM_BODYFALL_L:
param_1 = Z2SE_CM_BODYFALL_ASASE_L;
i_soundID = Z2SE_CM_BODYFALL_ASASE_L;
break;
}
}
if (param_1.mId.mBytes.b1 != 0 && param_1.mId.mBytes.b1 != 9) {
if (i_soundID.mId.mBytes.b1 != 0 && i_soundID.mId.mBytes.b1 != 9) {
if (Z2GetSceneMgr()->isInDarkness()) {
param_5 = 1.0f;
i_fxMix = 1.0f;
} else {
f32 ratio = Z2GetStatusMgr()->getCameraInWaterDepthRatio();
f32 uStack_8c = ratio > 0.0f;
if (uStack_8c) {
param_5 = uStack_8c;
i_fxMix = uStack_8c;
} else {
param_5 += 0.5f * Z2GetEnvSeMgr()->getFogDensity();
if (param_5 > 1.0f) {
param_5 = 1.0f;
i_fxMix += 0.5f * Z2GetEnvSeMgr()->getFogDensity();
if (i_fxMix > 1.0f) {
i_fxMix = 1.0f;
}
}
}
}
int startSoundRes = Z2GetAudioMgr()->startSound(param_1, handlePtr, param_3);
bool startSoundRes = Z2GetAudioMgr()->startSound(i_soundID, handlePtr, i_pos);
if (*handlePtr) {
if (param_4 != 0) {
setPortData(handlePtr, 6, param_4, -1);
}
if (param_5 > 0.0f) {
(*handlePtr)->getAuxiliary().moveFxMix(param_5, param_10);
if (i_fxMix > 0.0f) {
(*handlePtr)->getAuxiliary().moveFxMix(i_fxMix, i_count);
}
if (param_6 != 1.0f) {
(*handlePtr)->getAuxiliary().movePitch(param_6, param_10);
if (i_pitch != 1.0f) {
(*handlePtr)->getAuxiliary().movePitch(i_pitch, i_count);
}
if (param_7 != 1.0f) {
(*handlePtr)->getAuxiliary().moveVolume(param_7, param_10);
if (i_volume != 1.0f) {
(*handlePtr)->getAuxiliary().moveVolume(i_volume, i_count);
}
if (param_8 != -1.0f) {
(*handlePtr)->getAuxiliary().movePan(param_8, param_10);
if (i_pan != -1.0f) {
(*handlePtr)->getAuxiliary().movePan(i_pan, i_count);
}
if (param_9 != -1.0f) {
(*handlePtr)->getAuxiliary().moveDolby(param_9, param_10);
if (i_dolby != -1.0f) {
(*handlePtr)->getAuxiliary().moveDolby(i_dolby, i_count);
}
}
return startSoundRes;
+1 -1
View File
@@ -1984,7 +1984,7 @@ SECTION_SDATA2 static f32 lit_4572 = 0.5f;
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm int Z2SpeechStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
asm bool Z2SpeechStarter::startSound(JAISoundID param_0, JAISoundHandle* param_1,
JGeometry::TVec3<f32> const* param_2, u32 param_3, f32 param_4,
f32 param_5, f32 param_6, f32 param_7, f32 param_8,
u32 param_9) {