mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-22 23:09:52 -04:00
Reorganize library code into libs/ (#3119)
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAudio2/JASAudioReseter.h"
|
||||
#include "JSystem/JAudio2/JASAudioThread.h"
|
||||
#include "JSystem/JAudio2/JASCriticalSection.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JAudio2/JASDSPChannel.h"
|
||||
#include <types.h>
|
||||
|
||||
JASAudioReseter::JASAudioReseter() {
|
||||
field_0x0 = 0;
|
||||
mDoneFlag = true;
|
||||
mThreadStopFlag = false;
|
||||
mDSPLevel = JASDriver::getDSPLevel();
|
||||
}
|
||||
|
||||
JASAudioReseter::~JASAudioReseter() {
|
||||
JUT_ASSERT(28, mDoneFlag);
|
||||
}
|
||||
|
||||
bool JASAudioReseter::start(u32 param_0, bool param_1) {
|
||||
if (mDoneFlag == false) {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
mDoneFlag = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void JASAudioReseter::resume() {
|
||||
JUT_ASSERT(55, mDoneFlag);
|
||||
JUT_ASSERT(56, ! mThreadStopFlag);
|
||||
JASDriver::setDSPLevel(mDSPLevel);
|
||||
}
|
||||
|
||||
s32 JASAudioReseter::checkDone() const {
|
||||
return mDoneFlag;
|
||||
}
|
||||
|
||||
s32 JASAudioReseter::calc() {
|
||||
if (field_0x0==0) {
|
||||
for (size_t i = 0; i<64; i++) {
|
||||
JASDSPChannel* handle = JASDSPChannel::getHandle(i);
|
||||
if (handle->getStatus() == 0) {
|
||||
handle->drop();
|
||||
}
|
||||
}
|
||||
if (mThreadStopFlag!=false) {
|
||||
JASAudioThread* pAudioThread = JASGlobalInstance<JASAudioThread>::getInstance();
|
||||
JUT_ASSERT(78, pAudioThread);
|
||||
pAudioThread->stop();
|
||||
}
|
||||
mDoneFlag = 1;
|
||||
return -1;
|
||||
}
|
||||
field_0x0--;
|
||||
JASDriver::setDSPLevel(field_0x0 * JASDriver::getDSPLevel() / (field_0x0 + 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 JASAudioReseter::callback(void* param_0) {
|
||||
JASAudioReseter* i_this = (JASAudioReseter*) param_0;
|
||||
return i_this->calc();
|
||||
}
|
||||
Reference in New Issue
Block a user