AUDIO: Introduce DISABLE_MAME_OPL

Similar to DISABLE_DOSBOX_OPL and DISABLE_NUKED_OPL. Now with the null
driver available, weaker backends can be completely OPL emulation free.
This commit is contained in:
Miro Kropacek
2026-04-22 00:44:03 +10:00
committed by Filippos Karapetis
parent 25024d5188
commit 182ad45eae
4 changed files with 19 additions and 1 deletions
+4
View File
@@ -81,7 +81,9 @@ OPL::OPL() {
const Config::EmulatorDescription Config::_drivers[] = {
{ "auto", "<default>", kAuto, kFlagOpl2 | kFlagDualOpl2 | kFlagOpl3 },
{ "null", _s("None"), kNull, kFlagOpl2 | kFlagDualOpl2 | kFlagOpl3 },
#ifndef DISABLE_MAME_OPL
{ "mame", _s("MAME OPL emulator"), kMame, kFlagOpl2 },
#endif
#ifndef DISABLE_DOSBOX_OPL
{ "db", _s("DOSBox OPL emulator"), kDOSBox, kFlagOpl2 | kFlagDualOpl2 | kFlagOpl3 },
#endif
@@ -201,12 +203,14 @@ OPL *Config::create(DriverId driver, OplType type) {
}
switch (driver) {
#ifndef DISABLE_MAME_OPL
case kMame:
if (type == kOpl2)
return new MAME::OPL();
else
warning("MAME OPL emulator only supports OPL2 emulation");
return nullptr;
#endif
#ifndef DISABLE_DOSBOX_OPL
case kDOSBox:
+4
View File
@@ -22,6 +22,8 @@
*
*/
#ifndef DISABLE_MAME_OPL
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1253,3 +1255,5 @@ FM_OPL *makeAdLibOPL(int rate) {
} // End of namespace MAME
} // End of namespace OPL
#endif // !DISABLE_MAME_OPL
+4
View File
@@ -26,6 +26,8 @@
#ifndef AUDIO_SOFTSYNTH_OPL_MAME_H
#define AUDIO_SOFTSYNTH_OPL_MAME_H
#ifndef DISABLE_MAME_OPL
#include "common/scummsys.h"
#include "common/random.h"
@@ -196,4 +198,6 @@ protected:
} // End of namespace MAME
} // End of namespace OPL
#endif // !DISABLE_MAME_OPL
#endif
+7 -1
View File
@@ -180,7 +180,13 @@ static const char HELP_STRING4[] =
" --enable-gs Enable Roland GS mode for MIDI playback\n"
" --output-channels=CHANNELS Select output channel count (e.g. 2 for stereo)\n"
" --output-rate=RATE Select output sample rate in Hz (e.g. 22050)\n"
" --opl-driver=DRIVER Select AdLib (OPL) emulator (db, mame"
" --opl-driver=DRIVER Select AdLib (OPL) emulator ("
#ifndef DISABLE_MAME_OPL
"mame"
#endif
#ifndef DISABLE_DOSBOX_OPL
", db"
#endif
#ifndef DISABLE_NUKED_OPL
", nuked"
#endif