From ced98b9b77730b1d485b781437aff063e5b45c1e Mon Sep 17 00:00:00 2001 From: RNMB15 <56356083+RNMB15@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:39:07 +0200 Subject: [PATCH] Update sblaster.cpp --- src/hardware/sblaster.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hardware/sblaster.cpp b/src/hardware/sblaster.cpp index 73777faab1..f021b6292c 100644 --- a/src/hardware/sblaster.cpp +++ b/src/hardware/sblaster.cpp @@ -3718,7 +3718,7 @@ class SBLASTER: public Module_base { /* OPL/CMS Init */ const char * omode=config->Get_string("oplmode"); if (!strcasecmp(omode,"none")) opl_mode=OPL_none; - else if (!strcasecmp(omode,"cms")) opl_mode=OPL_cms; + else if (!strcasecmp(omode,"cms")) {} // Skip for backward compatibility with existing configurations else if (!strcasecmp(omode,"opl2")) opl_mode=OPL_opl2; else if (!strcasecmp(omode,"dualopl2")) opl_mode=OPL_dualopl2; else if (!strcasecmp(omode,"opl3")) opl_mode=OPL_opl3; @@ -3733,7 +3733,8 @@ class SBLASTER: public Module_base { opl_mode=OPL_none; break; case SBT_GB: - opl_mode=OPL_cms; + opl_mode=OPL_none; + bool cms; break; case SBT_1: case SBT_2: @@ -3999,8 +4000,12 @@ bool is_cms_enabled() Bitu base = (unsigned int)section->Get_hex("hardwarebase"); HARDOPL_Init(base, sb.hw.base, isCMSpassthrough); #else - LOG_MSG("OPL pass-through is disabled. It may not be supported on this operating system."); + LOG_MSG("OPL pass-through is disabled. It may not be supported on this operating system."); #endif + sb.cms = is_cms_enabled(); + if (cms) { + CMS_Init(section); + } break; } if (sb.type==SBT_NONE || sb.type==SBT_GB) return; @@ -4266,6 +4271,9 @@ ASP> ~SBLASTER() { switch (oplmode) { + if (sb.cms) { + CMS_ShutDown(m_configuration); + } case OPL_none: break; case OPL_opl2: