mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
-nscsi_cd: Return mid-sector data when initiating a read mid-sector in 512-byte block mode. [Ryan Holtz]
This commit is contained in:
parent
e317fb887f
commit
ea58b128bf
@ -49,6 +49,7 @@ uint8_t nscsi_cdrom_device::scsi_get_data(int id, int pos)
|
||||
if(id != 2)
|
||||
return nscsi_full_device::scsi_get_data(id, pos);
|
||||
const int sector = (lba * bytes_per_block + pos) / bytes_per_sector;
|
||||
const int extra_pos = (lba * bytes_per_block) % bytes_per_sector;
|
||||
if(sector != cur_sector) {
|
||||
cur_sector = sector;
|
||||
if(!cdrom_read_data(cdrom, sector, sector_buffer, CD_TRACK_MODE1)) {
|
||||
@ -56,7 +57,7 @@ uint8_t nscsi_cdrom_device::scsi_get_data(int id, int pos)
|
||||
std::fill_n(sector_buffer, sizeof(sector_buffer), 0);
|
||||
}
|
||||
}
|
||||
return sector_buffer[pos & (bytes_per_sector - 1)];
|
||||
return sector_buffer[(pos + extra_pos) & (bytes_per_sector - 1)];
|
||||
}
|
||||
|
||||
void nscsi_cdrom_device::return_no_cd()
|
||||
|
@ -1999,11 +1999,17 @@ static void sun_floppies(device_slot_interface &device)
|
||||
device.option_add("35hd", FLOPPY_35_HD);
|
||||
}
|
||||
|
||||
static void sun4_cdrom(device_t *device)
|
||||
{
|
||||
downcast<nscsi_cdrom_device &>(*device).set_block_size(512);
|
||||
}
|
||||
|
||||
static void sun_scsi_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("cdrom", NSCSI_CDROM);
|
||||
device.option_add("harddisk", NSCSI_HARDDISK);
|
||||
device.option_add_internal("ncr53c90a", NCR53C90A);
|
||||
device.set_option_machine_config("cdrom", sun4_cdrom);
|
||||
}
|
||||
|
||||
void sun4_state::ncr53c90a(device_t *device)
|
||||
|
Loading…
Reference in New Issue
Block a user