1 /* FCE Ultra - NES/Famicom Emulator
2  *
3  * Copyright notice for this file:
4  *  Copyright (C) 2002 Xodnizel
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 
21 #ifndef _FCEU_SOUND_H
22 #define _FCEU_SOUND_H
23 
24 typedef struct {
25 	void (*Fill)(int Count);	/* Low quality ext sound. */
26 
27 	/* NeoFill is for sound devices that are emulated in a more
28 		high-level manner(VRC7) in HQ mode.  Interestingly,
29 		this device has slightly better sound quality(updated more
30 		often) in lq mode than in high-quality mode.  Maybe that
31 		should be fixed. :)
32 	*/
33 	void (*NeoFill)(int32 *Wave, int Count);
34 	void (*HiFill)(void);
35 	void (*HiSync)(int32 ts);
36 
37 	void (*RChange)(void);
38 	void (*Kill)(void);
39 } EXPSOUND;
40 
41 extern EXPSOUND GameExpSound;
42 
43 extern int32 nesincsize;
44 
45 void SetSoundVariables(void);
46 
47 int GetSoundBuffer(int32 **W);
48 int FlushEmulateSound(void);
49 extern int32 Wave[2048 + 512];
50 extern int32 WaveFinal[2048 + 512];
51 extern int32 WaveHi[];
52 extern uint32 soundtsinc;
53 
54 extern uint32 soundtsoffs;
55 #define SOUNDTS (sound_timestamp + soundtsoffs)
56 
57 void SetNESSoundMap(void);
58 void FrameSoundUpdate(void);
59 
60 void FCEUSND_Power(void);
61 void FCEUSND_Reset(void);
62 void FCEUSND_SaveState(void);
63 void FCEUSND_LoadState(int version);
64 
65 void FASTAPASS(1) FCEU_SoundCPUHook(int);
66 
67 #endif
68