diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 6047f912..1dadd8ca 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -857,7 +857,7 @@ static BYTE __stdcall MB_Read(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULO bool bAccessedDevice = (CS & 3) ? true : false; - bool CS_SSI263 = !(nAddr & 0x80) && (nAddr & 0x60); // SSI263 at $Cn2x and/or $Cn4x + bool CS_SSI263 = !(nAddr & 0x10) && (nAddr & 0x60) && !(nAddr & 0x80); // SSI263 at $Cn2x and/or $Cn4x if (g_phasorMode == PH_Phasor && CS_SSI263) // NB. Mockingboard mode: SSI263.bit7 not readable { diff --git a/source/SSI263.cpp b/source/SSI263.cpp index 26617318..9e689cbb 100644 --- a/source/SSI263.cpp +++ b/source/SSI263.cpp @@ -312,6 +312,15 @@ void SSI263::Play(unsigned int nPhoneme) return; } + if (!m_isVotraxPhoneme) + { + const DWORD volume = AMPLITUDE_MASK - (m_ctrlArtAmp & AMPLITUDE_MASK); // Invert so that: 0=max, 15=min + SSI263SingleVoice.nVolume = NewVolume(volume*volume, AMPLITUDE_MASK*AMPLITUDE_MASK); // logarithmic, but amplitude<8 can't be heard + HRESULT hr = SSI263SingleVoice.lpDSBvoice->SetVolume(SSI263SingleVoice.nVolume); + if (hr != S_OK) + LogFileOutput("SSI263::Play: SetVolume(%d) res = %08X\n", SSI263SingleVoice.nVolume, hr); + } + if (m_dbgFirst) { m_dbgStartTime = g_nCumulativeCycles; @@ -328,9 +337,6 @@ void SSI263::Play(unsigned int nPhoneme) bool bPause = false; - if (!m_isVotraxPhoneme && (m_ctrlArtAmp & AMPLITUDE_MASK) == 0) - nPhoneme = 0; - if (nPhoneme == 1) nPhoneme = 2; // Missing this sample, so map to phoneme-2