mirror of https://github.com/zeldaret/tp.git
137 lines
3.9 KiB
C++
137 lines
3.9 KiB
C++
//
|
|
// Generated By: dol2asm
|
|
// Translation Unit: JASBasicInst
|
|
//
|
|
|
|
#include "JSystem/JAudio2/JASBasicInst.h"
|
|
#include "JSystem/JAudio2/JASCalc.h"
|
|
#include "JSystem/JKernel/JKRHeap.h"
|
|
#include "dol2asm.h"
|
|
|
|
//
|
|
// Types:
|
|
//
|
|
|
|
//
|
|
// Forward References:
|
|
//
|
|
|
|
extern "C" void __ct__12JASBasicInstFv();
|
|
extern "C" void __dt__12JASBasicInstFv();
|
|
extern "C" void getParam__12JASBasicInstCFiiP12JASInstParam();
|
|
extern "C" void setKeyRegionCount__12JASBasicInstFUlP7JKRHeap();
|
|
extern "C" void setOsc__12JASBasicInstFiPCQ213JASOscillator4Data();
|
|
extern "C" void getKeyRegion__12JASBasicInstFi();
|
|
extern "C" void __dt__Q212JASBasicInst7TKeymapFv();
|
|
extern "C" void __dt__7JASInstFv();
|
|
extern "C" void __ct__Q212JASBasicInst7TKeymapFv();
|
|
extern "C" void getType__12JASBasicInstCFv();
|
|
|
|
//
|
|
// External References:
|
|
//
|
|
|
|
extern "C" void bzero__7JASCalcFPvUl();
|
|
extern "C" void* __nwa__FUlP7JKRHeapi();
|
|
extern "C" void __dl__FPv();
|
|
extern "C" void __destroy_new_array();
|
|
extern "C" void __construct_new_array();
|
|
extern "C" void _savegpr_29();
|
|
extern "C" void _restgpr_29();
|
|
|
|
//
|
|
// Declarations:
|
|
//
|
|
|
|
/* ############################################################################################## */
|
|
|
|
// /* 803C76FC-803C7710 02481C 0014+00 3/3 2/2 0/0 .data __vt__7JASInst */
|
|
SECTION_DATA extern void* __vt__7JASInst[5];
|
|
|
|
/* 80298014-8029807C 292954 0068+00 0/0 2/2 0/0 .text __ct__12JASBasicInstFv */
|
|
JASBasicInst::JASBasicInst() {
|
|
mVolume = 1.0;
|
|
mPitch = 1.0;
|
|
mKeymapCount = 0;
|
|
mKeymap = NULL;
|
|
JASCalc::bzero(field_0xc, sizeof(field_0xc));
|
|
}
|
|
|
|
/* 8029807C-802980F8 2929BC 007C+00 1/0 0/0 0/0 .text __dt__12JASBasicInstFv */
|
|
JASBasicInst::~JASBasicInst() {
|
|
delete[] mKeymap;
|
|
}
|
|
|
|
/* 802980F8-8029819C 292A38 00A4+00 1/0 0/0 0/0 .text getParam__12JASBasicInstCFiiP12JASInstParam
|
|
*/
|
|
bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) const {
|
|
param_2->field_0x1c = 0;
|
|
param_2->field_0x1e = 0;
|
|
param_2->field_0x14 = (JASOscillator::Data**)&field_0xc;
|
|
param_2->field_0x1d = 2;
|
|
param_2->mVolume = mVolume;
|
|
param_2->mPitch = mPitch;
|
|
|
|
TKeymap* keyMap = NULL;
|
|
for (int i = 0; i < mKeymapCount; i++) {
|
|
if (param_0 <= mKeymap[i].field_0x0) {
|
|
keyMap = &mKeymap[i];
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (keyMap == NULL) {
|
|
return false;
|
|
}
|
|
|
|
param_2->mVolume *= keyMap->field_0x8;
|
|
param_2->mPitch *= keyMap->field_0xc;
|
|
param_2->field_0x1a = keyMap->field_0x4;
|
|
return true;
|
|
}
|
|
|
|
/* 8029819C-8029821C 292ADC 0080+00 0/0 2/2 0/0 .text
|
|
* setKeyRegionCount__12JASBasicInstFUlP7JKRHeap */
|
|
void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap* param_1) {
|
|
delete [] mKeymap;
|
|
mKeymap = new (param_1, 0) TKeymap[count];
|
|
mKeymapCount = count;
|
|
}
|
|
|
|
/* 8029821C-8029822C 292B5C 0010+00 0/0 2/2 0/0 .text
|
|
* setOsc__12JASBasicInstFiPCQ213JASOscillator4Data */
|
|
void JASBasicInst::setOsc(int param_0, JASOscillator::Data const* param_1) {
|
|
field_0xc[param_0] = param_1;
|
|
}
|
|
|
|
/* 8029822C-80298250 292B6C 0024+00 0/0 2/2 0/0 .text getKeyRegion__12JASBasicInstFi */
|
|
JASBasicInst::TKeymap* JASBasicInst::getKeyRegion(int param_0) {
|
|
if (param_0 >= mKeymapCount) {
|
|
return NULL;
|
|
}
|
|
|
|
return mKeymap + param_0;
|
|
}
|
|
|
|
/* 80298250-8029828C 292B90 003C+00 2/2 0/0 0/0 .text __dt__Q212JASBasicInst7TKeymapFv */
|
|
JASBasicInst::TKeymap::~TKeymap() {
|
|
}
|
|
|
|
/* 8029828C-802982D4 292BCC 0048+00 1/0 0/0 0/0 .text __dt__7JASInstFv */
|
|
// If not here, default placement is after JASBasicInst::JASBasicInst
|
|
#pragma push
|
|
#pragma optimization_level 0
|
|
#pragma optimizewithasm off
|
|
//asm JASInst::~JASInst() {
|
|
asm void __dt__7JASInstFv() {
|
|
nofralloc
|
|
#include "asm/JSystem/JAudio2/JASBasicInst/__dt__7JASInstFv.s"
|
|
}
|
|
#pragma pop
|
|
|
|
/* 802982D4-802982E0 292C14 000C+00 1/1 0/0 0/0 .text __ct__Q212JASBasicInst7TKeymapFv */
|
|
JASBasicInst::TKeymap::TKeymap() {
|
|
field_0x0 = -1;
|
|
}
|
|
|