summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/scsi/omti5100.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/scsi/omti5100.cpp')
-rw-r--r--src/devices/bus/scsi/omti5100.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/devices/bus/scsi/omti5100.cpp b/src/devices/bus/scsi/omti5100.cpp
index f095dd2b191..b4c46de8553 100644
--- a/src/devices/bus/scsi/omti5100.cpp
+++ b/src/devices/bus/scsi/omti5100.cpp
@@ -33,7 +33,7 @@ omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag,
void omti5100_device::device_start()
{
- if(!m_image0->get_hard_disk_file())
+ if(!m_image0->exists())
m_image = m_image1;
m_image = m_image0;
scsihle_device::device_start();
@@ -42,8 +42,8 @@ void omti5100_device::device_start()
void omti5100_device::ExecCommand()
{
int drive = (command[1] >> 5) & 1;
- hard_disk_file *image = (drive ? m_image1 : m_image0)->get_hard_disk_file();
- if(!image)
+ harddisk_image_device *image = drive ? m_image1 : m_image0;
+ if(!image->exists())
{
if(command[0] == T10SPC_CMD_REQUEST_SENSE)
return scsihd_device::ExecCommand();
@@ -54,7 +54,7 @@ void omti5100_device::ExecCommand()
m_transfer_length = 0;
return;
}
- hard_disk_info *info = hard_disk_get_info(image);
+ const auto &info = image->get_info();
switch(command[0])
{
case OMTI_READ_DATA_BUFFER:
@@ -77,7 +77,7 @@ void omti5100_device::ExecCommand()
{
int track = ((command[1]&0x1f)<<16 | command[2]<<8 | command[3]) / (m_param[drive].sectors ? m_param[drive].sectors : 1);
int heads = m_param[drive].heads ? m_param[drive].heads : 1;
- if(((track % heads) > info->heads) || (track >= (info->cylinders * heads)))
+ if(((track % heads) > info.heads) || (track >= (info.cylinders * heads)))
{
m_phase = SCSI_PHASE_STATUS;
m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION;
@@ -86,7 +86,6 @@ void omti5100_device::ExecCommand()
}
else
{
- SetDevice(image);
scsihd_device::ExecCommand();
}
break;
@@ -94,15 +93,15 @@ void omti5100_device::ExecCommand()
case OMTI_FORMAT_TRACK:
{
int track = ((command[1]&0x1f)<<16 | command[2]<<8 | command[3]) / m_param[drive].sectors;
- if(((track % m_param[drive].heads) <= info->heads) && (track < (info->cylinders * m_param[drive].heads)))
+ if(((track % m_param[drive].heads) <= info.heads) && (track < (info.cylinders * m_param[drive].heads)))
{
- std::vector<uint8_t> sector(info->sectorbytes);
- memset(&sector[0], 0xe5, info->sectorbytes);
+ std::vector<uint8_t> sector(info.sectorbytes);
+ memset(&sector[0], 0xe5, info.sectorbytes);
m_phase = SCSI_PHASE_STATUS;
m_status_code = SCSI_STATUS_CODE_GOOD;
m_transfer_length = 0;
- for(int i = 0; i < info->sectors; i++)
- hard_disk_write(image, track * info->sectors + i, &sector[0]);
+ for(int i = 0; i < info.sectors; i++)
+ image->write(track * info.sectors + i, &sector[0]);
}
else
{
@@ -114,7 +113,6 @@ void omti5100_device::ExecCommand()
break;
}
default:
- SetDevice(image);
scsihd_device::ExecCommand();
break;
}
@@ -144,12 +142,12 @@ void omti5100_device::WriteData( uint8_t *data, int dataLength )
case OMTI_ASSIGN_DISK_PARAM:
{
int drive = ((command[1] >> 5) & 1);
- hard_disk_file *image = (drive ? m_image1 : m_image0)->get_hard_disk_file();
+ harddisk_image_device *image = drive ? m_image1 : m_image0;
m_param[drive].heads = data[3] + 1;
m_param[drive].cylinders = ((data[4] << 8) | data[5]) + 1;
- if(!data[8] && image)
+ if(!data[8] && image->exists())
{
- switch(hard_disk_get_info(image)->sectorbytes)
+ switch(image->get_info().sectorbytes)
{
case 128:
m_param[drive].sectors = 53;