DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
sound.hpp
1#pragma once
2
3#include "common.h"
4
8// clang-format off
9enum MidiPort {
10 MIDI_PORT_BGM = 0,
11 MIDI_PORT_AMBIENT = 1,
12 MIDI_PORT_UNK_2 = 2,
13 MIDI_PORT_UNK_A = 10,
14 MIDI_PORT_UNK_B = 11,
15 MIDI_PORT_SE_SPECIAL = 12,
16 MIDI_PORT_UNK_D = 13,
17 MIDI_PORT_SE_DEFAULT = 14,
18 MIDI_PORT_SE_TITLE = 15,
19};
20
21// clang-format on
22
28 char name[12];
29 s32 volume;
30};
31
39
40STATIC_ASSERT(sizeof(SQ_INF_TABLE) == 0x1904);
41
45struct MIDI_FADE {
46 s32 active;
48 float volume;
49 float step;
50};
51
52STATIC_ASSERT(sizeof(MIDI_FADE) == 0x10);
53
58struct MIDI_PORT {
59 void *bank;
61 void *sequence_address[10];
65 u8 unk_7C[4];
66};
67
68STATIC_ASSERT(sizeof(MIDI_PORT) == 0x80);
69
73struct MIDI_STATE {
75};
76
77STATIC_ASSERT(sizeof(MIDI_STATE) == 0x400);
78
84struct MIDI_BANK {
85 void *hd_address;
86 void *bd_address;
87 s32 bd_size;
89 u8 unk_10[0x30];
90};
91
92STATIC_ASSERT(sizeof(MIDI_BANK) == 0x40);
93
98struct SE_INF {
99 s8 bank;
101 s16 volume;
102};
103
108 SE_INF entry[3000];
109 s32 count;
110};
111
112STATIC_ASSERT(sizeof(SE_INF_TABLE) == 0x2EE4);
113
119 s32 size;
120 s32 length;
121 u8 messages[0x1F8];
122};
123
124STATIC_ASSERT(sizeof(MSIN_BUFFER) == 0x200);
125
126class CSound {
127public:
136
144 short *GetSeInfTbl();
145
153 int GetSeNo(int bank, int program);
154
162 void StopVoice(int core);
163
171 void SetReverb(int core, int mode, int depth);
172
180 int LoadSoundFileFromPack(char *name, unsigned int *pack);
181
189 int LoadSqInf(char *name, unsigned int *buffer);
190
198 int LoadSeInf(char *name, unsigned int *buffer);
199
207 int Init(int mode0, int mode1, int depth0, int depth1);
208
216 void SQ_Play(int port, int seq_no);
217
225 void SQ_Play(int port, int seq_no, int volume);
226
234 void SQ_RePlay(int port);
235
243 void SE_Play(int port, int bank, int program, int pan, int velocity, int volume, int voice);
244
252 void SE_Play(int port, int se_no, int voice);
253
261 void SE_Play(int port, int bank, int program, int volume, int voice);
262
270 void SE_Play(int port, int bank, int program, int voice);
271
279 void SE_SetVol(int port, int bank, int program, int volume, int voice);
280
288 void SE_SetPan(int port, int bank, int program, int pan, int voice);
289
298 void SE_SetPan(int port, int se_no, int pan, int voice);
299
307 void SE_Stop(int port, int bank, int program, int voice);
308
316 void Fade(int port, float step, int volume);
317
325 void Step();
326
334 void Stop(int port);
335
343 void SetVol(int port, int volume);
344
352 void SetStereoMode(int mode);
353
361 int LoadHdBd_A(int hd, int hd_size, int bd, int bd_size);
362
370 int LoadHdBd_C(int hd, int hd_size, int bd, int bd_size);
371
379 int LoadHdBd_E(int hd, int hd_size, int bd, int bd_size);
380
388 int LoadHdBd_G(int hd, int hd_size, int bd, int bd_size);
389
397 int LoadHdBd_I(int hd, int hd_size, int bd, int bd_size);
398
406 int LoadHdBd_M(int hd, int hd_size, int bd, int bd_size);
407
415 int LoadHdBd_Q(int hd, int hd_size, int bd, int bd_size);
416
424 int LoadHdBd_S(int hd, int hd_size, int bd, int bd_size);
425
433 int LoadSeq_A(int address, int size);
434
442 int LoadSeq_E(int address, int size);
443
451 int LoadSeq_I(int address, int size);
452};
453
454STATIC_ASSERT(sizeof(CSound) == 1);
455
463extern CSound CSnd;
void StopVoice(int core)
Definition sound.cpp:69
int Init(int mode0, int mode1, int depth0, int depth1)
Definition sound.cpp:372
int LoadHdBd_E(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1065
int LoadSeq_I(int address, int size)
Definition sound.cpp:1292
void SE_Play(int port, int bank, int program, int pan, int velocity, int volume, int voice)
Definition sound.cpp:579
int LoadSoundFileFromPack(char *name, unsigned int *pack)
Definition sound.cpp:186
int LoadSeq_E(int address, int size)
Definition sound.cpp:1275
int LoadHdBd_S(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1230
int LoadHdBd_C(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1022
void SetStereoMode(int mode)
Definition sound.cpp:987
void SE_SetPan(int port, int bank, int program, int pan, int voice)
Definition sound.cpp:679
void Step()
Definition sound.cpp:814
void SetVol(int port, int volume)
Definition sound.cpp:983
int LoadHdBd_M(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1174
int LoadHdBd_G(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1096
void SE_SetVol(int port, int bank, int program, int volume, int voice)
Definition sound.cpp:643
int LoadHdBd_A(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:991
int LoadHdBd_Q(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1202
void Fade(int port, float step, int volume)
Definition sound.cpp:755
int LoadHdBd_I(int hd, int hd_size, int bd, int bd_size)
Definition sound.cpp:1125
void SQ_RePlay(int port)
Definition sound.cpp:574
void Stop(int port)
Definition sound.cpp:978
short * GetSeInfTbl()
Definition sound.cpp:49
void SE_Stop(int port, int bank, int program, int voice)
Definition sound.cpp:719
int LoadSeq_A(int address, int size)
Definition sound.cpp:1258
int LoadSqInf(char *name, unsigned int *buffer)
Definition sound.cpp:321
void SQ_Play(int port, int seq_no)
Definition sound.cpp:495
int LoadSeInf(char *name, unsigned int *buffer)
Definition sound.cpp:344
void SetReverb(int core, int mode, int depth)
Definition sound.cpp:74
int GetSeNo(int bank, int program)
Definition sound.cpp:53
MIDI_STATE * GetMidiState()
Definition sound.cpp:45
void * hd_address
Definition sound.hpp:85
s32 spu_address
Definition sound.hpp:88
s32 bd_size
Definition sound.hpp:87
void * bd_address
Definition sound.hpp:86
s32 active
Definition sound.hpp:46
float volume
Definition sound.hpp:48
s32 target_volume
Definition sound.hpp:47
float step
Definition sound.hpp:49
MIDI_FADE fade[2]
Definition sound.hpp:64
void * sequence_address[10]
Definition sound.hpp:61
s32 spu_address
Definition sound.hpp:60
MIDI_SEQUENCE * sequence[10]
Definition sound.hpp:62
void * bank
Definition sound.hpp:59
s32 sequence_count
Definition sound.hpp:63
char name[12]
Definition sound.hpp:28
MIDI_PORT port[8]
Definition sound.hpp:74
u8 messages[0x1F8]
Definition sound.hpp:121
SE_INF entry[3000]
Definition sound.hpp:108
s8 bank
Definition sound.hpp:99
s16 volume
Definition sound.hpp:101
s8 program
Definition sound.hpp:100
MIDI_SEQUENCE sequence[400]
Definition sound.hpp:36