mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-26 11:11:48 +01:00
[Core/MD] fixed MegaSD edge case occurring when 'play' command is sent while previous track fade out is still in progress
This commit is contained in:
parent
7ca2deffa6
commit
42b8cc665c
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 3.8 MiB |
Binary file not shown.
Before Width: | Height: | Size: 4.0 MiB After Width: | Height: | Size: 4.0 MiB |
@ -487,6 +487,16 @@ static void megasd_ctrl_write_word(unsigned int address, unsigned int data)
|
|||||||
cdd.status = CD_PLAY;
|
cdd.status = CD_PLAY;
|
||||||
scd.regs[0x36>>1].byte.h = 0x00;
|
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 */
|
/* initialize remaining samples count */
|
||||||
megasd_hw.playbackSamplesCount = (cdd.toc.tracks[index].end - cdd.toc.tracks[index].start) * 588;
|
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;
|
cdd.status = CD_PLAY;
|
||||||
scd.regs[0x36>>1].byte.h = 0x00;
|
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) */
|
/* get playback end sector from command buffer (32-bit value in big-endian format) */
|
||||||
#ifndef LSB_FIRST
|
#ifndef LSB_FIRST
|
||||||
megasd_hw.playbackEndSector = *(unsigned int *)(megasd_hw.buffer + 4) - 150;
|
megasd_hw.playbackEndSector = *(unsigned int *)(megasd_hw.buffer + 4) - 150;
|
||||||
|
Loading…
Reference in New Issue
Block a user