mirror of
https://github.com/holub/mame
synced 2025-04-25 01:40:16 +03:00
ncr5390: various fixes (nw)
Several important fixes that help Sun4 (can now boot Solaris 2.3 from CD-ROM) and Jazz work better. * Fix stupid virtual/override errors preventing ncr53c90a+ from working properly. * Start DMA after arbitration/selection is completed for "select with..." commands. * Trigger an interrupt on SCSI bus reset (if enabled).
This commit is contained in:
parent
dacf82932a
commit
a1a23add71
@ -407,10 +407,15 @@ void ncr5390_device::step(bool timeout)
|
||||
|
||||
case DISC_SEL_ARBITRATION_INIT:
|
||||
// wait until a command is in the fifo
|
||||
if (!fifo_pos && dma_command && !(status & S_TC0))
|
||||
if (!fifo_pos && dma_command && !(status & S_TC0)) {
|
||||
// dma starts after bus arbitration/selection is complete
|
||||
dma_set(DMA_OUT);
|
||||
step(false);
|
||||
break;
|
||||
}
|
||||
|
||||
command_length = derive_msg_size(fifo[0]);
|
||||
// "with atn" variants have a message byte before the command descriptor
|
||||
command_length = (c == CD_SELECT) ? derive_msg_size(fifo[0]) : 1;
|
||||
state = DISC_SEL_ARBITRATION;
|
||||
step(false);
|
||||
break;
|
||||
@ -850,6 +855,12 @@ 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();
|
||||
}
|
||||
break;
|
||||
|
||||
case CD_RESELECT:
|
||||
@ -867,7 +878,6 @@ void ncr5390_device::start_command()
|
||||
"Select with ATN and stop sequence\n");
|
||||
seq = 0;
|
||||
state = DISC_SEL_ARBITRATION_INIT;
|
||||
dma_set(dma_command ? DMA_OUT : DMA_NONE);
|
||||
arbitrate();
|
||||
break;
|
||||
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(fifo_w);
|
||||
DECLARE_READ8_MEMBER(command_r);
|
||||
DECLARE_WRITE8_MEMBER(command_w);
|
||||
DECLARE_READ8_MEMBER(status_r);
|
||||
virtual DECLARE_READ8_MEMBER(status_r);
|
||||
DECLARE_WRITE8_MEMBER(bus_id_w);
|
||||
DECLARE_READ8_MEMBER(istatus_r);
|
||||
DECLARE_WRITE8_MEMBER(timeout_w);
|
||||
@ -236,7 +236,7 @@ protected:
|
||||
void check_irq();
|
||||
|
||||
protected:
|
||||
void reset_soft();
|
||||
virtual void reset_soft();
|
||||
|
||||
private:
|
||||
void reset_disconnect();
|
||||
@ -262,19 +262,19 @@ public:
|
||||
|
||||
virtual void map(address_map &map) override;
|
||||
|
||||
DECLARE_READ8_MEMBER(status_r);
|
||||
virtual DECLARE_READ8_MEMBER(status_r) override;
|
||||
|
||||
DECLARE_READ8_MEMBER(conf2_r) { return config2; };
|
||||
DECLARE_WRITE8_MEMBER(conf2_w) { config2 = data; };
|
||||
|
||||
DECLARE_READ8_MEMBER(read) override;
|
||||
DECLARE_WRITE8_MEMBER(write) override;
|
||||
virtual DECLARE_READ8_MEMBER(read) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write) override;
|
||||
|
||||
protected:
|
||||
ncr53c90a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_start() override;
|
||||
void reset_soft();
|
||||
virtual void reset_soft() override;
|
||||
|
||||
virtual bool check_valid_command(uint8_t cmd) override;
|
||||
|
||||
@ -298,12 +298,12 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(conf3_w) { config3 = data; };
|
||||
DECLARE_WRITE8_MEMBER(fifo_align_w) { fifo_align = data; };
|
||||
|
||||
DECLARE_READ8_MEMBER(read) override;
|
||||
DECLARE_WRITE8_MEMBER(write) override;
|
||||
virtual DECLARE_READ8_MEMBER(read) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
void reset_soft();
|
||||
virtual void reset_soft() override;
|
||||
|
||||
private:
|
||||
u8 config3;
|
||||
|
Loading…
Reference in New Issue
Block a user