mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-06 11:37:25 -04:00
JASHardStream OK
This commit is contained in:
+1
-1
@@ -769,7 +769,7 @@ config.libs = [
|
||||
Object(Matching, "JSystem/JAudio/JASDvdThread.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASCallback.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASRate.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASHardStream.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASHardStream.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASHeapCtrl.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASResArcLoader.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASProbe.cpp"),
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace JASystem {
|
||||
static int getNumBreak();
|
||||
|
||||
u8 getNumber() { return mNumber; }
|
||||
u8 getStatus() { return mStatus; }
|
||||
u8 getPriority() { return mPriority; }
|
||||
void setPriority(u8 priority) { mPriority = priority; }
|
||||
u16 getPriorityTime() { return mPriorityTime; }
|
||||
@@ -58,12 +59,11 @@ namespace JASystem {
|
||||
// TODO: inlines
|
||||
void checkSign(u32) {}
|
||||
void isFree() {}
|
||||
void getStatus() {}
|
||||
void forceStop(TDSPChannel*) {}
|
||||
void release(TDSPChannel*, u32) {}
|
||||
|
||||
/* 0x00 */ u8 mNumber;
|
||||
/* 0x01 */ u8 field_0x1;
|
||||
/* 0x01 */ u8 mStatus;
|
||||
/* 0x02 */ u8 field_0x2;
|
||||
/* 0x03 */ u8 mPriority;
|
||||
/* 0x04 */ u16 mPriorityTime;
|
||||
|
||||
@@ -124,6 +124,20 @@ namespace JASystem {
|
||||
void initBuffer();
|
||||
FXBuffer* getFXHandle(u8 param_1);
|
||||
|
||||
// TODO inlines
|
||||
inline void boot(void (*)(void*)) {}
|
||||
inline void finishWork(u16) {}
|
||||
inline void flushChannel(u8) {}
|
||||
inline void restart() {}
|
||||
inline void setBusConnect(u8, u8, u8) {}
|
||||
inline void setFXLine(u8, s16*, FxlineConfig_*) {}
|
||||
inline void setMixerInitDelayMax(u8, u8) {}
|
||||
inline void setMixerInitVolume(u8, u8, s16, u8) {}
|
||||
inline void setMixerVolume(u8, u8, s16, u8) {}
|
||||
inline void setPauseFlag(u8, u8) {}
|
||||
inline void setPitch(u8, u16) {}
|
||||
inline void sync(u32, u32, u32) {}
|
||||
|
||||
extern u16 SEND_TABLE[12];
|
||||
extern u32 DOLBY2_DELAY_BUF[];
|
||||
extern u16 JAS_DSP_PREFIX;
|
||||
|
||||
@@ -76,18 +76,18 @@ namespace JASystem {
|
||||
/* 0x0B */ u8 field_0xb;
|
||||
/* 0x0C */ f32 field_0xc;
|
||||
/* 0x10 */ f32 field_0x10;
|
||||
/* 0x14 */ int field_0x14;
|
||||
/* 0x18 */ int field_0x18;
|
||||
/* 0x1C */ int field_0x1c;
|
||||
/* 0x14 */ u32 field_0x14;
|
||||
/* 0x18 */ u32 field_0x18;
|
||||
/* 0x1C */ u32 field_0x1c;
|
||||
/* 0x20 */ f32 field_0x20;
|
||||
/* 0x24 */ f32 field_0x24;
|
||||
/* 0x28 */ f32 field_0x28;
|
||||
/* 0x2C */ f32 field_0x2c;
|
||||
/* 0x30 */ f32 field_0x30;
|
||||
/* 0x34 */ f32 field_0x34;
|
||||
/* 0x38 */ int field_0x38;
|
||||
/* 0x3C */ int field_0x3c;
|
||||
/* 0x40 */ int field_0x40;
|
||||
/* 0x38 */ u32 field_0x38;
|
||||
/* 0x3C */ u32 field_0x3c;
|
||||
/* 0x40 */ u32 field_0x40;
|
||||
/* 0x44 */ u32 field_0x44[2];
|
||||
/* 0x4C */ u8 field_0x4c;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/* 8028963C-80289694 .text init__Q28JASystem11TDSPChannelFUc */
|
||||
void JASystem::TDSPChannel::init(u8 param_1) {
|
||||
mNumber = param_1;
|
||||
field_0x1 = 1;
|
||||
mStatus = 1;
|
||||
field_0x8 = 0;
|
||||
mCBInterval = 0;
|
||||
mCallback = NULL;
|
||||
@@ -27,14 +27,14 @@ void JASystem::TDSPChannel::init(u8 param_1) {
|
||||
|
||||
/* 80289694-80289720 .text allocate__Q28JASystem11TDSPChannelFUl */
|
||||
int JASystem::TDSPChannel::allocate(u32 param_1) {
|
||||
if (field_0x1 != 1) {
|
||||
if (mStatus != 1) {
|
||||
return false;
|
||||
}
|
||||
BOOL r0 = (field_0x8 == 0) ? TRUE : FALSE;
|
||||
if (!r0) {
|
||||
OSReport("sign %x があるのにCH.%d はFREE\n", field_0x8, mNumber);
|
||||
}
|
||||
field_0x1 = 0;
|
||||
mStatus = 0;
|
||||
field_0x8 = param_1;
|
||||
mPriority = 1;
|
||||
field_0xc->allocInit();
|
||||
@@ -43,7 +43,7 @@ int JASystem::TDSPChannel::allocate(u32 param_1) {
|
||||
|
||||
/* 80289720-8028973C .text free__Q28JASystem11TDSPChannelFv */
|
||||
void JASystem::TDSPChannel::free() {
|
||||
field_0x1 = 1;
|
||||
mStatus = 1;
|
||||
mPriority = 0;
|
||||
mCallback = NULL;
|
||||
field_0x8 = 0;
|
||||
@@ -54,10 +54,10 @@ int JASystem::TDSPChannel::smnUse;
|
||||
|
||||
/* 8028973C-802897E0 .text forceStop__Q28JASystem11TDSPChannelFv */
|
||||
bool JASystem::TDSPChannel::forceStop() {
|
||||
if (field_0x1 == 2) {
|
||||
if (mStatus == 2) {
|
||||
return false;
|
||||
}
|
||||
if (field_0x1 == 1) {
|
||||
if (mStatus == 1) {
|
||||
OSReport("----- JASDSPChannel::forceStop Warning! : CH_FREE\n");
|
||||
return false;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ bool JASystem::TDSPChannel::forceStop() {
|
||||
smnUse--;
|
||||
field_0xc->field_0x10a = 1;
|
||||
field_0xc->flushChannel();
|
||||
field_0x1 = 2;
|
||||
mStatus = 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::alloc(u32 param_1, u32 param_2) {
|
||||
}
|
||||
int i = 0;
|
||||
do {
|
||||
BOOL r0 = DSPCH[i].field_0x1 == 1 ? TRUE : FALSE;
|
||||
BOOL r0 = DSPCH[i].getStatus() == 1 ? TRUE : FALSE;
|
||||
if (r0 && DSPCH[i].allocate(param_2)) {
|
||||
smnFree--;
|
||||
smnUse++;
|
||||
@@ -131,22 +131,22 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::alloc(u32 param_1, u32 param_2) {
|
||||
}
|
||||
|
||||
/* 80289A54-80289AF4 .text free__Q28JASystem11TDSPChannelFPQ28JASystem11TDSPChannelUl */
|
||||
int JASystem::TDSPChannel::free(JASystem::TDSPChannel* param_1, u32 param_2) {
|
||||
if (!param_1) {
|
||||
int JASystem::TDSPChannel::free(JASystem::TDSPChannel* dspch, u32 param_2) {
|
||||
if (!dspch) {
|
||||
OSReport("----- JASDSPChannel::free : NULL のチャネルを解放しようとしました\n");
|
||||
return -1;
|
||||
}
|
||||
if (param_1->field_0x8 != param_2) {
|
||||
if (dspch->field_0x8 != param_2) {
|
||||
OSReport("----- JASDSPChannel::free : BAD USERが開放を試みた\n");
|
||||
return -2;
|
||||
}
|
||||
if (param_1->field_0x1 == 0) {
|
||||
if (dspch->getStatus() == 0) {
|
||||
smnUse--;
|
||||
}
|
||||
if (param_1->field_0x1 != 1) {
|
||||
if (dspch->getStatus() != 1) {
|
||||
smnFree++;
|
||||
}
|
||||
param_1->free();
|
||||
dspch->free();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -157,16 +157,16 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::getLower() {
|
||||
u32 r29 = 0;
|
||||
for (u8 i = 0; i < 64; i++) {
|
||||
u8 r27;
|
||||
TDSPChannel* dspch = DSPCH + i;
|
||||
if (dspch->field_0x1 == 2) {
|
||||
TDSPChannel* dspch = &DSPCH[i];
|
||||
if (dspch->getStatus() == 2) {
|
||||
continue;
|
||||
}
|
||||
if (dspch->field_0x1 == 1) {
|
||||
if (dspch->getStatus() == 1) {
|
||||
r30 = i;
|
||||
break;
|
||||
}
|
||||
if (dspch->mCallback) {
|
||||
r27 = dspch->mPriority;
|
||||
r27 = dspch->getPriority();
|
||||
if (r27 <= r31) {
|
||||
JUT_ASSERT(305, i == dspch->getNumber());
|
||||
if (r27 != r31 || dspch->field_0xc->field_0x10c >= r29) {
|
||||
@@ -177,21 +177,26 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::getLower() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return DSPCH + r30;
|
||||
return &DSPCH[r30];
|
||||
}
|
||||
|
||||
/* 80289C0C-80289D10 .text getLowerActive__Q28JASystem11TDSPChannelFv */
|
||||
JASystem::TDSPChannel* JASystem::TDSPChannel::getLowerActive() {
|
||||
/* Nonmatching */
|
||||
u8 r29 = 0xff;
|
||||
u8 r28 = 0;
|
||||
u32 r27 = 0;
|
||||
for (u8 i = 0; i < 64; i++) {
|
||||
TDSPChannel* dspch = DSPCH + i;
|
||||
if (dspch->field_0x1 == 2 || dspch->field_0x1 == 1) {
|
||||
/* Nonmatching - regalloc */
|
||||
u8 i;
|
||||
u32 r27;
|
||||
u8 r29;
|
||||
u8 r28;
|
||||
u8 r30;
|
||||
r29 = 0xff;
|
||||
r28 = 0;
|
||||
r27 = 0;
|
||||
for (i = 0; i < 64; i++) {
|
||||
TDSPChannel* dspch = &DSPCH[i];
|
||||
if (dspch->getStatus() == 2 || dspch->getStatus() == 1) {
|
||||
continue;
|
||||
}
|
||||
u8 r30 = dspch->mPriority;
|
||||
r30 = dspch->getPriority();
|
||||
if (r30 <= r29) {
|
||||
JUT_ASSERT(345, i == dspch->getNumber());
|
||||
if (r30 != r29 || dspch->field_0xc->field_0x10c >= r27) {
|
||||
@@ -201,16 +206,16 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::getLowerActive() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return DSPCH + r28;
|
||||
return &DSPCH[r28];
|
||||
}
|
||||
|
||||
/* 80289D10-80289DC8 .text breakLower__Q28JASystem11TDSPChannelFUc */
|
||||
BOOL JASystem::TDSPChannel::breakLower(u8 param_1) {
|
||||
TDSPChannel* dspch = getLower();
|
||||
if (dspch->mPriority > param_1) {
|
||||
if (dspch->getPriority() > param_1) {
|
||||
return false;
|
||||
}
|
||||
if (dspch->field_0x1 != 1) {
|
||||
if (dspch->getStatus() != 1) {
|
||||
if (dspch->mCallback) {
|
||||
dspch->onUpdate(3);
|
||||
} else {
|
||||
@@ -227,10 +232,10 @@ BOOL JASystem::TDSPChannel::breakLower(u8 param_1) {
|
||||
/* 80289DC8-80289E68 .text breakLowerActive__Q28JASystem11TDSPChannelFUc */
|
||||
bool JASystem::TDSPChannel::breakLowerActive(u8 param_1) {
|
||||
TDSPChannel* dspch = getLowerActive();
|
||||
if (dspch->mPriority > param_1) {
|
||||
if (dspch->getPriority() > param_1) {
|
||||
return false;
|
||||
}
|
||||
if (dspch->field_0x1 != 1) {
|
||||
if (dspch->getStatus() != 1) {
|
||||
if (dspch->mCallback) {
|
||||
dspch->onUpdate(3);
|
||||
}
|
||||
@@ -270,7 +275,7 @@ void JASystem::TDSPChannel::updateAll() {
|
||||
}
|
||||
dspBuffer = DSPCH[i].field_0xc;
|
||||
TDSPChannel* dspChannel = &DSPCH[i];
|
||||
if (dspChannel->field_0x1 == 1) {
|
||||
if (dspChannel->getStatus() == 1) {
|
||||
continue;
|
||||
}
|
||||
if (dspBuffer->field_0x2 != 0) {
|
||||
@@ -280,7 +285,7 @@ void JASystem::TDSPChannel::updateAll() {
|
||||
dspBuffer->field_0x2 = 0;
|
||||
dspBuffer->field_0x0 = 0;
|
||||
dspBuffer->flushChannel();
|
||||
if (dspChannel->field_0x1 == 1) {
|
||||
if (dspChannel->getStatus() == 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -318,7 +323,7 @@ void JASystem::TDSPChannel::onUpdate(u32 param_1) {
|
||||
int JASystem::TDSPChannel::getNumBreak() {
|
||||
int count = 0;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
if (DSPCH[i].field_0x1 == 2) {
|
||||
if (DSPCH[i].getStatus() == 2) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void JASystem::HardStream::getAddrCallback(s32 param_1, DVDCommandBlock* param_2
|
||||
}
|
||||
}
|
||||
|
||||
static float dummy1() {
|
||||
static f32 dummy1() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -297,6 +297,9 @@ static void dummy2() {
|
||||
OSReport("[JASHardStream::registBgmPair] このペア(%d)にはイントロ/ループともにありませんので登録できません。\n");
|
||||
OSReport("new_list != 0");
|
||||
OSReport("[JASHardStream::playBgm] まだ前の曲が再生中ですので、新たに開始できません。\n");
|
||||
OSReport("[JASHardStream::main] ファイルが開けません。(%s)\n");
|
||||
OSReport("finfo != 0");
|
||||
OSReport("");
|
||||
}
|
||||
|
||||
/* 8027C5B4-8027C648 .text fileOpen__Q38JASystem10HardStream8TControlFUsP11DVDFileInfo */
|
||||
@@ -382,7 +385,65 @@ u8 JASystem::HardStream::TControl::getCurVol() {
|
||||
|
||||
/* 8027C900-8027CB5C .text calcCurVolume__Q38JASystem10HardStream8TControlFv */
|
||||
void JASystem::HardStream::TControl::calcCurVolume() {
|
||||
/* Nonmatching */
|
||||
f32 f0 = 1.0f;
|
||||
f32 f30 = 1.0f;
|
||||
f32 f29 = 1.0f;
|
||||
|
||||
if (field_0x14 != 0) {
|
||||
if (field_0x38 == 0)
|
||||
field_0x20 = 1.0f / (f32)field_0x14;
|
||||
|
||||
f30 = field_0x20 * (f32)field_0x38;
|
||||
|
||||
if (f30 >= 1.0f) {
|
||||
f30 = 1.0f;
|
||||
field_0x14 = 0;
|
||||
field_0x20 = 0.0f;
|
||||
field_0x38 = 0;
|
||||
} else {
|
||||
++field_0x38;
|
||||
}
|
||||
}
|
||||
|
||||
if (field_0x18 != 0) {
|
||||
if (field_0x3c == 0)
|
||||
field_0x24 = 1.0f / (f32)field_0x18;
|
||||
|
||||
f29 = 1.0f - field_0x24 * (f32)field_0x3c;
|
||||
|
||||
if (f29 <= 0.0f) {
|
||||
f29 = 0.0f;
|
||||
|
||||
resetFader();
|
||||
field_0xb = 6;
|
||||
|
||||
unregistBgmAll();
|
||||
} else {
|
||||
++field_0x3c;
|
||||
}
|
||||
}
|
||||
|
||||
if (field_0x1c != 0) {
|
||||
if (field_0x40 == 0)
|
||||
field_0x34 = (field_0x28 - field_0x30) / (f32)field_0x1c;
|
||||
|
||||
f32 fVar2 = field_0x34 * (f32)field_0x40 + field_0x30;
|
||||
if (field_0x40 >= field_0x1c) {
|
||||
fVar2 = field_0x28;
|
||||
field_0x30 = fVar2;
|
||||
field_0x28 = field_0x30;
|
||||
field_0x1c = 0;
|
||||
field_0x34 = 0.0f;
|
||||
field_0x40 = 0;
|
||||
} else {
|
||||
++field_0x40;
|
||||
}
|
||||
field_0x2c = fVar2;
|
||||
}
|
||||
|
||||
f0 *= field_0x2c * (f30 * f29);
|
||||
f0 *= field_0xc;
|
||||
field_0x10 = f0;
|
||||
}
|
||||
|
||||
/* 8027CB5C-8027CB9C .text volFloatToU8__Q38JASystem10HardStream8TControlFf */
|
||||
|
||||
Reference in New Issue
Block a user