Fixed a bug in the DOSBox track position return code to no longer incorrectly offset the relative position by 150 sectors (2 frames), fixes track time counters in Sony CD Player for DOS and DOS Navigator.
This commit is contained in:
@@ -59,8 +59,12 @@ void image_close(uint8_t id);
|
||||
|
||||
void image_audio_callback(uint8_t id, int16_t *output, int len)
|
||||
{
|
||||
if ((cdrom_image[id].cd_state != CD_PLAYING) || (cdrom_image[id].image_is_iso))
|
||||
if (!cdrom_drives[id].sound_on || (cdrom_image[id].cd_state != CD_PLAYING) || cdrom_image[id].image_is_iso)
|
||||
{
|
||||
if (cdrom_ioctl[id].cd_state == CD_PLAYING)
|
||||
{
|
||||
cdrom[id].seek_pos += (len >> 11);
|
||||
}
|
||||
memset(output, 0, len * 2);
|
||||
return;
|
||||
}
|
||||
@@ -292,22 +296,20 @@ static uint8_t image_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf)
|
||||
|
||||
if (msf)
|
||||
{
|
||||
uint32_t dat = MSFtoLBA(absPos.min, absPos.sec, absPos.fr);
|
||||
b[pos + 3] = (uint8_t)(dat % 75); dat /= 75;
|
||||
b[pos + 2] = (uint8_t)(dat % 60); dat /= 60;
|
||||
b[pos + 1] = (uint8_t)dat;
|
||||
b[pos + 3] = (uint8_t) absPos.fr;
|
||||
b[pos + 2] = (uint8_t) absPos.sec;
|
||||
b[pos + 1] = (uint8_t) absPos.min;
|
||||
b[pos] = 0;
|
||||
pos += 4;
|
||||
dat = MSFtoLBA(relPos.min, relPos.sec, relPos.fr);
|
||||
b[pos + 3] = (uint8_t)(dat % 75); dat /= 75;
|
||||
b[pos + 2] = (uint8_t)(dat % 60); dat /= 60;
|
||||
b[pos + 1] = (uint8_t)dat;
|
||||
b[pos + 3] = (uint8_t) relPos.fr;
|
||||
b[pos + 2] = (uint8_t) relPos.sec;
|
||||
b[pos + 1] = (uint8_t) relPos.min;
|
||||
b[pos] = 0;
|
||||
pos += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t dat = MSFtoLBA(absPos.min, absPos.sec, absPos.fr);
|
||||
uint32_t dat = MSFtoLBA(absPos.min, absPos.sec, absPos.fr) - 150;
|
||||
b[pos++] = (dat >> 24) & 0xff;
|
||||
b[pos++] = (dat >> 16) & 0xff;
|
||||
b[pos++] = (dat >> 8) & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user