diff options
| author | Luke Street <luke@street.dev> | 2026-03-01 15:35:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-01 14:35:36 -0800 |
| commit | 9649319ec4926457ef85e6094f8207474c977c2d (patch) | |
| tree | 1c5cd4c7cc4c1aee03f28921213da47f2775444d /libs/JSystem/src/JAudio2/JASBasicBank.cpp | |
| parent | 6e149819e13b1f70ecbf8a4c66b030c17ffed2bb (diff) | |
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
Diffstat (limited to 'libs/JSystem/src/JAudio2/JASBasicBank.cpp')
| -rw-r--r-- | libs/JSystem/src/JAudio2/JASBasicBank.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libs/JSystem/src/JAudio2/JASBasicBank.cpp b/libs/JSystem/src/JAudio2/JASBasicBank.cpp new file mode 100644 index 0000000000..510d7a718d --- /dev/null +++ b/libs/JSystem/src/JAudio2/JASBasicBank.cpp @@ -0,0 +1,49 @@ +#include "JSystem/JSystem.h" // IWYU pragma: keep + +#include "JSystem/JAudio2/JASBasicBank.h" +#include "JSystem/JAudio2/JASCalc.h" + +JASBasicBank::JASBasicBank() { + mInstTable = NULL; + mInstNumMax = 0; +} + +void JASBasicBank::newInstTable(u8 num, JKRHeap* heap) { + if (num != 0) { + JUT_ASSERT(31, num <= JASBank::PRG_OSC); + mInstNumMax = num; + mInstTable = new (heap, 0) JASInst*[mInstNumMax]; + JASCalc::bzero(mInstTable, mInstNumMax * 4); + } +} + +bool JASBasicBank::getInstParam(int prg_no, int param_1, int param_2, + JASInstParam* o_param) const { + JASInst* inst = getInst(prg_no); + if (inst == NULL) { + return NULL; + } + return inst->getParam(param_1, param_2, o_param); +} + +void JASBasicBank::setInst(int prg_no, JASInst* inst) { + if (mInstTable != NULL) { + JUT_ASSERT(50, prg_no < mInstNumMax); + JUT_ASSERT(54, prg_no >= 0); + JUT_ASSERT(56, mInstTable[prg_no] == 0); + mInstTable[prg_no] = inst; + } +} + +JASInst* JASBasicBank::getInst(int prg_no) const { + if (prg_no < 0) { + return NULL; + } + if (prg_no >= mInstNumMax) { + return NULL; + } + if (mInstTable == NULL) { + return NULL; + } + return mInstTable[prg_no]; +} |
