aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-04-10 02:15:03 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-04-10 02:15:03 +0300
commit8a0a939a3281a31fc17327d24f0a4c0975a1b9fa (patch)
treee5f87aba998ede08465aa319af7dba930abff025 /utils
parent0ad695eeaaf5d52d3ea4ef15d295d8cc62002a50 (diff)
downloadlibADLMIDI-8a0a939a3281a31fc17327d24f0a4c0975a1b9fa.tar.gz
libADLMIDI-8a0a939a3281a31fc17327d24f0a4c0975a1b9fa.tar.bz2
libADLMIDI-8a0a939a3281a31fc17327d24f0a4c0975a1b9fa.zip
[Experimental] Added support for emulation core switching in real time!
Due to clunky playback on updated Nuked OPL3 emulator v 1.8, I kept the Nuked OPL3 1.7.4 work in parallel and be a separated switchable emulator.
Diffstat (limited to 'utils')
-rw-r--r--utils/midiplay/adlmidiplay.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/utils/midiplay/adlmidiplay.cpp b/utils/midiplay/adlmidiplay.cpp
index 69b3698..3734b13 100644
--- a/utils/midiplay/adlmidiplay.cpp
+++ b/utils/midiplay/adlmidiplay.cpp
@@ -195,6 +195,11 @@ int main(int argc, char **argv)
" -s Enables scaling of modulator volumes\n"
" -nl Quit without looping\n"
" -w Write WAV file rather than playing\n"
+ #ifndef HARDWARE_OPL3
+ " --emu-nuked Uses Nuked OPL3 v 1.7.4 emulator\n"
+ " --emu-nuked8 Uses Nuked OPL3 v 1.8 emulator\n"
+ " --emu-dosbox Uses DosBox 0.74 OPL3 emulator\n"
+ #endif
"\n"
"Where <bank> - number of embeeded bank or filepath to custom WOPL bank file\n"
"\n"
@@ -282,6 +287,10 @@ int main(int argc, char **argv)
bool recordWave = false;
int loopEnabled = 1;
#endif
+ #ifndef HARDWARE_OPL3
+ int emulator = ADLMIDI_EMU_NUKED;
+ #endif
+
while(argc > 2)
{
bool had_option = false;
@@ -290,16 +299,29 @@ int main(int argc, char **argv)
adl_setPercMode(myDevice, 1);//Turn on AdLib percussion mode
else if(!std::strcmp("-v", argv[2]))
adl_setHVibrato(myDevice, 1);//Turn on deep vibrato
+
#ifndef OUTPUT_WAVE_ONLY
else if(!std::strcmp("-w", argv[2]))
recordWave = true;//Record library output into WAV file
#endif
+
else if(!std::strcmp("-t", argv[2]))
adl_setHTremolo(myDevice, 1);//Turn on deep tremolo
+
#ifndef OUTPUT_WAVE_ONLY
else if(!std::strcmp("-nl", argv[2]))
loopEnabled = 0; //Enable loop
#endif
+
+ #ifndef HARDWARE_OPL3
+ else if(!std::strcmp("--emu-nuked", argv[2]))
+ emulator = ADLMIDI_EMU_NUKED;
+ else if(!std::strcmp("--emu-nuked8", argv[2]))
+ emulator = ADLMIDI_EMU_NUKED_8;
+ else if(!std::strcmp("--emu-dosbox", argv[2]))
+ emulator = ADLMIDI_EMU_DOSBOX;
+ #endif
+
else if(!std::strcmp("-s", argv[2]))
adl_setScaleModulators(myDevice, 1);//Turn on modulators scaling by volume
else break;
@@ -321,10 +343,14 @@ int main(int argc, char **argv)
adl_setRawEventHook(myDevice, debugPrintEvent, NULL);
#endif
+ #ifndef HARDWARE_OPL3
+ adl_switchEmulator(myDevice, emulator);
+ #endif
+
#ifdef HARDWARE_OPL3
std::fprintf(stdout, " - Hardware OPL3 chip in use\n");
#else
- std::fprintf(stdout, " - %s OPL3 Emulator in use\n", adl_emulatorName());
+ std::fprintf(stdout, " - %s Emulator in use\n", adl_chipEmulatorName(myDevice));
#endif
#if !defined(HARDWARE_OPL3) && !defined(OUTPUT_WAVE_ONLY)