diff options
author | Walter van Niftrik | 2015-03-26 09:19:28 +0100 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:48 -0400 |
commit | f0606aa8f131b72bf76e08a82f6deb5016d5d8bb (patch) | |
tree | 3f5f3edcd45bdd98eec3266467f4e36cd98942ed /audio | |
parent | 1287a56429d0cd85567daa130fc6518ee2030b70 (diff) | |
download | scummvm-rg350-f0606aa8f131b72bf76e08a82f6deb5016d5d8bb.tar.gz scummvm-rg350-f0606aa8f131b72bf76e08a82f6deb5016d5d8bb.tar.bz2 scummvm-rg350-f0606aa8f131b72bf76e08a82f6deb5016d5d8bb.zip |
AUDIO: Reset OPL registers in ALSA driver
Diffstat (limited to 'audio')
-rw-r--r-- | audio/softsynth/opl/alsa.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/audio/softsynth/opl/alsa.cpp b/audio/softsynth/opl/alsa.cpp index 79ff589bd2..6b9e48e987 100644 --- a/audio/softsynth/opl/alsa.cpp +++ b/audio/softsynth/opl/alsa.cpp @@ -179,9 +179,17 @@ bool OPL::init() { void OPL::reset() { snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_RESET, nullptr); - if (_iface != SND_HWDEP_IFACE_OPL2) + if (_iface == SND_HWDEP_IFACE_OPL3) snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_MODE, (void *)SNDRV_DM_FM_MODE_OPL3); + clear(); + + // Sync up with the hardware + snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_PARAMS, (void *)&_params); + for (uint i = 0; i < (_iface == SND_HWDEP_IFACE_OPL3 ? kVoices : kOpl2Voices); ++i) + snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_PLAY_NOTE, (void *)&_voice[i]); + for (uint i = 0; i < (_iface == SND_HWDEP_IFACE_OPL3 ? kOperators : kOpl2Operators); ++i) + snd_hwdep_ioctl(_opl, SNDRV_DM_FM_IOCTL_SET_VOICE, (void *)&_oper[i]); } void OPL::write(int port, int val) { |