Skip to content

Commit

Permalink
Add support for SudoMaker RetroWave OPL3 express
Browse files Browse the repository at this point in the history
  • Loading branch information
mywave82 committed Jun 27, 2023
1 parent de8f3b3 commit 4c56a6c
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 9 deletions.
24 changes: 16 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ AC_ARG_ENABLE([output-oss],AS_HELP_STRING([--disable-output-oss],[Disable OSS ou
AC_ARG_ENABLE([output-null],AS_HELP_STRING([--disable-output-null],[Disable null output]))
AC_ARG_ENABLE([output-disk],AS_HELP_STRING([--disable-output-disk],[Disable disk writer]))
AC_ARG_ENABLE([output-esound],AS_HELP_STRING([--disable-output-esound],[Disable EsounD output]))
AC_ARG_ENABLE([output-retrowave],AS_HELP_STRING([--disable-output-retrowave],[Disable RetroWave output]))
AC_ARG_ENABLE([output-qsa],AS_HELP_STRING([--disable-output-qsa],[Disable QSA output]))
AC_ARG_ENABLE([output-sdl],AS_HELP_STRING([--disable-output-sdl],[Disable SDL output]))
AC_ARG_ENABLE([output-alsa],AS_HELP_STRING([--disable-output-alsa],[Disable ALSA output]))
Expand Down Expand Up @@ -146,6 +147,12 @@ if test ${enable_output_esound:=yes} = yes; then
AC_MSG_RESULT([*** EsounD (libesd) >= 0.2.8 not installed ***]))
fi

# RetroWave output
if test ${enable_output_retrowave:=yes} = yes; then
AC_DEFINE(DRIVER_RETROWAVE,1,[Build RetroWave output])
drivers=$drivers' retrowave.$(OBJEXT)'
fi

# QSA driver
if test ${enable_output_qsa:=yes} = yes; then
AC_MSG_CHECKING([for QSA headers])
Expand Down Expand Up @@ -219,11 +226,12 @@ echo "Configuration:"
echo "Install path: ${prefix}"
echo ""
echo "Build output mechanisms:"
echo "OSS output (oss): ${enable_output_oss}"
echo "Null output (null): ${enable_output_null}"
echo "Disk writer (disk): ${enable_output_disk}"
echo "EsounD output (esound): ${enable_output_esound}"
echo "QSA output (qsa): ${enable_output_qsa}"
echo "SDL output (sdl): ${enable_output_sdl}"
echo "ALSA output (alsa): ${enable_output_alsa}"
echo "Libao output (ao): ${enable_output_ao}"
echo "OSS output (oss): ${enable_output_oss}"
echo "Null output (null): ${enable_output_null}"
echo "Disk writer (disk): ${enable_output_disk}"
echo "EsounD output (esound): ${enable_output_esound}"
echo "Retrowave output (retrowave) ${enable_output_retrowave}"
echo "QSA output (qsa): ${enable_output_qsa}"
echo "SDL output (sdl): ${enable_output_sdl}"
echo "ALSA output (alsa): ${enable_output_alsa}"
echo "Libao output (ao): ${enable_output_ao}"
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ adplay_SOURCES = adplay.cc output.cc output.h players.h defines.h

EXTRA_adplay_SOURCES = oss.cc oss.h null.h disk.cc disk.h esound.cc esound.h \
qsa.cc qsa.h sdl.cc sdl.h alsa.cc alsa.h ao.cc ao.h getopt.c \
retrowave.cc retrowave.h \
getopt1.c getopt.h

adplay_LDADD = $(drivers) $(adplug_LIBS) @ESD_LIBS@ @QSA_LIBS@ @SDL_LIBS@ \
Expand Down
20 changes: 20 additions & 0 deletions src/adplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ static void usage()
"EsounD driver (esound) specific:\n"
" -d, --device=URL URL to EsounD server host (hostname:port)\n\n"
#endif
#ifdef DRIVER_RETROWAVE
"RetroWave driver (retrowave) specific:\n"
" -d --device=DEVICE set sound device to DEVICE\n\n"
#endif
#ifdef DRIVER_SDL
"SDL driver (sdl) specific:\n"
" -b, --buffer=SIZE set output buffer size to SIZE\n\n"
Expand Down Expand Up @@ -202,6 +206,9 @@ static void usage()
#ifdef DRIVER_ESOUND
"esound "
#endif
#ifdef DRIVER_RETROWAVE
"retrowave "
#endif
#ifdef DRIVER_QSA
"qsa "
#endif
Expand Down Expand Up @@ -300,6 +307,10 @@ static int decode_switches(int argc, char **argv)
if(!strcmp(optarg,"alsa")) cfg.output = alsa;
else
#endif
#ifdef DRIVER_RETROWAVE
if(!strcmp(optarg,"retrowave")) cfg.output = retrowave;
else
#endif
#ifdef DRIVER_SDL
if(!strcmp(optarg,"sdl")) cfg.output = sdl;
else
Expand Down Expand Up @@ -579,6 +590,15 @@ int main(int argc, char **argv)
player = new AOPlayer(opl, cfg.device, cfg.bits, cfg.channels, cfg.freq, cfg.buf_size);
break;
#endif
#ifdef DRIVER_RETROWAVE
case retrowave:
if (opl) {
delete(opl);
opl = 0;
}
player = new RetroWavePlayer(cfg.device);
break;
#endif
#ifdef DRIVER_SDL
case sdl:
player = new SDLPlayer(opl, cfg.bits, cfg.channels, cfg.freq, cfg.buf_size);
Expand Down
8 changes: 7 additions & 1 deletion src/players.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "config.h"

// Enumerate ALL outputs (regardless of availability)
enum Outputs {none, null, ao, oss, disk, esound, qsa, sdl, alsa};
enum Outputs {none, null, ao, oss, disk, esound, retrowave, qsa, sdl, alsa};

#define DEFAULT_DRIVER none

Expand All @@ -39,6 +39,12 @@ enum Outputs {none, null, ao, oss, disk, esound, qsa, sdl, alsa};
#define DEFAULT_DRIVER null
#endif

#ifdef DRIVER_RETROWAVE
#include "retrowave.h"
#undef DEFAULT_DRIVER
#define DEFAULT_DRIVER retrowave
#endif

// Disk writer
#ifdef DRIVER_DISK
#include "disk.h"
Expand Down
Loading

0 comments on commit 4c56a6c

Please sign in to comment.