mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
multibus: report unmapped addresses
* make bus device available during card configuration * improve interrupt routing
This commit is contained in:
parent
02d5a6aad8
commit
e90146d367
@ -39,7 +39,6 @@ cpuap_device::cpuap_device(machine_config const &mconfig, char const *tag, devic
|
||||
, m_s7(*this, "S7")
|
||||
, m_s8(*this, "S8")
|
||||
, m_boot(*this, "boot")
|
||||
, m_installed(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -139,22 +138,6 @@ void cpuap_device::device_start()
|
||||
|
||||
void cpuap_device::device_reset()
|
||||
{
|
||||
if (!m_installed)
|
||||
{
|
||||
// TODO: what's exposed to the Multibus?
|
||||
|
||||
m_bus->int_callback<0>().set(m_icu, FUNC(ns32202_device::ir_w<0>));
|
||||
m_bus->int_callback<1>().set(m_icu, FUNC(ns32202_device::ir_w<1>));
|
||||
m_bus->int_callback<2>().set(m_icu, FUNC(ns32202_device::ir_w<3>));
|
||||
m_bus->int_callback<3>().set(m_icu, FUNC(ns32202_device::ir_w<4>));
|
||||
m_bus->int_callback<4>().set(m_icu, FUNC(ns32202_device::ir_w<6>));
|
||||
m_bus->int_callback<5>().set(m_icu, FUNC(ns32202_device::ir_w<7>));
|
||||
m_bus->int_callback<6>().set(m_icu, FUNC(ns32202_device::ir_w<8>));
|
||||
m_bus->int_callback<7>().set([this](int state) { m_s8->read() ? m_cpu->set_input_line(INPUT_LINE_NMI, !state) : m_icu->ir_w<11>(state); });
|
||||
|
||||
m_installed = true;
|
||||
}
|
||||
|
||||
m_boot.select(0);
|
||||
m_nmi = 0xff;
|
||||
}
|
||||
@ -182,6 +165,15 @@ void cpuap_device::device_add_mconfig(machine_config &config)
|
||||
NS32202(config, m_icu, 20_MHz_XTAL / 2);
|
||||
m_icu->out_int().set_inputline(m_cpu, INPUT_LINE_IRQ0).invert();
|
||||
|
||||
int_callback<0>().set(m_icu, FUNC(ns32202_device::ir_w<0>));
|
||||
int_callback<1>().set(m_icu, FUNC(ns32202_device::ir_w<1>));
|
||||
int_callback<2>().set(m_icu, FUNC(ns32202_device::ir_w<3>));
|
||||
int_callback<3>().set(m_icu, FUNC(ns32202_device::ir_w<4>));
|
||||
int_callback<4>().set(m_icu, FUNC(ns32202_device::ir_w<6>));
|
||||
int_callback<5>().set(m_icu, FUNC(ns32202_device::ir_w<7>));
|
||||
int_callback<6>().set(m_icu, FUNC(ns32202_device::ir_w<8>));
|
||||
int_callback<7>().set([this](int state) { m_s8->read() ? m_cpu->set_input_line(INPUT_LINE_NMI, !state) : m_icu->ir_w<11>(state); });
|
||||
|
||||
MC146818(config, m_rtc, 32.768_kHz_XTAL);
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,6 @@ private:
|
||||
u8 m_prdia;
|
||||
u8 m_poff;
|
||||
u8 m_nmi;
|
||||
|
||||
bool m_installed;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(CPUAP, cpuap_device)
|
||||
|
@ -87,7 +87,6 @@ void isbc8024_device::device_reset()
|
||||
}
|
||||
|
||||
// TODO: what's exposed to the Multibus?
|
||||
m_bus->int_callback<2>().set(m_pic, FUNC(pic8259_device::ir1_w));
|
||||
|
||||
m_installed = true;
|
||||
}
|
||||
@ -115,6 +114,7 @@ void isbc8024_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
PIC8259(config, m_pic);
|
||||
m_pic->out_int_callback().set_inputline(m_cpu, I8085_INTR_LINE);
|
||||
int_callback<2>().set(m_pic, FUNC(pic8259_device::ir1_w));
|
||||
|
||||
RS232_PORT(config, m_j3, default_rs232_devices, nullptr);
|
||||
|
||||
|
@ -177,11 +177,6 @@ ioport_constructor labtam_8086cpu_device::device_input_ports() const
|
||||
return INPUT_PORTS_NAME(labtam_8086cpu);
|
||||
}
|
||||
|
||||
void labtam_vducom_device_base::device_resolve_objects()
|
||||
{
|
||||
m_bus->int_callback<3>().set(m_pic, FUNC(pic8259_device::ir6_w));
|
||||
}
|
||||
|
||||
void labtam_vducom_device_base::device_start()
|
||||
{
|
||||
save_item(NAME(m_start));
|
||||
@ -251,6 +246,7 @@ void labtam_vducom_device_base::device_add_mconfig(machine_config &config)
|
||||
* 7 not connected
|
||||
*/
|
||||
m_pic->out_int_callback().set_inputline(m_cpu, INPUT_LINE_INT0);
|
||||
int_callback<3>().set(m_pic, FUNC(pic8259_device::ir6_w));
|
||||
|
||||
UPD7201(config, m_com[0], 16_MHz_XTAL / 4);
|
||||
m_com[0]->out_int_callback().set(m_pic, FUNC(pic8259_device::ir3_w));
|
||||
|
@ -29,7 +29,6 @@ protected:
|
||||
labtam_vducom_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
|
||||
virtual void device_resolve_objects() override ATTR_COLD;
|
||||
virtual void device_start() override ATTR_COLD;
|
||||
virtual void device_reset() override ATTR_COLD;
|
||||
|
||||
|
@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(MULTIBUS_SLOT, multibus_slot_device, "multibus_slot", "Intel
|
||||
multibus_device::multibus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, MULTIBUS, tag, owner, clock)
|
||||
, device_memory_interface(mconfig, *this)
|
||||
, m_mem_config("mem", ENDIANNESS_LITTLE, 16, 24)
|
||||
, m_pio_config("pio", ENDIANNESS_LITTLE, 16, 16)
|
||||
, m_mem_config("mem", ENDIANNESS_LITTLE, 16, 24, 0, address_map_constructor(FUNC(multibus_device::mem_map), this))
|
||||
, m_pio_config("pio", ENDIANNESS_LITTLE, 16, 16, 0, address_map_constructor(FUNC(multibus_device::pio_map), this))
|
||||
, m_int_cb(*this)
|
||||
, m_xack_cb(*this)
|
||||
{
|
||||
@ -43,10 +43,19 @@ void multibus_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
void multibus_device::mem_map(address_map &map)
|
||||
{
|
||||
map(0x00'0000, 0xff'ffff).unmaprw().flags(FLAG_UNMAPPED);
|
||||
}
|
||||
|
||||
void multibus_device::pio_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).unmaprw().flags(FLAG_UNMAPPED);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@ -54,23 +63,31 @@ void multibus_slot_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
void multibus_slot_device::device_resolve_objects()
|
||||
{
|
||||
device_multibus_interface *const card(dynamic_cast<device_multibus_interface *>(get_card_device()));
|
||||
|
||||
if (card)
|
||||
card->set_bus_device(*m_bus);
|
||||
}
|
||||
|
||||
device_multibus_interface::device_multibus_interface(machine_config const &mconfig, device_t &device)
|
||||
: device_interface(device, "multibus")
|
||||
, m_bus(nullptr)
|
||||
, m_bus(*this, finder_base::DUMMY_TAG)
|
||||
, m_int(*this)
|
||||
{
|
||||
}
|
||||
|
||||
void device_multibus_interface::set_bus_device(multibus_device &bus_device)
|
||||
void device_multibus_interface::interface_config_complete()
|
||||
{
|
||||
m_bus = &bus_device;
|
||||
if (device().owner() && device().owner()->owner())
|
||||
{
|
||||
multibus_device *const bus = downcast<multibus_device *>(device().owner()->owner());
|
||||
|
||||
m_bus.set_tag(*bus);
|
||||
|
||||
// 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); });
|
||||
}
|
||||
}
|
||||
|
||||
void device_multibus_interface::int_w(unsigned number, int state)
|
||||
@ -87,3 +104,8 @@ void device_multibus_interface::int_w(unsigned number, int state)
|
||||
case 7: int_w<7>(state); break;
|
||||
}
|
||||
}
|
||||
|
||||
void device_multibus_interface::unmap(int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmirror)
|
||||
{
|
||||
m_bus->space(spacenum).unmap_readwrite(addrstart, addrend, addrmirror, multibus_device::FLAG_UNMAPPED);
|
||||
}
|
||||
|
@ -83,6 +83,11 @@ class multibus_device
|
||||
public:
|
||||
multibus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
enum flags : u16
|
||||
{
|
||||
FLAG_UNMAPPED = 0x0001,
|
||||
};
|
||||
|
||||
// interrupt interface
|
||||
template <unsigned I> auto int_callback() { return m_int_cb[I].bind(); }
|
||||
template <unsigned I> void int_w(int state) { m_int_cb[I](state); }
|
||||
@ -100,6 +105,9 @@ protected:
|
||||
// device_memory_interface overrides
|
||||
virtual space_config_vector memory_space_config() const override;
|
||||
|
||||
void mem_map(address_map &map);
|
||||
void pio_map(address_map &map);
|
||||
|
||||
private:
|
||||
address_space_config const m_mem_config;
|
||||
address_space_config const m_pio_config;
|
||||
@ -113,13 +121,12 @@ class multibus_slot_device
|
||||
, public device_slot_interface
|
||||
{
|
||||
public:
|
||||
multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = DERIVED_CLOCK(1, 1));
|
||||
|
||||
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)
|
||||
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)
|
||||
: 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);
|
||||
@ -128,31 +135,34 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_start() override ATTR_COLD;
|
||||
virtual void device_resolve_objects() override ATTR_COLD;
|
||||
|
||||
private:
|
||||
required_device<multibus_device> m_bus;
|
||||
};
|
||||
|
||||
class device_multibus_interface : public device_interface
|
||||
{
|
||||
protected:
|
||||
friend class multibus_slot_device;
|
||||
|
||||
device_multibus_interface(machine_config const &mconfig, device_t &device);
|
||||
|
||||
void set_bus_device(multibus_device &bus_device);
|
||||
// configuration
|
||||
template <unsigned I> auto int_callback() { return m_int[I].bind(); }
|
||||
|
||||
// device_interface implementation
|
||||
virtual void interface_config_complete() override ATTR_COLD;
|
||||
|
||||
// runtime
|
||||
template <unsigned I> void int_w(int state) { m_bus->int_w<I>(state); }
|
||||
void int_w(unsigned number, int state);
|
||||
|
||||
void xack_w(int state) { m_bus->xack_w(state); }
|
||||
void unmap(int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmirror = 0U);
|
||||
|
||||
multibus_device *m_bus;
|
||||
required_device<multibus_device> m_bus;
|
||||
|
||||
private:
|
||||
devcb_write_line::array<8> m_int;
|
||||
};
|
||||
|
||||
// device type declaration
|
||||
DECLARE_DEVICE_TYPE(MULTIBUS, multibus_device)
|
||||
DECLARE_DEVICE_TYPE(MULTIBUS_SLOT, multibus_slot_device)
|
||||
|
||||
#endif /* MAME_BUS_MULTIBUS_MULTIBUS_H */
|
||||
#endif // MAME_BUS_MULTIBUS_MULTIBUS_H
|
||||
|
@ -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", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:1", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:2", m_bus, labtam_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", m_bus, labtam_cards, "labtam_8086cpu", false);
|
||||
MULTIBUS_SLOT(config, "slot:4", m_bus, labtam_cards, "labtam_vducom", false);
|
||||
MULTIBUS_SLOT(config, "slot:5", m_bus, labtam_cards, "labtam_z80sbc", false);
|
||||
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);
|
||||
}
|
||||
|
||||
ROM_START(labtam)
|
||||
|
@ -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, m_bus, imds2_cards, nullptr, false); // FIXME: isbc202
|
||||
MULTIBUS_SLOT(config, m_slot, imds2_cards, nullptr, false); // FIXME: isbc202
|
||||
}
|
||||
|
||||
void imds2_state::xack(int state)
|
||||
|
@ -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", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:2", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:4", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:5", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:6", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:7", m_bus, isbc660_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:8", m_bus, isbc660_cards, nullptr, false);
|
||||
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);
|
||||
}
|
||||
|
||||
ROM_START(isbc660)
|
||||
|
@ -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", m_bus, a7150_cards, "kgs", false);
|
||||
MULTIBUS_SLOT(config, "slot:1", a7150_cards, "kgs", false);
|
||||
|
||||
// ZRE board
|
||||
|
||||
|
@ -75,14 +75,14 @@ void pcmx2_state::pcmx2(machine_config &config)
|
||||
{
|
||||
MULTIBUS(config, m_bus, 20_MHz_XTAL / 2);
|
||||
|
||||
MULTIBUS_SLOT(config, "slot:1", m_bus, pcmx2_cards, nullptr, false); // DTC 86-1 or Storager
|
||||
MULTIBUS_SLOT(config, "slot:2", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:3", m_bus, pcmx2_cards, "serad", false);
|
||||
MULTIBUS_SLOT(config, "slot:4", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:5", m_bus, pcmx2_cards, nullptr, false);
|
||||
MULTIBUS_SLOT(config, "slot:6", m_bus, pcmx2_cards, "cpuap", false);
|
||||
MULTIBUS_SLOT(config, "slot:7", m_bus, pcmx2_cards, nullptr, false); // MEM
|
||||
MULTIBUS_SLOT(config, "slot:8", m_bus, pcmx2_cards, nullptr, false);
|
||||
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);
|
||||
}
|
||||
|
||||
ROM_START(pcmx2)
|
||||
|
Loading…
Reference in New Issue
Block a user