Skip to content

Commit

Permalink
JASOscillator minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTGL committed Aug 18, 2024
1 parent 4169b87 commit 353a9de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/JSystem/JAudio/JASOscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace JASystem {
struct Osc_ {
/* 0x00 */ u8 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ void* table;
/* 0x0C */ void* rel_table;
/* 0x08 */ s16* table;
/* 0x0C */ s16* rel_table;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
};
Expand Down
4 changes: 2 additions & 2 deletions src/JSystem/JAudio/JASOscillator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ f32 JASystem::TOscillator::getOffset() {
default:
s16* var_r4;
if (mState == 4) {
var_r4 = (s16*)mOsc->rel_table;
var_r4 = mOsc->rel_table;
} else if (mState == 5) {
var_r4 = oscTableForceStop;
} else {
var_r4 = (s16*)mOsc->table;
var_r4 = mOsc->table;
}

if (var_r4 == NULL && mState != 6) {
Expand Down
10 changes: 5 additions & 5 deletions src/JSystem/JAudio/JASTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void JASystem::TTrack::overwriteOsc(TChannel* param_1) {
}
param_1->copyOsc(r28, &field_0x2cc[i]);
} else if (var1 & 4) {
void* var4 = field_0x2cc[i].rel_table;
s16* var4 = field_0x2cc[i].rel_table;
if (!param_1->isOsc(r28)) {
JUT_WARN(603, "%s", "cannot copy osc");
continue;
Expand Down Expand Up @@ -390,26 +390,26 @@ void JASystem::TTrack::oscSetupFull(u8 param_1, u32 param_2, u32 param_3) {
if (param_2 == 0) {
field_0x2cc[var1].table = NULL;
}
field_0x2cc[var1].table = mSeqCtrl.mRawFilePtr + param_2;
field_0x2cc[var1].table = (s16*)(mSeqCtrl.mRawFilePtr + param_2);
}
if (!var5) {
return;
}
if (param_3 == 0) {
field_0x2cc[var1].rel_table = Player::sRelTable;
}
field_0x2cc[var1].rel_table = mSeqCtrl.mRawFilePtr + param_2;
field_0x2cc[var1].rel_table = (s16*)(mSeqCtrl.mRawFilePtr + param_2);
}

/* 802817E4-80281850 .text oscSetupSimpleEnv__Q28JASystem6TTrackFUcUl */
void JASystem::TTrack::oscSetupSimpleEnv(u8 param_1, u32 param_2) {
switch (param_1) {
case 0:
field_0x2cc[0] = Player::sEnvelopeDef;
field_0x2cc[0].table = mSeqCtrl.mRawFilePtr + param_2;
field_0x2cc[0].table = (s16*)(mSeqCtrl.mRawFilePtr + param_2);
break;
case 1:
field_0x2cc[0].rel_table = mSeqCtrl.mRawFilePtr + param_2;
field_0x2cc[0].rel_table = (s16*)(mSeqCtrl.mRawFilePtr + param_2);
break;
}
}
Expand Down

0 comments on commit 353a9de

Please sign in to comment.