1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2002 Ben Parnell
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.
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.
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
21 #define OVERSAMPLESHIFT 4
22 #define OVERSAMPLE *16
23 #define SND_BUFSIZE 256
27 void (*Fill)(int Count);
28 void (*RChange)(void);
31 // from 0.98.15, currently unused
32 void (*NeoFill)(int32 *Wave, int Count);
34 void (*HiSync)(int32 ts);
37 extern EXPSOUND GameExpSound;
39 //extern int64 nesincsizeLL;
40 extern int32 nesincsize;
41 extern uint8 PSG[0x18];
42 extern uint32 PSG_base;
44 void SetSoundVariables(void);
45 extern uint8 decvolume[];
54 extern uint8 sweepon[2];
55 extern int32 curfreq[2];
57 extern uint8 SweepCount[2];
58 extern uint8 DecCountTo1[3];
64 uint8 FCEU_GetJoyJoy(void);
66 int GetSoundBuffer(int16 **W);
67 int FlushEmulateSound(void);
68 extern uint32 Wave[2048+512];
69 extern int16 WaveFinalMono[2048+512];
70 extern int32 WaveHi[];
71 extern uint32 soundtsinc;
73 extern uint32 soundtsoffs;
74 #define SOUNDTS (timestamp + soundtsoffs)
76 void SetNESSoundMap(void);
77 void FrameSoundUpdate(void);
78 void FixOldSaveStateSFreq(void);
80 void FCEUSND_Power(void);
81 void FCEUSND_Reset(void);
82 void FCEUSND_SaveState(void);
83 void FCEUSND_LoadState(int version);
85 void FCEU_SoundCPUHook(int cycles48);