Skip to content

Commit

Permalink
t11: reuse z80_daisy_chain for QBus vectored interrupts; forward INIT…
Browse files Browse the repository at this point in the history
… signal to all cards on QBus. (#12290)
  • Loading branch information
shattered authored May 20, 2024
1 parent 3212445 commit cc42b2b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/devices/bus/qbus/qbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/devices/bus/qbus/qbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ class device_qbus_card_interface : public device_interface
// 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() { }
Expand Down Expand Up @@ -79,6 +82,8 @@ class qbus_device : public device_t,
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); }
Expand Down Expand Up @@ -138,7 +143,6 @@ class qbus_slot_device : public device_t, public device_slot_interface
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;
Expand Down
6 changes: 5 additions & 1 deletion src/devices/cpu/t11/t11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/devices/cpu/t11/t11.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include "machine/z80daisy.h"


enum
{
Expand Down Expand Up @@ -1194,7 +1196,7 @@ class t11_device : public cpu_device
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
Expand All @@ -1212,7 +1214,7 @@ class k1801vm1_device : public t11_device
};


class k1801vm2_device : public t11_device
class k1801vm2_device : public t11_device, public z80_daisy_chain_interface
{
public:
// construction/destruction
Expand Down

0 comments on commit cc42b2b

Please sign in to comment.