From ff10fdf9294eb33a21c03db658a2e910e07c2d60 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 19 Oct 2019 23:48:40 +0000 Subject: [PATCH] Add mus_adlibstereo cvar to enable and disable AdLib stereo mode git-svn-id: https://svn.eduke32.com/eduke32@8223 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/audiolib/src/driver_adlib.cpp | 4 ++-- source/audiolib/src/driver_adlib.h | 2 ++ source/audiolib/src/fx_man.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/audiolib/src/driver_adlib.cpp b/source/audiolib/src/driver_adlib.cpp index b5f1b508c..7b35095f4 100644 --- a/source/audiolib/src/driver_adlib.cpp +++ b/source/audiolib/src/driver_adlib.cpp @@ -197,7 +197,7 @@ static AdLibChannel Channel[NUMADLIBCHANNELS]; static int AL_LeftPort = ADLIB_PORT; static int AL_RightPort = ADLIB_PORT; -static int AL_Stereo; +int AL_Stereo; static int AL_SendStereo; static int AL_MaxMidiChannel = 16; @@ -863,7 +863,7 @@ static int AL_Init(int rate) { OPL3_Reset(&chip, rate); - AL_Stereo = FALSE; + AL_Stereo = TRUE; AL_LeftPort = ADLIB_PORT; AL_RightPort = ADLIB_PORT + 2; diff --git a/source/audiolib/src/driver_adlib.h b/source/audiolib/src/driver_adlib.h index 362b0210c..1ddd90544 100644 --- a/source/audiolib/src/driver_adlib.h +++ b/source/audiolib/src/driver_adlib.h @@ -22,6 +22,8 @@ #include "midifuncs.h" #include "opl3.h" +extern int AL_Stereo; + int AdLibDrv_GetError(void); const char *AdLibDrv_ErrorString(int ErrorNumber); diff --git a/source/audiolib/src/fx_man.cpp b/source/audiolib/src/fx_man.cpp index 25dbca26b..c9bc1cf22 100644 --- a/source/audiolib/src/fx_man.cpp +++ b/source/audiolib/src/fx_man.cpp @@ -73,6 +73,7 @@ int FX_Init(int numvoices, int numchannels, unsigned mixrate, void *initdata) static osdcvardata_t cvars_audiolib[] = { { "mus_emidicard", "force a specific EMIDI instrument set", (void *)&ASS_EMIDICard, CVAR_INT | CVAR_FUNCPTR, 0, 10 }, + { "mus_adlibstereo", "enable/disable OPL3 stereo mode", (void *)&AL_Stereo, CVAR_BOOL | CVAR_FUNCPTR, 0, 10 }, }; if (!init++)