diff options
author | Simon Howard | 2015-05-30 13:04:56 -0400 |
---|---|---|
committer | Simon Howard | 2015-05-30 13:04:56 -0400 |
commit | 0e90c19ca717298f4f3b83dfd075cdf0c458de32 (patch) | |
tree | 09fae977fd34c03759d5c90e7daf2a087e6e7756 /src/setup | |
parent | 5082f14944442344030d66f6fbdf86a75a1c1c70 (diff) | |
parent | 1e516e34911d3a95479c303fe26b59f20e618252 (diff) | |
download | chocolate-doom-0e90c19ca717298f4f3b83dfd075cdf0c458de32.tar.gz chocolate-doom-0e90c19ca717298f4f3b83dfd075cdf0c458de32.tar.bz2 chocolate-doom-0e90c19ca717298f4f3b83dfd075cdf0c458de32.zip |
Merge pull request #545 from khokh2001/opl3_mode
opl: Add OPL3 mode.
The DMX library had limited support for the features of the OPL3 chip,
enabled by setting the DMXOPTIONS variable. This reproduces the OPL3
support in Chocolate Doom's OPL playback and emulation layer.
Huge thanks to Alexey Khokholov for researching and developing this.
This fixes #470.
Diffstat (limited to 'src/setup')
-rw-r--r-- | src/setup/sound.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/src/setup/sound.c b/src/setup/sound.c index 280a6bc2..092a5dd8 100644 --- a/src/setup/sound.c +++ b/src/setup/sound.c @@ -61,6 +61,12 @@ static char *musicmode_strings[] = "CD audio" }; +static char *opltype_strings[] = +{ + "OPL2", + "OPL3" +}; + static char *cfg_extension[] = { "cfg", NULL }; // Config file variables: @@ -84,6 +90,7 @@ static float libsamplerate_scale = 0.65; static char *timidity_cfg_path = NULL; static char *gus_patch_path = NULL; static int gus_ram_kb = 1024; +static int opl_type = 0; // DOS specific variables: these are unused but should be maintained // so that the config file can be shared between chocolate @@ -139,29 +146,36 @@ static void UpdateExtraTable(TXT_UNCAST_ARG(widget), { TXT_CAST_ARG(txt_table_t, extra_table); - // Rebuild the GUS table. Start by emptying it, then only add the - // GUS control widget if we are in GUS music mode. - - TXT_ClearTable(extra_table); - - if (snd_musicmode == MUSICMODE_GUS) + switch (snd_musicmode) { + case MUSICMODE_OPL: + TXT_InitTable(extra_table, 2); + TXT_SetColumnWidths(extra_table, 19, 4); TXT_AddWidgets(extra_table, - TXT_NewLabel("GUS patch path:"), - TXT_NewFileSelector(&gus_patch_path, 30, - "Select path to GUS patches", - TXT_DIRECTORY), - NULL); - } + TXT_NewLabel("OPL type"), + TXT_NewDropdownList(&opl_type, opltype_strings, 2), + NULL); + break; - if (snd_musicmode == MUSICMODE_NATIVE) - { + case MUSICMODE_GUS: + TXT_InitTable(extra_table, 1); TXT_AddWidgets(extra_table, - TXT_NewLabel("Timidity configuration file:"), - TXT_NewFileSelector(&timidity_cfg_path, 30, - "Select Timidity config file", - cfg_extension), - NULL); + TXT_NewLabel("GUS patch path:"), + TXT_NewFileSelector(&gus_patch_path, 30, + "Select path to GUS patches", + TXT_DIRECTORY), + NULL); + break; + + case MUSICMODE_NATIVE: + TXT_InitTable(extra_table, 1); + TXT_AddWidgets(extra_table, + TXT_NewLabel("Timidity configuration file:"), + TXT_NewFileSelector(&timidity_cfg_path, 30, + "Select Timidity config file", + cfg_extension), + NULL); + break; } } @@ -324,6 +338,7 @@ void BindSoundVariables(void) M_BindIntVariable("snd_cachesize", &snd_cachesize); M_BindIntVariable("opl_io_port", &opl_io_port); + M_BindIntVariable("opl_type", &opl_type); if (gamemission == strife) { |