merged ppu code, added input+zapper, FDS/VS insert in menu
[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;
d97315ac 40extern int64 nesincsize;
c62d2810 41extern uint8 PSG[];
42extern uint32 PSG_base;
43extern int32 PCMIRQCount;
44
45void SetSoundVariables(void);
46void PowerSound(void);
47void ResetSound(void);
48extern uint8 decvolume[];
49
50extern int vdis;
51extern uint8 sqnon;
52extern uint16 nreg;
53
54extern uint8 trimode;
55extern uint8 tricoop;
56extern uint8 PCMBitIndex;
57extern uint32 PCMAddressIndex;
58extern int32 PCMSizeIndex;
59extern uint8 PCMBuffer;
60
61extern uint8 sweepon[2];
62extern int32 curfreq[2];
63
64extern uint8 SweepCount[2];
65extern uint8 DecCountTo1[3];
66
67extern uint8 fcnt;
68extern int32 fhcnt;
69extern int32 fhinc;
70
d97315ac 71uint8 FCEU_GetJoyJoy(void);
72
73int GetSoundBuffer(int32 **W);
c62d2810 74int FlushEmulateSound(void);
75extern uint32 Wave[2048];
76extern int32 WaveFinal[2048];
5232c20c 77extern int16 WaveFinalMono[2048];
c62d2810 78extern uint32 soundtsinc;
79
4fdfab07 80extern uint32 soundtsoffs;
81#define SOUNDTS (timestamp + soundtsoffs)
82
c62d2810 83void SetNESSoundMap(void);
84void FrameSoundUpdate(void);
85void FixOldSaveStateSFreq(void);
4fdfab07 86
e2d0dd92 87DECLFW(Write_IRQFM);
88