diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-08-16 04:30:38 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-08-16 04:30:38 +0300 |
commit | 64496d6a075fa0bdcdd20520a3476970d5146e78 (patch) | |
tree | f64c59b3c0a6511c08631b408d5c15350e2edb4b /src | |
parent | 0848115cd0dcdc06700ad3c74224d36f99d77779 (diff) | |
parent | 6813ad7480d14406db0911b0297bbc77436c5496 (diff) | |
download | libADLMIDI-64496d6a075fa0bdcdd20520a3476970d5146e78.tar.gz libADLMIDI-64496d6a075fa0bdcdd20520a3476970d5146e78.tar.bz2 libADLMIDI-64496d6a075fa0bdcdd20520a3476970d5146e78.zip |
Merge branch 'master' into wip-new-embedded-banks
Diffstat (limited to 'src')
-rw-r--r-- | src/adlmidi_opl3.cpp | 15 | ||||
-rw-r--r-- | src/adlmidi_private.hpp | 21 |
2 files changed, 22 insertions, 14 deletions
diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp index a5d8f74..18488b3 100644 --- a/src/adlmidi_opl3.cpp +++ b/src/adlmidi_opl3.cpp @@ -236,6 +236,13 @@ OPL3::OPL3() : OPL3::~OPL3() { +#ifdef ADLMIDI_HW_OPL + silenceAll(); + writeRegI(0, 0x0BD, 0); + writeRegI(0, 0x104, 0); + writeRegI(0, 0x105, 0); + silenceAll(); +#endif } bool OPL3::setupLocked() @@ -341,19 +348,19 @@ void OPL3::writeReg(size_t chip, uint16_t address, uint8_t value) unsigned o = address >> 8; unsigned port = OPLBase + o * 2; - #ifdef __DJGPP__ +# ifdef __DJGPP__ outportb(port, address); for(unsigned c = 0; c < 6; ++c) inportb(port); outportb(port + 1, value); for(unsigned c = 0; c < 35; ++c) inportb(port); - #endif +# endif - #ifdef __WATCOMC__ +# ifdef __WATCOMC__ outp(port, address); for(uint16_t c = 0; c < 6; ++c) inp(port); outp(port + 1, value); for(uint16_t c = 0; c < 35; ++c) inp(port); - #endif//__WATCOMC__ +# endif//__WATCOMC__ #else//ADLMIDI_HW_OPL m_chips[chip]->writeReg(address, value); diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 887fc4d..b478363 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -60,16 +60,17 @@ typedef int32_t ssize_t; #endif #if defined(__DJGPP__) || (defined(__WATCOMC__) && (defined(__DOS__) || defined(__DOS4G__) || defined(__DOS4GNZ__))) -#define ADLMIDI_HW_OPL -#include <conio.h> -#ifdef __DJGPP__ -#include <pc.h> -#include <dpmi.h> -#include <go32.h> -#include <sys/farptr.h> -#include <dos.h> -#endif - +# ifndef ADLMIDI_HW_OPL +# define ADLMIDI_HW_OPL +# endif +# include <conio.h> +# ifdef __DJGPP__ +# include <pc.h> +# include <dpmi.h> +# include <go32.h> +# include <sys/farptr.h> +# include <dos.h> +# endif #endif #include <vector> |