diff options
Diffstat (limited to 'src/devices/machine/ncr5390.cpp')
-rw-r--r-- | src/devices/machine/ncr5390.cpp | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/src/devices/machine/ncr5390.cpp b/src/devices/machine/ncr5390.cpp index 616fec28a27..d3918df1e30 100644 --- a/src/devices/machine/ncr5390.cpp +++ b/src/devices/machine/ncr5390.cpp @@ -52,7 +52,7 @@ READ8_MEMBER(ncr5390_device::read) case 6: return seq_step_r(space, 0); case 7: return fifo_flags_r(space, 0); case 8: return conf_r(space, 0); - default: return 0; + default: return 0xff; } } @@ -184,10 +184,7 @@ void ncr5390_device::device_start() m_irq_handler.resolve_safe(); m_drq_handler.resolve_safe(); - tcount = 0; - tcounter = 0; config = 0; - status = 0; bus_id = 0; select_timeout = 0; tm = timer_alloc(0); @@ -203,26 +200,28 @@ void ncr5390_device::device_reset() sync_offset = 0; seq = 0; config &= 7; - status &= 0x90; + status = 0; istatus = 0; irq = false; m_irq_handler(irq); - reset_soft(); -} -void ncr5390_device::reset_soft() -{ state = IDLE; scsi_bus->ctrl_wait(scsi_refid, S_SEL|S_BSY|S_RST, S_ALL); - status &= 0xef; drq = false; test_mode = false; m_drq_handler(drq); + + scsi_bus->ctrl_w(scsi_refid, 0, S_RST); + tcount = 0; + tcounter = 0; + reset_disconnect(); } void ncr5390_device::reset_disconnect() { + scsi_bus->ctrl_w(scsi_refid, 0, ~S_RST); + command_pos = 0; command_length = 0; memset(command, 0, sizeof(command)); @@ -265,6 +264,17 @@ void ncr5390_device::step(bool timeout) case IDLE: break; + case BUSRESET_WAIT_INT: + state = IDLE; + scsi_bus->ctrl_w(scsi_refid, 0, S_RST); + reset_disconnect(); + + if (!(config & 0x40)) { + istatus |= I_SCSI_RESET; + check_irq(); + } + break; + case ARB_COMPLETE << SUB_SHIFT: { if(!timeout) break; @@ -466,6 +476,8 @@ void ncr5390_device::step(bool timeout) if((ctrl & S_PHASE_MASK) != S_PHASE_COMMAND) { if(!command_length) seq = 4; + else + seq = 2; scsi_bus->ctrl_wait(scsi_refid, 0, S_REQ); function_bus_complete(); break; @@ -858,13 +870,9 @@ void ncr5390_device::start_command() case CM_RESET_BUS: LOGMASKED(LOG_COMMAND, "Reset SCSI bus\n"); - reset_soft(); - // FIXME: this interrupt should be generated when the reset is reflected - // back into the device, and not when the device starts the scsi reset - if (!(config & 0x40)) { - istatus = I_SCSI_RESET; - check_irq(); - } + state = BUSRESET_WAIT_INT; + scsi_bus->ctrl_w(scsi_refid, S_RST, S_RST); + delay(130); break; case CD_RESELECT: @@ -1162,11 +1170,11 @@ void ncr53c90a_device::device_start() ncr5390_device::device_start(); } -void ncr53c90a_device::reset_soft() +void ncr53c90a_device::device_reset() { config2 = 0; - ncr5390_device::reset_soft(); + ncr5390_device::device_reset(); } READ8_MEMBER(ncr53c90a_device::status_r) @@ -1200,11 +1208,11 @@ void ncr53c94_device::device_start() ncr53c90a_device::device_start(); } -void ncr53c94_device::reset_soft() +void ncr53c94_device::device_reset() { config3 = 0; - ncr53c90a_device::reset_soft(); + ncr53c90a_device::device_reset(); } u16 ncr53c94_device::dma16_r() |