Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Oct 22, 2024
1 parent da6648d commit f8e615f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions include/JSystem/JAudio/JASTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,14 @@ namespace JASystem {
public:
TimedParam_();

#ifdef __MWERKS__
union {
AInnerParam_ mInnerParam;
MoveParam_ mMoveParams[TIMED_Count];
};
#else
MoveParam_ mMoveParams[TIMED_Count];
#endif
};

class TNoteMgr {
Expand Down
15 changes: 6 additions & 9 deletions src/JSystem/JAudio/JASSeqParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,8 @@ int JASystem::TSeqParser::cmdVibPitch(TTrack* track, u32* args) {
/* 8027F544-8027F5C8 .text cmdIIRSet__Q28JASystem10TSeqParserFPQ28JASystem6TTrackPUl */
int JASystem::TSeqParser::cmdIIRSet(TTrack* track, u32* args) {
for (u8 i = 0; i < 4; i++) {
// TTrack::MoveParam_* iir = &track->mTimedParam.mInnerParam.mIIRs[i];
// Fakematch? Accessing mIIRs directly results in fewer instructions than indexing into
// mVolume as if it was an array.
TTrack::MoveParam_* iir = (&track->mTimedParam.mInnerParam.mVolume) + (u8)(i + 0xC);
u8 iirIndex = TTrack::TIMED_IIR_Unk0 + i;
TTrack::MoveParam_* iir = &track->mTimedParam.mMoveParams[iirIndex];
iir->mTargetValue = (s16)args[i] / 32768.0f;
iir->mCurrentValue = iir->mTargetValue;
iir->mMoveAmount = 0.0f;
Expand All @@ -594,10 +592,8 @@ int JASystem::TSeqParser::cmdIIRCutOff(TTrack* track, u32* args) {
u8 iirTableIdx = args[0];
for (u8 i = 0; i < 4; i++) {
s16* table = &JASystem::Player::CUTOFF_TO_IIR_TABLE[iirTableIdx * 4];
// TTrack::MoveParam_* iir = &track->mTimedParam.mInnerParam.mIIRs[i];
// Fakematch? Accessing mIIRs directly results in fewer instructions than indexing into
// mVolume as if it was an array.
TTrack::MoveParam_* iir = (&track->mTimedParam.mInnerParam.mVolume) + (u8)(i + 0xC);
u8 iirIndex = TTrack::TIMED_IIR_Unk0 + i;
TTrack::MoveParam_* iir = &track->mTimedParam.mMoveParams[iirIndex];
iir->mTargetValue = table[i] / (32768.0f - 1.0f);
iir->mCurrentValue = iir->mTargetValue;
iir->mMoveAmount = 0.0f;
Expand Down Expand Up @@ -761,14 +757,15 @@ int JASystem::TSeqParser::cmdSetParam(TTrack* track, u8 param_2) {
case 4:
data = track->getSeq()->readByte();
break;
case 8:
case 8: {
u8 byte = track->getSeq()->readByte();
if (byte & 0x80) {
data = byte << 8;
} else {
data = byte << 8 | byte << 1;
}
break;
}
case 12:
data = track->getSeq()->read16();
break;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_obj_ebomzo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int daObjEbomzo::Act_c::Create() {
}
else mMode = Ebomzo_Mode_Check;

return TRUE;
return TRUE;
}

/* 0000021C-000003A0 .text Mthd_Create__Q211daObjEbomzo5Act_cFv */
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_sail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Vec l_pos[] = {
{840.0f, -1100.0f, 0.0f},
};

f32 l_texCoord[][2] = {
cXy l_texCoord[] = {
{0.0f, 0.0f},
{0.165f, 0.0f},
{0.33f, 0.0f},
Expand Down
2 changes: 1 addition & 1 deletion src/d/d_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static Vec l_pos[] = {
{ 2.0f, -1.522254f, 7.0f },

};
static f32 l_texCoord[][2] = {
static cXy l_texCoord[] = {
{ 0.02736f, 0.041406f },
{ 0.97264f, 0.041406f },
{ 0.830848f, 0.40324f },
Expand Down
2 changes: 2 additions & 0 deletions src/m_Do/m_Do_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#include "JSystem/JAudio/JAISequenceMgr.h"
#include "JSystem/JAudio/JAIStreamMgr.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#if VERSION == VERSION_JPN
#include "JSystem/JUtility/JUTConsole.h"
#endif
#include "SSystem/SComponent/c_lib.h"
#include "d/d_com_inf_game.h"
#include "m_Do/m_Do_controller_pad.h"
Expand Down

0 comments on commit f8e615f

Please sign in to comment.