changeset 49:3518ca5c8b0f

Support for compile-time big/little-endian optimizations in audio output
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 21 Jun 2003 20:51:01 +0000
parents 9f3b5e7a0c15
children dae6d3c2268d
files src/xmms-sid.cc src/xs_support.c src/xs_support.h
diffstat 3 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmms-sid.cc	Sat Jun 21 20:50:02 2003 +0000
+++ b/src/xmms-sid.cc	Sat Jun 21 20:51:01 2003 +0000
@@ -226,7 +226,7 @@
  pthread_mutex_unlock(&xs_mutex);
 
 
-
+ /* Exit the playing thread */
  XSDEBUG("exiting thread, bye.\n");
  return NULL;
 }
@@ -335,7 +335,11 @@
  /* Configure rest of the emulation */
  xs_emuConf.bitsPerSample	= xs_cfg.fmtBitsPerSample;
  xs_emuConf.frequency		= xs_cfg.fmtFrequency;
+#ifdef HAVE_UNSIGNEDPCM
+ xs_emuConf.sampleFormat	= SIDEMU_UNSIGNED_PCM;
+#else
  xs_emuConf.sampleFormat	= SIDEMU_SIGNED_PCM;
+#endif
  xs_emuConf.mos8580		= xs_cfg.mos8580;
  xs_emuConf.emulateFilter	= xs_cfg.emulateFilters;
  xs_emuConf.filterFs		= xs_cfg.filterFs;
@@ -425,6 +429,20 @@
  xs_emuConf.sidDefault   = SID2_MOS6581;
  xs_emuConf.sidSamples   = emulation.sidSamples;
 
+#ifdef HAVE_UNSIGNEDPCM
+#ifdef WORDS_BIGENDIAN
+ xs_emuConf.sampleFormat	= SID2_BIG_UNSIGNED;
+#else
+ xs_emuConf.sampleFormat	= SID2_LITTLE_UNSIGNED;
+#endif
+#else
+#ifdef WORDS_BIGENDIAN
+ xs_emuConf.sampleFormat	= SID2_BIG_SIGNED;
+#else
+ xs_emuConf.sampleFormat	= SID2_LITTLE_SIGNED;
+#endif
+#endif
+
  /* Now set the emulator configuration */
  xs_emuEngine.config(xs_emuConf);
 #endif
--- a/src/xs_support.c	Sat Jun 21 20:50:02 2003 +0000
+++ b/src/xs_support.c	Sat Jun 21 20:51:01 2003 +0000
@@ -20,7 +20,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
-#include "xmms-sid.h"
+#include "xs_support.h"
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
--- a/src/xs_support.h	Sat Jun 21 20:50:02 2003 +0000
+++ b/src/xs_support.h	Sat Jun 21 20:51:01 2003 +0000
@@ -5,7 +5,7 @@
 extern "C" {
 #endif
 
-#include <glib.h>
+#include "xmms-sid.h"
 
 /*
  * Functions