mirror of
https://github.com/zeldaret/tp
synced 2026-07-09 06:53:23 -04:00
various Z2Audio / JAudio debug cleanup (#2876)
* some JAudio work * audio cleanup checkpoint * checkpoint more audio cleanup * fix symbols * more z2 cleanup * fix regression * fix build * some fixes
This commit is contained in:
+288
-267
File diff suppressed because it is too large
Load Diff
@@ -1,41 +1,81 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2AudioArcLoader
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2AudioArcLoader.h"
|
||||
#include "JSystem/JAudio2/JAUSectionHeap.h"
|
||||
#include "JSystem/JAudio2/JAUSoundTable.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "Z2AudioLib/Z2FxLineMgr.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
|
||||
/* 802A9A34-802A9A70 2A4374 003C+00 0/0 1/1 0/0 .text __ct__16Z2AudioArcLoaderFP10JAUSection */
|
||||
Z2AudioArcLoader::Z2AudioArcLoader(JAUSection* param_0) : JAUAudioArcLoader(param_0) {
|
||||
/* empty function */
|
||||
}
|
||||
Z2AudioArcLoader::Z2AudioArcLoader(JAUSection* section) : JAUAudioArcLoader(section) {}
|
||||
|
||||
/* 802A9A70-802A9AC8 2A43B0 0058+00 1/0 0/0 0/0 .text readCommandMore__16Z2AudioArcLoaderFUl */
|
||||
bool Z2AudioArcLoader::readCommandMore(u32 param_0) {
|
||||
bool Z2AudioArcLoader::readCommandMore(u32 command) {
|
||||
bool rv = false;
|
||||
switch (param_0) {
|
||||
u32 read = 0;
|
||||
|
||||
switch (command) {
|
||||
case 'bfca':
|
||||
readBFCA(getContent_(readU32_()));
|
||||
read = readU32_();
|
||||
readBFCA(getContent_(read));
|
||||
rv = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* 802A9AC8-802A9B54 2A4408 008C+00 1/1 0/0 0/0 .text readBFCA__16Z2AudioArcLoaderFPCv */
|
||||
void Z2AudioArcLoader::readBFCA(void const* param_0) {
|
||||
void Z2AudioArcLoader::readBFCA(const void* addr) {
|
||||
JUT_ASSERT(76, addr);
|
||||
|
||||
JKRHeap* heap = JAUSectionHeap::getInstance()->getHeap();
|
||||
JKRArchive* archive = JKRMountArchive((void*)param_0, JKRGetCurrentHeap(), JKRArchive::MOUNT_DIRECTION_TAIL);
|
||||
JUT_ASSERT(78, heap);
|
||||
JUT_ASSERT(79, Z2GetFxLineMgr());
|
||||
|
||||
JKRArchive* archive = JKRMountArchive((void*)addr, JKRGetCurrentHeap(), JKRArchive::MOUNT_DIRECTION_TAIL);
|
||||
Z2GetFxLineMgr()->initDataArc(archive, heap);
|
||||
JKRUnmountArchive(archive);
|
||||
}
|
||||
|
||||
/* 802A9B54-802A9B58 2A4494 0004+00 1/0 0/0 0/0 .text readBSTN__16Z2AudioArcLoaderFPCvUl
|
||||
*/
|
||||
void Z2AudioArcLoader::readBSTN(void const* param_0, u32 param_1) {
|
||||
/* empty function */
|
||||
void Z2AudioArcLoader::readBSTN(const void* addr, u32 param_1) {
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
|
||||
JUT_ASSERT(97, sectionHeap);
|
||||
|
||||
JUT_ASSERT(99, sectionHeap->isOpen());
|
||||
JUT_ASSERT(100, sectionHeap->isBuilding());
|
||||
JUT_ASSERT(101, addr);
|
||||
|
||||
JUT_ASSERT(103, sectionHeap->getSectionHeapData().soundNameTable == 0);
|
||||
|
||||
JKRHeap* heap = JKRHeap::getCurrentHeap();
|
||||
JKRHeap* gameHeap = (JKRHeap*)mDoExt_getGameHeap();
|
||||
JKRSetCurrentHeap(gameHeap);
|
||||
|
||||
u8* bstnDst = (u8*)addr;
|
||||
if (param_1 != 0) {
|
||||
bstnDst = new (gameHeap, 4) u8[param_1];
|
||||
if (bstnDst != NULL) {
|
||||
memcpy(bstnDst, addr, param_1);
|
||||
}
|
||||
|
||||
JUT_ASSERT(122, bstnDst);
|
||||
}
|
||||
|
||||
JAUSoundNameTable* soundNameTable = new (gameHeap, 0) JAUSoundNameTable(true);
|
||||
JUT_ASSERT(125, soundNameTable);
|
||||
|
||||
soundNameTable->init(bstnDst);
|
||||
|
||||
JAUSectionHeap::TSectionHeapData& sectionHeapData = (JAUSectionHeap::TSectionHeapData&)sectionHeap->getSectionHeapData();
|
||||
sectionHeapData.soundNameTable = soundNameTable;
|
||||
|
||||
JAUSection::TSectionData& sectionData = (JAUSection::TSectionData&)sectionHeap->getSectionData();
|
||||
sectionData.mBstnDst = bstnDst;
|
||||
|
||||
JKRSetCurrentHeap(heap);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2AudioMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
@@ -11,13 +6,15 @@
|
||||
#include "JSystem/JAudio2/JAUInitializer.h"
|
||||
#include "JSystem/JAudio2/JAUSectionHeap.h"
|
||||
#include "JSystem/JAudio2/JAUStreamAramMgr.h"
|
||||
#include "JSystem/JAudio2/JAUSeqCollection.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "Z2AudioLib/Z2AudioArcLoader.h"
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "Z2AudioLib/Z2SoundHandles.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
/* 80451368-80451370 000868 0004+04 1/1 251/251 900/900 .sbss mAudioMgrPtr__10Z2AudioMgr
|
||||
*/
|
||||
@@ -32,45 +29,46 @@ Z2AudioMgr::Z2AudioMgr() : mSoundStarter(true) {
|
||||
|
||||
/* 802CD34C-802CD7F8 2C7C8C 04AC+00 0/0 1/1 0/0 .text
|
||||
* init__10Z2AudioMgrFP12JKRSolidHeapUlPvP10JKRArchive */
|
||||
void Z2AudioMgr::init(JKRSolidHeap* param_0, u32 param_1, void* param_2, JKRArchive* param_3) {
|
||||
JAU_JASInitializer stack_60;
|
||||
stack_60.field_0x04 = param_1;
|
||||
stack_60.field_0x1c = 0x8c;
|
||||
stack_60.field_0x2c = 1.3f;
|
||||
stack_60.field_0x30 = "Audiores/Waves/";
|
||||
stack_60.initJASystem(param_0);
|
||||
// NONMATCHING JASPoolAllocObject<_> locations
|
||||
void Z2AudioMgr::init(JKRSolidHeap* heap, u32 memSize, void* baaData, JKRArchive* seqArc) {
|
||||
JAU_JASInitializer JASInitializer;
|
||||
JASInitializer.audioMemSize_ = memSize;
|
||||
JASInitializer.field_0x1c = 140;
|
||||
JASInitializer.dspLevel_ = 1.3f;
|
||||
JASInitializer.waveArcDir_ = "Audiores/Waves/";
|
||||
JASInitializer.initJASystem(heap);
|
||||
|
||||
JAU_JAIInitializer stack_90;
|
||||
stack_90.field_0x0 = 0x4e;
|
||||
stack_90.field_0x4 = 4;
|
||||
stack_90.field_0xc = 0x30;
|
||||
stack_90.initJAInterface();
|
||||
JAU_JAIInitializer JAIInitializer;
|
||||
JAIInitializer.field_0x0 = 78;
|
||||
JAIInitializer.field_0x4 = 4;
|
||||
JAIInitializer.field_0xc = 48;
|
||||
JAIInitializer.initJAInterface();
|
||||
|
||||
JAISeMgr *seMgr = mSoundMgr.getSeMgr();
|
||||
JAISeMgr* seMgr = mSoundMgr.getSeMgr();
|
||||
|
||||
JAISeCategoryArrangement stack_80;
|
||||
stack_80.mItems[0].mMaxActiveSe = 4;
|
||||
stack_80.mItems[0].mMaxInactiveSe = 2;
|
||||
stack_80.mItems[1].mMaxActiveSe = 2;
|
||||
stack_80.mItems[1].mMaxInactiveSe = 1;
|
||||
stack_80.mItems[2].mMaxActiveSe = 6;
|
||||
stack_80.mItems[2].mMaxInactiveSe = 3;
|
||||
stack_80.mItems[3].mMaxActiveSe = 16;
|
||||
stack_80.mItems[3].mMaxInactiveSe = 8;
|
||||
stack_80.mItems[4].mMaxActiveSe = 8;
|
||||
stack_80.mItems[4].mMaxInactiveSe = 4;
|
||||
stack_80.mItems[5].mMaxActiveSe = 6;
|
||||
stack_80.mItems[5].mMaxInactiveSe = 3;
|
||||
stack_80.mItems[6].mMaxActiveSe = 6;
|
||||
stack_80.mItems[6].mMaxInactiveSe = 3;
|
||||
stack_80.mItems[7].mMaxActiveSe = 12;
|
||||
stack_80.mItems[7].mMaxInactiveSe = 8;
|
||||
stack_80.mItems[8].mMaxActiveSe = 10;
|
||||
stack_80.mItems[8].mMaxInactiveSe = 5;
|
||||
stack_80.mItems[9].mMaxActiveSe = 8;
|
||||
stack_80.mItems[9].mMaxInactiveSe = 4;
|
||||
JAISeCategoryArrangement categoryArrangement;
|
||||
categoryArrangement.mItems[0].mMaxActiveSe = 4;
|
||||
categoryArrangement.mItems[0].mMaxInactiveSe = 2;
|
||||
categoryArrangement.mItems[1].mMaxActiveSe = 2;
|
||||
categoryArrangement.mItems[1].mMaxInactiveSe = 1;
|
||||
categoryArrangement.mItems[2].mMaxActiveSe = 6;
|
||||
categoryArrangement.mItems[2].mMaxInactiveSe = 3;
|
||||
categoryArrangement.mItems[3].mMaxActiveSe = 16;
|
||||
categoryArrangement.mItems[3].mMaxInactiveSe = 8;
|
||||
categoryArrangement.mItems[4].mMaxActiveSe = 8;
|
||||
categoryArrangement.mItems[4].mMaxInactiveSe = 4;
|
||||
categoryArrangement.mItems[5].mMaxActiveSe = 6;
|
||||
categoryArrangement.mItems[5].mMaxInactiveSe = 3;
|
||||
categoryArrangement.mItems[6].mMaxActiveSe = 6;
|
||||
categoryArrangement.mItems[6].mMaxInactiveSe = 3;
|
||||
categoryArrangement.mItems[7].mMaxActiveSe = 12;
|
||||
categoryArrangement.mItems[7].mMaxInactiveSe = 8;
|
||||
categoryArrangement.mItems[8].mMaxActiveSe = 10;
|
||||
categoryArrangement.mItems[8].mMaxInactiveSe = 5;
|
||||
categoryArrangement.mItems[9].mMaxActiveSe = 8;
|
||||
categoryArrangement.mItems[9].mMaxInactiveSe = 4;
|
||||
seMgr->setCategoryArrangement(categoryArrangement);
|
||||
|
||||
seMgr->setCategoryArrangement(stack_80);
|
||||
seMgr->getCategory(0)->getParams()->moveVolume(Z2Param::VOL_SE_SYSTEM_DEFAULT, 0);
|
||||
seMgr->getCategory(1)->getParams()->moveVolume(Z2Param::VOL_SE_LINK_VOICE_DEFAULT, 0);
|
||||
seMgr->getCategory(2)->getParams()->moveVolume(Z2Param::VOL_SE_LINK_MOTION_DEFAULT, 0);
|
||||
@@ -81,33 +79,48 @@ void Z2AudioMgr::init(JKRSolidHeap* param_0, u32 param_1, void* param_2, JKRArch
|
||||
seMgr->getCategory(7)->getParams()->moveVolume(Z2Param::VOL_SE_CHAR_VOICE_DEFAULT, 0);
|
||||
seMgr->getCategory(8)->getParams()->moveVolume(Z2Param::VOL_SE_OBJECT_DEFAULT, 0);
|
||||
seMgr->getCategory(9)->getParams()->moveVolume(Z2Param::VOL_SE_ATMOSPHERE_DEFAULT, 0);
|
||||
|
||||
seMgr->getParams()->moveVolume(1.0f, 0);
|
||||
|
||||
JAISeqMgr* seqMgr = mSoundMgr.getSeqMgr();
|
||||
seqMgr->getParams()->moveVolume(Z2Param::VOL_BGM_DEFAULT, 0);
|
||||
|
||||
JAIStreamMgr* streamMgr = mSoundMgr.getStreamMgr();
|
||||
JAUStreamStaticAramMgr_<1>* streamStaticAramMgr = new(param_0, 0) JAUStreamStaticAramMgr_<1>();
|
||||
JAUStreamStaticAramMgr_<1>* streamStaticAramMgr = new(heap, 0) JAUStreamStaticAramMgr_<1>();
|
||||
streamStaticAramMgr->reserveAram(NULL, 0, 0x14);
|
||||
streamMgr->setStreamAramMgr(streamStaticAramMgr);
|
||||
streamMgr->getParams()->moveVolume(Z2Param::VOL_BGM_DEFAULT, 0);
|
||||
|
||||
JASPoolAllocObject<Z2Audible>::newMemPool(0x4e);
|
||||
mSoundMgr.getSeMgr()->setAudience(&mAudience);
|
||||
mSoundMgr.getSeqMgr()->setAudience(&mAudience);
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
Z2AudioCS::newSpkSoundMemPool();
|
||||
#endif
|
||||
|
||||
JASPoolAllocObject<Z2SoundHandlePool>::newMemPool(0x4e);
|
||||
// OSReport("[Z2AudioMgr::init]before Create Section: %d\n", param_0->getFreeSize());
|
||||
OS_REPORT("[Z2AudioMgr::init]before Create Section: %d\n", heap->getFreeSize());
|
||||
|
||||
JAUSectionHeap* sectionHeap = JAUNewSectionHeap(true);
|
||||
sectionHeap->setSeqDataArchive(param_3);
|
||||
size_t resMaxSize = JASResArcLoader::getResMaxSize(param_3);
|
||||
sectionHeap->newDynamicSeqBlock(0xe00);
|
||||
sectionHeap->newDynamicSeqBlock(0x17e0);
|
||||
sectionHeap->setSeqDataArchive(seqArc);
|
||||
size_t resMaxSize = JASResArcLoader::getResMaxSize(seqArc);
|
||||
sectionHeap->newDynamicSeqBlock(0xE00);
|
||||
sectionHeap->newDynamicSeqBlock(0x17E0);
|
||||
sectionHeap->newDynamicSeqBlock(0x5380);
|
||||
sectionHeap->newDynamicSeqBlock(resMaxSize);
|
||||
Z2AudioArcLoader stack_a0(sectionHeap);
|
||||
bool baaLoadResult = stack_a0.load(param_2);
|
||||
|
||||
Z2AudioArcLoader audioArcLoader(sectionHeap);
|
||||
bool baaLoadResult = audioArcLoader.load(baaData);
|
||||
JUT_ASSERT(252, baaLoadResult);
|
||||
|
||||
#if DEBUG
|
||||
seMgr->setSeqDataMgr(mDebugSys.initSeSeqDataMgr(((JAUSeqDataMgr_SeqCollection*)sectionHeap->getSeSeqDataMgr())->getResource()));
|
||||
#else
|
||||
seMgr->setSeqDataMgr(sectionHeap->getSeSeqDataMgr());
|
||||
#endif
|
||||
seqMgr->setSeqDataMgr(sectionHeap->getSeqSeqDataMgr());
|
||||
|
||||
if (sectionHeap->getStreamDataMgr()) {
|
||||
// The following is to force stack reg to be r31 in dbg:
|
||||
int unused;
|
||||
@@ -115,15 +128,21 @@ void Z2AudioMgr::init(JKRSolidHeap* param_0, u32 param_1, void* param_2, JKRArch
|
||||
} else {
|
||||
streamMgr->setStreamDataMgr(&mSoundInfo);
|
||||
}
|
||||
|
||||
sectionHeap->finishBuild();
|
||||
initSe();
|
||||
JASSeqParser::registerSeqCallback(seqCallback);
|
||||
|
||||
#if DEBUG
|
||||
mDebugSys.initSoundHioNode();
|
||||
mDebugSys.initJAW();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 802CD888-802CD8B4 2C81C8 002C+00 0/0 5/5 0/0 .text setOutputMode__10Z2AudioMgrFUl */
|
||||
void Z2AudioMgr::setOutputMode(u32 mode) {
|
||||
if (mode <= 2) {
|
||||
JASDriver::setOutputMode(mode);
|
||||
JAISetOutputMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,11 +153,16 @@ void Z2AudioMgr::zeldaGFrameWork() {
|
||||
processSeFramework();
|
||||
processBgmFramework();
|
||||
processHeartGaugeSound();
|
||||
|
||||
#if DEBUG
|
||||
mDebugSys.debugframework();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 802CD904-802CD974 2C8244 0070+00 0/0 1/1 0/0 .text gframeProcess__10Z2AudioMgrFv */
|
||||
void Z2AudioMgr::gframeProcess() {
|
||||
zeldaGFrameWork();
|
||||
|
||||
if (mResettingFlag && mAudioReseter.checkDone()) {
|
||||
if (!field_0x519) {
|
||||
mSoundMgr.stopSync();
|
||||
@@ -151,6 +175,8 @@ void Z2AudioMgr::gframeProcess() {
|
||||
|
||||
/* 802CD974-802CD9CC 2C82B4 0058+00 0/0 3/3 0/0 .text resetProcess__10Z2AudioMgrFUlb */
|
||||
void Z2AudioMgr::resetProcess(u32 param_0, bool param_1) {
|
||||
JUT_ASSERT(413, !mResettingFlag);
|
||||
|
||||
mAudioReseter.start(param_0 * JASDriver::getSubFrames(), param_1);
|
||||
field_0x519 = param_1;
|
||||
mResettingFlag = true;
|
||||
@@ -158,6 +184,9 @@ void Z2AudioMgr::resetProcess(u32 param_0, bool param_1) {
|
||||
|
||||
/* 802CD9CC-802CDA6C 2C830C 00A0+00 0/0 1/1 0/0 .text resetRecover__10Z2AudioMgrFv */
|
||||
void Z2AudioMgr::resetRecover() {
|
||||
JUT_ASSERT(427, mResettingFlag);
|
||||
JUT_ASSERT(428, mAudioReseter.checkDone());
|
||||
|
||||
mAudioReseter.resume();
|
||||
mSoundMgr.initParams();
|
||||
mResettingFlag = false;
|
||||
@@ -172,18 +201,26 @@ void Z2AudioMgr::resetRecover() {
|
||||
|
||||
/* 802CDA6C-802CDB1C 2C83AC 00B0+00 0/0 2/2 0/0 .text hasReset__10Z2AudioMgrCFv */
|
||||
bool Z2AudioMgr::hasReset() const {
|
||||
return mResettingFlag && mAudioReseter.checkDone()
|
||||
&& (field_0x519
|
||||
|| (mSoundMgr.getSeMgr()->getNumActiveSe() == 0
|
||||
&& mSoundMgr.getSeqMgr()->getNumActiveSeqs() == 0));
|
||||
return mResettingFlag && mAudioReseter.checkDone() &&
|
||||
(field_0x519 || (mSoundMgr.getSeMgr()->getNumActiveSe() == 0 && mSoundMgr.getSeqMgr()->getNumActiveSeqs() == 0));
|
||||
}
|
||||
|
||||
/* 802CDB1C-802CDB68 2C845C 004C+00 1/0 1/0 0/0 .text
|
||||
* startSound__10Z2AudioMgrF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
|
||||
bool Z2AudioMgr::startSound(JAISoundID param_0, JAISoundHandle* param_1,
|
||||
JGeometry::TVec3<f32> const* param_2) {
|
||||
bool Z2AudioMgr::startSound(JAISoundID soundID, JAISoundHandle* handle,
|
||||
const JGeometry::TVec3<f32>* posPtr) {
|
||||
if (mResettingFlag) {
|
||||
return 0;
|
||||
}
|
||||
return mSoundMgr.startSound(param_0, param_1, param_2);
|
||||
|
||||
return mSoundMgr.startSound(soundID, handle, posPtr);
|
||||
}
|
||||
|
||||
bool Z2AudioMgr::startLevelSound(JAISoundID soundID, JAISoundHandle* handle,
|
||||
const JGeometry::TVec3<f32>* posPtr) {
|
||||
if (mResettingFlag) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mSoundMgr.startSound(soundID, handle, posPtr);
|
||||
}
|
||||
|
||||
+68
-94
@@ -1,138 +1,112 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2Calc
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "JSystem/JMath/random.h"
|
||||
#include "math.h"
|
||||
#include "dol2asm.h"
|
||||
#include <math.h>
|
||||
|
||||
/* 802A968C-802A96F4 2A3FCC 0068+00 1/1 16/16 0/0 .text linearTransform__6Z2CalcFfffffb
|
||||
*/
|
||||
f32 Z2Calc::linearTransform(f32 param1, f32 param2, f32 param3, f32 param4, f32 param5,
|
||||
bool param6) {
|
||||
f32 temp;
|
||||
f32 Z2Calc::linearTransform(f32 inValue, f32 inMin, f32 inMax, f32 outMin, f32 outMax, bool noClamp) {
|
||||
f32 transformed = outMin + ((inValue - inMin) * ((outMax - outMin) / (inMax - inMin)));
|
||||
if (noClamp) {
|
||||
return transformed;
|
||||
}
|
||||
|
||||
temp = param4 + (param1 - param2) * ((param5 - param4) / (param3 - param2));
|
||||
|
||||
if (param6) {
|
||||
return temp;
|
||||
} else if (param4 < param5) {
|
||||
if (temp > param5) {
|
||||
return param5;
|
||||
} else if (temp < param4) {
|
||||
return param4;
|
||||
} else {
|
||||
return temp;
|
||||
}
|
||||
} else if (temp > param4) {
|
||||
return param4;
|
||||
} else if (temp < param5) {
|
||||
return param5;
|
||||
if (outMin < outMax) {
|
||||
return transformed > outMax ? outMax :
|
||||
transformed < outMin ? outMin :
|
||||
transformed;
|
||||
} else {
|
||||
return temp;
|
||||
return transformed > outMin ? outMin :
|
||||
transformed < outMax ? outMax :
|
||||
transformed;
|
||||
}
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80455820-80455824 003E20 0004+00 0/0 1/1 0/0 .sdata2 cEqualCSlope__6Z2Calc */
|
||||
SECTION_SDATA2 f32 Z2Calc::cEqualCSlope = 1.0f;
|
||||
const f32 Z2Calc::cEqualCSlope = 1.0f;
|
||||
|
||||
/* 80455824-80455828 003E24 0004+00 0/0 1/1 0/0 .sdata2 cEqualPSlope__6Z2Calc */
|
||||
SECTION_SDATA2 f32 Z2Calc::cEqualPSlope = 0.5f;
|
||||
const f32 Z2Calc::cEqualPSlope = 0.5f;
|
||||
|
||||
/* 802A96F4-802A9814 2A4034 0120+00 0/0 29/29 0/0 .text
|
||||
* getParamByExp__6Z2CalcFffffffQ26Z2Calc9CurveSign */
|
||||
f32 Z2Calc::getParamByExp(f32 f1, f32 f2, f32 f3, f32 f4, f32 f5, f32 f6, Z2Calc::CurveSign sign) {
|
||||
f32 out;
|
||||
if (sign == Z2Calc::CURVE_SIGN_1) {
|
||||
f32 tmp = exp(Z2Calc::linearTransform(f1, f2, f3, 0.0f, f4, true));
|
||||
out = Z2Calc::linearTransform(tmp, 1.0f, exp(f4), f5, f6, true);
|
||||
} else if (sign == Z2Calc::CURVE_SIGN_0) {
|
||||
f32 tmp = exp(Z2Calc::linearTransform(f1, f2, f3, f4, 0.0f, true));
|
||||
out = Z2Calc::linearTransform(tmp, exp(f4), 1.0f, f5, f6, true);
|
||||
f32 Z2Calc::getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 outMax, Z2Calc::CurveSign curveSign) {
|
||||
if (curveSign == Z2Calc::CURVE_POSITIVE) {
|
||||
value = linearTransform(value, inMin, inMax, 0.0f, exponent, true);
|
||||
value = expf(value);
|
||||
value = linearTransform(value, 1.0f, expf(exponent), outMin, outMax, true);
|
||||
} else if (curveSign == Z2Calc::CURVE_NEGATIVE) {
|
||||
value = linearTransform(value, inMin, inMax, exponent, 0.0f, true);
|
||||
value = expf(value);
|
||||
value = linearTransform(value, expf(exponent), 1.0f, outMin, outMax, true);
|
||||
} else {
|
||||
out = Z2Calc::linearTransform(f1, f2, f3, f5, f6, false);
|
||||
value = linearTransform(value, inMin, inMax, outMin, outMax, false);
|
||||
}
|
||||
if (out > f6) {
|
||||
return f6;
|
||||
}
|
||||
if (out < f5) {
|
||||
return f5;
|
||||
}
|
||||
return out;
|
||||
|
||||
return value > outMax ? outMax :
|
||||
value < outMin ? outMin :
|
||||
value;
|
||||
}
|
||||
|
||||
/* 802A9814-802A98D4 2A4154 00C0+00 0/0 2/2 0/0 .text getRandom__6Z2CalcFfff */
|
||||
f32 Z2Calc::getRandom(f32 f1, f32 f2, f32 f3) {
|
||||
f32 tmp = 2.0f * f3;
|
||||
f32 tmp2 = (1.0f - f3) * -2.0f;
|
||||
f1 *= Z2Calc::getRandom_0_1() < f3 ? tmp : tmp2;
|
||||
f32 tmp3 = pow(Z2Calc::getRandom_0_1(), f2);
|
||||
return tmp3 * f1;
|
||||
f32 Z2Calc::getRandom(f32 magnitude, f32 exponent, f32 bias) {
|
||||
f32 posBias = 2.0f * bias;
|
||||
f32 negBias = (1.0f - bias) * -2.0f;
|
||||
magnitude *= Z2Calc::getRandom_0_1() < bias ? posBias : negBias;
|
||||
|
||||
f32 exprnd = pow(Z2Calc::getRandom_0_1(), exponent);
|
||||
return exprnd * magnitude;
|
||||
}
|
||||
|
||||
/* 802A98D4-802A9944 2A4214 0070+00 1/1 1/1 0/0 .text getRandom_0_1__6Z2CalcFv */
|
||||
f32 Z2Calc::getRandom_0_1(void) {
|
||||
static JMath::TRandom_fast_ oRandom(0);
|
||||
f32 Z2Calc::getRandom_0_1() {
|
||||
static JMath::TRandom_<JMath::TRandom_fast_> oRandom(0);
|
||||
return oRandom.get_ufloat_1();
|
||||
}
|
||||
|
||||
/* 802A9944-802A9958 2A4284 0014+00 0/0 1/1 0/0 .text setParam__Q26Z2Calc8FNoise1fFfff */
|
||||
void Z2Calc::FNoise1f::setParam(f32 param1, f32 param2, f32 param3) {
|
||||
this->unk0 = param1;
|
||||
this->unk4 = param1;
|
||||
this->unk12 = param2;
|
||||
this->unk8 = param3;
|
||||
void Z2Calc::FNoise1f::setParam(f32 value, f32 threshold, f32 step) {
|
||||
value_ = value;
|
||||
targetValue_ = value;
|
||||
threshold_ = threshold;
|
||||
step_ = step;
|
||||
}
|
||||
|
||||
/* 802A9958-802A99A0 2A4298 0048+00 1/1 0/0 0/0 .text tau__Q26Z2Calc8FNoise1fFf */
|
||||
f32 Z2Calc::FNoise1f::tau(f32 param1) {
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
f32 Z2Calc::FNoise1f::tau(f32 input) {
|
||||
f32 var_f30 = 1.0f;
|
||||
|
||||
temp1 = param1;
|
||||
temp2 = temp1 + (temp1 * temp1);
|
||||
|
||||
if (temp2 > 1.0f) {
|
||||
temp2 = temp2 - 1.0f;
|
||||
|
||||
if (temp1 < this->unk12) {
|
||||
temp2 = temp2 + this->unk12;
|
||||
f32 result = input + (input * input);
|
||||
if (result > var_f30) {
|
||||
result = result - var_f30;
|
||||
if (input < threshold_) {
|
||||
result += threshold_;
|
||||
}
|
||||
|
||||
return temp2;
|
||||
} else if (temp1 < this->unk12) {
|
||||
temp2 = temp2 + this->unk12;
|
||||
return result;
|
||||
}
|
||||
return temp2;
|
||||
|
||||
if (input < threshold_) {
|
||||
result += threshold_;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 802A99A0-802A9A34 2A42E0 0094+00 0/0 5/5 0/0 .text calcNoise1f__Q26Z2Calc8FNoise1fFv
|
||||
*/
|
||||
f32 Z2Calc::FNoise1f::calcNoise1f(void) {
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
|
||||
temp1 = this->unk0;
|
||||
|
||||
if (this->unk0 < this->unk4) {
|
||||
this->unk0 = temp1 + this->unk8;
|
||||
|
||||
if (this->unk0 < this->unk4) {
|
||||
return this->unk0;
|
||||
f32 Z2Calc::FNoise1f::calcNoise1f() {
|
||||
if (value_ < targetValue_) {
|
||||
value_ += step_;
|
||||
if (value_ < targetValue_) {
|
||||
return value_;
|
||||
}
|
||||
} else {
|
||||
this->unk0 = temp1 - this->unk8;
|
||||
|
||||
if (this->unk0 > this->unk4) {
|
||||
return this->unk0;
|
||||
value_ -= step_;
|
||||
if (value_ > targetValue_) {
|
||||
return value_;
|
||||
}
|
||||
}
|
||||
this->unk0 = this->unk4;
|
||||
temp2 = tau(this->unk0);
|
||||
this->unk4 = temp2;
|
||||
|
||||
return this->unk0;
|
||||
value_ = targetValue_;
|
||||
targetValue_ = tau(value_);
|
||||
return value_;
|
||||
}
|
||||
|
||||
+349
-339
File diff suppressed because it is too large
Load Diff
+455
-301
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2FxLineMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2FxLineMgr.h"
|
||||
#include "Z2AudioLib/Z2SceneMgr.h"
|
||||
#include "JSystem/JAudio2/JASDSPInterface.h"
|
||||
@@ -11,25 +6,40 @@
|
||||
#include "JSystem/JSupport/JSUMemoryStream.h"
|
||||
|
||||
/* 802BA7DC-802BA7FC 2B511C 0020+00 0/0 1/1 0/0 .text __ct__11Z2FxLineMgrFv */
|
||||
Z2FxLineMgr::Z2FxLineMgr() : JASGlobalInstance<Z2FxLineMgr>(this) {
|
||||
Z2FxLineMgr::Z2FxLineMgr() : JASGlobalInstance<Z2FxLineMgr>(true) {
|
||||
mConfig = NULL;
|
||||
mLineID = -1;
|
||||
mFxDataNum = 0;
|
||||
mSetUnderWaterFx = false;
|
||||
|
||||
#if DEBUG
|
||||
mHIOEdit = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 802BA7FC-802BAC28 2B513C 042C+00 0/0 1/1 0/0 .text
|
||||
* initDataArc__11Z2FxLineMgrFP10JKRArchiveP7JKRHeap */
|
||||
void Z2FxLineMgr::initDataArc(JKRArchive* arc, JKRHeap* heap) {
|
||||
JUT_ASSERT(44, arc);
|
||||
JUT_ASSERT(45, heap);
|
||||
|
||||
mFxLineBuffer[0] = new (heap, 0x20) u8[0x2800];
|
||||
mFxLineBuffer[1] = new (heap, 0x20) u8[0x2800];
|
||||
mFxLineBuffer[2] = new (heap, 0x20) u8[0x4B00];
|
||||
mFxLineBuffer[3] = new (heap, 0x20) u8[0x4B00];
|
||||
|
||||
JUT_ASSERT(53, mFxLineBuffer[0]);
|
||||
JUT_ASSERT(54, mFxLineBuffer[1]);
|
||||
JUT_ASSERT(55, mFxLineBuffer[2]);
|
||||
JUT_ASSERT(56, mFxLineBuffer[3]);
|
||||
|
||||
mFxDataNum = arc->countResource();
|
||||
mConfig = new (heap, 0) Z2FxLineConfig[mFxDataNum];
|
||||
|
||||
for (u8 i = 0; i < mFxDataNum; i++) {
|
||||
void* res = arc->getResource(i);
|
||||
u32 size = (arc->getResSize(res) + 0x1f) & ~0x1f;
|
||||
|
||||
JSUMemoryInputStream stream(res, size);
|
||||
stream >> mConfig[i].field_0x0;
|
||||
stream >> mConfig[i].field_0x1;
|
||||
@@ -61,23 +71,29 @@ void Z2FxLineMgr::initDataArc(JKRArchive* arc, JKRHeap* heap) {
|
||||
stream >> mConfig[i].field_0x20[7];
|
||||
JKRFree(res);
|
||||
}
|
||||
|
||||
setLineID(-1, false, false);
|
||||
setLineID(-1, true, false);
|
||||
}
|
||||
|
||||
/* 802BAC28-802BAC74 2B5568 004C+00 4/4 0/0 0/0 .text setLineID__11Z2FxLineMgrFScbb */
|
||||
void Z2FxLineMgr::setLineID(s8 fxID, bool param_1, bool param_2) {
|
||||
JUT_ASSERT(109, fxID < mFxDataNum);
|
||||
|
||||
if (fxID < 0) {
|
||||
mLineID = 0;
|
||||
} else {
|
||||
mLineID = fxID;
|
||||
}
|
||||
|
||||
setLine(&mConfig[mLineID], param_1, param_2);
|
||||
}
|
||||
|
||||
/* 802BAC74-802BAE1C 2B55B4 01A8+00 1/1 0/0 0/0 .text setLine__11Z2FxLineMgrFP14Z2FxLineConfigbb
|
||||
*/
|
||||
void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
JUT_ASSERT(121, config);
|
||||
|
||||
u8 buf1 = 0;
|
||||
u8 buf2 = 1;
|
||||
if (param_1) {
|
||||
@@ -86,6 +102,7 @@ void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
}
|
||||
|
||||
if (mFxLineBuffer[buf1] == NULL || mFxLineBuffer[buf2] == NULL) {
|
||||
OS_REPORT("[Z2FxLineMgr::setLine] FxBuffer is NOT CREATED!!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -93,6 +110,7 @@ void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
dsp_config.field_0x0 = config->field_0x0;
|
||||
dsp_config.field_0x2 = config->field_0x1;
|
||||
dsp_config.field_0x6 = config->field_0x2;
|
||||
|
||||
if (param_2) {
|
||||
dsp_config.field_0x4 = 0;
|
||||
dsp_config.field_0x8 = 0;
|
||||
@@ -100,6 +118,7 @@ void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
dsp_config.field_0x4 = config->field_0x4;
|
||||
dsp_config.field_0x8 = config->field_0x6;
|
||||
}
|
||||
|
||||
dsp_config.field_0xc = config->field_0x3;
|
||||
dsp_config.field_0x10[0] = config->field_0x8[0];
|
||||
dsp_config.field_0x10[1] = config->field_0x8[1];
|
||||
@@ -114,6 +133,7 @@ void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
dsp_config.field_0x0 = config->field_0x18;
|
||||
dsp_config.field_0x2 = config->field_0x19;
|
||||
dsp_config.field_0x6 = config->field_0x1a;
|
||||
|
||||
if (param_2) {
|
||||
dsp_config.field_0x4 = 0;
|
||||
dsp_config.field_0x8 = 0;
|
||||
@@ -121,6 +141,7 @@ void Z2FxLineMgr::setLine(Z2FxLineConfig* config, bool param_1, bool param_2) {
|
||||
dsp_config.field_0x4 = config->field_0x1c;
|
||||
dsp_config.field_0x8 = config->field_0x1e;
|
||||
}
|
||||
|
||||
dsp_config.field_0xc = config->field_0x1b;
|
||||
dsp_config.field_0x10[0] = config->field_0x20[0];
|
||||
dsp_config.field_0x10[1] = config->field_0x20[1];
|
||||
@@ -139,84 +160,86 @@ void Z2FxLineMgr::setFxForceOff(bool param_0) {
|
||||
}
|
||||
|
||||
/* 802BAE48-802BAEB8 2B5788 0070+00 0/0 1/1 0/0 .text setUnderWaterFx__11Z2FxLineMgrFb */
|
||||
void Z2FxLineMgr::setUnderWaterFx(bool param_0) {
|
||||
if (mSetUnderWaterFx != param_0) {
|
||||
if (param_0) {
|
||||
void Z2FxLineMgr::setUnderWaterFx(bool isUnderWaterFx) {
|
||||
if (mSetUnderWaterFx != isUnderWaterFx) {
|
||||
if (isUnderWaterFx) {
|
||||
OS_REPORT("[Z2FxLineMgr::setUnderWaterFx] → underWaterFx!\n");
|
||||
setLineID(12, true, false);
|
||||
} else {
|
||||
OS_REPORT("[Z2FxLineMgr::setUnderWaterFx] → sceneFx!\n");
|
||||
setSceneFx(Z2GetSceneMgr()->getCurrentSceneNum());
|
||||
}
|
||||
mSetUnderWaterFx = param_0;
|
||||
mSetUnderWaterFx = isUnderWaterFx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BAEB8-802BB00C 2B57F8 0154+00 2/1 1/1 0/0 .text setSceneFx__11Z2FxLineMgrFl */
|
||||
void Z2FxLineMgr::setSceneFx(s32 sceneNum) {
|
||||
void Z2FxLineMgr::setSceneFx(s32 sceneNo) {
|
||||
if (Z2GetSceneMgr()->isInDarkness()) {
|
||||
setLineID(11, true, false);
|
||||
} else {
|
||||
switch (sceneNum) {
|
||||
case SPOT_SHADES_REALM:
|
||||
switch (sceneNo) {
|
||||
case Z2SCENE_SHADES_REALM:
|
||||
setLineID(9, true, false);
|
||||
break;
|
||||
case SPOT_KAKARIKO_VILLAGE:
|
||||
case SPOT_DEATH_MOUNTAIN:
|
||||
case SPOT_HIDDEN_VILLAGE:
|
||||
case SPOT_ZORAS_RIVER:
|
||||
case SPOT_HYRULE_FIELD:
|
||||
case Z2SCENE_KAKARIKO_VILLAGE:
|
||||
case Z2SCENE_DEATH_MOUNTAIN:
|
||||
case Z2SCENE_HIDDEN_VILLAGE:
|
||||
case Z2SCENE_ZORAS_RIVER:
|
||||
case Z2SCENE_HYRULE_FIELD:
|
||||
setLineID(10, true, false);
|
||||
break;
|
||||
case SPOT_SACRED_GROVE:
|
||||
case SPOT_FOREST_TEMPLE:
|
||||
case SPOT_FOREST_TEMPLE_MINIBOSS:
|
||||
case SPOT_FOREST_TEMPLE_BOSS:
|
||||
case SPOT_GORGE_LANTERN_CAVE:
|
||||
case SPOT_LAKE_LANTERN_CAVE:
|
||||
case SPOT_FARON_WOODS_CAVE:
|
||||
case Z2SCENE_SACRED_GROVE:
|
||||
case Z2SCENE_FOREST_TEMPLE:
|
||||
case Z2SCENE_FOREST_TEMPLE_MINIBOSS:
|
||||
case Z2SCENE_FOREST_TEMPLE_BOSS:
|
||||
case Z2SCENE_GORGE_LANTERN_CAVE:
|
||||
case Z2SCENE_LAKE_LANTERN_CAVE:
|
||||
case Z2SCENE_FARON_WOODS_CAVE:
|
||||
if (Z2GetSceneMgr()->getCurrentRoomNum() == 2) {
|
||||
return;
|
||||
}
|
||||
// fallthrough
|
||||
case SPOT_FARON_WOODS:
|
||||
case Z2SCENE_FARON_WOODS:
|
||||
setLineID(1, true, false);
|
||||
break;
|
||||
case SPOT_GORON_MINES:
|
||||
case SPOT_GORON_MINES_MINIBOSS:
|
||||
case SPOT_GORON_MINES_BOSS:
|
||||
case SPOT_ELDIN_MAGNET_CAVE:
|
||||
case Z2SCENE_GORON_MINES:
|
||||
case Z2SCENE_GORON_MINES_MINIBOSS:
|
||||
case Z2SCENE_GORON_MINES_BOSS:
|
||||
case Z2SCENE_ELDIN_MAGNET_CAVE:
|
||||
setLineID(2, true, false);
|
||||
break;
|
||||
case SPOT_LAKE_HYLIA:
|
||||
case SPOT_LAKEBED_TEMPLE:
|
||||
case SPOT_LAKEBED_TEMPLE_MINIBOSS:
|
||||
case SPOT_LAKEBED_TEMPLE_BOSS:
|
||||
case Z2SCENE_LAKE_HYLIA:
|
||||
case Z2SCENE_LAKEBED_TEMPLE:
|
||||
case Z2SCENE_LAKEBED_TEMPLE_MINIBOSS:
|
||||
case Z2SCENE_LAKEBED_TEMPLE_BOSS:
|
||||
if (Z2GetSceneMgr()->getCurrentRoomNum() == 1) {
|
||||
setLineID(3, true, false);
|
||||
}
|
||||
break;
|
||||
case SPOT_ARBITERS_GROUNDS:
|
||||
case SPOT_ARBITERS_GROUNDS_MINIBOSS:
|
||||
case SPOT_ARBITERS_GROUNDS_BOSS:
|
||||
case Z2SCENE_ARBITERS_GROUNDS:
|
||||
case Z2SCENE_ARBITERS_GROUNDS_MINIBOSS:
|
||||
case Z2SCENE_ARBITERS_GROUNDS_BOSS:
|
||||
setLineID(4, true, false);
|
||||
break;
|
||||
case SPOT_SNOWPEAK_RUINS:
|
||||
case SPOT_SNOWPEAK_RUINS_MINIBOSS:
|
||||
case SPOT_SNOWPEAK_RUINS_BOSS:
|
||||
case SPOT_ICE_BLOCK_PUZZLE:
|
||||
case Z2SCENE_SNOWPEAK_RUINS:
|
||||
case Z2SCENE_SNOWPEAK_RUINS_MINIBOSS:
|
||||
case Z2SCENE_SNOWPEAK_RUINS_BOSS:
|
||||
case Z2SCENE_ICE_BLOCK_PUZZLE:
|
||||
setLineID(5, true, false);
|
||||
break;
|
||||
case SPOT_TEMPLE_OF_TIME:
|
||||
case SPOT_TEMPLE_OF_TIME_MINIBOSS:
|
||||
case SPOT_TEMPLE_OF_TIME_BOSS:
|
||||
case Z2SCENE_TEMPLE_OF_TIME:
|
||||
case Z2SCENE_TEMPLE_OF_TIME_MINIBOSS:
|
||||
case Z2SCENE_TEMPLE_OF_TIME_BOSS:
|
||||
setLineID(6, true, false);
|
||||
break;
|
||||
case SPOT_CITY_IN_THE_SKY:
|
||||
case SPOT_CITY_IN_THE_SKY_MINIBOSS:
|
||||
case SPOT_CITY_IN_THE_SKY_BOSS:
|
||||
case Z2SCENE_CITY_IN_THE_SKY:
|
||||
case Z2SCENE_CITY_IN_THE_SKY_MINIBOSS:
|
||||
case Z2SCENE_CITY_IN_THE_SKY_BOSS:
|
||||
setLineID(7, true, false);
|
||||
break;
|
||||
case SPOT_HYRULE_CASTLE:
|
||||
case SPOT_FINAL_BATTLE_THRONE_ROOM:
|
||||
case Z2SCENE_HYRULE_CASTLE:
|
||||
case Z2SCENE_FINAL_BATTLE_THRONE_ROOM:
|
||||
setLineID(8, true, false);
|
||||
break;
|
||||
default:
|
||||
|
||||
+198
-175
@@ -1,23 +1,21 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2LinkMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2LinkMgr.h"
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
/* 802C321C-802C3220 2BDB5C 0004+00 0/0 1/1 0/0 .text setLinkGroupInfo__14Z2CreatureLinkFUc */
|
||||
void Z2CreatureLink::setLinkGroupInfo(u8) {}
|
||||
|
||||
/* 802C3220-802C3228 -00001 0008+00 0/0 0/0 0/0 .text setLinkHp__14Z2CreatureLinkFll */
|
||||
void Z2CreatureLink::setLinkHp(s32 i_hp, s32) {
|
||||
mLinkHp = i_hp;
|
||||
void Z2CreatureLink::setLinkHp(s32 linkHp, s32) {
|
||||
mLinkHp = linkHp;
|
||||
}
|
||||
|
||||
/* 802C3228-802C328C 2BDB68 0064+00 0/0 1/1 0/0 .text setLinkSwordType__14Z2CreatureLinkFll */
|
||||
void Z2CreatureLink::setLinkSwordType(s32 i_swordType, s32 param_1) {
|
||||
mLinkSwordType = i_swordType;
|
||||
void Z2CreatureLink::setLinkSwordType(s32 swordType, s32 param_1) {
|
||||
mLinkSwordType = swordType;
|
||||
mFlag3 = param_1 == 1;
|
||||
|
||||
if (mLinkSwordType != 0) {
|
||||
@@ -31,8 +29,8 @@ void Z2CreatureLink::setLinkSwordType(s32 i_swordType, s32 param_1) {
|
||||
}
|
||||
|
||||
/* 802C328C-802C32F0 2BDBCC 0064+00 0/0 1/1 0/0 .text setLinkShieldType__14Z2CreatureLinkFll */
|
||||
void Z2CreatureLink::setLinkShieldType(s32 i_shieldType, s32 param_1) {
|
||||
mLinkShieldType = i_shieldType;
|
||||
void Z2CreatureLink::setLinkShieldType(s32 shieldType, s32 param_1) {
|
||||
mLinkShieldType = shieldType;
|
||||
mFlag4 = param_1 == 1;
|
||||
|
||||
if (mLinkSwordType != 0) {
|
||||
@@ -46,8 +44,8 @@ void Z2CreatureLink::setLinkShieldType(s32 i_shieldType, s32 param_1) {
|
||||
}
|
||||
|
||||
/* 802C32F0-802C333C 2BDC30 004C+00 0/0 1/1 0/0 .text setLinkBootsType__14Z2CreatureLinkFl */
|
||||
void Z2CreatureLink::setLinkBootsType(s32 i_bootsType) {
|
||||
mLinkBootsType = i_bootsType;
|
||||
void Z2CreatureLink::setLinkBootsType(s32 bootsType) {
|
||||
mLinkBootsType = bootsType;
|
||||
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
startLinkSound(Z2SE_AL_CHANGE_BOOTS, 0, -1);
|
||||
@@ -102,10 +100,10 @@ void Z2CreatureLink::deleteObject() {
|
||||
}
|
||||
|
||||
/* 802C3638-802C3710 2BDF78 00D8+00 0/0 1/1 0/0 .text init__14Z2CreatureLinkFP3VecP3VecP3Vec */
|
||||
void Z2CreatureLink::init(Vec* param_0, Vec* param_1, Vec* param_2) {
|
||||
void Z2CreatureLink::init(Vec* animePosPtr, Vec* simplePosPtr, Vec* simple2PosPtr) {
|
||||
OS_REPORT("[Z2CreatureLink::init]");
|
||||
|
||||
Z2Creature::init(param_0, param_1, param_2, 6, 1, 2);
|
||||
Z2Creature::init(animePosPtr, simplePosPtr, simple2PosPtr, 6, 1, 2);
|
||||
Z2GetAudience()->getLinkMic()->setPosPtr(getCurrentPos());
|
||||
|
||||
field_0xc1 = 0xFF;
|
||||
@@ -117,7 +115,7 @@ void Z2CreatureLink::init(Vec* param_0, Vec* param_1, Vec* param_2) {
|
||||
mRiding = false;
|
||||
mMagnetized = false;
|
||||
mUsingIronBall = false;
|
||||
field_0xb4 = *param_0;
|
||||
field_0xb4 = *animePosPtr;
|
||||
mMoveSpeed = 0;
|
||||
mMovingTime = 0;
|
||||
mSinkDepth = -1;
|
||||
@@ -125,9 +123,9 @@ void Z2CreatureLink::init(Vec* param_0, Vec* param_1, Vec* param_2) {
|
||||
|
||||
/* 802C3710-802C374C 2BE050 003C+00 0/0 1/1 0/0 .text initKantera__14Z2CreatureLinkFP3Vec
|
||||
*/
|
||||
void Z2CreatureLink::initKantera(Vec* i_pos) {
|
||||
void Z2CreatureLink::initKantera(Vec* posPtr) {
|
||||
mKanteraState = 0;
|
||||
mKantera.init(i_pos, 2);
|
||||
mKantera.init(posPtr, 2);
|
||||
}
|
||||
|
||||
/* 802C374C-802C3778 2BE08C 002C+00 1/1 1/1 0/0 .text deleteKantera__14Z2CreatureLinkFv
|
||||
@@ -138,16 +136,16 @@ void Z2CreatureLink::deleteKantera() {
|
||||
}
|
||||
|
||||
/* 802C3778-802C3780 -00001 0008+00 0/0 0/0 0/0 .text setKanteraState__14Z2CreatureLinkFUc */
|
||||
void Z2CreatureLink::setKanteraState(u8 i_state) {
|
||||
mKanteraState = i_state;
|
||||
void Z2CreatureLink::setKanteraState(u8 state) {
|
||||
mKanteraState = state;
|
||||
}
|
||||
|
||||
/* 802C3780-802C3A64 2BE0C0 02E4+00 1/0 0/0 0/0 .text framework__14Z2CreatureLinkFUlSc */
|
||||
void Z2CreatureLink::framework(u32 param_0, s8 param_1) {
|
||||
Z2Creature::framework(param_0, param_1);
|
||||
void Z2CreatureLink::framework(u32 mapinfo, s8 reverb) {
|
||||
Z2Creature::framework(mapinfo, reverb);
|
||||
|
||||
if (mKantera.isAlive()) {
|
||||
mKantera.framework(param_0, param_1);
|
||||
mKantera.framework(mapinfo, reverb);
|
||||
}
|
||||
|
||||
if (field_0xc1 != 0xFF) {
|
||||
@@ -194,39 +192,53 @@ void Z2CreatureLink::framework(u32 param_0, s8 param_1) {
|
||||
|
||||
/* 802C3A64-802C3A6C -00001 0008+00 0/0 0/0 0/0 .text setSinkDepth__14Z2CreatureLinkFSc
|
||||
*/
|
||||
void Z2CreatureLink::setSinkDepth(s8 i_sinkDepth) {
|
||||
mSinkDepth = i_sinkDepth;
|
||||
void Z2CreatureLink::setSinkDepth(s8 sinkDepth) {
|
||||
mSinkDepth = sinkDepth;
|
||||
}
|
||||
|
||||
/* 802C3A6C-802C3AEC 2BE3AC 0080+00 0/0 4/4 0/0 .text setRiding__14Z2CreatureLinkFb */
|
||||
void Z2CreatureLink::setRiding(bool i_isRiding) {
|
||||
if (mRiding != i_isRiding) {
|
||||
if (i_isRiding) {
|
||||
void Z2CreatureLink::setRiding(bool isRiding) {
|
||||
if (mRiding != isRiding) {
|
||||
if (isRiding) {
|
||||
OS_REPORT("[Z2CreatureLink::setRiding] true targetVol = 0.35f\n");
|
||||
Z2GetAudience()->setTargetVolume(0.35f, 0);
|
||||
} else {
|
||||
OS_REPORT("[Z2CreatureLink::setRiding] false targetVol = 0.0f\n");
|
||||
Z2GetAudience()->setTargetVolume(0.0f, 0);
|
||||
}
|
||||
|
||||
mRiding = i_isRiding;
|
||||
mRiding = isRiding;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802C3AEC-802C3AFC 2BE42C 0010+00 0/0 5/5 0/0 .text setMagnetized__14Z2CreatureLinkFb
|
||||
*/
|
||||
void Z2CreatureLink::setMagnetized(bool i_isMagnetized) {
|
||||
mMagnetized = i_isMagnetized;
|
||||
void Z2CreatureLink::setMagnetized(bool isMagnetized) {
|
||||
mMagnetized = isMagnetized;
|
||||
}
|
||||
|
||||
/* 802C3AFC-802C3BD4 2BE43C 00D8+00 0/0 2/2 0/0 .text setWolfEyeOpen__14Z2CreatureLinkFb
|
||||
*/
|
||||
void Z2CreatureLink::setWolfEyeOpen(bool i_wolfEyeOpen) {
|
||||
mWolfEyeOpen = i_wolfEyeOpen;
|
||||
void Z2CreatureLink::setWolfEyeOpen(bool wolfEyeOpen) {
|
||||
mWolfEyeOpen = wolfEyeOpen;
|
||||
|
||||
if (mWolfEyeOpen) {
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
Z2AudioCS::start(0x55, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
Z2GetSeMgr()->seStart(Z2SE_WOLF_SENSE_OPEN_START, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
Z2GetFxLineMgr()->setFxForceOff(true);
|
||||
Z2GetSoundObjMgr()->setGhostEnemyState(32);
|
||||
} else {
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
Z2AudioCS::start(0x56, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
Z2GetSeMgr()->seStart(Z2SE_WOLF_SENSE_CLOSE, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
Z2GetFxLineMgr()->setFxForceOff(false);
|
||||
Z2GetSoundObjMgr()->setGhostEnemyState(16);
|
||||
@@ -235,11 +247,10 @@ void Z2CreatureLink::setWolfEyeOpen(bool i_wolfEyeOpen) {
|
||||
|
||||
/* 802C3BD4-802C3E68 2BE514 0294+00 3/3 3/3 0/0 .text
|
||||
* startLinkSound__14Z2CreatureLinkF10JAISoundIDUlSc */
|
||||
// stopSound seems to store to the stack twice
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkSound(JAISoundID i_soundID, u32 param_1, s8 param_2) {
|
||||
Z2SoundHandlePool* var_r30 = startCreatureSound(i_soundID, param_1, param_2);
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = startCreatureSound(soundID, mapinfo, reverb);
|
||||
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_DAMAGE_NORMAL:
|
||||
case Z2SE_AL_DAMAGE_LARGE:
|
||||
case Z2SE_AL_FREEZE:
|
||||
@@ -249,35 +260,35 @@ Z2SoundHandlePool* Z2CreatureLink::startLinkSound(JAISoundID i_soundID, u32 para
|
||||
mSoundObjAnime.stopSound(Z2SE_AL_HS_OPEN, 0);
|
||||
break;
|
||||
case Z2SE_AL_SINK_SAND_OUT:
|
||||
if (var_r30 != NULL && *var_r30) {
|
||||
f32 var_f31 = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 0.4f, 1.0f, false);
|
||||
f32 var_f30 = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 1.0f, 0.7f, false);
|
||||
if (handle != NULL && *handle) {
|
||||
f32 volume = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 0.4f, 1.0f, false);
|
||||
f32 pitch = Z2Calc::linearTransform(mSinkDepth, 32.0f, 127.0f, 1.0f, 0.7f, false);
|
||||
|
||||
(*var_r30)->getAuxiliary().moveVolume(var_f31, 0);
|
||||
(*var_r30)->getAuxiliary().movePitch(var_f30, 0);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
}
|
||||
break;
|
||||
case Z2SE_AL_SINK_SNOW_OUT:
|
||||
if (var_r30 != NULL && *var_r30) {
|
||||
f32 var_f29 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.5f, 1.0f, false);
|
||||
f32 var_f28 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, false);
|
||||
if (handle != NULL && *handle) {
|
||||
f32 volume = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.5f, 1.0f, false);
|
||||
f32 pitch = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, false);
|
||||
|
||||
(*var_r30)->getAuxiliary().moveVolume(var_f29, 0);
|
||||
(*var_r30)->getAuxiliary().movePitch(var_f28, 0);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return var_r30;
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802C3E68-802C4320 2BE7A8 04B8+00 1/1 3/3 0/0 .text
|
||||
* startLinkSoundLevel__14Z2CreatureLinkF10JAISoundIDUlSc */
|
||||
JAISoundHandle* Z2CreatureLink::startLinkSoundLevel(JAISoundID i_soundID, u32 param_1, s8 param_2) {
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
JAISoundHandle* Z2CreatureLink::startLinkSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
int iVar3 = -1;
|
||||
switch((u32)i_soundID) {
|
||||
switch((u32)soundID) {
|
||||
case Z2SE_AL_REEL_SLOW_LOOP:
|
||||
iVar3 = 0x16;
|
||||
break;
|
||||
@@ -296,81 +307,81 @@ JAISoundHandle* Z2CreatureLink::startLinkSoundLevel(JAISoundID i_soundID, u32 pa
|
||||
}
|
||||
#endif
|
||||
|
||||
if (i_soundID == Z2SE_AL_LIGHTNING_SW_GLOW && (Z2GetStatusMgr()->getDemoStatus() == 2 || !Z2GetSceneMgr()->isInGame())) {
|
||||
if (soundID == Z2SE_AL_LIGHTNING_SW_GLOW && (Z2GetStatusMgr()->getDemoStatus() == 2 || !Z2GetSceneMgr()->isInGame())) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* temp_r3 = startCreatureSoundLevel((u32)i_soundID, param_1, param_2);
|
||||
if (temp_r3 != NULL && *temp_r3) {
|
||||
f32 var_f31 = 1.0f;
|
||||
f32 var_f30 = 1.0f;
|
||||
int var_r30 = 0;
|
||||
Z2SoundHandlePool* handle = startCreatureSoundLevel((u32)soundID, mapinfo, reverb);
|
||||
if (handle != NULL && *handle) {
|
||||
f32 volume = 1.0f;
|
||||
f32 pitch = 1.0f;
|
||||
int volumeMoveSteps = 0;
|
||||
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_SINK_SAND_LEVEL:
|
||||
if (mSinkDepth > 0) {
|
||||
var_f31 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 0.4f, 1.0f, true);
|
||||
var_f30 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 1.0f, 0.7f, true);
|
||||
volume = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 0.4f, 1.0f, true);
|
||||
pitch = Z2Calc::linearTransform(mSinkDepth, 0.0f, 127.0f, 1.0f, 0.7f, true);
|
||||
}
|
||||
break;
|
||||
case Z2SE_AL_SINK_SNOW_LEVEL:
|
||||
if (mSinkDepth > 0) {
|
||||
var_f31 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.7f, 1.0f, true);
|
||||
var_f30 = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, true);
|
||||
volume = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 0.7f, 1.0f, true);
|
||||
pitch = Z2Calc::linearTransform(mSinkDepth, 0.0f, 23.0f, 1.0f, 0.7f, true);
|
||||
}
|
||||
break;
|
||||
case Z2SE_AL_SPINNER_RIDE:
|
||||
var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.3f, 0.8f, 1.0f, Z2Calc::CURVE_SIGN_0);
|
||||
pitch = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.3f, 0.8f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
|
||||
if (mMoveSpeed == 0 && mMovingTime > 120) {
|
||||
var_f31 = Z2Calc::getParamByExp(mMovingTime, 180.0f, 120.0f, 0.6f, 0.0f, 0.4f, Z2Calc::CURVE_SIGN_0);
|
||||
volume = Z2Calc::getParamByExp(mMovingTime, 180.0f, 120.0f, 0.6f, 0.0f, 0.4f, Z2Calc::CURVE_NEGATIVE);
|
||||
} else {
|
||||
var_f31 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.6f, 0.4f, 1.0f, Z2Calc::CURVE_SIGN_0);
|
||||
volume = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 30.0f, 0.6f, 0.4f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
}
|
||||
break;
|
||||
case Z2SE_AL_SPINNER_RAIL:
|
||||
var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.8f, 1.2f, Z2Calc::CURVE_SIGN_0);
|
||||
pitch = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.8f, 1.2f, Z2Calc::CURVE_NEGATIVE);
|
||||
break;
|
||||
case Z2SE_AL_SNOBO_RIDE:
|
||||
case Z2SE_AL_SNOBO_BREAK:
|
||||
/* dSv_event_flag_c::F_0266 - Snowpeak Ruins - Snowpeak Ruins clear */
|
||||
if (dComIfGs_isEventBit((u16)dSv_event_flag_c::saveBitLabels[266])
|
||||
&& Z2GetSeqMgr()->getSubBgmID() != Z2BGM_SNOW_BOARD) {
|
||||
var_f31 = 0.0f;
|
||||
var_r30 = 0;
|
||||
volume = 0.0f;
|
||||
volumeMoveSteps = 0;
|
||||
} else if (mMoveSpeed == 0) {
|
||||
var_f31 = 0.0f;
|
||||
var_r30 = 10;
|
||||
volume = 0.0f;
|
||||
volumeMoveSteps = 10;
|
||||
} else {
|
||||
var_f31 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.25f, 0.4f, 1.0f, Z2Calc::CURVE_SIGN_0);
|
||||
volume = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.25f, 0.4f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
}
|
||||
|
||||
var_f30 = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.5f, 1.1f, Z2Calc::CURVE_SIGN_0);
|
||||
pitch = Z2Calc::getParamByExp(mMoveSpeed, 0.0f, 80.0f, 0.3f, 0.5f, 1.1f, Z2Calc::CURVE_NEGATIVE);
|
||||
break;
|
||||
case Z2SE_AL_LIGHTNING_SW_GLOW:
|
||||
f32 temp_f1_2 = (*temp_r3)->getAuxiliary().mTransition.mVolume.mDest;
|
||||
f32 temp_f1_2 = (*handle)->getAuxiliary().transition_.volume_.targetValue_;
|
||||
if (Z2GetStatusMgr()->getDemoStatus() == 2 && temp_f1_2 != 0.3f) {
|
||||
var_f31 = 0.3f;
|
||||
var_r30 = 45;
|
||||
volume = 0.3f;
|
||||
volumeMoveSteps = 45;
|
||||
} else if (temp_f1_2 != 1.0f) {
|
||||
var_f31 = 1.0f;
|
||||
var_r30 = 45;
|
||||
volume = 1.0f;
|
||||
volumeMoveSteps = 45;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
(*temp_r3)->getAuxiliary().moveVolume(var_f31, var_r30);
|
||||
(*temp_r3)->getAuxiliary().movePitch(var_f30, 0);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, volumeMoveSteps);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
}
|
||||
|
||||
return temp_r3;
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802C4320-802C45B0 2BEC60 0290+00 1/1 1/1 0/0 .text
|
||||
* startLinkVoice__14Z2CreatureLinkF10JAISoundIDSc */
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkVoice(JAISoundID i_soundID, s8 param_1) {
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkVoice(JAISoundID soundID, s8 reverb) {
|
||||
if (mLinkState == 1) {
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_WL_V_BREATH_WAIT:
|
||||
case Z2SE_WL_V_BREATH_TIRED:
|
||||
case Z2SE_WL_V_BREATH_SIT:
|
||||
@@ -392,57 +403,56 @@ Z2SoundHandlePool* Z2CreatureLink::startLinkVoice(JAISoundID i_soundID, s8 param
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (i_soundID == Z2SE_AL_V_ATTACK_RUN) {
|
||||
if (soundID == Z2SE_AL_V_ATTACK_RUN) {
|
||||
if (field_0xc1 < 10) {
|
||||
return NULL;
|
||||
}
|
||||
field_0xc1 = 0;
|
||||
}
|
||||
|
||||
if (mMarkState != 3 && Z2GetSoundObjMgr()->getEnemyNumNear() == 0
|
||||
&& !Z2GetSoundObjMgr()->isForceBattle())
|
||||
if (mMarkState != 3 && Z2GetSoundObjMgr()->getEnemyNumNear() == 0 && !Z2GetSoundObjMgr()->isForceBattle())
|
||||
{
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_V_ATTACK_S:
|
||||
i_soundID = Z2SE_AL_V_ATTACK_S_FREE;
|
||||
soundID = Z2SE_AL_V_ATTACK_S_FREE;
|
||||
break;
|
||||
case Z2SE_AL_V_ATTACK_M:
|
||||
case Z2SE_AL_V_TATE_OSHI:
|
||||
i_soundID = Z2SE_AL_V_ATTACK_M_FREE;
|
||||
soundID = Z2SE_AL_V_ATTACK_M_FREE;
|
||||
break;
|
||||
case Z2SE_AL_V_ATTACK_L:
|
||||
i_soundID = Z2SE_AL_V_ATTACK_L_FREE;
|
||||
soundID = Z2SE_AL_V_ATTACK_L_FREE;
|
||||
break;
|
||||
case Z2SE_AL_V_KAITEN:
|
||||
i_soundID = Z2SE_AL_V_KAITEN_FREE;
|
||||
soundID = Z2SE_AL_V_KAITEN_FREE;
|
||||
break;
|
||||
case Z2SE_AL_V_BACKTEN:
|
||||
case Z2SE_AL_V_SOTOMO_ROLL:
|
||||
i_soundID = Z2SE_AL_V_BACKTEN_FREE;
|
||||
soundID = Z2SE_AL_V_BACKTEN_FREE;
|
||||
break;
|
||||
case Z2SE_AL_V_ATTACK_RUN:
|
||||
i_soundID = Z2SE_AL_V_ATTACK_RUN_FREE;
|
||||
soundID = Z2SE_AL_V_ATTACK_RUN_FREE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (i_soundID == Z2SE_AL_V_JUMP_S) {
|
||||
i_soundID = Z2SE_AL_V_BACKTEN;
|
||||
if (soundID == Z2SE_AL_V_JUMP_S) {
|
||||
soundID = Z2SE_AL_V_BACKTEN;
|
||||
}
|
||||
}
|
||||
|
||||
if (isInWater()) {
|
||||
i_soundID = Z2SE_AL_V_UNDER_WATER;
|
||||
soundID = Z2SE_AL_V_UNDER_WATER;
|
||||
}
|
||||
}
|
||||
|
||||
return startCreatureVoice(i_soundID, param_1);
|
||||
return startCreatureVoice(soundID, reverb);
|
||||
}
|
||||
|
||||
/* 802C45B0-802C46F0 2BEEF0 0140+00 0/0 1/1 0/0 .text
|
||||
* startLinkVoiceLevel__14Z2CreatureLinkF10JAISoundIDSc */
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkVoiceLevel(JAISoundID i_soundID, s8 param_1) {
|
||||
Z2SoundHandlePool* Z2CreatureLink::startLinkVoiceLevel(JAISoundID soundID, s8 reverb) {
|
||||
if (mLinkState == 1) {
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_WL_V_ROAR:
|
||||
f32 volume = 0.0f;
|
||||
u8 port_data = 0;
|
||||
@@ -465,7 +475,7 @@ Z2SoundHandlePool* Z2CreatureLink::startLinkVoiceLevel(JAISoundID i_soundID, s8
|
||||
break;
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* handle = startCreatureVoiceLevel(Z2SE_WL_V_ROAR, param_1);
|
||||
Z2SoundHandlePool* handle = startCreatureVoiceLevel(Z2SE_WL_V_ROAR, reverb);
|
||||
if (handle != NULL && *handle) {
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
Z2GetSoundStarter()->setPortData(handle, 8, port_data, -1);
|
||||
@@ -474,23 +484,33 @@ Z2SoundHandlePool* Z2CreatureLink::startLinkVoiceLevel(JAISoundID i_soundID, s8
|
||||
}
|
||||
}
|
||||
|
||||
return startCreatureVoiceLevel(i_soundID, param_1);
|
||||
return startCreatureVoiceLevel(soundID, reverb);
|
||||
}
|
||||
|
||||
/* 802C46F0-802C4784 2BF030 0094+00 0/0 2/2 0/0 .text
|
||||
* startLinkSwordSound__14Z2CreatureLinkF10JAISoundIDUlSc */
|
||||
void Z2CreatureLink::startLinkSwordSound(JAISoundID i_soundID, u32 id, s8 ch) {
|
||||
u32 soundID = i_soundID;
|
||||
void Z2CreatureLink::startLinkSwordSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
u32 sound_ID = soundID; // fakematch
|
||||
|
||||
switch (soundID) {
|
||||
switch (sound_ID) {
|
||||
case Z2SE_SWORD_POWER_COME:
|
||||
startCreatureExtraSoundLevel(soundID, id, ch);
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
Z2AudioCS::startLevel(0x2F, 0);
|
||||
}
|
||||
#endif
|
||||
startCreatureExtraSoundLevel(sound_ID, mapinfo, reverb);
|
||||
break;
|
||||
case Z2SE_WOLF_POWER_COME:
|
||||
startCreatureExtraSoundLevel(soundID, id, ch);
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
Z2AudioCS::startLevel(0x6B, 0);
|
||||
}
|
||||
#endif
|
||||
startCreatureExtraSoundLevel(sound_ID, mapinfo, reverb);
|
||||
break;
|
||||
default:
|
||||
startCreatureExtraSound(soundID, id, ch);
|
||||
startCreatureExtraSound(sound_ID, mapinfo, reverb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -515,30 +535,33 @@ Z2SoundHandlePool* Z2CreatureLink::startCollisionSE(u32 hitID, u32 mapinfo) {
|
||||
|
||||
/* 802C4814-802C48D8 2BF154 00C4+00 0/0 4/4 2/2 .text
|
||||
* startHitItemSE__14Z2CreatureLinkFUlUlP14Z2SoundObjBasef */
|
||||
Z2SoundHandlePool* Z2CreatureLink::startHitItemSE(u32 i_soundID, u32 param_1,
|
||||
Z2SoundObjBase* param_2, f32 speed) {
|
||||
if (param_2 == NULL) {
|
||||
param_2 = &mSoundObjSimple2;
|
||||
Z2SoundHandlePool* Z2CreatureLink::startHitItemSE(u32 soundID, u32 mapinfo, Z2SoundObjBase* other, f32 speed) {
|
||||
if (other == NULL) {
|
||||
other = &mSoundObjSimple2;
|
||||
}
|
||||
|
||||
if (i_soundID == Z2SE_HIT_SHIELD_ATTACK) {
|
||||
return mSoundObjAnime.startCollisionSE(i_soundID, param_1, NULL);
|
||||
if (soundID == Z2SE_HIT_SHIELD_ATTACK) {
|
||||
return mSoundObjAnime.startCollisionSE(soundID, mapinfo, NULL);
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* handle = param_2->startCollisionSE(i_soundID, param_1, NULL);
|
||||
Z2SoundHandlePool* handle = other->startCollisionSE(soundID, mapinfo, NULL);
|
||||
if (speed >= 0.0f && handle != NULL && *handle) {
|
||||
OS_REPORT("[Z2CreatureLink::startHitItemSE] speed:%.3f\n", speed);
|
||||
if (speed >= 100.0f) {
|
||||
speed = 100.0f;
|
||||
}
|
||||
(*handle)->getAuxiliary().moveVolume(speed / 100.0f, 0);
|
||||
|
||||
f32 volume = speed / 100.0f;
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802C48D8-802C48E8 2BF218 0010+00 0/0 1/1 0/0 .text setResumeAttack__14Z2CreatureLinkFb
|
||||
*/
|
||||
void Z2CreatureLink::setResumeAttack(bool i_resumeAttack) {
|
||||
mResumeAttack = i_resumeAttack;
|
||||
void Z2CreatureLink::setResumeAttack(bool resumeAttack) {
|
||||
mResumeAttack = resumeAttack;
|
||||
}
|
||||
|
||||
/* 802C48E8-802C4928 2BF228 0040+00 1/1 0/0 0/0 .text __ct__18Z2LinkSoundStarterFv */
|
||||
@@ -546,47 +569,47 @@ Z2LinkSoundStarter::Z2LinkSoundStarter() : Z2SoundStarter(false) {}
|
||||
|
||||
/* 802C4928-802C4FFC 2BF268 06D4+00 2/0 0/0 0/0 .text
|
||||
* startSound__18Z2LinkSoundStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f>UlfffffUl */
|
||||
bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, 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) {
|
||||
bool Z2LinkSoundStarter::startSound(JAISoundID soundID, JAISoundHandle* handle,
|
||||
const JGeometry::TVec3<f32>* posPtr, u32 mapinfo,
|
||||
f32 fxMix, f32 pitch, f32 volume, f32 pan,
|
||||
f32 dolby, u32 moveSteps) {
|
||||
bool bVar2 = false;
|
||||
bool bVar3 = false;
|
||||
|
||||
if (Z2GetLink()->isInWater() && Z2GetStatusMgr()->getCameraInWaterDepthRatio() > 0.0f) {
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_SWIM:
|
||||
case Z2SE_AL_DIVE_SWIM:
|
||||
i_soundID = Z2SE_AL_SWIM_UNDERWATER;
|
||||
soundID = Z2SE_AL_SWIM_UNDERWATER;
|
||||
break;
|
||||
case Z2SE_AL_SWORD_SWING_S:
|
||||
case Z2SE_AL_FINISH_SWING1:
|
||||
case Z2SE_AL_FINISH_SWING2:
|
||||
case Z2SE_AL_WAIT_SWORD_SWING:
|
||||
i_soundID = Z2SE_AL_WATER_STROKE_S;
|
||||
soundID = Z2SE_AL_WATER_STROKE_S;
|
||||
break;
|
||||
case Z2SE_AL_SWORD_SWING_L:
|
||||
i_soundID = Z2SE_AL_WATER_STROKE_L;
|
||||
soundID = Z2SE_AL_WATER_STROKE_L;
|
||||
break;
|
||||
case Z2SE_AL_SWORD_THRUST:
|
||||
i_soundID = Z2SE_AL_WATER_STROKE_FAST;
|
||||
soundID = Z2SE_AL_WATER_STROKE_FAST;
|
||||
break;
|
||||
case Z2SE_AL_KAITENGIRI:
|
||||
i_soundID = Z2SE_AL_WATER_STROKE_CIRCLE;
|
||||
soundID = Z2SE_AL_WATER_STROKE_CIRCLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i_soundID.mId.mBytes.b1 == 3 && param_3 > 26) {
|
||||
if (param_3 == 44) {
|
||||
param_3 = 23;
|
||||
if (soundID.id_.info.type.parts.groupID == 3 && mapinfo > 26) {
|
||||
if (mapinfo == 44) {
|
||||
mapinfo = 23;
|
||||
} else {
|
||||
JUT_WARN_DEVICE(929, 1, "%s", "mapinfo > 26\n");
|
||||
param_3 = 0;
|
||||
mapinfo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_INTO_WATER:
|
||||
case Z2SE_AL_DIVE_INTO_WATER:
|
||||
case Z2SE_WL_INTO_WATER:
|
||||
@@ -602,9 +625,9 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
case Z2SE_GORON_FOOTNOTE:
|
||||
case Z2SE_FN_GOB_JUMP:
|
||||
if (Z2GetLink()->mLinkBootsType == 1) {
|
||||
i_soundID = Z2SE_FN_WALK_HEAVY;
|
||||
soundID = Z2SE_FN_WALK_HEAVY;
|
||||
if (Z2GetLink()->mMagnetized) {
|
||||
param_3 = 127;
|
||||
mapinfo = 127;
|
||||
}
|
||||
}
|
||||
bVar3 = true;
|
||||
@@ -613,9 +636,9 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
bVar2 = true;
|
||||
bVar3 = true;
|
||||
if (Z2GetLink()->mLinkBootsType == 1) {
|
||||
i_soundID = Z2SE_FN_JUMP_HEAVY;
|
||||
soundID = Z2SE_FN_JUMP_HEAVY;
|
||||
if (Z2GetLink()->mMagnetized) {
|
||||
param_3 = 127;
|
||||
mapinfo = 127;
|
||||
}
|
||||
}
|
||||
if (Z2GetLink()->mSoundObjSimple1.getHandleSoundID(Z2SE_AL_V_FALL) != NULL) {
|
||||
@@ -640,7 +663,7 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
}
|
||||
|
||||
if (Z2GetLink()->mSinkDepth > 0) {
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_FN_WALK_DUMMY:
|
||||
case Z2SE_FN_JUMP_DUMMY:
|
||||
case Z2SE_FN_BOUND_DUMMY:
|
||||
@@ -651,32 +674,32 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
case Z2SE_WL_WALK_R_DUMMY:
|
||||
case Z2SE_WL_RUN_L_DUMMY:
|
||||
case Z2SE_WL_RUN_R_DUMMY:
|
||||
if (param_3 == 3) {
|
||||
param_5 *= Z2Calc::linearTransform(Z2GetLink()->mSinkDepth,
|
||||
if (mapinfo == 3) {
|
||||
pitch *= Z2Calc::linearTransform(Z2GetLink()->mSinkDepth,
|
||||
0.0f, 127.0f, 1.0f, 0.5f, true);
|
||||
} else if (param_3 == 25) {
|
||||
param_5 *= Z2Calc::linearTransform(Z2GetLink()->mSinkDepth,
|
||||
} else if (mapinfo == 25) {
|
||||
pitch *= Z2Calc::linearTransform(Z2GetLink()->mSinkDepth,
|
||||
0.0f, 23.0f, 1.0f, 0.7f, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool ret = Z2SoundStarter::startSound(i_soundID, param_1, param_2, param_3, param_4, param_5,
|
||||
param_6, param_7, param_8, param_9);
|
||||
bool ret = Z2SoundStarter::startSound(soundID, handle, posPtr, mapinfo, fxMix, pitch,
|
||||
volume, pan, dolby, moveSteps);
|
||||
|
||||
if (bVar2 && Z2GetSceneMgr()->getDemoSeWaveNum() != 114) {
|
||||
if (Z2GetLink()->mFlag5) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_SWORD_SHIELD_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_SWORD_SHIELD_ADD, 0, fxMix * 127.0f);
|
||||
}
|
||||
|
||||
if (Z2GetLink()->mUsingIronBall) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_IB_CHAIN_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_IB_CHAIN_ADD, 0, fxMix * 127.0f);
|
||||
}
|
||||
|
||||
if (Z2GetLink()->mKanteraState != 0) {
|
||||
Z2SoundHandlePool* handle =
|
||||
Z2GetLink()->mKantera.startSound(Z2SE_AL_KANTERA_SWING_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->mKantera.startSound(Z2SE_AL_KANTERA_SWING_ADD, 0, fxMix * 127.0f);
|
||||
if (Z2GetLink()->mKanteraState == 2 && handle != NULL && *handle) {
|
||||
(*handle)->getAuxiliary().moveVolume(0.6f, 0);
|
||||
(*handle)->getAuxiliary().movePitch(0.9f, 0);
|
||||
@@ -686,9 +709,9 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
|
||||
if (bVar3) {
|
||||
if (Z2GetLink()->getLinkState() == 4) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_FN_ARMER_LIGHT_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_FN_ARMER_LIGHT_ADD, 0, fxMix * 127.0f);
|
||||
} else if (Z2GetLink()->getLinkState() == 5) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_FN_ARMER_HEAVY_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_FN_ARMER_HEAVY_ADD, 0, fxMix * 127.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,8 +736,8 @@ void Z2CreatureRide::deleteObject() {
|
||||
}
|
||||
|
||||
/* 802C520C-802C522C 2BFB4C 0020+00 0/0 0/0 3/3 .text init__14Z2CreatureRideFP3VecP3VecUcUc */
|
||||
void Z2CreatureRide::init(Vec* param_0, Vec* param_1, u8 param_2, u8 param_3) {
|
||||
Z2Creature::init(param_0, param_1, param_2, param_3);
|
||||
void Z2CreatureRide::init(Vec* animePosPtr, Vec* simplePosPtr, u8 animeHandleNum, u8 simpleHandleNum) {
|
||||
Z2Creature::init(animePosPtr, simplePosPtr, animeHandleNum, simpleHandleNum);
|
||||
}
|
||||
|
||||
/* 802C522C-802C5234 -00001 0008+00 0/0 0/0 0/0 .text setLinkRiding__14Z2CreatureRideFb
|
||||
@@ -727,20 +750,21 @@ void Z2CreatureRide::setLinkRiding(bool isRiding) {
|
||||
*/
|
||||
Z2RideSoundStarter::Z2RideSoundStarter(Z2CreatureRide* ride) : Z2SoundStarter(false) {
|
||||
mRide = ride;
|
||||
JUT_ASSERT(1294, ride);
|
||||
}
|
||||
|
||||
/* 802C5284-802C54B8 2BFBC4 0234+00 2/0 0/0 0/0 .text
|
||||
* startSound__18Z2RideSoundStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f>UlfffffUl */
|
||||
bool Z2RideSoundStarter::startSound(JAISoundID i_soundID, 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) {
|
||||
bool Z2RideSoundStarter::startSound(JAISoundID soundID, JAISoundHandle* handle,
|
||||
const JGeometry::TVec3<f32>* posPtr, u32 mapinfo,
|
||||
f32 fxMix, f32 pitch, f32 volume, f32 pan,
|
||||
f32 dolby, u32 moveSteps) {
|
||||
if (!Z2GetSceneMgr()->isInGame()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 uVar3 = 0;
|
||||
switch (i_soundID) {
|
||||
switch (soundID) {
|
||||
case Z2SE_HS_WALK_L_DUMMY:
|
||||
case Z2SE_HS_WALK_R_DUMMY:
|
||||
case Z2SE_HS_TROT_L_DUMMY:
|
||||
@@ -755,17 +779,17 @@ bool Z2RideSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
break;
|
||||
}
|
||||
|
||||
bool ret = Z2SoundStarter::startSound((u32)i_soundID, param_1, param_2, param_3, param_4, param_5,
|
||||
param_6, param_7, param_8, param_9);
|
||||
bool ret = Z2SoundStarter::startSound((u32)soundID, handle, posPtr, mapinfo, fxMix, pitch,
|
||||
volume, pan, dolby, moveSteps);
|
||||
|
||||
if (mRide->isLinkRiding() && uVar3 != 0) {
|
||||
if (Z2GetLink()->mFlag5) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_SWORD_SHIELD_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_SWORD_SHIELD_ADD, 0, fxMix * 127.0f);
|
||||
}
|
||||
|
||||
if (Z2GetLink()->mKanteraState != 0) {
|
||||
Z2SoundHandlePool* handle =
|
||||
Z2GetLink()->mKantera.startSound(Z2SE_AL_KANTERA_SWING_ADD, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->mKantera.startSound(Z2SE_AL_KANTERA_SWING_ADD, 0, fxMix * 127.0f);
|
||||
if (Z2GetLink()->mKanteraState == 2 && handle != NULL && *handle) {
|
||||
(*handle)->getAuxiliary().moveVolume(0.6f, 0);
|
||||
(*handle)->getAuxiliary().movePitch(0.9f, 0);
|
||||
@@ -774,11 +798,10 @@ bool Z2RideSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
|
||||
switch (uVar3) {
|
||||
case 1:
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_HARNESS_ADD_HS, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_HARNESS_ADD_HS, 0, fxMix * 127.0f);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_HARNESS_ADD_WB, 0, param_4 * 127.0f);
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_HARNESS_ADD_WB, 0, fxMix * 127.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -792,8 +815,8 @@ Z2SoundObjCoach::Z2SoundObjCoach() {
|
||||
}
|
||||
|
||||
/* 802C54FC-802C551C 2BFE3C 0020+00 1/0 0/0 0/0 .text init__15Z2SoundObjCoachFP3VecUc */
|
||||
void Z2SoundObjCoach::init(Vec* i_soundPos, u8 i_numHandles) {
|
||||
Z2SoundObjBase::init(i_soundPos, i_numHandles);
|
||||
void Z2SoundObjCoach::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundObjBase::init(posPtr, handleNum);
|
||||
}
|
||||
|
||||
/* 802C551C-802C56C0 2BFE5C 01A4+00 0/0 0/0 1/1 .text startWheelSound__15Z2SoundObjCoachFf */
|
||||
@@ -805,20 +828,20 @@ Z2SoundHandlePool* Z2SoundObjCoach::startWheelSound(f32 param_0) {
|
||||
handle = startLevelSound(Z2SE_COACH_WHEEL_ROLL_A, 0, -1);
|
||||
if (handle != NULL && *handle) {
|
||||
f32 pitch = Z2Calc::getParamByExp(param_0, 0.0f, 35.0f, 0.25f, 0.88f, 1.25f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
f32 volume = Z2Calc::getParamByExp(param_0, 0.0f, 35.0f, 0.3f, 0.7f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
} else {
|
||||
handle = startLevelSound(Z2SE_COACH_WHEEL_ROLL_B, 0, -1);
|
||||
if (handle != NULL && *handle) {
|
||||
f32 pitch = Z2Calc::getParamByExp(param_0, 35.0f, 50.0f, 0.25f, 0.88f, 1.25f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
f32 volume = Z2Calc::getParamByExp(param_0, 35.0f, 50.0f, 0.3f, 0.8f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
}
|
||||
@@ -834,10 +857,10 @@ Z2SoundHandlePool* Z2SoundObjCoach::startFireSound(u16 param_0) {
|
||||
|
||||
if (handle != NULL && *handle) {
|
||||
f32 pitch = Z2Calc::getParamByExp(param_0, 0.0f, 1500.0f, 0.2f, 0.85f, 1.25f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
f32 volume = Z2Calc::getParamByExp(param_0, 0.0f, 1500.0f, 0.2f, 0.6f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
|
||||
@@ -846,15 +869,15 @@ Z2SoundHandlePool* Z2SoundObjCoach::startFireSound(u16 param_0) {
|
||||
|
||||
/* 802C57C0-802C588C 2C0100 00CC+00 1/0 0/0 0/0 .text
|
||||
* startSound__15Z2SoundObjCoachF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2SoundObjCoach::startSound(JAISoundID i_soundID, u32 param_1, s8 param_2) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(i_soundID, param_1, param_2);
|
||||
Z2SoundHandlePool* Z2SoundObjCoach::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb);
|
||||
|
||||
if (handle != NULL && *handle && i_soundID == Z2SE_COACH_SHAKE) {
|
||||
if (handle != NULL && *handle && soundID == Z2SE_COACH_SHAKE) {
|
||||
f32 pitch = Z2Calc::getParamByExp(field_0x20, 0.0f, 50.0f, 0.2f, 0.85f, 1.25f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
f32 volume = Z2Calc::getParamByExp(field_0x20, 0.0f, 50.0f, 0.2f, 0.8f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
|
||||
|
||||
+26
-26
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804507D8-804507DC 000258 0004+00 0/0 4/4 0/0 .sdata DISTANCE_MAX__7Z2Param */
|
||||
f32 Z2Param::DISTANCE_MAX = 2000.0f;
|
||||
|
||||
@@ -123,28 +122,31 @@ f32 Z2Param::VOL_SE_OBJECT_PAUSING = 72.0f / 127.0f;
|
||||
f32 Z2Param::VOL_SE_ATMOSPHERE_PAUSING = 72.0f / 127.0f;
|
||||
|
||||
/* 80450860-80450864 -00001 0004+00 0/0 15/15 0/0 .sdata None */
|
||||
u8 struct_80450860 = 0x21;
|
||||
u8 struct_80450861 = 0x3C;
|
||||
u8 struct_80450862 = 0x3C;
|
||||
u8 struct_80450863 = 0x1E;
|
||||
u8 Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME = 33;
|
||||
|
||||
u8 Z2Param::BGM_CROSS_FADEIN_TIME = 60;
|
||||
|
||||
u8 Z2Param::BGM_CROSS_FADEOUT_TIME = 60;
|
||||
|
||||
u8 Z2Param::BATTLE_BGM_WAIT_TIME = 30;
|
||||
|
||||
/* 80450864-80450868 -00001 0004+00 0/0 2/2 0/0 .sdata None */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
u8 struct_80450864 = 0x14;
|
||||
u8 struct_80450865 = 0x1E;
|
||||
u8 struct_80450866 = 0x0A;
|
||||
u8 struct_80450867 = 0x1E;
|
||||
#pragma pop
|
||||
u8 Z2Param::FOUND_TRACK_FI_TIME = 20;
|
||||
|
||||
u8 Z2Param::FOUND_TRACK_FO_TIME = 30;
|
||||
|
||||
u8 Z2Param::CLOSE_BATTLE_TRACK_FI_TIME = 10;
|
||||
|
||||
u8 Z2Param::CLOSE_BATTLE_TRACK_FO_TIME = 30;
|
||||
|
||||
/* 80450868-8045086C -00001 0004+00 0/0 5/5 0/0 .sdata None */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
u8 struct_80450868 = 0x01;
|
||||
u8 struct_80450869 = 0x0A;
|
||||
u8 struct_8045086A = 0x1E;
|
||||
u8 struct_8045086B = 0x14;
|
||||
#pragma pop
|
||||
u8 Z2Param::ENDING_BLOW_VOL_DOWN_TIME = 1;
|
||||
|
||||
u8 Z2Param::ENDING_BLOW_VOL_LOWER_TIME = 10;
|
||||
|
||||
u8 Z2Param::ENDING_BLOW_VOL_LOWER_RECOVER_TIME = 30;
|
||||
|
||||
u8 Z2Param::ENDING_BLOW_MIN_FINISH_TIME = 20;
|
||||
|
||||
/* 8045086C-80450870 0002EC 0004+00 0/0 3/3 0/0 .sdata None */
|
||||
u8 data_8045086C = 1;
|
||||
@@ -158,12 +160,10 @@ f32 Z2Param::ENEMY_LASTHIT_MUTE_VOLUME;
|
||||
|
||||
/* 80451340-80451348 -00001 0008+00 0/0 2/2 0/0 .sbss None */
|
||||
/* 80451340 0001+00 data_80451340 None */
|
||||
u8 Z2Param::DARK_SE_FILTER_ON;
|
||||
|
||||
/* 80451341 0001+00 data_80451341 None */
|
||||
u8 Z2Param::DARK_SE_LOW_PASS_FILTER_SETTING;
|
||||
|
||||
/* 80451342 0006+00 data_80451342 None */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
u8 struct_80451340;
|
||||
u8 struct_80451341;
|
||||
u8 struct_80451342;
|
||||
u8 pad_80451344[4];
|
||||
#pragma pop
|
||||
u8 Z2Param::SYSTEM_SE_USE_DARK_SE_SETTING;
|
||||
|
||||
+240
-235
File diff suppressed because it is too large
Load Diff
+359
-332
File diff suppressed because it is too large
Load Diff
+751
-647
File diff suppressed because it is too large
Load Diff
@@ -1,40 +1,38 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2SoundHandles
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundHandles.h"
|
||||
#include "JSystem/JAudio2/JAISoundInfo.h"
|
||||
|
||||
Z2SoundHandles::Z2SoundHandles() {
|
||||
mNumHandles = 0;
|
||||
handleNum_ = 0;
|
||||
}
|
||||
|
||||
Z2SoundHandles::~Z2SoundHandles() {
|
||||
deleteHandlesPool();
|
||||
}
|
||||
|
||||
void Z2SoundHandles::initHandlesPool(u8 pNumHandles) {
|
||||
mNumHandles = pNumHandles;
|
||||
void Z2SoundHandles::initHandlesPool(u8 handleNum) {
|
||||
handleNum_ = handleNum;
|
||||
}
|
||||
|
||||
/* 802AB120-802AB200 2A5A60 00E0+00 1/1 1/1 0/0 .text deleteHandlesPool__14Z2SoundHandlesFv */
|
||||
void Z2SoundHandles::deleteHandlesPool() {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
while (link = getFirst(), link != NULL) {
|
||||
Z2SoundHandlePool* handle = link->getObject();
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
while (i = getFirst(), i != NULL) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
JUT_ASSERT(48, handle->getSupervisor() == this);
|
||||
|
||||
remove(handle);
|
||||
delete handle;
|
||||
}
|
||||
mNumHandles = 0;
|
||||
|
||||
handleNum_ = 0;
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* Z2SoundHandles::getHandleSoundID(JAISoundID pSoundId) {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
Z2SoundHandlePool* handle = link->getObject();
|
||||
Z2SoundHandlePool* Z2SoundHandles::getHandleSoundID(JAISoundID soundID) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
if (handle->isSoundAttached()) {
|
||||
if ((*handle)->getID() == pSoundId) {
|
||||
if ((*handle)->getID() == soundID) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
@@ -43,12 +41,12 @@ Z2SoundHandlePool* Z2SoundHandles::getHandleSoundID(JAISoundID pSoundId) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Z2SoundHandlePool* Z2SoundHandles::getHandleUserData(u32 pUserData) {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
Z2SoundHandlePool* handle = link->getObject();
|
||||
Z2SoundHandlePool* Z2SoundHandles::getHandleUserData(u32 userData) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
if (handle->isSoundAttached()) {
|
||||
if ((*handle)->getUserData() == pUserData) {
|
||||
if ((*handle)->getUserData() == userData) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
@@ -60,21 +58,23 @@ Z2SoundHandlePool* Z2SoundHandles::getHandleUserData(u32 pUserData) {
|
||||
/* 802AB2D8-802AB3D0 2A5C18 00F8+00 0/0 3/3 0/0 .text getFreeHandle__14Z2SoundHandlesFv
|
||||
*/
|
||||
Z2SoundHandlePool* Z2SoundHandles::getFreeHandle() {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
Z2SoundHandlePool* handle = link->getObject();
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
if (!handle->isSoundAttached()) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
if (getNumHandles() < mNumHandles)
|
||||
{
|
||||
if (getNumHandles() < handleNum_) {
|
||||
Z2SoundHandlePool* handle = new Z2SoundHandlePool();
|
||||
if (handle != NULL) {
|
||||
append(handle);
|
||||
JUT_ASSERT(113, handle->getSupervisor() == this);
|
||||
return handle;
|
||||
}
|
||||
|
||||
JUT_WARN_DEVICE(118, 1, "%s", "cannot Alloc Handle !!\n");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -82,46 +82,52 @@ Z2SoundHandlePool* Z2SoundHandles::getFreeHandle() {
|
||||
|
||||
/* 802AB3D0-802AB4A0 2A5D10 00D0+00 0/0 2/2 0/0 .text
|
||||
* getLowPrioSound__14Z2SoundHandlesF10JAISoundID */
|
||||
Z2SoundHandlePool* Z2SoundHandles::getLowPrioSound(JAISoundID pSoundId) {
|
||||
JAISoundInfo* sound_info = JASGlobalInstance<JAISoundInfo>::getInstance();
|
||||
Z2SoundHandlePool* handle;
|
||||
u32 low_prio = 0xffff;
|
||||
Z2SoundHandlePool* low_prio_handle = NULL;
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
handle = link->getObject();
|
||||
Z2SoundHandlePool* Z2SoundHandles::getLowPrioSound(JAISoundID soundID) {
|
||||
JAISoundInfo* soundInfo = JASGlobalInstance<JAISoundInfo>::getInstance();
|
||||
u32 low_prio = 0xFFFF;
|
||||
Z2SoundHandlePool* rethandle = NULL;
|
||||
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
if (!handle->isSoundAttached()) {
|
||||
return handle;
|
||||
}
|
||||
u32 prio = sound_info->getPriority(handle->getSound()->getID());
|
||||
|
||||
u32 prio = soundInfo->getPriority((*handle)->getID());
|
||||
if (prio < low_prio) {
|
||||
low_prio = prio;
|
||||
low_prio_handle = handle;
|
||||
rethandle = handle;
|
||||
}
|
||||
}
|
||||
if (sound_info->getPriority(pSoundId) >= low_prio) {
|
||||
return low_prio_handle;
|
||||
|
||||
#if DEBUG
|
||||
if (rethandle != NULL) {
|
||||
JUT_ASSERT(163, rethandle->getSupervisor() == this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (soundInfo->getPriority(soundID) >= low_prio) {
|
||||
return rethandle;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Z2SoundHandles::stopAllSounds(u32 fadeout) {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
JAISoundHandle* handle = link->getObject();
|
||||
//! @meme: explicit operator bool call required to match and be similar
|
||||
//! to CHN_debug; could more concisely write handle->isSoundAttached
|
||||
//! (for some reason cast-to-bool doesn't work?)
|
||||
if (handle && handle->operator bool()) {
|
||||
(*handle)->stop(fadeout);
|
||||
void Z2SoundHandles::stopAllSounds(u32 fadeTime) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
JAISoundHandle* handle = i->getObject();
|
||||
if (handle && (*handle)) {
|
||||
(*handle)->stop(fadeTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Z2SoundHandles::isActive() const {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
if (link->getObject()->isSoundAttached()) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
if (i->getObject()->isSoundAttached()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -131,12 +137,15 @@ bool Z2SoundHandles::isActive() const {
|
||||
|
||||
/* 802AB538-802AB64C 2A5E78 0114+00 0/0 1/1 0/0 .text
|
||||
* setPos__14Z2SoundHandlesFRCQ29JGeometry8TVec3<f> */
|
||||
void Z2SoundHandles::setPos(JGeometry::TVec3<f32> const& param_0) {
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
Z2SoundHandlePool* handle = link->getObject();
|
||||
void Z2SoundHandles::setPos(const JGeometry::TVec3<f32>& pos) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2SoundHandlePool* handle = i->getObject();
|
||||
JUT_ASSERT(209, handle);
|
||||
JUT_ASSERT(210, handle->getSupervisor() == this);
|
||||
|
||||
if (handle->isSoundAttached()) {
|
||||
handle->getSound()->setPos(param_0);
|
||||
(*handle)->setPos(pos);
|
||||
}
|
||||
else {
|
||||
remove(handle);
|
||||
|
||||
+144
-127
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2SoundInfo
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundInfo.h"
|
||||
#include "JSystem/JAudio2/JAISeq.h"
|
||||
#include "JSystem/JAudio2/JAISe.h"
|
||||
@@ -11,7 +6,6 @@
|
||||
#include "JSystem/JAudio2/JAUSoundTable.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "dolphin/dvd.h"
|
||||
|
||||
struct JAUStdSoundTableType {
|
||||
static const u32 STRM_CH_SHIFT;
|
||||
@@ -24,23 +18,24 @@ struct JAUStdSoundTableType {
|
||||
|
||||
/* 802BB00C-802BB090 2B594C 0084+00 2/1 0/0 0/0 .text
|
||||
* getBgmSeqResourceID__11Z2SoundInfoCF10JAISoundID */
|
||||
u16 Z2SoundInfo::getBgmSeqResourceID(JAISoundID param_0) const {
|
||||
u16 Z2SoundInfo::getBgmSeqResourceID(JAISoundID soundID) const {
|
||||
JUT_ASSERT(20, isValid());
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_0);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_0);
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
|
||||
if (data != NULL) {
|
||||
switch ((typeID & 0xf0)) {
|
||||
case 0x60:
|
||||
return data->mResourceId;
|
||||
return (u16)data->mResourceId;
|
||||
}
|
||||
}
|
||||
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
/* 802BB090-802BB0D8 2B59D0 0048+00 1/0 0/0 0/0 .text getSoundType__11Z2SoundInfoCF10JAISoundID */
|
||||
int Z2SoundInfo::getSoundType(JAISoundID param_0) const {
|
||||
switch (param_0.mId.mBytes.b0) {
|
||||
int Z2SoundInfo::getSoundType(JAISoundID soundID) const {
|
||||
switch (soundID.id_.info.type.parts.sectionID) {
|
||||
case 0:
|
||||
return 0;
|
||||
case 1:
|
||||
@@ -48,178 +43,194 @@ int Z2SoundInfo::getSoundType(JAISoundID param_0) const {
|
||||
case 2:
|
||||
return 2;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* 802BB0D8-802BB0E0 2B5A18 0008+00 1/0 0/0 0/0 .text getCategory__11Z2SoundInfoCF10JAISoundID */
|
||||
int Z2SoundInfo::getCategory(JAISoundID param_0) const {
|
||||
return param_0.mId.mBytes.b1;
|
||||
int Z2SoundInfo::getCategory(JAISoundID soundID) const {
|
||||
return soundID.id_.info.type.parts.groupID;
|
||||
}
|
||||
|
||||
/* 802BB0E0-802BB158 2B5A20 0078+00 1/0 0/0 0/0 .text getPriority__11Z2SoundInfoCF10JAISoundID */
|
||||
u32 Z2SoundInfo::getPriority(JAISoundID param_0) const {
|
||||
u32 Z2SoundInfo::getPriority(JAISoundID soundID) const {
|
||||
JUT_ASSERT(63, isValid());
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_0);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_0);
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
|
||||
if (data != NULL && (typeID & 0x40) != 0) {
|
||||
return data->mPriority;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802BB158-802BB448 2B5A98 02F0+00 0/0 1/1 0/0 .text getAudibleSwFull__11Z2SoundInfoF10JAISoundID
|
||||
*/
|
||||
JAUAudibleParam Z2SoundInfo::getAudibleSwFull(JAISoundID param_0) {
|
||||
JAUAudibleParam local_28;
|
||||
JAUAudibleParam Z2SoundInfo::getAudibleSwFull(JAISoundID soundID) {
|
||||
JAUAudibleParam audibleParam;
|
||||
JUT_ASSERT(82, isValid());
|
||||
int iVar1, uVar7;
|
||||
switch (JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_0)) {
|
||||
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
switch (typeID) {
|
||||
case 81:
|
||||
local_28.field_0x0.bytes.b0_0 = (u32)getSwBit(param_0) >> 8;
|
||||
if ((getSwBit(param_0) & 1) != 0) {
|
||||
local_28.field_0x0.bytes.b0_4 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_0 = (u32)getSwBit(soundID) >> 8;
|
||||
if ((getSwBit(soundID) & 1) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_4 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_4 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_4 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 2) != 0) {
|
||||
local_28.field_0x0.bytes.b0_5 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 2) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_5 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_5 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_5 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 4) != 0) {
|
||||
local_28.field_0x0.bytes.b0_6 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 4) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_6 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_6 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_6 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x800000) != 0) {
|
||||
local_28.field_0x0.bytes.b0_7 = 1;
|
||||
|
||||
if ((getSwBit(soundID) & 0x800000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_7 = 1;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_7 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_7 = 0;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x1000) != 0) {
|
||||
local_28.field_0x0.bytes.b1_0 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 0x1000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b1_0 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b1_0 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_0 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x2000) != 0) {
|
||||
local_28.field_0x0.bytes.b1_1 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 0x2000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b1_1 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b1_1 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_1 = 1;
|
||||
}
|
||||
|
||||
uVar7 = 0;
|
||||
if ((getSwBit(param_0) & 0x80000) != 0) {
|
||||
if ((getSwBit(soundID) & 0x80000) != 0) {
|
||||
uVar7 = 8;
|
||||
}
|
||||
|
||||
iVar1 = (getSwBit(param_0) >> 16) & 0x7;
|
||||
iVar1 += (getSwBit(param_0) >> 16) & 0x70;
|
||||
iVar1 += (getSwBit(param_0) >> 16) & 0xf00;
|
||||
local_28.field_0x0.bytes.b1_2_7 = uVar7;
|
||||
local_28.field_0x0.half.f1 = iVar1;
|
||||
iVar1 = (getSwBit(soundID) >> 16) & 0x7;
|
||||
iVar1 += (getSwBit(soundID) >> 16) & 0x70;
|
||||
iVar1 += (getSwBit(soundID) >> 16) & 0xf00;
|
||||
audibleParam.field_0x0.bytes.b1_2_7 = uVar7;
|
||||
audibleParam.field_0x0.half.f1 = iVar1;
|
||||
break;
|
||||
default:
|
||||
local_28.field_0x0.bytes.b0_0 = 0;
|
||||
local_28.field_0x0.bytes.b0_4 = 1;
|
||||
local_28.field_0x0.bytes.b0_5 = 1;
|
||||
local_28.field_0x0.bytes.b0_6 = 1;
|
||||
local_28.field_0x0.bytes.b0_7 = 0;
|
||||
local_28.field_0x0.bytes.b1_0 = 1;
|
||||
local_28.field_0x0.bytes.b1_1 = 1;
|
||||
local_28.field_0x0.bytes.b1_2_7 = 0;
|
||||
local_28.field_0x0.half.f1 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_0 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_4 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_5 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_6 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_7 = 0;
|
||||
audibleParam.field_0x0.bytes.b1_0 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_1 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_2_7 = 0;
|
||||
audibleParam.field_0x0.half.f1 = 0;
|
||||
break;
|
||||
}
|
||||
return local_28;
|
||||
|
||||
return audibleParam;
|
||||
}
|
||||
|
||||
/* 802BB448-802BB6DC 2B5D88 0294+00 2/1 0/0 0/0 .text getAudibleSw__11Z2SoundInfoCF10JAISoundID */
|
||||
u16 Z2SoundInfo::getAudibleSw(JAISoundID param_0) const {
|
||||
JAUAudibleParam local_28;
|
||||
u16 Z2SoundInfo::getAudibleSw(JAISoundID soundID) const {
|
||||
JAUAudibleParam audibleParam;
|
||||
JUT_ASSERT(184, isValid());
|
||||
int iVar1, uVar7;
|
||||
switch (JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_0)) {
|
||||
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
switch (typeID) {
|
||||
case 81:
|
||||
local_28.field_0x0.bytes.b0_0 = (u32)getSwBit(param_0) >> 8;
|
||||
if ((getSwBit(param_0) & 1) != 0) {
|
||||
local_28.field_0x0.bytes.b0_4 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_0 = (u32)getSwBit(soundID) >> 8;
|
||||
if ((getSwBit(soundID) & 1) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_4 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_4 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_4 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 2) != 0) {
|
||||
local_28.field_0x0.bytes.b0_5 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 2) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_5 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_5 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_5 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 4) != 0) {
|
||||
local_28.field_0x0.bytes.b0_6 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 4) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_6 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_6 = 1;
|
||||
audibleParam.field_0x0.bytes.b0_6 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x800000) != 0) {
|
||||
local_28.field_0x0.bytes.b0_7 = 1;
|
||||
|
||||
if ((getSwBit(soundID) & 0x800000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b0_7 = 1;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b0_7 = 0;
|
||||
audibleParam.field_0x0.bytes.b0_7 = 0;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x1000) != 0) {
|
||||
local_28.field_0x0.bytes.b1_0 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 0x1000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b1_0 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b1_0 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_0 = 1;
|
||||
}
|
||||
if ((getSwBit(param_0) & 0x2000) != 0) {
|
||||
local_28.field_0x0.bytes.b1_1 = 0;
|
||||
|
||||
if ((getSwBit(soundID) & 0x2000) != 0) {
|
||||
audibleParam.field_0x0.bytes.b1_1 = 0;
|
||||
} else {
|
||||
local_28.field_0x0.bytes.b1_1 = 1;
|
||||
audibleParam.field_0x0.bytes.b1_1 = 1;
|
||||
}
|
||||
|
||||
uVar7 = 0;
|
||||
if ((getSwBit(param_0) & 0x80000) != 0) {
|
||||
if ((getSwBit(soundID) & 0x80000) != 0) {
|
||||
uVar7 = 8;
|
||||
}
|
||||
|
||||
iVar1 = (getSwBit(param_0) >> 16) & 0x7;
|
||||
iVar1 += (getSwBit(param_0) >> 16) & 0x70;
|
||||
iVar1 += (getSwBit(param_0) >> 16) & 0xf00;
|
||||
local_28.field_0x0.bytes.b1_2_7 = uVar7;
|
||||
local_28.field_0x0.half.f1 = iVar1;
|
||||
iVar1 = (getSwBit(soundID) >> 16) & 0x7;
|
||||
iVar1 += (getSwBit(soundID) >> 16) & 0x70;
|
||||
iVar1 += (getSwBit(soundID) >> 16) & 0xf00;
|
||||
audibleParam.field_0x0.bytes.b1_2_7 = uVar7;
|
||||
audibleParam.field_0x0.half.f1 = iVar1;
|
||||
break;
|
||||
default:
|
||||
local_28.field_0x0.half.f0 = 0xffff;
|
||||
local_28.field_0x0.half.f1 = 0xffff;
|
||||
audibleParam.field_0x0.half.f0 = 0xffff;
|
||||
audibleParam.field_0x0.half.f1 = 0xffff;
|
||||
break;
|
||||
}
|
||||
return local_28.field_0x0.half.f0;
|
||||
|
||||
return audibleParam.field_0x0.half.f0;
|
||||
}
|
||||
|
||||
/* 802BB6DC-802BB8B4 2B601C 01D8+00 1/0 0/0 0/0 .text
|
||||
* getSeInfo__11Z2SoundInfoCF10JAISoundIDP5JAISe */
|
||||
void Z2SoundInfo::getSeInfo(JAISoundID param_1, JAISe* param_2) const {
|
||||
getSoundInfo_(param_1, param_2);
|
||||
void Z2SoundInfo::getSeInfo(JAISoundID soundID, JAISe* sePtr) const {
|
||||
getSoundInfo_(soundID, sePtr);
|
||||
JUT_ASSERT(292, isValid());
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_1);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_1);
|
||||
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
if (data == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch(typeID) {
|
||||
case 81:
|
||||
param_2->getProperty().field_0x8 *= data->field_0x8;
|
||||
u32 uStack_6c = (getSwBit(param_1) & 0xf0) >> 4;
|
||||
sePtr->getProperty().field_0x8 *= data->field_0x8;
|
||||
u32 uStack_6c = (getSwBit(soundID) & 0xf0) >> 4;
|
||||
if (uStack_6c > 8) {
|
||||
f32 dVar18 = Z2Calc::getRandom_0_1();
|
||||
f32 dVar19 = Z2Calc::linearTransform(uStack_6c, 8.0f, 15.0f, 16.0f, 24.0f, true);
|
||||
dVar19 = dVar19 / 48.0f * dVar18;
|
||||
param_2->getProperty().field_0x8 += dVar19;
|
||||
sePtr->getProperty().field_0x8 += Z2Calc::linearTransform(uStack_6c, 8.0f, 15.0f, 16.0f, 24.0f, true) / 48.0f * Z2Calc::getRandom_0_1();
|
||||
} else {
|
||||
f32 dVar18 = Z2Calc::getRandom_0_1();
|
||||
dVar18 = (uStack_6c / 48.0f) * dVar18;
|
||||
param_2->getProperty().field_0x8 += dVar18;
|
||||
sePtr->getProperty().field_0x8 += (uStack_6c / 48.0f) * Z2Calc::getRandom_0_1();
|
||||
}
|
||||
u32 uVar1 = (u32)getSwBit(param_1) >> 0x1c;
|
||||
|
||||
u32 uVar1 = (u32)getSwBit(soundID) >> 0x1c;
|
||||
if (uVar1 != 0) {
|
||||
f32 dVar18 = (uVar1 / 15.0f) * Z2Calc::getRandom_0_1();
|
||||
param_2->getProperty().field_0x0 -= dVar18 < 0.0f ? 0.0f : (dVar18 > 1.0f ? 1.0f : dVar18);
|
||||
sePtr->getProperty().field_0x0 -= dVar18 < 0.0f ? 0.0f : (dVar18 > 1.0f ? 1.0f : dVar18);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -227,43 +238,46 @@ void Z2SoundInfo::getSeInfo(JAISoundID param_1, JAISe* param_2) const {
|
||||
|
||||
/* 802BB8B4-802BB8E0 2B61F4 002C+00 1/0 0/0 0/0 .text
|
||||
* getSeqInfo__11Z2SoundInfoCF10JAISoundIDP6JAISeq */
|
||||
void Z2SoundInfo::getSeqInfo(JAISoundID param_0, JAISeq* param_1) const {
|
||||
getSoundInfo_(param_0, param_1);
|
||||
void Z2SoundInfo::getSeqInfo(JAISoundID soundID, JAISeq* seqPtr) const {
|
||||
getSoundInfo_(soundID, seqPtr);
|
||||
}
|
||||
|
||||
/* 80455A90-80455A94 004090 0004+00 1/1 0/0 0/0 .sdata2 STRM_CH_SHIFT__20JAUStdSoundTableType */
|
||||
u32 const JAUStdSoundTableType::STRM_CH_SHIFT = 2;
|
||||
const u32 JAUStdSoundTableType::STRM_CH_SHIFT = 2;
|
||||
|
||||
/* 802BB8E0-802BBA10 2B6220 0130+00 1/0 0/0 0/0 .text
|
||||
* getStreamInfo__11Z2SoundInfoCF10JAISoundIDP9JAIStream */
|
||||
void Z2SoundInfo::getStreamInfo(JAISoundID param_1, JAIStream* param_2) const {
|
||||
void Z2SoundInfo::getStreamInfo(JAISoundID soundID, JAIStream* streamPtr) const {
|
||||
int numChild;
|
||||
JAUSoundTableItem* data;
|
||||
getSoundInfo_(param_1, param_2);
|
||||
getSoundInfo_(soundID, streamPtr);
|
||||
JUT_ASSERT(349, isValid());
|
||||
switch (JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_1) & 0xf0) {
|
||||
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
switch (typeID & 0xf0) {
|
||||
case 0x70:
|
||||
u16 uVar1;
|
||||
s32 iVar4;
|
||||
data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_1);
|
||||
data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
JUT_ASSERT(356, data);
|
||||
|
||||
uVar1 = data->mResourceId;
|
||||
numChild = param_2->getNumChild();
|
||||
numChild = streamPtr->getNumChild();
|
||||
iVar4 = 0;
|
||||
for (; iVar4 < numChild && uVar1 != 0; uVar1 >>= JAUStdSoundTableType::STRM_CH_SHIFT, iVar4++) {
|
||||
u32 uVar2 = uVar1 & 3;
|
||||
if (uVar2 != 0) {
|
||||
JAISoundChild* child = param_2->getChild(iVar4);
|
||||
JAISoundChild* child = streamPtr->getChild(iVar4);
|
||||
if (child != NULL) {
|
||||
switch (uVar2) {
|
||||
case 1:
|
||||
child->mMove.mParams.mPan = 0.5f;
|
||||
child->mMove.params_.mPan = 0.5f;
|
||||
break;
|
||||
case 2:
|
||||
child->mMove.mParams.mPan = 0.0f;
|
||||
child->mMove.params_.mPan = 0.0f;
|
||||
break;
|
||||
case 3:
|
||||
child->mMove.mParams.mPan = 1.0f;
|
||||
child->mMove.params_.mPan = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -274,51 +288,54 @@ void Z2SoundInfo::getStreamInfo(JAISoundID param_1, JAIStream* param_2) const {
|
||||
|
||||
/* 802BBA10-802BBA88 2B6350 0078+00 1/1 0/0 0/0 .text
|
||||
* getStreamFilePath__11Z2SoundInfoF10JAISoundID */
|
||||
const char* Z2SoundInfo::getStreamFilePath(JAISoundID param_1) {
|
||||
const char* Z2SoundInfo::getStreamFilePath(JAISoundID soundID) {
|
||||
JUT_ASSERT(387, isValid());
|
||||
JAUSoundTableItem* data;
|
||||
const void* resource;
|
||||
switch (JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_1) & 0xf0) {
|
||||
|
||||
switch (JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID) & 0xf0) {
|
||||
case 0x70:
|
||||
data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_1);
|
||||
data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
JUT_ASSERT(394, data);
|
||||
resource = JASGlobalInstance<JAUSoundTable>::getInstance()->getResource();
|
||||
JUT_ASSERT(398, resource);
|
||||
return JAUStdSoundTableType::StringOffset::getString(resource, data->field_0x4);
|
||||
default:
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BBA88-802BBAC8 2B63C8 0040+00 2/1 0/0 0/0 .text
|
||||
* getStreamFileEntry__11Z2SoundInfoF10JAISoundID */
|
||||
s32 Z2SoundInfo::getStreamFileEntry(JAISoundID param_0) {
|
||||
const char* path = getStreamFilePath(param_0);
|
||||
s32 Z2SoundInfo::getStreamFileEntry(JAISoundID soundID) {
|
||||
const char* path = getStreamFilePath(soundID);
|
||||
return !path ? -1 : DVDConvertPathToEntrynum(path);
|
||||
}
|
||||
|
||||
/* 802BBAC8-802BBB48 2B6408 0080+00 3/3 4/4 0/0 .text getSwBit__11Z2SoundInfoCF10JAISoundID */
|
||||
int Z2SoundInfo::getSwBit(JAISoundID param_1) const {
|
||||
int Z2SoundInfo::getSwBit(JAISoundID soundID) const {
|
||||
JUT_ASSERT(418, isValid());
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_1);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_1);
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
if (data != NULL) {
|
||||
switch(typeID) {
|
||||
case 81:
|
||||
return data->field_0x4;
|
||||
}
|
||||
}
|
||||
return 0xffffffff;
|
||||
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
/* 802BBB48-802BBBE0 2B6488 0098+00 3/3 0/0 0/0 .text
|
||||
* getSoundInfo___11Z2SoundInfoCF10JAISoundIDP8JAISound */
|
||||
void Z2SoundInfo::getSoundInfo_(JAISoundID param_1, JAISound* param_2) const {
|
||||
void Z2SoundInfo::getSoundInfo_(JAISoundID soundID, JAISound* soundPtr) const {
|
||||
JUT_ASSERT(440, isValid());
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(param_1);
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(param_1);
|
||||
JAUSoundTableItem* data = JASGlobalInstance<JAUSoundTable>::getInstance()->getData(soundID);
|
||||
|
||||
u8 typeID = JASGlobalInstance<JAUSoundTable>::getInstance()->getTypeID(soundID);
|
||||
if (data != NULL && (typeID & 0x40) != 0) {
|
||||
param_2->getProperty().field_0x0 = (1.0f / 127.0f) * data->field_0x1;
|
||||
soundPtr->getProperty().field_0x0 = (1.0f / 127.0f) * data->field_0x1;
|
||||
}
|
||||
}
|
||||
|
||||
+171
-147
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Translation Unit: Z2SoundMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundMgr.h"
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "Z2AudioLib/Z2SceneMgr.h"
|
||||
@@ -9,19 +5,17 @@
|
||||
#include "Z2AudioLib/Z2SeqMgr.h"
|
||||
#include "Z2AudioLib/Z2SeMgr.h"
|
||||
#include "Z2AudioLib/Z2SoundInfo.h"
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "JSystem/JAudio2/JASCalc.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JAudio2/JAUSectionHeap.h"
|
||||
|
||||
void dComIfGs_staffroll_next_go();
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
/* 802A9BC8-802A9E80 2A4508 02B8+00 1/0 1/1 0/0 .text seqCallback__FP8JASTrackUs */
|
||||
u16 seqCallback(JASTrack* i_track, u16 param_1) {
|
||||
JSUList<JAISe>* list;
|
||||
switch (param_1) {
|
||||
u16 seqCallback(JASTrack* track, u16 command) {
|
||||
switch (command) {
|
||||
case 0x1000:
|
||||
Z2GetSeqMgr()->setChildTrackVolume(Z2GetSeqMgr()->getSubBgmHandle(),
|
||||
3, 1.0f, 0, -1.0f, -1.0f);
|
||||
Z2GetSeqMgr()->setChildTrackVolume(Z2GetSeqMgr()->getSubBgmHandle(), 3, 1.0f, 0, -1.0f, -1.0f);
|
||||
Z2GetSoundMgr()->getSeqMgr()->calc();
|
||||
Z2GetSoundMgr()->getSeqMgr()->mixOut();
|
||||
break;
|
||||
@@ -41,28 +35,32 @@ u16 seqCallback(JASTrack* i_track, u16 param_1) {
|
||||
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;
|
||||
for (JSULink<JAISe>* link = Z2GetSoundMgr()->getSeMgr()->getCategory(5)->getSeList()->getFirst(); link != NULL; link = link->getNext()) {
|
||||
JAISe* se = link->getObject();
|
||||
switch (se->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:
|
||||
JASTrack* track = se->getTrack();
|
||||
JUT_ASSERT(94, track);
|
||||
track->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;
|
||||
for (JSULink<JAISe>* link = Z2GetSoundMgr()->getSeMgr()->getCategory(5)->getSeList()->getFirst(); link != NULL; link = link->getNext()) {
|
||||
JAISe* se = link->getObject();
|
||||
switch (se->getID()) {
|
||||
case Z2SE_MCN_A_V_DANCE:
|
||||
case Z2SE_WCN_A_V_DANCE:
|
||||
JASTrack* track = se->getTrack();
|
||||
JUT_ASSERT(113, track);
|
||||
track->writePort(14, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -76,123 +74,144 @@ u16 seqCallback(JASTrack* i_track, u16 param_1) {
|
||||
dComIfGs_staffroll_next_go();
|
||||
break;
|
||||
}
|
||||
if (param_1 >= 0x1009 && param_1 <= 0x1013) {
|
||||
|
||||
if (command >= 0x1009 && command <= 0x1013) {
|
||||
JAISoundID sound_id = Z2SE_CSL_TOWN_BAND_VOCAL;
|
||||
if (param_1 <= 0x100a) {
|
||||
if (command <= 0x100a) {
|
||||
sound_id = Z2SE_CSL_TOWN_BAND_GT_1;
|
||||
} else if (param_1 <= 0x100c) {
|
||||
} else if (command <= 0x100c) {
|
||||
sound_id = Z2SE_CSL_TOWN_BAND_GT_2;
|
||||
} else if (param_1 <= 0x100f) {
|
||||
} else if (command <= 0x100f) {
|
||||
sound_id = Z2SE_CSL_TOWN_BAND_GT_3;
|
||||
} else if (param_1 <= 0x1011) {
|
||||
} else if (command <= 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);
|
||||
|
||||
for (JSULink<JAISe>* link = Z2GetSoundMgr()->getSeMgr()->getCategory(6)->getSeList()->getFirst(); link != NULL; link = link->getNext()) {
|
||||
JAISe* se = link->getObject();
|
||||
if (se->getID() == sound_id) {
|
||||
JASTrack* track = se->getTrack();
|
||||
JUT_ASSERT(159, track);
|
||||
track->writePort(14, command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802A9E80-802A9EE8 2A47C0 0068+00 0/0 1/1 0/0 .text __ct__10Z2SoundMgrFv */
|
||||
Z2SoundMgr::Z2SoundMgr() :
|
||||
JASGlobalInstance<Z2SoundMgr>(this),
|
||||
mSeMgr(true),
|
||||
mSeqMgr(true),
|
||||
mStreamMgr(true)
|
||||
JASGlobalInstance<Z2SoundMgr>(true),
|
||||
seMgr_(true),
|
||||
seqMgr_(true),
|
||||
streamMgr_(true)
|
||||
{
|
||||
mSoundID.setAnonymous();
|
||||
soundID_.setAnonymous();
|
||||
}
|
||||
|
||||
/* 802A9EE8-802AA1B0 2A4828 02C8+00 1/0 0/0 0/0 .text
|
||||
* startSound__10Z2SoundMgrF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
|
||||
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) {
|
||||
bool Z2SoundMgr::startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr) {
|
||||
int soundType = Z2GetSoundInfo()->getSoundType(soundID);
|
||||
switch (soundType) {
|
||||
case 0: {
|
||||
if (Z2GetSoundInfo()->getSwBit(soundID) & 8) {
|
||||
OS_REPORT("[Z2SoundMgr::startSound] se seq Mute! id = %08x\n", *(u32*)&soundID);
|
||||
Z2GetSeqMgr()->bgmAllMute(3, 0.3f);
|
||||
mSoundID = i_soundID;
|
||||
soundID_ = soundID;
|
||||
}
|
||||
return mSeMgr.startSound(i_soundID, i_handle, i_pos);
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if ((u32)soundID == 12) {
|
||||
Z2AudioCS::start(0, 0);
|
||||
} else if ((u32)soundID == 13) {
|
||||
Z2AudioCS::start(0x66, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool result = seMgr_.startSound(soundID, handle, posPtr);
|
||||
return result;
|
||||
}
|
||||
case 1:
|
||||
if (i_soundID == Z2BGM_LUTERA_DEMO) {
|
||||
if (soundID == Z2BGM_LUTERA_DEMO) {
|
||||
Z2GetSeqMgr()->bgmStart(Z2BGM_LUTERA2, 0, 0);
|
||||
Z2GetSeqMgr()->unMuteSceneBgm(0);
|
||||
Z2GetSeqMgr()->changeBgmStatus(0);
|
||||
return mSeMgr.startSound(Z2SE_NO_SOUND, i_handle, i_pos);
|
||||
return seMgr_.startSound(Z2SE_NO_SOUND, handle, posPtr);
|
||||
} 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) {
|
||||
JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
|
||||
JUT_ASSERT(228, sectionHeap);
|
||||
|
||||
for (JSULink<JAUSeqDataBlock>* link = sectionHeap->getSectionHeapData().seqDataBlocks.getLoadedBlocks().getFirst(); link != NULL; link = link->getNext()) {
|
||||
if (link->getObject()->field_0x10 == 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()) {
|
||||
u32 sp2C = sectionHeap->releaseIdleDynamicSeqDataBlock();
|
||||
if (!sectionHeap->loadDynamicSeq(soundID, true)) {
|
||||
OS_REPORT("[Z2SoundMgr::startSound] FAILED!!! LOAD SEQ_DATA id: %08x\n", *(u32*)&soundID);
|
||||
|
||||
for (JSULink<JAUSeqDataBlock>* link = sectionHeap->getSectionHeapData().seqDataBlocks.getFreeBlocks().getFirst(); link != NULL; link = link->getNext()) {
|
||||
OS_REPORT(" freeSeqBlock: %d\n", link->getObject()->field_0x14.size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return mSeqMgr.startSound(i_soundID, i_handle, i_pos);
|
||||
|
||||
return seqMgr_.startSound(soundID, handle, posPtr);
|
||||
}
|
||||
case 2:
|
||||
if (i_soundID == 0x2000001 || i_soundID == 0x200004d) {
|
||||
mStreamMgr.stop(180);
|
||||
return mSeMgr.startSound(Z2SE_NO_SOUND, i_handle, i_pos);
|
||||
if (soundID == 0x2000001 || soundID == 0x200004d) {
|
||||
streamMgr_.stop(180);
|
||||
return seMgr_.startSound(Z2SE_NO_SOUND, handle, posPtr);
|
||||
}
|
||||
if (i_soundID == 0x2000005) {
|
||||
mSeMgr.getCategory(9)->pause(false);
|
||||
mSeMgr.getCategory(9)->getParams()->moveVolume(1.0f, 45);
|
||||
if (soundID == 0x2000005) {
|
||||
seMgr_.getCategory(9)->pause(false);
|
||||
seMgr_.getCategory(9)->getParams()->moveVolume(1.0f, 45);
|
||||
}
|
||||
return mStreamMgr.startSound(i_soundID, i_handle, i_pos);
|
||||
return streamMgr_.startSound(soundID, handle, posPtr);
|
||||
default:
|
||||
char error[32];
|
||||
sprintf(error, "Unknown Sound-Type id :%08x\n", (u32)i_soundID);
|
||||
return false;
|
||||
sprintf(error, "Unknown Sound-Type id :%08x\n", *(u32*)&soundID);
|
||||
JUT_WARN(277, "%s", error);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 802AA1B0-802AA270 2A4AF0 00C0+00 2/2 0/0 0/0 .text calc__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::calc() {
|
||||
mSeMgr.calc();
|
||||
if (!mSoundID.isAnonymous() && !isPlayingSoundID(mSoundID)) {
|
||||
seMgr_.calc();
|
||||
if (!soundID_.isAnonymous() && !isPlayingSoundID(soundID_)) {
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
Z2GetSeqMgr()->bgmAllUnMute(3);
|
||||
}
|
||||
mSoundID.setAnonymous();
|
||||
soundID_.setAnonymous();
|
||||
}
|
||||
mSeqMgr.calc();
|
||||
mStreamMgr.calc();
|
||||
seqMgr_.calc();
|
||||
streamMgr_.calc();
|
||||
}
|
||||
|
||||
/* 802AA270-802AA33C 2A4BB0 00CC+00 1/1 2/2 0/0 .text setIIR__10Z2SoundMgrFP8JAISoundPCs
|
||||
*/
|
||||
void Z2SoundMgr::setIIR(JAISound* param_0, s16 const* param_1) {
|
||||
if (param_0 != NULL) {
|
||||
JASTrack* track = param_0->getTrack();
|
||||
void Z2SoundMgr::setIIR(JAISound* sound, const s16* iir) {
|
||||
if (sound != NULL) {
|
||||
JASTrack* track = sound->getTrack();
|
||||
JUT_ASSERT(340, track);
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
JASTrack* child = track->getChild(i);
|
||||
if (child != NULL && child->getStatus() == 1) {
|
||||
child->setIIR(param_1);
|
||||
child->setIIR(iir);
|
||||
for (u32 j = 0; j < 4; j++) {
|
||||
JASTrack* child2 = child->getChild(j);
|
||||
if (child2 != NULL && child2->getStatus() == 1) {
|
||||
child2->setIIR(param_1);
|
||||
child2->setIIR(iir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,9 +225,10 @@ static s16 const cResetFilterTable[8] = {
|
||||
};
|
||||
|
||||
/* 802AA33C-802AA430 2A4C7C 00F4+00 1/1 0/0 0/0 .text setFilterOff__10Z2SoundMgrFP8JAISound */
|
||||
void Z2SoundMgr::setFilterOff(JAISound* param_0) {
|
||||
if (param_0 != NULL) {
|
||||
JASTrack* track = param_0->getTrack();
|
||||
void Z2SoundMgr::setFilterOff(JAISound* sound) {
|
||||
if (sound != NULL) {
|
||||
JASTrack* track = sound->getTrack();
|
||||
JUT_ASSERT(403, track);
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
JASTrack* child = track->getChild(i);
|
||||
if (child != NULL && child->getStatus() == 1) {
|
||||
@@ -229,16 +249,17 @@ void Z2SoundMgr::setFilterOff(JAISound* param_0) {
|
||||
/* 802AA430-802AA528 2A4D70 00F8+00 0/0 1/1 0/0 .text resetFilterAll__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::resetFilterAll() {
|
||||
int i = 1;
|
||||
if (struct_80451342 != 0) {
|
||||
if (Z2Param::SYSTEM_SE_USE_DARK_SE_SETTING) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
for (; i < 9; i++) {
|
||||
JAISeCategoryMgr* category = mSeMgr.getCategory(i);
|
||||
JAISeCategoryMgr* category = seMgr_.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--)
|
||||
link = link->getNext(), --se_count)
|
||||
{
|
||||
setFilterOff(link->getObject());
|
||||
}
|
||||
@@ -255,34 +276,36 @@ void Z2SoundMgr::resetFilterAll() {
|
||||
|
||||
/* 802AA528-802AA67C 2A4E68 0154+00 2/2 0/0 0/0 .text mixOut__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::mixOut() {
|
||||
if (struct_80451340 != 0 && Z2GetSceneMgr()->isInDarkness()) {
|
||||
if (Z2Param::DARK_SE_FILTER_ON && Z2GetSceneMgr()->isInDarkness()) {
|
||||
int i = 1;
|
||||
if (struct_80451342 != 0) {
|
||||
if (Z2Param::SYSTEM_SE_USE_DARK_SE_SETTING) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
for (; i < 9; i++) {
|
||||
JAISeCategoryMgr* category = mSeMgr.getCategory(i);
|
||||
JAISeCategoryMgr* category = seMgr_.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--)
|
||||
link = link->getNext(), --se_count)
|
||||
{
|
||||
setIIR(link->getObject(), JASCalc::CUTOFF_TO_IIR_TABLE[struct_80451341]);
|
||||
setIIR(link->getObject(), JASCalc::CUTOFF_TO_IIR_TABLE[Z2Param::DARK_SE_LOW_PASS_FILTER_SETTING]);
|
||||
}
|
||||
} 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]);
|
||||
setIIR(link->getObject(), JASCalc::CUTOFF_TO_IIR_TABLE[Z2Param::DARK_SE_LOW_PASS_FILTER_SETTING]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mSeMgr.mixOut();
|
||||
mSeqMgr.mixOut();
|
||||
mStreamMgr.mixOut();
|
||||
|
||||
seMgr_.mixOut();
|
||||
seqMgr_.mixOut();
|
||||
streamMgr_.mixOut();
|
||||
}
|
||||
|
||||
/* 802AA67C-802AA6B0 2A4FBC 0034+00 0/0 1/1 0/0 .text framework__10Z2SoundMgrFv */
|
||||
@@ -293,45 +316,44 @@ void Z2SoundMgr::framework() {
|
||||
|
||||
/* 802AA6B0-802AA7DC 2A4FF0 012C+00 0/0 1/1 0/0 .text pauseAllGameSound__10Z2SoundMgrFb
|
||||
*/
|
||||
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) {
|
||||
void Z2SoundMgr::pauseAllGameSound(bool paused) {
|
||||
seMgr_.getCategory(0)->pause(paused);
|
||||
seMgr_.getCategory(1)->pause(paused);
|
||||
seMgr_.getCategory(2)->pause(paused);
|
||||
seMgr_.getCategory(3)->pause(paused);
|
||||
seMgr_.getCategory(4)->pause(paused);
|
||||
seMgr_.getCategory(5)->pause(paused);
|
||||
seMgr_.getCategory(6)->pause(paused);
|
||||
seMgr_.getCategory(7)->pause(paused);
|
||||
seMgr_.getCategory(8)->pause(paused);
|
||||
seMgr_.getCategory(9)->pause(paused);
|
||||
seqMgr_.pause(paused);
|
||||
streamMgr_.pause(paused);
|
||||
|
||||
if (paused) {
|
||||
Z2GetSeMgr()->seMoveVolumeAll(0.0f, 10);
|
||||
mSeqMgr.getParams()->moveVolume(0.0f, 10);
|
||||
mStreamMgr.getParams()->moveVolume(0.0f, 10);
|
||||
}
|
||||
else {
|
||||
seqMgr_.getParams()->moveVolume(0.0f, 10);
|
||||
streamMgr_.getParams()->moveVolume(0.0f, 10);
|
||||
} else {
|
||||
Z2GetSeMgr()->seMoveVolumeAll(1.0f, 10);
|
||||
mSeqMgr.getParams()->moveVolume(1.0f, 10);
|
||||
mStreamMgr.getParams()->moveVolume(1.0f, 10);
|
||||
seqMgr_.getParams()->moveVolume(1.0f, 10);
|
||||
streamMgr_.getParams()->moveVolume(1.0f, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 802AA7DC-802AA84C 2A511C 0070+00 0/0 1/1 0/0 .text stopSoundID__10Z2SoundMgrF10JAISoundID */
|
||||
void Z2SoundMgr::stopSoundID(JAISoundID i_soundID) {
|
||||
mSeMgr.stopSoundID(i_soundID);
|
||||
mSeqMgr.stopSoundID(i_soundID);
|
||||
mStreamMgr.stopSoundID(i_soundID);
|
||||
void Z2SoundMgr::stopSoundID(JAISoundID soundID) {
|
||||
seMgr_.stopSoundID(soundID);
|
||||
seqMgr_.stopSoundID(soundID);
|
||||
streamMgr_.stopSoundID(soundID);
|
||||
}
|
||||
|
||||
/* 802AA84C-802AA8C8 2A518C 007C+00 0/0 1/1 0/0 .text stopSync__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::stopSync() {
|
||||
stop();
|
||||
while (mSeMgr.getNumActiveSe() > 0 || mSeqMgr.getNumActiveSeqs() > 0) {
|
||||
while (seMgr_.getNumActiveSe() > 0 || seqMgr_.getNumActiveSeqs() > 0) {
|
||||
calc();
|
||||
if (mSeMgr.getNumActiveSe() == 0 && mSeqMgr.getNumActiveSeqs() == 0) {
|
||||
if (seMgr_.getNumActiveSe() == 0 && seqMgr_.getNumActiveSeqs() == 0) {
|
||||
break;
|
||||
}
|
||||
mixOut();
|
||||
@@ -341,28 +363,29 @@ void Z2SoundMgr::stopSync() {
|
||||
|
||||
/* 802AA8C8-802AA908 2A5208 0040+00 1/1 0/0 0/0 .text stop__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::stop() {
|
||||
mSeMgr.stop();
|
||||
mSeqMgr.stop();
|
||||
mStreamMgr.stop();
|
||||
seMgr_.stop();
|
||||
seqMgr_.stop();
|
||||
streamMgr_.stop();
|
||||
}
|
||||
|
||||
/* 802AA908-802AA9E8 2A5248 00E0+00 0/0 1/1 0/0 .text initParams__10Z2SoundMgrFv */
|
||||
void Z2SoundMgr::initParams() {
|
||||
mSeMgr.initParams();
|
||||
mSeqMgr.getParams()->init();
|
||||
mStreamMgr.getParams()->init();
|
||||
}
|
||||
JUT_ASSERT(613, ! seMgr_.isActive());
|
||||
JUT_ASSERT(614, ! seqMgr_.isActive());
|
||||
|
||||
seMgr_.initParams();
|
||||
seqMgr_.getParams()->init();
|
||||
streamMgr_.getParams()->init();
|
||||
}
|
||||
|
||||
/* 802AA9E8-802AAAC4 2A5328 00DC+00 0/0 1/1 0/0 .text
|
||||
* multiVolumeSoundID__10Z2SoundMgrF10JAISoundIDf */
|
||||
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;
|
||||
void Z2SoundMgr::multiVolumeSoundID(JAISoundID soundID, f32 volume) {
|
||||
if (!soundID.isAnonymous() && Z2GetSoundInfo()->getSoundType(soundID) == 0) {
|
||||
int category = Z2GetSoundInfo()->getCategory(soundID);
|
||||
for (JSULink<JAISe>* link = seMgr_.getCategory(category)->getSeList()->getFirst(); link != NULL; link = link->getNext()) {
|
||||
if (link->getObject()->getID() == soundID) {
|
||||
link->getObject()->getAuxiliary().params_.mVolume *= volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,18 +393,19 @@ void Z2SoundMgr::multiVolumeSoundID(JAISoundID i_soundID, f32 i_multi) {
|
||||
|
||||
/* 802AAAC4-802AAB94 2A5404 00D0+00 1/1 0/0 0/0 .text isPlayingSoundID__10Z2SoundMgrF10JAISoundID
|
||||
*/
|
||||
bool Z2SoundMgr::isPlayingSoundID(JAISoundID i_soundID) {
|
||||
if (i_soundID.isAnonymous()) {
|
||||
bool Z2SoundMgr::isPlayingSoundID(JAISoundID soundID) {
|
||||
if (soundID.isAnonymous()) {
|
||||
return false;
|
||||
}
|
||||
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) {
|
||||
|
||||
if (Z2GetSoundInfo()->getSoundType(soundID) == 0) {
|
||||
int category = Z2GetSoundInfo()->getCategory(soundID);
|
||||
for (JSULink<JAISe>* link = seMgr_.getCategory(category)->getSeList()->getFirst(); link != NULL; link = link->getNext()) {
|
||||
if (link->getObject()->getID() == soundID) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+137
-123
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2SoundObjMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundObjMgr.h"
|
||||
#include "Z2AudioLib/Z2Creature.h"
|
||||
#include "Z2AudioLib/Z2SeqMgr.h"
|
||||
@@ -11,9 +6,9 @@
|
||||
#include "Z2AudioLib/Z2LinkMgr.h"
|
||||
|
||||
/* 802BF920-802BF980 2BA260 0060+00 0/0 1/1 0/0 .text __ct__13Z2SoundObjMgrFv */
|
||||
Z2SoundObjMgr::Z2SoundObjMgr() : JASGlobalInstance<Z2SoundObjMgr>(this) {
|
||||
mGhostEnemyState = 0;
|
||||
mTwilightBattle = 0;
|
||||
Z2SoundObjMgr::Z2SoundObjMgr() : JASGlobalInstance<Z2SoundObjMgr>(true) {
|
||||
ghostEnemyState_ = 0;
|
||||
twilightBattle_ = 0;
|
||||
setBattleInit();
|
||||
setForceBattleArea(false, 700, 1100, 1500);
|
||||
}
|
||||
@@ -21,10 +16,10 @@ Z2SoundObjMgr::Z2SoundObjMgr() : JASGlobalInstance<Z2SoundObjMgr>(this) {
|
||||
/* 802BF980-802BF994 2BA2C0 0014+00 1/1 3/3 3/3 .text setForceBattleArea__13Z2SoundObjMgrFbUsUsUs
|
||||
*/
|
||||
void Z2SoundObjMgr::setForceBattleArea(bool forceBattle, u16 param_1, u16 param_2, u16 param_3) {
|
||||
mForceBattle = forceBattle;
|
||||
mEnemyArea.field_0x2 = param_1;
|
||||
mEnemyArea.field_0x4 = param_2;
|
||||
mEnemyArea.field_0x6 = param_3;
|
||||
forceBattle_ = forceBattle;
|
||||
enemyArea_.field_0x2 = param_1;
|
||||
enemyArea_.field_0x4 = param_2;
|
||||
enemyArea_.field_0x6 = param_3;
|
||||
}
|
||||
|
||||
/* 80455B80-80455B84 004180 0004+00 1/1 0/0 0/0 .sdata2 sAreaDefault */
|
||||
@@ -45,13 +40,13 @@ static Z2EnemyArea const sAreaSmall = {true, 300, 700, 1000};
|
||||
/* 80455BA8-80455BAC 0041A8 0004+00 1/1 0/0 0/0 .sdata2 sAreaSmallFloating */
|
||||
static Z2EnemyArea const sAreaSmallFloating = {false, 500, 800, 1200};
|
||||
|
||||
struct EnemyInfo {
|
||||
struct Z2EnemyInfo {
|
||||
char mName[8];
|
||||
Z2EnemyArea mEnemyArea;
|
||||
};
|
||||
|
||||
/* 803CAD70-803CB170 027E90 0400+00 3/3 0/0 0/0 .data mEnemyInfo */
|
||||
static EnemyInfo mEnemyInfo[64] = {
|
||||
static Z2EnemyInfo mEnemyInfo[64] = {
|
||||
{"Dummy", sAreaDefault},
|
||||
{"E_s1", {true, 700, 1200, 2000}},
|
||||
{"E_yk", sAreaSmallFloating},
|
||||
@@ -120,72 +115,80 @@ static EnemyInfo mEnemyInfo[64] = {
|
||||
|
||||
/* 802BF994-802BFFEC 2BA2D4 0658+00 1/0 1/1 0/0 .text searchEnemy__13Z2SoundObjMgrFv */
|
||||
void Z2SoundObjMgr::searchEnemy() {
|
||||
mTwilightBattle = 0;
|
||||
Z2CreatureLink* link = Z2GetLink();
|
||||
if (link == 0) {
|
||||
twilightBattle_ = 0;
|
||||
|
||||
if (!Z2GetLink()) {
|
||||
Z2GetSeqMgr()->stopBattleBgm(1, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
bool bVar7 = false;
|
||||
bool local_96 = false;
|
||||
bool iVar8 = false;
|
||||
|
||||
bool isHolyForestBgm = false;
|
||||
if (Z2GetSeqMgr()->getMainBgmID() == Z2BGM_HOLY_FOREST) {
|
||||
iVar8 = true;
|
||||
isHolyForestBgm = true;
|
||||
}
|
||||
u8 iVar16 = 0;
|
||||
|
||||
u8 subBgmType = 0;
|
||||
if (Z2GetSeqMgr()->getSubBgmID() == Z2BGM_HORSE_BATTLE) {
|
||||
iVar16 = 1;
|
||||
subBgmType = 1;
|
||||
} else if (Z2GetSeqMgr()->getSubBgmID() == Z2BGM_FACE_OFF_BATTLE2) {
|
||||
iVar16 = 2;
|
||||
subBgmType = 2;
|
||||
}
|
||||
|
||||
field_0x14 = 0;
|
||||
mEnemyNumNear = 0;
|
||||
enemuNumNear_ = 0;
|
||||
field_0x16 = 0;
|
||||
mEnemyNumVeryFar = 0;
|
||||
enemuNumVeryFar_ = 0;
|
||||
field_0x1a = false;
|
||||
field_0x18 = 0;
|
||||
f32 dVar18 = Z2Calc::getParamByExp(
|
||||
|
||||
f32 linkDistScale = Z2Calc::getParamByExp(
|
||||
Z2GetLink()->getMoveSpeed(),
|
||||
0.0f,
|
||||
100.0f,
|
||||
0.3f,
|
||||
1.0f,
|
||||
2.5f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
f32 dVar19 = 5000.0f;
|
||||
Z2Calc::CURVE_POSITIVE);
|
||||
f32 veryFarDist = 5000.0f;
|
||||
|
||||
for (JSULink<Z2CreatureEnemy>* local_8c = getFirst(); local_8c != NULL; local_8c = local_8c->getNext()) {
|
||||
Z2CreatureEnemy* this_00 = local_8c->getObject();
|
||||
if (this_00 == NULL) {
|
||||
for (JSULink<Z2CreatureEnemy>* i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
Z2CreatureEnemy* enemy = i->getObject();
|
||||
if (enemy == NULL) {
|
||||
JUT_WARN_DEVICE(100, 1, "%s", "[Z2SoundObjMgr::searchEnemy] remain remove enemy\n");
|
||||
continue;
|
||||
}
|
||||
if (this_00->field_0xa1 < 1) {
|
||||
|
||||
if (enemy->field_0xa1 < 1) {
|
||||
continue;
|
||||
}
|
||||
bool bVar6 = false;
|
||||
u8 enemyId = this_00->mEnemyID;
|
||||
|
||||
bool isGhostEnemy = false;
|
||||
|
||||
u8 enemyId = enemy->mEnemyID;
|
||||
switch (enemyId) {
|
||||
case Z2_ENEMY_SW:
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == 0x1c)
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == Z2SCENE_GERUDO_DESERT)
|
||||
continue;
|
||||
break;
|
||||
case Z2_ENEMY_CR:
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == 0x1e)
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == Z2SCENE_HYRULE_FIELD)
|
||||
continue;
|
||||
break;
|
||||
case Z2_ENEMY_NZ:
|
||||
case Z2_ENEMY_PO:
|
||||
case Z2_ENEMY_HP:
|
||||
bVar6 = true;
|
||||
isGhostEnemy = true;
|
||||
break;
|
||||
case Z2_ENEMY_RDB:
|
||||
if (iVar16 == 0)
|
||||
if (subBgmType == 0)
|
||||
continue;
|
||||
break;
|
||||
case Z2_ENEMY_WB:
|
||||
case Z2_ENEMY_RD:
|
||||
if (iVar16 != 0)
|
||||
if (subBgmType != 0)
|
||||
continue;
|
||||
#if VERSION == VERSION_GCN_JPN
|
||||
}
|
||||
@@ -208,77 +211,86 @@ void Z2SoundObjMgr::searchEnemy() {
|
||||
#endif
|
||||
if (!Z2GetLink()->isRiding())
|
||||
break;
|
||||
if (Z2GetLink()->getMoveSpeed() <= 0x26)
|
||||
if (Z2GetLink()->getMoveSpeed() <= 38)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
Vec* iVar10 = this_00->getCurrentPos();
|
||||
if (iVar10 != NULL) {
|
||||
Vec* iVar14 = Z2GetLink()->getCurrentPos();
|
||||
if (iVar14 != NULL) {
|
||||
Z2EnemyArea local_88 = mEnemyInfo[enemyId].mEnemyArea;
|
||||
if (mForceBattle) {
|
||||
local_88 = mEnemyArea;
|
||||
|
||||
Vec* enemyPos = enemy->getCurrentPos();
|
||||
if (enemyPos != NULL) {
|
||||
Vec* linkPos = Z2GetLink()->getCurrentPos();
|
||||
if (linkPos != NULL) {
|
||||
Z2EnemyArea enemyArea = mEnemyInfo[enemyId].mEnemyArea;
|
||||
if (forceBattle_) {
|
||||
enemyArea = enemyArea_;
|
||||
}
|
||||
f32 fVar2 = 2.0f;
|
||||
if (local_88.field_0x0 == true) {
|
||||
fVar2 = 4.0f;
|
||||
|
||||
f32 y_scale = 2.0f;
|
||||
if (enemyArea.field_0x0 == true) {
|
||||
y_scale = 4.0f;
|
||||
}
|
||||
Vec local_80 = {0.0f, 0.0f, 0.0f};
|
||||
VECSubtract(iVar10, iVar14, &local_80);
|
||||
local_80.y *= fVar2;
|
||||
f32 dVar20 = VECMag(&local_80);
|
||||
if (dVar20 < local_88.field_0x6 * dVar18) {
|
||||
if (bVar6) {
|
||||
|
||||
Vec enemy_linkVec = {0.0f, 0.0f, 0.0f};
|
||||
VECSubtract(enemyPos, linkPos, &enemy_linkVec);
|
||||
enemy_linkVec.y *= y_scale;
|
||||
|
||||
f32 enemyDist = VECMag(&enemy_linkVec);
|
||||
if (enemyDist < enemyArea.field_0x6 * linkDistScale) {
|
||||
if (isGhostEnemy) {
|
||||
field_0x1a++;
|
||||
|
||||
if (dVar20 < local_88.field_0x4 * dVar18) {
|
||||
mGhostEnemyState |= 1;
|
||||
if (mGhostEnemyState >= 0x10) {
|
||||
mEnemyNumNear++;
|
||||
if (dVar20 < local_88.field_0x2 * dVar18) {
|
||||
if (enemyDist < enemyArea.field_0x4 * linkDistScale) {
|
||||
ghostEnemyState_ |= (u8)1;
|
||||
if (ghostEnemyState_ >= 16) {
|
||||
enemuNumNear_++;
|
||||
if (enemyDist < enemyArea.field_0x2 * linkDistScale) {
|
||||
field_0x14++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mGhostEnemyState >= 0x11) {
|
||||
|
||||
if (ghostEnemyState_ >= 17) {
|
||||
field_0x16++;
|
||||
if (this_00->mLinkSearch) {
|
||||
if (enemy->mLinkSearch) {
|
||||
local_96 = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
field_0x16++;
|
||||
if (enemyId != 0 && enemyId < 9) {
|
||||
if (mTwilightBattle == 0) {
|
||||
mTwilightBattle = 1;
|
||||
if (twilightBattle_ == 0) {
|
||||
twilightBattle_ = 1;
|
||||
}
|
||||
if (enemyId == 0x1 || enemyId == 0x5) {
|
||||
mTwilightBattle = 2;
|
||||
|
||||
if (enemyId == Z2_ENEMY_S1 || enemyId == Z2_ENEMY_YC) {
|
||||
twilightBattle_ = 2;
|
||||
}
|
||||
if (enemyId == 0x8) {
|
||||
mTwilightBattle = 2;
|
||||
|
||||
if (enemyId == Z2_ENEMY_YMB) {
|
||||
twilightBattle_ = 2;
|
||||
} else {
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(mTwilightBattle);
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(twilightBattle_);
|
||||
}
|
||||
}
|
||||
if (enemyId != 0x2c && this_00->mLinkSearch) {
|
||||
|
||||
if (enemyId != Z2_ENEMY_GB && enemy->mLinkSearch) {
|
||||
local_96 = true;
|
||||
}
|
||||
if (dVar20 < local_88.field_0x4 * dVar18)
|
||||
{
|
||||
mEnemyNumNear++;
|
||||
if (dVar20 < local_88.field_0x2 * dVar18)
|
||||
{
|
||||
|
||||
if (enemyDist < enemyArea.field_0x4 * linkDistScale) {
|
||||
enemuNumNear_++;
|
||||
if (enemyDist < enemyArea.field_0x2 * linkDistScale) {
|
||||
field_0x14++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dVar20 < dVar19 * dVar18) {
|
||||
mEnemyNumVeryFar++;
|
||||
|
||||
if (enemyDist < veryFarDist * linkDistScale) {
|
||||
enemuNumVeryFar_++;
|
||||
}
|
||||
if (this_00->field_0xa3 != 0) {
|
||||
|
||||
if (enemy->field_0xa3 != 0) {
|
||||
bVar7 = true;
|
||||
field_0x18++;
|
||||
}
|
||||
@@ -286,108 +298,108 @@ void Z2SoundObjMgr::searchEnemy() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mGhostEnemyState == 0x11) {
|
||||
if (ghostEnemyState_ == 17) {
|
||||
if (field_0x1a >= field_0x16) {
|
||||
Z2GetSeqMgr()->setBattleGhostMute(false);
|
||||
} else {
|
||||
Z2GetSeqMgr()->setBattleGhostMute(true);
|
||||
}
|
||||
} else if (mGhostEnemyState < 0x20 && field_0x1a == 0x0) {
|
||||
} else if (ghostEnemyState_ < 32 && field_0x1a == 0) {
|
||||
setGhostEnemyState(0);
|
||||
}
|
||||
if (iVar16 == 1) {
|
||||
if (field_0x14 != 0x0) {
|
||||
|
||||
if (subBgmType == 1) {
|
||||
if (field_0x14 != 0) {
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(1);
|
||||
} else {
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(0);
|
||||
}
|
||||
} else if (iVar16 == 2) {
|
||||
if (mEnemyNumNear != 0x0) {
|
||||
} else if (subBgmType == 2) {
|
||||
if (enemuNumNear_ != 0) {
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(1);
|
||||
} else {
|
||||
Z2GetSeqMgr()->changeSubBgmStatus(0);
|
||||
}
|
||||
} else if (iVar8) {
|
||||
if (field_0x16 != 0x0) {
|
||||
} else if (isHolyForestBgm) {
|
||||
if (field_0x16 != 0) {
|
||||
Z2GetSeqMgr()->changeBgmStatus(1);
|
||||
} else {
|
||||
Z2GetSeqMgr()->changeBgmStatus(0);
|
||||
}
|
||||
} else if (!bVar7) {
|
||||
Z2GetSeqMgr()->setBattleSearched(local_96);
|
||||
if (field_0x14 != 0x0) {
|
||||
|
||||
if (field_0x14 != 0) {
|
||||
Z2GetSeqMgr()->setBattleDistState(0);
|
||||
} else if (enemuNumNear_ != 0) {
|
||||
Z2GetSeqMgr()->setBattleDistState(1);
|
||||
} else if (field_0x16 != 0) {
|
||||
Z2GetSeqMgr()->setBattleDistState(2);
|
||||
} else {
|
||||
if (mEnemyNumNear != 0x0) {
|
||||
Z2GetSeqMgr()->setBattleDistState(1);
|
||||
} else {
|
||||
if (field_0x16 != 0x0) {
|
||||
Z2GetSeqMgr()->setBattleDistState(2);
|
||||
} else {
|
||||
Z2GetSeqMgr()->setBattleDistState(3);
|
||||
}
|
||||
}
|
||||
Z2GetSeqMgr()->setBattleDistState(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Z2SoundObjMgr::setGhostEnemyState(u8 p1) {
|
||||
if (p1 == 0x20) {
|
||||
void Z2SoundObjMgr::setGhostEnemyState(u8 state) {
|
||||
if (state == 32) {
|
||||
if (field_0x1a >= field_0x16) {
|
||||
JASGlobalInstance<Z2SeqMgr>::getInstance()->setBattleGhostMute(true);
|
||||
Z2GetSeqMgr()->setBattleGhostMute(true);
|
||||
}
|
||||
} else {
|
||||
if (field_0x1a == false) {
|
||||
mGhostEnemyState = 0;
|
||||
ghostEnemyState_ = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mGhostEnemyState = p1 + (mGhostEnemyState & 1);
|
||||
ghostEnemyState_ = state + (ghostEnemyState_ & 1);
|
||||
}
|
||||
|
||||
/* 802C0074-802C0100 2BA9B4 008C+00 0/0 1/1 0/0 .text
|
||||
* getEnemyID__13Z2SoundObjMgrFPCcP26JSULink<15Z2CreatureEnemy> */
|
||||
u8 Z2SoundObjMgr::getEnemyID(char const* param_0, JSULink<Z2CreatureEnemy>* param_1) {
|
||||
if (param_0 != NULL) {
|
||||
for (u8 uVar2 = 0; uVar2 < ARRAY_SIZEU(mEnemyInfo); uVar2++) {
|
||||
if (strcmp(param_0, mEnemyInfo[(u32)uVar2].mName) == 0) {
|
||||
append(param_1);
|
||||
return uVar2;
|
||||
u8 Z2SoundObjMgr::getEnemyID(const char* enemyName, JSULink<Z2CreatureEnemy>* enemyLink) {
|
||||
if (enemyName != NULL) {
|
||||
for (u8 i = 0; i < ARRAY_SIZEU(mEnemyInfo); i++) {
|
||||
if (strcmp(enemyName, mEnemyInfo[(u32)i].mName) == 0) {
|
||||
append(enemyLink);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Z2_ENEMY_NULL;
|
||||
}
|
||||
|
||||
/* 802C0100-802C0120 2BAA40 0020+00 1/1 1/1 0/0 .text setBattleInit__13Z2SoundObjMgrFv */
|
||||
void Z2SoundObjMgr::setBattleInit() {
|
||||
field_0x14 = 0;
|
||||
mEnemyNumNear = 0;
|
||||
enemuNumNear_ = 0;
|
||||
field_0x16 = 0;
|
||||
mEnemyNumVeryFar = 0;
|
||||
enemuNumVeryFar_ = 0;
|
||||
field_0x18 = 0;
|
||||
field_0x1a = false;
|
||||
}
|
||||
|
||||
/* 802C0120-802C013C 2BAA60 001C+00 0/0 1/1 0/0 .text checkBattleFinish__13Z2SoundObjMgrFv */
|
||||
bool Z2SoundObjMgr::checkBattleFinish() {
|
||||
return mEnemyNumVeryFar - field_0x18 <= 0;
|
||||
if (enemuNumVeryFar_ - field_0x18 > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802C013C-802C0190 2BAA7C 0054+00 0/0 1/1 0/0 .text deleteEnemyAll__13Z2SoundObjMgrFv
|
||||
*/
|
||||
void Z2SoundObjMgr::deleteEnemyAll() {
|
||||
JSULink<Z2CreatureEnemy>* link;
|
||||
JSULink<Z2CreatureEnemy>* i;
|
||||
|
||||
// not moving the link pointer forward looks like a bug, but deleteObject() actually unlinks the
|
||||
// enemy from its owning list
|
||||
while (link = this->getFirst(), link != NULL) {
|
||||
Z2CreatureEnemy* enemy = link->getObject();
|
||||
// not moving the pointer forward looks like a bug, but deleteObject() actually unlinks the enemy from its owning list
|
||||
while (i = getFirst(), i != NULL) {
|
||||
Z2CreatureEnemy* enemy = i->getObject();
|
||||
if (enemy == NULL) {
|
||||
// setWarningMessage_f((JUTAssertion *)0x1,(ulong)"Z2SoundObjMgr.cpp",(char
|
||||
// *)0x16f,(int)&*fill*,
|
||||
// "[Z2SoundObjMgr::searchEnemy] remain remove enemy\n",in_r8);
|
||||
JUT_WARN_DEVICE(367, 1, "%s", "[Z2SoundObjMgr::searchEnemy] remain remove enemy\n");
|
||||
} else {
|
||||
enemy->deleteObject();
|
||||
}
|
||||
@@ -396,20 +408,22 @@ void Z2SoundObjMgr::deleteEnemyAll() {
|
||||
|
||||
/* 802C0190-802C01E4 2BAAD0 0054+00 0/0 2/2 0/0 .text
|
||||
* removeEnemy__13Z2SoundObjMgrFP26JSULink<15Z2CreatureEnemy> */
|
||||
bool Z2SoundObjMgr::removeEnemy(JSULink<Z2CreatureEnemy>* param_0) {
|
||||
if (param_0 == NULL) {
|
||||
bool Z2SoundObjMgr::removeEnemy(JSULink<Z2CreatureEnemy>* enemyLink) {
|
||||
if (enemyLink == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Z2CreatureEnemy* enemy = param_0->getObject();
|
||||
Z2CreatureEnemy* enemy = enemyLink->getObject();
|
||||
if (enemy->field_0xa3 != 0 && field_0x18 != 0) {
|
||||
field_0x18--;
|
||||
}
|
||||
return remove(param_0);
|
||||
|
||||
bool result = remove(enemyLink);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 802C01E4-802C01EC 2BAB24 0008+00 0/0 4/4 0/0 .text isTwilightBattle__13Z2SoundObjMgrFv
|
||||
*/
|
||||
u8 Z2SoundObjMgr::isTwilightBattle() {
|
||||
return mTwilightBattle;
|
||||
return twilightBattle_;
|
||||
}
|
||||
|
||||
+324
-259
@@ -1,61 +1,71 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: Z2SoundObject
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundObject.h"
|
||||
#include "Z2AudioLib/Z2SoundObjMgr.h"
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "Z2AudioLib/Z2SeMgr.h"
|
||||
#include "Z2AudioLib/Z2SoundInfo.h"
|
||||
#include "Z2AudioLib/Z2SoundMgr.h"
|
||||
#include "Z2AudioLib/Z2SoundStarter.h"
|
||||
#include "Z2AudioLib/Z2SceneMgr.h"
|
||||
#include "Z2AudioLib/Z2Audience.h"
|
||||
#include "JSystem/JAudio2/JAUSoundAnimator.h"
|
||||
|
||||
Z2SoundObjBase::Z2SoundObjBase() {
|
||||
//! @note initializer list doesn't work since fields were initialized out of
|
||||
//! structure layout order, indicating original code didn't use initializer list.
|
||||
mSoundPos = NULL;
|
||||
mIsInitialized = false;
|
||||
mSoundStarter = JASGlobalInstance<Z2SoundStarter>::getInstance(); // sInstance
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#endif
|
||||
|
||||
Z2SoundObjBase::Z2SoundObjBase()
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
: JSULink<Z2SoundObjBase>(this)
|
||||
#endif
|
||||
{
|
||||
pos_ = NULL;
|
||||
alive_ = false;
|
||||
soundStarter_ = Z2GetSoundStarter();
|
||||
field_0x1c = 0;
|
||||
field_0x1e = 0;
|
||||
reverb_ = 0;
|
||||
}
|
||||
|
||||
Z2SoundObjBase::~Z2SoundObjBase() {
|
||||
deleteObject();
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::init(Vec* pSoundPos, u8 pNumHandles) {
|
||||
initHandlesPool(pNumHandles);
|
||||
mSoundPos = (JGeometry::TVec3<f32>*)pSoundPos;
|
||||
mIsInitialized = true;
|
||||
void Z2SoundObjBase::init(Vec* posPtr, u8 handleNum) {
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
Z2GetSoundObjMgr()->getAllList()->append(this);
|
||||
#endif
|
||||
|
||||
initHandlesPool(handleNum);
|
||||
pos_ = (JGeometry::TVec3<f32>*)posPtr;
|
||||
alive_ = true;
|
||||
}
|
||||
|
||||
/* 802BDFF8-802BE038 2B8938 0040+00 1/1 8/8 61/61 .text deleteObject__14Z2SoundObjBaseFv
|
||||
*/
|
||||
void Z2SoundObjBase::deleteObject() {
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
Z2GetSoundObjMgr()->getAllList()->remove(this);
|
||||
#endif
|
||||
|
||||
dispose();
|
||||
deleteHandlesPool();
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::framework(u32 p1, s8 reverb) {
|
||||
if (mIsInitialized) {
|
||||
field_0x1c = p1;
|
||||
field_0x1e = reverb;
|
||||
setPos(*mSoundPos);
|
||||
void Z2SoundObjBase::framework(u32 param_0, s8 reverb) {
|
||||
if (alive_) {
|
||||
field_0x1c = param_0;
|
||||
reverb_ = reverb;
|
||||
setPos(*pos_);
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BE070-802BE104 2B89B0 0094+00 5/0 3/0 0/0 .text dispose__14Z2SoundObjBaseFv */
|
||||
void Z2SoundObjBase::dispose() {
|
||||
JAISoundHandle* handle;
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = getFirst(); link != NULL; link = link->getNext()) {
|
||||
handle = link->getObject();
|
||||
if (handle != NULL && (bool)*handle) {
|
||||
u32 swBit = JASGlobalInstance<Z2SoundInfo>::sInstance->getSwBit((*handle)->getID());
|
||||
if ((swBit & 0x8000) != 0) {
|
||||
JSULink<Z2SoundHandlePool>* i;
|
||||
for (i = getFirst(); i != NULL; i = i->getNext()) {
|
||||
handle = i->getObject();
|
||||
if (handle != NULL && *handle) {
|
||||
if ((Z2GetSoundInfo()->getSwBit((*handle)->getID()) & 0x8000) != 0) {
|
||||
handle->releaseSound();
|
||||
} else {
|
||||
(*handle)->stop();
|
||||
@@ -63,84 +73,122 @@ void Z2SoundObjBase::dispose() {
|
||||
}
|
||||
}
|
||||
|
||||
mIsInitialized = false;
|
||||
alive_ = false;
|
||||
}
|
||||
|
||||
/* 802BE104-802BE144 2B8A44 0040+00 5/0 3/0 0/0 .text
|
||||
* stopOK__14Z2SoundObjBaseFR17Z2SoundHandlePool */
|
||||
bool Z2SoundObjBase::stopOK(Z2SoundHandlePool& pSoundHandlePool) {
|
||||
return !(JASGlobalInstance<Z2SoundInfo>::sInstance->
|
||||
getSwBit(pSoundHandlePool->getID()) & 0x8000);
|
||||
bool Z2SoundObjBase::stopOK(Z2SoundHandlePool& handlePool) {
|
||||
if ((Z2GetSoundInfo()->getSwBit(handlePool->getID()) & 0x8000) != 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BE144-802BE2D4 2B8A84 0190+00 5/3 3/1 0/0 .text
|
||||
* startSound__14Z2SoundObjBaseF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startSound(JAISoundID pSoundId, u32 param_1, s8 param_2) {
|
||||
if (!mIsInitialized) {
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
if (!alive_) {
|
||||
return NULL;
|
||||
}
|
||||
if (JASGlobalInstance<Z2SeMgr>::getInstance()->isSoundCulling(pSoundId)) {
|
||||
|
||||
if (Z2GetSeMgr()->isSoundCulling(soundID)) {
|
||||
return NULL;
|
||||
}
|
||||
if (param_1 == 0) {
|
||||
param_1 = (u32)field_0x1c;
|
||||
|
||||
if (mapinfo == 0) {
|
||||
mapinfo = (u32)field_0x1c;
|
||||
}
|
||||
if (param_2 < 0) {
|
||||
param_2 = field_0x1e;
|
||||
|
||||
if (reverb < 0) {
|
||||
reverb = reverb_;
|
||||
}
|
||||
f32 local_0 = (f32)param_2 / 127.0f;
|
||||
Z2SoundHandlePool* handle = getHandleSoundID(pSoundId);
|
||||
|
||||
f32 fxMix = (f32)reverb / 127.0f;
|
||||
|
||||
Z2SoundHandlePool* handle = getHandleSoundID(soundID);
|
||||
if (handle != NULL) {
|
||||
if ((JASGlobalInstance<Z2SoundInfo>::getInstance()->getSwBit(pSoundId) & 0x4000) != 0) {
|
||||
if ((Z2GetSoundInfo()->getSwBit(soundID) & 0x4000) != 0) {
|
||||
handle = NULL;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (handle == NULL) {
|
||||
handle = getFreeHandle();
|
||||
}
|
||||
|
||||
if (handle == NULL) {
|
||||
handle = getLowPrioSound(pSoundId);
|
||||
handle = getLowPrioSound(soundID);
|
||||
}
|
||||
|
||||
if (handle != NULL) {
|
||||
mSoundStarter->startSound(pSoundId, handle, mSoundPos, param_1, local_0,
|
||||
soundStarter_->startSound(soundID, handle, pos_, mapinfo, fxMix,
|
||||
1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802BE2D4-802BE4A4 2B8C14 01D0+00 4/2 3/0 0/0 .text
|
||||
* startLevelSound__14Z2SoundObjBaseF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID pSoundId, u32 param_1, s8 param_2) {
|
||||
if (!mIsInitialized) {
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
if (!alive_) {
|
||||
return NULL;
|
||||
}
|
||||
if (param_1 == 0) {
|
||||
param_1 = (u32)field_0x1c;
|
||||
|
||||
if (mapinfo == 0) {
|
||||
mapinfo = (u32)field_0x1c;
|
||||
}
|
||||
if (param_2 < 0) {
|
||||
param_2 = field_0x1e;
|
||||
|
||||
if (reverb < 0) {
|
||||
reverb = reverb_;
|
||||
}
|
||||
f32 local_0 = (f32)param_2 / 127.0f;
|
||||
Z2SoundHandlePool* handle = getHandleSoundID(pSoundId);
|
||||
|
||||
f32 fxMix = (f32)reverb / 127.0f;
|
||||
|
||||
Z2SoundHandlePool* handle = getHandleSoundID(soundID);
|
||||
if (handle != NULL) {
|
||||
handle->getSound()->updateLifeTime(1);
|
||||
mSoundStarter->setPortData(handle, 6, (u16)param_1, -1);
|
||||
handle->getSound()->getAuxiliary().moveFxMix(local_0, 0);
|
||||
JUT_ASSERT_MSG(218, *handle, "handle exist, but (*handle) is not exist!!\n");
|
||||
(*handle)->updateLifeTime(1);
|
||||
soundStarter_->setPortData(handle, 6, (u16)mapinfo, -1);
|
||||
(*handle)->getAuxiliary().moveFxMix(fxMix, 0);
|
||||
} else {
|
||||
if (JASGlobalInstance<Z2SeMgr>::getInstance()->isSoundCulling(pSoundId)) {
|
||||
if (Z2GetSeMgr()->isSoundCulling(soundID)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
handle = getFreeHandle();
|
||||
if (handle == NULL) {
|
||||
handle = getLowPrioSound(pSoundId);
|
||||
handle = getLowPrioSound(soundID);
|
||||
}
|
||||
|
||||
if (handle != NULL) {
|
||||
mSoundStarter->startSound(pSoundId, handle, mSoundPos, param_1, local_0,
|
||||
soundStarter_->startSound(soundID, handle, pos_, mapinfo, fxMix,
|
||||
1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
if (handle != NULL && handle->getSound() != NULL) {
|
||||
handle->getSound()->setLifeTime(1, false);
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
(*handle)->setLifeTime(1, false);
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (Z2GetSceneMgr()->isSceneExist()) {
|
||||
switch (soundID) {
|
||||
case Z2SE_BOOM_POWER_RESUME:
|
||||
Z2AudioCS::start(0x12, 0);
|
||||
break;
|
||||
case Z2SE_BOOM_TORNADO:
|
||||
Z2AudioCS::start(0x13, 0);
|
||||
break;
|
||||
case Z2SE_AL_SPINNER_RAIL:
|
||||
Z2AudioCS::start(0x3C, 0);
|
||||
break;
|
||||
case Z2SE_WOLFATTACK_WIND_RUSH:
|
||||
Z2AudioCS::start(0x58, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,31 +197,35 @@ Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID pSoundId, u32 para
|
||||
|
||||
/* 802BE4A4-802BE5A0 2B8DE4 00FC+00 0/0 5/5 21/21 .text
|
||||
* startCollisionSE__14Z2SoundObjBaseFUlUlP14Z2SoundObjBase */
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startCollisionSE(u32 pId, u32 pUserData, Z2SoundObjBase* pOther) {
|
||||
if (pOther != NULL) {
|
||||
return pOther->startCollisionSE(pId, pUserData, NULL);
|
||||
Z2SoundHandlePool* Z2SoundObjBase::startCollisionSE(u32 hitID, u32 mapinfo, Z2SoundObjBase* other) {
|
||||
if (other != NULL) {
|
||||
return other->startCollisionSE(hitID, mapinfo, NULL);
|
||||
}
|
||||
if (53 < pUserData) {
|
||||
pUserData = 0;
|
||||
|
||||
if (53 < mapinfo) {
|
||||
JUT_WARN_DEVICE(297, 1, "%s", "mapinfo > 53\n");
|
||||
OS_REPORT("startCollisionSE Invalid MAPINFO:%d hitID:%08x\n", mapinfo, hitID);
|
||||
mapinfo = 0;
|
||||
}
|
||||
for (JSULink<JAISe>* link =
|
||||
Z2GetSoundMgr()->getSeMgr()->getCategory(4)->getSeList()->getFirst();
|
||||
link != NULL; link = link->getNext()) {
|
||||
if (pId == link->getObject()->getID() && pUserData == link->getObject()->getUserData()) {
|
||||
link->getObject()->stop();
|
||||
|
||||
for (JSULink<JAISe>* i = Z2GetSoundMgr()->getSeMgr()->getCategory(4)->getSeList()->getFirst(); i != NULL; i = i->getNext()) {
|
||||
JAISe* se = i->getObject();
|
||||
if (hitID == se->getID() && mapinfo == se->getUserData()) {
|
||||
se->stop();
|
||||
}
|
||||
}
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(JAISoundID(pId), pUserData, -1);
|
||||
if (handle != NULL && handle->getSound() != NULL) {
|
||||
handle->getSound()->setUserData(pUserData);
|
||||
if (30 <= pUserData && pUserData <= 52) {
|
||||
Z2Audible* audible = (Z2Audible*)handle->getSound()->getAudible();
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(JAISoundID(hitID), mapinfo, -1);
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
(*handle)->setUserData(mapinfo);
|
||||
if (30 <= mapinfo && mapinfo <= 52) {
|
||||
Z2Audible* audible = (Z2Audible*)(*handle)->getAudible();
|
||||
if (audible != NULL) {
|
||||
JAUAudibleParam* param = audible->getAudibleParam();
|
||||
param->field_0x0.bytes.b1_2_7 = 8;
|
||||
audible->getAudibleParam()->field_0x0.bytes.b1_2_7 = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -187,106 +239,107 @@ Z2DopplerSoundObjBase::Z2DopplerSoundObjBase() : Z2SoundObjBase() {
|
||||
Z2DopplerSoundObjBase::~Z2DopplerSoundObjBase() {}
|
||||
|
||||
/* 802BE65C-802BE6B8 2B8F9C 005C+00 1/0 0/0 0/0 .text init__21Z2DopplerSoundObjBaseFP3VecUc */
|
||||
void Z2DopplerSoundObjBase::init(Vec* param_0, u8 param_1) {
|
||||
Z2SoundObjBase::init(param_0, param_1);
|
||||
if (mSoundPos != NULL) {
|
||||
// field_0x20 = *mSoundPos;
|
||||
JGeometry::setTVec3f(&mSoundPos->x, &field_0x20.x);
|
||||
// field_0x2c = *mSoundPos;
|
||||
JGeometry::setTVec3f(&mSoundPos->x, &field_0x2c.x);
|
||||
void Z2DopplerSoundObjBase::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundObjBase::init(posPtr, handleNum);
|
||||
if (pos_ != NULL) {
|
||||
field_0x20 = *pos_;
|
||||
field_0x2c = *pos_;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BE6B8-802BE714 2B8FF8 005C+00 2/0 0/0 0/0 .text framework__21Z2DopplerSoundObjBaseFUlSc */
|
||||
void Z2DopplerSoundObjBase::framework(u32 param_0, s8 param_1) {
|
||||
Z2SoundObjBase::framework(param_0, param_1);
|
||||
if (mSoundPos != NULL) {
|
||||
// field_0x20 = field_0x2c;
|
||||
JGeometry::setTVec3f(&field_0x2c.x, &field_0x20.x);
|
||||
// field_0x2c = *mSoundPos;
|
||||
JGeometry::setTVec3f(&mSoundPos->x, &field_0x2c.x);
|
||||
void Z2DopplerSoundObjBase::framework(u32 param_0, s8 reverb) {
|
||||
Z2SoundObjBase::framework(param_0, reverb);
|
||||
if (pos_ != NULL) {
|
||||
field_0x20 = field_0x2c;
|
||||
field_0x2c = *pos_;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802BE714-802BE7AC 2B9054 0098+00 2/0 0/0 0/0 .text
|
||||
* startSound__21Z2DopplerSoundObjBaseF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2DopplerSoundObjBase::startSound(JAISoundID pSoundId, u32 param_1, s8 param_2) {
|
||||
JGeometry::TVec3<f32>* pos = mSoundPos;
|
||||
mSoundPos = NULL;
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(pSoundId, param_1, param_2);
|
||||
if (pos != NULL && handle != NULL && handle->getSound() != NULL) {
|
||||
if (handle->getSound()->acceptsNewAudible()) {
|
||||
handle->getSound()->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
Z2SoundHandlePool* Z2DopplerSoundObjBase::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
JGeometry::TVec3<f32>* pos = pos_;
|
||||
pos_ = NULL;
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb);
|
||||
if (pos != NULL && handle != NULL && (*handle) != NULL) {
|
||||
if ((*handle)->acceptsNewAudible()) {
|
||||
(*handle)->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
}
|
||||
}
|
||||
mSoundPos = pos;
|
||||
|
||||
pos_ = pos;
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802BE7AC-802BE844 2B90EC 0098+00 2/0 0/0 0/0 .text
|
||||
* startLevelSound__21Z2DopplerSoundObjBaseF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2DopplerSoundObjBase::startLevelSound(JAISoundID pSoundId,
|
||||
u32 param_1, s8 param_2) {
|
||||
JGeometry::TVec3<f32>* pos = mSoundPos;
|
||||
mSoundPos = NULL;
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(pSoundId, param_1, param_2);
|
||||
if (pos != NULL && handle != NULL && handle->getSound() != NULL) {
|
||||
if (handle->getSound()->acceptsNewAudible()) {
|
||||
handle->getSound()->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
Z2SoundHandlePool* Z2DopplerSoundObjBase::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
JGeometry::TVec3<f32>* pos = pos_;
|
||||
pos_ = NULL;
|
||||
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb);
|
||||
if (pos != NULL && handle != NULL && (*handle) != NULL) {
|
||||
if ((*handle)->acceptsNewAudible()) {
|
||||
(*handle)->newAudible(*pos, &field_0x20, 0, NULL);
|
||||
}
|
||||
}
|
||||
mSoundPos = pos;
|
||||
|
||||
pos_ = pos;
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802BE844-802BE880 2B9184 003C+00 0/0 8/8 65/65 .text __ct__16Z2SoundObjSimpleFv */
|
||||
Z2SoundObjSimple::Z2SoundObjSimple() : Z2SoundObjBase() {}
|
||||
|
||||
void Z2SoundObjSimple::init(Vec* pSoundPos, u8 pNumHandles) {
|
||||
Z2SoundObjBase::init(pSoundPos, pNumHandles);
|
||||
void Z2SoundObjSimple::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundObjBase::init(posPtr, handleNum);
|
||||
}
|
||||
|
||||
/* 802BE8A0-802BE9B0 2B91E0 0110+00 1/0 0/0 0/0 .text
|
||||
* startSound__16Z2SoundObjSimpleF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID pSoundId, u32 param_1, s8 param_2) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(pSoundId, param_1, param_2);
|
||||
if (pSoundId == 0x200c7 && handle != NULL && handle->getSound() != NULL) {
|
||||
f32 local_0 = Z2Calc::getParamByExp((f32)param_1, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
f32 local_1 = Z2Calc::getParamByExp((f32)param_1, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
handle->getSound()->getAuxiliary().movePitch(local_1, 0);
|
||||
handle->getSound()->getAuxiliary().moveVolume(local_0, 0);
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb);
|
||||
|
||||
if (soundID == Z2SE_AL_UKI_POKOPOKO && handle != NULL && (*handle) != NULL) {
|
||||
f32 volume = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f, Z2Calc::CURVE_POSITIVE);
|
||||
f32 pitch = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f, Z2Calc::CURVE_POSITIVE);
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* 802BE9B0-802BEB38 2B92F0 0188+00 1/0 0/0 0/0 .text
|
||||
* startLevelSound__16Z2SoundObjSimpleF10JAISoundIDUlSc */
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startLevelSound(JAISoundID pSoundId, u32 param_1, s8 param_2) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(pSoundId, param_1, param_2);
|
||||
if (handle != NULL && handle->getSound() != NULL) {
|
||||
f32 local_0 = 1.0f;
|
||||
f32 local_1 = 1.0f;
|
||||
switch (pSoundId) {
|
||||
case 0x200c6:
|
||||
local_1 = Z2Calc::getParamByExp((f32)param_1, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
local_0 = Z2Calc::getParamByExp((f32)param_1, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f,
|
||||
Z2Calc::CURVE_SIGN_1);
|
||||
Z2SoundHandlePool* Z2SoundObjSimple::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) {
|
||||
Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb);
|
||||
|
||||
if (handle != NULL && (*handle) != NULL) {
|
||||
f32 pitch = 1.0f;
|
||||
f32 volume = 1.0f;
|
||||
switch (soundID) {
|
||||
case Z2SE_AL_UKI_KURUKURU_LOOP:
|
||||
volume = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f, Z2Calc::CURVE_POSITIVE);
|
||||
pitch = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f, Z2Calc::CURVE_POSITIVE);
|
||||
break;
|
||||
case 0x8025c:
|
||||
if (param_1 > 100) {
|
||||
local_0 = 2.0f;
|
||||
} else if (param_1 > 21) {
|
||||
local_0 = Z2Calc::getParamByExp((f32)param_1, 22.0f, 50.0f, 0.4f, 1.0f, 1.5f,
|
||||
Z2Calc::CURVE_SIGN_0);
|
||||
case Z2SE_OBJ_FLR_FALLING:
|
||||
if (mapinfo > 100) {
|
||||
pitch = 2.0f;
|
||||
} else if (mapinfo > 21) {
|
||||
pitch = Z2Calc::getParamByExp((f32)mapinfo, 22.0f, 50.0f, 0.4f, 1.0f, 1.5f, Z2Calc::CURVE_NEGATIVE);
|
||||
} else {
|
||||
pitch = 1.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
handle->getSound()->getAuxiliary().movePitch(local_0, 0);
|
||||
handle->getSound()->getAuxiliary().moveVolume(local_1, 0);
|
||||
|
||||
(*handle)->getAuxiliary().movePitch(pitch, 0);
|
||||
(*handle)->getAuxiliary().moveVolume(volume, 0);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -294,42 +347,44 @@ Z2SoundHandlePool* Z2SoundObjSimple::startLevelSound(JAISoundID pSoundId, u32 pa
|
||||
Z2SoundObjArrow::Z2SoundObjArrow() : Z2DopplerSoundObjBase() {}
|
||||
|
||||
/* 802BEB74-802BEB94 2B94B4 0020+00 1/0 0/0 0/0 .text init__15Z2SoundObjArrowFP3VecUc */
|
||||
void Z2SoundObjArrow::init(Vec* param_0, u8 param_1) {
|
||||
Z2SoundObjBase::init(param_0, param_1);
|
||||
void Z2SoundObjArrow::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundObjBase::init(posPtr, handleNum);
|
||||
}
|
||||
|
||||
/* 802BEB94-802BEBDC 2B94D4 0048+00 0/0 2/2 0/0 .text __ct__15Z2SoundObjAnimeFv */
|
||||
Z2SoundObjAnime::Z2SoundObjAnime() : Z2SoundObjBase() {
|
||||
mpAnimation = NULL;
|
||||
mReverse = false;
|
||||
animation_ = NULL;
|
||||
reverse_ = false;
|
||||
}
|
||||
|
||||
/* 802BEBDC-802BEBFC 2B951C 0020+00 1/0 1/0 0/0 .text init__15Z2SoundObjAnimeFP3VecUc */
|
||||
void Z2SoundObjAnime::init(Vec* param_0, u8 param_1) {
|
||||
Z2SoundObjBase::init(param_0, param_1);
|
||||
void Z2SoundObjAnime::init(Vec* posPtr, u8 handleNum) {
|
||||
Z2SoundObjBase::init(posPtr, handleNum);
|
||||
}
|
||||
|
||||
/* 802BEBFC-802BED68 2B953C 016C+00 0/0 2/2 0/0 .text initAnime__15Z2SoundObjAnimeFPvbff
|
||||
*/
|
||||
void Z2SoundObjAnime::initAnime(void* param_0, bool param_1, f32 param_2, f32 param_3) {
|
||||
void Z2SoundObjAnime::initAnime(void* animation, bool param_1, f32 startFrame, f32 param_3) {
|
||||
ageSounds_();
|
||||
mpAnimation = (JAUSoundAnimation*)param_0;
|
||||
if (mpAnimation != NULL) {
|
||||
mReverse = !param_1;
|
||||
animation_ = (JAUSoundAnimation*)animation;
|
||||
if (animation_ != NULL) {
|
||||
reverse_ = !param_1;
|
||||
field_0x3c = 0;
|
||||
if (mReverse) {
|
||||
mCurSoundIndex = mpAnimation->getNumSounds() - 1;
|
||||
mCurSoundFrame = FLT_MAX;
|
||||
setLoopFrame(0.0f, param_2);
|
||||
|
||||
if (reverse_) {
|
||||
curSoundIndex_ = animation_->getNumSounds() - 1;
|
||||
curSoundFrame_ = FLT_MAX;
|
||||
setLoopFrame(0.0f, startFrame);
|
||||
} else {
|
||||
mCurSoundIndex = 0;
|
||||
mCurSoundFrame = 0.0f;
|
||||
setLoopFrame(param_2, 0.0f);
|
||||
curSoundIndex_ = 0;
|
||||
curSoundFrame_ = 0.0f;
|
||||
setLoopFrame(startFrame, 0.0f);
|
||||
}
|
||||
mCurSoundFrame = param_3;
|
||||
mCurSoundIndex = mpAnimation->getStartSoundIndex(param_3);
|
||||
if (mReverse && mCurSoundIndex > 0) {
|
||||
mCurSoundIndex--;
|
||||
|
||||
curSoundFrame_ = param_3;
|
||||
curSoundIndex_ = animation_->getStartSoundIndex(param_3);
|
||||
if (reverse_ && curSoundIndex_ > 0) {
|
||||
curSoundIndex_--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,25 +392,24 @@ void Z2SoundObjAnime::initAnime(void* param_0, bool param_1, f32 param_2, f32 pa
|
||||
/* 802BED68-802BEED4 2B96A8 016C+00 1/1 0/0 0/0 .text ageSounds___15Z2SoundObjAnimeFv */
|
||||
void Z2SoundObjAnime::ageSounds_() {
|
||||
for (int i = 0; i < getNumHandles(); i++) {
|
||||
if (getHandle(i)->getSound() != NULL) {
|
||||
switch (getHandle(i)->getSound()->getAnimationState()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (getHandle(i)->getSound()->hasLifeTime()) {
|
||||
getHandle(i)->getSound()->stop();
|
||||
if ((*getHandle(i))) {
|
||||
switch ((*getHandle(i))->getAnimationState()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if ((*getHandle(i))->hasLifeTime()) {
|
||||
(*getHandle(i))->stop();
|
||||
} else {
|
||||
JAUSoundAnimationSound* animationSound = (JAUSoundAnimationSound*)(*getHandle(i))->getUserData();
|
||||
if (animationSound->stopsWhenAnimationChanges()) {
|
||||
(*getHandle(i))->stop();
|
||||
} else {
|
||||
JAUSoundAnimationSound* sound =
|
||||
(JAUSoundAnimationSound*)getHandle(i)->getSound()->getUserData();
|
||||
if (sound->stopsWhenAnimationChanges()) {
|
||||
getHandle(i)->getSound()->stop();
|
||||
} else {
|
||||
getHandle(i)->getSound()->setAnimationState(2);
|
||||
}
|
||||
(*getHandle(i))->setAnimationState(2);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,90 +419,93 @@ void Z2SoundObjAnime::ageSounds_() {
|
||||
*/
|
||||
void Z2SoundObjAnime::updateAnime(f32 param_0, f32 param_1) {
|
||||
for (int i = 0; i < getNumHandles(); i++) {
|
||||
if (getHandle(i)->getSound() != NULL && getHandle(i)->getSound()->isAnimated()) {
|
||||
getHandle(i)->getSound()->setPos(*mSoundPos);
|
||||
if ((*getHandle(i)) && (*getHandle(i))->isAnimated()) {
|
||||
(*getHandle(i))->setPos(*pos_);
|
||||
}
|
||||
}
|
||||
|
||||
if (mpAnimation == NULL || mpAnimation->getNumSounds() == 0) {
|
||||
if (animation_ == NULL || animation_->getNumSounds() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mReverse) {
|
||||
if (param_0 < mCurSoundFrame) {
|
||||
while (mCurSoundIndex < mEndSoundIndex) {
|
||||
startSoundInner(*mSoundPos, param_1, mSoundStarter, field_0x1c, field_0x1e);
|
||||
if (!reverse_) {
|
||||
if (param_0 < curSoundFrame_) {
|
||||
while (curSoundIndex_ < endSoundIndex_) {
|
||||
startSoundInner(*pos_, param_1, soundStarter_, field_0x1c, reverb_);
|
||||
}
|
||||
mCurSoundIndex = mStartSoundIndex;
|
||||
mCurSoundFrame = param_0;
|
||||
if (field_0x3c < 0xffff) {
|
||||
curSoundIndex_ = startSoundIndex_;
|
||||
curSoundFrame_ = param_0;
|
||||
if (field_0x3c < 0xFFFF) {
|
||||
field_0x3c++;
|
||||
}
|
||||
}
|
||||
|
||||
updateSoundLifeTime_(param_0, param_1);
|
||||
while (mCurSoundIndex < mpAnimation->getNumSounds() &&
|
||||
mpAnimation->getSound(mCurSoundIndex)->isNotingOn(param_0, false)) {
|
||||
startSoundInner(*mSoundPos, param_1, mSoundStarter, field_0x1c, field_0x1e);
|
||||
|
||||
while (curSoundIndex_ < animation_->getNumSounds() && animation_->getSound(curSoundIndex_)->isNotingOn(param_0, false)) {
|
||||
startSoundInner(*pos_, param_1, soundStarter_, field_0x1c, reverb_);
|
||||
}
|
||||
} else {
|
||||
if (param_0 > mCurSoundFrame) {
|
||||
while (mCurSoundIndex >= mStartSoundIndex) {
|
||||
startSoundInner(*mSoundPos, param_1, mSoundStarter, field_0x1c, field_0x1e);
|
||||
if (param_0 > curSoundFrame_) {
|
||||
while (curSoundIndex_ >= startSoundIndex_) {
|
||||
startSoundInner(*pos_, param_1, soundStarter_, field_0x1c, reverb_);
|
||||
}
|
||||
mCurSoundIndex = mEndSoundIndex - 1;
|
||||
mCurSoundFrame = param_0;
|
||||
if (field_0x3c < 0xffff) {
|
||||
curSoundIndex_ = endSoundIndex_ - 1;
|
||||
curSoundFrame_ = param_0;
|
||||
if (field_0x3c < 0xFFFF) {
|
||||
field_0x3c++;
|
||||
}
|
||||
}
|
||||
|
||||
updateSoundLifeTime_(param_0, param_1);
|
||||
while (mCurSoundIndex >= 0 &&
|
||||
mpAnimation->getSound(mCurSoundIndex)->isNotingOn(param_0, true)) {
|
||||
startSoundInner(*mSoundPos, param_1, mSoundStarter, field_0x1c, field_0x1e);
|
||||
|
||||
while (curSoundIndex_ >= 0 && animation_->getSound(curSoundIndex_)->isNotingOn(param_0, true)) {
|
||||
startSoundInner(*pos_, param_1, soundStarter_, field_0x1c, reverb_);
|
||||
}
|
||||
}
|
||||
|
||||
mCurSoundFrame = param_0;
|
||||
curSoundFrame_ = param_0;
|
||||
}
|
||||
|
||||
/* 802BF304-802BF660 2B9C44 035C+00 1/1 0/0 0/0 .text updateSoundLifeTime___15Z2SoundObjAnimeFff
|
||||
*/
|
||||
void Z2SoundObjAnime::updateSoundLifeTime_(f32 param_0, f32 param_1) {
|
||||
if (mpAnimation == NULL) {
|
||||
if (animation_ == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < getNumHandles(); i++) {
|
||||
if (getHandle(i)->getSound() != NULL) {
|
||||
switch (getHandle(i)->getSound()->getAnimationState()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1: {
|
||||
JAUSoundAnimationSound* sound =
|
||||
(JAUSoundAnimationSound*)getHandle(i)->getSound()->getUserData();
|
||||
bool bvar1 = param_1 == 0.0f && sound->stopsWhenSpeedIsZero();
|
||||
if (sound->setsLifeTime()) {
|
||||
if (bvar1) {
|
||||
getHandle(i)->getSound()->pause(true);
|
||||
} else {
|
||||
if (sound->isNoting(param_0)) {
|
||||
getHandle(i)->getSound()->updateLifeTime(1);
|
||||
getHandle(i)->getSound()->pause(false);
|
||||
} else {
|
||||
getHandle(i)->getSound()->stop();
|
||||
}
|
||||
}
|
||||
if ((*getHandle(i))) {
|
||||
switch ((*getHandle(i))->getAnimationState()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1: {
|
||||
JAUSoundAnimationSound* animationSound = (JAUSoundAnimationSound*)(*getHandle(i))->getUserData();
|
||||
JUT_ASSERT(696, animationSound);
|
||||
|
||||
bool bvar1 = param_1 == 0.0f && animationSound->stopsWhenSpeedIsZero();
|
||||
if (animationSound->setsLifeTime()) {
|
||||
if (bvar1) {
|
||||
(*getHandle(i))->pause(true);
|
||||
} else {
|
||||
if (bvar1) {
|
||||
getHandle(i)->getSound()->stop();
|
||||
} else if (sound->stopsWhenNoteOff() &&
|
||||
sound->isNotingOff(param_0, mReverse)) {
|
||||
getHandle(i)->getSound()->stop();
|
||||
if (animationSound->isNoting(param_0)) {
|
||||
(*getHandle(i))->updateLifeTime(1);
|
||||
(*getHandle(i))->pause(false);
|
||||
} else {
|
||||
(*getHandle(i))->stop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
if (bvar1) {
|
||||
(*getHandle(i))->stop();
|
||||
} else if (animationSound->stopsWhenNoteOff() && animationSound->isNotingOff(param_0, reverse_)) {
|
||||
(*getHandle(i))->stop();
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,38 +513,44 @@ void Z2SoundObjAnime::updateSoundLifeTime_(f32 param_0, f32 param_1) {
|
||||
|
||||
/* 802BF660-802BF890 2B9FA0 0230+00 1/1 0/0 0/0 .text
|
||||
* startSoundInner__15Z2SoundObjAnimeFRCQ29JGeometry8TVec3<f>fP14Z2SoundStarterUlSc */
|
||||
void Z2SoundObjAnime::startSoundInner(JGeometry::TVec3<f32> const& param_0, f32 param_1,
|
||||
Z2SoundStarter* param_2, u32 param_3, s8 param_4) {
|
||||
const JAUSoundAnimationSound* sound = mpAnimation->getSound(mCurSoundIndex);
|
||||
u32 user_data = (u32)sound;
|
||||
if (mReverse) {
|
||||
mCurSoundIndex--;
|
||||
void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3<f32>& pos, f32 param_1,
|
||||
Z2SoundStarter* soundStarter, u32 mapinfo, s8 reverb) {
|
||||
JUT_ASSERT(746, curSoundIndex_ >= 0);
|
||||
JUT_ASSERT(747, curSoundIndex_ < animation_->getNumSounds());
|
||||
|
||||
const JAUSoundAnimationSound* animationSound = animation_->getSound(curSoundIndex_);
|
||||
u32 user_data = (u32)animationSound;
|
||||
if (reverse_) {
|
||||
curSoundIndex_--;
|
||||
} else {
|
||||
mCurSoundIndex++;
|
||||
curSoundIndex_++;
|
||||
}
|
||||
if (sound->field_0x1a > 0) {
|
||||
param_3 = sound->field_0x1a;
|
||||
|
||||
if (animationSound->field_0x1a > 0) {
|
||||
mapinfo = animationSound->field_0x1a;
|
||||
}
|
||||
if (playsSound(sound, param_0, param_1)) {
|
||||
u32 id = getSoundID(sound, param_0, param_1);
|
||||
|
||||
if (playsSound(animationSound, pos, param_1)) {
|
||||
u32 id = getSoundID(animationSound, pos, param_1);
|
||||
if (!Z2GetSeMgr()->isSoundCulling(id)) {
|
||||
JAISoundHandle* handle = getHandleUserData(user_data);
|
||||
if (handle != NULL && handle->getSound() != NULL &&
|
||||
handle->getSound()->getAnimationState() != 1) {
|
||||
if (handle != NULL && (*handle) != NULL && (*handle)->getAnimationState() != 1) {
|
||||
handle = NULL;
|
||||
}
|
||||
|
||||
if (handle == NULL) {
|
||||
handle = getFreeHandle();
|
||||
}
|
||||
|
||||
if (handle != NULL) {
|
||||
param_2->startSound(id, handle, ¶m_0, param_3, (f32)param_4 / 127.0f,
|
||||
sound->field_0x0c, (f32)sound->field_0x14 / 127.0f,
|
||||
-1.0f, -1.0f, 0);
|
||||
if (handle->getSound() != NULL) {
|
||||
handle->getSound()->setAnimationState(1);
|
||||
handle->getSound()->setUserData(user_data);
|
||||
if (sound->setsLifeTime()) {
|
||||
handle->getSound()->setLifeTime(1, false);
|
||||
bool result = soundStarter->startSound(id, handle, &pos, mapinfo, (f32)reverb / 127.0f,
|
||||
animationSound->field_0x0c, (f32)animationSound->field_0x14 / 127.0f,
|
||||
-1.0f, -1.0f, 0);
|
||||
if ((*handle) != NULL) {
|
||||
(*handle)->setAnimationState(1);
|
||||
(*handle)->setUserData(user_data);
|
||||
if (animationSound->setsLifeTime()) {
|
||||
(*handle)->setLifeTime(1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,32 +560,34 @@ void Z2SoundObjAnime::startSoundInner(JGeometry::TVec3<f32> const& param_0, f32
|
||||
|
||||
/* 802BF890-802BF898 2BA1D0 0008+00 1/1 0/0 0/0 .text
|
||||
* getSoundID__15Z2SoundObjAnimeFPC22JAUSoundAnimationSoundRCQ29JGeometry8TVec3<f>f */
|
||||
u32 Z2SoundObjAnime::getSoundID(JAUSoundAnimationSound const* i_sound,
|
||||
JGeometry::TVec3<f32> const& param_1, f32 param_2) {
|
||||
return i_sound->mSoundId;
|
||||
u32 Z2SoundObjAnime::getSoundID(const JAUSoundAnimationSound* animationSound,
|
||||
const JGeometry::TVec3<f32>& param_1, f32 param_2) {
|
||||
return animationSound->mSoundId;
|
||||
}
|
||||
|
||||
/* 802BF898-802BF920 2BA1D8 0088+00 1/1 0/0 0/0 .text
|
||||
* playsSound__15Z2SoundObjAnimeFPC22JAUSoundAnimationSoundRCQ29JGeometry8TVec3<f>f */
|
||||
bool Z2SoundObjAnime::playsSound(JAUSoundAnimationSound const* i_sound,
|
||||
JGeometry::TVec3<f32> const& param_1, f32 param_2) {
|
||||
if (i_sound->playsOnlyOnce()) {
|
||||
if (field_0x3c != i_sound->field_0x16) {
|
||||
bool Z2SoundObjAnime::playsSound(const JAUSoundAnimationSound* animationSound,
|
||||
const JGeometry::TVec3<f32>& param_1, f32 param_2) {
|
||||
(void)param_1;
|
||||
(void)param_2;
|
||||
|
||||
if (animationSound->playsOnlyOnce()) {
|
||||
if (field_0x3c != animationSound->field_0x16) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (i_sound->playsAtIntervals() &&
|
||||
i_sound->field_0x16 != field_0x3c % i_sound->field_0x19) {
|
||||
if (animationSound->playsAtIntervals() && animationSound->field_0x16 != field_0x3c % animationSound->field_0x19) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (mReverse) {
|
||||
if (i_sound->playsOnlyForward()) {
|
||||
if (reverse_) {
|
||||
if (animationSound->playsOnlyForward()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (i_sound->playsOnlyReverse()) {
|
||||
if (animationSound->playsOnlyReverse()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,110 +1,109 @@
|
||||
//
|
||||
// Z2SoundStarter
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SoundStarter.h"
|
||||
#include "Z2AudioLib/Z2EnvSeMgr.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
|
||||
/* 802AAB94-802AABF4 2A54D4 0060+00 0/0 4/4 0/0 .text __ct__14Z2SoundStarterFb */
|
||||
Z2SoundStarter::Z2SoundStarter(bool param_0) : JAISoundStarter(param_0), JASGlobalInstance<Z2SoundStarter>(param_0) {
|
||||
}
|
||||
Z2SoundStarter::Z2SoundStarter(bool setInstance) :
|
||||
JAISoundStarter(setInstance), JASGlobalInstance<Z2SoundStarter>(setInstance) {}
|
||||
|
||||
/* 802AABF4-802AAC3C 2A5534 0048+00 1/0 5/0 0/0 .text
|
||||
* startSound__14Z2SoundStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f> */
|
||||
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);
|
||||
bool Z2SoundStarter::startSound(JAISoundID soundID, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr) {
|
||||
return Z2SoundStarter::startSound(soundID, handlePtr, posPtr, 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 */
|
||||
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) {
|
||||
bool Z2SoundStarter::startSound(JAISoundID soundID, JAISoundHandle* handlePtr,
|
||||
const JGeometry::TVec3<f32>* posPtr, u32 mapinfo, f32 fxMix,
|
||||
f32 pitch, f32 volume, f32 pan, f32 dolby, u32 moveSteps) {
|
||||
JUT_ASSERT(45, handlePtr);
|
||||
if (param_4 == 6) {
|
||||
switch (i_soundID) {
|
||||
if (mapinfo == 6) {
|
||||
switch (soundID) {
|
||||
case Z2SE_CM_BODYFALL_S:
|
||||
i_soundID = Z2SE_CM_BODYFALL_ASASE_S;
|
||||
soundID = Z2SE_CM_BODYFALL_ASASE_S;
|
||||
break;
|
||||
case Z2SE_CM_BODYFALL_M:
|
||||
i_soundID = Z2SE_CM_BODYFALL_ASASE_M;
|
||||
soundID = Z2SE_CM_BODYFALL_ASASE_M;
|
||||
break;
|
||||
case Z2SE_CM_BODYFALL_L:
|
||||
i_soundID = Z2SE_CM_BODYFALL_ASASE_L;
|
||||
soundID = Z2SE_CM_BODYFALL_ASASE_L;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i_soundID.mId.mBytes.b1 != 0 && i_soundID.mId.mBytes.b1 != 9) {
|
||||
|
||||
if (soundID.id_.info.type.parts.groupID != 0 && soundID.id_.info.type.parts.groupID != 9) {
|
||||
if (Z2GetSceneMgr()->isInDarkness()) {
|
||||
i_fxMix = 1.0f;
|
||||
fxMix = 1.0f;
|
||||
} else {
|
||||
f32 ratio = Z2GetStatusMgr()->getCameraInWaterDepthRatio();
|
||||
f32 uStack_8c = ratio > 0.0f;
|
||||
if (uStack_8c) {
|
||||
i_fxMix = uStack_8c;
|
||||
f32 inWaterMix = Z2GetStatusMgr()->getCameraInWaterDepthRatio() > 0.0f;
|
||||
if (inWaterMix) {
|
||||
fxMix = inWaterMix;
|
||||
} else {
|
||||
i_fxMix += 0.5f * Z2GetEnvSeMgr()->getFogDensity();
|
||||
if (i_fxMix > 1.0f) {
|
||||
i_fxMix = 1.0f;
|
||||
fxMix += 0.5f * Z2GetEnvSeMgr()->getFogDensity();
|
||||
if (fxMix > 1.0f) {
|
||||
fxMix = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bool startSoundRes = Z2GetAudioMgr()->startSound(i_soundID, handlePtr, i_pos);
|
||||
|
||||
bool startSoundRes = Z2GetAudioMgr()->startSound(soundID, handlePtr, posPtr);
|
||||
if (*handlePtr) {
|
||||
if (param_4 != 0) {
|
||||
setPortData(handlePtr, 6, param_4, -1);
|
||||
if (mapinfo != 0) {
|
||||
setPortData(handlePtr, 6, mapinfo, -1);
|
||||
}
|
||||
if (i_fxMix > 0.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveFxMix(i_fxMix, i_count);
|
||||
if (fxMix > 0.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveFxMix(fxMix, moveSteps);
|
||||
}
|
||||
if (i_pitch != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePitch(i_pitch, i_count);
|
||||
if (pitch != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePitch(pitch, moveSteps);
|
||||
}
|
||||
if (i_volume != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveVolume(i_volume, i_count);
|
||||
if (volume != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveVolume(volume, moveSteps);
|
||||
}
|
||||
if (i_pan != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePan(i_pan, i_count);
|
||||
if (pan != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePan(pan, moveSteps);
|
||||
}
|
||||
if (i_dolby != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveDolby(i_dolby, i_count);
|
||||
if (dolby != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveDolby(dolby, moveSteps);
|
||||
}
|
||||
}
|
||||
|
||||
return startSoundRes;
|
||||
}
|
||||
|
||||
/* 802AAEDC-802AAF74 2A581C 0098+00 1/1 10/10 0/0 .text
|
||||
* setPortData__14Z2SoundStarterFP14JAISoundHandleUlUsSc */
|
||||
void Z2SoundStarter::setPortData(JAISoundHandle* param_1, u32 param_2, u16 param_3, s8 param_4) {
|
||||
if (param_1 != NULL && *param_1) {
|
||||
JASTrack* track = param_1->getSound()->getTrack();
|
||||
if (param_4 != -1) {
|
||||
if (track->getChild(param_4) == NULL) {
|
||||
track->openChild(param_4);
|
||||
void Z2SoundStarter::setPortData(JAISoundHandle* handlePtr, u32 portNum, u16 data, s8 childIndex) {
|
||||
if (handlePtr != NULL && *handlePtr) {
|
||||
JASTrack* track = handlePtr->getSound()->getTrack();
|
||||
if (childIndex != -1) {
|
||||
if (track->getChild(childIndex) == NULL) {
|
||||
track->openChild(childIndex);
|
||||
}
|
||||
track = track->getChild(param_4);
|
||||
track = track->getChild(childIndex);
|
||||
}
|
||||
|
||||
JUT_ASSERT(122, track);
|
||||
track->writePort(param_2, param_3);
|
||||
track->writePort(portNum, data);
|
||||
}
|
||||
}
|
||||
|
||||
/* 802AAF74-802AAFF0 2A58B4 007C+00 0/0 1/1 0/0 .text
|
||||
* getPortData__14Z2SoundStarterFP14JAISoundHandleUlSc */
|
||||
u16 Z2SoundStarter::getPortData(JAISoundHandle* param_1, u32 param_2, s8 param_3) {
|
||||
if (param_1 != NULL && *param_1) {
|
||||
JASTrack* track;
|
||||
if (param_3 == -1) {
|
||||
track = param_1->getSound()->getTrack();
|
||||
u16 Z2SoundStarter::getPortData(JAISoundHandle* handlePtr, u32 portNum, s8 childIndex) {
|
||||
if (handlePtr != NULL && *handlePtr) {
|
||||
JASTrack* track = NULL;
|
||||
if (childIndex == -1) {
|
||||
track = handlePtr->getSound()->getTrack();
|
||||
} else {
|
||||
track = param_1->getSound()->getChildTrack(param_3);
|
||||
track = handlePtr->getSound()->getChildTrack(childIndex);
|
||||
}
|
||||
|
||||
JUT_ASSERT(140, track);
|
||||
return track->readPort(param_2);
|
||||
return track->readPort(portNum);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+207
-182
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Z2SpeechMgr2
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2SpeechMgr2.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "Z2AudioLib/Z2EnvSeMgr.h"
|
||||
@@ -9,56 +5,76 @@
|
||||
#include "Z2AudioLib/Z2SeMgr.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
|
||||
typedef struct {
|
||||
const u8* field_0x0;
|
||||
const u8* field_0x4;
|
||||
u8 field_0x8;
|
||||
u8 field_0x9;
|
||||
u8 field_0xa;
|
||||
u8 field_0xb;
|
||||
|
||||
} sPrmStruct;
|
||||
|
||||
struct Z2MdnPrm {
|
||||
static u8 const sReply[100];
|
||||
struct Unit {
|
||||
u8 start;
|
||||
u8 end;
|
||||
};
|
||||
|
||||
struct Prm {
|
||||
const Unit* main;
|
||||
const u8* tail;
|
||||
u8 mainNum;
|
||||
u8 tailNum1;
|
||||
u8 tailNum2;
|
||||
};
|
||||
|
||||
static Unit const sReply[50];
|
||||
static u8 const sReplyTail[10];
|
||||
static u8 const sJoke[100];
|
||||
|
||||
static Unit const sJoke[50];
|
||||
static u8 const sJokeTail[10];
|
||||
static u8 const sSexy[100];
|
||||
|
||||
static Unit const sSexy[50];
|
||||
static u8 const sSexyTail[10];
|
||||
static u8 const sRidicule[100];
|
||||
|
||||
static Unit const sRidicule[50];
|
||||
static u8 const sRidiculeTail[10];
|
||||
static u8 const sBoring[108];
|
||||
static u8 const sIrritated[94];
|
||||
static u8 const sIrritatedTail[10];
|
||||
static u8 const sOrder[114];
|
||||
static u8 const sResent[106];
|
||||
static u8 const sCheerful[106];
|
||||
static u8 const sConfused[106];
|
||||
static u8 const sHostility[104];
|
||||
static u8 const sTired[106];
|
||||
static u8 const sSerious[106];
|
||||
static u8 const sReplyb[84];
|
||||
static u8 const sApologize[100];
|
||||
static u8 const sApologizeTail[9];
|
||||
static u8 const sDeside[100];
|
||||
static u8 const sAfford[104];
|
||||
static u8 const sAffordTail[12];
|
||||
static sPrmStruct const sPrm[17];
|
||||
|
||||
static Unit const sBoring[54];
|
||||
static u8 const sBoringTail[6];
|
||||
|
||||
static Unit const sIrritated[47];
|
||||
static u8 const sIrritatedTail[10];
|
||||
|
||||
static Unit const sOrder[57];
|
||||
static u8 const sOrderTail[6];
|
||||
|
||||
static Unit const sResent[53];
|
||||
static u8 const sResentTail[5];
|
||||
|
||||
static Unit const sCheerful[53];
|
||||
static u8 const sCheerfulTail[8];
|
||||
|
||||
static Unit const sConfused[53];
|
||||
static u8 const sConfusedTail[5];
|
||||
|
||||
static Unit const sHostility[52];
|
||||
static u8 const sHostilityTail[7];
|
||||
|
||||
static Unit const sTired[53];
|
||||
static u8 const sTiredTail[8];
|
||||
|
||||
static Unit const sSerious[53];
|
||||
static u8 const sSeriousTail[7];
|
||||
|
||||
static Unit const sReplyb[42];
|
||||
static u8 const sReplybTail[7];
|
||||
|
||||
static Unit const sApologize[50];
|
||||
static u8 const sApologizeTail[9];
|
||||
|
||||
static Unit const sDeside[50];
|
||||
static u8 const sDesideTail[8];
|
||||
|
||||
static Unit const sAfford[52];
|
||||
static u8 const sAffordTail[12];
|
||||
|
||||
static Prm const sPrm[17];
|
||||
};
|
||||
|
||||
/* 8039C260-8039C2C4 0288C0 0064+00 1/0 0/0 0/0 .rodata sReply__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sReply[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sReply[50] = {
|
||||
0x6A, 0x8A, 0x50, 0x5F, 0x53, 0x37, 0x37, 0x4F, 0x4F, 0x5E, 0xAA, 0x46, 0x52, 0x5A, 0x5A,
|
||||
0x4F, 0x4F, 0x45, 0x45, 0x56, 0x64, 0x79, 0x79, 0x79, 0x87, 0x95, 0x95, 0x89, 0x89, 0x4C,
|
||||
0x4C, 0x4B, 0x52, 0x41, 0x41, 0x5B, 0x5F, 0x71, 0x53, 0x47, 0x89, 0x7D, 0x77, 0x88, 0x88,
|
||||
@@ -74,7 +90,7 @@ u8 const Z2MdnPrm::sReplyTail[10] = {
|
||||
};
|
||||
|
||||
/* 8039C2D0-8039C334 028930 0064+00 1/0 0/0 0/0 .rodata sJoke__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sJoke[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sJoke[50] = {
|
||||
0x68, 0x57, 0x57, 0x55, 0x55, 0x51, 0x5B, 0x64, 0x6B, 0x7B, 0x7B, 0x5C, 0x77, 0x97, 0x8D,
|
||||
0x97, 0x97, 0x8D, 0x66, 0x69, 0xA2, 0x5C, 0x87, 0x4F, 0x69, 0x5F, 0x5F, 0x83, 0x83, 0x82,
|
||||
0x7F, 0x96, 0x96, 0xB0, 0x70, 0xA1, 0x6D, 0x6D, 0x6D, 0x59, 0x4C, 0x4B, 0x5A, 0x40, 0x4A,
|
||||
@@ -83,13 +99,14 @@ u8 const Z2MdnPrm::sJoke[100] = {
|
||||
0x64, 0x60, 0xB1, 0x6C, 0x6D, 0x6D, 0x7E, 0x7A, 0x97, 0x97, 0x99, 0xA5, 0x89, 0x90, 0xA4,
|
||||
0x45, 0x45, 0x29, 0x4C, 0x4B, 0x64, 0x64, 0x60, 0x5C, 0xB1,
|
||||
};
|
||||
|
||||
/* 8039C334-8039C340 028994 000A+02 1/0 0/0 0/0 .rodata sJokeTail__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sJokeTail[10] = {
|
||||
0x51, 0x97, 0x60, 0xB0, 0x6F, 0x5E, 0x5A, 0xA6, 0x4F, 0x4F,
|
||||
};
|
||||
|
||||
/* 8039C340-8039C3A4 0289A0 0064+00 1/0 0/0 0/0 .rodata sSexy__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sSexy[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sSexy[50] = {
|
||||
0x5E, 0x60, 0x5F, 0x63, 0x63, 0x72, 0x72, 0x78, 0x4D, 0x7A, 0x6E, 0x6E, 0x6E, 0x6E, 0x6E,
|
||||
0x59, 0x59, 0x7A, 0x7A, 0xA5, 0x90, 0x8D, 0x86, 0x62, 0x72, 0x79, 0x79, 0x86, 0x7F, 0x8B,
|
||||
0x85, 0x7B, 0x7B, 0x5E, 0x5E, 0x6D, 0x6D, 0x88, 0x5F, 0xA3, 0xA3, 0x95, 0x95, 0x7F, 0x79,
|
||||
@@ -105,7 +122,7 @@ u8 const Z2MdnPrm::sSexyTail[10] = {
|
||||
};
|
||||
|
||||
/* 8039C3B0-8039C414 028A10 0064+00 1/0 0/0 0/0 .rodata sRidicule__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sRidicule[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sRidicule[50] = {
|
||||
0xA7, 0x5A, 0x5A, 0x52, 0x52, 0x85, 0x85, 0x8C, 0x63, 0x73, 0x73, 0x90, 0x50, 0x46, 0x74,
|
||||
0x74, 0xA3, 0xA7, 0x41, 0x51, 0x58, 0x34, 0x34, 0x2A, 0x5A, 0x81, 0x5D, 0x42, 0x4B, 0x70,
|
||||
0x70, 0xB1, 0xB1, 0xB1, 0xB1, 0x65, 0x6A, 0xB1, 0x54, 0xA8, 0xA8, 0x6B, 0x6C, 0x55, 0x55,
|
||||
@@ -121,7 +138,7 @@ u8 const Z2MdnPrm::sRidiculeTail[10] = {
|
||||
};
|
||||
|
||||
/* 8039C420-8039C48C 028A80 006C+00 1/0 0/0 0/0 .rodata sBoring__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sBoring[108] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sBoring[54] = {
|
||||
0x8E, 0x9C, 0x9C, 0x5A, 0x5A, 0x52, 0x52, 0x5B, 0x5C, 0x56, 0x5C, 0x52, 0x52, 0x2D, 0x2D, 0x5B,
|
||||
0x59, 0x56, 0x56, 0x56, 0x56, 0x6B, 0x6B, 0x58, 0x4C, 0x8E, 0x8E, 0x59, 0x61, 0x54, 0xA0, 0x4D,
|
||||
0x5D, 0x59, 0x48, 0x30, 0x30, 0x5B, 0x5B, 0x5B, 0x4A, 0x64, 0x64, 0x7A, 0x7A, 0x92, 0x62, 0x62,
|
||||
@@ -137,7 +154,7 @@ u8 const Z2MdnPrm::sBoringTail[6] = {
|
||||
};
|
||||
|
||||
/* 8039C48C-8039C4EC 028AEC 005E+02 1/0 0/0 0/0 .rodata sIrritated__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sIrritated[94] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sIrritated[47] = {
|
||||
0x6C, 0x91, 0x67, 0x8B, 0x8B, 0xA2, 0xA2, 0xAB, 0x48, 0x64, 0x73, 0x61, 0x61, 0x64, 0x64, 0x6D,
|
||||
0x60, 0x7E, 0x4A, 0x55, 0x6A, 0x63, 0x66, 0x78, 0x5C, 0x5A, 0x6E, 0x79, 0x75, 0x62, 0x62, 0x57,
|
||||
0x85, 0x3F, 0x3C, 0x83, 0x83, 0x9B, 0x78, 0x65, 0x65, 0x67, 0x65, 0x65, 0x87, 0x88, 0x88, 0x3D,
|
||||
@@ -152,7 +169,7 @@ u8 const Z2MdnPrm::sIrritatedTail[10] = {
|
||||
};
|
||||
|
||||
/* 8039C4F8-8039C56C 028B58 0072+02 1/0 0/0 0/0 .rodata sOrder__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sOrder[114] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sOrder[57] = {
|
||||
0x77, 0x5F, 0x5F, 0x73, 0x73, 0x66, 0x66, 0x6B, 0x6B, 0x7A, 0x7A, 0x60, 0x54, 0x5F, 0x5F,
|
||||
0x69, 0x69, 0x5A, 0x86, 0x84, 0x84, 0x96, 0x96, 0x94, 0x94, 0x8A, 0x87, 0x84, 0x5A, 0x2C,
|
||||
0x4E, 0x52, 0x52, 0x52, 0x52, 0x51, 0x51, 0x6E, 0x62, 0x5E, 0x6C, 0xA3, 0xA3, 0x5B, 0x62,
|
||||
@@ -169,7 +186,7 @@ u8 const Z2MdnPrm::sOrderTail[6] = {
|
||||
};
|
||||
|
||||
/* 8039C56C-8039C5D8 028BCC 006A+02 1/0 0/0 0/0 .rodata sResent__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sResent[106] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sResent[53] = {
|
||||
0x6F, 0x5F, 0x5F, 0x66, 0x66, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x4B, 0x4B, 0x6B, 0x6B, 0x86,
|
||||
0x86, 0x4A, 0x4A, 0x6D, 0x6D, 0x6D, 0x6D, 0x8C, 0x8C, 0x84, 0x84, 0x64, 0x64, 0x6C, 0x6C, 0x92,
|
||||
0x92, 0x6A, 0x5F, 0x6F, 0x6F, 0x62, 0x62, 0x62, 0x75, 0x5A, 0x5A, 0x5A, 0x5A, 0x60, 0x60, 0x6A,
|
||||
@@ -185,7 +202,7 @@ u8 const Z2MdnPrm::sResentTail[5] = {
|
||||
};
|
||||
|
||||
/* 8039C5D8-8039C644 028C38 006A+02 1/0 0/0 0/0 .rodata sCheerful__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sCheerful[106] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sCheerful[53] = {
|
||||
0x64, 0x6D, 0x6D, 0x6D, 0x99, 0x6D, 0x40, 0x51, 0x51, 0x6F, 0x6F, 0x66, 0x66, 0x60, 0xA7, 0xAF,
|
||||
0xB3, 0x61, 0x61, 0xA7, 0xA7, 0x5E, 0x8B, 0x75, 0x77, 0x72, 0x72, 0x93, 0x93, 0x8B, 0x8B, 0x88,
|
||||
0x88, 0x77, 0x77, 0x80, 0x80, 0x80, 0x80, 0x67, 0x67, 0x4D, 0x4A, 0x69, 0x44, 0xA1, 0x64, 0xA8,
|
||||
@@ -201,7 +218,7 @@ u8 const Z2MdnPrm::sCheerfulTail[8] = {
|
||||
};
|
||||
|
||||
/* 8039C644-8039C6B0 028CA4 006A+02 1/0 0/0 0/0 .rodata sConfused__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sConfused[106] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sConfused[53] = {
|
||||
0x83, 0x80, 0x80, 0x82, 0x82, 0x82, 0x82, 0x5B, 0x75, 0x84, 0x84, 0x84, 0x84, 0x75, 0x75, 0x62,
|
||||
0x62, 0x62, 0x4D, 0x56, 0x56, 0x59, 0x59, 0x59, 0x59, 0x74, 0x74, 0x85, 0x7D, 0x8D, 0x8D, 0x70,
|
||||
0x70, 0x5A, 0x5A, 0x6B, 0x6B, 0x6B, 0x6B, 0x70, 0x79, 0x73, 0x73, 0x71, 0x71, 0x75, 0x75, 0x7B,
|
||||
@@ -217,7 +234,7 @@ u8 const Z2MdnPrm::sConfusedTail[5] = {
|
||||
};
|
||||
|
||||
/* 8039C6B0-8039C718 028D10 0068+00 1/0 0/0 0/0 .rodata sHostility__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sHostility[104] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sHostility[52] = {
|
||||
0x85, 0x71, 0x71, 0x73, 0x73, 0x3B, 0x62, 0x84, 0x94, 0x94, 0x94, 0xAF, 0x98, 0xAD, 0xAD,
|
||||
0x5A, 0x5A, 0x63, 0x63, 0x97, 0x90, 0x90, 0x7B, 0x73, 0x73, 0x63, 0x63, 0x55, 0x55, 0x65,
|
||||
0x66, 0x7F, 0x7F, 0x87, 0x87, 0x8A, 0x8A, 0x94, 0x5D, 0x5C, 0x5A, 0x67, 0x67, 0x68, 0x68,
|
||||
@@ -233,7 +250,7 @@ u8 const Z2MdnPrm::sHostilityTail[7] = {
|
||||
};
|
||||
|
||||
/* 8039C718-8039C784 028D78 006A+02 1/0 0/0 0/0 .rodata sTired__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sTired[106] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sTired[53] = {
|
||||
0x70, 0x70, 0x70, 0x5C, 0x5C, 0x5C, 0x6F, 0x6F, 0x6F, 0x93, 0x8C, 0x9A, 0x9D, 0x89, 0x99, 0x7A,
|
||||
0x91, 0x8D, 0x8D, 0x8D, 0x8D, 0x69, 0x69, 0x72, 0x72, 0x65, 0x65, 0x65, 0x9E, 0x98, 0x98, 0x2A,
|
||||
0x50, 0x54, 0x54, 0x49, 0x64, 0x59, 0x59, 0x62, 0x62, 0x62, 0x44, 0x5E, 0x9F, 0x91, 0x63, 0x63,
|
||||
@@ -249,7 +266,7 @@ u8 const Z2MdnPrm::sTiredTail[8] = {
|
||||
};
|
||||
|
||||
/* 8039C784-8039C7F0 028DE4 006A+02 1/0 0/0 0/0 .rodata sSerious__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sSerious[106] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sSerious[53] = {
|
||||
0x52, 0x65, 0x65, 0x72, 0x5A, 0x61, 0x61, 0x7B, 0x80, 0x92, 0x93, 0x9D, 0x9D, 0x70, 0x79, 0x76,
|
||||
0x62, 0x57, 0x5A, 0x53, 0x53, 0x59, 0x59, 0x65, 0x63, 0x60, 0x60, 0x6A, 0x83, 0x80, 0x7F, 0x5D,
|
||||
0x5C, 0x45, 0x5D, 0x71, 0x72, 0x65, 0x65, 0x65, 0x66, 0x4B, 0xB2, 0x60, 0x5C, 0x5C, 0x5C, 0x5B,
|
||||
@@ -265,7 +282,7 @@ u8 const Z2MdnPrm::sSeriousTail[7] = {
|
||||
};
|
||||
|
||||
/* 8039C7F0-8039C844 028E50 0054+00 1/0 0/0 0/0 .rodata sReplyb__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sReplyb[84] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sReplyb[42] = {
|
||||
0x5C, 0x45, 0x45, 0x71, 0x9F, 0x57, 0xB4, 0xB4, 0x56, 0x62, 0x8E, 0x61, 0x61, 0xB0,
|
||||
0xB0, 0x3C, 0x59, 0x4A, 0x64, 0xA4, 0xA4, 0x5A, 0x5A, 0x5A, 0x5A, 0x72, 0x72, 0x4B,
|
||||
0x6B, 0x97, 0x97, 0x59, 0x60, 0x60, 0x60, 0x69, 0x3E, 0x3E, 0x57, 0x42, 0x5E, 0x76,
|
||||
@@ -280,7 +297,7 @@ u8 const Z2MdnPrm::sReplybTail[7] = {
|
||||
};
|
||||
|
||||
/* 8039C844-8039C8A8 028EA4 0064+00 1/0 0/0 0/0 .rodata sApologize__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sApologize[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sApologize[50] = {
|
||||
0x6A, 0x6A, 0x6A, 0x51, 0x51, 0x51, 0x51, 0x51, 0x51, 0x51, 0x57, 0x57, 0x57, 0x63, 0x61,
|
||||
0x54, 0x54, 0x54, 0x54, 0x58, 0x58, 0x58, 0x58, 0x45, 0x45, 0x56, 0x56, 0x5B, 0x5B, 0x37,
|
||||
0x53, 0x53, 0x53, 0x59, 0x59, 0x59, 0x49, 0x58, 0x58, 0x55, 0x56, 0x56, 0x83, 0x7F, 0x7F,
|
||||
@@ -296,7 +313,7 @@ u8 const Z2MdnPrm::sApologizeTail[9] = {
|
||||
};
|
||||
|
||||
/* 8039C8B4-8039C918 028F14 0064+00 1/0 0/0 0/0 .rodata sDeside__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sDeside[100] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sDeside[50] = {
|
||||
0x77, 0x77, 0x77, 0x58, 0x58, 0x6F, 0x78, 0x5F, 0x66, 0x5E, 0x6E, 0x62, 0x62, 0x2E, 0x5A,
|
||||
0x58, 0x54, 0x52, 0x52, 0x5C, 0x59, 0x56, 0x56, 0x4B, 0x4B, 0x63, 0x63, 0x4D, 0x4E, 0x4A,
|
||||
0x69, 0x71, 0x71, 0x76, 0x80, 0x80, 0x80, 0x73, 0x73, 0x5C, 0x7C, 0x64, 0x83, 0x89, 0x89,
|
||||
@@ -312,7 +329,7 @@ u8 const Z2MdnPrm::sDesideTail[8] = {
|
||||
};
|
||||
|
||||
/* 8039C918-8039C980 028F78 0068+00 1/0 0/0 0/0 .rodata sAfford__8Z2MdnPrm */
|
||||
u8 const Z2MdnPrm::sAfford[104] = {
|
||||
Z2MdnPrm::Unit const Z2MdnPrm::sAfford[52] = {
|
||||
0x4E, 0x45, 0x52, 0x5B, 0x56, 0x5B, 0x59, 0x52, 0x52, 0x57, 0x5C, 0x50, 0x50, 0x49, 0x80,
|
||||
0x6E, 0x6E, 0x5A, 0x5C, 0x60, 0x6A, 0x62, 0x62, 0x6A, 0x71, 0x48, 0x4C, 0x5B, 0x5A, 0x40,
|
||||
0x40, 0x49, 0x49, 0x50, 0x51, 0x51, 0x51, 0x3A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x57, 0x57,
|
||||
@@ -328,24 +345,24 @@ u8 const Z2MdnPrm::sAffordTail[12] = {
|
||||
};
|
||||
|
||||
/* 8039C98C-8039CA58 -00001 00CC+00 2/2 0/0 0/0 .rodata sPrm__8Z2MdnPrm */
|
||||
sPrmStruct const Z2MdnPrm::sPrm[17] = {
|
||||
{ Z2MdnPrm::sReply, Z2MdnPrm::sReplyTail, 0x32, 0x06, 0x04, 0x00},
|
||||
{ Z2MdnPrm::sJoke, Z2MdnPrm::sJokeTail, 0x32, 0x03, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sSexy, Z2MdnPrm::sSexyTail, 0x32, 0x03, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sRidicule, Z2MdnPrm::sRidiculeTail, 0x32, 0x03, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sBoring, Z2MdnPrm::sBoringTail, 0x36, 0x01, 0x05, 0x00},
|
||||
{ Z2MdnPrm::sIrritated, Z2MdnPrm::sIrritatedTail, 0x2F, 0x03, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sOrder, Z2MdnPrm::sOrderTail, 0x39, 0x02, 0x04, 0x00},
|
||||
{ Z2MdnPrm::sResent, Z2MdnPrm::sResentTail, 0x35, 0x02, 0x03, 0x00},
|
||||
{ Z2MdnPrm::sCheerful, Z2MdnPrm::sCheerfulTail, 0x35, 0x01, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sConfused, Z2MdnPrm::sConfusedTail, 0x35, 0x03, 0x02, 0x00},
|
||||
{ Z2MdnPrm::sHostility, Z2MdnPrm::sHostilityTail, 0x34, 0x02, 0x05, 0x00},
|
||||
{ Z2MdnPrm::sTired, Z2MdnPrm::sTiredTail, 0x35, 0x03, 0x05, 0x00},
|
||||
{ Z2MdnPrm::sSerious, Z2MdnPrm::sSeriousTail, 0x35, 0x02, 0x05, 0x00},
|
||||
{ Z2MdnPrm::sReplyb, Z2MdnPrm::sReplybTail, 0x2A, 0x04, 0x03, 0x00},
|
||||
{ Z2MdnPrm::sApologize, Z2MdnPrm::sApologizeTail, 0x32, 0x04, 0x05, 0x00},
|
||||
{ Z2MdnPrm::sDeside, Z2MdnPrm::sDesideTail, 0x32, 0x01, 0x07, 0x00},
|
||||
{ Z2MdnPrm::sAfford, Z2MdnPrm::sAffordTail, 0x34, 0x02, 0x0A, 0x00},
|
||||
const Z2MdnPrm::Prm Z2MdnPrm::sPrm[17] = {
|
||||
{Z2MdnPrm::sReply, Z2MdnPrm::sReplyTail, ARRAY_SIZE(Z2MdnPrm::sReply), 6, 4},
|
||||
{Z2MdnPrm::sJoke, Z2MdnPrm::sJokeTail, ARRAY_SIZE(Z2MdnPrm::sJoke), 3, 7},
|
||||
{Z2MdnPrm::sSexy, Z2MdnPrm::sSexyTail, ARRAY_SIZE(Z2MdnPrm::sSexy), 3, 7},
|
||||
{Z2MdnPrm::sRidicule, Z2MdnPrm::sRidiculeTail, ARRAY_SIZE(Z2MdnPrm::sRidicule), 3, 7},
|
||||
{Z2MdnPrm::sBoring, Z2MdnPrm::sBoringTail, ARRAY_SIZE(Z2MdnPrm::sBoring), 1, 5},
|
||||
{Z2MdnPrm::sIrritated, Z2MdnPrm::sIrritatedTail, ARRAY_SIZE(Z2MdnPrm::sIrritated), 3, 7},
|
||||
{Z2MdnPrm::sOrder, Z2MdnPrm::sOrderTail, ARRAY_SIZE(Z2MdnPrm::sOrder), 2, 4},
|
||||
{Z2MdnPrm::sResent, Z2MdnPrm::sResentTail, ARRAY_SIZE(Z2MdnPrm::sResent), 2, 3},
|
||||
{Z2MdnPrm::sCheerful, Z2MdnPrm::sCheerfulTail, ARRAY_SIZE(Z2MdnPrm::sCheerful), 1, 7},
|
||||
{Z2MdnPrm::sConfused, Z2MdnPrm::sConfusedTail, ARRAY_SIZE(Z2MdnPrm::sConfused), 3, 2},
|
||||
{Z2MdnPrm::sHostility, Z2MdnPrm::sHostilityTail, ARRAY_SIZE(Z2MdnPrm::sHostility), 2, 5},
|
||||
{Z2MdnPrm::sTired, Z2MdnPrm::sTiredTail, ARRAY_SIZE(Z2MdnPrm::sTired), 3, 5},
|
||||
{Z2MdnPrm::sSerious, Z2MdnPrm::sSeriousTail, ARRAY_SIZE(Z2MdnPrm::sSerious), 2, 5},
|
||||
{Z2MdnPrm::sReplyb, Z2MdnPrm::sReplybTail, ARRAY_SIZE(Z2MdnPrm::sReplyb), 4, 3},
|
||||
{Z2MdnPrm::sApologize, Z2MdnPrm::sApologizeTail, ARRAY_SIZE(Z2MdnPrm::sApologize), 4, 5},
|
||||
{Z2MdnPrm::sDeside, Z2MdnPrm::sDesideTail, ARRAY_SIZE(Z2MdnPrm::sDeside), 1, 7},
|
||||
{Z2MdnPrm::sAfford, Z2MdnPrm::sAffordTail, ARRAY_SIZE(Z2MdnPrm::sAfford), 2, 10},
|
||||
};
|
||||
|
||||
/* 802CBC60-802CBCEC 2C65A0 008C+00 0/0 1/1 0/0 .text __ct__12Z2SpeechMgr2Fv */
|
||||
@@ -356,6 +373,7 @@ Z2SpeechMgr2::Z2SpeechMgr2() : JASGlobalInstance<Z2SpeechMgr2>(true), random(0)
|
||||
mVoice = 0;
|
||||
field_0x3ff = 0;
|
||||
field_0x401 = 0;
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
field_0x402[i] = -1;
|
||||
}
|
||||
@@ -363,8 +381,8 @@ Z2SpeechMgr2::Z2SpeechMgr2() : JASGlobalInstance<Z2SpeechMgr2>(true), random(0)
|
||||
|
||||
/* 802CBD88-802CBF60 2C66C8 01D8+00 1/0 1/1 0/0 .text setString__12Z2SpeechMgr2FPCUssUcUs
|
||||
*/
|
||||
void Z2SpeechMgr2::setString(u16 const* s, s16 i_textNum, u8 i_speaker, u16 i_mood) {
|
||||
switch (i_speaker) {
|
||||
void Z2SpeechMgr2::setString(const u16* s, s16 textNum, u8 speakerID, u16 mood) {
|
||||
switch (speakerID) {
|
||||
case 0x13:
|
||||
case 0x15:
|
||||
mVoice = 1;
|
||||
@@ -467,19 +485,19 @@ void Z2SpeechMgr2::setString(u16 const* s, s16 i_textNum, u8 i_speaker, u16 i_mo
|
||||
}
|
||||
|
||||
if (mVoice == 1 || mVoice == 2) {
|
||||
if (i_mood == 0) {
|
||||
if (mood == 0) {
|
||||
mMood = 0;
|
||||
} else {
|
||||
if (i_mood > 17) {
|
||||
if (mood > 17) {
|
||||
if ((mVoice == 21) || (mVoice == 20)) {
|
||||
mMood = 0;
|
||||
}
|
||||
} else {
|
||||
mMood = i_mood - 1;
|
||||
mMood = mood - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mMood = i_mood;
|
||||
mMood = mood;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 500; i++) {
|
||||
@@ -488,18 +506,19 @@ void Z2SpeechMgr2::setString(u16 const* s, s16 i_textNum, u8 i_speaker, u16 i_mo
|
||||
|
||||
JUT_ASSERT(383, s != NULL);
|
||||
|
||||
if (i_textNum > 500) {
|
||||
if (textNum > 500) {
|
||||
mTextNum = 500;
|
||||
JUT_WARN_DEVICE(387, 1, "TOO MANY TEXT : now(%d) > max(%d)", i_textNum, 500);
|
||||
JUT_WARN_DEVICE(387, 1, "TOO MANY TEXT : now(%d) > max(%d)", textNum, 500);
|
||||
} else {
|
||||
mTextNum = i_textNum;
|
||||
mTextNum = textNum;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
for (int i = 0; i <= mTextNum; i++) {
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
for (int i = 0; i <= mTextNum; i++)
|
||||
#else
|
||||
for (int i = 0; i < mTextNum; i++) {
|
||||
for (int i = 0; i < mTextNum; i++)
|
||||
#endif
|
||||
{
|
||||
mText[i] = s[i];
|
||||
}
|
||||
|
||||
@@ -516,22 +535,24 @@ void Z2SpeechMgr2::setString(u16 const* s, s16 i_textNum, u8 i_speaker, u16 i_mo
|
||||
}
|
||||
|
||||
/* 802CBF60-802CC190 2C68A0 0230+00 1/0 2/2 0/0 .text setTextCount__12Z2SpeechMgr2Fs */
|
||||
void Z2SpeechMgr2::setTextCount(s16 i_textCount) {
|
||||
void Z2SpeechMgr2::setTextCount(s16 textCount) {
|
||||
if (mVoice != 99) {
|
||||
field_0x3ff = 0x0;
|
||||
|
||||
#ifndef DEBUG
|
||||
i_textCount = (i_textCount == 0) ? 0 : i_textCount - 1;
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
textCount = (textCount == 0) ? 0 : textCount - 1;
|
||||
#endif
|
||||
|
||||
bool all_text = false;
|
||||
if (mTextCount == 0 && i_textCount >= mTextNum) {
|
||||
if (mTextCount == 0 && textCount >= mTextNum) {
|
||||
all_text = true;
|
||||
}
|
||||
mTextCount = i_textCount;
|
||||
|
||||
mTextCount = textCount;
|
||||
if (mTextCount >= mTextNum) {
|
||||
mTextCount = mTextNum;
|
||||
}
|
||||
|
||||
if (mVoice == 1 || mVoice == 2) {
|
||||
if (!field_0x0.isSoundAttached()) {
|
||||
speakOneWord(false);
|
||||
@@ -576,8 +597,8 @@ void Z2SpeechMgr2::setTextCount(s16 i_textCount) {
|
||||
sound_id = Z2SE_SY_TEXT_OUT_ZANT;
|
||||
break;
|
||||
}
|
||||
mSpeech.startSound(sound_id, &field_0x4, NULL, 0, 0.0f, 1.0f, 1.0f, -1.0f, -1.0f,
|
||||
0);
|
||||
|
||||
mSpeech.startSound(sound_id, &field_0x4, NULL, 0, 0.0f, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -594,11 +615,12 @@ void Z2SpeechMgr2::speakOneWord(bool param_0) {
|
||||
} else if (isNonVerbal()) {
|
||||
return;
|
||||
}
|
||||
u32 sound = mMood + Z2SE_HYL_MDN_RPLY;
|
||||
f32 fVar1 = Z2GetSceneMgr()->getRoomReverb() / 127.0f;
|
||||
bool soundStarted =
|
||||
mSpeech.startSound(sound, &field_0x0, NULL, 0, fVar1, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
|
||||
u32 soundID = mMood + Z2SE_HYL_MDN_RPLY;
|
||||
f32 fxMix = Z2GetSceneMgr()->getRoomReverb() / 127.0f;
|
||||
bool soundStarted = mSpeech.startSound(soundID, &field_0x0, NULL, 0, fxMix, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
mSpeech.setPortData(&field_0x0, 8, field_0x402[field_0x401 - 1] + 1, -1);
|
||||
|
||||
if (field_0x400 == 0) {
|
||||
selectUnit(param_0);
|
||||
}
|
||||
@@ -608,39 +630,39 @@ void Z2SpeechMgr2::speakOneWord(bool param_0) {
|
||||
/* 802CC2FC-802CC4C0 2C6C3C 01C4+00 2/2 0/0 0/0 .text isNonVerbal__12Z2SpeechMgr2Fv */
|
||||
bool Z2SpeechMgr2::isNonVerbal() {
|
||||
switch(mText[mTextCount]) {
|
||||
case 0:
|
||||
case 0x20:
|
||||
case 0x21:
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
case 0x24:
|
||||
case 0x25:
|
||||
case 0x26:
|
||||
case 0x27:
|
||||
case 0x28:
|
||||
case 0x29:
|
||||
case 0x2a:
|
||||
case 0x2b:
|
||||
case 0x2c:
|
||||
case 0x2d:
|
||||
case 0x2e:
|
||||
case 0x2f:
|
||||
case 0x3a:
|
||||
case 0x3b:
|
||||
case 0x3c:
|
||||
case 0x3d:
|
||||
case 0x3e:
|
||||
case 0x3f:
|
||||
case 0x4b:
|
||||
case 0x4c:
|
||||
case 0x4d:
|
||||
case 0x4e:
|
||||
case 0x4f:
|
||||
case 0x5b:
|
||||
case 0x5c:
|
||||
case 0x5d:
|
||||
case 0x5e:
|
||||
case 0x5f:
|
||||
case '\0':
|
||||
case ' ':
|
||||
case '!':
|
||||
case '\"':
|
||||
case '#':
|
||||
case '$':
|
||||
case '%':
|
||||
case '&':
|
||||
case '\'':
|
||||
case '(':
|
||||
case ')':
|
||||
case '*':
|
||||
case '+':
|
||||
case ',':
|
||||
case '-':
|
||||
case '.':
|
||||
case '/':
|
||||
case ':':
|
||||
case ';':
|
||||
case '<':
|
||||
case '=':
|
||||
case '>':
|
||||
case '?':
|
||||
case 'K':
|
||||
case 'L':
|
||||
case 'M':
|
||||
case 'N':
|
||||
case 'O':
|
||||
case '[':
|
||||
case '\\':
|
||||
case ']':
|
||||
case '^':
|
||||
case '_':
|
||||
case 0x813f:
|
||||
case 0x8140:
|
||||
case 0x8141:
|
||||
@@ -681,7 +703,8 @@ bool Z2SpeechMgr2::isNonVerbal() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(mText[mTextCount] == 0x0a) {
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
if(mText[mTextCount] == 0xA) {
|
||||
switch (mVoice) {
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -690,11 +713,13 @@ bool Z2SpeechMgr2::isNonVerbal() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
s8 field_0x0;
|
||||
s8 unitIndex;
|
||||
u8 field_0x1;
|
||||
} Z2ConnectCost;
|
||||
|
||||
@@ -707,7 +732,7 @@ void Z2SpeechMgr2::selectUnit(bool param_0) {
|
||||
return;
|
||||
}
|
||||
|
||||
s8 ZVar2 = random.get_uint8(Z2MdnPrm::sPrm[mMood].field_0x8);
|
||||
s8 unitIndex = random.get_uint8(Z2MdnPrm::sPrm[mMood].mainNum);
|
||||
s8 ZVar3;
|
||||
s8 cVar5;
|
||||
|
||||
@@ -717,10 +742,10 @@ void Z2SpeechMgr2::selectUnit(bool param_0) {
|
||||
|
||||
while (true) {
|
||||
bool bVar1 = false;
|
||||
ZVar2 = random.get_uint8(Z2MdnPrm::sPrm[mMood].field_0x8);
|
||||
unitIndex = random.get_uint8(Z2MdnPrm::sPrm[mMood].mainNum);
|
||||
|
||||
for (int i = 0; i < field_0x401; i++) {
|
||||
if (field_0x402[i] == ZVar2) {
|
||||
if (field_0x402[i] == unitIndex) {
|
||||
bVar1 = true;
|
||||
break;
|
||||
}
|
||||
@@ -731,7 +756,7 @@ void Z2SpeechMgr2::selectUnit(bool param_0) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < cVar5; i++) {
|
||||
if (ZVar2 == cost[i].field_0x0) {
|
||||
if (unitIndex == cost[i].unitIndex) {
|
||||
bVar1 = true;
|
||||
break;
|
||||
}
|
||||
@@ -741,9 +766,9 @@ void Z2SpeechMgr2::selectUnit(bool param_0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const u8 (*prm)[2] = (u8 (*)[2])Z2MdnPrm::sPrm[mMood].field_0x0;
|
||||
u8 local_3f = JMAAbs(prm[ZVar2][0] - prm[ZVar4][1]);
|
||||
Z2ConnectCost connectCost = {ZVar2, local_3f};
|
||||
const Z2MdnPrm::Unit* units = Z2MdnPrm::sPrm[mMood].main;
|
||||
u8 local_3f = JMAAbs(units[unitIndex].start - units[ZVar4].end);
|
||||
Z2ConnectCost connectCost = {unitIndex, local_3f};
|
||||
cost[cVar5] = connectCost;
|
||||
cVar5++;
|
||||
|
||||
@@ -753,16 +778,16 @@ void Z2SpeechMgr2::selectUnit(bool param_0) {
|
||||
}
|
||||
|
||||
u16 tmp = cost[0].field_0x1;
|
||||
ZVar2 = cost[0].field_0x0;
|
||||
unitIndex = cost[0].unitIndex;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (cost[i].field_0x1 < tmp) {
|
||||
tmp = cost[i].field_0x1;
|
||||
ZVar2 = cost[i].field_0x0;
|
||||
unitIndex = cost[i].unitIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
field_0x402[field_0x401] = ZVar2;
|
||||
field_0x402[field_0x401] = unitIndex;
|
||||
field_0x401++;
|
||||
}
|
||||
|
||||
@@ -772,34 +797,33 @@ void Z2SpeechMgr2::selectTail() {
|
||||
s8 cVar9 = 0;
|
||||
s8 ZVar1 = field_0x402[field_0x401 - 1];
|
||||
s8 ZVar6;
|
||||
u8 bVar3;
|
||||
u8 bVar3 = 0;
|
||||
|
||||
while (true) {
|
||||
bool bVar5 = false;
|
||||
|
||||
switch (mVoice) {
|
||||
case 2:
|
||||
bVar3 = Z2MdnPrm::sPrm[mMood].field_0x9;
|
||||
bVar3 = Z2MdnPrm::sPrm[mMood].tailNum1;
|
||||
ZVar6 = random.get_uint8(bVar3);
|
||||
break;
|
||||
case 1:
|
||||
bVar3 = Z2MdnPrm::sPrm[mMood].field_0xa;
|
||||
ZVar6 = Z2MdnPrm::sPrm[mMood].field_0x9 + random.get_uint8(bVar3);
|
||||
bVar3 = Z2MdnPrm::sPrm[mMood].tailNum2;
|
||||
ZVar6 = Z2MdnPrm::sPrm[mMood].tailNum1 + random.get_uint8(bVar3);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < cVar9; i++) {
|
||||
if (ZVar6 == cost[i].field_0x0) {
|
||||
if (ZVar6 == cost[i].unitIndex) {
|
||||
bVar5 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bVar5) {
|
||||
u8 local_3f = JMAAbs(Z2MdnPrm::sPrm[mMood].field_0x4[ZVar6]
|
||||
- Z2MdnPrm::sPrm[mMood].field_0x0[ZVar1 * 2 + 1]);
|
||||
u8 local_3f = JMAAbs(Z2MdnPrm::sPrm[mMood].tail[ZVar6] - Z2MdnPrm::sPrm[mMood].main[ZVar1].end);
|
||||
Z2ConnectCost connectCost = {ZVar6, local_3f};
|
||||
cost[cVar9] = connectCost;
|
||||
cVar9++;
|
||||
@@ -807,15 +831,15 @@ void Z2SpeechMgr2::selectTail() {
|
||||
if (cVar9 == bVar3 || cVar9 == 5) {
|
||||
s8 tmp_r8;
|
||||
u16 tmp_r9 = cost[0].field_0x1;
|
||||
tmp_r8 = cost[0].field_0x0;
|
||||
int local_3c = bVar3 >= 5 ? 5 : bVar3;
|
||||
tmp_r8 = cost[0].unitIndex;
|
||||
int local_3c = bVar3 < 5 ? bVar3 : 5;
|
||||
for (int i = 0; i < local_3c; i++) {
|
||||
if (cost[i].field_0x1 < tmp_r9) {
|
||||
tmp_r9 = cost[i].field_0x1;
|
||||
tmp_r8 = cost[i].field_0x0;
|
||||
tmp_r8 = cost[i].unitIndex;
|
||||
}
|
||||
}
|
||||
field_0x402[field_0x401 - 1] = tmp_r8 + Z2MdnPrm::sPrm[mMood].field_0x8;
|
||||
field_0x402[field_0x401 - 1] = tmp_r8 + Z2MdnPrm::sPrm[mMood].mainNum;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -841,15 +865,15 @@ void Z2SpeechMgr2::framework() {
|
||||
|
||||
/* 802CCA18-802CCF88 2C7358 0570+00 0/0 2/2 0/0 .text playOneShotVoice__12Z2SpeechMgr2FUcUsP3VecSc
|
||||
*/
|
||||
void Z2SpeechMgr2::playOneShotVoice(u8 i_speaker, u16 param_1, Vec* i_pos, s8 param_3) {
|
||||
if (i_speaker == 0) {
|
||||
void Z2SpeechMgr2::playOneShotVoice(u8 speakerID, u16 param_1, Vec* posPtr, s8 param_3) {
|
||||
if (speakerID == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
f32 fxmix = Z2GetSceneMgr()->getRoomReverb() / 127.0f;
|
||||
|
||||
if (mVoice == 1 || mVoice == 2) {
|
||||
JAISoundID sound_id;
|
||||
JAISoundID sound_id(-1);
|
||||
switch (param_1) {
|
||||
case 25:
|
||||
sound_id = Z2SE_MSG_V_MDN_D21;
|
||||
@@ -883,13 +907,13 @@ void Z2SpeechMgr2::playOneShotVoice(u8 i_speaker, u16 param_1, Vec* i_pos, s8 pa
|
||||
}
|
||||
|
||||
if (sound_id != -1) {
|
||||
mSpeech.startSound(sound_id, &field_0x0, (JGeometry::TVec3<f32>*)i_pos,
|
||||
i_speaker, fxmix, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
mSpeech.startSound(sound_id, &field_0x0, (JGeometry::TVec3<f32>*)posPtr,
|
||||
speakerID, fxmix, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
JAISoundID sound_id = Z2SE_MESSAGE_SE_COMMON;
|
||||
switch (i_speaker) {
|
||||
switch (speakerID) {
|
||||
case 3:
|
||||
if (param_1 == 1) {
|
||||
Z2GetSeqMgr()->subBgmStart(Z2BGM_ITEM_GET_MINI);
|
||||
@@ -987,7 +1011,7 @@ void Z2SpeechMgr2::playOneShotVoice(u8 i_speaker, u16 param_1, Vec* i_pos, s8 pa
|
||||
if (field_0x0) {
|
||||
field_0x0.releaseSound();
|
||||
}
|
||||
mSpeech.startSound(sound_id, &field_0x0, (JGeometry::TVec3<f32>*)i_pos, i_speaker,
|
||||
mSpeech.startSound(sound_id, &field_0x0, (JGeometry::TVec3<f32>*)posPtr, speakerID,
|
||||
fxmix, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
if (field_0x0) {
|
||||
mSpeech.setPortData(&field_0x0, 8, param_1, -1);
|
||||
@@ -1000,6 +1024,7 @@ bool Z2SpeechMgr2::isMidnaSpeak() {
|
||||
if ((mVoice == 1 || mVoice == 2) && field_0x0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1008,48 +1033,48 @@ Z2SpeechStarter::Z2SpeechStarter() : Z2SoundStarter(false) {}
|
||||
|
||||
/* 802CCFF8-802CD248 2C7938 0250+00 1/0 0/0 0/0 .text
|
||||
* startSound__15Z2SpeechStarterF10JAISoundIDP14JAISoundHandlePCQ29JGeometry8TVec3<f>UlfffffUl */
|
||||
bool Z2SpeechStarter::startSound(JAISoundID i_soundID, JAISoundHandle* i_handle,
|
||||
JGeometry::TVec3<f32> const* i_pos, u32 param_3, f32 i_fxmix,
|
||||
f32 i_pitch, f32 i_volume, f32 i_pan, f32 i_dolby, u32 i_count) {
|
||||
bool Z2SpeechStarter::startSound(JAISoundID soundID, JAISoundHandle* handlePtr,
|
||||
const JGeometry::TVec3<f32>* posPtr, u32 portData, f32 fxmix,
|
||||
f32 pitch, f32 volume, f32 pan, f32 dolby, u32 moveSteps) {
|
||||
JUT_ASSERT(1076, handlePtr);
|
||||
|
||||
if (Z2GetSceneMgr()->isInDarkness() && Z2GetSceneMgr()->getDemoSeWaveNum() != 0x77
|
||||
&& Z2GetSceneMgr()->getDemoSeWaveNum() != 0x78) {
|
||||
i_fxmix = 1.0f;
|
||||
fxmix = 1.0f;
|
||||
} else {
|
||||
f32 tmp = Z2GetStatusMgr()->getCameraInWaterDepthRatio() > 0.0f;
|
||||
if (tmp) {
|
||||
i_fxmix = tmp;
|
||||
} else if (Z2GetSceneMgr()->getDemoSeWaveNum() == 0x6c
|
||||
|| Z2GetSceneMgr()->getDemoSeWaveNum() == 0x77)
|
||||
{
|
||||
i_fxmix = 0.07f;
|
||||
fxmix = tmp;
|
||||
} else if (Z2GetSceneMgr()->getDemoSeWaveNum() == 0x6c || Z2GetSceneMgr()->getDemoSeWaveNum() == 0x77) {
|
||||
fxmix = 0.07f;
|
||||
} else {
|
||||
i_fxmix += Z2GetEnvSeMgr()->getFogDensity() * 0.5f;
|
||||
if (i_fxmix > 1.0f) {
|
||||
i_fxmix = 1.0f;
|
||||
fxmix += Z2GetEnvSeMgr()->getFogDensity() * 0.5f;
|
||||
if (fxmix > 1.0f) {
|
||||
fxmix = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ret = Z2GetAudioMgr()->startSound(i_soundID, i_handle, i_pos);
|
||||
bool ret = Z2GetAudioMgr()->startSound(soundID, handlePtr, posPtr);
|
||||
|
||||
if (*i_handle) {
|
||||
if (param_3 != 0) {
|
||||
setPortData(i_handle, 6, param_3, -1);
|
||||
if (*handlePtr) {
|
||||
if (portData != 0) {
|
||||
setPortData(handlePtr, 6, portData, -1);
|
||||
}
|
||||
if (i_fxmix > 0.0f) {
|
||||
(*i_handle)->getAuxiliary().moveFxMix(i_fxmix, i_count);
|
||||
if (fxmix > 0.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveFxMix(fxmix, moveSteps);
|
||||
}
|
||||
if (i_pitch != 1.0f) {
|
||||
(*i_handle)->getAuxiliary().movePitch(i_pitch, i_count);
|
||||
if (pitch != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePitch(pitch, moveSteps);
|
||||
}
|
||||
if (i_volume != 1.0f) {
|
||||
(*i_handle)->getAuxiliary().moveVolume(i_volume, i_count);
|
||||
if (volume != 1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveVolume(volume, moveSteps);
|
||||
}
|
||||
if (i_pan != -1.0f) {
|
||||
(*i_handle)->getAuxiliary().movePan(i_pan, i_count);
|
||||
if (pan != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().movePan(pan, moveSteps);
|
||||
}
|
||||
if (i_dolby != -1.0f) {
|
||||
(*i_handle)->getAuxiliary().moveDolby(i_dolby, i_count);
|
||||
if (dolby != -1.0f) {
|
||||
(*handlePtr)->getAuxiliary().moveDolby(dolby, moveSteps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+113
-106
@@ -1,15 +1,94 @@
|
||||
//
|
||||
// Z2StatusMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2StatusMgr.h"
|
||||
#include "Z2AudioLib/Z2Creature.h"
|
||||
#include "Z2AudioLib/Z2Param.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_s_play.h"
|
||||
|
||||
static const char* sSpotName[] = {
|
||||
"F_SP00",
|
||||
"F_SP103",
|
||||
"R_SP01",
|
||||
"F_SP104",
|
||||
"R_SP107",
|
||||
"F_SP108",
|
||||
"R_SP108",
|
||||
"F_SP117",
|
||||
"F_SP109",
|
||||
"R_SP109",
|
||||
"R_SP209",
|
||||
"F_SP110",
|
||||
"R_SP110",
|
||||
"F_SP111",
|
||||
"F_SP128",
|
||||
"R_SP128",
|
||||
"F_SP115",
|
||||
"F_SP112",
|
||||
"F_SP126",
|
||||
"F_SP127",
|
||||
"R_SP127",
|
||||
"F_SP113",
|
||||
"F_SP116",
|
||||
"R_SP116",
|
||||
"R_SP160",
|
||||
"R_SP161",
|
||||
"F_SP114",
|
||||
"F_SP118",
|
||||
"F_SP124",
|
||||
"F_SP125",
|
||||
"F_SP121",
|
||||
"F_SP122",
|
||||
"F_SP123",
|
||||
"F_SP200",
|
||||
"F_SP102",
|
||||
"",
|
||||
"R_SP300",
|
||||
"R_SP301",
|
||||
"T_ENEMY",
|
||||
"D_MN54",
|
||||
"D_MN05",
|
||||
"D_MN05B",
|
||||
"D_MN05A",
|
||||
"D_MN04",
|
||||
"D_MN04B",
|
||||
"D_MN04A",
|
||||
"D_MN01",
|
||||
"D_MN01B",
|
||||
"D_MN01A",
|
||||
"D_MN10",
|
||||
"D_MN10B",
|
||||
"D_MN10A",
|
||||
"D_MN11",
|
||||
"D_MN11B",
|
||||
"D_MN11A",
|
||||
"D_MN06",
|
||||
"D_MN06B",
|
||||
"D_MN06A",
|
||||
"D_MN07",
|
||||
"D_MN07B",
|
||||
"D_MN07A",
|
||||
"D_MN08",
|
||||
"D_MN08B",
|
||||
"D_MN08C",
|
||||
"D_MN08A",
|
||||
"D_MN08D",
|
||||
"D_MN09",
|
||||
"D_MN09A",
|
||||
"D_MN09B",
|
||||
"D_MN09C",
|
||||
"D_SB00",
|
||||
"D_SB01",
|
||||
"D_SB02",
|
||||
"D_SB03",
|
||||
"D_SB04",
|
||||
"D_SB05",
|
||||
"D_SB06",
|
||||
"D_SB07",
|
||||
"D_SB08",
|
||||
"D_SB09",
|
||||
"D_SB10",
|
||||
};
|
||||
|
||||
/* 802B5F1C-802B5F70 2B085C 0054+00 0/0 1/1 0/0 .text __ct__11Z2StatusMgrFv */
|
||||
Z2StatusMgr::Z2StatusMgr() : JASGlobalInstance(this) {
|
||||
Z2StatusMgr::Z2StatusMgr() : JASGlobalInstance(true) {
|
||||
mHour = 0;
|
||||
mMinute = 0;
|
||||
mWeekday = 0;
|
||||
@@ -45,13 +124,16 @@ void Z2StatusMgr::processHeartGaugeSound() {
|
||||
if (Z2GetLink() == NULL) {
|
||||
return;
|
||||
}
|
||||
u32 linkHp = Z2GetLink()->getLinkHp();
|
||||
|
||||
u8 linkHp = Z2GetLink()->getLinkHp();
|
||||
if (linkHp == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Z2GetSeqMgr()->isItemGetDemo()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (linkHp <= 2) {
|
||||
Z2GetSeMgr()->seStartLevel(Z2SE_ALMOST_DIE_ALERM_3, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
} else if (linkHp <= 4) {
|
||||
@@ -99,90 +181,6 @@ bool Z2StatusMgr::isMovieDemo() {
|
||||
return mDemoStatus == 2 || mDemoStatus == 8 || mDemoStatus == 9;
|
||||
}
|
||||
|
||||
static void dummyStrings() {
|
||||
DEAD_STRING("F_SP00");
|
||||
DEAD_STRING("F_SP103");
|
||||
DEAD_STRING("R_SP01");
|
||||
DEAD_STRING("F_SP104");
|
||||
DEAD_STRING("R_SP107");
|
||||
DEAD_STRING("F_SP108");
|
||||
DEAD_STRING("R_SP108");
|
||||
DEAD_STRING("F_SP117");
|
||||
DEAD_STRING("F_SP109");
|
||||
DEAD_STRING("R_SP109");
|
||||
DEAD_STRING("R_SP209");
|
||||
DEAD_STRING("F_SP110");
|
||||
DEAD_STRING("R_SP110");
|
||||
DEAD_STRING("F_SP111");
|
||||
DEAD_STRING("F_SP128");
|
||||
DEAD_STRING("R_SP128");
|
||||
DEAD_STRING("F_SP115");
|
||||
DEAD_STRING("F_SP112");
|
||||
DEAD_STRING("F_SP126");
|
||||
DEAD_STRING("F_SP127");
|
||||
DEAD_STRING("R_SP127");
|
||||
DEAD_STRING("F_SP113");
|
||||
DEAD_STRING("F_SP116");
|
||||
DEAD_STRING("R_SP116");
|
||||
DEAD_STRING("R_SP160");
|
||||
DEAD_STRING("R_SP161");
|
||||
DEAD_STRING("F_SP114");
|
||||
DEAD_STRING("F_SP118");
|
||||
DEAD_STRING("F_SP124");
|
||||
DEAD_STRING("F_SP125");
|
||||
DEAD_STRING("F_SP121");
|
||||
DEAD_STRING("F_SP122");
|
||||
DEAD_STRING("F_SP123");
|
||||
DEAD_STRING("F_SP200");
|
||||
DEAD_STRING("F_SP102");
|
||||
DEAD_STRING("");
|
||||
DEAD_STRING("R_SP300");
|
||||
DEAD_STRING("R_SP301");
|
||||
DEAD_STRING("T_ENEMY");
|
||||
DEAD_STRING("D_MN54");
|
||||
DEAD_STRING("D_MN05");
|
||||
DEAD_STRING("D_MN05B");
|
||||
DEAD_STRING("D_MN05A");
|
||||
DEAD_STRING("D_MN04");
|
||||
DEAD_STRING("D_MN04B");
|
||||
DEAD_STRING("D_MN04A");
|
||||
DEAD_STRING("D_MN01");
|
||||
DEAD_STRING("D_MN01B");
|
||||
DEAD_STRING("D_MN01A");
|
||||
DEAD_STRING("D_MN10");
|
||||
DEAD_STRING("D_MN10B");
|
||||
DEAD_STRING("D_MN10A");
|
||||
DEAD_STRING("D_MN11");
|
||||
DEAD_STRING("D_MN11B");
|
||||
DEAD_STRING("D_MN11A");
|
||||
DEAD_STRING("D_MN06");
|
||||
DEAD_STRING("D_MN06B");
|
||||
DEAD_STRING("D_MN06A");
|
||||
DEAD_STRING("D_MN07");
|
||||
DEAD_STRING("D_MN07B");
|
||||
DEAD_STRING("D_MN07A");
|
||||
DEAD_STRING("D_MN08");
|
||||
DEAD_STRING("D_MN08B");
|
||||
DEAD_STRING("D_MN08C");
|
||||
DEAD_STRING("D_MN08A");
|
||||
DEAD_STRING("D_MN08D");
|
||||
DEAD_STRING("D_MN09");
|
||||
DEAD_STRING("D_MN09A");
|
||||
DEAD_STRING("D_MN09B");
|
||||
DEAD_STRING("D_MN09C");
|
||||
DEAD_STRING("D_SB00");
|
||||
DEAD_STRING("D_SB01");
|
||||
DEAD_STRING("D_SB02");
|
||||
DEAD_STRING("D_SB03");
|
||||
DEAD_STRING("D_SB04");
|
||||
DEAD_STRING("D_SB05");
|
||||
DEAD_STRING("D_SB06");
|
||||
DEAD_STRING("D_SB07");
|
||||
DEAD_STRING("D_SB08");
|
||||
DEAD_STRING("D_SB09");
|
||||
DEAD_STRING("D_SB10");
|
||||
}
|
||||
|
||||
/* 802B61E8-802B671C 2B0B28 0534+00 1/0 7/7 11/11 .text setDemoName__11Z2StatusMgrFPc */
|
||||
void Z2StatusMgr::setDemoName(char* demoName) {
|
||||
if (mDemoStatus == 11) {
|
||||
@@ -191,20 +189,26 @@ void Z2StatusMgr::setDemoName(char* demoName) {
|
||||
Z2GetSceneMgr()->sceneBgmStart();
|
||||
}
|
||||
}
|
||||
|
||||
if (demoName == NULL) {
|
||||
OS_REPORT("[Z2StatusMgr::setDemoName] → No demo\n");
|
||||
if (mDemoStatus == 3) {
|
||||
Z2GetSeqMgr()->setBattleBgmOff(false);
|
||||
} else if (mDemoStatus == 4) {
|
||||
Z2GetSeqMgr()->unMuteSceneBgm(struct_80450861);
|
||||
Z2GetSeqMgr()->unMuteSceneBgm(Z2Param::BGM_CROSS_FADEIN_TIME);
|
||||
} else if (mDemoStatus == 5) {
|
||||
OS_REPORT("[Z2StatusMgr::setDemoName] HIDDEN_VIL DEMO_END\n");
|
||||
Z2GetSeqMgr()->subBgmStop();
|
||||
} else if (mDemoStatus == 9) {
|
||||
Z2GetSeqMgr()->bgmStreamStop(0x3c);
|
||||
Z2GetSeqMgr()->bgmStreamStop(60);
|
||||
}
|
||||
|
||||
if (mDemoStatus != 8) {
|
||||
mDemoStatus = 0;
|
||||
}
|
||||
} else {
|
||||
OS_REPORT("[Z2StatusMgr::setDemoName] demoName : %s\n", demoName);
|
||||
|
||||
bool bVar1 = false;
|
||||
if (mDemoStatus == 8) {
|
||||
if (strcmp(demoName, "force_end") == 0) {
|
||||
@@ -235,45 +239,47 @@ void Z2StatusMgr::setDemoName(char* demoName) {
|
||||
mDemoStatus = 10;
|
||||
} else {
|
||||
switch (Z2GetSceneMgr()->getCurrentSceneNum()) {
|
||||
case 0xe:
|
||||
case Z2SCENE_HIDDEN_VILLAGE:
|
||||
if (strcmp(demoName, "R00_start") == 0) {
|
||||
mDemoStatus = 5;
|
||||
Z2GetSeqMgr()->subBgmStart(Z2BGM_HIDDEN_VIL_D1);
|
||||
OS_REPORT("[Z2StatusMgr::setDemoName] HIDDEN_VIL DEMO_START\n");
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case Z2SCENE_FARON_WOODS:
|
||||
if (strcmp(demoName, "B_W_START") == 0) {
|
||||
Z2GetSeqMgr()->bgmStreamPrepare(0x200005f);
|
||||
Z2GetSeqMgr()->bgmStreamPlay();
|
||||
mDemoStatus = 9;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case Z2SCENE_TWILIGHT_HYRULE_CASTLE:
|
||||
if (strcmp(demoName, "L0_rampart01") == 0) {
|
||||
bVar1 = true;
|
||||
}
|
||||
break;
|
||||
case 0x28:
|
||||
case Z2SCENE_FOREST_TEMPLE:
|
||||
if (strcmp(demoName, "R22-opening") == 0) {
|
||||
bVar1 = true;
|
||||
}
|
||||
break;
|
||||
case 0x2b:
|
||||
case Z2SCENE_GORON_MINES:
|
||||
if (strcmp(demoName, "R01-start") == 0) {
|
||||
bVar1 = true;
|
||||
}
|
||||
break;
|
||||
case 0x2e:
|
||||
case Z2SCENE_LAKEBED_TEMPLE:
|
||||
if (strcmp(demoName, "LV3R00OP") == 0) {
|
||||
bVar1 = true;
|
||||
}
|
||||
break;
|
||||
case 0x31:
|
||||
case Z2SCENE_ARBITERS_GROUNDS:
|
||||
if (strcmp(demoName, "R00_start") == 0) {
|
||||
bVar1 = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (bVar1) {
|
||||
Z2GetSeqMgr()->setBattleBgmOff(true);
|
||||
mDemoStatus = 3;
|
||||
@@ -300,14 +306,14 @@ bool Z2StatusMgr::checkDayTime() {
|
||||
}
|
||||
|
||||
/* 802B6758-802B6760 -00001 0008+00 0/0 0/0 0/0 .text setEventBit__11Z2StatusMgrFPv */
|
||||
void Z2StatusMgr::setEventBit(void* i_eventBit) {
|
||||
mEventBit = i_eventBit;
|
||||
void Z2StatusMgr::setEventBit(void* eventBit) {
|
||||
mEventBit = eventBit;
|
||||
}
|
||||
|
||||
/* 802B6760-802B6784 2B10A0 0024+00 0/0 1/1 0/0 .text setCameraPolygonPos__11Z2StatusMgrFP3Vec */
|
||||
void Z2StatusMgr::setCameraPolygonPos(Vec* i_polygonPos) {
|
||||
if (i_polygonPos != NULL) {
|
||||
mPolygonPosition = *i_polygonPos;
|
||||
void Z2StatusMgr::setCameraPolygonPos(Vec* polygonPos) {
|
||||
if (polygonPos != NULL) {
|
||||
mPolygonPosition = *polygonPos;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,11 +332,12 @@ void Z2StatusMgr::setCameraInWaterDepth(f32 depth) {
|
||||
mCameraInWaterDepthRatio = 1.0f;
|
||||
} else {
|
||||
mCameraInWaterDepthRatio =
|
||||
Z2Calc::getParamByExp(depth, 0.0f, 2000.0f, 0.2f, 0.0f, 1.0f, Z2Calc::CURVE_SIGN_0);
|
||||
Z2Calc::getParamByExp(depth, 0.0f, 2000.0f, 0.2f, 0.0f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
}
|
||||
Z2GetFxLineMgr()->setUnderWaterFx(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mUnderwaterDepth = depth;
|
||||
}
|
||||
|
||||
+328
-223
@@ -1,9 +1,4 @@
|
||||
//
|
||||
// Z2WolfHowlMgr
|
||||
//
|
||||
|
||||
#include "Z2AudioLib/Z2WolfHowlMgr.h"
|
||||
#include "Z2AudioLib/Z2Creature.h"
|
||||
#include "Z2AudioLib/Z2Calc.h"
|
||||
#include "Z2AudioLib/Z2SeqMgr.h"
|
||||
#include "Z2AudioLib/Z2SeMgr.h"
|
||||
@@ -13,27 +8,27 @@
|
||||
#include "d/d_demo.h"
|
||||
|
||||
/* 80450880-80450884 000300 0004+00 2/2 0/0 0/0 .sdata cPitchDown */
|
||||
static f32 cPitchDown = 0.8909000158309937f;
|
||||
static f32 cPitchDown = 0.8909f;
|
||||
|
||||
/* 80450884-80450888 000304 0004+00 4/4 0/0 0/0 .sdata cPitchCenter */
|
||||
static f32 cPitchCenter = 1.0f;
|
||||
|
||||
/* 80450888-8045088C 000308 0004+00 2/2 0/0 0/0 .sdata cPitchUp */
|
||||
static f32 cPitchUp = 1.1892000436782837f;
|
||||
static f32 cPitchUp = 1.1892f;
|
||||
|
||||
static u8 struct_8045088C = 7;
|
||||
static u8 struct_8045088D = 7;
|
||||
|
||||
/* 8045088E-80450890 00030E 0002+00 4/4 0/0 0/0 .sdata None */
|
||||
static u8 data_8045088E = 0x1E;
|
||||
static u8 data_8045088F = 0x00;
|
||||
static u8 cBeginHowlTime = 30;
|
||||
static u8 data_8045088F = 0;
|
||||
|
||||
/* 80450890-80450894 000310 0004+00 1/1 0/0 0/0 .sdata cR_FlatWidth */
|
||||
static f32 cR_FlatWidth = 0.9438700079917908f;
|
||||
static f32 cR_FlatWidth = 0.94387f; // 1.0f / 12th root of 2
|
||||
|
||||
/* 80450894-80450898 -00001 0004+00 3/3 0/0 0/0 .sdata None */
|
||||
static u8 struct_80450894 = 0x05;
|
||||
static u8 struct_80450895 = 0x1E;
|
||||
static u8 struct_80450894 = 5;
|
||||
static u8 struct_80450895 = 30;
|
||||
|
||||
/* 80450898-8045089C 000318 0004+00 1/1 0/0 0/0 .sdata sStickHigh */
|
||||
static f32 sStickHigh = 0.5f;
|
||||
@@ -42,76 +37,128 @@ static f32 sStickHigh = 0.5f;
|
||||
static f32 sStickCenter = 1.0f / 5.0f;
|
||||
|
||||
/* 804508A0-804508A8 000320 0008+00 1/0 0/0 0/0 .sdata sHowlTobikusa */
|
||||
static SongNote sHowlTobikusa[4] = {
|
||||
{0x01, 0x1E},
|
||||
{0x03, 0x1E},
|
||||
{0x01, 0x1E},
|
||||
{0x03, 0x1E},
|
||||
static Z2WolfHowlLine sHowlTobikusa[4] = {
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
};
|
||||
|
||||
/* 803CBC50-803CBC5C 028D70 000C+00 1/0 0/0 0/0 .data sHowlUmakusa */
|
||||
static SongNote sHowlUmakusa[6] = {
|
||||
{0x01, 0x0F}, {0x02, 0x0F}, {0x03, 0x3C}, {0x01, 0x0F}, {0x02, 0x0F}, {0x03, 0x3C},
|
||||
static Z2WolfHowlLine sHowlUmakusa[6] = {
|
||||
{HOWL_LINE_HIGH, 15},
|
||||
{HOWL_LINE_MID, 15},
|
||||
{HOWL_LINE_LOW, 60},
|
||||
{HOWL_LINE_HIGH, 15},
|
||||
{HOWL_LINE_MID, 15},
|
||||
{HOWL_LINE_LOW, 60},
|
||||
};
|
||||
|
||||
/* 803CBC5C-803CBC68 028D7C 000C+00 1/0 0/0 0/0 .data sHowlZeldaSong */
|
||||
static SongNote sHowlZeldaSong[6] = {
|
||||
{0x02, 0x1E}, {0x01, 0x0F}, {0x03, 0x2D}, {0x02, 0x1E}, {0x01, 0x0F}, {0x03, 0x2D},
|
||||
static Z2WolfHowlLine sHowlZeldaSong[6] = {
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_HIGH, 15},
|
||||
{HOWL_LINE_LOW, 45},
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_HIGH, 15},
|
||||
{HOWL_LINE_LOW, 45},
|
||||
};
|
||||
|
||||
/* 803CBC68-803CBC74 028D88 000C+00 1/0 0/0 0/0 .data sHowlLightPrelude */
|
||||
static SongNote sHowlLightPrelude[6] = {
|
||||
{0x01, 0x14}, {0x03, 0x28}, {0x01, 0x14}, {0x03, 0x14}, {0x02, 0x14}, {0x01, 0x1E},
|
||||
static Z2WolfHowlLine sHowlLightPrelude[6] = {
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_LOW, 40},
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_LOW, 20},
|
||||
{HOWL_LINE_MID, 20},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
};
|
||||
|
||||
/* 803CBC74-803CBC80 028D94 000C+00 1/0 0/0 0/0 .data sHowlSoulRequiem */
|
||||
static SongNote sHowlSoulRequiem[6] = {
|
||||
{0x03, 0x1E}, {0x02, 0x0F}, {0x03, 0x0F}, {0x01, 0x1E}, {0x02, 0x1E}, {0x03, 0x1E},
|
||||
static Z2WolfHowlLine sHowlSoulRequiem[6] = {
|
||||
{HOWL_LINE_LOW, 30},
|
||||
{HOWL_LINE_MID, 15},
|
||||
{HOWL_LINE_LOW, 15},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
};
|
||||
|
||||
/* 803CBC80-803CBC8C 028DA0 000C+00 1/0 0/0 0/0 .data sHealingSong */
|
||||
static SongNote sHealingSong[6] = {
|
||||
{0x01, 0x1E}, {0x02, 0x1E}, {0x03, 0x1E}, {0x01, 0x1E}, {0x02, 0x1E}, {0x03, 0x1E},
|
||||
static Z2WolfHowlLine sHealingSong[6] = {
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
};
|
||||
|
||||
/* 803CBC8C-803CBC9C 028DAC 000E+02 1/0 0/0 0/0 .data sNewSong1 */
|
||||
static SongNote sNewSong1[7] = {
|
||||
{0x03, 0x1E}, {0x02, 0x1E}, {0x01, 0x1E}, {0x03, 0x28}, {0x02, 0x14}, {0x03, 0x1E}, {0x01, 0x1E},
|
||||
static Z2WolfHowlLine sNewSong1[7] = {
|
||||
{HOWL_LINE_LOW, 30},
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
{HOWL_LINE_LOW, 40},
|
||||
{HOWL_LINE_MID, 20},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
{HOWL_LINE_HIGH, 30},
|
||||
};
|
||||
|
||||
/* 803CBC9C-803CBCAC 028DBC 0010+00 1/0 0/0 0/0 .data sNewSong2 */
|
||||
static SongNote sNewSong2[8] = {
|
||||
{0x01, 0x14}, {0x02, 0x14}, {0x03, 0x14}, {0x02, 0x3C}, {0x03, 0x14}, {0x01, 0x14}, {0x02, 0x14}, {0x03, 0x1E},
|
||||
static Z2WolfHowlLine sNewSong2[8] = {
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_MID, 20},
|
||||
{HOWL_LINE_LOW, 20},
|
||||
{HOWL_LINE_MID, 60},
|
||||
{HOWL_LINE_LOW, 20},
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_MID, 20},
|
||||
{HOWL_LINE_LOW, 30},
|
||||
};
|
||||
|
||||
/* 803CBCAC-803CBCC0 028DCC 0012+02 1/0 0/0 0/0 .data sNewSong3 */
|
||||
static SongNote sNewSong3[9] = {
|
||||
{0x02, 0x1E}, {0x03, 0x3C}, {0x02, 0x28}, {0x01, 0x14}, {0x03, 0x3C}, {0x01, 0x14}, {0x02, 0x14}, {0x01, 0x14}, {0x02, 0x2D},
|
||||
static Z2WolfHowlLine sNewSong3[9] = {
|
||||
{HOWL_LINE_MID, 30},
|
||||
{HOWL_LINE_LOW, 60},
|
||||
{HOWL_LINE_MID, 40},
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_LOW, 60},
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_MID, 20},
|
||||
{HOWL_LINE_HIGH, 20},
|
||||
{HOWL_LINE_MID, 45},
|
||||
};
|
||||
|
||||
/* 803CBCC0-803CBD08 -00001 0048+00 1/1 0/0 0/0 .data sGuideData */
|
||||
static Z2WolfHowlData sGuideData[9] = {
|
||||
{4, sHowlTobikusa}, {6, sHowlUmakusa}, {6, sHowlZeldaSong},
|
||||
{6, sHealingSong}, {6, sHowlSoulRequiem}, {6, sHowlLightPrelude},
|
||||
{7, sNewSong1}, {8, sNewSong2}, {9, sNewSong3},
|
||||
{ARRAY_SIZE(sHowlTobikusa), sHowlTobikusa},
|
||||
{ARRAY_SIZE(sHowlUmakusa), sHowlUmakusa},
|
||||
{ARRAY_SIZE(sHowlZeldaSong), sHowlZeldaSong},
|
||||
{ARRAY_SIZE(sHealingSong), sHealingSong},
|
||||
{ARRAY_SIZE(sHowlSoulRequiem), sHowlSoulRequiem},
|
||||
{ARRAY_SIZE(sHowlLightPrelude), sHowlLightPrelude},
|
||||
{ARRAY_SIZE(sNewSong1), sNewSong1},
|
||||
{ARRAY_SIZE(sNewSong2), sNewSong2},
|
||||
{ARRAY_SIZE(sNewSong3), sNewSong3},
|
||||
};
|
||||
|
||||
/* 802CAAC0-802CAB8C 2C5400 00CC+00 0/0 1/1 0/0 .text __ct__13Z2WolfHowlMgrFv */
|
||||
Z2WolfHowlMgr::Z2WolfHowlMgr() : JASGlobalInstance(this) {
|
||||
mpCurSong = NULL;
|
||||
Z2WolfHowlMgr::Z2WolfHowlMgr() : JASGlobalInstance(true) {
|
||||
mNowHowlData = NULL;
|
||||
mNowInputValue = 0.0f;
|
||||
field_0x18 = 1.0f;
|
||||
mWolfHowlVolume = 1.0f;
|
||||
field_0x1c = 1.0f;
|
||||
field_0x20 = cPitchCenter;
|
||||
field_0x24 = cPitchCenter;
|
||||
mNowPitch = cPitchCenter;
|
||||
field_0x28 = 1.0f;
|
||||
mTimer = 0;
|
||||
mReleaseTimer = 0;
|
||||
mCorrectCurveID = -1;
|
||||
field_0x90 = -1;
|
||||
field_0xba = 0;
|
||||
mCorrectCurveID = Z2WOLFHOWL_NONE;
|
||||
mCorrectScore = -1;
|
||||
mNowLineIndex = 0;
|
||||
field_0xbb = 0;
|
||||
field_0xbc = 0;
|
||||
mNowLineScore = 0;
|
||||
|
||||
for (u8 i = 0; i < 20; i++) {
|
||||
field_0x92[i] = 0;
|
||||
@@ -124,17 +171,17 @@ Z2WolfHowlMgr::Z2WolfHowlMgr() : JASGlobalInstance(this) {
|
||||
|
||||
field_0x34 = 0.0f;
|
||||
field_0x30 = 0.0f;
|
||||
mpSongList = (Z2WolfHowlData*)&sGuideData;
|
||||
mGuideData = (Z2WolfHowlData*)&sGuideData;
|
||||
}
|
||||
|
||||
/* 802CAB8C-802CABEC 2C54CC 0060+00 1/1 0/0 0/0 .text resetState__13Z2WolfHowlMgrFv */
|
||||
void Z2WolfHowlMgr::resetState() {
|
||||
field_0x18 = 1.0f;
|
||||
field_0x24 = cPitchCenter;
|
||||
mWolfHowlVolume = 1.0f;
|
||||
mNowPitch = cPitchCenter;
|
||||
field_0x28 = 1.0f;
|
||||
mTimer = 0;
|
||||
mReleaseTimer = 0;
|
||||
field_0xba = 0;
|
||||
mNowLineIndex = 0;
|
||||
|
||||
for (u8 i = 0; i < 10; i++) {
|
||||
field_0x38[i] = 0.0f;
|
||||
@@ -146,28 +193,31 @@ void Z2WolfHowlMgr::resetState() {
|
||||
}
|
||||
|
||||
/* 802CABEC-802CACB0 2C552C 00C4+00 1/1 0/0 0/0 .text calcVolumeMod__13Z2WolfHowlMgrFf */
|
||||
void Z2WolfHowlMgr::calcVolumeMod(f32 param_0) {
|
||||
if (field_0x00) {
|
||||
if (mTimer < data_8045088E) {
|
||||
field_0x00->getAuxiliary().moveVolume(1.0f, 0);
|
||||
void Z2WolfHowlMgr::calcVolumeMod(f32) {
|
||||
f32 volume;
|
||||
|
||||
if (mWolfHowlHandle) {
|
||||
if (mTimer < cBeginHowlTime) {
|
||||
mWolfHowlHandle->getAuxiliary().moveVolume(1.0f, 0);
|
||||
} else {
|
||||
f32 dVar7 = 1.0f;
|
||||
if (mReleaseTimer != 0x0) {
|
||||
dVar7 = getParamByExp(mReleaseTimer, 30.0f, 0.0f, 2.0f, 0.0f, 1.0f, Z2Calc::CURVE_SIGN_1);
|
||||
volume = 1.0f;
|
||||
if (mReleaseTimer != 0) {
|
||||
volume = getParamByExp(mReleaseTimer, 30.0f, 0.0f, 2.0f, 0.0f, 1.0f, Z2Calc::CURVE_POSITIVE);
|
||||
}
|
||||
field_0x18 = dVar7;
|
||||
if (field_0x00) {
|
||||
field_0x00->getAuxiliary().moveVolume(field_0x18, 0);
|
||||
mWolfHowlVolume = volume;
|
||||
|
||||
if (mWolfHowlHandle) {
|
||||
mWolfHowlHandle->getAuxiliary().moveVolume(mWolfHowlVolume, 0);
|
||||
}
|
||||
field_0x1c = field_0x18;
|
||||
field_0x1c = mWolfHowlVolume;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802CACB0-802CACCC 2C55F0 001C+00 1/1 0/0 0/0 .text getNowPitch__13Z2WolfHowlMgrFv */
|
||||
f32 Z2WolfHowlMgr::getNowPitch() {
|
||||
if (field_0x00) {
|
||||
return field_0x00->getAuxiliary().mParams.mPitch;
|
||||
if (mWolfHowlHandle) {
|
||||
return mWolfHowlHandle->getAuxiliary().params_.mPitch;
|
||||
}
|
||||
|
||||
return 1.0f;
|
||||
@@ -181,81 +231,87 @@ f32 Z2WolfHowlMgr::getNowInputValue() {
|
||||
|
||||
/* 802CACD4-802CAED4 2C5614 0200+00 1/1 0/0 0/0 .text calcPitchMod__13Z2WolfHowlMgrFff */
|
||||
void Z2WolfHowlMgr::calcPitchMod(f32 param_0, f32 param_1) {
|
||||
f32 dVar12 = 1.0f;
|
||||
(void)param_0;
|
||||
|
||||
f32 pitch = 1.0f;
|
||||
field_0x20 = getNowPitch();
|
||||
|
||||
if (mReleaseTimer != 0) {
|
||||
f32 dVar11 = getParamByExp(mReleaseTimer, 30.0f, 0.0f, 1.0f, 0.97f, 1.0f, Z2Calc::CURVE_SIGN_0);
|
||||
dVar11 = field_0x24 * dVar11;
|
||||
if (field_0x00) {
|
||||
field_0x00->getAuxiliary().movePitch(dVar11, 0);
|
||||
f32 releaseScale = getParamByExp(mReleaseTimer, 30.0f, 0.0f, 1.0f, 0.97f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
pitch = mNowPitch * releaseScale;
|
||||
|
||||
if (mWolfHowlHandle) {
|
||||
mWolfHowlHandle->getAuxiliary().movePitch(pitch, 0);
|
||||
}
|
||||
} else {
|
||||
if (mTimer < data_8045088E) {
|
||||
if (mTimer < cBeginHowlTime) {
|
||||
field_0x34 = 0.0f;
|
||||
} else {
|
||||
f32 dVar11 = 1.0f;
|
||||
f32 inputPitch = 1.0f;
|
||||
if (mNowInputValue < 0.0f) {
|
||||
dVar11 = Z2Calc::linearTransform(mNowInputValue, -1.0f, 0.0f, cPitchDown, 1.0f, false);
|
||||
inputPitch = Z2Calc::linearTransform(mNowInputValue, -1.0f, 0.0f, cPitchDown, 1.0f, false);
|
||||
} else if (mNowInputValue > 0.0f) {
|
||||
dVar11 = Z2Calc::linearTransform(mNowInputValue, 1.0f, 0.0f,cPitchUp, 1.0f, false);
|
||||
inputPitch = Z2Calc::linearTransform(mNowInputValue, 1.0f, 0.0f,cPitchUp, 1.0f, false);
|
||||
}
|
||||
|
||||
f32 temp = dVar11 * cPitchCenter;
|
||||
f32 fVar5 = temp - (dVar12 = field_0x24);
|
||||
if (fVar5 == 0.0f) {
|
||||
dVar12 = dVar12;
|
||||
} else if (fVar5 > 0.0f) {
|
||||
dVar12 += fVar5 / struct_8045088C;
|
||||
|
||||
f32 newPitch = inputPitch * cPitchCenter;
|
||||
f32 pitchDiff = newPitch - mNowPitch;
|
||||
if (pitchDiff == 0.0f) {
|
||||
pitch = mNowPitch;
|
||||
} else if (pitchDiff > 0.0f) {
|
||||
pitch = mNowPitch + (pitchDiff / struct_8045088C);
|
||||
} else {
|
||||
dVar12 += fVar5 / struct_8045088D;
|
||||
pitch = mNowPitch + (pitchDiff / struct_8045088D);
|
||||
}
|
||||
}
|
||||
field_0x24 = dVar12;
|
||||
|
||||
mNowPitch = pitch;
|
||||
|
||||
f32 dVar11 = Z2Calc::linearTransform(param_1, 0.0f, 1.0f, 1.0f, cR_FlatWidth, true);
|
||||
f32 fVar5 = field_0x28 + (dVar11 - field_0x28) / struct_80450894;
|
||||
field_0x28 = fVar5;
|
||||
dVar12 *= fVar5;
|
||||
if (field_0x00) {
|
||||
field_0x00->getAuxiliary().movePitch(dVar12, 0);
|
||||
pitch *= fVar5;
|
||||
|
||||
if (mWolfHowlHandle) {
|
||||
mWolfHowlHandle->getAuxiliary().movePitch(pitch, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802CAED4-802CB100 2C5814 022C+00 0/0 1/1 0/0 .text startWolfHowlSound__13Z2WolfHowlMgrFffbf */
|
||||
s8 Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 param_1, bool param_2, f32 param_3) {
|
||||
if (mCorrectCurveID > 1) {
|
||||
s8 Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 stickValue, bool isHowl, f32 param_3) {
|
||||
if (mCorrectCurveID > Z2WOLFHOWL_UMAKUSA) {
|
||||
Z2GetSeqMgr()->setWindStoneVol(0.0f, 0);
|
||||
}
|
||||
|
||||
if (Z2GetSeqMgr()->isItemGetDemo() || (mReleaseTimer != 0)) {
|
||||
param_2 = false;
|
||||
if (Z2GetSeqMgr()->isItemGetDemo() || mReleaseTimer != 0) {
|
||||
isHowl = false;
|
||||
} else {
|
||||
if (param_1 > sStickCenter) {
|
||||
mNowInputValue = Z2Calc::linearTransform(param_1, sStickCenter, sStickHigh, 0.0f, 1.0f, false);
|
||||
if (stickValue > sStickCenter) {
|
||||
mNowInputValue = Z2Calc::linearTransform(stickValue, sStickCenter, sStickHigh, 0.0f, 1.0f, false);
|
||||
} else if (stickValue < -1.0f * sStickCenter) {
|
||||
mNowInputValue = Z2Calc::linearTransform(stickValue, -1.0f * sStickCenter, -1.0f * sStickHigh, 0.0f, -1.0f, false);
|
||||
} else {
|
||||
f32 fVar1 = -1.0f * sStickCenter;
|
||||
if (param_1 < fVar1) {
|
||||
mNowInputValue = Z2Calc::linearTransform(param_1, fVar1, -1.0f * sStickHigh, 0.0f, -1.0f, false);
|
||||
} else {
|
||||
mNowInputValue = 0.0f;
|
||||
}
|
||||
mNowInputValue = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (param_2) {
|
||||
if (mTimer > data_8045088E) {
|
||||
Z2GetSoundStarter()->startLevelSound(0x10035, &field_0x00, NULL);
|
||||
if (isHowl) {
|
||||
if (mTimer > cBeginHowlTime) {
|
||||
Z2GetSoundStarter()->startLevelSound(Z2SE_WL_V_HOWL, &mWolfHowlHandle, NULL);
|
||||
}
|
||||
if (field_0x00) {
|
||||
|
||||
if (mWolfHowlHandle) {
|
||||
calcPitchMod(0.0f, 0.0f);
|
||||
calcVolumeMod(param_3);
|
||||
}
|
||||
|
||||
mTimer++;
|
||||
} else {
|
||||
if (mTimer > data_8045088E) {
|
||||
if (mReleaseTimer < 0x1e) {
|
||||
Z2GetSoundStarter()->startLevelSound(0x10035, &field_0x00, NULL);
|
||||
if (field_0x00) {
|
||||
if (mTimer > cBeginHowlTime) {
|
||||
if (mReleaseTimer < 30) {
|
||||
Z2GetSoundStarter()->startLevelSound(Z2SE_WL_V_HOWL, &mWolfHowlHandle, NULL);
|
||||
if (mWolfHowlHandle) {
|
||||
calcPitchMod(0.0f, 0.0f);
|
||||
calcVolumeMod(param_3);
|
||||
}
|
||||
@@ -274,183 +330,225 @@ s8 Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 param_1, bool param_2, f32
|
||||
|
||||
/* 802CB100-802CB320 2C5A40 0220+00 0/0 1/1 0/0 .text
|
||||
* setCorrectData__13Z2WolfHowlMgrFScP14Z2WolfHowlData */
|
||||
void Z2WolfHowlMgr::setCorrectData(s8 param_0, Z2WolfHowlData* param_1) {
|
||||
if (param_0 == mCorrectCurveID) {
|
||||
void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
|
||||
if (curveID == mCorrectCurveID) {
|
||||
return;
|
||||
}
|
||||
if (param_0 == -1) {
|
||||
mCorrectCurveID = -1;
|
||||
mpCurSong = 0;
|
||||
|
||||
if (curveID == Z2WOLFHOWL_NONE) {
|
||||
OS_REPORT("[Z2WolfHowMgr:setCorrectData] CorrectData NONE\n");
|
||||
mCorrectCurveID = Z2WOLFHOWL_NONE;
|
||||
mNowHowlData = NULL;
|
||||
return;
|
||||
}
|
||||
if (param_1 == NULL) {
|
||||
if (param_0 >= 9) {
|
||||
mCorrectCurveID = -1;
|
||||
mpCurSong = 0;
|
||||
|
||||
if (data == NULL) {
|
||||
if (curveID >= Z2WOLFHOWL_MAX) {
|
||||
mCorrectCurveID = Z2WOLFHOWL_NONE;
|
||||
mNowHowlData = NULL;
|
||||
return;
|
||||
}
|
||||
param_1 = &mpSongList[param_0];
|
||||
data = &mGuideData[curveID];
|
||||
}
|
||||
mCorrectCurveID = param_0;
|
||||
mpCurSong = param_1;
|
||||
|
||||
switch(param_0) {
|
||||
case 3:
|
||||
cPitchUp = 1.1224600076675415f;
|
||||
cPitchCenter = 1.0594600439071655f;
|
||||
cPitchDown = 0.7936859726905823f;
|
||||
JUT_ASSERT(648, data);
|
||||
|
||||
mCorrectCurveID = curveID;
|
||||
mNowHowlData = data;
|
||||
|
||||
switch(curveID) {
|
||||
case Z2WOLFHOWL_HEALINGSONG:
|
||||
cPitchUp = 1.12246f;
|
||||
cPitchCenter = 1.05946f;
|
||||
cPitchDown = 0.793686f;
|
||||
break;
|
||||
case 4:
|
||||
cPitchUp = 1.2599060535430908f;
|
||||
cPitchCenter = 0.9438700079917908f;
|
||||
cPitchDown = 0.8408849835395813f;
|
||||
case Z2WOLFHOWL_SOULREQUIEM:
|
||||
cPitchUp = 1.259906f;
|
||||
cPitchCenter = 0.94387f;
|
||||
cPitchDown = 0.840885f;
|
||||
break;
|
||||
case 6:
|
||||
cPitchUp = 1.3348400592803955f;
|
||||
cPitchCenter = 0.8909000158309937f;
|
||||
cPitchDown = 0.8909000158309937f;
|
||||
case Z2WOLFHOWL_NEWSONG1:
|
||||
cPitchUp = 1.33484f;
|
||||
cPitchCenter = 0.8909f;
|
||||
cPitchDown = 0.8909f;
|
||||
break;
|
||||
case 7:
|
||||
cPitchUp = 1.2599060535430908f;
|
||||
cPitchCenter = 0.9438700079917908f;
|
||||
cPitchDown = 0.8909000158309937f;
|
||||
case Z2WOLFHOWL_NEWSONG2:
|
||||
cPitchUp = 1.259906f;
|
||||
cPitchCenter = 0.94387f;
|
||||
cPitchDown = 0.8909f;
|
||||
break;
|
||||
case 8:
|
||||
cPitchUp = 1.1224600076675415f;
|
||||
cPitchCenter = 0.9438700079917908f;
|
||||
cPitchDown = 0.7491499781608582f;
|
||||
case Z2WOLFHOWL_NEWSONG3:
|
||||
cPitchUp = 1.12246f;
|
||||
cPitchCenter = 0.94387f;
|
||||
cPitchDown = 0.74915f;
|
||||
break;
|
||||
default:
|
||||
cPitchUp = 1.1892000436782837f;
|
||||
cPitchUp = 1.1892f;
|
||||
cPitchCenter = 1.0f;
|
||||
cPitchDown = 0.8909000158309937f;
|
||||
cPitchDown = 0.8909f;
|
||||
break;
|
||||
}
|
||||
|
||||
field_0xbe = 0;
|
||||
u32 uVar4 = 0;
|
||||
mFullScore = 0;
|
||||
|
||||
for (u8 bVar5 = 0; bVar5 < getCorrectLineNum(); bVar5++) {
|
||||
uVar4 += getCorrectLine(bVar5).length;
|
||||
if (getCorrectLine(bVar5).barType != 0) {
|
||||
field_0xbe += struct_80450895;
|
||||
field_0xbe += getCorrectLine(bVar5).length;
|
||||
u32 length = 0;
|
||||
for (u8 i = 0; i < getCorrectLineNum(); i++) {
|
||||
length += getCorrectLine(i).length;
|
||||
if (getCorrectLine(i).type != 0) {
|
||||
mFullScore += struct_80450895;
|
||||
mFullScore += getCorrectLine(i).length;
|
||||
}
|
||||
}
|
||||
field_0xbe -= uVar4 >> 2;
|
||||
|
||||
OS_REPORT("[Z2WolfHowMgr:setCorrectData] id:%d length:%d blockNum:%d, fullScore:%d\n",
|
||||
mCorrectCurveID, length, getCorrectLineNum(), mFullScore);
|
||||
mFullScore -= FAST_DIV(length, 4);
|
||||
}
|
||||
|
||||
/* 802CB320-802CB370 2C5C60 0050+00 3/3 2/2 0/0 .text getCorrectLine__13Z2WolfHowlMgrFUc
|
||||
*/
|
||||
SongNote Z2WolfHowlMgr::getCorrectLine(u8 param_0) {
|
||||
Z2WolfHowlLine Z2WolfHowlMgr::getCorrectLine(u8 lineIndex) {
|
||||
u16 local_18;
|
||||
|
||||
if (mpCurSong == 0 || param_0 >= mpCurSong->mLineNum) {
|
||||
SongNote note;
|
||||
note.barType = 0;
|
||||
note.length = 0;
|
||||
return note;
|
||||
if (mNowHowlData == NULL || lineIndex >= mNowHowlData->lineNum) {
|
||||
Z2WolfHowlLine line;
|
||||
line.type = 0;
|
||||
line.length = 0;
|
||||
return line;
|
||||
}
|
||||
return mpCurSong->mSongData[param_0];
|
||||
|
||||
return mNowHowlData->lineData[lineIndex];
|
||||
}
|
||||
|
||||
/* 802CB370-802CB38C 2C5CB0 001C+00 2/2 1/1 0/0 .text getCorrectLineNum__13Z2WolfHowlMgrFv */
|
||||
u8 Z2WolfHowlMgr::getCorrectLineNum() {
|
||||
if (mpCurSong != NULL) {
|
||||
return mpCurSong->mLineNum;
|
||||
if (mNowHowlData != NULL) {
|
||||
return mNowHowlData->lineNum;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804341F8-8043421C 060F18 0024+00 2/2 0/0 0/0 .bss sCorrectPhrase */
|
||||
static JAISoundID sCorrectPhrase[9] = {
|
||||
0x1000052, 0x1000053, 0x1000054, 0x1000072, 0x1000068,
|
||||
0x1000055, 0x1000075, 0x100007c, 0x100007f,
|
||||
Z2BGM_HOWL_TOBIKUSA,
|
||||
Z2BGM_HOWL_UMAKUSA,
|
||||
Z2BGM_HOWL_ZELDASONG,
|
||||
Z2BGM_HEALING_HOWL,
|
||||
Z2BGM_SOUL_REQ_HOWL,
|
||||
Z2BGM_HOWL_LIGHT_PRLD,
|
||||
Z2BGM_NEW_01_HOWL,
|
||||
Z2BGM_NEW_02_HOWL,
|
||||
Z2BGM_NEW_03_HOWL,
|
||||
};
|
||||
|
||||
/* 8043421C-80434240 060F3C 0024+00 2/3 0/0 0/0 .bss sWindStoneSound */
|
||||
static JAISoundID sWindStoneSound[9] = {
|
||||
0xffffffff, 0xffffffff, 0x100005b, 0x1000071, 0x1000067,
|
||||
0x100005c, 0x1000074, 0x100007b, 0x100007e,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
Z2BGM_STONE_ZELDASONG,
|
||||
Z2BGM_HEALING_STONE,
|
||||
Z2BGM_SOUL_REQ_STONE,
|
||||
Z2BGM_STONE_LIGHT_PRLD,
|
||||
Z2BGM_NEW_01_STONE,
|
||||
Z2BGM_NEW_02_STONE,
|
||||
Z2BGM_NEW_03_STONE,
|
||||
};
|
||||
|
||||
/* 80434240-80434268 060F60 0024+04 1/2 0/0 0/0 .bss sCorrectDuo */
|
||||
static JAISoundID sCorrectDuo[9] = {
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0x1000073, 0x1000069,
|
||||
0x1000066, 0x1000076, 0x100007d, 0x1000080,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
0xFFFFFFFF,
|
||||
Z2BGM_HEALING_DUO,
|
||||
Z2BGM_SOUL_REQ_DUO,
|
||||
Z2BGM_LIGHT_PRLD_DUO,
|
||||
Z2BGM_NEW_01_DUO,
|
||||
Z2BGM_NEW_02_DUO,
|
||||
Z2BGM_NEW_03_DUO,
|
||||
};
|
||||
|
||||
/* 802CB38C-802CB650 2C5CCC 02C4+00 1/1 0/0 0/0 .text checkLine__13Z2WolfHowlMgrFv */
|
||||
s8 Z2WolfHowlMgr::checkLine() {
|
||||
if (mCorrectCurveID == -1 || mpCurSong == NULL) {
|
||||
if (mCorrectCurveID == Z2WOLFHOWL_NONE || mNowHowlData == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (Z2GetSeqMgr()->isItemGetDemo()) {
|
||||
return mCorrectCurveID;
|
||||
}
|
||||
|
||||
if (mTimer == 0) {
|
||||
if (field_0x90 > 0) {
|
||||
field_0x90 = -1;
|
||||
if (mCorrectScore > 0) {
|
||||
OS_REPORT("↑↑↑CheckCurveDone!!! correctCount:%d / %d\n", mCorrectScore, mFullScore);
|
||||
mCorrectScore = -1;
|
||||
}
|
||||
return -1;
|
||||
} else if (field_0x90 >= field_0xbe) {
|
||||
u32 uVar1 = 0;
|
||||
} else if (mCorrectScore >= mFullScore) {
|
||||
u32 length = 0;
|
||||
for (u8 i = 0; i < getCorrectLineNum(); i++) {
|
||||
uVar1 += getCorrectLine(i).length;
|
||||
length += getCorrectLine(i).length;
|
||||
}
|
||||
if (mTimer - data_8045088E < uVar1) {
|
||||
|
||||
if (mTimer - cBeginHowlTime < length) {
|
||||
return -1;
|
||||
}
|
||||
Z2GetSeMgr()->seStart(0xd, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
if (mCorrectCurveID > 2) {
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == 0x21) {
|
||||
|
||||
OS_REPORT("↑↑↑CheckCurveDone!!! correctCount:%d / %d\n", mCorrectScore, mFullScore);
|
||||
|
||||
Z2GetSeMgr()->seStart(Z2SE_READ_RIDDLE_B, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
|
||||
if (mCorrectCurveID > Z2WOLFHOWL_ZELDASONG) {
|
||||
if (Z2GetSceneMgr()->getCurrentSceneNum() == Z2SCENE_SHADES_REALM) {
|
||||
Z2GetSeqMgr()->subBgmStart(sCorrectDuo[mCorrectCurveID]);
|
||||
}
|
||||
} else {
|
||||
Z2GetSeqMgr()->subBgmStart(sCorrectPhrase[mCorrectCurveID]);
|
||||
}
|
||||
field_0x90 = 0xffff;
|
||||
|
||||
mCorrectScore = -1;
|
||||
return mCorrectCurveID;
|
||||
} else {
|
||||
if (mTimer == 1) {
|
||||
field_0x90 = 0;
|
||||
field_0xba = 0;
|
||||
field_0xbc = 0;
|
||||
} else if (mTimer >= data_8045088E) {
|
||||
u32 r29 = mTimer - data_8045088E;
|
||||
u32 uVar1 = 0;
|
||||
for (u8 i = 0; i <= field_0xba; i++) {
|
||||
uVar1 += getCorrectLine(i).length;
|
||||
mCorrectScore = 0;
|
||||
mNowLineIndex = 0;
|
||||
mNowLineScore = 0;
|
||||
OS_REPORT("↓↓↓CheckCurveStart!!! correctCount:%d, block:%d, length%d\n", mCorrectScore, mNowLineIndex, field_0x92[mNowLineIndex]);
|
||||
} else if (mTimer >= cBeginHowlTime) {
|
||||
u32 howlTime = mTimer - cBeginHowlTime;
|
||||
|
||||
u32 length = 0;
|
||||
for (u8 i = 0; i <= mNowLineIndex; i++) {
|
||||
length += getCorrectLine(i).length;
|
||||
}
|
||||
if (r29 > uVar1 && field_0xba < getCorrectLineNum()) {
|
||||
field_0x90 += field_0xbc;
|
||||
if (field_0xbc > getCorrectLine(field_0xba).length / 6) {
|
||||
field_0x90 += struct_80450895;
|
||||
|
||||
if (howlTime > length && mNowLineIndex < getCorrectLineNum()) {
|
||||
mCorrectScore += mNowLineScore;
|
||||
if (mNowLineScore > getCorrectLine(mNowLineIndex).length / 6) {
|
||||
mCorrectScore += struct_80450895;
|
||||
}
|
||||
field_0xba++;
|
||||
field_0xbc = 0;
|
||||
mNowLineIndex++;
|
||||
mNowLineScore = 0;
|
||||
} else {
|
||||
if (getOnLineNum() > -1) {
|
||||
field_0xbc++;
|
||||
mNowLineScore++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
return mCorrectCurveID;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* 802CB650-802CB6EC 2C5F90 009C+00 1/1 1/1 0/0 .text getOnLineNum__13Z2WolfHowlMgrFv */
|
||||
s8 Z2WolfHowlMgr::getOnLineNum() {
|
||||
SongNote note = getCorrectLine(field_0xba);
|
||||
if ((note.barType == 1 && mNowInputValue == 1.0f) ||
|
||||
(note.barType == 2 && mNowInputValue == 0.0f) ||
|
||||
(note.barType == 3 && mNowInputValue == -1.0f)) {
|
||||
s8 rv = field_0xba;
|
||||
Z2WolfHowlLine line = getCorrectLine(mNowLineIndex);
|
||||
u8 type = line.type;
|
||||
if ((type == HOWL_LINE_HIGH && mNowInputValue == 1.0f) ||
|
||||
(type == HOWL_LINE_MID && mNowInputValue == 0.0f) ||
|
||||
(type == HOWL_LINE_LOW && mNowInputValue == -1.0f))
|
||||
{
|
||||
s8 rv = mNowLineIndex;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -459,49 +557,56 @@ s8 Z2WolfHowlMgr::getOnLineNum() {
|
||||
|
||||
/* 802CB6EC-802CBA88 2C602C 039C+00 0/0 0/0 2/2 .text startWindStoneSound__13Z2WolfHowlMgrFScP3Vec
|
||||
*/
|
||||
void Z2WolfHowlMgr::startWindStoneSound(s8 param_0, Vec* param_1) {
|
||||
if (param_1 == NULL || Z2GetLink() == NULL || Z2GetLink()->getCurrentPos() == NULL) {
|
||||
void Z2WolfHowlMgr::startWindStoneSound(s8 curveID, Vec* pos) {
|
||||
if (pos == NULL || Z2GetLink() == NULL || Z2GetLink()->getCurrentPos() == NULL) {
|
||||
return;
|
||||
}
|
||||
Vec local_60 = Z2GetAudience()->getAudioCamPos(0);
|
||||
f32 dVar13 = sqrtf(VECSquareDistance(param_1, &local_60));
|
||||
if (dVar13 > 2100.0f && field_0x04) {
|
||||
field_0x04->stop();
|
||||
} else if (dVar13 < 2100.0f && !field_0x04) {
|
||||
Z2GetSoundMgr()->startSound(sWindStoneSound[param_0], &field_0x04, (const JGeometry::TVec3<f32>*)param_1);
|
||||
|
||||
Vec audioCamPos = Z2GetAudience()->getAudioCamPos(0);
|
||||
f32 camDist = sqrtf(VECSquareDistance(pos, &audioCamPos));
|
||||
if (camDist > 2100.0f && mWindStoneHandle) {
|
||||
mWindStoneHandle->stop();
|
||||
} else if (camDist < 2100.0f && !mWindStoneHandle) {
|
||||
Z2GetSoundMgr()->startSound(sWindStoneSound[curveID], &mWindStoneHandle, (const JGeometry::TVec3<f32>*)pos);
|
||||
}
|
||||
if (field_0x04) {
|
||||
field_0x04->fadeIn(0);
|
||||
field_0x04->stop(0x1e);
|
||||
|
||||
if (mWindStoneHandle) {
|
||||
mWindStoneHandle->fadeIn(0);
|
||||
mWindStoneHandle->stop(30);
|
||||
|
||||
if (Z2GetLink()->getLinkState() == 1) {
|
||||
f32 fVar14 = sqrtf(VECSquareDistance(param_1, Z2GetLink()->getCurrentPos()));
|
||||
f32 dVar13 = 1.0f;
|
||||
if (fVar14 < 150.0f) {
|
||||
dVar13 = 0.0f;
|
||||
} else if (fVar14 < 2000.0f) {
|
||||
dVar13 = Z2Calc::getParamByExp(fVar14, 150.0f, 2000.0f,
|
||||
0.45f, 0.05f, dVar13, Z2Calc::CURVE_SIGN_0);
|
||||
f32 linkDist = sqrtf(VECSquareDistance(pos, Z2GetLink()->getCurrentPos()));
|
||||
f32 volume = 1.0f;
|
||||
if (linkDist < 150.0f) {
|
||||
volume = 0.0f;
|
||||
} else if (linkDist < 2000.0f) {
|
||||
volume = Z2Calc::getParamByExp(linkDist, 150.0f, 2000.0f,
|
||||
0.45f, 0.05f, 1.0f, Z2Calc::CURVE_NEGATIVE);
|
||||
}
|
||||
Z2GetSeqMgr()->setWindStoneVol(dVar13, 0);
|
||||
field_0x04->getAuxiliary().moveVolume(0.4f, 0);
|
||||
|
||||
Z2GetSeqMgr()->setWindStoneVol(volume, 0);
|
||||
mWindStoneHandle->getAuxiliary().moveVolume(0.4f, 0);
|
||||
} else {
|
||||
field_0x04->getAuxiliary().moveVolume(0.04f, 0);
|
||||
mWindStoneHandle->getAuxiliary().moveVolume(0.04f, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802CBA88-802CBB58 2C63C8 00D0+00 0/0 1/1 0/0 .text startGuideMelody__13Z2WolfHowlMgrFb
|
||||
*/
|
||||
int Z2WolfHowlMgr::startGuideMelody(bool param_0) {
|
||||
int Z2WolfHowlMgr::startGuideMelody(bool startSound) {
|
||||
Z2GetSeqMgr()->setWindStoneVol(0.0f, 0);
|
||||
if (param_0) {
|
||||
Z2GetSoundMgr()->startSound(sWindStoneSound[mCorrectCurveID], &field_0x08, NULL);
|
||||
|
||||
if (startSound) {
|
||||
Z2GetSoundMgr()->startSound(sWindStoneSound[mCorrectCurveID], &mGuideHandle, NULL);
|
||||
}
|
||||
if (field_0x08) {
|
||||
field_0x08->fadeIn(0);
|
||||
field_0x08->stop(0x1e);
|
||||
return field_0x08->getCount();
|
||||
|
||||
if (mGuideHandle) {
|
||||
mGuideHandle->fadeIn(0);
|
||||
mGuideHandle->stop(30);
|
||||
return mGuideHandle->getCount();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user