Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JASAramStream.h
Go to the documentation of this file.
1#ifndef JASARAMSTREAM_H
2#define JASARAMSTREAM_H
3
6#include "dolphin/dvd.h"
7
8class JASChannel;
9
10namespace JASDsp {
11 class TChannel;
12}
13
14#define CHANNEL_MAX 6
15
21public:
22 typedef void (*StreamCallback)(u32, JASAramStream*, void*);
23
25 /* 0 */ CB_START,
26 /* 1 */ CB_STOP,
27 };
28
29 // Used internally for passing data to task functions
30 struct TaskData {
32 /* 0x4 */ u32 field_0x4;
33 /* 0x8 */ int field_0x8;
34 };
35
36 struct Header {
37 /* 0x00 */ u32 tag;
38 /* 0x04 */ u8 field_0x4[5];
39 /* 0x09 */ u8 format;
40 /* 0x0A */ u8 bits;
41 /* 0x0C */ u16 channels;
42 /* 0x0E */ u16 loop;
43 /* 0x10 */ int field_0x10;
44 /* 0x14 */ u8 field_0x14[4];
45 /* 0x18 */ int loop_start;
46 /* 0x1C */ int loop_end;
47 /* 0x20 */ u32 block_size;
48 /* 0x24 */ u8 field_0x24[4];
49 /* 0x28 */ u8 field_0x28;
50 /* 0x29 */ u8 field_0x29[0x17];
51 }; // Size: 0x40
52
53 struct BlockHeader {
54 /* 0x00 */ u32 tag;
55 /* 0x04 */ u32 field_0x4;
56 /* 0x08 */ struct {
60 }; // Size: 0x20
61
62 /* 8029631C */ static void initSystem(u32, u32);
63 /* 802963A8 */ JASAramStream();
64 /* 8029649C */ void init(u32, u32, StreamCallback, void*);
65 /* 8029655C */ bool prepare(s32, int);
66 /* 80296618 */ bool start();
67 /* 8029664C */ bool stop(u16);
68 /* 80296684 */ bool pause(bool);
69 /* 802966CC */ bool cancel();
70 /* 80296710 */ u32 getBlockSamples() const;
71 /* 8029673C */ static void headerLoadTask(void*);
72 /* 8029676C */ static void firstLoadTask(void*);
73 /* 80296848 */ static void loadToAramTask(void*);
74 /* 80296868 */ static void finishTask(void*);
75 /* 802968C8 */ static void prepareFinishTask(void*);
76 /* 80296920 */ bool headerLoad(u32, int);
77 /* 80296AE8 */ bool load();
78 /* 80296D74 */ static s32 channelProcCallback(void*);
79 /* 80296D94 */ static s32 dvdErrorCheck(void*);
80 /* 80296DF0 */ static void channelCallback(u32, JASChannel*, JASDsp::TChannel*, void*);
81 /* 80296E2C */ void updateChannel(u32, JASChannel*, JASDsp::TChannel*);
82 /* 802974AC */ s32 channelProc();
83 /* 80297658 */ void channelStart();
84 /* 80297870 */ void channelStop(u16);
85
88 for (int i = 0; i < 6; i++) {
90 }
91 }
92
93 void setPan(f32 pan) {
94 for (int i = 0; i < 6; i++) {
95 mChannelPan[i] = pan;
96 }
97 }
98
100 for (int i = 0; i < 6; i++) {
102 }
103 }
104
106 for (int i = 0; i < 6; i++) {
108 }
109 }
110
111 void setChannelVolume(int channel, f32 volume) {
112 JUT_ASSERT(290, channel < CHANNEL_MAX);
113 mChannelVolume[channel] = volume;
114 }
115
116 void setChannelPan(int channel, f32 pan) {
117 JUT_ASSERT(296, channel < CHANNEL_MAX);
118 mChannelPan[channel] = pan;
119 }
120
121 void setChannelFxmix(int channel, f32 fxMix) {
122 JUT_ASSERT(302, channel < CHANNEL_MAX);
123 mChannelFxMix[channel] = fxMix;
124 }
125
126 void setChannelDolby(int channel, f32 dolby) {
127 JUT_ASSERT(308, channel < CHANNEL_MAX);
128 mChannelDolby[channel] = dolby;
129 }
130
131 static u32 getBlockSize() { return sBlockSize; }
132
135 /* 0x040 */ void* field_0x040[16];
136 /* 0x080 */ void* field_0x080[4];
139 /* 0x0AC */ bool field_0x0ac;
140 /* 0x0AD */ bool field_0x0ad;
141 /* 0x0AE */ u8 field_0x0ae;
142 /* 0x0B0 */ int field_0x0b0;
143 /* 0x0B4 */ int field_0x0b4;
144 /* 0x0B8 */ u32 field_0x0b8;
145 /* 0x0BC */ int field_0x0bc;
146 /* 0x0C0 */ bool field_0x0c0;
147 /* 0x0C4 */ u32 field_0x0c4;
148 /* 0x0C8 */ f32 field_0x0c8;
150 /* 0x108 */ u32 field_0x108;
151 /* 0x10C */ int field_0x10c;
152 /* 0x110 */ u32 mBlock;
153 /* 0x114 */ u8 field_0x114;
154 /* 0x118 */ u32 field_0x118;
155 /* 0x11C */ int field_0x11c;
156 /* 0x120 */ int field_0x120;
157 /* 0x124 */ int field_0x124;
158 /* 0x128 */ u16 field_0x128;
159 /* 0x12C */ int field_0x12c;
162 /* 0x148 */ int field_0x148;
163 /* 0x14C */ u32 field_0x14c;
165 /* 0x154 */ void* mCallbackData;
166 /* 0x158 */ u16 field_0x158;
167 /* 0x15A */ u16 mChannelNum;
168 /* 0x15C */ u32 mBufCount;
169 /* 0x160 */ u32 field_0x160;
170 /* 0x164 */ u32 field_0x164;
171 /* 0x168 */ bool mLoop;
172 /* 0x16C */ u32 mLoopStart;
173 /* 0x170 */ u32 mLoopEnd;
174 /* 0x174 */ f32 mVolume;
175 /* 0x178 */ f32 mPitch;
181
186};
187
188#endif /* JASARAMSTREAM_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JASAramStream.h:20
int field_0x11c
Definition JASAramStream.h:155
u32 field_0x160
Definition JASAramStream.h:169
u32 mBufCount
Definition JASAramStream.h:168
u16 field_0x128
Definition JASAramStream.h:158
u32 field_0x108
Definition JASAramStream.h:150
u32 field_0x0c4
Definition JASAramStream.h:147
void setChannelDolby(int channel, f32 dolby)
Definition JASAramStream.h:126
void channelStart()
Definition JASAramStream.cpp:651
int field_0x148
Definition JASAramStream.h:162
CallbackType
Definition JASAramStream.h:24
@ CB_STOP
Definition JASAramStream.h:26
@ CB_START
Definition JASAramStream.h:25
u8 field_0x114
Definition JASAramStream.h:153
JASChannel * field_0x0a8
Definition JASAramStream.h:138
static void prepareFinishTask(void *)
Definition JASAramStream.cpp:234
static void finishTask(void *)
Definition JASAramStream.cpp:224
void setChannelFxmix(int channel, f32 fxMix)
Definition JASAramStream.h:121
u32 field_0x0b8
Definition JASAramStream.h:144
f32 field_0x0c8
Definition JASAramStream.h:148
static u8 * sReadBuffer
Definition JASAramStream.h:183
JASAramStream()
Definition JASAramStream.cpp:53
bool cancel()
Definition JASAramStream.cpp:170
int field_0x10c
Definition JASAramStream.h:151
bool headerLoad(u32, int)
Definition JASAramStream.cpp:243
void channelStop(u16)
Definition JASAramStream.cpp:691
int field_0x12c
Definition JASAramStream.h:159
OSMessageQueue field_0x000
Definition JASAramStream.h:133
DVDFileInfo mDvdFileInfo
Definition JASAramStream.h:149
OSMessageQueue field_0x020
Definition JASAramStream.h:134
int field_0x0b0
Definition JASAramStream.h:142
bool load()
Definition JASAramStream.cpp:292
bool prepare(s32, int)
Definition JASAramStream.cpp:127
bool field_0x0c0
Definition JASAramStream.h:146
bool stop(u16)
Definition JASAramStream.cpp:151
u32 getBlockSamples() const
Definition JASAramStream.cpp:177
u32 mLoopEnd
Definition JASAramStream.h:173
void setVolume(f32 volume)
Definition JASAramStream.h:87
static JASTaskThread * sLoadThread
Definition JASAramStream.h:182
u32 mLoopStart
Definition JASAramStream.h:172
u16 field_0x1dc[CHANNEL_MAX]
Definition JASAramStream.h:180
static void channelCallback(u32, JASChannel *, JASDsp::TChannel *, void *)
Definition JASAramStream.cpp:394
static void firstLoadTask(void *)
Definition JASAramStream.cpp:193
s16 field_0x130[CHANNEL_MAX]
Definition JASAramStream.h:160
static s32 dvdErrorCheck(void *)
Definition JASAramStream.cpp:368
void(* StreamCallback)(u32, JASAramStream *, void *)
Definition JASAramStream.h:22
u32 mBlock
Definition JASAramStream.h:152
u32 field_0x164
Definition JASAramStream.h:170
u16 field_0x158
Definition JASAramStream.h:166
f32 mVolume
Definition JASAramStream.h:174
StreamCallback mCallback
Definition JASAramStream.h:164
u32 field_0x14c
Definition JASAramStream.h:163
bool mLoop
Definition JASAramStream.h:171
bool field_0x0ac
Definition JASAramStream.h:139
void setChannelVolume(int channel, f32 volume)
Definition JASAramStream.h:111
f32 mChannelFxMix[CHANNEL_MAX]
Definition JASAramStream.h:178
void * field_0x040[16]
Definition JASAramStream.h:135
static s32 channelProcCallback(void *)
Definition JASAramStream.cpp:361
int field_0x0b4
Definition JASAramStream.h:143
f32 mChannelPan[CHANNEL_MAX]
Definition JASAramStream.h:177
void setPitch(f32 pitch)
Definition JASAramStream.h:86
f32 mChannelVolume[CHANNEL_MAX]
Definition JASAramStream.h:176
bool pause(bool)
Definition JASAramStream.cpp:156
void setChannelPan(int channel, f32 pan)
Definition JASAramStream.h:116
s16 field_0x13c[CHANNEL_MAX]
Definition JASAramStream.h:161
bool field_0x0ad
Definition JASAramStream.h:140
static u32 sChannelMax
Definition JASAramStream.h:185
JASChannel * mChannels[CHANNEL_MAX]
Definition JASAramStream.h:137
void * mCallbackData
Definition JASAramStream.h:165
s32 channelProc()
Definition JASAramStream.cpp:583
u32 field_0x118
Definition JASAramStream.h:154
int field_0x124
Definition JASAramStream.h:157
void updateChannel(u32, JASChannel *, JASDsp::TChannel *)
Definition JASAramStream.cpp:402
static u32 getBlockSize()
Definition JASAramStream.h:131
static void headerLoadTask(void *)
Definition JASAramStream.cpp:186
u8 field_0x0ae
Definition JASAramStream.h:141
void * field_0x080[4]
Definition JASAramStream.h:136
static void loadToAramTask(void *)
Definition JASAramStream.cpp:219
bool start()
Definition JASAramStream.cpp:146
static u32 sBlockSize
Definition JASAramStream.h:184
u16 mChannelNum
Definition JASAramStream.h:167
f32 mChannelDolby[CHANNEL_MAX]
Definition JASAramStream.h:179
void setDolby(f32 dolby)
Definition JASAramStream.h:105
static void initSystem(u32, u32)
Definition JASAramStream.cpp:38
void setPan(f32 pan)
Definition JASAramStream.h:93
f32 mPitch
Definition JASAramStream.h:175
int field_0x120
Definition JASAramStream.h:156
void setFxmix(f32 fxMix)
Definition JASAramStream.h:99
int field_0x0bc
Definition JASAramStream.h:145
Definition JASAudioThread.cpp:53
Definition JASTaskThread.h:11
static initFunc init[]
Definition d_menu_collect.cpp:42
int i
Definition e_pow.c:165
Definition JASAramStream.h:10
Definition dvd.h:75
Definition JASAramStream.h:53
s16 field_0x0
Definition JASAramStream.h:57
u32 field_0x4
Definition JASAramStream.h:55
struct JASAramStream::BlockHeader::@111 field_0x8[6]
s16 field_0x2
Definition JASAramStream.h:58
u32 tag
Definition JASAramStream.h:54
Definition JASAramStream.h:36
u8 format
Definition JASAramStream.h:39
u16 loop
Definition JASAramStream.h:42
int loop_start
Definition JASAramStream.h:45
u32 block_size
Definition JASAramStream.h:47
u8 field_0x4[5]
Definition JASAramStream.h:38
u16 channels
Definition JASAramStream.h:41
u8 bits
Definition JASAramStream.h:40
u32 tag
Definition JASAramStream.h:37
u8 field_0x29[0x17]
Definition JASAramStream.h:50
u8 field_0x24[4]
Definition JASAramStream.h:48
u8 field_0x14[4]
Definition JASAramStream.h:44
int loop_end
Definition JASAramStream.h:46
u8 field_0x28
Definition JASAramStream.h:49
int field_0x10
Definition JASAramStream.h:43
Definition JASAramStream.h:30
int field_0x8
Definition JASAramStream.h:33
u32 field_0x4
Definition JASAramStream.h:32
JASAramStream * stream
Definition JASAramStream.h:31
Definition JASDSPInterface.h:32
Definition OSMessage.h:12
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