mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
abc1600: Fixed hard disk formatting by introducing configurable byte transfer and command delays into the NSCSI system. [Curt Coder]
This commit is contained in:
parent
c340617fa4
commit
4df2a01734
@ -94,7 +94,7 @@ INPUT_PORTS_START( luxor_4105 )
|
||||
PORT_DIPSETTING( 0x01, "Half (Seagate/Texas)" )
|
||||
PORT_DIPSETTING( 0x02, "Half (Tandon)" )
|
||||
PORT_DIPSETTING( 0x03, "Buffered" )
|
||||
PORT_DIPNAME( 0x0c, 0x0c, "Heads" ) PORT_DIPLOCATION("1E:3,4")
|
||||
PORT_DIPNAME( 0x0c, 0x04, "Heads" ) PORT_DIPLOCATION("1E:3,4")
|
||||
PORT_DIPSETTING( 0x00, "2" )
|
||||
PORT_DIPSETTING( 0x04, "4" )
|
||||
PORT_DIPSETTING( 0x08, "6" )
|
||||
@ -106,7 +106,7 @@ INPUT_PORTS_START( luxor_4105 )
|
||||
PORT_DIPSETTING( 0x30, "Seagate ST412" )
|
||||
|
||||
PORT_START("5E")
|
||||
PORT_DIPNAME( 0x7f, 0x25, "Card Address" ) PORT_DIPLOCATION("5E:1,2,3,4,5,6,7")
|
||||
PORT_DIPNAME( 0x3f, 0x25, "Card Address" ) PORT_DIPLOCATION("5E:1,2,3,4,5,6")
|
||||
PORT_DIPSETTING( 0x25, "37" )
|
||||
PORT_DIPSETTING( 0x2d, "45" )
|
||||
|
||||
@ -309,7 +309,7 @@ WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req )
|
||||
{
|
||||
// reset REQ FF
|
||||
m_req = 0;
|
||||
}
|
||||
}
|
||||
|
||||
update_ack();
|
||||
update_dma();
|
||||
|
@ -174,3 +174,24 @@ void nscsi_s1410_device::scsi_put_data(int id, int pos, uint8_t data)
|
||||
return nscsi_harddisk_device::scsi_put_data(id, pos, data);
|
||||
}
|
||||
}
|
||||
|
||||
// Byte transfer rate (5Mb/s)
|
||||
attotime nscsi_s1410_device::scsi_data_byte_period()
|
||||
{
|
||||
return attotime::from_nsec(1600);
|
||||
}
|
||||
|
||||
// Command execution delay
|
||||
attotime nscsi_s1410_device::scsi_data_command_delay()
|
||||
{
|
||||
switch(scsi_cmdbuf[0]) {
|
||||
case SC_READ:
|
||||
case SC_WRITE:
|
||||
case SC_SEEK:
|
||||
// average seek time of NEC D5126A hard disk
|
||||
return attotime::from_msec(85);
|
||||
|
||||
default:
|
||||
return attotime::zero;
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ protected:
|
||||
virtual void scsi_command() override;
|
||||
virtual uint8_t scsi_get_data(int id, int pos) override;
|
||||
virtual void scsi_put_data(int buf, int offset, uint8_t data) override;
|
||||
virtual attotime scsi_data_byte_period() override;
|
||||
virtual attotime scsi_data_command_delay() override;
|
||||
|
||||
uint8_t params[8];
|
||||
};
|
||||
|
@ -268,7 +268,7 @@ void nscsi_full_device::device_reset()
|
||||
|
||||
TIMER_CALLBACK_MEMBER(nscsi_full_device::update_tick)
|
||||
{
|
||||
step(true);
|
||||
step(param);
|
||||
}
|
||||
|
||||
void nscsi_full_device::scsi_ctrl_changed()
|
||||
@ -304,7 +304,7 @@ void nscsi_full_device::step(bool timeout)
|
||||
if(scsi_initiator_id == 16)
|
||||
scsi_initiator_id = -1;
|
||||
scsi_state = TARGET_SELECT_WAIT_BUS_SETTLE;
|
||||
scsi_timer->adjust(scsi_bus_settle_delay());
|
||||
scsi_timer->adjust(scsi_bus_settle_delay(), true);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -336,7 +336,7 @@ void nscsi_full_device::step(bool timeout)
|
||||
if(!(ctrl & S_ACK)) {
|
||||
scsi_state &= STATE_MASK;
|
||||
scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK);
|
||||
step(false);
|
||||
scsi_timer->adjust(scsi_data_byte_period(), false);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -352,7 +352,7 @@ void nscsi_full_device::step(bool timeout)
|
||||
if(!(ctrl & S_ACK)) {
|
||||
scsi_state &= STATE_MASK;
|
||||
scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK);
|
||||
step(false);
|
||||
scsi_timer->adjust(scsi_data_byte_period(), false);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -460,7 +460,7 @@ void nscsi_full_device::step(bool timeout)
|
||||
scsi_bus->ctrl_wait(scsi_refid, 0, S_ACK);
|
||||
scsi_command();
|
||||
scsi_state = TARGET_NEXT_CONTROL;
|
||||
step(false);
|
||||
scsi_timer->adjust(scsi_data_command_delay(), false);
|
||||
} else
|
||||
target_recv_byte();
|
||||
break;
|
||||
@ -788,3 +788,15 @@ attotime nscsi_full_device::scsi_fast_negation_period()
|
||||
{
|
||||
return attotime::from_nsec(30);
|
||||
}
|
||||
|
||||
// Byte transfer rate (immediate)
|
||||
attotime nscsi_full_device::scsi_data_byte_period()
|
||||
{
|
||||
return attotime::zero;
|
||||
}
|
||||
|
||||
// Command execution delay (immediate)
|
||||
attotime nscsi_full_device::scsi_data_command_delay()
|
||||
{
|
||||
return attotime::zero;
|
||||
}
|
||||
|
@ -396,6 +396,12 @@ protected:
|
||||
// Fast negation period (30ns)
|
||||
virtual attotime scsi_fast_negation_period();
|
||||
|
||||
// Byte transfer rate (immediate)
|
||||
virtual attotime scsi_data_byte_period();
|
||||
|
||||
// Command delay (immediate)
|
||||
virtual attotime scsi_data_command_delay();
|
||||
|
||||
uint8_t scsi_cmdbuf[4096], scsi_sense_buffer[18];
|
||||
int scsi_cmdsize;
|
||||
uint8_t scsi_identify;
|
||||
|
Loading…
Reference in New Issue
Block a user