Commit 9863375a authored by ekeeke's avatar ekeeke
Browse files

[Core/MD] fixed MegaSD edge case when another 'pause' command is sent while...

[Core/MD] fixed MegaSD edge case when another 'pause' command is sent while fade out is still in progress
parent 52c54c70
No preview for this file type
No preview for this file type
......@@ -547,6 +547,13 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
/* check audio track is currently playing */
if (scd.regs[0x36>>1].byte.h == 0x00)
{
/* check if fade out is already in progress */
if (megasd_hw.fadeoutSamplesCount > 0)
{
/* restore initial volume */
cdd.fader[0] = cdd.fader[1] = megasd_hw.fadeoutStartVolume;
}
/* get fade out samples count from command parameter */
megasd_hw.fadeoutSamplesCount = (data & 0xff) * 588;
......@@ -582,7 +589,17 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
case 0x15: /* Set CDDA volume (0-255) */
{
cdd.fader[0] = cdd.fader[1] = ((data & 0xff) * 0x400) / 255;
/* check if fade out is in progress */
if (megasd_hw.fadeoutSamplesCount > 0)
{
/* update default volume to be restored once fade out is finished */
megasd_hw.fadeoutStartVolume = ((data & 0xff) * 0x400) / 255;
}
else
{
/* update current volume */
cdd.fader[0] = cdd.fader[1] = ((data & 0xff) * 0x400) / 255;
}
return;
}
......@@ -614,6 +631,9 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
/* update CDD status to allow reading data track */
cdd.status = CD_PLAY;
/* no audio track playing */
scd.regs[0x36>>1].byte.h = 0x01;
}
}
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment