diff --git a/Makefile.xenon b/Makefile.xenon index 6093ad0e34..c0d27a3c2c 100644 --- a/Makefile.xenon +++ b/Makefile.xenon @@ -18,7 +18,7 @@ PPU_TARGET_ADJUSTED := ssnes-libxenon.elf32 LDDIRS = -L. -L$(DEVKITXENON)/usr/lib -L$(DEVKITXENON)/xenon/lib/32 INCDIRS = -I. -I$(DEVKITXENON)/usr/include -I$(DEVKITXENON)/usr/include/SDL -OBJ = fifo_buffer.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o input/sdl.o audio/sdl.o gfx/sdl.o gfx/sdlwrap.o gfx/gfx_common.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o xenon/cond.o xenon/main.o +OBJ = fifo_buffer.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o input/sdl.o audio/sdl.o gfx/sdl.o gfx/sdlwrap.o gfx/gfx_common.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o audio/utils.o conf/config_file.o xenon/cond.o xenon/main.o xenon/xenon360_audio.o LIBS = -lsnes -lSDL -lxenon -lm -lc DEFINES = -std=gnu99 -DHAVE_CONFIGFILE=1 -DHAVE_SDL=1 -DPACKAGE_VERSION=\"0.9.3\" -DHAVE_GETOPT_LONG=1 -Dmain=ssnes_main diff --git a/config.def.h b/config.def.h index 6e6ca2866c..8991ee10bb 100644 --- a/config.def.h +++ b/config.def.h @@ -51,6 +51,7 @@ #define AUDIO_DSOUND 16 #define AUDIO_COREAUDIO 17 #define AUDIO_PS3 18 +#define AUDIO_XENON360 20 //////////////////////// #define INPUT_SDL 7 #define INPUT_X 12 @@ -71,6 +72,8 @@ #if defined(__CELLOS_LV2__) #define AUDIO_DEFAULT_DRIVER AUDIO_PS3 +#elif defined(XENON) +#define AUDIO_DEFAULT_DRIVER AUDIO_XENON360 #elif defined(HAVE_ALSA) #define AUDIO_DEFAULT_DRIVER AUDIO_ALSA #elif defined(HAVE_PULSE) @@ -184,7 +187,7 @@ static const float refresh_rate = 59.95; //////////////// // Will enable audio or not. -static const bool audio_enable = false; +static const bool audio_enable = true; // Output samplerate static const unsigned out_rate = 48000; diff --git a/driver.c b/driver.c index f80e83f8c4..89eca67f25 100644 --- a/driver.c +++ b/driver.c @@ -68,6 +68,9 @@ static const audio_driver_t *audio_drivers[] = { #ifdef HAVE_DYLIB &audio_ext, #endif +#ifdef XENON + &audio_xenon360, +#endif }; static const video_driver_t *video_drivers[] = { diff --git a/driver.h b/driver.h index 28d04a8eb6..ddeb724478 100644 --- a/driver.h +++ b/driver.h @@ -167,6 +167,7 @@ extern const audio_driver_t audio_pulse; extern const audio_driver_t audio_ext; extern const audio_driver_t audio_dsound; extern const audio_driver_t audio_coreaudio; +extern const audio_driver_t audio_xenon360; extern const audio_driver_t audio_ps3; extern const video_driver_t video_gl; extern const video_driver_t video_xvideo; diff --git a/settings.c b/settings.c index 36fc080c6b..d0a4c2f6c7 100644 --- a/settings.c +++ b/settings.c @@ -98,6 +98,8 @@ static void set_defaults(void) case AUDIO_EXT: def_audio = "ext"; break; + case AUDIO_XENON360: + def_audio = "xenon360"; default: break; } diff --git a/xenon/xenon360_audio.c b/xenon/xenon360_audio.c index f61ad72529..4e37013afb 100644 --- a/xenon/xenon360_audio.c +++ b/xenon/xenon360_audio.c @@ -32,11 +32,12 @@ typedef struct static void *xenon360_init(const char *device, unsigned rate, unsigned latency) { xenon_sound_init(); + return; } static ssize_t xenon360_write(void *data, const void *buf, size_t size) { - xenon360_audio_t *xa = data; + xenon360_audio_t *xenon360_audio = data; #if 0 if (xa->nonblock) { @@ -60,8 +61,8 @@ static bool xenon360_stop(void *data) static void xenon360_set_nonblock_state(void *data, bool state) { - xenon360_audio_t *xa = data; - xa->nonblock = state; + xenon360_audio_t *xenon360_audio = data; + xenon360_audio->nonblock = state; } static bool xenon360_start(void *data) @@ -78,12 +79,12 @@ static bool xenon360_use_float(void *data) static void xenon360_free(void *data) { - xenon360_audio_t *xa = data; - if (xa) - free(xa); + xenon360_audio_t *xenon360_audio = data; + if (xenon360_audio) + free(xenon360_audio); } -const audio_driver_t audio_xa = { +const audio_driver_t audio_xenon360 = { .init = xenon360_init, .write = xenon360_write, .stop = xenon360_stop, @@ -93,4 +94,3 @@ const audio_driver_t audio_xa = { .free = xenon360_free, .ident = "xenon360" }; -