Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JASTrack.h
Go to the documentation of this file.
1#ifndef JASTRACK_H
2#define JASTRACK_H
3
10
11struct JASSoundParams;
12
13namespace JASDsp {
14 class TChannel;
15
16 extern const u32 FILTER_MODE_IIR;
17};
18
23struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
28
29 struct TChannelMgr : public JASPoolAllocObject_MultiThreaded<TChannelMgr> {
30 /* 802930DC */ TChannelMgr(JASTrack*);
31 /* 80293148 */ void init();
32 /* 802931B0 */ void releaseAll();
33 /* 80293220 */ bool noteOff(u32, u16);
34 /* 802932A0 */ void setPauseFlag(bool);
35
36 /* 0x00 */ JASChannel* mChannels[8];
38 /* 0x38 */ short field_0x38[8];
40 /* 0x4c */ JASTrack* mTrack;
41 };
42
43 struct TList : JGadget::TLinkList<JASTrack, -0x240> {
45 /* 80292F90 */ void append(JASTrack*);
46 /* 8029301C */ void seqMain();
47 /* 8029345C */ ~TList() {}
48
49 /* 80292F6C */ static s32 cbSeqMain(void*);
50
51 /* 0xC */ bool mCallbackRegistered;
52 };
53
54 struct MoveParam_ {
55 /* 802932C8 */ MoveParam_() : mValue(0.0f), mTarget(0.0f), mCount(0) {}
56
57 /* 0x00 */ f32 mValue;
58 /* 0x04 */ f32 mTarget;
59 /* 0x08 */ u32 mCount;
60 };
61
62 /* 80291228 */ JASTrack();
63 /* 8029131C */ ~JASTrack();
64 /* 80291444 */ void setChannelMgrCount(u32);
65 /* 802915D4 */ void init();
66 /* 802918FC */ void initTimed();
67 /* 8029194C */ void inherit(JASTrack const&);
68 /* 802919F4 */ void assignExtBuffer(u32, JASSoundParams*);
69 /* 80291A08 */ void setSeqData(void*, u32);
70 /* 80291A28 */ void startSeq();
71 /* 80291A78 */ void stopSeq();
72 /* 80291ABC */ void start();
73 /* 80291AC8 */ void close();
74 /* 80291B8C */ bool connectChild(u32, JASTrack*);
75 /* 80291BB8 */ void closeChild(u32);
76 /* 80291C30 */ JASTrack* openChild(u32);
77 /* 80291DAC */ void connectBus(int, int);
78 /* 80291DBC */ void setLatestKey(u8);
80 /* 80291F38 */ int noteOn(u32, u32, u32);
81 /* 80292008 */ int gateOn(u32, u32, f32, u32);
82 /* 80292198 */ int noteOff(u32, u16);
83 /* 80292220 */ bool checkNoteStop(u32) const;
84 /* 8029226C */ void overwriteOsc(JASChannel*);
85 /* 802922D8 */ void updateTimedParam();
86 /* 80292348 */ void updateTrack(f32);
87 /* 802924E4 */ void updateTempo();
88 /* 80292580 */ void updateSeq(bool, f32);
89 /* 80292644 */ u32 seqTimeToDspTime(f32);
90 /* 802926E0 */ void setParam(u32, f32, u32);
91 /* 80292708 */ void noteOffAll(u16);
92 /* 802927A0 */ void mute(bool);
93 /* 802927D8 */ void setOscScale(u32, f32);
94 /* 802927E8 */ void setOscTable(u32, JASOscillator::Point const*);
95 /* 80292808 */ void setOscAdsr(s16, s16, s16, s16, u16);
96 /* 8029285C */ void setFIR(s16 const*);
97 /* 8029289C */ void setIIR(s16 const*);
98 /* 802928D0 */ u16 readPortSelf(u32);
99 /* 802928F4 */ void writePortSelf(u32, u16);
100 /* 80292918 */ void writePort(u32, u16);
101 /* 8029297C */ u16 readPort(u32);
102 /* 802929A0 */ void setChannelPauseFlag(bool);
103 /* 80292A3C */ void pause(bool);
104 /* 80292AA4 */ int getTransposeTotal() const;
105 /* 80292AF4 */ bool isMute() const;
106 /* 80292B58 */ void setTempo(u16);
107 /* 80292B8C */ void setTempoRate(f32);
108 /* 80292BC0 */ void setTimebase(u16);
109 /* 80292BF4 */ void updateChannel(JASChannel*, JASDsp::TChannel*);
110 /* 80292D88 */ JASTrack* getRootTrack();
111 /* 80292DA0 */ int tickProc();
112 /* 80292E9C */ int seqMain();
113
114 /* 80292CA4 */ static void channelUpdateCallback(u32, JASChannel*, JASDsp::TChannel*, void*);
115
116 static JASOscillator::Point const sAdsTable[4];
117 static JASOscillator::Data const sEnvOsc;
119
122
131 JASTrack* getChild(u32 index) { return mChildren[index]; }
133 f32 getVibDepth() const { return mVibDepth; }
135 f32 getVibPitch() const { return mVibPitch; }
137 f32 getTremDepth() const { return mTremDepth; }
139 f32 getTremPitch() const { return mTremPitch; }
141 u16 getVibDelay() const { return mVibDelay; }
143 u16 getTremDelay() const { return mTremDelay; }
145 u8 getStatus() const { return mStatus; }
146 void setAutoDelete(u8 param_0) { mFlags.autoDelete = param_0; }
147 f32 getPanPower() const { return mPanPower; }
149 u32 getSkipSample() const { return mSkipSample; }
153 u16 getTimebase() const { return mTimebase; }
154 s8 getTranspose() const { return mTranspose; }
156 u16 getBankNumber() const { return mBankNumber; }
158 u16 getProgNumber() const { return mProgNumber; }
160 u8 getBendSense() const { return mBendSense; }
162 u8 getNoteOnPrio() const { return mNoteOnPrio; }
164 u8 getReleasePrio() const { return mReleasePrio; }
166 u8 getGateRate() const { return mGateRate; }
168
169 /* 0x000 */ JASSeqCtrl mSeqCtrl;
172 /* 0x09C */ MoveParam_ mMoveParam[6]; // volume, pitch, fxmix, pan, dolby, distFilter
175 /* 0x12C */ JASTrack* mParent;
176 /* 0x130 */ JASTrack* mChildren[16];
177 /* 0x170 */ TChannelMgr* mChannelMgrs[4];
179 /* 0x1D0 */ int mChannelMgrCount;
181 /* 0x1D8 */ f32 field_0x1d8;
182 /* 0x1DC */ f32 field_0x1dc;
183 /* 0x1E0 */ f32 mVibDepth;
184 /* 0x1E4 */ f32 mVibPitch;
185 /* 0x1E8 */ f32 mTremDepth;
186 /* 0x1EC */ f32 mTremPitch;
187 /* 0x1F0 */ u16 mVibDelay;
188 /* 0x1F2 */ u16 mTremDelay;
189 /* 0x1F4 */ short mFIR[8];
190 /* 0x204 */ short mIIR[8];
191 /* 0x214 */ u8 mFilterMode;
192 /* 0x215 */ volatile u8 mStatus;
193 /* 0x216 */ struct {
194 bool pause : 1;
195 bool mute : 1;
196 bool flag2 : 1;
197 bool autoDelete : 1;
198 bool flag4 : 1;
199 bool flag5 : 1;
200 bool flag6 : 1;
201 bool flag7 : 1;
203 /* 0x218 */ f32 mPanPower;
204 /* 0x21C */ f32 mTempoRate;
205 /* 0x220 */ u32 mSkipSample;
206 /* 0x224 */ u16 mDirectRelease;
207 /* 0x226 */ u16 mTempo;
208 /* 0x228 */ u16 mTimebase;
209 /* 0x22A */ s8 mTranspose;
210 /* 0x22B */ u8 field_0x22b;
211 /* 0x22C */ u16 mBankNumber;
212 /* 0x22E */ u16 mProgNumber;
213 /* 0x230 */ u8 mBendSense;
214 /* 0x231 */ u8 mNoteOnPrio;
215 /* 0x232 */ u8 mReleasePrio;
216 /* 0x233 */ u8 mGateRate;
217 /* 0x234 */ u16 mMixConfig[6];
219};
220
221#endif /* JASTRACK_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JASChannel.h:21
Definition JASAudioThread.cpp:53
Definition JASBankTable.h:26
Definition JASHeapCtrl.h:292
Definition JASRegisterParam.h:10
void write(JASRegisterParam::RegID, u32)
Definition JASRegisterParam.cpp:42
RegID
Definition JASRegisterParam.h:12
u32 read(JASRegisterParam::RegID)
Definition JASRegisterParam.cpp:101
Definition JASSeqCtrl.h:13
Definition JASTrackPort.h:10
void set(u32 param_0, u16 param_1)
Definition JASTrackPort.h:21
u16 get(u32 param_0)
Definition JASTrackPort.h:20
u32 checkImport(u32) const
Definition JASTrackPort.cpp:42
u32 checkExport(u32) const
Definition JASTrackPort.cpp:47
Definition JASAramStream.h:10
const u32 FILTER_MODE_IIR
Definition JASTrack.cpp:728
Definition JASDSPInterface.h:32
Definition JASOscillator.h:37
Definition JASOscillator.h:11
Definition JASSoundParams.h:10
Definition JASTrack.h:54
MoveParam_()
Definition JASTrack.h:55
u32 mCount
Definition JASTrack.h:59
f32 mValue
Definition JASTrack.h:57
f32 mTarget
Definition JASTrack.h:58
Definition JASTrack.h:29
JASChannel * mChannels[8]
Definition JASTrack.h:36
short field_0x38[8]
Definition JASTrack.h:38
bool noteOff(u32, u16)
Definition JASTrack.cpp:1007
void setPauseFlag(bool)
Definition JASTrack.cpp:1023
JASChannelParams mParams
Definition JASTrack.h:37
void init()
Definition JASTrack.cpp:982
void releaseAll()
Definition JASTrack.cpp:995
JASTrack * mTrack
Definition JASTrack.h:40
JASSoundParams * mSoundParams
Definition JASTrack.h:39
Definition JASTrack.h:43
void seqMain()
Definition JASTrack.cpp:959
void append(JASTrack *)
Definition JASTrack.cpp:947
~TList()
Definition JASTrack.h:47
bool mCallbackRegistered
Definition JASTrack.h:51
TList()
Definition JASTrack.h:44
static s32 cbSeqMain(void *)
Definition JASTrack.cpp:941
Definition JASTrack.h:23
f32 mVibPitch
Definition JASTrack.h:184
JASTrack * mParent
Definition JASTrack.h:175
TChannelMgr mDefaultChannelMgr
Definition JASTrack.h:178
void updateChannel(JASChannel *, JASDsp::TChannel *)
Definition JASTrack.cpp:840
u8 mReleasePrio
Definition JASTrack.h:215
JASOscillator::Data mOscParam[2]
Definition JASTrack.h:173
void updateTempo()
Definition JASTrack.cpp:633
u8 getStatus() const
Definition JASTrack.h:145
bool flag5
Definition JASTrack.h:199
void setChannelMgrCount(u32)
Definition JASTrack.cpp:196
short mFIR[8]
Definition JASTrack.h:189
u32 seqTimeToDspTime(f32)
Definition JASTrack.cpp:661
u32 mSkipSample
Definition JASTrack.h:205
bool mute
Definition JASTrack.h:195
int getChannelMgrCount()
Definition JASTrack.h:132
u16 getDirectRelease() const
Definition JASTrack.h:151
f32 getTremPitch() const
Definition JASTrack.h:139
f32 mTremPitch
Definition JASTrack.h:186
void close()
Definition JASTrack.cpp:366
void setSeqData(void *, u32)
Definition JASTrack.cpp:343
u16 getVibDelay() const
Definition JASTrack.h:141
~JASTrack()
Definition JASTrack.cpp:188
u8 mBendSense
Definition JASTrack.h:213
JASOscillator::Point mOscPoint[4]
Definition JASTrack.h:174
u8 mGateRate
Definition JASTrack.h:216
void writeReg(JASRegisterParam::RegID param_0, u32 param_1)
Definition JASTrack.h:129
static TList sTrackList
Definition JASTrack.h:121
void writePortSelf(u32, u16)
Definition JASTrack.cpp:753
bool flag2
Definition JASTrack.h:196
u16 readPort(u32)
Definition JASTrack.cpp:772
u16 mMixConfig[6]
Definition JASTrack.h:217
void setOscTable(u32, JASOscillator::Point const *)
Definition JASTrack.cpp:709
void updateTimedParam()
Definition JASTrack.cpp:576
f32 getVibDepth() const
Definition JASTrack.h:133
void setChannelPauseFlag(bool)
Definition JASTrack.cpp:777
u16 mProgNumber
Definition JASTrack.h:212
void inherit(JASTrack const &)
Definition JASTrack.cpp:317
u16 mTimebase
Definition JASTrack.h:208
u16 mVibDelay
Definition JASTrack.h:187
u8 getNoteOnPrio() const
Definition JASTrack.h:162
Status
Definition JASTrack.h:24
@ STATUS_FREE
Definition JASTrack.h:25
@ STATUS_RUN
Definition JASTrack.h:26
JASChannel * channelStart(JASTrack::TChannelMgr *, u32, u32, u32)
Definition JASTrack.cpp:455
f32 getTremDepth() const
Definition JASTrack.h:137
u8 getGateRate() const
Definition JASTrack.h:166
struct JASTrack::@118 mFlags
void setDirectRelease(u16 param_0)
Definition JASTrack.h:152
int gateOn(u32, u32, f32, u32)
Definition JASTrack.cpp:503
void setTremDelay(u32 param_0)
Definition JASTrack.h:144
s8 getTranspose() const
Definition JASTrack.h:154
JASTrack * openChild(u32)
Definition JASTrack.cpp:411
void setPort(u32 param_0, u16 param_1)
Definition JASTrack.h:125
void init()
Definition JASTrack.cpp:231
void closeChild(u32)
Definition JASTrack.cpp:397
void setFIR(s16 const *)
Definition JASTrack.cpp:731
static JASDefaultBankTable sDefaultBankTable
Definition JASTrack.h:120
f32 mPanPower
Definition JASTrack.h:203
int noteOff(u32, u16)
Definition JASTrack.cpp:544
void pause(bool)
u16 getBankNumber() const
Definition JASTrack.h:156
void setIIR(s16 const *)
Definition JASTrack.cpp:740
void setTimebase(u16)
Definition JASTrack.cpp:832
void start()
Definition JASTrack.cpp:361
JASSeqCtrl mSeqCtrl
Definition JASTrack.h:169
MoveParam_ mMoveParam[6]
Definition JASTrack.h:172
f32 mTempoRate
Definition JASTrack.h:204
void connectBus(int, int)
Definition JASTrack.cpp:443
void setTempoRate(f32)
Definition JASTrack.cpp:825
u8 mNoteOnPrio
Definition JASTrack.h:214
bool autoDelete
Definition JASTrack.h:197
JASTrack * getRootTrack()
Definition JASTrack.cpp:883
u16 mTempo
Definition JASTrack.h:207
int noteOn(u32, u32, u32)
Definition JASTrack.cpp:483
void setProgNumber(u16 param_0)
Definition JASTrack.h:159
void setReleasePrio(u8 param_0)
Definition JASTrack.h:165
static void channelUpdateCallback(u32, JASChannel *, JASDsp::TChannel *, void *)
Definition JASTrack.cpp:856
void setVibDepth(f32 param_0)
Definition JASTrack.h:134
JASTrackPort mTrackPort
Definition JASTrack.h:170
void setTranspose(u32 param_0)
Definition JASTrack.h:155
u16 getTremDelay() const
Definition JASTrack.h:143
JASSeqCtrl * getSeqCtrl()
Definition JASTrack.h:123
void noteOffAll(u16)
Definition JASTrack.cpp:683
int getTransposeTotal() const
Definition JASTrack.cpp:800
f32 field_0x1d8
Definition JASTrack.h:181
int mChannelMgrCount
Definition JASTrack.h:179
int tickProc()
Definition JASTrack.cpp:892
bool flag6
Definition JASTrack.h:200
int seqMain()
Definition JASTrack.cpp:920
u16 readPortSelf(u32)
Definition JASTrack.cpp:748
void updateSeq(bool, f32)
Definition JASTrack.cpp:644
f32 field_0x1dc
Definition JASTrack.h:182
void setBendSense(u8 param_0)
Definition JASTrack.h:161
void initTimed()
Definition JASTrack.cpp:303
void setAutoDelete(u8 param_0)
Definition JASTrack.h:146
f32 mVibDepth
Definition JASTrack.h:183
short mIIR[8]
Definition JASTrack.h:190
JASRegisterParam mRegisterParam
Definition JASTrack.h:171
f32 mTremDepth
Definition JASTrack.h:185
bool pause
Definition JASTrack.h:194
JASTrack * mChildren[16]
Definition JASTrack.h:176
void writePort(u32, u16)
Definition JASTrack.cpp:758
bool flag7
Definition JASTrack.h:201
void setSkipSample(u32 param_0)
Definition JASTrack.h:150
void setTempo(u16)
Definition JASTrack.cpp:818
JASTrack()
Definition JASTrack.cpp:172
bool connectChild(u32, JASTrack *)
Definition JASTrack.cpp:387
volatile u8 mStatus
Definition JASTrack.h:192
u16 mBankNumber
Definition JASTrack.h:211
JGadget::TLinkListNode field_0x240
Definition JASTrack.h:218
static JASOscillator::Data const sPitchEnvOsc
Definition JASTrack.h:227
void setVibPitch(f32 param_0)
Definition JASTrack.h:136
bool checkNoteStop(u32) const
Definition JASTrack.cpp:557
u32 readReg(JASRegisterParam::RegID param_0)
Definition JASTrack.h:128
f32 getVibPitch() const
Definition JASTrack.h:135
u8 getReleasePrio() const
Definition JASTrack.h:164
JASTrack * getChild(u32 index)
Definition JASTrack.h:131
JASDefaultBankTable * mBankTable
Definition JASTrack.h:180
void setParam(u32, f32, u32)
Definition JASTrack.cpp:673
void setOscScale(u32, f32)
Definition JASTrack.cpp:703
u8 mFilterMode
Definition JASTrack.h:191
void setNoteOnPrio(u8 param_0)
Definition JASTrack.h:163
u16 getProgNumber() const
Definition JASTrack.h:158
u16 getPort(u32 param_0)
Definition JASTrack.h:124
void setTremPitch(f32 param_0)
Definition JASTrack.h:140
static JASOscillator::Data const sEnvOsc
Definition JASTrack.h:224
u32 checkPortIn(u32 param_0)
Definition JASTrack.h:126
void setTremDepth(f32 param_0)
Definition JASTrack.h:138
bool isMute() const
Definition JASTrack.cpp:809
void startSeq()
Definition JASTrack.cpp:348
void setGateRate(u8 param_0)
Definition JASTrack.h:167
void overwriteOsc(JASChannel *)
Definition JASTrack.cpp:567
void mute(bool)
u16 mDirectRelease
Definition JASTrack.h:206
s8 mTranspose
Definition JASTrack.h:209
void updateTrack(f32)
Definition JASTrack.cpp:587
void setOscAdsr(s16, s16, s16, s16, u16)
Definition JASTrack.cpp:717
u8 getBendSense() const
Definition JASTrack.h:160
JASTrack * getParent()
Definition JASTrack.h:130
u16 mTremDelay
Definition JASTrack.h:188
void setBankNumber(u16 param_0)
Definition JASTrack.h:157
void stopSeq()
Definition JASTrack.cpp:355
u16 getTimebase() const
Definition JASTrack.h:153
u8 field_0x22b
Definition JASTrack.h:210
void setVibDelay(u32 param_0)
Definition JASTrack.h:142
bool flag4
Definition JASTrack.h:198
void setLatestKey(u8)
Definition JASTrack.cpp:448
void setPanPower(f32 param_0)
Definition JASTrack.h:148
TChannelMgr * mChannelMgrs[4]
Definition JASTrack.h:177
void assignExtBuffer(u32, JASSoundParams *)
Definition JASTrack.cpp:338
static JASOscillator::Point const sAdsTable[4]
Definition JASTrack.h:216
f32 getPanPower() const
Definition JASTrack.h:147
u32 checkPort(u32 param_0)
Definition JASTrack.h:127
u32 getSkipSample() const
Definition JASTrack.h:149
Definition linklist.h:7
signed char s8
Definition types.h:4
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8