SSI263: support reg3's amplitude

This commit is contained in:
tomcw 2022-06-03 22:09:32 +01:00
parent 22065c6325
commit 9e9996bee7
2 changed files with 10 additions and 4 deletions

View File

@ -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
{

View File

@ -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