aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi_opl3.cpp5
-rw-r--r--src/chips/dosbox/dbopl.cpp9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp
index 983949e..44322a3 100644
--- a/src/adlmidi_opl3.cpp
+++ b/src/adlmidi_opl3.cpp
@@ -33,7 +33,10 @@
#ifdef ADLMIDI_HW_OPL
static const unsigned OPLBase = 0x388;
#else
-# if defined(ADLMIDI_DISABLE_NUKED_EMULATOR) && defined(ADLMIDI_DISABLE_DOSBOX_EMULATOR)
+# if defined(ADLMIDI_DISABLE_NUKED_EMULATOR) && \
+ defined(ADLMIDI_DISABLE_DOSBOX_EMULATOR) && \
+ defined(ADLMIDI_DISABLE_OPAL_EMULATOR) && \
+ defined(ADLMIDI_DISABLE_JAVA_EMULATOR)
# error "No emulators enabled. You must enable at least one emulator to use this library!"
# endif
diff --git a/src/chips/dosbox/dbopl.cpp b/src/chips/dosbox/dbopl.cpp
index d1ab82f..5b4bf53 100644
--- a/src/chips/dosbox/dbopl.cpp
+++ b/src/chips/dosbox/dbopl.cpp
@@ -1507,11 +1507,15 @@ void Chip::Setup( Bit32u rate ) {
}
}
-static bool doneTables = false;
+static volatile bool doneTables = false;
+static Mutex mutexTables;
+
void InitTables( void ) {
if ( doneTables )
return;
- doneTables = true;
+ MutexHolder lock( mutexTables );
+ if ( doneTables )
+ return;
#if ( DBOPL_WAVE == WAVE_HANDLER ) || ( DBOPL_WAVE == WAVE_TABLELOG )
//Exponential volume table, same as the real adlib
for ( int i = 0; i < 256; i++ ) {
@@ -1661,6 +1665,7 @@ void InitTables( void ) {
}
}
#endif
+ doneTables = true;
}
Bit32u Handler::WriteAddr( Bit32u port, Bit8u val ) {