mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-12 21:14:38 -04:00
JAudio2 debug (#3006)
This commit is contained in:
@@ -10,41 +10,46 @@ struct JASDSPChannel {
|
||||
void drop();
|
||||
static JASDSPChannel* getHandle(u32);
|
||||
|
||||
inline u32 getStatus() {return mStatus;}
|
||||
inline u8 getStatus() const { return mStatus; }
|
||||
u32 mStatus;
|
||||
};
|
||||
|
||||
JASAudioReseter::JASAudioReseter() {
|
||||
field_0x0 = 0;
|
||||
mIsDone = true;
|
||||
field_0xc = false;
|
||||
mDoneFlag = true;
|
||||
mThreadStopFlag = false;
|
||||
mDSPLevel = JASDriver::getDSPLevel();
|
||||
}
|
||||
|
||||
JASAudioReseter::~JASAudioReseter() {}
|
||||
JASAudioReseter::~JASAudioReseter() {
|
||||
JUT_ASSERT(28, mDoneFlag);
|
||||
}
|
||||
|
||||
bool JASAudioReseter::start(u32 param_0, bool param_1) {
|
||||
if (mIsDone == false) {
|
||||
if (mDoneFlag == false) {
|
||||
return false;
|
||||
}
|
||||
field_0xc = param_1;
|
||||
mThreadStopFlag = param_1;
|
||||
JASCriticalSection critical;
|
||||
if (!JASDriver::registerDspSyncCallback(callback, this)) {
|
||||
JUT_WARN(40, "%s", "Failed JASAudioReseter start\n");
|
||||
return false;
|
||||
} else {
|
||||
mDSPLevel = JASDriver::getDSPLevel();
|
||||
field_0x0 = param_0;
|
||||
mIsDone = false;
|
||||
mDoneFlag = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void JASAudioReseter::resume() {
|
||||
JUT_ASSERT(55, mDoneFlag);
|
||||
JUT_ASSERT(56, ! mThreadStopFlag);
|
||||
JASDriver::setDSPLevel(mDSPLevel);
|
||||
}
|
||||
|
||||
s32 JASAudioReseter::checkDone() const {
|
||||
return mIsDone;
|
||||
return mDoneFlag;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,23 +57,24 @@ s32 JASAudioReseter::calc() {
|
||||
if(field_0x0==0) {
|
||||
for(size_t i = 0; i<64; i++) {
|
||||
JASDSPChannel* handle = JASDSPChannel::getHandle(i);
|
||||
if ((handle->getStatus()&0xFF)==0) {
|
||||
if ((handle->getStatus())==0) {
|
||||
handle->drop();
|
||||
}
|
||||
}
|
||||
if(field_0xc!=false) {
|
||||
JASGlobalInstance<JASAudioThread>::getInstance()->stop();//JASGlobalInstance<JASAudioThread>::sInstance->stop();
|
||||
if(mThreadStopFlag!=false) {
|
||||
JASAudioThread* pAudioThread = JASGlobalInstance<JASAudioThread>::getInstance();
|
||||
JUT_ASSERT(78, pAudioThread);
|
||||
pAudioThread->stop();
|
||||
}
|
||||
mIsDone = 1;
|
||||
mDoneFlag = 1;
|
||||
return -1;
|
||||
}
|
||||
field_0x0--;
|
||||
u32 unk = field_0x0;
|
||||
float dspLevel = JASDriver::getDSPLevel();
|
||||
JASDriver::setDSPLevel(((float)unk*dspLevel)/(float)(unk+1));
|
||||
JASDriver::setDSPLevel(field_0x0 * JASDriver::getDSPLevel() / (field_0x0 + 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 JASAudioReseter::callback(void* param_0) {
|
||||
return ((JASAudioReseter*)param_0)->calc();
|
||||
JASAudioReseter* i_this = (JASAudioReseter*) param_0;
|
||||
return i_this->calc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user