mirror of
https://github.com/holub/mame
synced 2025-04-27 18:53:05 +03:00
multibus: restore bus/slot structural flexibility
This commit is contained in:
parent
f2ba762e0a
commit
cf67936396
@ -56,6 +56,7 @@ void multibus_device::pio_map(address_map &map)
|
||||
multibus_slot_device::multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, MULTIBUS_SLOT, tag, owner, clock)
|
||||
, device_slot_interface(mconfig, *this)
|
||||
, m_bus(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
@ -72,21 +73,20 @@ device_multibus_interface::device_multibus_interface(machine_config const &mconf
|
||||
|
||||
void device_multibus_interface::interface_config_complete()
|
||||
{
|
||||
if (device().owner() && device().owner()->owner())
|
||||
if (device().owner())
|
||||
{
|
||||
multibus_device *const bus = downcast<multibus_device *>(device().owner()->owner());
|
||||
|
||||
m_bus.set_tag(*bus);
|
||||
m_bus.set_tag(downcast<multibus_slot_device &>(*device().owner()).bus());
|
||||
multibus_device &bus(*m_bus.lookup());
|
||||
|
||||
// route incoming interrupt requests to all cards
|
||||
bus->int_callback<0>().append([this](int state) { m_int[0](state); });
|
||||
bus->int_callback<1>().append([this](int state) { m_int[1](state); });
|
||||
bus->int_callback<2>().append([this](int state) { m_int[2](state); });
|
||||
bus->int_callback<3>().append([this](int state) { m_int[3](state); });
|
||||
bus->int_callback<4>().append([this](int state) { m_int[4](state); });
|
||||
bus->int_callback<5>().append([this](int state) { m_int[5](state); });
|
||||
bus->int_callback<6>().append([this](int state) { m_int[6](state); });
|
||||
bus->int_callback<7>().append([this](int state) { m_int[7](state); });
|
||||
bus.int_callback<0>().append([this](int state) { m_int[0](state); });
|
||||
bus.int_callback<1>().append([this](int state) { m_int[1](state); });
|
||||
bus.int_callback<2>().append([this](int state) { m_int[2](state); });
|
||||
bus.int_callback<3>().append([this](int state) { m_int[3](state); });
|
||||
bus.int_callback<4>().append([this](int state) { m_int[4](state); });
|
||||
bus.int_callback<5>().append([this](int state) { m_int[5](state); });
|
||||
bus.int_callback<6>().append([this](int state) { m_int[6](state); });
|
||||
bus.int_callback<7>().append([this](int state) { m_int[7](state); });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,18 +123,25 @@ class multibus_slot_device
|
||||
public:
|
||||
multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = DERIVED_CLOCK(1, 1));
|
||||
|
||||
template <typename T>
|
||||
multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&slot_options, char const *default_option, bool const fixed)
|
||||
template <typename T, typename U>
|
||||
multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bus_tag, U &&slot_options, char const *default_option, bool const fixed)
|
||||
: multibus_slot_device(mconfig, tag, owner, DERIVED_CLOCK(1,1))
|
||||
{
|
||||
m_bus.set_tag(std::forward<T>(bus_tag));
|
||||
|
||||
option_reset();
|
||||
slot_options(*this);
|
||||
set_default_option(default_option);
|
||||
set_fixed(fixed);
|
||||
}
|
||||
|
||||
auto bus() const { return m_bus; }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override ATTR_COLD;
|
||||
|
||||
private:
|
||||
required_device<multibus_device> m_bus;
|
||||
};
|
||||
|
||||
class device_multibus_interface : public device_interface
|
||||
|
@ -61,7 +61,7 @@ class labtam_state : public driver_device
|
||||
public:
|
||||
labtam_state(machine_config const &mconfig, device_type type, char const *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_bus(*this, "slot")
|
||||
, m_bus(*this, "bus")
|
||||
{
|
||||
}
|
||||
|
||||
@ -98,12 +98,12 @@ void labtam_state::labtam(machine_config &config)
|
||||
{
|
||||
MULTIBUS(config, m_bus, 10_MHz_XTAL); // FIXME: clock driven by bus master
|
||||
|
||||
MULTIBUS_SLOT(config, "slot:0", labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:1", labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:2", labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", labtam_cards, "labtam_8086cpu", false);
|
||||
MULTIBUS_SLOT(config, "slot:4", labtam_cards, "labtam_vducom", false);
|
||||
MULTIBUS_SLOT(config, "slot:5", labtam_cards, "labtam_z80sbc", false);
|
||||
MULTIBUS_SLOT(config, "slot0", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot1", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot2", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot3", m_bus, labtam_cards, "labtam_8086cpu", false);
|
||||
MULTIBUS_SLOT(config, "slot4", m_bus, labtam_cards, "labtam_vducom", false);
|
||||
MULTIBUS_SLOT(config, "slot5", m_bus, labtam_cards, "labtam_z80sbc", false);
|
||||
}
|
||||
|
||||
ROM_START(labtam)
|
||||
|
@ -188,8 +188,8 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const
|
||||
m_ipcctrl(*this, "ipcctrl"),
|
||||
m_serial(*this, "serial%u", 0U),
|
||||
m_ioc(*this, "ioc"),
|
||||
m_bus(*this, "slot"),
|
||||
m_slot(*this, "slot:1"),
|
||||
m_bus(*this, "bus"),
|
||||
m_slot(*this, "slot1"),
|
||||
m_ram(*this, "ram"),
|
||||
m_boot(*this, "boot")
|
||||
{
|
||||
@ -310,7 +310,7 @@ void imds2_state::imds2(machine_config &config)
|
||||
|
||||
MULTIBUS(config, m_bus, 9'830'400);
|
||||
m_bus->xack_cb().set(FUNC(imds2_state::xack));
|
||||
MULTIBUS_SLOT(config, m_slot, imds2_cards, nullptr, false); // FIXME: isbc202
|
||||
MULTIBUS_SLOT(config, m_slot, m_bus, imds2_cards, nullptr, false); // FIXME: isbc202
|
||||
}
|
||||
|
||||
void imds2_state::xack(int state)
|
||||
|
@ -29,7 +29,7 @@ class isbc660_state : public driver_device
|
||||
public:
|
||||
isbc660_state(machine_config const &mconfig, device_type type, char const *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_bus(*this, "slot")
|
||||
, m_bus(*this, "bus")
|
||||
{
|
||||
}
|
||||
|
||||
@ -63,14 +63,14 @@ void isbc660_state::isbc660(machine_config &config)
|
||||
{
|
||||
MULTIBUS(config, m_bus, 10_MHz_XTAL); // FIXME: clock driven by bus master
|
||||
|
||||
MULTIBUS_SLOT(config, "slot:1", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:2", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:4", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:5", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:6", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:7", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:8", isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot1", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot2", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot3", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot4", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot5", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot6", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot7", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot8", m_bus, isbc660_cards, nullptr, false);
|
||||
}
|
||||
|
||||
ROM_START(isbc660)
|
||||
|
@ -53,7 +53,7 @@ class a7150_state : public driver_device
|
||||
public:
|
||||
a7150_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_bus(*this, "slot")
|
||||
, m_bus(*this, "bus")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_uart8251(*this, "uart8251")
|
||||
, m_pit8253(*this, "pit8253")
|
||||
@ -157,7 +157,7 @@ void a7150_state::a7150(machine_config &config)
|
||||
m_bus->int_callback<1>().set(m_pic8259, FUNC(pic8259_device::ir1_w));
|
||||
m_bus->int_callback<6>().set(m_pic8259, FUNC(pic8259_device::ir6_w));
|
||||
m_bus->int_callback<7>().set(m_pic8259, FUNC(pic8259_device::ir7_w));
|
||||
MULTIBUS_SLOT(config, "slot:1", a7150_cards, "kgs", false);
|
||||
MULTIBUS_SLOT(config, "slot1", m_bus, a7150_cards, "kgs", false);
|
||||
|
||||
// ZRE board
|
||||
|
||||
|
@ -39,7 +39,7 @@ class pcmx2_state : public driver_device
|
||||
public:
|
||||
pcmx2_state(machine_config const &mconfig, device_type type, char const *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_bus(*this, "slot")
|
||||
, m_bus(*this, "bus")
|
||||
{
|
||||
}
|
||||
|
||||
@ -75,14 +75,14 @@ void pcmx2_state::pcmx2(machine_config &config)
|
||||
{
|
||||
MULTIBUS(config, m_bus, 20_MHz_XTAL / 2);
|
||||
|
||||
MULTIBUS_SLOT(config, "slot:1", pcmx2_cards, nullptr, false); // DTC 86-1 or Storager
|
||||
MULTIBUS_SLOT(config, "slot:2", pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", pcmx2_cards, "serad", false);
|
||||
MULTIBUS_SLOT(config, "slot:4", pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:5", pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:6", pcmx2_cards, "cpuap", false);
|
||||
MULTIBUS_SLOT(config, "slot:7", pcmx2_cards, nullptr, false); // MEM
|
||||
MULTIBUS_SLOT(config, "slot:8", pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot1", m_bus, pcmx2_cards, nullptr, false); // DTC 86-1 or Storager
|
||||
MULTIBUS_SLOT(config, "slot2", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot3", m_bus, pcmx2_cards, "serad", false);
|
||||
MULTIBUS_SLOT(config, "slot4", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot5", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot6", m_bus, pcmx2_cards, "cpuap", false);
|
||||
MULTIBUS_SLOT(config, "slot7", m_bus, pcmx2_cards, nullptr, false); // MEM
|
||||
MULTIBUS_SLOT(config, "slot8", m_bus, pcmx2_cards, nullptr, false);
|
||||
}
|
||||
|
||||
ROM_START(pcmx2)
|
||||
|
@ -76,7 +76,7 @@ class sun1_state : public driver_device
|
||||
public:
|
||||
sun1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_bus(*this, "slot")
|
||||
, m_bus(*this, "bus")
|
||||
{
|
||||
}
|
||||
|
||||
@ -108,13 +108,13 @@ void sun1_state::sun1(machine_config &config)
|
||||
MULTIBUS(config, m_bus, 19.6608_MHz_XTAL / 2);
|
||||
|
||||
// slot 1 is physically located at top, only slots 1-3 have P2
|
||||
MULTIBUS_SLOT(config, "slot:1", sun1_cards, nullptr, false); // memory expansion 2
|
||||
MULTIBUS_SLOT(config, "slot:2", sun1_cards, nullptr, false); // memory expansion 1
|
||||
MULTIBUS_SLOT(config, "slot:3", sun1_cards, "sun1cpu", false); // processor
|
||||
MULTIBUS_SLOT(config, "slot:4", sun1_cards, nullptr, false); // bus master 1
|
||||
MULTIBUS_SLOT(config, "slot:5", sun1_cards, nullptr, false); // bus master 2
|
||||
MULTIBUS_SLOT(config, "slot:6", sun1_cards, nullptr, false); // multibus memory, optional
|
||||
MULTIBUS_SLOT(config, "slot:7", sun1_cards, nullptr, false); // graphics
|
||||
MULTIBUS_SLOT(config, "slot1", m_bus, sun1_cards, nullptr, false); // memory expansion 2
|
||||
MULTIBUS_SLOT(config, "slot2", m_bus, sun1_cards, nullptr, false); // memory expansion 1
|
||||
MULTIBUS_SLOT(config, "slot3", m_bus, sun1_cards, "sun1cpu", false); // processor
|
||||
MULTIBUS_SLOT(config, "slot4", m_bus, sun1_cards, nullptr, false); // bus master 1
|
||||
MULTIBUS_SLOT(config, "slot5", m_bus, sun1_cards, nullptr, false); // bus master 2
|
||||
MULTIBUS_SLOT(config, "slot6", m_bus, sun1_cards, nullptr, false); // multibus memory, optional
|
||||
MULTIBUS_SLOT(config, "slot7", m_bus, sun1_cards, nullptr, false); // graphics
|
||||
}
|
||||
|
||||
ROM_START(sun1)
|
||||
|
@ -14,7 +14,6 @@ class sun1mmu_device
|
||||
{
|
||||
public:
|
||||
template <unsigned N, typename T> void set_space(T &&tag, int spacenum) { m_space[N].set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <unsigned N> void set_space(device_t &base, char const *tag, int spacenum) { m_space[N].set_tag(base, tag, spacenum); }
|
||||
|
||||
enum error_type : unsigned
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user