mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-29 08:12:52 -04:00
Minor JSystem/Z2Audio fixes (#2650)
This commit is contained in:
+5
-5
@@ -919,12 +919,12 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASSeqParser.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASSeqReader.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASAramStream.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2J01"), "JSystem/JAudio2/JASBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASBasicBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "ShieldD"), "JSystem/JAudio2/JASVoiceBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASBasicInst.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASDrumSet.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASBasicWaveBank.cpp"),
|
||||
Object(Equivalent, "JSystem/JAudio2/JASBasicWaveBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASSimpleWaveBank.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JASWSParser.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASBNKParser.cpp"),
|
||||
@@ -965,7 +965,7 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "ShieldD"), "JSystem/JAudio2/JAUBankTable.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JAUClusterSound.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2J01"), "JSystem/JAudio2/JAUInitializer.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JAUSectionHeap.cpp"),
|
||||
Object(Equivalent, "JSystem/JAudio2/JAUSectionHeap.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JAUSeqCollection.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JAUSeqDataBlockMgr.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JAudio2/JAUSoundAnimator.cpp"),
|
||||
@@ -978,7 +978,7 @@ config.libs = [
|
||||
[
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JMessage/control.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "ShieldD"), "JSystem/JMessage/data.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/processor.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2J01"), "JSystem/JMessage/processor.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/resource.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "JSystem/JMessage/locale.cpp"),
|
||||
],
|
||||
@@ -1006,7 +1006,7 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "Z2AudioLib/Z2SoundObject.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundObjMgr.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2Creature.cpp"),
|
||||
Object(NonMatching, "Z2AudioLib/Z2LinkMgr.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2J01"), "Z2AudioLib/Z2LinkMgr.cpp"),
|
||||
Object(NonMatching, "Z2AudioLib/Z2EnvSeMgr.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "Z2AudioLib/Z2WolfHowlMgr.cpp"),
|
||||
Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "Z2AudioLib/Z2SpeechMgr2.cpp"),
|
||||
|
||||
@@ -773,6 +773,7 @@ public:
|
||||
u32 getTexGenNum() const { return mTexGenNum; }
|
||||
void setTexGenNum(u32 num) { mTexGenNum = num; }
|
||||
void setTexCoord(u32 i, J2DTexCoord coord) { mTexGenCoord[i] = coord; }
|
||||
void setTexCoord(u32 i, const J2DTexCoord* coord) { mTexGenCoord[i] = *coord; }
|
||||
void setTexMtx(u32 i, J2DTexMtx* mtx) { mTexMtx[i] = mtx; }
|
||||
J2DTexMtx& getTexMtx(u32 i) { return *mTexMtx[i]; }
|
||||
J2DTexCoord& getTexCoord(u32 i) { return mTexGenCoord[i]; }
|
||||
|
||||
@@ -21,7 +21,7 @@ class JKRSolidHeap;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*
|
||||
*/
|
||||
class JAUSection : public JKRDisposer, protected JSULink<JAUSection> {
|
||||
public:
|
||||
@@ -102,7 +102,6 @@ public:
|
||||
/* 802A60AC */ bool newDynamicSeqBlock(u32);
|
||||
/* 802A61D0 */ SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*);
|
||||
/* 802A6270 */ int releaseSeqData();
|
||||
/* 802A6278 */ ~JAUSectionHeap() {}
|
||||
|
||||
JAISeqDataMgr* getSeqSeqDataMgr() { return this; }
|
||||
JAISeqDataMgr* getSeSeqDataMgr() { return sectionHeapData_.seSeqDataMgr_; }
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
#include "JSystem/JSystem.pch" // IWYU pragma: export
|
||||
#endif
|
||||
|
||||
#endif // DOLZEL_PCH
|
||||
#endif // JSYSTEM_H
|
||||
|
||||
@@ -27,7 +27,8 @@ public:
|
||||
void stopAllSounds(u32 fadeout);
|
||||
|
||||
void stopSound(JAISoundID soundID, u32 param_1) {
|
||||
JAISoundHandle* phandle = getHandleSoundID(soundID);
|
||||
// u32 cast is a fakematch
|
||||
JAISoundHandle* phandle = getHandleSoundID((u32)soundID);
|
||||
if (phandle != NULL) {
|
||||
(*phandle)->stop(param_1);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/J2DGraph/J2DMatBlock.h"
|
||||
#include "JSystem/J2DGraph/J2DTevs.h"
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
@@ -1357,8 +1358,40 @@ J2DTevBlock8::~J2DTevBlock8() {
|
||||
}
|
||||
|
||||
/* 802EEF6C-802EF1E0 2E98AC 0274+00 1/0 0/0 0/0 .text initialize__12J2DTevBlock8Fv */
|
||||
// NONMATCHING - inlines
|
||||
void J2DTevBlock8::initialize() {
|
||||
// NONMATCHING
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mTexNo[i] = 0xffff;
|
||||
}
|
||||
mFontNo = 0xffff;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mTevOrder[i].setTevOrderInfo(j2dDefaultTevOrderInfoNull);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevColor[i] = j2dDefaultTevColor;
|
||||
}
|
||||
mTevStageNum = 1;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mTevStage[i].setStageNo(i);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevKColor[i] = j2dDefaultTevKColor;
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mTevKColorSel[i] = 0xff;
|
||||
mTevKAlphaSel[i] = 0xff;
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevSwapModeTable[i].setTevSwapModeTableInfo(j2dDefaultTevSwapModeTable);
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mIndTevStage[i].setIndTevStageInfo(j2dDefaultIndTevStageInfo);
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mPalette[i] = 0;
|
||||
}
|
||||
mFont = NULL;
|
||||
mFontUndeleteFlag = 0;
|
||||
}
|
||||
|
||||
/* 802EF1E0-802EF2B0 2E9B20 00D0+00 1/0 0/0 0/0 .text prepareTexture__12J2DTevBlock8FUc
|
||||
@@ -1788,8 +1821,41 @@ J2DTevBlock16::~J2DTevBlock16() {
|
||||
}
|
||||
|
||||
/* 802F03EC-802F0660 2EAD2C 0274+00 1/0 0/0 0/0 .text initialize__13J2DTevBlock16Fv */
|
||||
// NONMATCHING - inlines
|
||||
void J2DTevBlock16::initialize() {
|
||||
// NONMATCHING
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mTexNo[i] = 0xffff;
|
||||
}
|
||||
mFontNo = 0xffff;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mTevOrder[i].setTevOrderInfo(j2dDefaultTevOrderInfoNull);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevColor[i] = j2dDefaultTevColor;
|
||||
}
|
||||
mTevStageNum = 1;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mTevStage[i].setStageNo(i);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevKColor[i] = j2dDefaultTevKColor;
|
||||
}
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mTevKColorSel[i] = 0xff;
|
||||
mTevKAlphaSel[i] = 0xff;
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mTevSwapModeTable[i].setTevSwapModeTableInfo(j2dDefaultTevSwapModeTable);
|
||||
}
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mIndTevStage[i].setIndTevStageInfo(j2dDefaultIndTevStageInfo);
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mPalette[i] = 0;
|
||||
}
|
||||
mFont = NULL;
|
||||
mFontUndeleteFlag = 0;
|
||||
}
|
||||
|
||||
/* 802F0660-802F0730 2EAFA0 00D0+00 1/0 0/0 0/0 .text prepareTexture__13J2DTevBlock16FUc
|
||||
|
||||
@@ -71,7 +71,6 @@ u32 J2DMaterialFactory::countStages(int param_0) const {
|
||||
/* 802F2D1C-802F362C 2ED65C 0910+00 0/0 1/1 0/0 .text
|
||||
* create__18J2DMaterialFactoryCFP11J2DMaterialiUlP15J2DResReferenceP15J2DResReferenceP10JKRArchive
|
||||
*/
|
||||
// NONMATCHING - Stack issues
|
||||
J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 param_2,
|
||||
J2DResReference* param_3, J2DResReference* param_4,
|
||||
JKRArchive* param_5) const {
|
||||
@@ -84,8 +83,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
|
||||
s32 local_3bc = ((param_2 & 0x1000000) != 0);
|
||||
s32 local_3c0 = (param_2 & 0x1f0000) ? local_3bc : 0;
|
||||
bool temp = (param_2 & 0x1f0000);
|
||||
u16 tevBlockNum = r28;
|
||||
param_0->mTevBlock = J2DMaterial::createTevBlock(tevBlockNum, temp);
|
||||
param_0->mTevBlock = J2DMaterial::createTevBlock((u16)r28, temp);
|
||||
param_0->mIndBlock = J2DMaterial::createIndBlock(local_3c0, temp);
|
||||
param_0->mIndex = index;
|
||||
param_0->field_0x8 = getMaterialMode(index);
|
||||
@@ -128,9 +126,8 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
|
||||
local_388 = aJStack_12c.getResource(local_384, 'FONT', NULL);
|
||||
}
|
||||
if (local_388 == NULL && J2DScreen::getDataManage() != NULL) {
|
||||
char* pcVar9 = param_4->getName(param_0->getTevBlock()->getFontNo());
|
||||
char acStack_334[257];
|
||||
strcpy(acStack_334, pcVar9);
|
||||
strcpy(acStack_334, param_4->getName(param_0->getTevBlock()->getFontNo()));
|
||||
local_388 = J2DScreen::getDataManage()->get(acStack_334);
|
||||
}
|
||||
}
|
||||
@@ -151,8 +148,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
|
||||
param_0->getTevBlock()->setTevKColor(i, newTevKColor(index, i));
|
||||
}
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
J2DTevBlock* block = param_0->getTevBlock();
|
||||
block->setTevColor(i, newTevColor(index, i));
|
||||
param_0->getTevBlock()->setTevColor(i, newTevColor(index, i));
|
||||
}
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
param_0->getTevBlock()->setTevSwapModeTable(i, newTevSwapModeTable(index, i));
|
||||
@@ -161,10 +157,12 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
|
||||
param_0->getColorBlock()->setMatColor(i, newMatColor(index, i));
|
||||
}
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
param_0->getColorBlock()->setColorChan(i, newColorChan(index, i));
|
||||
J2DColorChan colorChan = newColorChan(index, i);
|
||||
param_0->getColorBlock()->setColorChan(i, colorChan);
|
||||
}
|
||||
for (u8 i = 0; i < 8; i++) {
|
||||
param_0->getTexGenBlock()->setTexCoord(i, newTexCoord(index, i));
|
||||
J2DTexCoord texCoord = newTexCoord(index, i);
|
||||
param_0->getTexGenBlock()->setTexCoord(i, &texCoord);
|
||||
}
|
||||
for (u8 i = 0; i < 8; i++) {
|
||||
param_0->getTexGenBlock()->setTexMtx(i, newTexMtx(index, i));
|
||||
|
||||
@@ -804,8 +804,9 @@ void JASTrack::TList::seqMain() {
|
||||
iterator it, it2;
|
||||
for (it = begin(); it != end(); it = it2) {
|
||||
it2 = it;
|
||||
it2++;
|
||||
if (it->seqMain() < 0) {
|
||||
++it2;
|
||||
int seqMainRes = it->seqMain();
|
||||
if (seqMainRes < 0) {
|
||||
Remove(&*it);
|
||||
if (it->mFlags.autoDelete) {
|
||||
delete &*it;
|
||||
|
||||
@@ -370,7 +370,8 @@ JASVoiceBank* JAUSection::newVoiceBank(u32 bank_no, u32 param_1) {
|
||||
JASWaveBank* waveBank = sectionHeap_->getWaveBankTable().getWaveBank(param_1);
|
||||
JUT_ASSERT(688, waveBank != 0);
|
||||
TPushCurrentHeap push(getHeap_());
|
||||
JASVoiceBank* voiceBank = new JASVoiceBank();
|
||||
JASBank* voiceBank = new JASVoiceBank();
|
||||
JASVoiceBank* voiceBank2 = (JASVoiceBank*)voiceBank;
|
||||
if (voiceBank) {
|
||||
if (buildingBankTable_) {
|
||||
JUT_ASSERT(696, buildingBankTable_->getBank( bank_no ) == 0);
|
||||
@@ -380,8 +381,8 @@ JASVoiceBank* JAUSection::newVoiceBank(u32 bank_no, u32 param_1) {
|
||||
JASDefaultBankTable::getInstance()->registBank(bank_no, voiceBank);
|
||||
data_.registeredBankTables.set(bank_no, true);
|
||||
}
|
||||
voiceBank->assignWaveBank(waveBank);
|
||||
return voiceBank;
|
||||
voiceBank2->assignWaveBank(waveBank);
|
||||
return voiceBank2;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -55,9 +55,8 @@ const JMessage::TResource* JMessage::TProcessor::getResource_groupID(u16 u16Grou
|
||||
|
||||
/* 802A7CD4-802A7E38 2A2614 0164+00 0/0 1/1 0/0 .text
|
||||
* toMessageCode_messageID__Q28JMessage10TProcessorCFUlUlPb */
|
||||
// NONMATCHING - regalloc, likely due to wrong enumerator implementation
|
||||
u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool* pbValid) const {
|
||||
const TResource* pResourceCache = getResourceCache();
|
||||
const TResource* pResourceCache = (const TResource*)getResourceCache();
|
||||
if (pResourceCache != NULL) {
|
||||
u16 u16Index = pResourceCache->toMessageIndex_messageID(uMsgID, param_1, pbValid);
|
||||
if (u16Index != 0xFFFF) {
|
||||
|
||||
@@ -636,10 +636,7 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
case Z2SE_OBJ_ARROW_SHOT_GAIN:
|
||||
case Z2SE_OBJ_ARROWBOMB_SHOT:
|
||||
case Z2SE_OBJ_ARROWBOMB_SHOTGAIN:
|
||||
Z2SoundHandlePool* handle = Z2GetLink()->mSoundObjAnime.getHandleSoundID(Z2SE_AL_DRAW_BOW);
|
||||
if (handle != NULL) {
|
||||
(*handle)->stop(0);
|
||||
}
|
||||
Z2GetLink()->mSoundObjAnime.stopSound(Z2SE_AL_DRAW_BOW, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -668,7 +665,7 @@ bool Z2LinkSoundStarter::startSound(JAISoundID i_soundID, JAISoundHandle* param_
|
||||
|
||||
bool ret = Z2SoundStarter::startSound(i_soundID, param_1, param_2, param_3, param_4, param_5,
|
||||
param_6, param_7, param_8, param_9);
|
||||
|
||||
|
||||
if (bVar2 && Z2GetSceneMgr()->getDemoSeWaveNum() != 114) {
|
||||
if (Z2GetLink()->mFlag5) {
|
||||
Z2GetLink()->startLinkSound(Z2SE_AL_SWORD_SHIELD_ADD, 0, param_4 * 127.0f);
|
||||
|
||||
Reference in New Issue
Block a user