fmtowns.cpp: fix CDDA start/end position

This commit is contained in:
r09 2019-07-14 22:53:37 +02:00 committed by GitHub
parent c0bfb23284
commit 99e33d7668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,7 +224,7 @@ inline uint32_t towns_state::msf_to_lbafm(uint32_t val) // because the CDROM co
f = bcd_to_byte(val & 0x0000ff);
s = (bcd_to_byte((val & 0x00ff00) >> 8));
m = (bcd_to_byte((val & 0xff0000) >> 16));
return ((m * (60 * 75)) + (s * 75) + f);
return ((m * (60 * 75)) + (s * 75) + f) - 150;
}
void towns_state::init_serial_rom()
@ -1481,13 +1481,7 @@ void towns_state::towns_cdrom_read(cdrom_image_device* device)
m_towns_cd.lba_current = msf_to_lbafm(lba1);
m_towns_cd.lba_last = msf_to_lbafm(lba2);
// first track starts at 00:02:00 - this is hardcoded in the boot procedure
track = cdrom_get_track(device->get_cdrom_file(),m_towns_cd.lba_current);
if(track < 2)
{ // recalculate LBA
m_towns_cd.lba_current -= 150;
m_towns_cd.lba_last -= 150;
}
// parameter 7 = sector count?
// lemmings 2 sets this to 4 but hates 4 extra sectors being read