fmtowns: fix off-by-1 calculation in CDDA length (#7921)

This commit is contained in:
r09 2021-04-03 13:58:58 +02:00 committed by GitHub
parent 195d45d335
commit db89743e8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1614,7 +1614,7 @@ void towns_state::towns_cdrom_play_cdda(cdrom_image_device* device)
lba2 += m_towns_cd.parameter[3] << 8;
lba2 += m_towns_cd.parameter[2];
m_towns_cd.cdda_current = msf_to_lbafm(lba1);
m_towns_cd.cdda_length = msf_to_lbafm(lba2) - m_towns_cd.cdda_current;
m_towns_cd.cdda_length = msf_to_lbafm(lba2) - m_towns_cd.cdda_current + 1;
m_cdda->set_cdrom(device->get_cdrom_file());
m_cdda->start_audio(m_towns_cd.cdda_current,m_towns_cd.cdda_length);