t11: reuse z80_daisy_chain for QBus vectored interrupts; forward INIT signal to all cards on QBus. (#12290)

This commit is contained in:
shattered 2024-05-20 20:34:58 +03:00 committed by GitHub
parent 321244520c
commit cc42b2bf56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 4 deletions

View File

@ -131,6 +131,14 @@ void qbus_device::device_reset()
{
}
void qbus_device::init_w()
{
for (device_qbus_card_interface &entry : m_device_list)
{
entry.init_w();
}
}
//-------------------------------------------------
// add_card - add card

View File

@ -33,11 +33,14 @@ public:
// Q-Bus interface
virtual void biaki_w(int state) { }
virtual void bdmgi_w(int state) { }
virtual void init_w() { device_reset(); }
protected:
// construction/destruction
device_qbus_card_interface(const machine_config &mconfig, device_t &device);
virtual void device_reset() { }
virtual int z80daisy_irq_state() { return 0; }
virtual int z80daisy_irq_ack() { return -1; }
virtual void z80daisy_irq_reti() { }
@ -79,6 +82,8 @@ public:
void add_card(device_qbus_card_interface &card);
void install_device(offs_t start, offs_t end, read16sm_delegate rhandler, write16sm_delegate whandler, uint32_t mask=0xffffffff);
void init_w();
void birq4_w(int state) { m_out_birq4_cb(state); }
void birq5_w(int state) { m_out_birq5_cb(state); }
void birq6_w(int state) { m_out_birq6_cb(state); }
@ -138,7 +143,6 @@ public:
protected:
// device_t implementation
virtual void device_start() override;
virtual void device_reset() override { if (m_card) get_card_device()->reset(); }
devcb_write_line m_write_birq4;
devcb_write_line m_write_birq5;

View File

@ -42,12 +42,14 @@ DEFINE_DEVICE_TYPE(K1801VM2, k1801vm2_device, "k1801vm2", "K1801VM2")
k1801vm1_device::k1801vm1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: t11_device(mconfig, K1801VM1, tag, owner, clock)
, z80_daisy_chain_interface(mconfig, *this)
{
c_insn_set = IS_LEIS | IS_MXPS | IS_VM1;
}
k1801vm2_device::k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: t11_device(mconfig, K1801VM2, tag, owner, clock)
, z80_daisy_chain_interface(mconfig, *this)
{
c_insn_set = IS_LEIS | IS_EIS | IS_MXPS | IS_VM2;
}
@ -258,6 +260,7 @@ void k1801vm1_device::t11_check_irqs()
// 8. external HALT (nIRQ1 pin); PSW11, PSW10
else if (m_hlt_active)
{
m_hlt_active = 0;
m_mcir = MCIR_HALT;
m_vsel = VM1_HALT;
}
@ -277,7 +280,8 @@ void k1801vm1_device::t11_check_irqs()
// 12. nVIRQ pin; PSW7, PSW10
else if (m_vec_active && !GET_I)
{
int vec = m_in_iack_func(0);
device_z80daisy_interface *intf = daisy_get_irq_device();
int vec = (intf != nullptr) ? intf->z80daisy_irq_ack() : m_in_iack_func(0);
if (vec == -1 || vec == 0)
{
m_vec_active = 0;

View File

@ -7,6 +7,8 @@
#pragma once
#include "machine/z80daisy.h"
enum
{
@ -1194,7 +1196,7 @@ protected:
void sub_ixd_ixd(uint16_t op);
};
class k1801vm1_device : public t11_device
class k1801vm1_device : public t11_device, public z80_daisy_chain_interface
{
public:
// construction/destruction
@ -1212,7 +1214,7 @@ protected:
};
class k1801vm2_device : public t11_device
class k1801vm2_device : public t11_device, public z80_daisy_chain_interface
{
public:
// construction/destruction