release r2, update credits
[fceu.git] / sound.h
CommitLineData
c62d2810 1/* FCE Ultra - NES/Famicom Emulator
2 *
3 * Copyright notice for this file:
4 * Copyright (C) 2002 Ben Parnell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#define OVERSAMPLESHIFT 4
22#define OVERSAMPLE *16
23#define SND_BUFSIZE 256
24
25
26typedef struct {
27 void (*Fill)(int Count);
28 void (*RChange)(void);
29 void (*Kill)(void);
d97315ac 30
31 // from 0.98.15, currently unused
32 void (*NeoFill)(int32 *Wave, int Count);
33 void (*HiFill)(void);
34 void (*HiSync)(int32 ts);
c62d2810 35} EXPSOUND;
36
37extern EXPSOUND GameExpSound;
38
971a1d07 39//extern int64 nesincsizeLL;
a384bf44 40extern int32 nesincsize;
41extern uint8 PSG[0x18];
c62d2810 42extern uint32 PSG_base;
c62d2810 43
77887306 44void SetSoundVariables(void);
c62d2810 45extern uint8 decvolume[];
46
47extern int vdis;
48extern uint8 sqnon;
49extern uint16 nreg;
50
51extern uint8 trimode;
52extern uint8 tricoop;
c62d2810 53
54extern uint8 sweepon[2];
55extern int32 curfreq[2];
56
57extern uint8 SweepCount[2];
58extern uint8 DecCountTo1[3];
59
60extern uint8 fcnt;
61extern int32 fhcnt;
62extern int32 fhinc;
63
d97315ac 64uint8 FCEU_GetJoyJoy(void);
65
c4980f9e 66int GetSoundBuffer(int16 **W);
c62d2810 67int FlushEmulateSound(void);
a384bf44 68extern uint32 Wave[2048+512];
69extern int16 WaveFinalMono[2048+512];
ebde7d27 70extern int32 WaveHi[];
c62d2810 71extern uint32 soundtsinc;
72
4fdfab07 73extern uint32 soundtsoffs;
74#define SOUNDTS (timestamp + soundtsoffs)
75
c62d2810 76void SetNESSoundMap(void);
77void FrameSoundUpdate(void);
78void FixOldSaveStateSFreq(void);
4fdfab07 79
5bd16b94 80void FCEUSND_Power(void);
81void FCEUSND_Reset(void);
82void FCEUSND_SaveState(void);
83void FCEUSND_LoadState(int version);
84
3ac1cc0b 85void FCEU_SoundCPUHook(int cycles48);
77887306 86DECLFW(Write_IRQFM);