summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-11-18 00:58:48 +1100
committer Vas Crabb <vas@vastheman.com>2019-11-18 00:58:48 +1100
commit1fbfa9e071fe1824ea47c567c23778d8ab33cacf (patch)
treea73f9130e4ad11a15f0acaf899da5a0479538c1c /src
parent50694d017bf5be29f5523faedeb76463e0565870 (diff)
bus/amiga/zorro: put in namespace, improve safety a bit (nw)
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/amiga/zorro/a2052.cpp26
-rw-r--r--src/devices/bus/amiga/zorro/a2052.h10
-rw-r--r--src/devices/bus/amiga/zorro/a2058.cpp27
-rw-r--r--src/devices/bus/amiga/zorro/a2058.h10
-rw-r--r--src/devices/bus/amiga/zorro/a2065.cpp15
-rw-r--r--src/devices/bus/amiga/zorro/a2065.h10
-rw-r--r--src/devices/bus/amiga/zorro/a2232.cpp49
-rw-r--r--src/devices/bus/amiga/zorro/a2232.h10
-rw-r--r--src/devices/bus/amiga/zorro/a590.cpp59
-rw-r--r--src/devices/bus/amiga/zorro/a590.h35
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.cpp32
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.h39
-rw-r--r--src/devices/bus/amiga/zorro/buddha.cpp76
-rw-r--r--src/devices/bus/amiga/zorro/buddha.h14
-rw-r--r--src/devices/bus/amiga/zorro/cards.cpp38
-rw-r--r--src/devices/bus/amiga/zorro/cards.h10
-rw-r--r--src/devices/bus/amiga/zorro/zorro.cpp138
-rw-r--r--src/devices/bus/amiga/zorro/zorro.h59
-rw-r--r--src/frontend/mame/ui/menu.cpp4
-rw-r--r--src/mame/drivers/amiga.cpp5
20 files changed, 361 insertions, 305 deletions
diff --git a/src/devices/bus/amiga/zorro/a2052.cpp b/src/devices/bus/amiga/zorro/a2052.cpp
index 4aa54e52bbc..877d0f9c1d3 100644
--- a/src/devices/bus/amiga/zorro/a2052.cpp
+++ b/src/devices/bus/amiga/zorro/a2052.cpp
@@ -11,19 +11,18 @@
#include "emu.h"
#include "a2052.h"
-
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
#define VERBOSE 1
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(A2052, a2052_device, "a2052", "CBM A2052 Fast Memory")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A2052, bus::amiga::zorro, a2052_device, "zorro_a2052", "CBM A2052 Fast Memory")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// input_ports - device-specific input ports
@@ -52,7 +51,7 @@ ioport_constructor a2052_device::device_input_ports() const
//-------------------------------------------------
a2052_device::a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, A2052, tag, owner, clock),
+ device_t(mconfig, ZORRO_A2052, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_config(*this, "config")
{
@@ -64,7 +63,6 @@ a2052_device::a2052_device(const machine_config &mconfig, const char *tag, devic
void a2052_device::device_start()
{
- set_zorro_device();
}
@@ -74,11 +72,8 @@ void a2052_device::device_start()
void a2052_device::autoconfig_base_address(offs_t address)
{
- if (VERBOSE)
- logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);
-
- if (VERBOSE)
- logerror("-> installing a2052\n");
+ LOG("%s: autoconfig_base_address received: 0x%06x\n", shortname(), address);
+ LOG("-> installing a2052\n");
// stop responding to default autoconfig
m_slot->space().unmap_readwrite(0xe80000, 0xe8007f);
@@ -92,8 +87,7 @@ void a2052_device::autoconfig_base_address(offs_t address)
WRITE_LINE_MEMBER( a2052_device::cfgin_w )
{
- if (VERBOSE)
- logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state);
+ LOG("%s: configin_w (%d)\n", shortname(), state);
if (state == 0)
{
@@ -133,3 +127,5 @@ WRITE_LINE_MEMBER( a2052_device::cfgin_w )
write16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_write)), 0xffff);
}
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/a2052.h b/src/devices/bus/amiga/zorro/a2052.h
index 255b459767d..fbbac14f4cb 100644
--- a/src/devices/bus/amiga/zorro/a2052.h
+++ b/src/devices/bus/amiga/zorro/a2052.h
@@ -17,6 +17,8 @@
#include "machine/autoconfig.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -30,8 +32,8 @@ public:
a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
- virtual ioport_constructor device_input_ports() const override;
- virtual void device_start() override;
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
// device_zorro2_card_interface overrides
virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ) override;
@@ -44,7 +46,9 @@ private:
std::vector<uint16_t> m_ram;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(A2052, a2052_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A2052, bus::amiga::zorro, a2052_device)
#endif // MAME_BUS_AMIGA_ZORRO_A2052_H
diff --git a/src/devices/bus/amiga/zorro/a2058.cpp b/src/devices/bus/amiga/zorro/a2058.cpp
index d0ecee24526..cb30212620f 100644
--- a/src/devices/bus/amiga/zorro/a2058.cpp
+++ b/src/devices/bus/amiga/zorro/a2058.cpp
@@ -11,19 +11,18 @@
#include "emu.h"
#include "a2058.h"
-
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
#define VERBOSE 1
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(A2058, a2058_device, "a2058", "CBM A2058 Fast Memory")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A2058, bus::amiga::zorro, a2058_device, "zorro_a2058", "CBM A2058 Fast Memory")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// input_ports - device-specific input ports
@@ -53,7 +52,7 @@ ioport_constructor a2058_device::device_input_ports() const
//-------------------------------------------------
a2058_device::a2058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, A2058, tag, owner, clock),
+ device_t(mconfig, ZORRO_A2058, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_config(*this, "config"),
m_ram_size(0)
@@ -71,8 +70,6 @@ void a2058_device::device_start()
// register for save states
save_pointer(NAME(m_ram), 0x800000/2);
-
- set_zorro_device();
}
@@ -82,11 +79,8 @@ void a2058_device::device_start()
void a2058_device::autoconfig_base_address(offs_t address)
{
- if (VERBOSE)
- logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);
-
- if (VERBOSE)
- logerror("-> installing a2058\n");
+ LOG("%s: autoconfig_base_address received: 0x%06x\n", shortname(), address);
+ LOG("-> installing a2058\n");
// stop responding to default autoconfig
m_slot->space().unmap_readwrite(0xe80000, 0xe8007f);
@@ -100,8 +94,7 @@ void a2058_device::autoconfig_base_address(offs_t address)
WRITE_LINE_MEMBER( a2058_device::cfgin_w )
{
- if (VERBOSE)
- logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state);
+ LOG("%s: configin_w (%d)\n", shortname(), state);
if (state == 0)
{
@@ -145,3 +138,5 @@ WRITE_LINE_MEMBER( a2058_device::cfgin_w )
write16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_write)), 0xffff);
}
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/a2058.h b/src/devices/bus/amiga/zorro/a2058.h
index 0d3b6771c1f..e46a6774a3e 100644
--- a/src/devices/bus/amiga/zorro/a2058.h
+++ b/src/devices/bus/amiga/zorro/a2058.h
@@ -17,6 +17,8 @@
#include "machine/autoconfig.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -30,8 +32,8 @@ public:
a2058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
- virtual ioport_constructor device_input_ports() const override;
- virtual void device_start() override;
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
// device_zorro2_card_interface overrides
virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ) override;
@@ -45,7 +47,9 @@ private:
int m_ram_size;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(A2058, a2058_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A2058, bus::amiga::zorro, a2058_device)
#endif // MAME_BUS_AMIGA_ZORRO_A2058_H
diff --git a/src/devices/bus/amiga/zorro/a2065.cpp b/src/devices/bus/amiga/zorro/a2065.cpp
index 392601e1421..a3c0437aa17 100644
--- a/src/devices/bus/amiga/zorro/a2065.cpp
+++ b/src/devices/bus/amiga/zorro/a2065.cpp
@@ -24,7 +24,10 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(A2065, a2065_device, "a2065", "CBM A2065 Ethernet Card")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A2065, bus::amiga::zorro, a2065_device, "zorro_a2065", "CBM A2065 Ethernet Card")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// device_add_mconfig - add device configuration
@@ -48,7 +51,7 @@ void a2065_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
a2065_device::a2065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, A2065, tag, owner, clock),
+ device_t(mconfig, ZORRO_A2065, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_lance(*this, "lance")
{
@@ -66,8 +69,6 @@ void a2065_device::device_start()
// register for save states
save_pointer(NAME(m_ram), 0x4000);
-
- set_zorro_device();
}
@@ -77,7 +78,7 @@ void a2065_device::device_start()
void a2065_device::autoconfig_base_address(offs_t address)
{
- LOG("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);
+ LOG("%s: autoconfig_base_address received: 0x%06x\n", shortname(), address);
LOG("-> installing a2065\n");
// stop responding to default autoconfig
@@ -104,7 +105,7 @@ void a2065_device::autoconfig_base_address(offs_t address)
WRITE_LINE_MEMBER( a2065_device::cfgin_w )
{
- LOG("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state);
+ LOG("%s: configin_w (%d)\n", shortname(), state);
if (state == 0)
{
@@ -160,3 +161,5 @@ WRITE_LINE_MEMBER( a2065_device::lance_irq_w )
// default is irq 2, can be changed via jumper
m_slot->int2_w(!state);
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/a2065.h b/src/devices/bus/amiga/zorro/a2065.h
index bdc0db72475..c3311eb2a53 100644
--- a/src/devices/bus/amiga/zorro/a2065.h
+++ b/src/devices/bus/amiga/zorro/a2065.h
@@ -18,6 +18,8 @@
#include "machine/autoconfig.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -39,8 +41,8 @@ public:
protected:
// device-level overrides
- virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
// device_zorro2_card_interface overrides
virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ) override;
@@ -54,7 +56,9 @@ private:
std::unique_ptr<uint16_t[]> m_ram;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(A2065, a2065_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A2065, bus::amiga::zorro, a2065_device)
#endif // MAME_BUS_AMIGA_ZORRO_A2065_H
diff --git a/src/devices/bus/amiga/zorro/a2232.cpp b/src/devices/bus/amiga/zorro/a2232.cpp
index 8afa7e245f3..3243a6c7286 100644
--- a/src/devices/bus/amiga/zorro/a2232.cpp
+++ b/src/devices/bus/amiga/zorro/a2232.cpp
@@ -11,20 +11,20 @@
#include "emu.h"
#include "a2232.h"
-
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
-#define VERBOSE 0
-#define VERBOSE_DATA 0
+#define LOG_GENERAL (1U << 0)
+#define LOG_DATA (1U << 1)
+//#define VERBOSE (LOG_GENERAL | LOG_DATA)
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(A2232, a2232_device, "a2232", "CBM A2232 Serial Card")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A2232, bus::amiga::zorro, a2232_device, "zorro_a2232", "CBM A2232 Serial Card")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// device_add_mconfig - add device configuration
@@ -118,7 +118,7 @@ void a2232_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
a2232_device::a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, A2232, tag, owner, clock),
+ device_t(mconfig, ZORRO_A2232, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_iocpu(*this, "iocpu"),
m_ioirq(*this, "ioirq"),
@@ -136,7 +136,6 @@ a2232_device::a2232_device(const machine_config &mconfig, const char *tag, devic
void a2232_device::device_start()
{
- set_zorro_device();
}
//-------------------------------------------------
@@ -160,16 +159,14 @@ void a2232_device::device_reset_after_children()
WRITE8_MEMBER( a2232_device::int2_w )
{
- if (VERBOSE)
- logerror("%s('%s'): int2_w %04x\n", shortname(), basetag(), data);
+ LOG("%s: int2_w %04x\n", shortname(), data);
m_slot->int2_w(1);
}
WRITE8_MEMBER( a2232_device::irq_ack8_w )
{
- if (VERBOSE)
- logerror("%s('%s'): irq_ack_w %04x\n", shortname(), basetag(), data);
+ LOG("%s: irq_ack_w %04x\n", shortname(), data);
m_ioirq->in_w<8>(CLEAR_LINE);
}
@@ -181,11 +178,8 @@ WRITE8_MEMBER( a2232_device::irq_ack8_w )
void a2232_device::autoconfig_base_address(offs_t address)
{
- if (VERBOSE)
- logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);
-
- if (VERBOSE)
- logerror("-> installing a2232\n");
+ LOG("%s: autoconfig_base_address received: 0x%06x\n", shortname(), address);
+ LOG("-> installing a2232\n");
// stop responding to default autoconfig
m_slot->space().unmap_readwrite(0xe80000, 0xe8007f);
@@ -216,8 +210,7 @@ void a2232_device::autoconfig_base_address(offs_t address)
WRITE_LINE_MEMBER( a2232_device::cfgin_w )
{
- if (VERBOSE)
- logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state);
+ LOG("%s: configin_w (%d)\n", shortname(), state);
if (state == 0)
{
@@ -261,16 +254,14 @@ READ16_MEMBER( a2232_device::shared_ram_r )
else
data |= 0xff00;
- if (VERBOSE_DATA)
- logerror("%s('%s'): shared_ram_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset << 1, data, mem_mask);
+ LOGMASKED(LOG_DATA, "%s: shared_ram_r(%04x) %04x [mask = %04x]\n", shortname(), offset << 1, data, mem_mask);
return data;
}
WRITE16_MEMBER( a2232_device::shared_ram_w )
{
- if (VERBOSE_DATA)
- logerror("%s('%s'): shared_ram_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset << 1, data, mem_mask);
+ LOGMASKED(LOG_DATA, "%s: shared_ram_w(%04x) %04x [mask = %04x]\n", shortname(), offset << 1, data, mem_mask);
if (ACCESSING_BITS_0_7)
m_shared_ram[(offset << 1) + 1] = data & 0xff;
@@ -320,8 +311,7 @@ READ16_MEMBER( a2232_device::reset_high_r )
{
uint16_t data = 0xffff;
- if (VERBOSE)
- logerror("%s('%s'): reset_high_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask);
+ LOG("%s: reset_high_r %04x [mask = %04x]\n", shortname(), data, mem_mask);
m_iocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
@@ -330,8 +320,7 @@ READ16_MEMBER( a2232_device::reset_high_r )
WRITE16_MEMBER( a2232_device::reset_high_w )
{
- if (VERBOSE)
- logerror("%s('%s'): reset_high_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask);
+ LOG("%s: reset_high_w %04x [mask = %04x]\n", shortname(), data, mem_mask);
m_iocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
@@ -498,3 +487,5 @@ void a2232_device::iocpu_map(address_map &map)
map(0x8000, 0x8000).w(FUNC(a2232_device::irq_ack8_w));
map(0xc000, 0xffff).ram().share("shared");
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/a2232.h b/src/devices/bus/amiga/zorro/a2232.h
index 31a0c368071..14a452f65d2 100644
--- a/src/devices/bus/amiga/zorro/a2232.h
+++ b/src/devices/bus/amiga/zorro/a2232.h
@@ -24,6 +24,8 @@
#include "bus/rs232/rs232.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -51,8 +53,8 @@ public:
void iocpu_map(address_map &map);
protected:
- virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset_after_children() override;
// device_zorro2_card_interface overrides
@@ -104,7 +106,9 @@ private:
uint8_t m_cia_port_b;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(A2232, a2232_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A2232, bus::amiga::zorro, a2232_device)
#endif // MAME_BUS_AMIGA_ZORRO_A2232_H
diff --git a/src/devices/bus/amiga/zorro/a590.cpp b/src/devices/bus/amiga/zorro/a590.cpp
index 01975c4a6ad..cba4f706fed 100644
--- a/src/devices/bus/amiga/zorro/a590.cpp
+++ b/src/devices/bus/amiga/zorro/a590.cpp
@@ -18,8 +18,11 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(A590, a590_device, "a590", "CBM A590 HD Controller")
-DEFINE_DEVICE_TYPE(A2091, a2091_device, "a2091", "CBM A2091 HD Controller")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A590, bus::amiga::zorro, a590_device, "zorro_a590", "CBM A590 HD Controller")
+DEFINE_DEVICE_TYPE_NS(ZORRO_A2091, bus::amiga::zorro, a2091_device, "zorro_a2091", "CBM A2091 HD Controller")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// input_ports - device-specific input ports
@@ -114,20 +117,20 @@ ioport_constructor a2091_device::device_input_ports() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-void dmac_hdc_device::wd33c93(device_t *device)
+void dmac_hdc_device_base::wd33c93(device_t *device)
{
device->set_clock(10000000);
- downcast<wd33c93a_device *>(device)->irq_cb().set(*this, FUNC(dmac_hdc_device::scsi_irq_w));
- downcast<wd33c93a_device *>(device)->drq_cb().set(*this, FUNC(dmac_hdc_device::scsi_drq_w));
+ downcast<wd33c93a_device *>(device)->irq_cb().set(*this, FUNC(dmac_hdc_device_base::scsi_irq_w));
+ downcast<wd33c93a_device *>(device)->drq_cb().set(*this, FUNC(dmac_hdc_device_base::scsi_drq_w));
}
-void dmac_hdc_device::device_add_mconfig(machine_config &config)
+void dmac_hdc_device_base::device_add_mconfig(machine_config &config)
{
amiga_dmac_device &dmac(AMIGA_DMAC(config, "dmac", 0));
- dmac.scsi_read_handler().set(FUNC(dmac_hdc_device::dmac_scsi_r));
- dmac.scsi_write_handler().set(FUNC(dmac_hdc_device::dmac_scsi_w));
- dmac.int_handler().set(FUNC(dmac_hdc_device::dmac_int_w));
- dmac.cfgout_handler().set(FUNC(dmac_hdc_device::dmac_cfgout_w));
+ dmac.scsi_read_handler().set(FUNC(dmac_hdc_device_base::dmac_scsi_r));
+ dmac.scsi_write_handler().set(FUNC(dmac_hdc_device_base::dmac_scsi_w));
+ dmac.int_handler().set(FUNC(dmac_hdc_device_base::dmac_int_w));
+ dmac.cfgout_handler().set(FUNC(dmac_hdc_device_base::dmac_cfgout_w));
NSCSI_BUS(config, "scsi", 0);
NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, nullptr, false);
@@ -137,7 +140,7 @@ void dmac_hdc_device::device_add_mconfig(machine_config &config)
NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "scsi:7").option_set("wd33c93", WD33C93A)
- .machine_config([this](device_t *device) { wd33c93(device); });
+ .machine_config([this] (device_t *device) { wd33c93(device); });
}
@@ -197,7 +200,7 @@ ROM_START( dmac_hdc )
ROM_LOAD("390333-03.u5", 0x000, 0x104, CRC(dc4a8d9b) SHA1(761a1318106e49057f95258699076ec1079967ad))
ROM_END
-const tiny_rom_entry *dmac_hdc_device::device_rom_region() const
+const tiny_rom_entry *dmac_hdc_device_base::device_rom_region() const
{
return ROM_NAME( dmac_hdc );
}
@@ -208,10 +211,10 @@ const tiny_rom_entry *dmac_hdc_device::device_rom_region() const
//**************************************************************************
//-------------------------------------------------
-// dmac_hdc_device - constructor
+// dmac_hdc_device_base - constructor
//-------------------------------------------------
-dmac_hdc_device::dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+dmac_hdc_device_base::dmac_hdc_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
m_int6(false),
m_dmac(*this, "dmac"),
@@ -220,7 +223,7 @@ dmac_hdc_device::dmac_hdc_device(const machine_config &mconfig, device_type type
}
a590_device::a590_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- dmac_hdc_device(mconfig, A590, tag, owner, clock),
+ dmac_hdc_device_base(mconfig, ZORRO_A590, tag, owner, clock),
device_exp_card_interface(mconfig, *this),
m_dips(*this, "dips"),
m_jp1(*this, "jp1"),
@@ -230,7 +233,7 @@ a590_device::a590_device(const machine_config &mconfig, const char *tag, device_
}
a2091_device::a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- dmac_hdc_device(mconfig, A2091, tag, owner, clock),
+ dmac_hdc_device_base(mconfig, ZORRO_A2091, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_jp1(*this, "jp1"),
m_jp2(*this, "jp2"),
@@ -244,13 +247,13 @@ a2091_device::a2091_device(const machine_config &mconfig, const char *tag, devic
// device_start - device-specific startup
//-------------------------------------------------
-void dmac_hdc_device::device_start()
+void dmac_hdc_device_base::device_start()
{
}
void a590_device::device_start()
{
- set_zorro_device();
+ dmac_hdc_device_base::device_start();
// setup DMAC
m_dmac->set_address_space(&m_slot->space());
@@ -259,7 +262,7 @@ void a590_device::device_start()
void a2091_device::device_start()
{
- set_zorro_device();
+ dmac_hdc_device_base::device_start();
// setup DMAC
m_dmac->set_address_space(&m_slot->space());
@@ -270,11 +273,11 @@ void a2091_device::device_start()
// device_reset - device-specific reset
//-------------------------------------------------
-void dmac_hdc_device::device_reset()
+void dmac_hdc_device_base::device_reset()
{
}
-void dmac_hdc_device::resize_ram(int config)
+void dmac_hdc_device_base::resize_ram(int config)
{
// allocate space for RAM
switch (config & 0x0f)
@@ -302,10 +305,12 @@ void dmac_hdc_device::resize_ram(int config)
void a590_device::device_reset()
{
+ dmac_hdc_device_base::device_reset();
}
void a2091_device::device_reset()
{
+ dmac_hdc_device_base::device_reset();
}
@@ -333,7 +338,7 @@ WRITE_LINE_MEMBER( a2091_device::cfgin_w )
m_dmac->configin_w(state);
}
-READ8_MEMBER( dmac_hdc_device::dmac_scsi_r )
+READ8_MEMBER( dmac_hdc_device_base::dmac_scsi_r )
{
switch (offset)
{
@@ -344,7 +349,7 @@ READ8_MEMBER( dmac_hdc_device::dmac_scsi_r )
return 0xff;
}
-WRITE8_MEMBER( dmac_hdc_device::dmac_scsi_w )
+WRITE8_MEMBER( dmac_hdc_device_base::dmac_scsi_w )
{
switch (offset)
{
@@ -353,7 +358,7 @@ WRITE8_MEMBER( dmac_hdc_device::dmac_scsi_w )
}
}
-WRITE_LINE_MEMBER( dmac_hdc_device::dmac_int_w )
+WRITE_LINE_MEMBER( dmac_hdc_device_base::dmac_int_w )
{
if (m_int6)
int6_w(state);
@@ -361,13 +366,15 @@ WRITE_LINE_MEMBER( dmac_hdc_device::dmac_int_w )
int2_w(state);
}
-WRITE_LINE_MEMBER( dmac_hdc_device::scsi_irq_w )
+WRITE_LINE_MEMBER( dmac_hdc_device_base::scsi_irq_w )
{
// should be or'ed with xt-ide IRQ
m_dmac->intx_w(state);
}
-WRITE_LINE_MEMBER( dmac_hdc_device::scsi_drq_w )
+WRITE_LINE_MEMBER( dmac_hdc_device_base::scsi_drq_w )
{
m_dmac->xdreq_w(state);
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/a590.h b/src/devices/bus/amiga/zorro/a590.h
index 62ea3bd189f..36b6ecf0a2e 100644
--- a/src/devices/bus/amiga/zorro/a590.h
+++ b/src/devices/bus/amiga/zorro/a590.h
@@ -18,25 +18,27 @@
#include "machine/wd33c9x.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> dmac_hdc_device
+// ======================> dmac_hdc_device_base
-class dmac_hdc_device : public device_t
+class dmac_hdc_device_base : public device_t
{
protected:
// construction/destruction
- dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ dmac_hdc_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset() override;
// optional information overrides
- virtual void device_add_mconfig(machine_config &config) override;
- virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
// to slot
virtual void cfgout_w(int state) = 0;
@@ -63,13 +65,13 @@ private:
DECLARE_WRITE_LINE_MEMBER( scsi_irq_w );
DECLARE_WRITE_LINE_MEMBER( scsi_drq_w );
- static void scsi_devices(device_slot_interface &device);
+ static void scsi_devices(device_slot_interface &device) ATTR_COLD;
void wd33c93(device_t *device);
};
// ======================> a590_device
-class a590_device : public dmac_hdc_device, public device_exp_card_interface
+class a590_device : public dmac_hdc_device_base, public device_exp_card_interface
{
public:
// construction/destruction
@@ -77,11 +79,11 @@ public:
protected:
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset() override;
// optional information overrides
- virtual ioport_constructor device_input_ports() const override;
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
// output to slot
virtual void cfgout_w(int state) override { m_slot->cfgout_w(state); }
@@ -100,18 +102,19 @@ private:
// ======================> a2091_device
-class a2091_device : public dmac_hdc_device, public device_zorro2_card_interface
+class a2091_device : public dmac_hdc_device_base, public device_zorro2_card_interface
{
public:
// construction/destruction
a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset() override;
// optional information overrides
- virtual ioport_constructor device_input_ports() const override;
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
// output to slot
virtual void cfgout_w(int state) override { m_slot->cfgout_w(state); }
@@ -129,8 +132,10 @@ private:
required_ioport m_jp201;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(A590, a590_device)
-DECLARE_DEVICE_TYPE(A2091, a2091_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A590, bus::amiga::zorro, a590_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_A2091, bus::amiga::zorro, a2091_device)
#endif // MAME_BUS_AMIGA_ZORRO_A590_H
diff --git a/src/devices/bus/amiga/zorro/action_replay.cpp b/src/devices/bus/amiga/zorro/action_replay.cpp
index 075948c4ec3..d8aea30153a 100644
--- a/src/devices/bus/amiga/zorro/action_replay.cpp
+++ b/src/devices/bus/amiga/zorro/action_replay.cpp
@@ -22,9 +22,12 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(ACTION_REPLAY_MK1, action_replay_mk1_device, "amiga_ar1", "Datel Action Replay MK-I")
-DEFINE_DEVICE_TYPE(ACTION_REPLAY_MK2, action_replay_mk2_device, "amiga_ar2", "Datel Action Replay MK-II")
-DEFINE_DEVICE_TYPE(ACTION_REPLAY_MK3, action_replay_mk3_device, "amiga_ar3", "Datel Action Replay MK-III")
+DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK1, bus::amiga::zorro, action_replay_mk1_device, "zorro_ar1", "Datel Action Replay MK-I")
+DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK2, bus::amiga::zorro, action_replay_mk2_device, "zorro_ar2", "Datel Action Replay MK-II")
+DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK3, bus::amiga::zorro, action_replay_mk3_device, "zorro_ar3", "Datel Action Replay MK-III")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// input_ports - device-specific input ports
@@ -32,10 +35,10 @@ DEFINE_DEVICE_TYPE(ACTION_REPLAY_MK3, action_replay_mk3_device, "amiga_ar3", "Da
static INPUT_PORTS_START( ar_button )
PORT_START("freeze")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, action_replay_device, freeze, 0)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, action_replay_device_base, freeze, 0)
INPUT_PORTS_END
-ioport_constructor action_replay_device::device_input_ports() const
+ioport_constructor action_replay_device_base::device_input_ports() const
{
return INPUT_PORTS_NAME( ar_button );
}
@@ -95,10 +98,10 @@ const tiny_rom_entry *action_replay_mk3_device::device_rom_region() const
//**************************************************************************
//-------------------------------------------------
-// action_replay_device - constructor
+// action_replay_device_base - constructor
//-------------------------------------------------
-action_replay_device::action_replay_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+action_replay_device_base::action_replay_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_exp_card_interface(mconfig, *this),
m_button(*this, "freeze")
@@ -106,17 +109,17 @@ action_replay_device::action_replay_device(const machine_config &mconfig, device
}
action_replay_mk1_device::action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock)
+ action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK1, tag, owner, clock)
{
}
action_replay_mk2_device::action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- action_replay_device(mconfig, ACTION_REPLAY_MK2, tag, owner, clock)
+ action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK2, tag, owner, clock)
{
}
action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- action_replay_device(mconfig, ACTION_REPLAY_MK3, tag, owner, clock)
+ action_replay_device_base(mconfig, ZORRO_ACTION_REPLAY_MK3, tag, owner, clock)
{
}
@@ -124,16 +127,15 @@ action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig
// device_start - device-specific startup
//-------------------------------------------------
-void action_replay_device::device_start()
+void action_replay_device_base::device_start()
{
- set_zorro_device();
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
-void action_replay_device::device_reset()
+void action_replay_device_base::device_reset()
{
}
@@ -142,8 +144,10 @@ void action_replay_device::device_reset()
// IMPLEMENTATION
//**************************************************************************
-INPUT_CHANGED_MEMBER( action_replay_device::freeze )
+INPUT_CHANGED_MEMBER( action_replay_device_base::freeze )
{
// pushing the freeze button generates an nmi
m_slot->ipl_w(newval == 1 ? 7 : 0);
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/action_replay.h b/src/devices/bus/amiga/zorro/action_replay.h
index 5dd1e347049..4c0d6f3c93d 100644
--- a/src/devices/bus/amiga/zorro/action_replay.h
+++ b/src/devices/bus/amiga/zorro/action_replay.h
@@ -16,65 +16,72 @@
#include "zorro.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> action_replay_device
+// ======================> action_replay_device_base
-class action_replay_device : public device_t, public device_exp_card_interface
+class action_replay_device_base : public device_t, public device_exp_card_interface
{
public:
- // optional information overrides
- virtual ioport_constructor device_input_ports() const override;
-
DECLARE_INPUT_CHANGED_MEMBER( freeze );
protected:
// construction/destruction
- action_replay_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ action_replay_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // optional information overrides
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset() override;
private:
required_ioport m_button;
};
-class action_replay_mk1_device : public action_replay_device
+class action_replay_mk1_device : public action_replay_device_base
{
public:
// construction/destruction
action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
// optional information overrides
- virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
};
-class action_replay_mk2_device : public action_replay_device
+class action_replay_mk2_device : public action_replay_device_base
{
public:
// construction/destruction
action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
// optional information overrides
- virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
};
-class action_replay_mk3_device : public action_replay_device
+class action_replay_mk3_device : public action_replay_device_base
{
public:
// construction/destruction
action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
// optional information overrides
- virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(ACTION_REPLAY_MK1, action_replay_mk1_device)
-DECLARE_DEVICE_TYPE(ACTION_REPLAY_MK2, action_replay_mk2_device)
-DECLARE_DEVICE_TYPE(ACTION_REPLAY_MK3, action_replay_mk3_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK1, bus::amiga::zorro, action_replay_mk1_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK2, bus::amiga::zorro, action_replay_mk2_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK3, bus::amiga::zorro, action_replay_mk3_device)
#endif // MAME_BUS_AMIGA_ZORRO_ACTION_REPLAY_H
diff --git a/src/devices/bus/amiga/zorro/buddha.cpp b/src/devices/bus/amiga/zorro/buddha.cpp
index ddb3ba3344c..3cc14d9d1d0 100644
--- a/src/devices/bus/amiga/zorro/buddha.cpp
+++ b/src/devices/bus/amiga/zorro/buddha.cpp
@@ -25,18 +25,18 @@
#include "emu.h"
#include "buddha.h"
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
#define VERBOSE 1
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(BUDDHA, buddha_device, "buddha", "Buddha IDE controller")
+DEFINE_DEVICE_TYPE_NS(ZORRO_BUDDHA, bus::amiga::zorro, buddha_device, "zorro_buddha", "Buddha IDE controller")
+
+
+namespace bus { namespace amiga { namespace zorro {
//-------------------------------------------------
// mmio_map - device-specific memory mapped I/O
@@ -95,7 +95,7 @@ const tiny_rom_entry *buddha_device::device_rom_region() const
//-------------------------------------------------
buddha_device::buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, BUDDHA, tag, owner, clock),
+ device_t(mconfig, ZORRO_BUDDHA, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_ata_0(*this, "ata_0"),
m_ata_1(*this, "ata_1"),
@@ -111,8 +111,6 @@ buddha_device::buddha_device(const machine_config &mconfig, const char *tag, dev
void buddha_device::device_start()
{
- set_zorro_device();
-
save_item(NAME(m_ide_interrupts_enabled));
save_item(NAME(m_ide_0_interrupt));
save_item(NAME(m_ide_1_interrupt));
@@ -136,11 +134,8 @@ void buddha_device::device_reset()
void buddha_device::autoconfig_base_address(offs_t address)
{
- if (VERBOSE)
- logerror("autoconfig_base_address received: 0x%06x\n", address);
-
- if (VERBOSE)
- logerror("-> installing buddha\n");
+ LOG("autoconfig_base_address received: 0x%06x\n", address);
+ LOG("-> installing buddha\n");
// stop responding to default autoconfig
m_slot->space().unmap_readwrite(0xe80000, 0xe8007f);
@@ -162,8 +157,7 @@ void buddha_device::autoconfig_base_address(offs_t address)
WRITE_LINE_MEMBER( buddha_device::cfgin_w )
{
- if (VERBOSE)
- logerror("configin_w (%d)\n", state);
+ LOG("configin_w (%d)\n", state);
if (state == 0)
{
@@ -191,22 +185,20 @@ READ16_MEMBER( buddha_device::speed_r )
{
uint16_t data = 0xffff;
- if (VERBOSE)
- logerror("speed_r %04x [mask = %04x]\n", data, mem_mask);
+ if (!machine().side_effects_disabled())
+ LOG("speed_r %04x [mask = %04x]\n", data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::speed_w )
{
- if (VERBOSE)
- logerror("speed_w %04x [mask = %04x]\n", data, mem_mask);
+ LOG("speed_w %04x [mask = %04x]\n", data, mem_mask);
}
-WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w)
+WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w )
{
- if (VERBOSE)
- logerror("ide_0_interrupt_w (%d)\n", state);
+ LOG("ide_0_interrupt_w (%d)\n", state);
m_ide_0_interrupt = state;
@@ -214,10 +206,9 @@ WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w)
m_slot->int2_w(state);
}
-WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w)
+WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w )
{
- if (VERBOSE)
- logerror("ide_1_interrupt_w (%d)\n", state);
+ LOG("ide_1_interrupt_w (%d)\n", state);
m_ide_1_interrupt = state;
@@ -231,8 +222,7 @@ READ16_MEMBER( buddha_device::ide_0_interrupt_r )
data = m_ide_0_interrupt << 15;
-// if (VERBOSE)
-// logerror("ide_0_interrupt_r %04x [mask = %04x]\n", data, mem_mask);
+// LOG("ide_0_interrupt_r %04x [mask = %04x]\n", data, mem_mask);
return data;
}
@@ -243,16 +233,14 @@ READ16_MEMBER( buddha_device::ide_1_interrupt_r )
data = m_ide_1_interrupt << 15;
-// if (VERBOSE)
-// logerror("ide_1_interrupt_r %04x [mask = %04x]\n", data, mem_mask);
+// LOG("ide_1_interrupt_r %04x [mask = %04x]\n", data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w )
{
- if (VERBOSE)
- logerror("ide_interrupt_enable_w %04x [mask = %04x]\n", data, mem_mask);
+ LOG("ide_interrupt_enable_w %04x [mask = %04x]\n", data, mem_mask);
// writing any value here enables ide interrupts to the zorro slot
m_ide_interrupts_enabled = true;
@@ -263,16 +251,14 @@ READ16_MEMBER( buddha_device::ide_0_cs0_r )
uint16_t data = m_ata_0->read_cs0((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8));
data = (data << 8) | (data >> 8);
- if (VERBOSE)
- logerror("ide_0_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_0_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::ide_0_cs0_w )
{
- if (VERBOSE)
- logerror("ide_0_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_0_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
mem_mask = (mem_mask << 8) | (mem_mask >> 8);
data = (data << 8) | (data >> 8);
@@ -285,16 +271,14 @@ READ16_MEMBER( buddha_device::ide_0_cs1_r )
uint16_t data = m_ata_0->read_cs1((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8));
data = (data << 8) | (data >> 8);
- if (VERBOSE)
- logerror("ide_0_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_0_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::ide_0_cs1_w )
{
- if (VERBOSE)
- logerror("ide_0_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_0_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
mem_mask = (mem_mask << 8) | (mem_mask >> 8);
data = (data << 8) | (data >> 8);
@@ -307,16 +291,14 @@ READ16_MEMBER( buddha_device::ide_1_cs0_r )
uint16_t data = m_ata_1->read_cs0((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8));
data = (data << 8) | (data >> 8);
- if (VERBOSE)
- logerror("ide_1_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_1_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::ide_1_cs0_w )
{
- if (VERBOSE)
- logerror("ide_1_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_1_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
mem_mask = (mem_mask << 8) | (mem_mask >> 8);
data = (data << 8) | (data >> 8);
@@ -329,19 +311,19 @@ READ16_MEMBER( buddha_device::ide_1_cs1_r )
uint16_t data = m_ata_1->read_cs1((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8));
data = (data << 8) | (data >> 8);
- if (VERBOSE)
- logerror("ide_1_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_1_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
return data;
}
WRITE16_MEMBER( buddha_device::ide_1_cs1_w )
{
- if (VERBOSE)
- logerror("ide_1_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
+ LOG("ide_1_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask);
mem_mask = (mem_mask << 8) | (mem_mask >> 8);
data = (data << 8) | (data >> 8);
m_ata_1->write_cs1((offset >> 1) & 0x07, data, mem_mask);
}
+
+} } } // namespace bus::amiga::zorro
diff --git a/src/devices/bus/amiga/zorro/buddha.h b/src/devices/bus/amiga/zorro/buddha.h
index 61ad183cbfb..b534734f994 100644
--- a/src/devices/bus/amiga/zorro/buddha.h
+++ b/src/devices/bus/amiga/zorro/buddha.h
@@ -18,6 +18,8 @@
#include "bus/ata/ataintf.h"
+namespace bus { namespace amiga { namespace zorro {
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -32,10 +34,10 @@ public:
protected:
// device-level overrides
- virtual void device_add_mconfig(machine_config &config) override;
- virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
virtual void device_reset() override;
// device_zorro2_card_interface overrides
@@ -66,7 +68,7 @@ private:
DECLARE_WRITE_LINE_MEMBER( ide_0_interrupt_w );
DECLARE_WRITE_LINE_MEMBER( ide_1_interrupt_w );
- void mmio_map(address_map &map);
+ void mmio_map(address_map &map) ATTR_COLD;
required_device<ata_interface_device> m_ata_0;
required_device<ata_interface_device> m_ata_1;
@@ -76,7 +78,9 @@ private:
int m_ide_1_interrupt;
};
+} } } // namespace bus::amiga::zorro
+
// device type definition
-DECLARE_DEVICE_TYPE(BUDDHA, buddha_device)
+DECLARE_DEVICE_TYPE_NS(ZORRO_BUDDHA, bus::amiga::zorro, buddha_device)
#endif // MAME_BUS_AMIGA_ZORRO_BUDDHA_H
diff --git a/src/devices/bus/amiga/zorro/cards.cpp b/src/devices/bus/amiga/zorro/cards.cpp
index 396069b537f..27b5e6afd6b 100644
--- a/src/devices/bus/amiga/zorro/cards.cpp
+++ b/src/devices/bus/amiga/zorro/cards.cpp
@@ -24,35 +24,35 @@ void a1000_expansion_cards(device_slot_interface &device)
void a500_expansion_cards(device_slot_interface &device)
{
- device.option_add("ar1", ACTION_REPLAY_MK1);
- device.option_add("ar2", ACTION_REPLAY_MK2);
- device.option_add("ar3", ACTION_REPLAY_MK3);
- device.option_add("a590", A590);
+ device.option_add("ar1", ZORRO_ACTION_REPLAY_MK1);
+ device.option_add("ar2", ZORRO_ACTION_REPLAY_MK2);
+ device.option_add("ar3", ZORRO_ACTION_REPLAY_MK3);
+ device.option_add("a590", ZORRO_A590);
}
void a2000_expansion_cards(device_slot_interface &device)
{
- device.option_add("ar1", ACTION_REPLAY_MK1);
- device.option_add("ar2", ACTION_REPLAY_MK2);
- device.option_add("ar3", ACTION_REPLAY_MK3);
+ device.option_add("ar1", ZORRO_ACTION_REPLAY_MK1);
+ device.option_add("ar2", ZORRO_ACTION_REPLAY_MK2);
+ device.option_add("ar3", ZORRO_ACTION_REPLAY_MK3);
}
void zorro2_cards(device_slot_interface &device)
{
- device.option_add("a2052", A2052);
- device.option_add("a2058", A2058);
- device.option_add("a2065", A2065);
- device.option_add("a2091", A2091);
- device.option_add("a2232", A2232);
- device.option_add("buddha", BUDDHA);
+ device.option_add("a2052", ZORRO_A2052);
+ device.option_add("a2058", ZORRO_A2058);
+ device.option_add("a2065", ZORRO_A2065);
+ device.option_add("a2091", ZORRO_A2091);
+ device.option_add("a2232", ZORRO_A2232);
+ device.option_add("buddha", ZORRO_BUDDHA);
}
void zorro3_cards(device_slot_interface &device)
{
- device.option_add("a2052", A2052);
- device.option_add("a2058", A2058);
- device.option_add("a2065", A2065);
- device.option_add("a2091", A2091);
- device.option_add("a2232", A2232);
- device.option_add("buddha", BUDDHA);
+ device.option_add("a2052", ZORRO_A2052);
+ device.option_add("a2058", ZORRO_A2058);
+ device.option_add("a2065", ZORRO_A2065);
+ device.option_add("a2091", ZORRO_A2091);
+ device.option_add("a2232", ZORRO_A2232);
+ device.option_add("buddha", ZORRO_BUDDHA);
}
diff --git a/src/devices/bus/amiga/zorro/cards.h b/src/devices/bus/amiga/zorro/cards.h
index 6daa99bf265..bcfaba5f8fd 100644
--- a/src/devices/bus/amiga/zorro/cards.h
+++ b/src/devices/bus/amiga/zorro/cards.h
@@ -27,11 +27,11 @@
#pragma once
-void a1000_expansion_cards(device_slot_interface &device);
-void a500_expansion_cards(device_slot_interface &device);
-void a2000_expansion_cards(device_slot_interface &device);
+void a1000_expansion_cards(device_slot_interface &device) ATTR_COLD;
+void a500_expansion_cards(device_slot_interface &device) ATTR_COLD;
+void a2000_expansion_cards(device_slot_interface &device) ATTR_COLD;
-void zorro2_cards(device_slot_interface &device);
-void zorro3_cards(device_slot_interface &device);
+void zorro2_cards(device_slot_interface &device) ATTR_COLD;
+void zorro3_cards(device_slot_interface &device) ATTR_COLD;
#endif // MAME_BUS_AMIGA_ZORRO_CARDS_H
diff --git a/src/devices/bus/amiga/zorro/zorro.cpp b/src/devices/bus/amiga/zorro/zorro.cpp
index e1c37ceee61..6bd8b280c86 100644
--- a/src/devices/bus/amiga/zorro/zorro.cpp
+++ b/src/devices/bus/amiga/zorro/zorro.cpp
@@ -40,10 +40,19 @@ zorro_slot_device::zorro_slot_device(const machine_config &mconfig, device_type
void zorro_slot_device::device_start()
{
- device_zorro_card_interface *dev = dynamic_cast<device_zorro_card_interface *>(get_card_device());
+ device_t *const card(get_card_device());
+ device_zorro_card_interface *const dev(dynamic_cast<device_zorro_card_interface *>(card));
if (dev)
- m_zorro_bus->add_card(dev);
+ {
+ m_zorro_bus->add_card(*dev);
+ }
+ else if (card)
+ {
+ throw emu_fatalerror(
+ "zorro slot '%s' card device %s (%s) does not implement device_zorro_card_interface\n",
+ tag(), card->tag(), card->name());
+ }
}
@@ -55,7 +64,7 @@ void zorro_slot_device::device_start()
// exp_slot_device - constructor
//-------------------------------------------------
-zorro_device::zorro_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+zorro_bus_device_base::zorro_bus_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
m_space(*this, finder_base::DUMMY_TAG, -1),
m_ovr_handler(*this),
@@ -70,7 +79,7 @@ zorro_device::zorro_device(const machine_config &mconfig, device_type type, cons
// initial conditions at start time
//-------------------------------------------------
-void zorro_device::device_resolve_objects()
+void zorro_bus_device_base::device_resolve_objects()
{
// resolve callbacks
m_ovr_handler.resolve_safe();
@@ -82,14 +91,14 @@ void zorro_device::device_resolve_objects()
// device_start - device-specific startup
//-------------------------------------------------
-void zorro_device::device_start()
+void zorro_bus_device_base::device_start()
{
}
// from slot device
-WRITE_LINE_MEMBER( zorro_device::ovr_w ) { m_ovr_handler(state); }
-WRITE_LINE_MEMBER( zorro_device::int2_w ) { m_int2_handler(state); }
-WRITE_LINE_MEMBER( zorro_device::int6_w ) { m_int6_handler(state); }
+WRITE_LINE_MEMBER( zorro_bus_device_base::ovr_w ) { m_ovr_handler(state); }
+WRITE_LINE_MEMBER( zorro_bus_device_base::int2_w ) { m_int2_handler(state); }
+WRITE_LINE_MEMBER( zorro_bus_device_base::int6_w ) { m_int6_handler(state); }
//**************************************************************************
@@ -103,14 +112,12 @@ DEFINE_DEVICE_TYPE(EXP_SLOT, exp_slot_device, "exp_slot", "86-pin expansion slot
//-------------------------------------------------
exp_slot_device::exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- zorro_device(mconfig, EXP_SLOT, tag, owner, clock),
- m_ipl_handler(*this),
- m_dev(nullptr)
+ exp_slot_device(mconfig, EXP_SLOT, tag, owner, clock)
{
}
exp_slot_device::exp_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- zorro_device(mconfig, type, tag, owner, clock),
+ zorro_bus_device_base(mconfig, type, tag, owner, clock),
m_ipl_handler(*this),
m_dev(nullptr)
{
@@ -124,11 +131,11 @@ exp_slot_device::exp_slot_device(const machine_config &mconfig, device_type type
void exp_slot_device::device_resolve_objects()
{
+ // call base device
+ zorro_bus_device_base::device_resolve_objects();
+
// resolve callbacks
m_ipl_handler.resolve_safe();
-
- // call base device
- zorro_device::device_resolve_objects();
}
//-------------------------------------------------
@@ -137,6 +144,9 @@ void exp_slot_device::device_resolve_objects()
void exp_slot_device::device_reset()
{
+ // call base device
+ zorro_bus_device_base::device_reset();
+
// if we have a device, start the autoconfig chain
if (m_dev)
m_dev->cfgin_w(0);
@@ -146,10 +156,16 @@ void exp_slot_device::device_reset()
// add_card - add new card to our bus
//-------------------------------------------------
-void exp_slot_device::add_card(device_zorro_card_interface *card)
+void exp_slot_device::add_card(device_zorro_card_interface &card)
{
- m_dev = downcast<device_exp_card_interface *>(card);
- card->set_zorro_bus(this);
+ m_dev = dynamic_cast<device_exp_card_interface *>(&card);
+ if (!m_dev)
+ {
+ throw emu_fatalerror(
+ "exp slot '%s' card device %s (%s) does not implement device_exp_card_interface\n",
+ tag(), card.device().tag(), card.device().name());
+ }
+ card.set_zorro_bus(*this);
}
// from slot device
@@ -163,19 +179,19 @@ void exp_slot_device::fc_w(int code) { if (m_dev) m_dev->fc_w(code); }
// ZORRO2 DEVICE
//**************************************************************************
-DEFINE_DEVICE_TYPE(ZORRO2, zorro2_device, "zorro2", "Zorro-II bus")
+DEFINE_DEVICE_TYPE(ZORRO2, zorro2_bus_device, "zorro2", "Zorro-II bus")
//-------------------------------------------------
-// zorro2_device - constructor
+// zorro2_bus_device - constructor
//-------------------------------------------------
-zorro2_device::zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- zorro2_device(mconfig, ZORRO2, tag, owner, clock)
+zorro2_bus_device::zorro2_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ zorro2_bus_device(mconfig, ZORRO2, tag, owner, clock)
{
}
-zorro2_device::zorro2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- zorro_device(mconfig, type, tag, owner, clock),
+zorro2_bus_device::zorro2_bus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ zorro_bus_device_base(mconfig, type, tag, owner, clock),
m_eint1_handler(*this),
m_eint4_handler(*this),
m_eint5_handler(*this),
@@ -185,10 +201,10 @@ zorro2_device::zorro2_device(const machine_config &mconfig, device_type type, co
}
//-------------------------------------------------
-// zorro2_device - destructor
+// zorro2_bus_device - destructor
//-------------------------------------------------
-zorro2_device::~zorro2_device()
+zorro2_bus_device::~zorro2_bus_device()
{
m_dev.detach_all();
}
@@ -199,24 +215,27 @@ zorro2_device::~zorro2_device()
// initial conditions at start time
//-------------------------------------------------
-void zorro2_device::device_resolve_objects()
+void zorro2_bus_device::device_resolve_objects()
{
+ // call base device
+ zorro_bus_device_base::device_resolve_objects();
+
// resolve callbacks
m_eint1_handler.resolve_safe();
m_eint4_handler.resolve_safe();
m_eint5_handler.resolve_safe();
m_eint7_handler.resolve_safe();
-
- // call base device
- zorro_device::device_resolve_objects();
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
-void zorro2_device::device_reset()
+void zorro2_bus_device::device_reset()
{
+ // call base device
+ zorro_bus_device_base::device_reset();
+
// initiate autoconfig
m_autoconfig_device = m_dev.first();
@@ -229,20 +248,26 @@ void zorro2_device::device_reset()
// add_card - add new card to our bus
//-------------------------------------------------
-void zorro2_device::add_card(device_zorro_card_interface *card)
+void zorro2_bus_device::add_card(device_zorro_card_interface &card)
{
- device_zorro2_card_interface *zorro2_card = downcast<device_zorro2_card_interface *>(card);
- card->set_zorro_bus(this);
+ device_zorro2_card_interface *const zorro2_card(dynamic_cast<device_zorro2_card_interface *>(&card));
+ if (!zorro2_card)
+ {
+ throw emu_fatalerror(
+ "zorro2 slot '%s' card device %s (%s) does not implement device_zorro2_card_interface\n",
+ tag(), card.device().tag(), card.device().name());
+ }
+ card.set_zorro_bus(*this);
m_dev.append(*zorro2_card);
}
// from slot device
-WRITE_LINE_MEMBER( zorro2_device::eint1_w ) { m_eint1_handler(state); }
-WRITE_LINE_MEMBER( zorro2_device::eint4_w ) { m_eint4_handler(state); }
-WRITE_LINE_MEMBER( zorro2_device::eint5_w ) { m_eint5_handler(state); }
-WRITE_LINE_MEMBER( zorro2_device::eint7_w ) { m_eint7_handler(state); }
+WRITE_LINE_MEMBER( zorro2_bus_device::eint1_w ) { m_eint1_handler(state); }
+WRITE_LINE_MEMBER( zorro2_bus_device::eint4_w ) { m_eint4_handler(state); }
+WRITE_LINE_MEMBER( zorro2_bus_device::eint5_w ) { m_eint5_handler(state); }
+WRITE_LINE_MEMBER( zorro2_bus_device::eint7_w ) { m_eint7_handler(state); }
-WRITE_LINE_MEMBER( zorro2_device::cfgout_w )
+WRITE_LINE_MEMBER( zorro2_bus_device::cfgout_w )
{
m_autoconfig_device = m_autoconfig_device->next();
@@ -252,7 +277,7 @@ WRITE_LINE_MEMBER( zorro2_device::cfgout_w )
}
// from host
-void zorro2_device::fc_w(int code)
+void zorro2_bus_device::fc_w(int code)
{
device_zorro2_card_interface *entry = m_dev.first();
@@ -286,9 +311,10 @@ device_zorro_card_interface::~device_zorro_card_interface()
{
}
-void device_zorro_card_interface::set_zorro_bus(zorro_device *device)
+void device_zorro_card_interface::set_zorro_bus(zorro_bus_device_base &device)
{
- m_zorro = device;
+ assert(!m_zorro);
+ m_zorro = &device;
}
void device_zorro_card_interface::fc_w(int code)
@@ -322,9 +348,20 @@ device_exp_card_interface::~device_exp_card_interface()
{
}
-void device_exp_card_interface::set_zorro_device()
+void device_exp_card_interface::interface_pre_start()
{
+ device_zorro_card_interface::interface_pre_start();
+
+ if (!m_zorro)
+ throw device_missing_dependencies();
+
m_slot = dynamic_cast<exp_slot_device *>(m_zorro);
+ if (!m_slot)
+ {
+ throw emu_fatalerror(
+ "exp card '%s' zorro device %s (%s) does not derive from exp_slot_device\n",
+ device().tag(), m_zorro->tag(), m_zorro->name());
+ }
}
@@ -351,7 +388,18 @@ device_zorro2_card_interface::~device_zorro2_card_interface()
{
}
-void device_zorro2_card_interface::set_zorro_device()
+void device_zorro2_card_interface::interface_pre_start()
{
- m_slot = dynamic_cast<zorro2_device *>(m_zorro);
+ device_zorro_card_interface::interface_pre_start();
+
+ if (!m_zorro)
+ throw device_missing_dependencies();
+
+ m_slot = dynamic_cast<zorro2_bus_device *>(m_zorro);
+ if (!m_slot)
+ {
+ throw emu_fatalerror(
+ "zorro2 card '%s' zorro device %s (%s) does not derive from zorro2_bus_device\n",
+ device().tag(), m_zorro->tag(), m_zorro->name());
+ }
}
diff --git a/src/devices/bus/amiga/zorro/zorro.h b/src/devices/bus/amiga/zorro/zorro.h
index bebe256ef2e..632a5de9f6a 100644
--- a/src/devices/bus/amiga/zorro/zorro.h
+++ b/src/devices/bus/amiga/zorro/zorro.h
@@ -83,7 +83,7 @@
Zorro-III
- The Zorro-III is a multiplexed Zorro-II bus with address- and
+ The Zorro-III is a multiplexed Zorro-II bus with address and
data phases. Signals changes as follows:
17 /CINH
@@ -152,7 +152,7 @@
class device_zorro_card_interface;
class device_exp_card_interface;
class device_zorro2_card_interface;
-class zorro_device;
+class zorro_bus_device_base;
// ======================> zorro slot device
@@ -179,10 +179,10 @@ protected:
zorro_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
// configuration
- required_device<zorro_device> m_zorro_bus;
+ required_device<zorro_bus_device_base> m_zorro_bus;
};
// device type definition
@@ -190,7 +190,7 @@ DECLARE_DEVICE_TYPE(ZORRO_SLOT, zorro_slot_device)
// ======================> base zorro bus device
-class zorro_device : public device_t
+class zorro_bus_device_base : public device_t
{
public:
// configuration helpers
@@ -200,10 +200,10 @@ public:
auto int6_handler() { return m_int6_handler.bind(); }
auto ovr_handler() { return m_ovr_handler.bind(); }
- virtual void add_card(device_zorro_card_interface *card) = 0;
+ virtual void add_card(device_zorro_card_interface &card) ATTR_COLD = 0;
// interface (from slot device)
- virtual DECLARE_WRITE_LINE_MEMBER( cfgout_w ) {};
+ virtual DECLARE_WRITE_LINE_MEMBER( cfgout_w ) { }
DECLARE_WRITE_LINE_MEMBER( int2_w );
DECLARE_WRITE_LINE_MEMBER( int6_w );
@@ -217,11 +217,11 @@ public:
protected:
// construction/destruction
- zorro_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ zorro_bus_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_resolve_objects() override;
- virtual void device_start() override;
+ virtual void device_resolve_objects() override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
private:
required_address_space m_space;
@@ -233,7 +233,7 @@ private:
// ======================> expansion slot device
-class exp_slot_device : public zorro_device
+class exp_slot_device : public zorro_bus_device_base
{
public:
// construction/destruction
@@ -242,7 +242,7 @@ public:
auto ipl_handler() { return m_ipl_handler.bind(); }
// the expansion slot can only have a single card
- virtual void add_card(device_zorro_card_interface *card) override;
+ virtual void add_card(device_zorro_card_interface &card) override ATTR_COLD;
// interface (from slot device)
void ipl_w(int interrupt);
@@ -254,7 +254,7 @@ protected:
exp_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_resolve_objects() override;
+ virtual void device_resolve_objects() override ATTR_COLD;
virtual void device_reset() override;
private:
@@ -268,12 +268,12 @@ DECLARE_DEVICE_TYPE(EXP_SLOT, exp_slot_device)
// ======================> zorro2 slot device
-class zorro2_device : public zorro_device
+class zorro2_bus_device : public zorro_bus_device_base
{
public:
// construction/destruction
- zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- ~zorro2_device();
+ zorro2_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ~zorro2_bus_device();
auto eint1_handler() { return m_eint1_handler.bind(); }
auto eint4_handler() { return m_eint4_handler.bind(); }
@@ -281,7 +281,7 @@ public:
auto eint7_handler() { return m_eint7_handler.bind(); }
// the zorro2 bus supports multiple cards
- virtual void add_card(device_zorro_card_interface *card) override;
+ virtual void add_card(device_zorro_card_interface &card) override ATTR_COLD;
// interface (from slot device)
virtual DECLARE_WRITE_LINE_MEMBER( cfgout_w ) override;
@@ -295,10 +295,10 @@ public:
virtual void fc_w(int code) override;
protected:
- zorro2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ zorro2_bus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_resolve_objects() override;
+ virtual void device_resolve_objects() override ATTR_COLD;
virtual void device_reset() override;
private:
@@ -314,7 +314,7 @@ private:
};
// device type definition
-DECLARE_DEVICE_TYPE(ZORRO2, zorro2_device)
+DECLARE_DEVICE_TYPE(ZORRO2, zorro2_bus_device)
// ======================> base zorro card interface
@@ -325,9 +325,7 @@ public:
// construction/destruction
virtual ~device_zorro_card_interface();
- virtual void set_zorro_device() = 0;
-
- void set_zorro_bus(zorro_device *device);
+ void set_zorro_bus(zorro_bus_device_base &device) ATTR_COLD;
// interface (from device)
void cfgout_w(int state) { m_zorro->cfgout_w(state); }
@@ -339,7 +337,7 @@ public:
protected:
device_zorro_card_interface(const machine_config &mconfig, device_t &device);
- zorro_device *m_zorro;
+ zorro_bus_device_base *m_zorro;
};
// ======================> expansion slot card interface
@@ -350,11 +348,11 @@ public:
// construction/destruction
virtual ~device_exp_card_interface();
- virtual void set_zorro_device() override;
-
protected:
device_exp_card_interface(const machine_config &mconfig, device_t &device);
+ virtual void interface_pre_start() override ATTR_COLD;
+
exp_slot_device *m_slot;
};
@@ -366,20 +364,19 @@ public:
// construction/destruction
virtual ~device_zorro2_card_interface();
- virtual void set_zorro_device() override;
-
device_zorro2_card_interface *next() const { return m_next; }
device_zorro2_card_interface *m_next;
protected:
device_zorro2_card_interface(const machine_config &mconfig, device_t &device);
- zorro2_device *m_slot;
+ virtual void interface_pre_start() override ATTR_COLD;
+
+ zorro2_bus_device *m_slot;
};
-// include this here so that you don't need to include it into every
-// driver that uses zorro slots
+// include this here so that you don't need to include it into every driver that uses zorro slots
#include "cards.h"
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index bc920cd8d0b..0b23a01c561 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -228,7 +228,9 @@ void menu::exit(running_machine &machine)
//-------------------------------------------------
menu::menu(mame_ui_manager &mui, render_container &container)
- : m_visible_lines(0)
+ : m_selected(0)
+ , m_items()
+ , m_visible_lines(0)
, m_visible_items(0)
, m_global_state(get_global_state(mui.machine()))
, m_special_main_menu(false)
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index 978f624c91a..f8aed0bf07c 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -33,7 +33,6 @@
//**************************************************************************
#define EXP_SLOT_TAG "exp"
-#define ZORROBUS_TAG "zorrobus"
//**************************************************************************
@@ -260,7 +259,7 @@ public:
a2000_state(const machine_config &mconfig, device_type type, const char *tag) :
amiga_state(mconfig, type, tag),
m_rtc(*this, "u65"),
- m_zorro(*this, ZORROBUS_TAG),
+ m_zorro(*this, "zorrobus"),
m_zorro2_int2(0),
m_zorro2_int6(0)
{ }
@@ -287,7 +286,7 @@ protected:
private:
// devices
required_device<msm6242_device> m_rtc;
- required_device<zorro2_device> m_zorro;
+ required_device<zorro2_bus_device> m_zorro;
// internal state
int m_zorro2_int2;