Files
tp/libs/JSystem/JAudio2/JASDrumSet.cpp
T

121 lines
3.2 KiB
C++
Raw Normal View History

2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
// Generated By: dol2asm
// Translation Unit: JASDrumSet
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
2021-04-01 02:07:58 +02:00
#include "JSystem/JAudio2/JASDrumSet.h"
2023-08-06 06:12:26 +03:00
#include "JSystem/JAudio2/JASCalc.h"
#include "JSystem/JKernel/JKRHeap.h"
2021-03-28 22:49:05 +02:00
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
// Types:
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
// Forward References:
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
// External References:
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
// Declarations:
2021-04-01 02:07:58 +02:00
//
2021-03-28 22:49:05 +02:00
/* ############################################################################################## */
2021-04-06 18:00:35 +02:00
/* 802982EC-80298314 292C2C 0028+00 0/0 2/2 0/0 .text __ct__10JASDrumSetFv */
2023-08-06 06:12:26 +03:00
JASDrumSet::JASDrumSet() {
field_0x4 = NULL;
field_0x8 = 0;
2021-03-28 22:49:05 +02:00
}
2021-04-06 18:00:35 +02:00
/* 80298314-80298370 292C54 005C+00 1/0 0/0 0/0 .text __dt__10JASDrumSetFv */
2023-08-06 06:12:26 +03:00
JASDrumSet::~JASDrumSet() {
2021-03-28 22:49:05 +02:00
}
2021-04-06 18:00:35 +02:00
/* 80298370-802983CC 292CB0 005C+00 0/0 2/2 0/0 .text newPercArray__10JASDrumSetFUcP7JKRHeap */
2023-08-06 06:12:26 +03:00
void JASDrumSet::newPercArray(u8 param_0, JKRHeap* param_1) {
if (param_0) {
field_0x8 = param_0;
field_0x4 = new (param_1, 0) TPerc*[field_0x8];
JASCalc::bzero(field_0x4, field_0x8 * sizeof(TPerc*));
}
2021-03-28 22:49:05 +02:00
}
/* ############################################################################################## */
2021-04-06 18:00:35 +02:00
/* 80431B58-80431B70 05E878 0018+00 1/1 0/0 0/0 .bss osc$213 */
2023-08-06 06:12:26 +03:00
static JASOscillator::Data osc;
2021-03-28 22:49:05 +02:00
2021-04-06 18:00:35 +02:00
/* 80451270-80451274 000770 0004+00 1/1 0/0 0/0 .sbss oscp$214 */
2023-08-06 06:12:26 +03:00
static JASOscillator::Data* oscp;
2021-03-28 22:49:05 +02:00
2021-04-06 18:00:35 +02:00
/* 80451274-80451278 000774 0004+00 1/1 0/0 0/0 .sbss None */
2023-08-06 06:12:26 +03:00
static s8 data_80451274[4];
2021-03-28 22:49:05 +02:00
2021-04-06 18:00:35 +02:00
/* 802983CC-802984B4 292D0C 00E8+00 1/0 0/0 0/0 .text getParam__10JASDrumSetCFiiP12JASInstParam */
2023-08-06 06:12:26 +03:00
bool JASDrumSet::getParam(int param_0, int param_1, JASInstParam* param_2) const {
if (field_0x4 == NULL) {
return false;
}
if (param_0 >= field_0x8) {
return false;
}
TPerc* perc = field_0x4[param_0];
if (perc == NULL) {
return false;
}
param_2->field_0x1c = 0;
param_2->field_0x1e = 1;
param_2->mVolume = perc->mVolume;
param_2->mPitch = perc->mPitch;
param_2->mPan = perc->mPan;
param_2->field_0x18 = perc->field_0xc;
osc._00 = 0;
osc._04 = 1.0f;
osc._08 = NULL;
osc._0C = NULL;
osc._10 = 1.0f;
osc._14 = 0.0f;
if (data_80451274[0] == 0) {
oscp = &osc;
data_80451274[0] = 1;
}
param_2->field_0x14 = &oscp;
param_2->field_0x1d = 1;
param_2->mVolume *= perc->field_0x10;
param_2->mPitch *= perc->field_0x14;
param_2->field_0x1a = perc->field_0xe;
return true;
2021-03-28 22:49:05 +02:00
}
2021-04-06 18:00:35 +02:00
/* 802984B4-802984C4 292DF4 0010+00 0/0 2/2 0/0 .text setPerc__10JASDrumSetFiPQ210JASDrumSet5TPerc
2021-04-01 02:07:58 +02:00
*/
2023-08-06 06:12:26 +03:00
void JASDrumSet::setPerc(int param_0, JASDrumSet::TPerc* param_1) {
field_0x4[param_0] = param_1;
2021-03-28 22:49:05 +02:00
}
/* ############################################################################################## */
2021-04-06 18:00:35 +02:00
/* 802984C4-802984E4 292E04 0020+00 0/0 2/2 0/0 .text __ct__Q210JASDrumSet5TPercFv */
2023-08-06 06:12:26 +03:00
JASDrumSet::TPerc::TPerc() {
mVolume = 1.0f;
mPitch = 1.0f;
mPan = 0.5f;
field_0xc = 1000;
2021-03-28 22:49:05 +02:00
}
/* 802984E4-802984EC -00001 0008+00 0/0 0/0 0/0 .text setRelease__Q210JASDrumSet5TPercFUl
2021-04-06 18:00:35 +02:00
*/
void JASDrumSet::TPerc::setRelease(u32 param_0) {
2023-08-06 06:12:26 +03:00
field_0xc = param_0;
2021-03-28 22:49:05 +02:00
}
2021-04-06 18:00:35 +02:00
/* 802984EC-802984F8 292E2C 000C+00 1/0 0/0 0/0 .text getType__10JASDrumSetCFv */
2023-08-06 06:12:26 +03:00
u32 JASDrumSet::getType() const { return 'PERC'; }