diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2019-04-29 22:00:52 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2019-04-29 22:00:52 -0400 |
commit | fa8d5aa902437562f61d2c51eaeda5afab189391 (patch) | |
tree | cb897a3309b1bf6ea904e7ca3cc2d5c984dcdf73 | |
parent | cac8808471dfecf31c15745a70218c38c1254518 (diff) |
i82586: Add line handler for reset (nw)
-rw-r--r-- | src/devices/bus/isa/3c505.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/isa/np600.cpp | 8 | ||||
-rw-r--r-- | src/devices/bus/isa/np600.h | 1 | ||||
-rw-r--r-- | src/devices/machine/i82586.cpp | 20 | ||||
-rw-r--r-- | src/devices/machine/i82586.h | 2 |
5 files changed, 24 insertions, 13 deletions
diff --git a/src/devices/bus/isa/3c505.cpp b/src/devices/bus/isa/3c505.cpp index cdf1f26e88e..aa9d0dfbb54 100644 --- a/src/devices/bus/isa/3c505.cpp +++ b/src/devices/bus/isa/3c505.cpp @@ -402,11 +402,7 @@ void isa16_3c505_device::acr_w(u8 data) if ((data ^ m_acr) & ACR_LED2) m_led[1] = !!(data & ACR_LED2); - if (!(m_acr & ACR_R586) && (data & ACR_R586)) - { - LOGMASKED(LOG_REG, "i82586 reset\n"); - m_net->reset(); - } + m_net->reset_w((data & ACR_R586) ? 1 : 0); if ((data ^ m_acr) & ACR_FLSH) { diff --git a/src/devices/bus/isa/np600.cpp b/src/devices/bus/isa/np600.cpp index b38dc008347..37e536ff51b 100644 --- a/src/devices/bus/isa/np600.cpp +++ b/src/devices/bus/isa/np600.cpp @@ -32,12 +32,6 @@ void np600a3_device::lcc_ca_w(u16 data) m_lcc->ca(1); } -WRITE_LINE_MEMBER(np600a3_device::lcc_reset_w) -{ - if (!state) - m_lcc->reset(); -} - u16 np600a3_device::status_r() { return 0; @@ -69,7 +63,7 @@ void np600a3_device::device_add_mconfig(machine_config &config) m_npcpu->set_addrmap(AS_IO, &np600a3_device::io_map); ls259_device &bitlatch(LS259(config, "bitlatch")); // U28 - bitlatch.q_out_cb<4>().set(FUNC(np600a3_device::lcc_reset_w)); + bitlatch.q_out_cb<4>().set(m_lcc, FUNC(i82586_device::reset_w)).invert(); I82586(config, m_lcc, 20_MHz_XTAL); m_lcc->set_addrmap(0, &np600a3_device::lcc_map); diff --git a/src/devices/bus/isa/np600.h b/src/devices/bus/isa/np600.h index e1068b54758..3d5563cf857 100644 --- a/src/devices/bus/isa/np600.h +++ b/src/devices/bus/isa/np600.h @@ -28,7 +28,6 @@ protected: private: void lcc_ca_w(u16 data); - DECLARE_WRITE_LINE_MEMBER(lcc_reset_w); u16 status_r(); void mem_map(address_map &map); diff --git a/src/devices/machine/i82586.cpp b/src/devices/machine/i82586.cpp index 3ecd092f0c1..6d8d3cd9bd9 100644 --- a/src/devices/machine/i82586.cpp +++ b/src/devices/machine/i82586.cpp @@ -38,6 +38,7 @@ #define LOG_FILTER (1U << 2) #define LOG_CONFIG (1U << 3) +#define VERBOSE LOG_GENERAL //#define VERBOSE (LOG_GENERAL | LOG_FRAMES | LOG_FILTER | LOG_CONFIG) #include "logmacro.h" @@ -119,6 +120,7 @@ i82586_base_device::i82586_base_device(const machine_config &mconfig, device_typ , m_cna(false) , m_rnr(false) , m_initialised(false) + , m_reset(false) , m_irq_assert(1) , m_cu_state(CU_IDLE) , m_ru_state(RU_IDLE) @@ -171,6 +173,7 @@ void i82586_base_device::device_start() save_item(NAME(m_cna)); save_item(NAME(m_rnr)); save_item(NAME(m_initialised)); + save_item(NAME(m_reset)); save_item(NAME(m_cu_state)); save_item(NAME(m_ru_state)); @@ -232,6 +235,17 @@ WRITE_LINE_MEMBER(i82586_base_device::ca) } } +WRITE_LINE_MEMBER(i82586_base_device::reset_w) +{ + LOG("reset %s (%s)\n", state ? "asserted" : "cleared", machine().describe_context()); + + // reset is active high + if (state && !m_reset) + device_reset(); + + m_reset = state; +} + int i82586_base_device::recv_start_cb(u8 *buf, int length) { // discard external packets in loopback mode @@ -776,6 +790,12 @@ void i82586_device::device_reset() void i82586_device::initialise() { + if (m_reset) + { + LOG("initialise blocked by reset\n"); + return; + } + // read iscp address from scp u32 iscp_address = m_space->read_dword(m_scp_address + 8); LOG("initialise iscp address 0x%08x\n", iscp_address); diff --git a/src/devices/machine/i82586.h b/src/devices/machine/i82586.h index fa6bec8b0d8..ad02c0bfece 100644 --- a/src/devices/machine/i82586.h +++ b/src/devices/machine/i82586.h @@ -158,6 +158,7 @@ public: auto out_irq_cb() { return m_out_irq.bind(); } DECLARE_WRITE_LINE_MEMBER(ca); + DECLARE_WRITE_LINE_MEMBER(reset_w); protected: i82586_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, endianness_t endian, u8 datawidth, u8 addrwidth); @@ -219,6 +220,7 @@ protected: bool m_cna; // command unit became inactive bool m_rnr; // receive unit became not ready bool m_initialised; + bool m_reset; int m_irq_assert; // configurable interrupt polarity // receive/command unit state |