Commit 42b8cc66 authored by ekeeke's avatar ekeeke
Browse files

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

[Core/MD] fixed MegaSD edge case occurring when 'play' command is sent while previous track fade out is still in progress
parent 7ca2deff
No preview for this file type
No preview for this file type
......@@ -487,6 +487,16 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
cdd.status = CD_PLAY;
scd.regs[0x36>>1].byte.h = 0x00;
/* check if fade out is still in progress */
if (megasd_hw.fadeoutSamplesCount > 0)
{
/* reset fade out */
megasd_hw.fadeoutSamplesCount = 0;
/* restore initial volume */
cdd.fader[0] = cdd.fader[1] = megasd_hw.fadeoutStartVolume;
}
/* initialize remaining samples count */
megasd_hw.playbackSamplesCount = (cdd.toc.tracks[index].end - cdd.toc.tracks[index].start) * 588;
......@@ -673,6 +683,16 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
cdd.status = CD_PLAY;
scd.regs[0x36>>1].byte.h = 0x00;
/* check if fade out is still in progress */
if (megasd_hw.fadeoutSamplesCount > 0)
{
/* reset fade out */
megasd_hw.fadeoutSamplesCount = 0;
/* restore initial volume */
cdd.fader[0] = cdd.fader[1] = megasd_hw.fadeoutStartVolume;
}
/* get playback end sector from command buffer (32-bit value in big-endian format) */
#ifndef LSB_FIRST
megasd_hw.playbackEndSector = *(unsigned int *)(megasd_hw.buffer + 4) - 150;
......
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