-
Notifications
You must be signed in to change notification settings - Fork 44
/
SPUSOUND.C
69 lines (52 loc) · 1.3 KB
/
SPUSOUND.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "SPUSOUND.H"
#include "SFX.H"
#include "SOUND.H"
#include <SYS/TYPES.H>
#include <LIBSPU.H>
short DepthTable[] =
{
0x0000, 0x0000, 0x1000, 0x0010, 0x1800
};
//Number of times SPU malloc can be called.
#define MAX_SPU_MALLOC_CALLS 1
short CurrentReverb;
int LnSamplesLoaded;
long LlVABAddr;
SpuVoiceAttr sva;
unsigned char LabSampleType[MAX_SOUND_SLOTS];
unsigned char LabFreeChannel[MAX_SOUND_SLOTS];
int LnFreeChannels;
static unsigned char LabSPUMallocArea[SPU_MALLOC_RECSIZ * (MAX_SPU_MALLOC_CALLS + 1)];
unsigned long LadwSampleAddr[MAX_NUM_SOUND_EFFECTS];
void SPU_FreeSamples()//62610, 62CF4 (F) (*)
{
SPU_StopAll();
if(LnSamplesLoaded != 0)
{
SpuFree(LlVABAddr);
}
LlVABAddr = 0;
LnSamplesLoaded = 0;
return;
}
void SPU_Init()//62650(<), 62D34(<) (F) (*) (D)
{
int nChannel;
SpuInit();
SpuInitMalloc(MAX_SPU_MALLOC_CALLS, (char*)&LabSPUMallocArea[0]);
SpuSetTransferMode(SPU_TRANSFER_BY_DMA);
SpuSetCommonMasterVolume(0x3FFF, 0x3FFF);
SpuSetReverbModeType(SPU_REV_MODE_STUDIO_B | SPU_REV_MODE_CLEAR_WA);
SpuSetReverbModeDepth(0x1FFF, 0x1FFF);
SpuSetReverbVoice(SPU_ON, SPU_ALLCH);
SpuSetReverb(SPU_ON);
LnFreeChannels = 0;
//loc_626B4
for(nChannel = 0; nChannel < MAX_SOUND_SLOTS; nChannel++)
{
SPU_FreeChannel(nChannel);
}
LlVABAddr = 0;
LnSamplesLoaded = 0;
return;
}