summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-12-09 19:40:25 +0100
committerGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-12-09 19:41:42 +0100
commit6fd96f5907a834990ce37d0073074c87467ab624 (patch) (github)
tree235a274d607f228573f72714bd2f0cb83c01d187
parent278fa097139f5aa311004e1cfd4d9e2c08ad77f2 (diff)
downloadmame-6fd96f5907a834990ce37d0073074c87467ab624.tar.bz2
mame-6fd96f5907a834990ce37d0073074c87467ab624.zip
-sh2, sh4, sat_ctrl: Removed MCFG, nw
-ticket: Added separate hopper_device, nw -aristmk6, atvtrack, cps3, cv1k, hikaru, saturn, sh4robot, stv: Removed MACHINE_CONFIG, nw -sat_ctrl/multitap, segatap: Refactored to use required_devicee_array, removed MACHINE_CONFIG, simplified code, nw -mega32x: Removed code duplication, eliminated MACHINE_CONFIG, nw -vegaeo: Removed machine().device, nw
-rw-r--r--src/devices/bus/sat_ctrl/ctrl.h23
-rw-r--r--src/devices/bus/sat_ctrl/multitap.cpp86
-rw-r--r--src/devices/bus/sat_ctrl/multitap.h7
-rw-r--r--src/devices/bus/sat_ctrl/segatap.cpp66
-rw-r--r--src/devices/bus/sat_ctrl/segatap.h5
-rw-r--r--src/devices/cpu/sh/sh2.h33
-rw-r--r--src/devices/cpu/sh/sh4.cpp11
-rw-r--r--src/devices/cpu/sh/sh4.h59
-rw-r--r--src/devices/cpu/sh/sh4comn.cpp42
-rw-r--r--src/devices/machine/ticket.cpp34
-rw-r--r--src/devices/machine/ticket.h19
-rw-r--r--src/mame/drivers/aristmk6.cpp62
-rw-r--r--src/mame/drivers/atvtrack.cpp90
-rw-r--r--src/mame/drivers/cps3.cpp67
-rw-r--r--src/mame/drivers/cv1k.cpp95
-rw-r--r--src/mame/drivers/dccons.cpp26
-rw-r--r--src/mame/drivers/hikaru.cpp80
-rw-r--r--src/mame/drivers/naomi.cpp22
-rw-r--r--src/mame/drivers/saturn.cpp47
-rw-r--r--src/mame/drivers/sh4robot.cpp36
-rw-r--r--src/mame/drivers/stv.cpp116
-rw-r--r--src/mame/drivers/vegaeo.cpp2
-rw-r--r--src/mame/drivers/y2.cpp22
-rw-r--r--src/mame/includes/eolith.h4
-rw-r--r--src/mame/machine/mega32x.cpp80
-rw-r--r--src/mame/machine/mega32x.h1
26 files changed, 503 insertions, 632 deletions
diff --git a/src/devices/bus/sat_ctrl/ctrl.h b/src/devices/bus/sat_ctrl/ctrl.h
index 913664777c2..6e18936f782 100644
--- a/src/devices/bus/sat_ctrl/ctrl.h
+++ b/src/devices/bus/sat_ctrl/ctrl.h
@@ -46,7 +46,17 @@ class saturn_control_port_device : public device_t,
{
public:
// construction/destruction
- saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, char const* dflt)
+ : saturn_control_port_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~saturn_control_port_device();
uint16_t read_direct();
@@ -61,20 +71,9 @@ protected:
device_saturn_control_port_interface *m_device;
};
-
// device type definition
DECLARE_DEVICE_TYPE(SATURN_CONTROL_PORT, saturn_control_port_device)
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SATURN_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SATURN_CONTROL_PORT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-
void saturn_controls(device_slot_interface &device);
void saturn_joys(device_slot_interface &device);
diff --git a/src/devices/bus/sat_ctrl/multitap.cpp b/src/devices/bus/sat_ctrl/multitap.cpp
index 393fbc01b32..76fd4c3094a 100644
--- a/src/devices/bus/sat_ctrl/multitap.cpp
+++ b/src/devices/bus/sat_ctrl/multitap.cpp
@@ -26,15 +26,10 @@ DEFINE_DEVICE_TYPE(SATURN_MULTITAP, saturn_multitap_device, "saturn_multitap", "
// saturn_multitap_device - constructor
//-------------------------------------------------
-saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, SATURN_MULTITAP, tag, owner, clock),
- device_saturn_control_port_interface(mconfig, *this),
- m_subctrl1_port(*this, "ctrl1"),
- m_subctrl2_port(*this, "ctrl2"),
- m_subctrl3_port(*this, "ctrl3"),
- m_subctrl4_port(*this, "ctrl4"),
- m_subctrl5_port(*this, "ctrl5"),
- m_subctrl6_port(*this, "ctrl6")
+saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, SATURN_MULTITAP, tag, owner, clock)
+ , device_saturn_control_port_interface(mconfig, *this)
+ , m_subctrl_port(*this, "ctrl%u", 1U)
{
}
@@ -45,12 +40,8 @@ saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, co
void saturn_multitap_device::device_start()
{
- m_subctrl1_port->device_start();
- m_subctrl2_port->device_start();
- m_subctrl3_port->device_start();
- m_subctrl4_port->device_start();
- m_subctrl5_port->device_start();
- m_subctrl6_port->device_start();
+ for (int i = 0; i < 6; i++)
+ m_subctrl_port[i]->device_start();
}
//-------------------------------------------------
@@ -67,36 +58,7 @@ void saturn_multitap_device::device_reset()
uint8_t saturn_multitap_device::read_ctrl(uint8_t offset)
{
- uint8_t res = 0;
- switch (offset)
- {
- default:
- case 0:
- case 1:
- res = m_subctrl1_port->read_ctrl(offset & 1);
- break;
- case 2:
- case 3:
- res = m_subctrl2_port->read_ctrl(offset & 1);
- break;
- case 4:
- case 5:
- res = m_subctrl3_port->read_ctrl(offset & 1);
- break;
- case 6:
- case 7:
- res = m_subctrl4_port->read_ctrl(offset & 1);
- break;
- case 8:
- case 9:
- res = m_subctrl5_port->read_ctrl(offset & 1);
- break;
- case 10:
- case 11:
- res = m_subctrl6_port->read_ctrl(offset & 1);
- break;
- }
- return res;
+ return m_subctrl_port[offset < 12 ? (offset >> 1) : 0]->read_ctrl(offset & 1);
}
//-------------------------------------------------
@@ -105,30 +67,16 @@ uint8_t saturn_multitap_device::read_ctrl(uint8_t offset)
uint8_t saturn_multitap_device::read_id(int idx)
{
- switch (idx)
- {
- case 0:
- default:
- return m_subctrl1_port->read_id(0);
- case 1:
- return m_subctrl2_port->read_id(0);
- case 2:
- return m_subctrl3_port->read_id(0);
- case 3:
- return m_subctrl4_port->read_id(0);
- case 4:
- return m_subctrl5_port->read_id(0);
- case 5:
- return m_subctrl6_port->read_id(0);
- }
+ return m_subctrl_port[idx < 6 ? idx : 0]->read_id(0);
}
-MACHINE_CONFIG_START(saturn_multitap_device::device_add_mconfig)
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl1", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl2", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl3", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl4", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl5", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl6", saturn_joys, "joypad")
-MACHINE_CONFIG_END
+void saturn_multitap_device::device_add_mconfig(machine_config &config)
+{
+ SATURN_CONTROL_PORT(config, m_subctrl_port[0], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[1], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[2], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[3], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[4], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[5], saturn_joys, "joypad");
+}
diff --git a/src/devices/bus/sat_ctrl/multitap.h b/src/devices/bus/sat_ctrl/multitap.h
index 209a1a7322d..c90b559d96c 100644
--- a/src/devices/bus/sat_ctrl/multitap.h
+++ b/src/devices/bus/sat_ctrl/multitap.h
@@ -43,12 +43,7 @@ protected:
virtual uint8_t read_id(int idx) override;
private:
- required_device<saturn_control_port_device> m_subctrl1_port;
- required_device<saturn_control_port_device> m_subctrl2_port;
- required_device<saturn_control_port_device> m_subctrl3_port;
- required_device<saturn_control_port_device> m_subctrl4_port;
- required_device<saturn_control_port_device> m_subctrl5_port;
- required_device<saturn_control_port_device> m_subctrl6_port;
+ required_device_array<saturn_control_port_device, 6> m_subctrl_port;
};
diff --git a/src/devices/bus/sat_ctrl/segatap.cpp b/src/devices/bus/sat_ctrl/segatap.cpp
index 4aa22d37584..e36400125fe 100644
--- a/src/devices/bus/sat_ctrl/segatap.cpp
+++ b/src/devices/bus/sat_ctrl/segatap.cpp
@@ -26,13 +26,10 @@ DEFINE_DEVICE_TYPE(SATURN_SEGATAP, saturn_segatap_device, "saturn_segatap", "sat
// saturn_segatap_device - constructor
//-------------------------------------------------
-saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, SATURN_SEGATAP, tag, owner, clock),
- device_saturn_control_port_interface(mconfig, *this),
- m_subctrl1_port(*this, "ctrl1"),
- m_subctrl2_port(*this, "ctrl2"),
- m_subctrl3_port(*this, "ctrl3"),
- m_subctrl4_port(*this, "ctrl4")
+saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, SATURN_SEGATAP, tag, owner, clock)
+ , device_saturn_control_port_interface(mconfig, *this)
+ , m_subctrl_port(*this, "ctrl%u", 1U)
{
}
@@ -43,10 +40,8 @@ saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, cons
void saturn_segatap_device::device_start()
{
- m_subctrl1_port->device_start();
- m_subctrl2_port->device_start();
- m_subctrl3_port->device_start();
- m_subctrl4_port->device_start();
+ for (int i = 0; i < 4; i++)
+ m_subctrl_port[i]->device_start();
}
//-------------------------------------------------
@@ -63,28 +58,7 @@ void saturn_segatap_device::device_reset()
uint8_t saturn_segatap_device::read_ctrl(uint8_t offset)
{
- uint8_t res = 0;
- switch (offset)
- {
- default:
- case 0:
- case 1:
- res = m_subctrl1_port->read_ctrl(offset & 1);
- break;
- case 2:
- case 3:
- res = m_subctrl2_port->read_ctrl(offset & 1);
- break;
- case 4:
- case 5:
- res = m_subctrl3_port->read_ctrl(offset & 1);
- break;
- case 6:
- case 7:
- res = m_subctrl4_port->read_ctrl(offset & 1);
- break;
- }
- return res;
+ return m_subctrl_port[offset < 8 ? (offset >> 1) : 0]->read_ctrl(offset & 1);
}
//-------------------------------------------------
@@ -93,24 +67,14 @@ uint8_t saturn_segatap_device::read_ctrl(uint8_t offset)
uint8_t saturn_segatap_device::read_id(int idx)
{
- switch (idx)
- {
- case 0:
- default:
- return m_subctrl1_port->read_id(0);
- case 1:
- return m_subctrl2_port->read_id(0);
- case 2:
- return m_subctrl3_port->read_id(0);
- case 3:
- return m_subctrl4_port->read_id(0);
- }
+ return m_subctrl_port[idx < 4 ? idx : 0]->read_id(0);
}
-MACHINE_CONFIG_START(saturn_segatap_device::device_add_mconfig)
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl1", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl2", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl3", saturn_joys, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl4", saturn_joys, "joypad")
-MACHINE_CONFIG_END
+void saturn_segatap_device::device_add_mconfig(machine_config &config)
+{
+ SATURN_CONTROL_PORT(config, m_subctrl_port[0], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[1], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[2], saturn_joys, "joypad");
+ SATURN_CONTROL_PORT(config, m_subctrl_port[3], saturn_joys, "joypad");
+}
diff --git a/src/devices/bus/sat_ctrl/segatap.h b/src/devices/bus/sat_ctrl/segatap.h
index 61580ba671d..987699e0a5a 100644
--- a/src/devices/bus/sat_ctrl/segatap.h
+++ b/src/devices/bus/sat_ctrl/segatap.h
@@ -43,10 +43,7 @@ protected:
virtual uint8_t read_id(int idx) override;
private:
- required_device<saturn_control_port_device> m_subctrl1_port;
- required_device<saturn_control_port_device> m_subctrl2_port;
- required_device<saturn_control_port_device> m_subctrl3_port;
- required_device<saturn_control_port_device> m_subctrl4_port;
+ required_device_array<saturn_control_port_device, 4> m_subctrl_port;
};
diff --git a/src/devices/cpu/sh/sh2.h b/src/devices/cpu/sh/sh2.h
index 2fd53b05e93..206cecbab6d 100644
--- a/src/devices/cpu/sh/sh2.h
+++ b/src/devices/cpu/sh/sh2.h
@@ -40,24 +40,9 @@
#define SH2_INT_ABUS 16
#define SH2_DMA_KLUDGE_CB(name) int name(uint32_t src, uint32_t dst, uint32_t data, int size)
-
#define SH2_DMA_FIFO_DATA_AVAILABLE_CB(name) int name(uint32_t src, uint32_t dst, uint32_t data, int size)
-
#define SH2_FTCSR_READ_CB(name) void name(uint32_t data)
-#define MCFG_SH2_IS_SLAVE(_slave) \
- downcast<sh2_device &>(*device).set_is_slave(_slave);
-
-#define MCFG_SH2_DMA_KLUDGE_CB(_class, _method) \
- downcast<sh2_device &>(*device).set_dma_kludge_callback(sh2_device::dma_kludge_delegate(&_class::_method, #_class "::" #_method, this));
-
-#define MCFG_SH2_FIFO_DATA_AVAIL_CB(_class, _method) \
- downcast<sh2_device &>(*device).set_dma_fifo_data_available_callback(sh2_device::dma_fifo_data_available_delegate(&_class::_method, #_class "::" #_method, this));
-
-#define MCFG_SH2_FTCSR_READ_CB(_class, _method) \
- downcast<sh2_device &>(*device).set_ftcsr_read_callback(sh2_device::ftcsr_read_delegate(&_class::_method, #_class "::" #_method, this));
-
-
class sh2_frontend;
class sh2_device : public sh_common_execution
@@ -74,9 +59,27 @@ public:
virtual ~sh2_device() override;
void set_is_slave(int slave) { m_is_slave = slave; }
+
template <typename Object> void set_dma_kludge_callback(Object &&cb) { m_dma_kludge_cb = std::forward<Object>(cb); }
+ template <class FunctionClass> void set_dma_kludge_callback(
+ int (FunctionClass::*callback)(uint32_t, uint32_t, uint32_t, int), const char *name)
+ {
+ set_dma_kludge_callback(dma_kludge_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+
template <typename Object> void set_dma_fifo_data_available_callback(Object &&cb) { m_dma_fifo_data_available_cb = std::forward<Object>(cb); }
+ template <class FunctionClass> void set_dma_fifo_data_available_callback(
+ int (FunctionClass::*callback)(uint32_t, uint32_t, uint32_t, int), const char *name)
+ {
+ set_dma_fifo_data_available_callback(dma_fifo_data_available_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+
template <typename Object> void set_ftcsr_read_callback(Object &&cb) { m_ftcsr_read_cb = std::forward<Object>(cb); }
+ template <class FunctionClass> void set_ftcsr_read_callback(void (FunctionClass::*callback)(uint32_t), const char *name)
+ {
+ set_ftcsr_read_callback(ftcsr_read_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+
DECLARE_WRITE32_MEMBER( sh7604_w );
DECLARE_READ32_MEMBER( sh7604_r );
diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp
index 81fc35740bf..47ed74df421 100644
--- a/src/devices/cpu/sh/sh4.cpp
+++ b/src/devices/cpu/sh/sh4.cpp
@@ -76,16 +76,7 @@ sh34_base_device::sh34_base_device(const machine_config &mconfig, device_type ty
: sh_common_execution(mconfig, type, tag, owner, clock, endianness, internal)
, m_program_config("program", endianness, 64, 32, 0, internal)
, m_io_config("io", endianness, 64, 8)
- , c_md2(0)
- , c_md1(0)
- , c_md0(0)
- , c_md6(0)
- , c_md4(0)
- , c_md3(0)
- , c_md5(0)
- , c_md7(0)
- , c_md8(0)
- , c_clock(0)
+ , m_clock(0)
, m_mmuhack(1)
, m_bigendian(endianness == ENDIANNESS_BIG)
{
diff --git a/src/devices/cpu/sh/sh4.h b/src/devices/cpu/sh/sh4.h
index eb84a9128f9..df11767d95d 100644
--- a/src/devices/cpu/sh/sh4.h
+++ b/src/devices/cpu/sh/sh4.h
@@ -155,41 +155,6 @@ struct sh4_utlb
typedef void (*sh4_ftcsr_callback)(uint32_t);
-
-#define MCFG_SH4_MD0(_md0) \
- downcast<sh34_base_device &>(*device).set_md0(_md0);
-
-#define MCFG_SH4_MD1(_md1) \
- downcast<sh34_base_device &>(*device).set_md1(_md1);
-
-#define MCFG_SH4_MD2(_md2) \
- downcast<sh34_base_device &>(*device).set_md2(_md2);
-
-#define MCFG_SH4_MD3(_md3) \
- downcast<sh34_base_device &>(*device).set_md3(_md3);
-
-#define MCFG_SH4_MD4(_md4) \
- downcast<sh34_base_device &>(*device).set_md4(_md4);
-
-#define MCFG_SH4_MD5(_md5) \
- downcast<sh34_base_device &>(*device).set_md5(_md5);
-
-#define MCFG_SH4_MD6(_md6) \
- downcast<sh34_base_device &>(*device).set_md6(_md6);
-
-#define MCFG_SH4_MD7(_md7) \
- downcast<sh34_base_device &>(*device).set_md7(_md7);
-
-#define MCFG_SH4_MD8(_md8) \
- downcast<sh34_base_device &>(*device).set_md8(_md8);
-
-#define MCFG_SH4_CLOCK(_clock) \
- downcast<sh34_base_device &>(*device).set_sh4_clock(_clock);
-
-
-#define MCFG_MMU_HACK_TYPE(_hacktype) \
- downcast<sh34_base_device &>(*device).set_mmu_hacktype(_hacktype);
-
class sh4_frontend;
class sh4be_frontend;
@@ -197,16 +162,8 @@ class sh34_base_device : public sh_common_execution
{
public:
- void set_md0(int md0) { c_md0 = md0; }
- void set_md1(int md0) { c_md1 = md0; }
- void set_md2(int md0) { c_md2 = md0; }
- void set_md3(int md0) { c_md3 = md0; }
- void set_md4(int md0) { c_md4 = md0; }
- void set_md5(int md0) { c_md5 = md0; }
- void set_md6(int md0) { c_md6 = md0; }
- void set_md7(int md0) { c_md7 = md0; }
- void set_md8(int md0) { c_md8 = md0; }
- void set_sh4_clock(int clock) { c_clock = clock; }
+ void set_md(int bit, int md) { m_md[bit] = md; }
+ void set_sh4_clock(int clock) { m_clock = clock; }
void set_sh4_clock(const XTAL &xtal) { set_sh4_clock(xtal.value()); }
void set_mmu_hacktype(int hacktype) { m_mmuhack = hacktype; }
@@ -328,16 +285,8 @@ protected:
uml::parameter m_fs_regmap[16];
uml::parameter m_fd_regmap[16];
- int c_md2;
- int c_md1;
- int c_md0;
- int c_md6;
- int c_md4;
- int c_md3;
- int c_md5;
- int c_md7;
- int c_md8;
- int c_clock;
+ int m_md[9];
+ int m_clock;
// hack 1 = Naomi hack, hack 2 = Work in Progress implementation
int m_mmuhack;
diff --git a/src/devices/cpu/sh/sh4comn.cpp b/src/devices/cpu/sh/sh4comn.cpp
index 7f4a77c4efa..8c3e8cbc82c 100644
--- a/src/devices/cpu/sh/sh4comn.cpp
+++ b/src/devices/cpu/sh/sh4comn.cpp
@@ -1218,42 +1218,42 @@ void sh34_base_device::execute_set_input(int irqline, int state) // set state of
void sh34_base_device::sh4_parse_configuration()
{
- if(c_clock > 0)
+ if(m_clock > 0)
{
- switch((c_md2 << 2) | (c_md1 << 1) | (c_md0))
+ switch((m_md[2] << 2) | (m_md[1] << 1) | (m_md[0]))
{
case 0:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 4;
- m_pm_clock = c_clock / 4;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 4;
+ m_pm_clock = m_clock / 4;
break;
case 1:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 6;
- m_pm_clock = c_clock / 6;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 6;
+ m_pm_clock = m_clock / 6;
break;
case 2:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 3;
- m_pm_clock = c_clock / 6;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 3;
+ m_pm_clock = m_clock / 6;
break;
case 3:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 3;
- m_pm_clock = c_clock / 6;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 3;
+ m_pm_clock = m_clock / 6;
break;
case 4:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 2;
- m_pm_clock = c_clock / 4;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 2;
+ m_pm_clock = m_clock / 4;
break;
case 5:
- m_cpu_clock = c_clock;
- m_bus_clock = c_clock / 2;
- m_pm_clock = c_clock / 4;
+ m_cpu_clock = m_clock;
+ m_bus_clock = m_clock / 2;
+ m_pm_clock = m_clock / 4;
break;
}
- m_is_slave = (~(c_md7)) & 1;
+ m_is_slave = (~(m_md[7])) & 1;
}
else
{
diff --git a/src/devices/machine/ticket.cpp b/src/devices/machine/ticket.cpp
index eecc76af978..f18faa45aab 100644
--- a/src/devices/machine/ticket.cpp
+++ b/src/devices/machine/ticket.cpp
@@ -27,6 +27,7 @@
// device type definition
DEFINE_DEVICE_TYPE(TICKET_DISPENSER, ticket_dispenser_device, "ticket_dispenser", "Ticket Dispenser")
+DEFINE_DEVICE_TYPE(HOPPER, hopper_device, "coin_hopper", "Coin Hopper")
@@ -38,22 +39,31 @@ DEFINE_DEVICE_TYPE(TICKET_DISPENSER, ticket_dispenser_device, "ticket_dispenser"
// ticket_dispenser_device - constructor
//-------------------------------------------------
+ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , m_motor_sense(TICKET_MOTOR_ACTIVE_LOW)
+ , m_status_sense(TICKET_STATUS_ACTIVE_LOW)
+ , m_period(attotime::from_msec(100))
+ , m_hopper_type(false)
+ , m_motoron(0)
+ , m_ticketdispensed(0)
+ , m_ticketnotdispensed(0)
+ , m_status(0)
+ , m_power(0)
+ , m_timer(nullptr)
+ , m_output(*this, "led2") // TODO: probably shouldn't be hardcoded
+{
+}
+
ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, TICKET_DISPENSER, tag, owner, clock),
- m_motor_sense(TICKET_MOTOR_ACTIVE_LOW),
- m_status_sense(TICKET_STATUS_ACTIVE_LOW),
- m_period(attotime::from_msec(100)),
- m_hopper_type(false),
- m_motoron(0),
- m_ticketdispensed(0),
- m_ticketnotdispensed(0),
- m_status(0),
- m_power(0),
- m_timer(nullptr),
- m_output(*this, "led2") // TODO: probably shouldn't be hardcoded
+ : ticket_dispenser_device(mconfig, TICKET_DISPENSER, tag, owner, clock)
{
}
+hopper_device::hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ticket_dispenser_device(mconfig, HOPPER, tag, owner, clock)
+{
+}
//-------------------------------------------------
// ~ticket_dispenser_device - destructor
diff --git a/src/devices/machine/ticket.h b/src/devices/machine/ticket.h
index 6157b6c27db..813e27b95c1 100644
--- a/src/devices/machine/ticket.h
+++ b/src/devices/machine/ticket.h
@@ -19,7 +19,7 @@
// device type definition
DECLARE_DEVICE_TYPE(TICKET_DISPENSER, ticket_dispenser_device)
-
+DECLARE_DEVICE_TYPE(HOPPER, hopper_device)
//**************************************************************************
@@ -60,7 +60,7 @@ class ticket_dispenser_device : public device_t
public:
// construction/destruction
ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense)
- : ticket_dispenser_device(mconfig, tag, owner, 0)
+ : ticket_dispenser_device(mconfig, tag, owner)
{
set_period(period);
set_senses(motor_sense, status_sense, false);
@@ -82,6 +82,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( motor_w );
protected:
+ ticket_dispenser_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0);
+
// device-level overrides
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
@@ -104,4 +106,17 @@ protected:
output_finder<> m_output;
};
+class hopper_device : public ticket_dispenser_device
+{
+public:
+ // construction/destruction
+ hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense)
+ : hopper_device(mconfig, tag, owner)
+ {
+ set_period(period);
+ set_senses(motor_sense, status_sense, true);
+ }
+ hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
#endif // MAME_MACHINE_TICKET_H
diff --git a/src/mame/drivers/aristmk6.cpp b/src/mame/drivers/aristmk6.cpp
index 9af3ce62959..e587ef0067a 100644
--- a/src/mame/drivers/aristmk6.cpp
+++ b/src/mame/drivers/aristmk6.cpp
@@ -73,7 +73,7 @@ private:
u8 irl3pend0, irl3en0;
u8 irl3pend1, irl3en1;
- required_device<cpu_device> m_maincpu;
+ required_device<sh4_device> m_maincpu;
required_device<ns16550_device> m_uart0;
required_device<ns16550_device> m_uart1;
required_device<eeprom_serial_93cxx_device> m_eeprom0;
@@ -331,41 +331,41 @@ INPUT_PORTS_END
static constexpr XTAL ARISTMK6_CPU_CLOCK = 200_MHz_XTAL;
// ?
-MACHINE_CONFIG_START(aristmk6_state::aristmk6)
+void aristmk6_state::aristmk6(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, ARISTMK6_CPU_CLOCK)
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(0)
- MCFG_SH4_MD2(1)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(ARISTMK6_CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(aristmk6_map)
- MCFG_DEVICE_IO_MAP(aristmk6_port)
- MCFG_MMU_HACK_TYPE(2)
- MCFG_CPU_FORCE_NO_DRC()
-// MCFG_DEVICE_DISABLE()
-
- MCFG_DEVICE_ADD( "uart0", NS16550, 8_MHz_XTAL )
- MCFG_DEVICE_ADD( "uart1", NS16550, 8_MHz_XTAL )
+ SH4LE(config, m_maincpu, ARISTMK6_CPU_CLOCK);
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 0);
+ m_maincpu->set_md(2, 1);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(ARISTMK6_CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &aristmk6_state::aristmk6_map);
+ m_maincpu->set_addrmap(AS_IO, &aristmk6_state::aristmk6_port);
+ m_maincpu->set_mmu_hacktype(2);
+ m_maincpu->set_force_no_drc(true);
+// m_maincpu->set_disable();
+
+ NS16550(config, "uart0", 8_MHz_XTAL);
+ NS16550(config, "uart1", 8_MHz_XTAL);
EEPROM_93C56_16BIT(config, m_eeprom0).default_value(0xff);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(640, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_SCREEN_UPDATE_DRIVER(aristmk6_state, screen_update_aristmk6)
-
- MCFG_PALETTE_ADD("palette", 0x1000)
-
-MACHINE_CONFIG_END
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(640, 480);
+ screen.set_visarea(0, 640-1, 0, 480-1);
+ screen.set_screen_update(FUNC(aristmk6_state::screen_update_aristmk6));
+
+ PALETTE(config, m_palette, 0x1000);
+}
#define ROM_LOAD32_WORD_BIOS(bios, name, offset, length, hash) \
ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(2) | ROM_BIOS(bios))
diff --git a/src/mame/drivers/atvtrack.cpp b/src/mame/drivers/atvtrack.cpp
index 1cfe513a12d..337c3f1bbf8 100644
--- a/src/mame/drivers/atvtrack.cpp
+++ b/src/mame/drivers/atvtrack.cpp
@@ -571,56 +571,56 @@ INPUT_PORTS_END
#define ATV_CPU_CLOCK XTAL(33'000'000)*6
-MACHINE_CONFIG_START(atvtrack_state::atvtrack)
+void atvtrack_state::atvtrack(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, ATV_CPU_CLOCK)
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(1)
- MCFG_SH4_MD2(0)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(ATV_CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(atvtrack_main_map)
- MCFG_DEVICE_IO_MAP(atvtrack_main_port)
- MCFG_CPU_FORCE_NO_DRC()
-
- MCFG_DEVICE_ADD("subcpu", SH4LE, ATV_CPU_CLOCK)
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(1)
- MCFG_SH4_MD2(0)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(ATV_CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(atvtrack_sub_map)
- MCFG_DEVICE_IO_MAP(atvtrack_sub_port)
- MCFG_CPU_FORCE_NO_DRC()
+ SH4LE(config, m_maincpu, ATV_CPU_CLOCK);
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 1);
+ m_maincpu->set_md(2, 0);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(ATV_CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &atvtrack_state::atvtrack_main_map);
+ m_maincpu->set_addrmap(AS_IO, &atvtrack_state::atvtrack_main_port);
+ m_maincpu->set_force_no_drc(true);
+
+ SH4LE(config, m_subcpu, ATV_CPU_CLOCK);
+ m_subcpu->set_md(0, 1);
+ m_subcpu->set_md(1, 1);
+ m_subcpu->set_md(2, 0);
+ m_subcpu->set_md(3, 0);
+ m_subcpu->set_md(4, 0);
+ m_subcpu->set_md(5, 1);
+ m_subcpu->set_md(6, 0);
+ m_subcpu->set_md(7, 1);
+ m_subcpu->set_md(8, 0);
+ m_subcpu->set_sh4_clock(ATV_CPU_CLOCK);
+ m_subcpu->set_addrmap(AS_PROGRAM, &atvtrack_state::atvtrack_sub_map);
+ m_subcpu->set_addrmap(AS_IO, &atvtrack_state::atvtrack_sub_port);
+ m_subcpu->set_force_no_drc(true);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(640, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_SCREEN_UPDATE_DRIVER(atvtrack_state, screen_update_atvtrack)
-
- MCFG_PALETTE_ADD("palette", 0x1000)
-MACHINE_CONFIG_END
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(640, 480);
+ screen.set_visarea(0, 640-1, 0, 480-1);
+ screen.set_screen_update(FUNC(atvtrack_state::screen_update_atvtrack));
+
+ PALETTE(config, "palette", 0x1000);
+}
-MACHINE_CONFIG_START(smashdrv_state::smashdrv)
+void smashdrv_state::smashdrv(machine_config &config)
+{
atvtrack(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(smashdrv_main_map)
- MCFG_DEVICE_IO_MAP(smashdrv_main_port)
-
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &smashdrv_state::smashdrv_main_map);
+ m_maincpu->set_addrmap(AS_IO, &smashdrv_state::smashdrv_main_port);
+}
ROM_START( atvtrack )
diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp
index a18a7469f80..96117b50377 100644
--- a/src/mame/drivers/cps3.cpp
+++ b/src/mame/drivers/cps3.cpp
@@ -2493,25 +2493,26 @@ void cps3_state::simm6_128mbit(machine_config &config)
FUJITSU_29F016A(config, "simm6.7");
}
-MACHINE_CONFIG_START(cps3_state::cps3)
+void cps3_state::cps3(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH2, 6250000*4) // external clock is 6.25 Mhz, it sets the internal multiplier to 4x (this should probably be handled in the core..)
- MCFG_DEVICE_PROGRAM_MAP(cps3_map)
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cps3_state, cps3_vbl_interrupt)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(cps3_state, cps3_other_interrupt, 80) /* ?source? */
- MCFG_SH2_DMA_KLUDGE_CB(cps3_state, dma_callback)
+ SH2(config, m_maincpu, 6250000*4); // external clock is 6.25 Mhz, it sets the internal multiplier to 4x (this should probably be handled in the core..)
+ m_maincpu->set_addrmap(AS_PROGRAM, &cps3_state::cps3_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &cps3_state::decrypted_opcodes_map);
+ m_maincpu->set_vblank_int("screen", FUNC(cps3_state::cps3_vbl_interrupt));
+ m_maincpu->set_periodic_int(FUNC(cps3_state::cps3_other_interrupt), attotime::from_hz(80)); /* ?source? */
+ m_maincpu->set_dma_kludge_callback(FUNC(cps3_state::dma_callback));
- MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
- MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_1)
+ scsi_port_device &scsi(SCSI_PORT(config, "scsi"));
+ scsi.set_slot_device(1, "cdrom", SCSICD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_1));
wd33c93_device& wd33c93(WD33C93(config, "wd33c93"));
wd33c93.set_scsi_port("scsi");
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(XTAL(60'000'000)/8, 486, 0, 384, 259, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(cps3_state, screen_update_cps3)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_raw(XTAL(60'000'000)/8, 486, 0, 384, 259, 0, 224);
+ screen.set_screen_update(FUNC(cps3_state::screen_update_cps3));
/*
Measured clocks:
V = 59.5992Hz
@@ -2524,56 +2525,61 @@ MACHINE_CONFIG_START(cps3_state::cps3)
*/
NVRAM(config, "eeprom", nvram_device::DEFAULT_ALL_0);
- MCFG_PALETTE_ADD("palette", 0x10000) // actually 0x20000 ...
+ PALETTE(config, m_palette, 0x10000); // actually 0x20000 ...
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfxdecode_device::empty)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("cps3sound", CPS3, MASTER_CLOCK / 3)
- MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
-MACHINE_CONFIG_END
+ CPS3(config, m_cps3sound, MASTER_CLOCK / 3);
+ m_cps3sound->add_route(1, "lspeaker", 1.0);
+ m_cps3sound->add_route(0, "rspeaker", 1.0);
+}
/* individual configs for each machine, depending on the SIMMs installed */
-MACHINE_CONFIG_START(cps3_state::redearth)
+void cps3_state::redearth(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm3_128mbit(config);
simm4_128mbit(config);
simm5_32mbit(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cps3_state::sfiii)
+void cps3_state::sfiii(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm3_128mbit(config);
simm4_128mbit(config);
simm5_32mbit(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cps3_state::sfiii2)
+void cps3_state::sfiii2(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm2_64mbit(config);
simm3_128mbit(config);
simm4_128mbit(config);
simm5_128mbit(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cps3_state::jojo)
+void cps3_state::jojo(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm2_64mbit(config);
simm3_128mbit(config);
simm4_128mbit(config);
simm5_32mbit(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cps3_state::sfiii3)
+void cps3_state::sfiii3(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm2_64mbit(config);
@@ -2581,16 +2587,17 @@ MACHINE_CONFIG_START(cps3_state::sfiii3)
simm4_128mbit(config);
simm5_128mbit(config);
simm6_128mbit(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cps3_state::jojoba)
+void cps3_state::jojoba(machine_config &config)
+{
cps3(config);
simm1_64mbit(config);
simm2_64mbit(config);
simm3_128mbit(config);
simm4_128mbit(config);
simm5_128mbit(config);
-MACHINE_CONFIG_END
+}
/* CD sets - use CD BIOS roms */
diff --git a/src/mame/drivers/cv1k.cpp b/src/mame/drivers/cv1k.cpp
index 2b023d36e1f..1c0537d6bcc 100644
--- a/src/mame/drivers/cv1k.cpp
+++ b/src/mame/drivers/cv1k.cpp
@@ -457,69 +457,66 @@ void cv1k_state::machine_reset()
m_blitter->reset();
}
-MACHINE_CONFIG_START(cv1k_state::cv1k)
-
+void cv1k_state::cv1k(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH3BE, 12.8_MHz_XTAL*8) // 102.4MHz
- MCFG_SH4_MD0(0) // none of this is verified
- MCFG_SH4_MD1(0) // (the sh3 is different to the sh4 anyway, should be changed)
- MCFG_SH4_MD2(0)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(12.8_MHz_XTAL*8) // 102.4MHz
- MCFG_DEVICE_PROGRAM_MAP(cv1k_map)
- MCFG_DEVICE_IO_MAP(cv1k_port)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cv1k_state, irq2_line_hold)
+ SH3BE(config, m_maincpu, 12.8_MHz_XTAL*8); // 102.4MHz
+ m_maincpu->set_md(0, 0); // none of this is verified
+ m_maincpu->set_md(1, 0); // (the sh3 is different to the sh4 anyway, should be changed)
+ m_maincpu->set_md(2, 0);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(12.8_MHz_XTAL*8); // 102.4MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &cv1k_state::cv1k_map);
+ m_maincpu->set_addrmap(AS_IO, &cv1k_state::cv1k_port);
+ m_maincpu->set_vblank_int("screen", FUNC(cv1k_state::irq2_line_hold));
RTC9701(config, m_eeprom);
SERFLASH(config, m_serflash, 0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(0x200, 0x200)
- MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xf0-1)
- MCFG_SCREEN_UPDATE_DRIVER(cv1k_state, screen_update)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(0x200, 0x200);
+ screen.set_visarea(0, 0x140-1, 0, 0xf0-1);
+ screen.set_screen_update(FUNC(cv1k_state::screen_update));
- MCFG_PALETTE_ADD("palette", 0x10000)
+ PALETTE(config, "palette", 0x10000);
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymz770", YMZ770, 16.384_MHz_XTAL)
- MCFG_SOUND_ROUTE(1, "mono", 1.0) // only Right output used, Left is not connected
+ YMZ770(config, "ymz770", 16.384_MHz_XTAL).add_route(1, "mono", 1.0); // only Right output used, Left is not connected
- MCFG_EPIC12_ADD("blitter")
- MCFG_EPIC12_SET_MAINRAMSIZE(0x800000)
-MACHINE_CONFIG_END
+ EPIC12(config, m_blitter, 0);
+ m_blitter->set_mainramsize(0x800000);
+}
-MACHINE_CONFIG_START(cv1k_state::cv1k_d)
+void cv1k_state::cv1k_d(machine_config &config)
+{
cv1k(config);
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("maincpu")
-
- MCFG_DEVICE_ADD("maincpu", SH3BE, 12.8_MHz_XTAL*8) // 102.4MHz
- MCFG_SH4_MD0(0) // none of this is verified
- MCFG_SH4_MD1(0) // (the sh3 is different to the sh4 anyway, should be changed)
- MCFG_SH4_MD2(0)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(12.8_MHz_XTAL*8) // 102.4MHz
- MCFG_DEVICE_PROGRAM_MAP(cv1k_d_map)
- MCFG_DEVICE_IO_MAP(cv1k_port)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cv1k_state, irq2_line_hold)
-
- MCFG_DEVICE_MODIFY("blitter")
- MCFG_EPIC12_SET_MAINRAMSIZE(0x1000000)
-MACHINE_CONFIG_END
+ SH3BE(config.replace(), m_maincpu, 12.8_MHz_XTAL*8); // 102.4MHz
+ m_maincpu->set_md(0, 0); // none of this is verified
+ m_maincpu->set_md(1, 0); // (the sh3 is different to the sh4 anyway, should be changed)
+ m_maincpu->set_md(2, 0);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(12.8_MHz_XTAL*8); // 102.4MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &cv1k_state::cv1k_d_map);
+ m_maincpu->set_addrmap(AS_IO, &cv1k_state::cv1k_port);
+ m_maincpu->set_vblank_int("screen", FUNC(cv1k_state::irq2_line_hold));
+
+ m_blitter->set_mainramsize(0x1000000);
+}
diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp
index 4457cacf7d8..c9a6f7b7678 100644
--- a/src/mame/drivers/dccons.cpp
+++ b/src/mame/drivers/dccons.cpp
@@ -583,19 +583,19 @@ void dc_cons_state::gdrom_config(device_t *device)
MACHINE_CONFIG_START(dc_cons_state::dc)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, CPU_CLOCK)
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(0)
- MCFG_SH4_MD2(1)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(dc_map)
- MCFG_DEVICE_IO_MAP(dc_port)
+ SH4LE(config, m_maincpu, CPU_CLOCK);
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 0);
+ m_maincpu->set_md(2, 1);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &dc_cons_state::dc_map);
+ m_maincpu->set_addrmap(AS_IO, &dc_cons_state::dc_port);
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dc_state, dc_scanline, "screen", 0, 1)
diff --git a/src/mame/drivers/hikaru.cpp b/src/mame/drivers/hikaru.cpp
index 166fd2625aa..f7d455bfe1f 100644
--- a/src/mame/drivers/hikaru.cpp
+++ b/src/mame/drivers/hikaru.cpp
@@ -393,17 +393,23 @@ class hikaru_state : public driver_device
{
public:
hikaru_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu") { }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_slave(*this, "slave")
+ { }
void hikaru(machine_config &config);
private:
virtual void video_start() override;
- uint32_t screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
+
void hikaru_map(address_map &map);
void hikaru_map_slave(address_map &map);
+
+ uint32_t screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ required_device<sh4_device> m_maincpu;
+ required_device<sh4_device> m_slave;
};
void hikaru_state::video_start()
@@ -490,47 +496,43 @@ void hikaru_state::hikaru_map_slave(address_map &map)
}
-MACHINE_CONFIG_START(hikaru_state::hikaru)
+void hikaru_state::hikaru(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, CPU_CLOCK)
-// MCFG_SH4_MD0(1)
-// MCFG_SH4_MD1(0)
-// MCFG_SH4_MD2(1)
-// MCFG_SH4_MD3(0)
-// MCFG_SH4_MD4(0)
-// MCFG_SH4_MD5(1)
-// MCFG_SH4_MD6(0)
-// MCFG_SH4_MD7(1)
-// MCFG_SH4_MD8(0)
-// MCFG_SH4_CLOCK(CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(hikaru_map)
-// MCFG_DEVICE_IO_MAP(hikaru_port)
- MCFG_CPU_FORCE_NO_DRC()
-// MCFG_CPU_VBLANK_INT("screen", hikaru,vblank)
-
- MCFG_DEVICE_ADD("slave", SH4LE, CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(hikaru_map_slave)
- MCFG_CPU_FORCE_NO_DRC()
-
-
-// MCFG_MACHINE_START_OVERRIDE(hikaru_state, hikaru )
-// MCFG_MACHINE_RESET_OVERRIDE(hikaru_state, hikaru )
+ SH4LE(config, m_maincpu, CPU_CLOCK);
+// m_maincpu->set_md(0, 1);
+// m_maincpu->set_md(1, 0);
+// m_maincpu->set_md(2, 1);
+// m_maincpu->set_md(3, 0);
+// m_maincpu->set_md(4, 0);
+// m_maincpu->set_md(5, 1);
+// m_maincpu->set_md(6, 0);
+// m_maincpu->set_md(7, 1);
+// m_maincpu->set_md(8, 0);
+// m_maincpu->set_sh4_clock(CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &hikaru_state::hikaru_map);
+// m_maincpu->set_addrmap(AS_IO, &hikaru_state::hikaru_port);
+ m_maincpu->set_force_no_drc(true);
+// m_maincpu->set_vblank_int("screen", FUNC(hikaru_state::vblank));
+
+ SH4LE(config, m_slave, CPU_CLOCK);
+ m_slave->set_addrmap(AS_PROGRAM, &hikaru_state::hikaru_map_slave);
+ m_slave->set_force_no_drc(true);
// MCFG_NVRAM_HANDLER(hikaru_eeproms)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(640, 480)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_SCREEN_UPDATE_DRIVER(hikaru_state, screen_update_hikaru)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(640, 480);
+ screen.set_visarea(0, 640-1, 0, 480-1);
+ screen.set_screen_update(FUNC(hikaru_state::screen_update_hikaru));
- MCFG_PALETTE_ADD("palette", 0x1000)
+ PALETTE(config, "palette", 0x1000);
-
-// SPEAKER(config, "lspeaker").front_left();
-// SPEAKER(config, "rspeaker").front_right();
+// SPEAKER(config, "lspeaker").front_left();
+// SPEAKER(config, "rspeaker").front_right();
// MCFG_DEVICE_ADD("aica", AICA, (XTAL(33'868'800)*2)/3) // 67.7376MHz(2*33.8688MHz), div 3 for audio block // 33.8688MHz on Board
// MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
@@ -539,7 +541,7 @@ MACHINE_CONFIG_START(hikaru_state::hikaru)
// MCFG_DEVICE_ADD("aica_pcb", AICA, (XTAL(33'868'800)*2)/3) // AICA PCB
// MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
// MCFG_SOUND_ROUTE(1, "rspeaker", 2.0)
-MACHINE_CONFIG_END
+}
#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp
index 10a1b35d9f3..ce48e989269 100644
--- a/src/mame/drivers/naomi.cpp
+++ b/src/mame/drivers/naomi.cpp
@@ -2898,17 +2898,17 @@ MACHINE_RESET_MEMBER(naomi_state,naomi)
// TODO: merge with Dreamcast base machine
MACHINE_CONFIG_START(dc_state::naomi_aw_base)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, CPU_CLOCK) // SH4!!!
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(0)
- MCFG_SH4_MD2(1)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(CPU_CLOCK)
+ SH4LE(config, m_maincpu, CPU_CLOCK);
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 0);
+ m_maincpu->set_md(2, 1);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(CPU_CLOCK);
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dc_state, dc_scanline, "screen", 0, 1)
diff --git a/src/mame/drivers/saturn.cpp b/src/mame/drivers/saturn.cpp
index 5be32daecd8..4f6d0d3394d 100644
--- a/src/mame/drivers/saturn.cpp
+++ b/src/mame/drivers/saturn.cpp
@@ -790,21 +790,21 @@ uint8_t sat_console_state::smpc_direct_mode(uint16_t in_value,bool which)
return 0x80 | 0x10 | ((in_value >> shift_bit[hshake]) & 0xf);
}
-MACHINE_CONFIG_START(sat_console_state::saturn)
-
+void sat_console_state::saturn(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
- MCFG_DEVICE_PROGRAM_MAP(saturn_mem)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sat_console_state, saturn_scanline, "screen", 0, 1)
+ SH2(config, m_maincpu, MASTER_CLOCK_352/2); // 28.6364 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &sat_console_state::saturn_mem);
+ m_maincpu->set_is_slave(0);
+ TIMER(config, "scantimer").configure_scanline(FUNC(sat_console_state::saturn_scanline), "screen", 0, 1);
- MCFG_DEVICE_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
- MCFG_DEVICE_PROGRAM_MAP(saturn_mem)
- MCFG_SH2_IS_SLAVE(1)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", sat_console_state, saturn_slave_scanline, "screen", 0, 1)
+ SH2(config, m_slave, MASTER_CLOCK_352/2); // 28.6364 MHz
+ m_slave->set_addrmap(AS_PROGRAM, &sat_console_state::saturn_mem);
+ m_slave->set_is_slave(1);
+ TIMER(config, "slave_scantimer").configure_scanline(FUNC(sat_console_state::saturn_slave_scanline), "screen", 0, 1);
- MCFG_DEVICE_ADD("audiocpu", M68000, 11289600) //256 x 44100 Hz = 11.2896 MHz
- MCFG_DEVICE_PROGRAM_MAP(sound_mem)
+ M68000(config, m_audiocpu, 11289600); //256 x 44100 Hz = 11.2896 MHz
+ m_audiocpu->set_addrmap(AS_PROGRAM, &sat_console_state::sound_mem);
SEGA_SCU(config, m_scu, 0);
m_scu->set_hostcpu(m_maincpu);
@@ -834,12 +834,13 @@ MACHINE_CONFIG_START(sat_console_state::saturn)
NVRAM(config, "nvram").set_custom_handler(FUNC(sat_console_state::nvram_init));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_320/8, 427, 0, 320, 263, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(sat_console_state, screen_update_stv_vdp2)
- MCFG_PALETTE_ADD("palette", 2048+(2048*2))//standard palette + extra memory for rgb brightness.
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(MASTER_CLOCK_320/8, 427, 0, 320, 263, 0, 224);
+ m_screen->set_screen_update(FUNC(sat_console_state::screen_update_stv_vdp2));
+
+ PALETTE(config, m_palette, 2048+(2048*2)); //standard palette + extra memory for rgb brightness.
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_stv)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_stv);
MCFG_VIDEO_START_OVERRIDE(sat_console_state,stv_vdp2)
@@ -853,13 +854,13 @@ MACHINE_CONFIG_START(sat_console_state::saturn)
m_scsp->add_route(0, "lspeaker", 1.0);
m_scsp->add_route(1, "rspeaker", 1.0);
- MCFG_DEVICE_ADD("stvcd", STVCD, 0)
- MCFG_SOUND_ROUTE(0, "scsp", 1.0, 0)
- MCFG_SOUND_ROUTE(1, "scsp", 1.0, 1)
+ stvcd_device &stvcd(STVCD(config, "stvcd", 0));
+ stvcd.add_route(0, "scsp", 1.0, 0);
+ stvcd.add_route(1, "scsp", 1.0, 1);
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl1", saturn_controls, "joypad")
- MCFG_SATURN_CONTROL_PORT_ADD("ctrl2", saturn_controls, "joypad")
-MACHINE_CONFIG_END
+ SATURN_CONTROL_PORT(config, "ctrl1", saturn_controls, "joypad");
+ SATURN_CONTROL_PORT(config, "ctrl2", saturn_controls, "joypad");
+}
static void saturn_cart(device_slot_interface &device)
{
diff --git a/src/mame/drivers/sh4robot.cpp b/src/mame/drivers/sh4robot.cpp
index 66ff981bf09..e373b9885ce 100644
--- a/src/mame/drivers/sh4robot.cpp
+++ b/src/mame/drivers/sh4robot.cpp
@@ -47,7 +47,7 @@ private:
void io_map(address_map &map);
void mem_map(address_map &map);
- required_device<cpu_device> m_maincpu;
+ required_device<sh4_device> m_maincpu;
};
@@ -68,24 +68,24 @@ void sh4robot_state::io_map(address_map &map)
static INPUT_PORTS_START( sh4robot )
INPUT_PORTS_END
-MACHINE_CONFIG_START(sh4robot_state::sh4robot)
+void sh4robot_state::sh4robot(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH4LE, 200000000) // SH7750
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(0)
- MCFG_SH4_MD2(1)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(200000000)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
- MCFG_CPU_FORCE_NO_DRC()
-
-MACHINE_CONFIG_END
+ SH4LE(config, m_maincpu, 200000000); // SH7750
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 0);
+ m_maincpu->set_md(2, 1);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(200000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &sh4robot_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &sh4robot_state::io_map);
+ m_maincpu->set_force_no_drc(true);
+}
/* ROM definition */
ROM_START( sh4robot )
diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp
index 9a0b476484e..ffa8e3ded19 100644
--- a/src/mame/drivers/stv.cpp
+++ b/src/mame/drivers/stv.cpp
@@ -1122,21 +1122,21 @@ WRITE8_MEMBER( stv_state::pdr2_output_w )
}
-MACHINE_CONFIG_START(stv_state::stv)
-
+void stv_state::stv(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
- MCFG_DEVICE_PROGRAM_MAP(stv_mem)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", stv_state, saturn_scanline, "screen", 0, 1)
+ SH2(config, m_maincpu, MASTER_CLOCK_352/2); // 28.6364 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::stv_mem);
+ m_maincpu->set_is_slave(0);
+ TIMER(config, "scantimer").configure_scanline(FUNC(stv_state::saturn_scanline), "screen", 0, 1);
- MCFG_DEVICE_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
- MCFG_DEVICE_PROGRAM_MAP(stv_mem)
- MCFG_SH2_IS_SLAVE(1)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", stv_state, saturn_slave_scanline, "screen", 0, 1)
+ SH2(config, m_slave, MASTER_CLOCK_352/2); // 28.6364 MHz
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::stv_mem);
+ m_slave->set_is_slave(1);
+ TIMER(config, "slave_scantimer").configure_scanline(FUNC(stv_state::saturn_slave_scanline), "screen", 0, 1);
- MCFG_DEVICE_ADD("audiocpu", M68000, 11289600) //11.2896 MHz
- MCFG_DEVICE_PROGRAM_MAP(sound_mem)
+ M68000(config, m_audiocpu, 11289600); //11.2896 MHz
+ m_audiocpu->set_addrmap(AS_PROGRAM, &stv_state::sound_mem);
SEGA_SCU(config, m_scu, 0);
m_scu->set_hostcpu(m_maincpu);
@@ -1163,13 +1163,13 @@ MACHINE_CONFIG_START(stv_state::stv)
EEPROM_93C46_16BIT(config, "eeprom"); /* Actually AK93C45F */
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_320/8, 427, 0, 352, 263, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(stv_state, screen_update_stv_vdp2)
- MCFG_PALETTE_ADD("palette", 2048+(2048*2))//standard palette + extra memory for rgb brightness.
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK);
+ m_screen->set_raw(MASTER_CLOCK_320/8, 427, 0, 352, 263, 0, 224);
+ m_screen->set_screen_update(FUNC(stv_state::screen_update_stv_vdp2));
+ PALETTE(config, m_palette, 2048+(2048*2)); //standard palette + extra memory for rgb brightness.
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_stv)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_stv);
MCFG_VIDEO_START_OVERRIDE(stv_state,stv_vdp2)
@@ -1182,26 +1182,26 @@ MACHINE_CONFIG_START(stv_state::stv)
m_scsp->main_irq_cb().set(m_scu, FUNC(sega_scu_device::sound_req_w));
m_scsp->add_route(0, "lspeaker", 1.0);
m_scsp->add_route(1, "rspeaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(stv_state::stv_5881)
+void stv_state::stv_5881(machine_config &config)
+{
stv(config);
- MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0)
- MCFG_SET_READ_CALLBACK(stv_state, crypt_read_callback)
-MACHINE_CONFIG_END
+ SEGA315_5881_CRYPT(config, m_cryptdevice, 0);
+ m_cryptdevice->set_read_cb(FUNC(stv_state::crypt_read_callback));
+}
-MACHINE_CONFIG_START(stv_state::stvcd)
+void stv_state::stvcd(machine_config &config)
+{
stv(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(stvcd_mem)
- MCFG_DEVICE_MODIFY("slave")
- MCFG_DEVICE_PROGRAM_MAP(stvcd_mem)
+ m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::stvcd_mem);
+ m_slave->set_addrmap(AS_PROGRAM, &stv_state::stvcd_mem);
- MCFG_DEVICE_ADD("stvcd", STVCD, 0)
- MCFG_SOUND_ROUTE(0, "scsp", 1.0, 0)
- MCFG_SOUND_ROUTE(1, "scsp", 1.0, 1)
-MACHINE_CONFIG_END
+ stvcd_device &stvcd(STVCD(config, "stvcd", 0));
+ stvcd.add_route(0, "scsp", 1.0, 0);
+ stvcd.add_route(1, "scsp", 1.0, 1);
+}
void stv_state::sega5838_map(address_map &map)
@@ -1209,13 +1209,13 @@ void stv_state::sega5838_map(address_map &map)
map(0x000000, 0x7fffff).bankr("protbank");
}
-MACHINE_CONFIG_START(stv_state::stv_5838)
+void stv_state::stv_5838(machine_config &config)
+{
stv(config);
- MCFG_DEVICE_ADD("315_5838", SEGA315_5838_COMP, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, sega5838_map)
-
-MACHINE_CONFIG_END
+ SEGA315_5838_COMP(config, m_5838crypt, 0);
+ m_5838crypt->set_addrmap(0, stv_state::sega5838_map);
+}
/*
@@ -1233,35 +1233,37 @@ WRITE32_MEMBER( stv_state::batmanfr_sound_comms_w )
}
-MACHINE_CONFIG_START(stv_state::batmanfr)
+void stv_state::batmanfr(machine_config &config)
+{
stv(config);
- MCFG_DEVICE_ADD("rax", ACCLAIM_RAX, 0)
-MACHINE_CONFIG_END
-
-
-#define MCFG_STV_CARTSLOT_ADD(_tag, _load) \
- MCFG_GENERIC_CARTSLOT_ADD(_tag, generic_plain_slot, "stv_cart") \
- MCFG_GENERIC_LOAD(stv_state, _load)
+ ACCLAIM_RAX(config, "rax", 0);
+}
-MACHINE_CONFIG_START(stv_state::stv_cartslot)
+#define STV_CARTSLOT_ADD(_tag, _load) \
+ GENERIC_CARTSLOT(config, _tag, generic_plain_slot, "stv_cart") \
+ .set_device_load(device_image_load_delegate(&stv_state::device_image_load_##_load, this));
- MCFG_STV_CARTSLOT_ADD("stv_slot1", stv_cart1)
- MCFG_STV_CARTSLOT_ADD("stv_slot2", stv_cart2)
- MCFG_STV_CARTSLOT_ADD("stv_slot3", stv_cart3)
- MCFG_STV_CARTSLOT_ADD("stv_slot4", stv_cart4)
+void stv_state::stv_cartslot(machine_config &config)
+{
+ STV_CARTSLOT_ADD("stv_slot1", stv_cart1);
+ STV_CARTSLOT_ADD("stv_slot2", stv_cart2);
+ STV_CARTSLOT_ADD("stv_slot3", stv_cart3);
+ STV_CARTSLOT_ADD("stv_slot4", stv_cart4);
- MCFG_SOFTWARE_LIST_ADD("cart_list","stv")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cart_list").set_original("stv");
+}
-MACHINE_CONFIG_START(stv_state::stv_slot)
+void stv_state::stv_slot(machine_config &config)
+{
stv(config);
stv_cartslot(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(stv_state::hopper)
+void stv_state::hopper(machine_config &config)
+{
stv(config);
- MCFG_HOPPER_ADD("hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
-MACHINE_CONFIG_END
+ HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
+}
MACHINE_RESET_MEMBER(stv_state,stv)
{
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index 08bf2bc82a2..b735b6c1d2b 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -292,7 +292,7 @@ ROM_END
void vegaeo_state::init_vegaeo()
{
// Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM
- machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank");
+ m_qs1000->subdevice<i8052_device>("cpu")->space(AS_IO).install_read_bank(0x0100, 0xffff, "bank");
membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
init_speedup();
diff --git a/src/mame/drivers/y2.cpp b/src/mame/drivers/y2.cpp
index a5eafc7a80f..4050d8b4684 100644
--- a/src/mame/drivers/y2.cpp
+++ b/src/mame/drivers/y2.cpp
@@ -55,17 +55,17 @@ INPUT_PORTS_END
MACHINE_CONFIG_START(system_board_y2_state::system_board_y2)
/*
- MCFG_CPU_ADD("maincpu", SH4LE, 266666666)
- MCFG_SH4_MD0(1)
- MCFG_SH4_MD1(0)
- MCFG_SH4_MD2(1)
- MCFG_SH4_MD3(0)
- MCFG_SH4_MD4(0)
- MCFG_SH4_MD5(1)
- MCFG_SH4_MD6(0)
- MCFG_SH4_MD7(1)
- MCFG_SH4_MD8(0)
- MCFG_SH4_CLOCK(CPU_CLOCK)
+ SH4LE(config, m_maincpu, 266666666);
+ m_maincpu->set_md(0, 1);
+ m_maincpu->set_md(1, 0);
+ m_maincpu->set_md(2, 1);
+ m_maincpu->set_md(3, 0);
+ m_maincpu->set_md(4, 0);
+ m_maincpu->set_md(5, 1);
+ m_maincpu->set_md(6, 0);
+ m_maincpu->set_md(7, 1);
+ m_maincpu->set_md(8, 0);
+ m_maincpu->set_sh4_clock(CPU_CLOCK);
*/
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h
index 9a8f1f730b4..1b22c197376 100644
--- a/src/mame/includes/eolith.h
+++ b/src/mame/includes/eolith.h
@@ -12,12 +12,12 @@ class eolith_state : public driver_device
public:
eolith_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_qs1000(*this, "qs1000")
, m_eepromoutport(*this, "EEPROMOUT")
, m_maincpu(*this, "maincpu")
, m_soundcpu(*this, "soundcpu")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
- , m_qs1000(*this, "qs1000")
, m_in0(*this, "IN0")
, m_penxport(*this, "PEN_X_P%u", 1)
, m_penyport(*this, "PEN_Y_P%u", 1)
@@ -46,6 +46,7 @@ public:
protected:
+ optional_device<qs1000_device> m_qs1000;
optional_ioport m_eepromoutport;
TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup);
@@ -81,7 +82,6 @@ private:
optional_device<i8032_device> m_soundcpu;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- optional_device<qs1000_device> m_qs1000;
optional_ioport m_in0; // klondkp doesn't have it
optional_ioport_array<2> m_penxport;
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 435e8090c99..3ab57276e1d 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -1760,67 +1760,57 @@ const rom_entry *sega_32x_device::device_rom_region() const
// some games appear to dislike 'perfect' levels of interleave, probably due to
// non-emulated cache, ram waitstates and other issues?
#define _32X_INTERLEAVE_LEVEL \
- MCFG_QUANTUM_TIME(attotime::from_hz(1800000))
-
-MACHINE_CONFIG_START(sega_32x_ntsc_device::device_add_mconfig)
+ config.m_minimum_quantum = attotime::from_hz(1800000);
+void sega_32x_device::device_add_mconfig(machine_config &config)
+{
#ifndef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
+ SH2(config, m_master_cpu, DERIVED_CLOCK(1, 1));
+ m_master_cpu->set_is_slave(0);
+ m_master_cpu->set_dma_fifo_data_available_callback(FUNC(sega_32x_device::_32x_fifo_available_callback));
#endif
- MCFG_DEVICE_ADD("32x_slave_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_slave_map)
- MCFG_SH2_IS_SLAVE(1)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
+ SH2(config, m_slave_cpu, DERIVED_CLOCK(1, 1));
+ m_slave_cpu->set_is_slave(1);
+ m_slave_cpu->set_dma_fifo_data_available_callback(FUNC(sega_32x_device::_32x_fifo_available_callback));
#ifdef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
+ SH2(config, m_master_cpu, DERIVED_CLOCK(1, 1));
+ m_master_cpu->set_is_slave(0);
+ m_master_cpu->set_dma_fifo_data_available_callback(FUNC(sega_32x_device::_32x_fifo_available_callback));
#endif
- MCFG_DEVICE_ADD("ldac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.4) // unknown DAC
- MCFG_DEVICE_ADD("rdac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.4) // unknown DAC
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
- MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
+ vref.set_output(5.0);
+ vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT);
+ vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT);
+ vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT);
+ vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT);
_32X_INTERLEAVE_LEVEL
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(sega_32x_pal_device::device_add_mconfig)
+void sega_32x_ntsc_device::device_add_mconfig(machine_config &config)
+{
+ sega_32x_device::device_add_mconfig(config);
-#ifndef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
-#endif
+ m_master_cpu->set_addrmap(AS_PROGRAM, &sega_32x_ntsc_device::sh2_main_map);
+ m_slave_cpu->set_addrmap(AS_PROGRAM, &sega_32x_ntsc_device::sh2_slave_map);
- MCFG_DEVICE_ADD("32x_slave_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_slave_map)
- MCFG_SH2_IS_SLAVE(1)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
+ DAC_12BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, ":lspeaker", 0.4); // unknown DAC
+ DAC_12BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, ":rspeaker", 0.4); // unknown DAC
+}
-#ifdef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
- MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
- MCFG_SH2_IS_SLAVE(0)
- MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
-#endif
+void sega_32x_pal_device::device_add_mconfig(machine_config &config)
+{
+ sega_32x_device::device_add_mconfig(config);
- MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.4) // unknown DAC
- MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.4) // unknown DAC
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
- MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+ m_master_cpu->set_addrmap(AS_PROGRAM, &sega_32x_pal_device::sh2_main_map);
+ m_slave_cpu->set_addrmap(AS_PROGRAM, &sega_32x_pal_device::sh2_slave_map);
- _32X_INTERLEAVE_LEVEL
-MACHINE_CONFIG_END
+ DAC_16BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, ":lspeaker", 0.4); // unknown DAC
+ DAC_16BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, ":rspeaker", 0.4); // unknown DAC
+}
void sega_32x_device::device_start()
diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h
index e8dc32e465e..523ba1ffe77 100644
--- a/src/mame/machine/mega32x.h
+++ b/src/mame/machine/mega32x.h
@@ -118,6 +118,7 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
+ virtual void device_add_mconfig(machine_config &config) override;
void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; } // this gets set at each EOF