Loading [MathJax]/extensions/MathMenu.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Toggle main menu visibility
Main Page
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
w
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
w
Variables
a
b
c
d
e
f
g
h
j
l
m
p
s
w
Typedefs
Enumerations
Enumerator
c
e
o
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
i
j
m
o
p
r
s
t
u
v
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
▼
Twilight Princess
►
About
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
►
docs
▼
include
►
c
►
d
▼
dolphin
►
amc
►
base
►
charPipeline
►
db
►
demo
►
gd
►
gf
►
gx
►
os
►
vi
►
ai.h
►
am.h
►
ar.h
►
ax.h
►
axart.h
►
axfx.h
►
card.h
►
db.h
►
demo.h
dolphin.h
►
dsp.h
►
dtk.h
►
dvd.h
►
exi.h
►
fake_tgmath.h
►
G2D.h
gd.h
gf.h
►
gx.h
►
hio.h
►
hw_regs.h
►
mcc.h
►
mix.h
►
mtx.h
►
os.h
►
pad.h
►
perf.h
►
seq.h
►
si.h
►
sp.h
►
syn.h
►
types.h
vi.h
►
f_ap
►
f_op
►
f_pc
►
JSystem
►
m_Do
►
REL
►
SSystem
►
TRK_MINNOW_DOLPHIN
►
Z2AudioLib
dol2asm.h
►
DynamicLink.h
►
global.h
►
src
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Loading...
Searching...
No Matches
syn.h
Go to the documentation of this file.
1
#ifndef _DOLPHIN_SYN_H_
2
#define _DOLPHIN_SYN_H_
3
4
#include <
dolphin/types.h
>
5
#include <
dolphin/ax.h
>
6
7
#ifdef __cplusplus
8
extern
"C"
{
9
#endif
10
11
#define SYN_INPUT_BUFFER_SIZE 0x100
12
13
typedef
struct
WTINST
{
14
/* 0x00 */
u16
keyRegion
[128];
15
}
WTINST
;
13
typedef
struct
WTINST
{
…
};
16
17
typedef
struct
WTREGION
{
18
/* 0x00 */
u8
unityNote
;
19
/* 0x01 */
u8
keyGroup
;
20
/* 0x02 */
s16
fineTune
;
21
/* 0x04 */
s32
attn
;
22
/* 0x08 */
u32
loopStart
;
23
/* 0x0C */
u32
loopLength
;
24
/* 0x10 */
u32
articulationIndex
;
25
/* 0x14 */
u32
sampleIndex
;
26
}
WTREGION
;
17
typedef
struct
WTREGION
{
…
};
27
28
typedef
struct
WTART
{
29
/* 0x00 */
s32
lfoFreq
;
30
/* 0x04 */
s32
lfoDelay
;
31
/* 0x08 */
s32
lfoAtten
;
32
/* 0x0C */
s32
lfoPitch
;
33
/* 0x10 */
s32
lfoMod2Atten
;
34
/* 0x14 */
s32
lfoMod2Pitch
;
35
/* 0x18 */
s32
eg1Attack
;
36
/* 0x1C */
s32
eg1Decay
;
37
/* 0x20 */
s32
eg1Sustain
;
38
/* 0x24 */
s32
eg1Release
;
39
/* 0x28 */
s32
eg1Vel2Attack
;
40
/* 0x2C */
s32
eg1Key2Decay
;
41
/* 0x30 */
s32
eg2Attack
;
42
/* 0x34 */
s32
eg2Decay
;
43
/* 0x38 */
s32
eg2Sustain
;
44
/* 0x3C */
s32
eg2Release
;
45
/* 0x40 */
s32
eg2Vel2Attack
;
46
/* 0x44 */
s32
eg2Key2Decay
;
47
/* 0x48 */
s32
eg2Pitch
;
48
/* 0x4C */
s32
pan
;
49
}
WTART
;
28
typedef
struct
WTART
{
…
};
50
51
typedef
struct
WTSAMPLE
{
52
/* 0x00 */
u16
format
;
53
/* 0x02 */
u16
sampleRate
;
54
/* 0x04 */
u32
offset
;
55
/* 0x08 */
u32
length
;
56
/* 0x0C */
u16
adpcmIndex
;
57
}
WTSAMPLE
;
51
typedef
struct
WTSAMPLE
{
…
};
58
59
typedef
struct
WTADPCM
{
60
/* 0x00 */
u16
a
[8][2];
61
/* 0x20 */
u16
gain
;
62
/* 0x22 */
u16
pred_scale
;
63
/* 0x24 */
u16
yn1
;
64
/* 0x26 */
u16
yn2
;
65
/* 0x28 */
u16
loop_pred_scale
;
66
/* 0x2A */
u16
loop_yn1
;
67
/* 0x2C */
u16
loop_yn2
;
68
}
WTADPCM
;
59
typedef
struct
WTADPCM
{
…
};
69
70
typedef
struct
SYNSYNTH
{
71
/* 0x0000 */
void
*
next
;
72
/* 0x0004 */
WTINST
*
percussiveInst
;
73
/* 0x0008 */
WTINST
*
melodicInst
;
74
/* 0x000C */
WTREGION
*
region
;
75
/* 0x0010 */
WTART
*
art
;
76
/* 0x0014 */
WTSAMPLE
*
sample
;
77
/* 0x0018 */
WTADPCM
*
adpcm
;
78
/* 0x001C */
u32
aramBaseWord
;
79
/* 0x0020 */
u32
aramBaseByte
;
80
/* 0x0024 */
u32
aramBaseNibble
;
81
/* 0x0028 */
u32
zeroBaseWord
;
82
/* 0x002C */
u32
zeroBaseByte
;
83
/* 0x0030 */
u32
zeroBaseNibble
;
84
/* 0x0034 */
u32
priorityVoiceAlloc
;
85
/* 0x0038 */
u32
priorityNoteOn
;
86
/* 0x003C */
u32
priorityNoteRelease
;
87
/* 0x0040 */
WTINST
*
inst
[16];
88
/* 0x0080 */
s32
masterVolume
;
89
/* 0x0084 */
u8
controller
[16][128];
90
/* 0x0844 */
u8
rpn
[16];
91
/* 0x0894 */
s16
dataEntry
[16];
92
/* 0x08B4 */
s32
pwMaxCents
[16];
93
/* 0x08F4 */
s32
pwCents
[16];
94
/* 0x0934 */
s32
volAttn
[16];
95
/* 0x0974 */
s32
expAttn
[16];
96
/* 0x09B4 */
s32
auxAAttn
[16];
97
/* 0x09F4 */
s32
auxBAttn
[16];
98
/* 0x0A34 */
u8
input
[SYN_INPUT_BUFFER_SIZE][3];
99
/* 0x0D34 */
u8
*
inputPosition
;
100
/* 0x0D38 */
u32
inputCounter
;
101
/* 0x0D3C */
u32
notes
;
102
/* 0x0D40 */
void
*
keyGroup
[16][16];
103
/* 0x1140 */
void
*
voice
[16][128];
104
}
SYNSYNTH
;
70
typedef
struct
SYNSYNTH
{
…
};
105
106
typedef
struct
SYNVOICE
{
107
/* 0x00 */
void
*
next
;
108
/* 0x04 */
AXVPB
*
axvpb
;
109
/* 0x08 */
SYNSYNTH
*
synth
;
110
/* 0x0C */
u8
midiChannel
;
111
/* 0x0D */
u8
keyNum
;
112
/* 0x0E */
u8
keyVel
;
113
/* 0x0F */
u8
pan
;
114
/* 0x10 */
u8
keyGroup
;
115
/* 0x14 */
WTREGION
*
region
;
116
/* 0x18 */
WTART
*
art
;
117
/* 0x1C */
WTSAMPLE
*
sample
;
118
/* 0x20 */
WTADPCM
*
adpcm
;
119
/* 0x24 */
u32
hold
;
120
/* 0x28 */
u32
type
;
121
/* 0x2C */
f32
srcRatio
;
122
/* 0x30 */
s32
cents
;
123
/* 0x34 */
s32
attn
;
124
/* 0x38 */
s32
lfoState
;
125
/* 0x3C */
s32
lfoAttn
;
126
/* 0x40 */
s32
lfoCents
;
127
/* 0x44 */
s32
lfoFreq
;
128
/* 0x48 */
s32
lfoDelay
;
129
/* 0x4C */
s32
lfoAttn_
;
130
/* 0x50 */
s32
lfoCents_
;
131
/* 0x54 */
s32
lfoModAttn
;
132
/* 0x58 */
s32
lfoModCents
;
133
/* 0x5C */
u32
veState
;
134
/* 0x60 */
s32
veAttn
;
135
/* 0x64 */
s32
veAttack
;
136
/* 0x68 */
s32
veAttackDelta
;
137
/* 0x6C */
s32
veDecay
;
138
/* 0x70 */
s32
veSustain
;
139
/* 0x74 */
s32
veRelease
;
140
/* 0x78 */
u32
peState
;
141
/* 0x7C */
s32
peCents
;
142
/* 0x80 */
s32
peAttack
;
143
/* 0x84 */
s32
peDecay
;
144
/* 0x88 */
s32
peSustain
;
145
/* 0x8C */
s32
peRelease
;
146
/* 0x90 */
s32
pePitch
;
147
}
SYNVOICE
;
106
typedef
struct
SYNVOICE
{
…
};
148
149
// sample formats
150
#define SYN_SAMPLE_FORMAT_ADPCM 0
151
#define SYN_SAMPLE_FORMAT_PCM16 1
152
#define SYN_SAMPLE_FORMAT_PCM8 2
153
154
// SYN
155
void
SYNInit
(
void
);
156
void
SYNQuit
(
void
);
157
void
SYNRunAudioFrame
(
void
);
158
void
SYNInitSynth
(
SYNSYNTH
* synth,
void
* wavetable,
u32
aramBase,
u32
zeroBase,
u32
priorityVoiceAlloc,
u32
priorityNoteOn,
u32
priorityNoteRelease);
159
void
SYNQuitSynth
(
SYNSYNTH
* synth);
160
void
SYNMidiInput
(
SYNSYNTH
* synth,
u8
* input);
161
void
SYNSetMasterVolume
(
SYNSYNTH
* synth,
s32
dB);
162
s32
SYNGetMasterVolume
(
SYNSYNTH
* synth);
163
u32
SYNGetActiveNotes
(
SYNSYNTH
* synth);
164
165
// SYNCTRL
166
u8
SYNGetMidiController
(
SYNSYNTH
* synth,
u8
midiChannel,
u8
function);
167
168
#ifdef __cplusplus
169
}
170
#endif
171
172
#endif
// _DOLPHIN_SYN_H_
ax.h
SYNSYNTH
Definition
syn.h:70
SYNSYNTH::volAttn
s32 volAttn[16]
Definition
syn.h:94
SYNSYNTH::pwCents
s32 pwCents[16]
Definition
syn.h:93
SYNSYNTH::inputCounter
u32 inputCounter
Definition
syn.h:100
SYNSYNTH::zeroBaseByte
u32 zeroBaseByte
Definition
syn.h:82
SYNSYNTH::zeroBaseNibble
u32 zeroBaseNibble
Definition
syn.h:83
SYNSYNTH::aramBaseNibble
u32 aramBaseNibble
Definition
syn.h:80
SYNSYNTH::expAttn
s32 expAttn[16]
Definition
syn.h:95
SYNSYNTH::priorityVoiceAlloc
u32 priorityVoiceAlloc
Definition
syn.h:84
SYNSYNTH::aramBaseByte
u32 aramBaseByte
Definition
syn.h:79
SYNSYNTH::input
u8 input[SYN_INPUT_BUFFER_SIZE][3]
Definition
syn.h:98
SYNSYNTH::art
WTART * art
Definition
syn.h:75
SYNSYNTH::region
WTREGION * region
Definition
syn.h:74
SYNSYNTH::controller
u8 controller[16][128]
Definition
syn.h:89
SYNSYNTH::inputPosition
u8 * inputPosition
Definition
syn.h:99
SYNSYNTH::priorityNoteOn
u32 priorityNoteOn
Definition
syn.h:85
SYNSYNTH::notes
u32 notes
Definition
syn.h:101
SYNSYNTH::dataEntry
s16 dataEntry[16]
Definition
syn.h:91
SYNSYNTH::inst
WTINST * inst[16]
Definition
syn.h:87
SYNSYNTH::melodicInst
WTINST * melodicInst
Definition
syn.h:73
SYNSYNTH::sample
WTSAMPLE * sample
Definition
syn.h:76
SYNSYNTH::zeroBaseWord
u32 zeroBaseWord
Definition
syn.h:81
SYNSYNTH::pwMaxCents
s32 pwMaxCents[16]
Definition
syn.h:92
SYNSYNTH::auxBAttn
s32 auxBAttn[16]
Definition
syn.h:97
SYNSYNTH::adpcm
WTADPCM * adpcm
Definition
syn.h:77
SYNSYNTH::priorityNoteRelease
u32 priorityNoteRelease
Definition
syn.h:86
SYNSYNTH::rpn
u8 rpn[16]
Definition
syn.h:90
SYNSYNTH::keyGroup
void * keyGroup[16][16]
Definition
syn.h:102
SYNSYNTH::masterVolume
s32 masterVolume
Definition
syn.h:88
SYNSYNTH::auxAAttn
s32 auxAAttn[16]
Definition
syn.h:96
SYNSYNTH::next
void * next
Definition
syn.h:71
SYNSYNTH::percussiveInst
WTINST * percussiveInst
Definition
syn.h:72
SYNSYNTH::voice
void * voice[16][128]
Definition
syn.h:103
SYNSYNTH::aramBaseWord
u32 aramBaseWord
Definition
syn.h:78
SYNVOICE
Definition
syn.h:106
SYNVOICE::srcRatio
f32 srcRatio
Definition
syn.h:121
SYNVOICE::peDecay
s32 peDecay
Definition
syn.h:143
SYNVOICE::art
WTART * art
Definition
syn.h:116
SYNVOICE::lfoModCents
s32 lfoModCents
Definition
syn.h:132
SYNVOICE::peSustain
s32 peSustain
Definition
syn.h:144
SYNVOICE::type
u32 type
Definition
syn.h:120
SYNVOICE::axvpb
AXVPB * axvpb
Definition
syn.h:108
SYNVOICE::veDecay
s32 veDecay
Definition
syn.h:137
SYNVOICE::keyGroup
u8 keyGroup
Definition
syn.h:114
SYNVOICE::lfoAttn
s32 lfoAttn
Definition
syn.h:125
SYNVOICE::lfoCents
s32 lfoCents
Definition
syn.h:126
SYNVOICE::veAttackDelta
s32 veAttackDelta
Definition
syn.h:136
SYNVOICE::pePitch
s32 pePitch
Definition
syn.h:146
SYNVOICE::peAttack
s32 peAttack
Definition
syn.h:142
SYNVOICE::attn
s32 attn
Definition
syn.h:123
SYNVOICE::midiChannel
u8 midiChannel
Definition
syn.h:110
SYNVOICE::cents
s32 cents
Definition
syn.h:122
SYNVOICE::next
void * next
Definition
syn.h:107
SYNVOICE::lfoModAttn
s32 lfoModAttn
Definition
syn.h:131
SYNVOICE::peRelease
s32 peRelease
Definition
syn.h:145
SYNVOICE::synth
SYNSYNTH * synth
Definition
syn.h:109
SYNVOICE::lfoAttn_
s32 lfoAttn_
Definition
syn.h:129
SYNVOICE::sample
WTSAMPLE * sample
Definition
syn.h:117
SYNVOICE::veAttack
s32 veAttack
Definition
syn.h:135
SYNVOICE::veRelease
s32 veRelease
Definition
syn.h:139
SYNVOICE::veSustain
s32 veSustain
Definition
syn.h:138
SYNVOICE::adpcm
WTADPCM * adpcm
Definition
syn.h:118
SYNVOICE::lfoState
s32 lfoState
Definition
syn.h:124
SYNVOICE::lfoDelay
s32 lfoDelay
Definition
syn.h:128
SYNVOICE::lfoCents_
s32 lfoCents_
Definition
syn.h:130
SYNVOICE::lfoFreq
s32 lfoFreq
Definition
syn.h:127
SYNVOICE::keyVel
u8 keyVel
Definition
syn.h:112
SYNVOICE::peState
u32 peState
Definition
syn.h:140
SYNVOICE::hold
u32 hold
Definition
syn.h:119
SYNVOICE::keyNum
u8 keyNum
Definition
syn.h:111
SYNVOICE::veAttn
s32 veAttn
Definition
syn.h:134
SYNVOICE::pan
u8 pan
Definition
syn.h:113
SYNVOICE::peCents
s32 peCents
Definition
syn.h:141
SYNVOICE::region
WTREGION * region
Definition
syn.h:115
SYNVOICE::veState
u32 veState
Definition
syn.h:133
WTADPCM
Definition
syn.h:59
WTADPCM::yn2
u16 yn2
Definition
syn.h:64
WTADPCM::pred_scale
u16 pred_scale
Definition
syn.h:62
WTADPCM::loop_yn1
u16 loop_yn1
Definition
syn.h:66
WTADPCM::yn1
u16 yn1
Definition
syn.h:63
WTADPCM::loop_pred_scale
u16 loop_pred_scale
Definition
syn.h:65
WTADPCM::gain
u16 gain
Definition
syn.h:61
WTADPCM::loop_yn2
u16 loop_yn2
Definition
syn.h:67
WTADPCM::a
u16 a[8][2]
Definition
syn.h:60
WTART
Definition
syn.h:28
WTART::lfoMod2Pitch
s32 lfoMod2Pitch
Definition
syn.h:34
WTART::eg1Release
s32 eg1Release
Definition
syn.h:38
WTART::eg2Decay
s32 eg2Decay
Definition
syn.h:42
WTART::lfoAtten
s32 lfoAtten
Definition
syn.h:31
WTART::eg1Vel2Attack
s32 eg1Vel2Attack
Definition
syn.h:39
WTART::lfoDelay
s32 lfoDelay
Definition
syn.h:30
WTART::eg2Release
s32 eg2Release
Definition
syn.h:44
WTART::eg2Pitch
s32 eg2Pitch
Definition
syn.h:47
WTART::pan
s32 pan
Definition
syn.h:48
WTART::eg1Sustain
s32 eg1Sustain
Definition
syn.h:37
WTART::lfoMod2Atten
s32 lfoMod2Atten
Definition
syn.h:33
WTART::eg2Vel2Attack
s32 eg2Vel2Attack
Definition
syn.h:45
WTART::eg2Sustain
s32 eg2Sustain
Definition
syn.h:43
WTART::eg2Attack
s32 eg2Attack
Definition
syn.h:41
WTART::lfoPitch
s32 lfoPitch
Definition
syn.h:32
WTART::eg1Decay
s32 eg1Decay
Definition
syn.h:36
WTART::lfoFreq
s32 lfoFreq
Definition
syn.h:29
WTART::eg1Key2Decay
s32 eg1Key2Decay
Definition
syn.h:40
WTART::eg2Key2Decay
s32 eg2Key2Decay
Definition
syn.h:46
WTART::eg1Attack
s32 eg1Attack
Definition
syn.h:35
WTINST
Definition
syn.h:13
WTINST::keyRegion
u16 keyRegion[128]
Definition
syn.h:14
WTREGION
Definition
syn.h:17
WTREGION::fineTune
s16 fineTune
Definition
syn.h:20
WTREGION::sampleIndex
u32 sampleIndex
Definition
syn.h:25
WTREGION::keyGroup
u8 keyGroup
Definition
syn.h:19
WTREGION::attn
s32 attn
Definition
syn.h:21
WTREGION::loopStart
u32 loopStart
Definition
syn.h:22
WTREGION::loopLength
u32 loopLength
Definition
syn.h:23
WTREGION::articulationIndex
u32 articulationIndex
Definition
syn.h:24
WTREGION::unityNote
u8 unityNote
Definition
syn.h:18
WTSAMPLE
Definition
syn.h:51
WTSAMPLE::sampleRate
u16 sampleRate
Definition
syn.h:53
WTSAMPLE::length
u32 length
Definition
syn.h:55
WTSAMPLE::format
u16 format
Definition
syn.h:52
WTSAMPLE::adpcmIndex
u16 adpcmIndex
Definition
syn.h:56
WTSAMPLE::offset
u32 offset
Definition
syn.h:54
_AXVPB
Definition
ax.h:133
SYNGetMasterVolume
s32 SYNGetMasterVolume(SYNSYNTH *synth)
Definition
syn.c:172
WTSAMPLE
struct WTSAMPLE WTSAMPLE
SYNGetActiveNotes
u32 SYNGetActiveNotes(SYNSYNTH *synth)
Definition
syn.c:177
SYNSetMasterVolume
void SYNSetMasterVolume(SYNSYNTH *synth, s32 dB)
Definition
syn.c:167
SYNGetMidiController
u8 SYNGetMidiController(SYNSYNTH *synth, u8 midiChannel, u8 function)
Definition
synctrl.c:505
WTART
struct WTART WTART
WTREGION
struct WTREGION WTREGION
WTADPCM
struct WTADPCM WTADPCM
SYNVOICE
struct SYNVOICE SYNVOICE
SYNRunAudioFrame
void SYNRunAudioFrame(void)
Definition
syn.c:70
SYNInitSynth
void SYNInitSynth(SYNSYNTH *synth, void *wavetable, u32 aramBase, u32 zeroBase, u32 priorityVoiceAlloc, u32 priorityNoteOn, u32 priorityNoteRelease)
Definition
syn.c:83
SYNQuit
void SYNQuit(void)
Definition
syn.c:66
SYNMidiInput
void SYNMidiInput(SYNSYNTH *synth, u8 *input)
Definition
syn.c:150
SYNSYNTH
struct SYNSYNTH SYNSYNTH
SYNInit
void SYNInit(void)
Definition
syn.c:57
WTINST
struct WTINST WTINST
SYNQuitSynth
void SYNQuitSynth(SYNSYNTH *synth)
Definition
syn.c:129
types.h
u32
unsigned long u32
Definition
types.h:9
s16
signed short int s16
Definition
types.h:6
f32
float f32
Definition
types.h:22
u16
unsigned short int u16
Definition
types.h:7
s32
signed long s32
Definition
types.h:8
u8
unsigned char u8
Definition
types.h:5
include
dolphin
syn.h
Generated by
1.12.0