apps,fceux: add config.h for configuration of frameskip and sound
This commit is contained in:
parent
2c17242576
commit
a149aba788
|
@ -12,6 +12,7 @@ INCLUDES += $(addprefix -I, $(INC_DIR)) -I$(AM_HOME)/am/
|
|||
INCLUDES += -I$(AM_HOME)/am/include
|
||||
CFLAGS += -O2 -MMD -Wall -Werror -ggdb $(INCLUDES) \
|
||||
-D__ISA__=\"$(ISA)\" -D__ISA_$(shell echo $(ISA) | tr a-z A-Z)__ \
|
||||
-D__PLATFORM__=\"$(PLATFORM)\" -D__PLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z)__ \
|
||||
-D__ARCH__=$(ARCH) -D__ARCH_$(shell echo $(ARCH) | tr a-z A-Z | tr - _) \
|
||||
-DARCH_H=\"arch/$(ARCH).h\" \
|
||||
-fno-asynchronous-unwind-tables -fno-builtin -fno-stack-protector \
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
|
||||
#define SOUND_NONE 0
|
||||
#define SOUND_LQ 1
|
||||
#define SOUND_HQ 2
|
||||
|
||||
#if defined(__PLATFORM_NEMU__)
|
||||
# define NR_FRAMESKIP 1
|
||||
# define SOUND_CONFIG SOUND_LQ
|
||||
#elif defined(__PLATFORM_NOOP__)
|
||||
# define NR_FRAMESKIP 2
|
||||
# define SOUND_CONFIG SOUND_NONE
|
||||
#else
|
||||
# define NR_FRAMESKIP 0
|
||||
# define SOUND_CONFIG SOUND_HQ
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "sdl.h"
|
||||
#include <amdev.h>
|
||||
#include "../../config.h"
|
||||
|
||||
// unit: 16-bit
|
||||
static unsigned int s_BufferSize;
|
||||
|
@ -33,7 +34,17 @@ static unsigned int s_BufferSize;
|
|||
int
|
||||
InitSound()
|
||||
{
|
||||
#if SOUND_CONFIG == SOUND_NONE
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
#if SOUND_CONFIG == SOUND_HQ
|
||||
const int soundrate = 44100;
|
||||
const int soundq = 1;
|
||||
#else
|
||||
const int soundrate = 11025;
|
||||
const int soundq = 0;
|
||||
#endif
|
||||
const int soundbufsize = 128;
|
||||
const int soundvolume = 150;
|
||||
const int soundtrianglevolume = 256;
|
||||
|
@ -41,10 +52,9 @@ InitSound()
|
|||
const int soundsquare2volume = 256;
|
||||
const int soundnoisevolume = 256;
|
||||
const int soundpcmvolume = 256;
|
||||
const int soundq = 1;
|
||||
|
||||
_DEV_AUDIO_INIT_t init;
|
||||
init.freq = 44100;
|
||||
init.freq = soundrate;
|
||||
init.channels = 1;
|
||||
init.samples = 512;
|
||||
init.bufsize = soundbufsize * soundrate / 1000;
|
||||
|
|
|
@ -11,12 +11,7 @@
|
|||
#include "sdl-video.h"
|
||||
|
||||
#include "../../types.h"
|
||||
|
||||
#ifdef __ISA_NATIVE__
|
||||
#define NR_FRAMESKIP 0
|
||||
#else
|
||||
#define NR_FRAMESKIP 2
|
||||
#endif
|
||||
#include "../../config.h"
|
||||
|
||||
int isloaded;
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "sound.h"
|
||||
#include "filter.h"
|
||||
#include "state.h"
|
||||
#include "config.h"
|
||||
//#include "wave.h"
|
||||
//#include "debug.h"
|
||||
|
||||
|
@ -516,6 +517,10 @@ static INLINE void DMCDMA(void)
|
|||
|
||||
void FCEU_SoundCPUHook(int cycles)
|
||||
{
|
||||
#if SOUND_CONFIG != SOUND_HQ
|
||||
return;
|
||||
#endif
|
||||
|
||||
fhcnt-=cycles*48;
|
||||
if(fhcnt<=0)
|
||||
{
|
||||
|
@ -1007,6 +1012,10 @@ void SetNESSoundMap(void)
|
|||
static int32 inbuf=0;
|
||||
int FlushEmulateSound(void)
|
||||
{
|
||||
#if SOUND_CONFIG == SOUND_NONE
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
int x;
|
||||
int32 end,left;
|
||||
|
||||
|
|
Loading…
Reference in New Issue