(Libxenon) Terribly borked libxenon audio driver :)

This commit is contained in:
TwinAphex51224 2011-12-13 23:17:37 +01:00
parent 2a3f3bad23
commit 1136820124
6 changed files with 19 additions and 10 deletions

View File

@ -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

View File

@ -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;

View File

@ -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[] = {

View File

@ -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;

View File

@ -98,6 +98,8 @@ static void set_defaults(void)
case AUDIO_EXT:
def_audio = "ext";
break;
case AUDIO_XENON360:
def_audio = "xenon360";
default:
break;
}

View File

@ -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"
};