mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
tiki100: Added the expansion bus slots to the Z80 daisy chain. [Curt Coder]
This commit is contained in:
parent
f2d7ec807c
commit
0f07c5b65d
@ -28,7 +28,8 @@ const device_type TIKI100_BUS_SLOT = &device_creator<tiki100_bus_slot_t>;
|
|||||||
|
|
||||||
tiki100_bus_slot_t::tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
tiki100_bus_slot_t::tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, TIKI100_BUS_SLOT, "TIKI-100 expansion bus slot", tag, owner, clock, "tiki100bus_slot", __FILE__),
|
device_t(mconfig, TIKI100_BUS_SLOT, "TIKI-100 expansion bus slot", tag, owner, clock, "tiki100bus_slot", __FILE__),
|
||||||
device_slot_interface(mconfig, *this)
|
device_slot_interface(mconfig, *this),
|
||||||
|
device_z80daisy_interface(mconfig, *this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +42,11 @@ void tiki100_bus_slot_t::device_start()
|
|||||||
{
|
{
|
||||||
m_bus = machine().device<tiki100_bus_t>(TIKI100_BUS_TAG);
|
m_bus = machine().device<tiki100_bus_t>(TIKI100_BUS_TAG);
|
||||||
device_tiki100bus_card_interface *dev = dynamic_cast<device_tiki100bus_card_interface *>(get_card_device());
|
device_tiki100bus_card_interface *dev = dynamic_cast<device_tiki100bus_card_interface *>(get_card_device());
|
||||||
if (dev) m_bus->add_card(dev);
|
if (dev)
|
||||||
|
{
|
||||||
|
m_bus->add_card(dev);
|
||||||
|
m_card = dev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#define __TIKI100_BUS__
|
#define __TIKI100_BUS__
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
|
#include "cpu/z80/z80daisy.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -53,9 +54,47 @@
|
|||||||
// ======================> tiki100_bus_slot_t
|
// ======================> tiki100_bus_slot_t
|
||||||
|
|
||||||
class tiki100_bus_t;
|
class tiki100_bus_t;
|
||||||
|
class tiki100_bus_slot_t;
|
||||||
|
|
||||||
|
|
||||||
|
// ======================> device_tiki100bus_card_interface
|
||||||
|
|
||||||
|
class device_tiki100bus_card_interface : public device_slot_card_interface
|
||||||
|
{
|
||||||
|
friend class tiki100_bus_t;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device);
|
||||||
|
virtual ~device_tiki100bus_card_interface() { }
|
||||||
|
|
||||||
|
device_tiki100bus_card_interface *next() const { return m_next; }
|
||||||
|
|
||||||
|
// memory access
|
||||||
|
virtual UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) { mdis = 1; return data; };
|
||||||
|
virtual void mrq_w(address_space &space, offs_t offset, UINT8 data) { };
|
||||||
|
|
||||||
|
// I/O access
|
||||||
|
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) { };
|
||||||
|
|
||||||
|
// Z80 daisy chain
|
||||||
|
virtual int z80daisy_irq_state() { return 0; }
|
||||||
|
virtual int z80daisy_irq_ack() { return 0; }
|
||||||
|
virtual void z80daisy_irq_reti() { }
|
||||||
|
|
||||||
|
tiki100_bus_t *m_bus;
|
||||||
|
tiki100_bus_slot_t *m_slot;
|
||||||
|
|
||||||
|
device_tiki100bus_card_interface *m_next;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// ======================> tiki100_bus_slot_t
|
||||||
|
|
||||||
class tiki100_bus_slot_t : public device_t,
|
class tiki100_bus_slot_t : public device_t,
|
||||||
public device_slot_interface
|
public device_slot_interface,
|
||||||
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
@ -64,9 +103,16 @@ public:
|
|||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// device_z80daisy_interface overrides
|
||||||
|
virtual int z80daisy_irq_state() { return get_card_device() ? m_card->z80daisy_irq_state() : 0; }
|
||||||
|
virtual int z80daisy_irq_ack() { return get_card_device() ? m_card->z80daisy_irq_ack() : 0; }
|
||||||
|
virtual void z80daisy_irq_reti() { if (get_card_device()) m_card->z80daisy_irq_reti(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// configuration
|
// configuration
|
||||||
tiki100_bus_t *m_bus;
|
tiki100_bus_t *m_bus;
|
||||||
|
device_tiki100bus_card_interface *m_card;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -74,9 +120,6 @@ private:
|
|||||||
extern const device_type TIKI100_BUS_SLOT;
|
extern const device_type TIKI100_BUS_SLOT;
|
||||||
|
|
||||||
|
|
||||||
class device_tiki100bus_card_interface;
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> tiki100_bus_t
|
// ======================> tiki100_bus_t
|
||||||
|
|
||||||
class tiki100_bus_t : public device_t
|
class tiki100_bus_t : public device_t
|
||||||
@ -118,33 +161,6 @@ private:
|
|||||||
extern const device_type TIKI100_BUS;
|
extern const device_type TIKI100_BUS;
|
||||||
|
|
||||||
|
|
||||||
// ======================> device_tiki100bus_card_interface
|
|
||||||
|
|
||||||
// class representing interface-specific live tiki100bus card
|
|
||||||
class device_tiki100bus_card_interface : public device_slot_card_interface
|
|
||||||
{
|
|
||||||
friend class tiki100_bus_t;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// construction/destruction
|
|
||||||
device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device);
|
|
||||||
virtual ~device_tiki100bus_card_interface() { }
|
|
||||||
|
|
||||||
device_tiki100bus_card_interface *next() const { return m_next; }
|
|
||||||
|
|
||||||
// memory access
|
|
||||||
virtual UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) { mdis = 1; return data; };
|
|
||||||
virtual void mrq_w(address_space &space, offs_t offset, UINT8 data) { };
|
|
||||||
|
|
||||||
// I/O access
|
|
||||||
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) { };
|
|
||||||
|
|
||||||
tiki100_bus_t *m_bus;
|
|
||||||
tiki100_bus_slot_t *m_slot;
|
|
||||||
|
|
||||||
device_tiki100bus_card_interface *m_next;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
SLOT_INTERFACE_EXTERN( tiki100_cards );
|
SLOT_INTERFACE_EXTERN( tiki100_cards );
|
||||||
|
@ -651,6 +651,9 @@ static const z80_daisy_config tiki100_daisy_chain[] =
|
|||||||
{ Z80CTC_TAG },
|
{ Z80CTC_TAG },
|
||||||
{ Z80DART_TAG },
|
{ Z80DART_TAG },
|
||||||
{ Z80PIO_TAG },
|
{ Z80PIO_TAG },
|
||||||
|
{ "slot1" },
|
||||||
|
{ "slot2" },
|
||||||
|
{ "slot3" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -706,8 +709,8 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
|
|||||||
MCFG_PALETTE_ADD("palette", 16)
|
MCFG_PALETTE_ADD("palette", 16)
|
||||||
|
|
||||||
MCFG_TIKI100_BUS_ADD()
|
MCFG_TIKI100_BUS_ADD()
|
||||||
//MCFG_TIKI100_BUS_IRQ_CALLBACK()
|
MCFG_TIKI100_BUS_IRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
|
||||||
//MCFG_TIKI100_BUS_NMI_CALLBACK()
|
MCFG_TIKI100_BUS_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI))
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user