mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-21 22:10:59 -04:00
JASSeqParser work
This commit is contained in:
@@ -43,7 +43,7 @@ namespace JASystem {
|
||||
/* 0x5A */ u8 field_0x5a[6];
|
||||
/* 0x60 */ u8 field_0x60;
|
||||
/* 0x61 */ u8 field_0x61;
|
||||
/* 0x62 */ u8 field_0x62[3];
|
||||
/* 0x62 */ u8 mCalcTypes[3];
|
||||
/* 0x68 */ int field_0x68;
|
||||
/* 0x6C */ u16 field_0x6c;
|
||||
/* 0x70 */ int field_0x70;
|
||||
|
||||
@@ -12,15 +12,23 @@ namespace JASystem {
|
||||
u8 getBankNumber() const;
|
||||
u8 getProgramNumber() const;
|
||||
|
||||
/* 0x00 */ short field_0x0;
|
||||
/* 0x02 */ short field_0x2;
|
||||
/* 0x04 */ short field_0x4;
|
||||
/* 0x06 */ short field_0x6;
|
||||
/* 0x08 */ short field_0x8;
|
||||
/* 0x0A */ short field_0xa;
|
||||
void getAddress(int) const {}
|
||||
void getBendSense() const {}
|
||||
void getFlag() const {}
|
||||
void getPanPowerBank() const {}
|
||||
void getPanPowerExt() const {}
|
||||
void getPanPowerOsc() const {}
|
||||
void getPanPowerParent() const {}
|
||||
void getPanPowerTrack() const {}
|
||||
void getPriority() const {}
|
||||
void setAddress(int, u32) {}
|
||||
void setFlag(u16) {}
|
||||
void setPanPower(int i, u16 power) { mPanPower[i] = power; }
|
||||
|
||||
/* 0x00 */ u16 field_0x0[6];
|
||||
/* 0x0C */ u16 field_0xc;
|
||||
/* 0x0E */ u16 field_0xe;
|
||||
/* 0x10 */ u16 field_0x10[5];
|
||||
/* 0x10 */ u16 mPanPower[5];
|
||||
/* 0x1A */ u16 field_0x1a;
|
||||
/* 0x1C */ int field_0x1c;
|
||||
/* 0x20 */ int field_0x20;
|
||||
|
||||
@@ -8,19 +8,32 @@ namespace JASystem {
|
||||
|
||||
class TSeqCtrl {
|
||||
public:
|
||||
void call(u32) {}
|
||||
void clrIntr() {}
|
||||
void getAddr(u32) {}
|
||||
void getBase() {}
|
||||
u8 getByte(u32 offset) const { return field_0x0[offset]; }
|
||||
void call(u32 offset) {
|
||||
mLoopStartPositions[mLoopIndex++] = mCurrentFilePtr;
|
||||
mCurrentFilePtr = mRawFilePtr + offset;
|
||||
}
|
||||
void clrIntr() { mPreviousFilePtr = 0; }
|
||||
u8* getAddr(u32 offset) { return mRawFilePtr + offset; }
|
||||
u8* getBase() { return mRawFilePtr; }
|
||||
u8 getByte(u32 offset) const { return mRawFilePtr[offset]; }
|
||||
void getLoopCount() const {}
|
||||
void getWait() const {}
|
||||
void isIntr() const {}
|
||||
void jump(u32) {}
|
||||
void loopStart(u32) {}
|
||||
u8 readByte() { return *field_0x4++; }
|
||||
void ret() {}
|
||||
void wait(s32) {}
|
||||
void jump(u32 offset) {
|
||||
mCurrentFilePtr = mRawFilePtr + offset;
|
||||
}
|
||||
void loopStart(u32 timer) {
|
||||
mLoopStartPositions[mLoopIndex] = mCurrentFilePtr;
|
||||
mLoopTimers[mLoopIndex++] = timer;
|
||||
}
|
||||
u8 readByte() { return *mCurrentFilePtr++; }
|
||||
bool ret() {
|
||||
mCurrentFilePtr = mLoopStartPositions[--mLoopIndex];
|
||||
return true;
|
||||
}
|
||||
void wait(s32 timer) {
|
||||
mWaitTimer = timer;
|
||||
}
|
||||
|
||||
void init();
|
||||
void start(void*, u32);
|
||||
@@ -34,14 +47,14 @@ namespace JASystem {
|
||||
u32 read16();
|
||||
u32 read24();
|
||||
|
||||
/* 0x00 */ u8* field_0x0;
|
||||
/* 0x04 */ u8* field_0x4;
|
||||
/* 0x08 */ int field_0x8;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u8* field_0x10[8];
|
||||
/* 0x30 */ u16 field_0x30[8];
|
||||
/* 0x00 */ u8* mRawFilePtr;
|
||||
/* 0x04 */ u8* mCurrentFilePtr;
|
||||
/* 0x08 */ int mWaitTimer;
|
||||
/* 0x0C */ u32 mLoopIndex;
|
||||
/* 0x10 */ u8* mLoopStartPositions[8];
|
||||
/* 0x30 */ u16 mLoopTimers[8];
|
||||
/* 0x40 */ int field_0x40;
|
||||
/* 0x44 */ u8* field_0x44;
|
||||
/* 0x44 */ u8* mPreviousFilePtr;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -59,17 +59,19 @@ namespace JASystem {
|
||||
int cmdOscFull(TTrack*, u32*);
|
||||
int cmdCheckWave(TTrack*, u32*);
|
||||
int cmdPrintf(TTrack*, u32*);
|
||||
void Cmd_Process(TTrack*, u8, u16);
|
||||
void RegCmd_Process(TTrack*, int, int);
|
||||
int Cmd_Process(TTrack*, u8, u16);
|
||||
int RegCmd_Process(TTrack*, int, int);
|
||||
int cmdSetParam(TTrack*, u8);
|
||||
int cmdWait(TTrack*, u8);
|
||||
int cmdNoteOff(TTrack*, u8);
|
||||
int cmdNoteOn(TTrack*, u8);
|
||||
bool conditionCheck(TTrack*, u8);
|
||||
void parseSeq(TTrack*);
|
||||
int parseSeq(TTrack*);
|
||||
|
||||
static int (TSeqParser::*sCmdPList[])(TTrack*, u32*);
|
||||
};
|
||||
|
||||
extern const u16 Arglist[0x40][2];
|
||||
}
|
||||
|
||||
#endif /* JASSEQPARSER_H */
|
||||
|
||||
@@ -38,13 +38,38 @@ namespace JASystem {
|
||||
void incCounter();
|
||||
f32 getValue() const;
|
||||
|
||||
void setDepth(f32 depth) { mDepth = depth; }
|
||||
void setPitch(f32 pitch) { mPitch = pitch; }
|
||||
|
||||
/* 0x00 */ f32 field_0x0;
|
||||
/* 0x04 */ f32 field_0x4;
|
||||
/* 0x08 */ f32 field_0x8;
|
||||
/* 0x04 */ f32 mDepth;
|
||||
/* 0x08 */ f32 mPitch;
|
||||
};
|
||||
|
||||
class TTrack {
|
||||
public:
|
||||
enum TimedParamType {
|
||||
TIMED_Volume = 0,
|
||||
TIMED_Pitch = 1,
|
||||
TIMED_Fxmix = 2,
|
||||
TIMED_Pan = 3,
|
||||
TIMED_Dolby = 4,
|
||||
TIMED_Unk5 = 5,
|
||||
TIMED_Osc0_Width = 6,
|
||||
TIMED_Osc0_Rate = 7,
|
||||
TIMED_Osc0_Vertex = 8,
|
||||
TIMED_Osc1_Width = 9,
|
||||
TIMED_Osc1_Rate = 10,
|
||||
TIMED_Osc1_Vertex = 11,
|
||||
TIMED_IIR_Unk0 = 12,
|
||||
TIMED_IIR_Unk1 = 13,
|
||||
TIMED_IIR_Unk2 = 14,
|
||||
TIMED_IIR_Unk3 = 15,
|
||||
TIMED_Unk16 = 16,
|
||||
TIMED_Unk17 = 17,
|
||||
TIMED_Count, // 18
|
||||
};
|
||||
|
||||
class TOuterParam {
|
||||
public:
|
||||
TOuterParam();
|
||||
@@ -73,17 +98,18 @@ namespace JASystem {
|
||||
public:
|
||||
MoveParam_();
|
||||
|
||||
/* 0x00 */ f32 field_0x0;
|
||||
/* 0x04 */ f32 field_0x4;
|
||||
/* 0x08 */ f32 field_0x8;
|
||||
/* 0x0C */ f32 field_0xc;
|
||||
/* 0x00 */ f32 mCurrentValue;
|
||||
/* 0x04 */ f32 mTargetValue;
|
||||
/* 0x08 */ f32 mMoveTime;
|
||||
/* 0x0C */ f32 mMoveAmount;
|
||||
};
|
||||
|
||||
class AInnerParam_ {
|
||||
public:
|
||||
AInnerParam_();
|
||||
|
||||
/* 0x000 */ f32 field_0x0[48];
|
||||
/* 0x000 */ MoveParam_ mIIRs[4];
|
||||
/* 0x010 */ f32 field_0x10[32];
|
||||
/* 0x0C0 */ MoveParam_ field_0xc0[4];
|
||||
/* 0x100 */ f32 field_0x100[8];
|
||||
};
|
||||
@@ -93,8 +119,8 @@ namespace JASystem {
|
||||
TimedParam_();
|
||||
|
||||
union {
|
||||
AInnerParam_ inner;
|
||||
MoveParam_ move[18];
|
||||
AInnerParam_ mInnerParam;
|
||||
MoveParam_ mMoveParams[TIMED_Count];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -106,12 +132,12 @@ namespace JASystem {
|
||||
void releaseChannel(int);
|
||||
TChannel* getChannel(int);
|
||||
|
||||
TChannel* field_0x0[8];
|
||||
u16 field_0x20[8];
|
||||
int field_0x30;
|
||||
u8 field_0x34;
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
/* 0x00 */ TChannel* field_0x0[8];
|
||||
/* 0x20 */ u16 field_0x20[8];
|
||||
/* 0x30 */ int field_0x30;
|
||||
/* 0x34 */ u8 field_0x34;
|
||||
/* 0x35 */ u8 field_0x35;
|
||||
/* 0x36 */ u8 field_0x36;
|
||||
};
|
||||
|
||||
static const int MAX_CHILDREN = 16;
|
||||
@@ -155,8 +181,8 @@ namespace JASystem {
|
||||
TTrack* openChild(u8, u8);
|
||||
int loadTbl(u32, u32, u32);
|
||||
int exchangeRegisterValue(u8);
|
||||
void readReg32(u8);
|
||||
void readReg16(u8);
|
||||
u32 readReg32(u8);
|
||||
u16 readReg16(u8);
|
||||
void writeRegDirect(u8, u16);
|
||||
void writeRegParam(u8);
|
||||
u16 readSelfPort(int);
|
||||
@@ -184,53 +210,53 @@ namespace JASystem {
|
||||
|
||||
TOuterParam* getOuterParam() { return mOuterParam; }
|
||||
|
||||
void checkExport(int) const {}
|
||||
void checkImport(int) const {}
|
||||
bool checkImport(int i) const { return mTrackPort.checkImport(i); }
|
||||
bool checkExport(int i) const { return mTrackPort.checkExport(i); }
|
||||
void getActivity() const {}
|
||||
void getRoute() const {}
|
||||
void getSeq() {}
|
||||
TSeqCtrl* getSeq() { return &mSeqCtrl; }
|
||||
// void operator delete(void*, u32) {}
|
||||
// void* operator new(size_t) {}
|
||||
void pauseTrackAll() {}
|
||||
void setPanPower(int, u16) {}
|
||||
void setPanPower(int i, u16 power) { mRegisterParam.setPanPower(i, power); }
|
||||
void setPauseStatus(u8) {}
|
||||
void setTranspose(s32) {}
|
||||
void setVolumeMode(u8) {}
|
||||
void setTranspose(s32 transpose) { field_0x37a = transpose; }
|
||||
void setVolumeMode(u8 mode) { mVolumeMode = mode; }
|
||||
void unPauseTrackAll() {}
|
||||
|
||||
/* 0x000 */ union {
|
||||
TSeqCtrl field_0x0;
|
||||
TSeqCtrl mSeqCtrl;
|
||||
TTrack* next;
|
||||
};
|
||||
/* 0x048 */ TTrackPort field_0x48;
|
||||
/* 0x048 */ TTrackPort mTrackPort;
|
||||
/* 0x088 */ TIntrMgr field_0x88;
|
||||
/* 0x0B4 */ TNoteMgr field_0xb4;
|
||||
/* 0x0EC */ TVibrate field_0xec;
|
||||
/* 0x0F8 */ TChannelMgr field_0xf8;
|
||||
/* 0x16C */ TimedParam_ field_0x16c;
|
||||
/* 0x28C */ TRegisterParam field_0x28c;
|
||||
/* 0x0B4 */ TNoteMgr mNoteMgr;
|
||||
/* 0x0EC */ TVibrate mVibrate;
|
||||
/* 0x0F8 */ TChannelMgr mChannelUpdater;
|
||||
/* 0x16C */ TimedParam_ mTimedParam;
|
||||
/* 0x28C */ TRegisterParam mRegisterParam;
|
||||
/* 0x2BC */ u8 field_0x2bc[0x2cc - 0x2bc];
|
||||
/* 0x2CC */ TOscillator::Osc_ field_0x2cc[2];
|
||||
/* 0x2FC */ u32 field_0x2fc[2];
|
||||
/* 0x304 */ short field_0x304[12];
|
||||
/* 0x2FC */ u32 mOscRoute[2];
|
||||
/* 0x304 */ s16 field_0x304[12];
|
||||
/* 0x31C */ TTrack* mParent;
|
||||
/* 0x320 */ TTrack* mChildren[MAX_CHILDREN];
|
||||
/* 0x360 */ TOuterParam* mOuterParam;
|
||||
/* 0x364 */ f32 field_0x364;
|
||||
/* 0x368 */ f32 field_0x368;
|
||||
/* 0x36C */ int field_0x36c;
|
||||
/* 0x370 */ int field_0x370;
|
||||
/* 0x370 */ u32 mUpdateFlags;
|
||||
/* 0x374 */ u16 field_0x374;
|
||||
/* 0x376 */ u16 field_0x376;
|
||||
/* 0x378 */ u16 field_0x378;
|
||||
/* 0x37a */ u8 field_0x37a;
|
||||
/* 0x37b */ u8 field_0x37b;
|
||||
/* 0x37c */ u8 field_0x37c;
|
||||
/* 0x37d */ u8 field_0x37d;
|
||||
/* 0x37e */ u8 field_0x37e;
|
||||
/* 0x37f */ u8 field_0x37f[3];
|
||||
/* 0x382 */ u8 field_0x382[3];
|
||||
/* 0x385 */ u8 field_0x385;
|
||||
/* 0x37A */ u8 field_0x37a;
|
||||
/* 0x37B */ u8 field_0x37b;
|
||||
/* 0x37C */ u8 mPauseStatus;
|
||||
/* 0x37D */ u8 mVolumeMode;
|
||||
/* 0x37E */ u8 field_0x37e;
|
||||
/* 0x37F */ u8 mCalcTypes[3];
|
||||
/* 0x382 */ u8 mParentCalcTypes[3];
|
||||
/* 0x385 */ u8 mIsPaused;
|
||||
/* 0x386 */ u8 field_0x386;
|
||||
/* 0x387 */ bool field_0x387;
|
||||
/* 0x388 */ u8 field_0x388;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#define TRACKPORT_MAX (16)
|
||||
|
||||
namespace JASystem {
|
||||
class TTrackPort {
|
||||
public:
|
||||
@@ -12,9 +14,13 @@ namespace JASystem {
|
||||
void writeImport(int, u16);
|
||||
void writeExport(int, u16);
|
||||
|
||||
/* 0x00 */ u8 field_0x0[16];
|
||||
/* 0x10 */ u8 field_0x10[16];
|
||||
/* 0x20 */ u16 field_0x20[16];
|
||||
bool checkImport(int i) const { return mImportFlag[i] != 0; }
|
||||
bool checkExport(int i) const { return mExportFlag[i] != 0; }
|
||||
u16 get(u32 i) { return mValue[i]; }
|
||||
|
||||
/* 0x00 */ u8 mImportFlag[TRACKPORT_MAX];
|
||||
/* 0x10 */ u8 mExportFlag[TRACKPORT_MAX];
|
||||
/* 0x20 */ u16 mValue[TRACKPORT_MAX];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
|
||||
}
|
||||
|
||||
inline u8 JSULoNibble(u8 param_0) { return param_0 & 0x0f; }
|
||||
inline u8 JSUHiNibble(u8 param_0) {return param_0 >> 4; }
|
||||
inline u8 JSUHiNibble(u8 param_0) {return (param_0 & 0xff) >> 4; }
|
||||
|
||||
inline u8 JSULoByte(u16 in) {
|
||||
return in & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user