aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_opl3.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2024-05-11 01:50:09 +0300
committerWohlstand <admin@wohlnet.ru>2024-05-11 01:50:09 +0300
commitef1ff088508f734147ad4a84983a5d127d5f8898 (patch)
treecddf9ecf218cbbba1d537fdf102ff624401cf676 /src/adlmidi_opl3.cpp
parent119293f8ae3c154f3ed2ab37c43fe04941569961 (diff)
downloadlibADLMIDI-ef1ff088508f734147ad4a84983a5d127d5f8898.tar.gz
libADLMIDI-ef1ff088508f734147ad4a84983a5d127d5f8898.tar.bz2
libADLMIDI-ef1ff088508f734147ad4a84983a5d127d5f8898.zip
OPL3: Also clean up frequency registers
This will guarantee the identical work on hardware too
Diffstat (limited to 'src/adlmidi_opl3.cpp')
-rw-r--r--src/adlmidi_opl3.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp
index 4638c5a..7809725 100644
--- a/src/adlmidi_opl3.cpp
+++ b/src/adlmidi_opl3.cpp
@@ -1846,7 +1846,12 @@ void OPL3::initChip(size_t chip)
/* Clean-up channels from any playing junk sounds */
for(size_t a = 0; a < OPL3_CHANNELS_RHYTHM_BASE; ++a)
+ {
+ writeRegI(chip, 0x20 + g_channelsMap[a * 2], 0x00);
+ writeRegI(chip, 0x20 + g_channelsMap[(a * 2) + 1], 0x00);
+ writeRegI(chip, 0xA0 + g_channelsMap[a], 0x00);
writeRegI(chip, 0xB0 + g_channelsMap[a], 0x00);
+ }
for(size_t a = 0; a < sizeof(data) / sizeof(*data); a += 2)
writeRegI(chip, data[a], (data[a + 1]));