tiki100: Added BUSRQ, BUSAK, and EXIN to the expansion bus. [Curt Coder]
This commit is contained in:
parent
8273b50e5a
commit
9f91d26cec
@ -49,6 +49,8 @@ const rom_entry *tiki100_8088_t::device_rom_region() const
|
|||||||
|
|
||||||
|
|
||||||
static ADDRESS_MAP_START( i8088_mem, AS_PROGRAM, 8, tiki100_8088_t )
|
static ADDRESS_MAP_START( i8088_mem, AS_PROGRAM, 8, tiki100_8088_t )
|
||||||
|
AM_RANGE(0x00000, 0xbffff) AM_RAM
|
||||||
|
AM_RANGE(0xc0000, 0xcffff) AM_DEVREADWRITE(":" TIKI100_BUS_TAG, tiki100_bus_t, exin_mrq_r, exin_mrq_w)
|
||||||
AM_RANGE(0xff000, 0xfffff) AM_ROM AM_REGION(I8088_TAG, 0)
|
AM_RANGE(0xff000, 0xfffff) AM_ROM AM_REGION(I8088_TAG, 0)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
@ -158,7 +160,7 @@ void tiki100_8088_t::iorq_w(address_space &space, offs_t offset, UINT8 data)
|
|||||||
|
|
||||||
READ8_MEMBER( tiki100_8088_t::read )
|
READ8_MEMBER( tiki100_8088_t::read )
|
||||||
{
|
{
|
||||||
return m_data;
|
return m_busak << 4 | m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -169,4 +171,6 @@ READ8_MEMBER( tiki100_8088_t::read )
|
|||||||
WRITE8_MEMBER( tiki100_8088_t::write )
|
WRITE8_MEMBER( tiki100_8088_t::write )
|
||||||
{
|
{
|
||||||
m_data = data & 0x0f;
|
m_data = data & 0x0f;
|
||||||
|
|
||||||
|
m_bus->busrq_w(BIT(data, 4));
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,10 @@ void tiki100_bus_slot_t::device_start()
|
|||||||
tiki100_bus_t::tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
tiki100_bus_t::tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, TIKI100_BUS, "TIKI-100 expansion bus", tag, owner, clock, "tiki100bus", __FILE__),
|
device_t(mconfig, TIKI100_BUS, "TIKI-100 expansion bus", tag, owner, clock, "tiki100bus", __FILE__),
|
||||||
m_irq_cb(*this),
|
m_irq_cb(*this),
|
||||||
m_nmi_cb(*this)
|
m_nmi_cb(*this),
|
||||||
|
m_busrq_cb(*this),
|
||||||
|
m_in_mrq_cb(*this),
|
||||||
|
m_out_mrq_cb(*this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +74,9 @@ void tiki100_bus_t::device_start()
|
|||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
m_irq_cb.resolve_safe();
|
m_irq_cb.resolve_safe();
|
||||||
m_nmi_cb.resolve_safe();
|
m_nmi_cb.resolve_safe();
|
||||||
|
m_busrq_cb.resolve_safe();
|
||||||
|
m_in_mrq_cb.resolve();
|
||||||
|
m_out_mrq_cb.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -154,6 +160,22 @@ WRITE8_MEMBER( tiki100_bus_t::iorq_w )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// busak_w - bus acknowledge write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER( tiki100_bus_t::busak_w )
|
||||||
|
{
|
||||||
|
device_tiki100bus_card_interface *entry = m_device_list.first();
|
||||||
|
|
||||||
|
while (entry)
|
||||||
|
{
|
||||||
|
entry->busak_w(state);
|
||||||
|
entry = entry->next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// DEVICE TIKI-100 BUS CARD INTERFACE
|
// DEVICE TIKI-100 BUS CARD INTERFACE
|
||||||
@ -164,7 +186,8 @@ WRITE8_MEMBER( tiki100_bus_t::iorq_w )
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
device_tiki100bus_card_interface::device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device) :
|
device_tiki100bus_card_interface::device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device) :
|
||||||
device_slot_card_interface(mconfig, device)
|
device_slot_card_interface(mconfig, device),
|
||||||
|
m_busak(CLEAR_LINE)
|
||||||
{
|
{
|
||||||
m_slot = dynamic_cast<tiki100_bus_slot_t *>(device.owner());
|
m_slot = dynamic_cast<tiki100_bus_slot_t *>(device.owner());
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,15 @@
|
|||||||
#define MCFG_TIKI100_BUS_NMI_CALLBACK(_write) \
|
#define MCFG_TIKI100_BUS_NMI_CALLBACK(_write) \
|
||||||
devcb = &tiki100_bus_t::set_nmi_wr_callback(*device, DEVCB_##_write);
|
devcb = &tiki100_bus_t::set_nmi_wr_callback(*device, DEVCB_##_write);
|
||||||
|
|
||||||
|
#define MCFG_TIKI100_BUS_BUSRQ_CALLBACK(_write) \
|
||||||
|
devcb = &tiki100_bus_t::set_busrq_wr_callback(*device, DEVCB_##_write);
|
||||||
|
|
||||||
|
#define MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(_read) \
|
||||||
|
devcb = &tiki100_bus_t::set_mrq_rd_callback(*device, DEVCB_##_read);
|
||||||
|
|
||||||
|
#define MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(_write) \
|
||||||
|
devcb = &tiki100_bus_t::set_mrq_wr_callback(*device, DEVCB_##_write);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -78,6 +87,8 @@ public:
|
|||||||
virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; };
|
virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; };
|
||||||
virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) { };
|
virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) { };
|
||||||
|
|
||||||
|
virtual void busak_w(int state) { m_busak = state; };
|
||||||
|
|
||||||
// Z80 daisy chain
|
// Z80 daisy chain
|
||||||
virtual int z80daisy_irq_state() { return 0; }
|
virtual int z80daisy_irq_state() { return 0; }
|
||||||
virtual int z80daisy_irq_ack() { return 0; }
|
virtual int z80daisy_irq_ack() { return 0; }
|
||||||
@ -85,6 +96,7 @@ public:
|
|||||||
|
|
||||||
tiki100_bus_t *m_bus;
|
tiki100_bus_t *m_bus;
|
||||||
tiki100_bus_slot_t *m_slot;
|
tiki100_bus_slot_t *m_slot;
|
||||||
|
int m_busak;
|
||||||
|
|
||||||
device_tiki100bus_card_interface *m_next;
|
device_tiki100bus_card_interface *m_next;
|
||||||
};
|
};
|
||||||
@ -131,6 +143,9 @@ public:
|
|||||||
|
|
||||||
template<class _Object> static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_irq_cb.set_callback(object); }
|
template<class _Object> static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_irq_cb.set_callback(object); }
|
||||||
template<class _Object> static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_nmi_cb.set_callback(object); }
|
template<class _Object> static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_nmi_cb.set_callback(object); }
|
||||||
|
template<class _Object> static devcb_base &set_busrq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_busrq_cb.set_callback(object); }
|
||||||
|
template<class _Object> static devcb_base &set_mrq_rd_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_in_mrq_cb.set_callback(object); }
|
||||||
|
template<class _Object> static devcb_base &set_mrq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_out_mrq_cb.set_callback(object); }
|
||||||
|
|
||||||
void add_card(device_tiki100bus_card_interface *card);
|
void add_card(device_tiki100bus_card_interface *card);
|
||||||
|
|
||||||
@ -141,9 +156,14 @@ public:
|
|||||||
UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data);
|
UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data);
|
||||||
DECLARE_WRITE8_MEMBER( iorq_w );
|
DECLARE_WRITE8_MEMBER( iorq_w );
|
||||||
|
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( busak_w );
|
||||||
|
|
||||||
// peripheral interface
|
// peripheral interface
|
||||||
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_cb(state); }
|
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_cb(state); }
|
||||||
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_cb(state); }
|
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_cb(state); }
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( busrq_w ) { m_busrq_cb(state); }
|
||||||
|
DECLARE_READ8_MEMBER( exin_mrq_r ) { return m_in_mrq_cb(offset); }
|
||||||
|
DECLARE_WRITE8_MEMBER( exin_mrq_w ) { m_out_mrq_cb(offset, data); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
@ -152,6 +172,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
devcb_write_line m_irq_cb;
|
devcb_write_line m_irq_cb;
|
||||||
devcb_write_line m_nmi_cb;
|
devcb_write_line m_nmi_cb;
|
||||||
|
devcb_write_line m_busrq_cb;
|
||||||
|
devcb_read8 m_in_mrq_cb;
|
||||||
|
devcb_write8 m_out_mrq_cb;
|
||||||
|
|
||||||
simple_list<device_tiki100bus_card_interface> m_device_list;
|
simple_list<device_tiki100bus_card_interface> m_device_list;
|
||||||
};
|
};
|
||||||
|
@ -657,13 +657,18 @@ static const z80_daisy_config tiki100_daisy_chain[] =
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TIMER_DEVICE_CALLBACK_MEMBER( tiki100_state::tape_tick )
|
TIMER_DEVICE_CALLBACK_MEMBER( tiki100_state::tape_tick )
|
||||||
{
|
{
|
||||||
m_pio->port_b_write((m_cassette->input() > 0.0) << 7);
|
m_pio->port_b_write((m_cassette->input() > 0.0) << 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER( tiki100_state::busrq_w )
|
||||||
|
{
|
||||||
|
// since our Z80 has no support for BUSACK, we assume it is granted immediately
|
||||||
|
m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, state);
|
||||||
|
m_exp->busak_w(state);
|
||||||
|
}
|
||||||
|
|
||||||
/* Machine Start */
|
/* Machine Start */
|
||||||
|
|
||||||
void tiki100_state::machine_start()
|
void tiki100_state::machine_start()
|
||||||
@ -711,6 +716,9 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
|
|||||||
MCFG_TIKI100_BUS_ADD()
|
MCFG_TIKI100_BUS_ADD()
|
||||||
MCFG_TIKI100_BUS_IRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
|
MCFG_TIKI100_BUS_IRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
|
||||||
MCFG_TIKI100_BUS_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI))
|
MCFG_TIKI100_BUS_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI))
|
||||||
|
MCFG_TIKI100_BUS_BUSRQ_CALLBACK(WRITELINE(tiki100_state, busrq_w))
|
||||||
|
MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(READ8(tiki100_state, mrq_r))
|
||||||
|
MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(WRITE8(tiki100_state, mrq_w))
|
||||||
MCFG_TIKI100_BUS_SLOT_ADD("slot1", "8088")
|
MCFG_TIKI100_BUS_SLOT_ADD("slot1", "8088")
|
||||||
MCFG_TIKI100_BUS_SLOT_ADD("slot2", "hdc")
|
MCFG_TIKI100_BUS_SLOT_ADD("slot2", "hdc")
|
||||||
MCFG_TIKI100_BUS_SLOT_ADD("slot3", NULL)
|
MCFG_TIKI100_BUS_SLOT_ADD("slot3", NULL)
|
||||||
|
@ -138,6 +138,8 @@ public:
|
|||||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
|
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
|
||||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
|
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
|
||||||
|
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( busrq_w );
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ROM0 = 0x01,
|
ROM0 = 0x01,
|
||||||
|
Loading…
Reference in New Issue
Block a user