Fix audio changes to be compatible with CDF/CDFJ

This commit is contained in:
cd-w 2020-11-15 15:36:23 -08:00 committed by Stephen Anthony
parent 2e6ddaa3d8
commit 248bb7b96f
1 changed files with 3 additions and 2 deletions

View File

@ -277,7 +277,8 @@ uInt8 CartridgeCDF::peek(uInt16 address)
if DIGITAL_AUDIO_ON
{
// retrieve packed sample (max size is 2K, or 4K of unpacked data)
uInt32 sampleaddress = getSample() + (myMusicCounters[0] >> 13);
uInt32 sampleaddress = getSample() + (myMusicCounters[0] >> (isCDFJplus() ? 13 : 21));
// get sample value from ROM or RAM
if (sampleaddress < 0x00080000)
@ -288,7 +289,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
peekvalue = 0;
// make sure current volume value is in the lower nybble
if ((myMusicCounters[0] & (1<<12)) == 0)
if ((myMusicCounters[0] & (1<<(isCDFJplus() ? 12 : 20))) == 0)
peekvalue >>= 4;
peekvalue &= 0x0f;
}