comparison src/sexypsf/spu/externals.h @ 12:3da1b8942b8b trunk

[svn] - remove src/Input src/Output src/Effect src/General src/Visualization src/Container
author nenolod
date Mon, 18 Sep 2006 03:14:20 -0700
parents src/Input/sexypsf/spu/externals.h@13389e613d67
children
comparison
equal deleted inserted replaced
11:cff1d04026ae 12:3da1b8942b8b
1 /***************************************************************************
2 externals.h - description
3 -------------------
4 begin : Wed May 15 2002
5 copyright : (C) 2002 by Pete Bernert
6 email : BlackDove@addcom.de
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. See also the license.txt file for *
15 * additional informations. *
16 * *
17 ***************************************************************************/
18
19 #include "types.h"
20 #include "PsxMem.h"
21
22 //*************************************************************************//
23 // History of changes:
24 //
25 // 2002/05/15 - Pete
26 // - generic cleanup for the Peops release
27 //
28 //*************************************************************************//
29
30 #define max(a,b) (((a) > (b)) ? (a) : (b))
31 #define min(a,b) (((a) < (b)) ? (a) : (b))
32
33 ////////////////////////////////////////////////////////////////////////
34 // spu defines
35 ////////////////////////////////////////////////////////////////////////
36
37 // num of channels
38 #define MAXCHAN 24
39
40 ///////////////////////////////////////////////////////////
41 // struct defines
42 ///////////////////////////////////////////////////////////
43
44 // ADSR INFOS PER CHANNEL
45 typedef struct
46 {
47 int AttackModeExp;
48 s32 AttackTime;
49 s32 DecayTime;
50 s32 SustainLevel;
51 int SustainModeExp;
52 s32 SustainModeDec;
53 s32 SustainTime;
54 int ReleaseModeExp;
55 u32 ReleaseVal;
56 s32 ReleaseTime;
57 s32 ReleaseStartTime;
58 s32 ReleaseVol;
59 s32 lTime;
60 s32 lVolume;
61 } ADSRInfo;
62
63 typedef struct
64 {
65 int State;
66 int AttackModeExp;
67 int AttackRate;
68 int DecayRate;
69 int SustainLevel;
70 int SustainModeExp;
71 int SustainIncrease;
72 int SustainRate;
73 int ReleaseModeExp;
74 int ReleaseRate;
75 int EnvelopeVol;
76 s32 lVolume;
77 s32 lDummy1;
78 s32 lDummy2;
79 } ADSRInfoEx;
80
81 ///////////////////////////////////////////////////////////
82
83 // Tmp Flags
84
85 // used for debug channel muting
86 #define FLAG_MUTE 1
87
88 ///////////////////////////////////////////////////////////
89
90 // MAIN CHANNEL STRUCT
91 typedef struct
92 {
93 int bNew; // start flag
94
95 int iSBPos; // mixing stuff
96 int spos;
97 int sinc;
98 int SB[32+1];
99 int sval;
100
101 u8 * pStart; // start ptr into sound mem
102 u8 * pCurr; // current pos in sound mem
103 u8 * pLoop; // loop ptr in sound mem
104
105 int bOn; // is channel active (sample playing?)
106 int bStop; // is channel stopped (sample _can_ still be playing, ADSR Release phase)
107 int iActFreq; // current psx pitch
108 int iUsedFreq; // current pc pitch
109 int iLeftVolume; // left volume
110 int iLeftVolRaw; // left psx volume value
111 int bIgnoreLoop; // ignore loop bit, if an external loop address is used
112 int iRightVolume; // right volume
113 int iRightVolRaw; // right psx volume value
114 int iRawPitch; // raw pitch (0...3fff)
115 int iIrqDone; // debug irq done flag
116 int s_1; // last decoding infos
117 int s_2;
118 int bRVBActive; // reverb active flag
119 int iRVBOffset; // reverb offset
120 int iRVBRepeat; // reverb repeat
121 int bNoise; // noise active flag
122 int bFMod; // freq mod (0=off, 1=sound channel, 2=freq channel)
123 int iOldNoise; // old noise val for this channel
124 ADSRInfo ADSR; // active ADSR settings
125 ADSRInfoEx ADSRX; // next ADSR settings (will be moved to active on sample start)
126
127 } SPUCHAN;
128
129 ///////////////////////////////////////////////////////////
130
131 typedef struct
132 {
133 int StartAddr; // reverb area start addr in samples
134 int CurrAddr; // reverb area curr addr in samples
135
136 int Enabled;
137 int VolLeft;
138 int VolRight;
139 int iLastRVBLeft;
140 int iLastRVBRight;
141 int iRVBLeft;
142 int iRVBRight;
143
144
145 int FB_SRC_A; // (offset)
146 int FB_SRC_B; // (offset)
147 int IIR_ALPHA; // (coef.)
148 int ACC_COEF_A; // (coef.)
149 int ACC_COEF_B; // (coef.)
150 int ACC_COEF_C; // (coef.)
151 int ACC_COEF_D; // (coef.)
152 int IIR_COEF; // (coef.)
153 int FB_ALPHA; // (coef.)
154 int FB_X; // (coef.)
155 int IIR_DEST_A0; // (offset)
156 int IIR_DEST_A1; // (offset)
157 int ACC_SRC_A0; // (offset)
158 int ACC_SRC_A1; // (offset)
159 int ACC_SRC_B0; // (offset)
160 int ACC_SRC_B1; // (offset)
161 int IIR_SRC_A0; // (offset)
162 int IIR_SRC_A1; // (offset)
163 int IIR_DEST_B0; // (offset)
164 int IIR_DEST_B1; // (offset)
165 int ACC_SRC_C0; // (offset)
166 int ACC_SRC_C1; // (offset)
167 int ACC_SRC_D0; // (offset)
168 int ACC_SRC_D1; // (offset)
169 int IIR_SRC_B1; // (offset)
170 int IIR_SRC_B0; // (offset)
171 int MIX_DEST_A0; // (offset)
172 int MIX_DEST_A1; // (offset)
173 int MIX_DEST_B0; // (offset)
174 int MIX_DEST_B1; // (offset)
175 int IN_COEF_L; // (coef.)
176 int IN_COEF_R; // (coef.)
177 } REVERBInfo;