summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-12-16 11:49:36 +0100
committer mooglyguy <therealmogminer@gmail.com>2018-12-16 11:49:36 +0100
commit463cfcceab1d210b78b4ac39669b0043fc1a52e1 (patch)
tree5801b7f494b84da9ea2a8ea7b2e61cdeaf37e852
parenta0351149de614051b7fb7563cd633e4c5e489b82 (diff)
-cpu/h8: Removed MCFG macros. [Ryan Holtz]
-machine/pcf8593, video/hd66421, sound/es8712: Removed MCFG macros. [Ryan Holtz] -drivers/cybiko, drivers/metro: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-rw-r--r--src/devices/cpu/h8/h83002.h9
-rw-r--r--src/devices/cpu/h8/h83003.h9
-rw-r--r--src/devices/cpu/h8/h8_sci.h9
-rw-r--r--src/devices/machine/pcf8593.h14
-rw-r--r--src/devices/sound/es8712.h20
-rw-r--r--src/devices/sound/ymf278b.h1
-rw-r--r--src/devices/video/hd66421.h9
-rw-r--r--src/mame/drivers/cybiko.cpp128
-rw-r--r--src/mame/drivers/gcpinbal.cpp20
-rw-r--r--src/mame/drivers/lastbank.cpp16
-rw-r--r--src/mame/drivers/metro.cpp709
-rw-r--r--src/mame/drivers/namcos12.cpp27
-rw-r--r--src/mame/drivers/witch.cpp16
-rw-r--r--src/mame/includes/cybiko.h6
14 files changed, 449 insertions, 544 deletions
diff --git a/src/devices/cpu/h8/h83002.h b/src/devices/cpu/h8/h83002.h
index 32047b60390..e95139ee382 100644
--- a/src/devices/cpu/h8/h83002.h
+++ b/src/devices/cpu/h8/h83002.h
@@ -25,17 +25,12 @@
#include "h8_sci.h"
#include "h8_watchdog.h"
-#define MCFG_H83002_TEND0_CALLBACK(_devcb) \
- downcast<h83002_device &>(*device).set_tend0_callback(DEVCB_##_devcb);
-#define MCFG_H83002_TEND1_CALLBACK(_devcb) \
- downcast<h83002_device &>(*device).set_tend1_callback(DEVCB_##_devcb);
-
class h83002_device : public h8h_device {
public:
h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class Object> devcb_base &set_tend0_callback(Object &&cb) { return tend0_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> devcb_base &set_tend1_callback(Object &&cb) { return tend1_cb.set_callback(std::forward<Object>(cb)); }
+ auto tend0() { return tend0_cb.bind(); }
+ auto tend1() { return tend1_cb.bind(); }
DECLARE_READ8_MEMBER(syscr_r);
DECLARE_WRITE8_MEMBER(syscr_w);
diff --git a/src/devices/cpu/h8/h83003.h b/src/devices/cpu/h8/h83003.h
index 6f57155faf2..29e42186222 100644
--- a/src/devices/cpu/h8/h83003.h
+++ b/src/devices/cpu/h8/h83003.h
@@ -25,17 +25,12 @@
#include "h8_sci.h"
#include "h8_watchdog.h"
-#define MCFG_H83003_TEND0_CALLBACK(_devcb) \
- downcast<h83003_device &>(*device).set_tend0_callback(DEVCB_##_devcb);
-#define MCFG_H83003_TEND1_CALLBACK(_devcb) \
- downcast<h83003_device &>(*device).set_tend1_callback(DEVCB_##_devcb);
-
class h83003_device : public h8h_device {
public:
h83003_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class Object> devcb_base &set_tend0_callback(Object &&cb) { return tend0_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> devcb_base &set_tend1_callback(Object &&cb) { return tend1_cb.set_callback(std::forward<Object>(cb)); }
+ auto tend0() { return tend0_cb.bind(); }
+ auto tend1() { return tend1_cb.bind(); }
DECLARE_READ8_MEMBER(syscr_r);
DECLARE_WRITE8_MEMBER(syscr_w);
diff --git a/src/devices/cpu/h8/h8_sci.h b/src/devices/cpu/h8/h8_sci.h
index 47603f2d91e..f704644e285 100644
--- a/src/devices/cpu/h8/h8_sci.h
+++ b/src/devices/cpu/h8/h8_sci.h
@@ -17,15 +17,6 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(_period) \
- downcast<h8_sci_device *>(device)->set_external_clock_period(_period);
-
-#define MCFG_H8_SCI_TX_CALLBACK(_devcb) \
- downcast<h8_sci_device &>(*device).set_tx_cb(DEVCB_##_devcb);
-
-#define MCFG_H8_SCI_CLK_CALLBACK(_devcb) \
- downcast<h8_sci_device &>(*device).set_clk_cb(DEVCB_##_devcb);
-
class h8_sci_device : public device_t {
public:
h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/machine/pcf8593.h b/src/devices/machine/pcf8593.h
index e1527b6d6ad..2b6d76bc853 100644
--- a/src/devices/machine/pcf8593.h
+++ b/src/devices/machine/pcf8593.h
@@ -15,18 +15,6 @@
#include "dirtc.h"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_PCF8593_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PCF8593, 0)
-
-#define MCFG_PCF8593_REMOVE(_tag) \
- MCFG_DEVICE_REMOVE(_tag)
-
-
// ======================> pcf8593_device
class pcf8593_device : public device_t,
@@ -34,7 +22,7 @@ class pcf8593_device : public device_t,
public device_nvram_interface
{
public:
- pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
DECLARE_WRITE_LINE_MEMBER(scl_w);
DECLARE_WRITE_LINE_MEMBER(sda_w);
diff --git a/src/devices/sound/es8712.h b/src/devices/sound/es8712.h
index 61f98068cde..d355bd10633 100644
--- a/src/devices/sound/es8712.h
+++ b/src/devices/sound/es8712.h
@@ -11,22 +11,6 @@
#include "sound/msm5205.h"
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_ES8712_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, ES8712, _clock)
-#define MCFG_ES8712_REPLACE(_tag, _clock) \
- MCFG_DEVICE_REPLACE(_tag, ES8712, _clock)
-#define MCFG_ES8712_RESET_HANDLER(_devcb) \
- downcast<es8712_device &>(*device).set_reset_handler(DEVCB_##_devcb);
-#define MCFG_ES8712_MSM_WRITE_CALLBACK(_devcb) \
- downcast<es8712_device &>(*device).set_msm_write_callback(DEVCB_##_devcb);
-#define MCFG_ES8712_MSM_TAG(_msmtag) \
- downcast<es8712_device &>(*device).set_msm_tag(_msmtag);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -40,8 +24,8 @@ public:
// configuration
void set_msm_tag(const char *tag) { m_msm.set_tag(tag); }
- template<class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); }
- template<class Object> devcb_base &set_msm_write_callback(Object &&cb) { return m_msm_write_cb.set_callback(std::forward<Object>(cb)); }
+ auto reset_handler() { return m_reset_handler.bind(); }
+ auto msm_write_handler() { return m_msm_write_cb.bind(); }
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h
index 7b12ae322f9..fbdde4e345e 100644
--- a/src/devices/sound/ymf278b.h
+++ b/src/devices/sound/ymf278b.h
@@ -18,6 +18,7 @@ public:
// configuration helpers
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/video/hd66421.h b/src/devices/video/hd66421.h
index 1237055eadc..ac4c9add745 100644
--- a/src/devices/video/hd66421.h
+++ b/src/devices/video/hd66421.h
@@ -17,13 +17,6 @@
///*************************************************************************
-// INTERFACE CONFIGURATION MACROS
-///*************************************************************************
-
-#define MCFG_HD66421_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, HD66421, 0)
-
-///*************************************************************************
// TYPE DEFINITIONS
///*************************************************************************
@@ -37,7 +30,7 @@ public:
static constexpr unsigned HEIGHT = 100;
// construction/destruction
- hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
DECLARE_READ8_MEMBER( reg_idx_r );
DECLARE_WRITE8_MEMBER( reg_idx_w );
diff --git a/src/mame/drivers/cybiko.cpp b/src/mame/drivers/cybiko.cpp
index 669087491e5..440e770d2f7 100644
--- a/src/mame/drivers/cybiko.cpp
+++ b/src/mame/drivers/cybiko.cpp
@@ -21,7 +21,6 @@ ToDo:
#include "emu.h"
#include "includes/cybiko.h"
-#include "bus/rs232/rs232.h"
#include "screen.h"
#include "speaker.h"
@@ -389,45 +388,47 @@ static DEVICE_INPUT_DEFAULTS_START( debug_serial ) // set up debug port to defau
DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 )
DEVICE_INPUT_DEFAULTS_END
-MACHINE_CONFIG_START(cybiko_state::cybikov1_debug_serial)
- auto &debug_serial(*subdevice<rs232_port_device>("debug_serial"));
- debug_serial.rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
- MCFG_DEVICE_MODIFY("maincpu:sci2")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("debug_serial", rs232_port_device, write_txd))
-MACHINE_CONFIG_END
+void cybiko_state::cybikov1_debug_serial(machine_config &config)
+{
+ m_debug_serial->rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("maincpu:sci2")->tx_handler().set(m_debug_serial, FUNC(rs232_port_device::write_txd));
+}
-MACHINE_CONFIG_START(cybiko_state::cybikov1_base)
+void cybiko_state::cybikov1_base(machine_config &config)
+{
// screen
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE( 60 )
- MCFG_SCREEN_SIZE( hd66421_device::WIDTH, hd66421_device::HEIGHT )
- MCFG_SCREEN_VISIBLE_AREA( 0, hd66421_device::WIDTH - 1, 0, hd66421_device::HEIGHT - 1 )
- MCFG_SCREEN_UPDATE_DEVICE("hd66421", hd66421_device, update_screen)
- MCFG_SCREEN_PALETTE("hd66421:palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(60);
+ screen.set_size(hd66421_device::WIDTH, hd66421_device::HEIGHT);
+ screen.set_visarea(0, hd66421_device::WIDTH - 1, 0, hd66421_device::HEIGHT - 1);
+ screen.set_screen_update("hd66421", FUNC(hd66421_device::update_screen));
+ screen.set_palette("hd66421:palette");
+
// video
- MCFG_HD66421_ADD("hd66421")
+ HD66421(config, m_crtc);
+
// sound
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00);
+
// machine
- /* rtc */
- MCFG_PCF8593_ADD("rtc")
+ PCF8593(config, m_rtc);
- NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+ NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0);
- /* internal ram */
+ // internal ram
RAM(config, m_ram).set_default_size("512K").set_extra_options("1M");
- /* serial debug port */
- rs232_port_device &debug_serial(RS232_PORT(config, "debug_serial", default_rs232_devices, nullptr));
- debug_serial.set_option_device_input_defaults("null_modem", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
- debug_serial.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
- debug_serial.set_option_device_input_defaults("pty", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
+ // serial debug port
+ RS232_PORT(config, m_debug_serial, default_rs232_devices, nullptr);
+ m_debug_serial->set_option_device_input_defaults("null_modem", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
+ m_debug_serial->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
+ m_debug_serial->set_option_device_input_defaults("pty", DEVICE_INPUT_DEFAULTS_NAME(debug_serial));
- /* quickload */
- MCFG_QUICKLOAD_ADD("quickload", cybiko_state, cybiko, "bin,nv", 0)
-MACHINE_CONFIG_END
+ // quickload
+ quickload_image_device &quickload(QUICKLOAD(config, "quickload", 0));
+ quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(cybiko_state, cybiko), this), "bin,nv", 0);
+}
void cybiko_state::cybikov1_flash(machine_config &config)
{
@@ -435,74 +436,71 @@ void cybiko_state::cybikov1_flash(machine_config &config)
m_flash1->so_callback().set("maincpu:sci1", FUNC(h8_sci_device::rx_w));
}
-MACHINE_CONFIG_START(cybiko_state::cybikov1)
+void cybiko_state::cybikov1(machine_config &config)
+{
cybikov1_base(config);
// cpu
- MCFG_DEVICE_ADD( "maincpu", H8S2241, XTAL(11'059'200) )
- MCFG_DEVICE_PROGRAM_MAP( cybikov1_mem )
- MCFG_DEVICE_IO_MAP( cybikov1_io )
+ H8S2241(config, m_maincpu, XTAL(11'059'200));
+ m_maincpu->set_addrmap(AS_PROGRAM, &cybiko_state::cybikov1_mem);
+ m_maincpu->set_addrmap(AS_IO, &cybiko_state::cybikov1_io);
- MCFG_DEVICE_MODIFY("maincpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("flash1", at45db041_device, si_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("flash1", at45db041_device, sck_w))
+ subdevice<h8_sci_device>("maincpu:sci1")->tx_handler().set("flash1", FUNC(at45db041_device::si_w));
+ subdevice<h8_sci_device>("maincpu:sci1")->clk_handler().set("flash1", FUNC(at45db041_device::sck_w));
// machine
cybikov1_flash(config);
cybikov1_debug_serial(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(cybiko_state::cybikov2)
+void cybiko_state::cybikov2(machine_config &config)
+{
cybikov1_base(config);
cybikov1_flash(config);
// cpu
- MCFG_DEVICE_ADD("maincpu", H8S2246, XTAL(11'059'200))
- MCFG_DEVICE_PROGRAM_MAP(cybikov2_mem)
- MCFG_DEVICE_IO_MAP(cybikov2_io)
+ H8S2246(config, m_maincpu, XTAL(11'059'200));
+ m_maincpu->set_addrmap(AS_PROGRAM, &cybiko_state::cybikov2_mem);
+ m_maincpu->set_addrmap(AS_IO, &cybiko_state::cybikov2_io);
- MCFG_DEVICE_MODIFY("maincpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("flash1", at45db041_device, si_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("flash1", at45db041_device, sck_w))
+ subdevice<h8_sci_device>("maincpu:sci1")->tx_handler().set("flash1", FUNC(at45db041_device::si_w));
+ subdevice<h8_sci_device>("maincpu:sci1")->clk_handler().set("flash1", FUNC(at45db041_device::sck_w));
// machine
SST_39VF020(config, "flash2");
cybikov1_debug_serial(config);
- /* internal ram */
+ // internal ram
m_ram->set_default_size("256K").set_extra_options("512K,1M");
- /* serial debug port */
- auto &debug_serial(*subdevice<rs232_port_device>("debug_serial"));
- debug_serial.rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
- MCFG_DEVICE_MODIFY("maincpu:sci2")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("debug_serial", rs232_port_device, write_txd))
-MACHINE_CONFIG_END
+ // serial debug port
+ m_debug_serial->rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("maincpu:sci2")->tx_handler().set(m_debug_serial, FUNC(rs232_port_device::write_txd));
+}
-MACHINE_CONFIG_START(cybiko_state::cybikoxt)
+void cybiko_state::cybikoxt(machine_config &config)
+{
cybikov1_base(config);
// cpu
- MCFG_DEVICE_ADD("maincpu", H8S2323, XTAL(18'432'000))
- MCFG_DEVICE_PROGRAM_MAP(cybikoxt_mem)
- MCFG_DEVICE_IO_MAP(cybikoxt_io)
+ H8S2323(config, m_maincpu, XTAL(18'432'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &cybiko_state::cybikoxt_mem);
+ m_maincpu->set_addrmap(AS_IO, &cybiko_state::cybikoxt_io);
// machine
SST_39VF400A(config, "flashxt");
- /* internal ram */
+ // internal ram
m_ram->set_default_size("2M");
- /* serial debug port */
- auto &debug_serial(*subdevice<rs232_port_device>("debug_serial"));
- debug_serial.rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
- MCFG_DEVICE_MODIFY("maincpu:sci2")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("debug_serial", rs232_port_device, write_txd))
+ // serial debug port
+ m_debug_serial->rxd_handler().set("maincpu:sci2", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("maincpu:sci2")->tx_handler().set("debug_serial", FUNC(rs232_port_device::write_txd));
- /* quickload */
- MCFG_DEVICE_REMOVE("quickload")
- MCFG_QUICKLOAD_ADD("quickload", cybiko_state, cybikoxt, "bin,nv", 0)
-MACHINE_CONFIG_END
+ // quickload
+ quickload_image_device &quickload(QUICKLOAD(config.replace(), "quickload", 0));
+ quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(cybiko_state, cybikoxt), this), "bin,nv", 0);
+}
/////////
// ROM //
diff --git a/src/mame/drivers/gcpinbal.cpp b/src/mame/drivers/gcpinbal.cpp
index 3ca090f2dd4..e69c4e532a5 100644
--- a/src/mame/drivers/gcpinbal.cpp
+++ b/src/mame/drivers/gcpinbal.cpp
@@ -94,7 +94,7 @@ NOTE: Mask ROMs from Power Flipper Pinball Shooting have not been dumped, but as
TIMER_DEVICE_CALLBACK_MEMBER(gcpinbal_state::scanline_cb)
{
-
+
if (param>=16)
m_screen->update_partial(m_screen->vpos()-1);
@@ -357,7 +357,7 @@ MACHINE_CONFIG_START(gcpinbal_state::gcpinbal)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL/2) /* 16 MHz */
MCFG_DEVICE_PROGRAM_MAP(gcpinbal_map)
-
+
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gcpinbal_state, scanline_cb, "screen", 0, 1)
EEPROM_93C46_16BIT(config, "eeprom");
@@ -385,15 +385,15 @@ MACHINE_CONFIG_START(gcpinbal_state::gcpinbal)
MCFG_DEVICE_ADD("oki", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
- MCFG_ES8712_ADD("essnd", 0)
- MCFG_ES8712_RESET_HANDLER(INPUTLINE("maincpu", 3))
- MCFG_ES8712_MSM_WRITE_CALLBACK(WRITE8("msm", msm6585_device, data_w))
- MCFG_ES8712_MSM_TAG("msm")
+ ES8712(config, m_essnd, 0);
+ m_essnd->reset_handler().set_inputline("maincpu", 3);
+ m_essnd->msm_write_handler().set("msm", FUNC(msm6585_device::data_w));
+ m_essnd->set_msm_tag("msm");
- MCFG_DEVICE_ADD("msm", MSM6585, 640_kHz_XTAL)
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("essnd", es8712_device, msm_int))
- MCFG_MSM6585_PRESCALER_SELECTOR(S40) /* 16 kHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL));
+ msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int));
+ msm.set_prescaler_selector(msm6585_device::S40); /* 16 kHz */
+ msm.add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp
index 45f3ca7b410..1942d977b20 100644
--- a/src/mame/drivers/lastbank.cpp
+++ b/src/mame/drivers/lastbank.cpp
@@ -558,14 +558,14 @@ MACHINE_CONFIG_START(lastbank_state::lastbank)
MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
- MCFG_ES8712_ADD("essnd", 0)
- MCFG_ES8712_MSM_WRITE_CALLBACK(WRITE8("msm", msm6585_device, data_w))
- MCFG_ES8712_MSM_TAG("msm")
-
- MCFG_DEVICE_ADD("msm", MSM6585, 640_kHz_XTAL) /* Not verified, It's actually MSM6585? */
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("essnd", es8712_device, msm_int))
- MCFG_MSM6585_PRESCALER_SELECTOR(S40) /* Not verified */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ ES8712(config, m_essnd, 0);
+ m_essnd->msm_write_handler().set("msm", FUNC(msm6585_device::data_w));
+ m_essnd->set_msm_tag("msm");
+
+ msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL)); /* Not verified, It's actually MSM6585? */
+ msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int));
+ msm.set_prescaler_selector(msm6585_device::S40); /* Not verified */
+ msm.add_route(ALL_OUTPUTS, "mono", 0.50);
// A RTC-62421 is present on the Last Bank PCB. However, the code
// that tries to read from it is broken and nonfunctional. The RTC
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 4c8978d1015..7c772688dc2 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -2994,156 +2994,153 @@ void metro_state::machine_start()
save_item(NAME(m_gakusai_oki_bank_hi));
}
-MACHINE_CONFIG_START(metro_state::i4100_config)
+void metro_state::i4100_config(machine_config &config)
+{
I4100(config, m_vdp, 26.666_MHz_XTAL);
m_vdp->blit_irq_cb().set(FUNC(metro_state::vdp_blit_end_w));
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58.2328) // VSync 58.2328Hz, HSync 15.32kHz
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
- MCFG_SCREEN_UPDATE_DEVICE("vdp", imagetek_i4100_device, screen_update)
- MCFG_SCREEN_PALETTE("vdp:palette")
-MACHINE_CONFIG_END
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 320-1, 0, 240-1);
+ m_screen->set_screen_update("vdp", FUNC(imagetek_i4100_device::screen_update));
+ m_screen->set_palette("vdp:palette");
+}
-MACHINE_CONFIG_START(metro_state::i4220_config)
+void metro_state::i4220_config(machine_config &config)
+{
I4220(config, m_vdp2, 26.666_MHz_XTAL);
m_vdp2->blit_irq_cb().set(FUNC(metro_state::vdp_blit_end_w));
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58.2328) // VSync 58.2328Hz, HSync 15.32kHz
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
- MCFG_SCREEN_UPDATE_DEVICE("vdp2", imagetek_i4100_device, screen_update)
- MCFG_SCREEN_PALETTE("vdp2:palette")
-MACHINE_CONFIG_END
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 320-1, 0, 224-1);
+ m_screen->set_screen_update("vdp2", FUNC(imagetek_i4100_device::screen_update));
+ m_screen->set_palette("vdp2:palette");
+}
-MACHINE_CONFIG_START(metro_state::i4300_config)
+void metro_state::i4300_config(machine_config &config)
+{
I4300(config, m_vdp3, 26.666_MHz_XTAL);
m_vdp3->blit_irq_cb().set(FUNC(metro_state::vdp_blit_end_w));
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58.2328) // VSync 58.2328Hz, HSync 15.32kHz
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
- MCFG_SCREEN_UPDATE_DEVICE("vdp3", imagetek_i4100_device, screen_update)
- MCFG_SCREEN_PALETTE("vdp3:palette")
-MACHINE_CONFIG_END
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 320-1, 0, 224-1);
+ m_screen->set_screen_update("vdp3", FUNC(imagetek_i4100_device::screen_update));
+ m_screen->set_palette("vdp3:palette");
+}
// TODO: these comes from the CRTC inside the i4100
-MACHINE_CONFIG_START(metro_state::i4100_config_360x224)
+void metro_state::i4100_config_360x224(machine_config &config)
+{
i4100_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_SIZE(360, 224)
- MCFG_SCREEN_VISIBLE_AREA(0, 360-1, 0, 224-1)
-MACHINE_CONFIG_END
+ m_screen->set_size(360, 224);
+ m_screen->set_visarea(0, 360-1, 0, 224-1);
+}
-MACHINE_CONFIG_START(metro_state::i4220_config_320x240)
+void metro_state::i4220_config_320x240(machine_config &config)
+{
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
-MACHINE_CONFIG_END
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 320-1, 0, 240-1);
+}
-MACHINE_CONFIG_START(metro_state::i4220_config_304x224)
+void metro_state::i4220_config_304x224(machine_config &config)
+{
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 304-1, 0, 224-1)
-MACHINE_CONFIG_END
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 304-1, 0, 224-1);
+}
-MACHINE_CONFIG_START(metro_state::i4300_config_384x224)
+void metro_state::i4300_config_384x224(machine_config &config)
+{
i4300_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_SIZE(384, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 224-1)
-MACHINE_CONFIG_END
+ m_screen->set_size(384, 240);
+ m_screen->set_visarea(0, 384-1, 0, 224-1);
+}
-MACHINE_CONFIG_START(metro_state::i4300_config_320x240)
+void metro_state::i4300_config_320x240(machine_config &config)
+{
i4300_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_SIZE(384, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
-MACHINE_CONFIG_END
-
+ m_screen->set_size(384, 240);
+ m_screen->set_visarea(0, 320-1, 0, 240-1);
+}
-MACHINE_CONFIG_START(metro_state::msgogo)
+void metro_state::msgogo(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(msgogo_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 60) // ?
+ M68000(config, m_maincpu, 16_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::msgogo_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(60)); // ?
/* video hardware */
i4220_config(config);
m_vdp2->set_tmap_xoffsets(-2,-2,-2);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq)) // timing is off, shaking sprites in intro
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq)); // timing is off, shaking sprites in intro
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ymf", YMF278B, YMF278B_STD_CLOCK)
- MCFG_DEVICE_ADDRESS_MAP(0, ymf278_map)
- MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("maincpu", 2))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK));
+ ymf.set_addrmap(0, &metro_state::ymf278_map);
+ ymf.irq_handler().set_inputline("maincpu", 2);
+ ymf.add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(metro_state::balcube)
+void metro_state::balcube(machine_config &config)
+{
msgogo(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(balcube_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::balcube_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
-MACHINE_CONFIG_END
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
+}
-MACHINE_CONFIG_START(metro_state::daitoa)
+void metro_state::daitoa(machine_config &config)
+{
msgogo(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(daitoa_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::daitoa_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
-MACHINE_CONFIG_END
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
+}
-MACHINE_CONFIG_START(metro_state::bangball)
+void metro_state::bangball(machine_config &config)
+{
msgogo(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(bangball_map)
- MCFG_DEVICE_PERIODIC_INT_REMOVE()
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", metro_state, bangball_scanline, "screen", 0, 1)
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::bangball_map);
+ m_maincpu->set_periodic_int(device_interrupt_delegate(), attotime());
+ TIMER(config, "scantimer").configure_scanline(FUNC(metro_state::bangball_scanline), "screen", 0, 1);
// doesn't like 58.2 Hz
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
-MACHINE_CONFIG_END
+ m_screen->set_refresh_hz(60);
+ m_screen->screen_vblank().set_nop();
+}
-MACHINE_CONFIG_START(metro_state::batlbubl)
+void metro_state::batlbubl(machine_config &config)
+{
msgogo(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(batlbubl_map)
- MCFG_DEVICE_PERIODIC_INT_REMOVE()
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", metro_state, bangball_scanline, "screen", 0, 1)
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::batlbubl_map);
+ m_maincpu->set_periodic_int(device_interrupt_delegate(), attotime());
+ TIMER(config, "scantimer").configure_scanline(FUNC(metro_state::bangball_scanline), "screen", 0, 1);
// doesn't like 58.2 Hz
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
-MACHINE_CONFIG_END
-
+ m_screen->set_refresh_hz(60);
+ m_screen->screen_vblank().set_nop();
+}
void metro_state::metro_upd7810_sound(machine_config &config)
{
@@ -3167,13 +3164,12 @@ void metro_state::daitorid_upd7810_sound(machine_config &config)
upd.pc_out_cb().set(FUNC(metro_state::upd7810_rombank_w<0x07>));
}
-
-MACHINE_CONFIG_START(metro_state::daitorid)
-
+void metro_state::daitorid(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(daitorid_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 32_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::daitorid_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
daitorid_upd7810_sound(config);
@@ -3181,8 +3177,7 @@ MACHINE_CONFIG_START(metro_state::daitorid)
i4220_config(config);
m_vdp2->set_tmap_xoffsets(-2,-2,-2);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -3193,187 +3188,179 @@ MACHINE_CONFIG_START(metro_state::daitorid)
ymsnd.irq_handler().set_inputline(m_audiocpu, UPD7810_INTF2);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
- MCFG_DEVICE_ADD("oki", OKIM6295, 1200000, okim6295_device::PIN7_HIGH) // sample rate = M6295 clock / 132
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 1200000, okim6295_device::PIN7_HIGH); // sample rate = M6295 clock / 132
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.40);
+}
-MACHINE_CONFIG_START(metro_state::puzzli)
+void metro_state::puzzli(machine_config &config)
+{
daitorid(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PERIODIC_INT_REMOVE()
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", metro_state, bangball_scanline, "screen", 0, 1)
+ m_maincpu->set_periodic_int(device_interrupt_delegate(), attotime());
+ TIMER(config, "scantimer").configure_scanline(FUNC(metro_state::bangball_scanline), "screen", 0, 1);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
- MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(metro_state::dharma)
+ m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE);
+ m_screen->screen_vblank().set_nop();
+}
+void metro_state::dharma(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(dharma_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::dharma_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // sample rate = M6295 clock / 132
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // sample rate = M6295 clock / 132
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(metro_state::karatour)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::karatour(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(karatour_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::karatour_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4100_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, karatour_vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // was /128.. so pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(metro_state::sankokushi)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::sankokushi(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(kokushi_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::kokushi_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4220_config_320x240(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, karatour_vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // was /128.. so pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
-MACHINE_CONFIG_START(metro_state::lastfort)
+void metro_state::lastfort(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(lastfort_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::lastfort_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4100_config_360x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW) // sample rate = M6295 clock / 165
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW); // sample rate = M6295 clock / 165
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
-MACHINE_CONFIG_START(metro_state::lastforg)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::lastforg(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(lastforg_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::lastforg_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
i4100_config_360x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, karatour_vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // was /128.. so pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
-MACHINE_CONFIG_START(metro_state::dokyusei)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::dokyusei(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(dokyusei_map)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(metro_state,irq_callback)
+ M68000(config, m_maincpu, 16_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::dokyusei_map);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(metro_state::irq_callback));
/* video hardware */
i4300_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 1056000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.25);
-MACHINE_CONFIG_START(metro_state::dokyusp)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::dokyusp(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(dokyusp_map)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(metro_state,irq_callback)
+ M68000(config, m_maincpu, 32_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::dokyusp_map);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(metro_state::irq_callback));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -3382,26 +3369,24 @@ MACHINE_CONFIG_START(metro_state::dokyusp)
/* video hardware */
i4300_config_384x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 2112000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ OKIM6295(config, m_oki, 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(metro_state::gakusai)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::gakusai(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 26.6660MHz/2?, OSCs listed are 26.6660MHz & 3.579545MHz */
- MCFG_DEVICE_PROGRAM_MAP(gakusai_map)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(metro_state,irq_callback)
+ M68000(config, m_maincpu, 16000000); /* 26.6660MHz/2?, OSCs listed are 26.6660MHz & 3.579545MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::gakusai_map);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(metro_state::irq_callback));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -3410,27 +3395,24 @@ MACHINE_CONFIG_START(metro_state::gakusai)
/* video hardware */
i4300_config_320x240(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 2112000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.00)
-MACHINE_CONFIG_END
-
+ OKIM6295(config, m_oki, 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.25);
-MACHINE_CONFIG_START(metro_state::gakusai2)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 2.00);
+}
+void metro_state::gakusai2(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 26.6660MHz/2?, OSCs listed are 26.6660MHz & 3.579545MHz */
- MCFG_DEVICE_PROGRAM_MAP(gakusai2_map)
-
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(metro_state,irq_callback)
+ M68000(config, m_maincpu, 16000000); /* 26.6660MHz/2?, OSCs listed are 26.6660MHz & 3.579545MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::gakusai2_map);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(metro_state::irq_callback));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -3439,90 +3421,83 @@ MACHINE_CONFIG_START(metro_state::gakusai2)
/* video hardware */
i4300_config_320x240(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 2112000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ OKIM6295(config, m_oki, 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.25);
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.00)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(metro_state::pangpoms)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 2.00);
+}
+void metro_state::pangpoms(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(pangpoms_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::pangpoms_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4100_config_360x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
-
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // was /128.. so pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
-MACHINE_CONFIG_START(metro_state::poitto)
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
+void metro_state::poitto(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(poitto_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::poitto_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4100_config_360x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // was /128.. so pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // was /128.. so pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
-MACHINE_CONFIG_START(metro_state::pururun)
-
+void metro_state::pururun(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2) /* Not confirmed */
- MCFG_DEVICE_PROGRAM_MAP(pururun_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2); /* Not confirmed */
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::pururun_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
daitorid_upd7810_sound(config);
/* video hardware */
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -3533,104 +3508,100 @@ MACHINE_CONFIG_START(metro_state::pururun)
ymsnd.irq_handler().set_inputline(m_audiocpu, UPD7810_INTF2);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.80);
- MCFG_DEVICE_ADD("oki", OKIM6295, 3.579545_MHz_XTAL/3, okim6295_device::PIN7_HIGH) // sample rate = M6295 clock / 132
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-MACHINE_CONFIG_END
-
+ OKIM6295(config, m_oki, 3.579545_MHz_XTAL/3, okim6295_device::PIN7_HIGH); // sample rate = M6295 clock / 132
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.40);
+}
-MACHINE_CONFIG_START(metro_state::skyalert)
+void metro_state::skyalert(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(skyalert_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::skyalert_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
i4100_config_360x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW) // sample rate = M6295 clock / 165
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_LOW); // sample rate = M6295 clock / 165
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
-MACHINE_CONFIG_START(metro_state::toride2g)
+void metro_state::toride2g(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(toride2g_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 24_MHz_XTAL/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::toride2g_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
metro_upd7810_sound(config);
/* video hardware */
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 24_MHz_XTAL/20, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.10);
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 0.90);
+}
-MACHINE_CONFIG_START(metro_state::mouja)
+void metro_state::mouja(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(mouja_map)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(metro_state,irq_callback)
+ M68000(config, m_maincpu, 16_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::mouja_map);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(metro_state::irq_callback));
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
i4300_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 16_MHz_XTAL/1024*132, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_DEVICE_ADDRESS_MAP(0, mouja_okimap)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 3.579545_MHz_XTAL)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 16_MHz_XTAL/1024*132, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->set_addrmap(0, &metro_state::mouja_okimap);
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.25);
+ ym2413_device &ymsnd(YM2413(config, m_ymsnd, 3.579545_MHz_XTAL));
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 1.00);
+}
-MACHINE_CONFIG_START(metro_state::vmetal)
+void metro_state::vmetal(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(vmetal_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 16_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::vmetal_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
/* video hardware */
i4220_config_304x224(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::vblank_irq));
m_vdp2->set_tmap_xoffsets(-16,-16,-16);
m_vdp2->set_tmap_yoffsets(-16,-16,-16);
@@ -3638,49 +3609,47 @@ MACHINE_CONFIG_START(metro_state::vmetal)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 1_MHz_XTAL, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_ES8712_ADD("essnd", 0)
- MCFG_ES8712_RESET_HANDLER(WRITELINE(*this, metro_state, vmetal_es8712_irq))
- MCFG_ES8712_MSM_WRITE_CALLBACK(WRITE8("msm", msm6585_device, data_w))
- MCFG_ES8712_MSM_TAG("msm")
+ OKIM6295(config, m_oki, 1_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.50);
- MCFG_DEVICE_ADD("msm", MSM6585, 640_kHz_XTAL) /* Not verified, value from docs */
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("essnd", es8712_device, msm_int))
- MCFG_MSM6585_PRESCALER_SELECTOR(S40) /* Not verified, value from docs */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ ES8712(config, m_essnd, 0);
+ m_essnd->reset_handler().set(FUNC(metro_state::vmetal_es8712_irq));
+ m_essnd->msm_write_handler().set("msm", FUNC(msm6585_device::data_w));
+ m_essnd->set_msm_tag("msm");
+ msm6585_device &msm(MSM6585(config, "msm", 640_kHz_XTAL)); /* Not verified, value from docs */
+ msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int));
+ msm.set_prescaler_selector(msm6585_device::S40); /* Not verified, value from docs */
+ msm.add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(metro_state::blzntrnd)
-
+void metro_state::blzntrnd(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(blzntrnd_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(metro_state, periodic_interrupt, 8*60) // ?
+ M68000(config, m_maincpu, 16_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::blzntrnd_map);
+ m_maincpu->set_periodic_int(FUNC(metro_state::periodic_interrupt), attotime::from_hz(8*60)); // ?
- MCFG_DEVICE_ADD("audiocpu", Z80, 16_MHz_XTAL/2)
- MCFG_DEVICE_PROGRAM_MAP(blzntrnd_sound_map)
- MCFG_DEVICE_IO_MAP(blzntrnd_sound_io_map)
+ Z80(config, m_audiocpu, 16_MHz_XTAL/2);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &metro_state::blzntrnd_sound_map);
+ m_audiocpu->set_addrmap(AS_IO, &metro_state::blzntrnd_sound_io_map);
/* video hardware */
I4220(config, m_vdp2, 26.666_MHz_XTAL);
m_vdp2->blit_irq_cb().set(FUNC(metro_state::vdp_blit_end_w));
m_vdp2->set_spriteram_buffered(true); // sprites are 1 frame delayed
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58.2328) // VSync 58.2328Hz, HSync 15.32kHz
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 304-1, 0, 224-1)
- MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_psac_vdp2_mix)
- MCFG_SCREEN_PALETTE("vdp2:palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, karatour_vblank_irq))
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(58.2328); // VSync 58.2328Hz, HSync 15.32kHz
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 304-1, 0, 224-1);
+ m_screen->set_screen_update(FUNC(metro_state::screen_update_psac_vdp2_mix));
+ m_screen->set_palette("vdp2:palette");
+ m_screen->screen_vblank().set(FUNC(metro_state::karatour_vblank_irq));
MCFG_VIDEO_START_OVERRIDE(metro_state,blzntrnd)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "vdp2:palette", gfx_blzntrnd)
+ GFXDECODE(config, m_gfxdecode, "vdp2:palette", gfx_blzntrnd);
K053936(config, m_k053936, 0);
m_k053936->set_offsets(-77, -21);
@@ -3693,17 +3662,19 @@ MACHINE_CONFIG_START(metro_state::blzntrnd)
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("ymsnd", YM2610, 16_MHz_XTAL/2)
- MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
- MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
-MACHINE_CONFIG_END
+ ym2610_device &ymsnd(YM2610(config, m_ymsnd, 16_MHz_XTAL/2));
+ ymsnd.irq_handler().set_inputline("audiocpu", 0);
+ ymsnd.add_route(0, "lspeaker", 0.25);
+ ymsnd.add_route(0, "rspeaker", 0.25);
+ ymsnd.add_route(1, "lspeaker", 1.0);
+ ymsnd.add_route(2, "rspeaker", 1.0);
+}
-MACHINE_CONFIG_START(metro_state::gstrik2)
+void metro_state::gstrik2(machine_config &config)
+{
blzntrnd(config);
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_gstrik2)
+ m_gfxdecode->set_info(gfx_gstrik2);
+
MCFG_VIDEO_START_OVERRIDE(metro_state,gstrik2)
m_k053936->set_offsets(-77, -19);
@@ -3711,48 +3682,42 @@ MACHINE_CONFIG_START(metro_state::gstrik2)
m_vdp2->set_tmap_xoffsets(0,-8,0);
// HUM-003 PCB Configuration : Mono output only
- MCFG_DEVICE_REMOVE("lspeaker")
- MCFG_DEVICE_REMOVE("rspeaker")
+ config.device_remove("lspeaker");
+ config.device_remove("rspeaker");
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_REPLACE("ymsnd", YM2610, 16_MHz_XTAL/2)
- MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(0, "mono", 0.5)
- MCFG_SOUND_ROUTE(1, "mono", 0.5)
- MCFG_SOUND_ROUTE(2, "mono", 0.5)
-MACHINE_CONFIG_END
-
+ ym2610_device &ymsnd(YM2610(config.replace(), m_ymsnd, 16_MHz_XTAL/2));
+ ymsnd.irq_handler().set_inputline("audiocpu", 0);
+ ymsnd.add_route(0, "mono", 0.5);
+ ymsnd.add_route(1, "mono", 0.5);
+ ymsnd.add_route(2, "mono", 0.5);
+}
-MACHINE_CONFIG_START(metro_state::puzzlet)
+void metro_state::puzzlet(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H83007, 20_MHz_XTAL) // H8/3007 - Hitachi HD6413007F20 CPU. Clock 20MHz
- MCFG_DEVICE_PROGRAM_MAP(puzzlet_map)
- MCFG_DEVICE_IO_MAP(puzzlet_io_map)
+ H83007(config, m_maincpu, 20_MHz_XTAL); // H8/3007 - Hitachi HD6413007F20 CPU. Clock 20MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &metro_state::puzzlet_map);
+ m_maincpu->set_addrmap(AS_IO, &metro_state::puzzlet_io_map);
/* Coins/service */
puzzlet_io_device &coins(PUZZLET_IO(config, "coins", 0));
coins.data_callback().set("maincpu:sci1", FUNC(h8_sci_device::rx_w));
- MCFG_DEVICE_MODIFY("maincpu:sci1")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("coins", puzzlet_io_device, ce_w))
- MCFG_H8_SCI_CLK_CALLBACK(WRITELINE("coins", puzzlet_io_device, clk_w))
+ subdevice<h8_sci_device>("maincpu:sci1")->tx_handler().set("coins", FUNC(puzzlet_io_device::ce_w));
+ subdevice<h8_sci_device>("maincpu:sci1")->clk_handler().set("coins", FUNC(puzzlet_io_device::clk_w));
/* video hardware */
// TODO: looks like game is running in i4220 compatibilty mode, $778000 seems to be an id for the chip?
i4220_config(config);
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, metro_state, puzzlet_vblank_irq))
+ m_screen->screen_vblank().set(FUNC(metro_state::puzzlet_vblank_irq));
/* sound hardware */
SPEAKER(config, "mono").front_center();
-
- MCFG_DEVICE_ADD("oki", OKIM6295, 20_MHz_XTAL/5, okim6295_device::PIN7_LOW)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DEVICE_ADD("ymsnd", YM2413, 20_MHz_XTAL/5)
- MCFG_SOUND_ROUTE(0, "mono", 0.90)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 20_MHz_XTAL/5, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.50);
+ YM2413(config, m_ymsnd, 20_MHz_XTAL/5).add_route(0, "mono", 0.90);
+}
/***************************************************************************
diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp
index b02df573a32..acde409417b 100644
--- a/src/mame/drivers/namcos12.cpp
+++ b/src/mame/drivers/namcos12.cpp
@@ -1830,17 +1830,14 @@ void namcos12_state::jvsiomap(address_map &map)
MACHINE_CONFIG_START(namcos12_boothack_state::truckk)
coh700(config);
// Timer at 115200*16 for the jvs serial clock
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(attotime::from_hz(JVSCLOCK/8))
+ subdevice<h8_sci_device>("sub:sci0")->set_external_clock_period(attotime::from_hz(JVSCLOCK/8));
MCFG_DEVICE_ADD("iocpu", H83334, JVSCLOCK )
MCFG_DEVICE_PROGRAM_MAP( jvsmap )
MCFG_DEVICE_IO_MAP( jvsiomap )
- MCFG_DEVICE_MODIFY("iocpu:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("sub:sci0", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("iocpu:sci0", h8_sci_device, rx_w))
+ subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
MCFG_QUANTUM_TIME(attotime::from_hz(2*115200))
MACHINE_CONFIG_END
@@ -1904,8 +1901,7 @@ void namcos12_state::plarailjvsiomap(address_map &map)
MACHINE_CONFIG_START(namcos12_boothack_state::technodr)
coh700(config);
// Timer at 115200*16 for the jvs serial clock
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(attotime::from_hz(JVSCLOCK/8))
+ subdevice<h8_sci_device>("sub:sci0")->set_external_clock_period(attotime::from_hz(JVSCLOCK/8));
// modify H8/3002 map to omit direct-connected controls
MCFG_DEVICE_MODIFY("sub")
@@ -1916,10 +1912,8 @@ MACHINE_CONFIG_START(namcos12_boothack_state::technodr)
MCFG_DEVICE_PROGRAM_MAP( tdjvsmap )
MCFG_DEVICE_IO_MAP( tdjvsiomap )
- MCFG_DEVICE_MODIFY("iocpu:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("sub:sci0", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("iocpu:sci0", h8_sci_device, rx_w))
+ subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
MCFG_QUANTUM_TIME(attotime::from_hz(2*115200))
MACHINE_CONFIG_END
@@ -1927,8 +1921,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(namcos12_boothack_state::aplarail)
coh700(config);
// Timer at 115200*16 for the jvs serial clock
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(attotime::from_hz(JVSCLOCK/8))
+ subdevice<h8_sci_device>("sub:sci0")->set_external_clock_period(attotime::from_hz(JVSCLOCK/8));
// modify H8/3002 map to omit direct-connected controls
MCFG_DEVICE_MODIFY("sub")
@@ -1939,10 +1932,8 @@ MACHINE_CONFIG_START(namcos12_boothack_state::aplarail)
MCFG_DEVICE_PROGRAM_MAP( plarailjvsmap )
MCFG_DEVICE_IO_MAP( plarailjvsiomap )
- MCFG_DEVICE_MODIFY("iocpu:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("sub:sci0", h8_sci_device, rx_w))
- MCFG_DEVICE_MODIFY("sub:sci0")
- MCFG_H8_SCI_TX_CALLBACK(WRITELINE("iocpu:sci0", h8_sci_device, rx_w))
+ subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
+ subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
MCFG_QUANTUM_TIME(attotime::from_hz(2*115200))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/witch.cpp b/src/mame/drivers/witch.cpp
index e6dc9b9eca4..fdfd60db55e 100644
--- a/src/mame/drivers/witch.cpp
+++ b/src/mame/drivers/witch.cpp
@@ -998,14 +998,14 @@ MACHINE_CONFIG_START(witch_state::witch)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_ES8712_ADD("essnd", 0)
- MCFG_ES8712_MSM_WRITE_CALLBACK(WRITE8("msm", msm5205_device, data_w))
- MCFG_ES8712_MSM_TAG("msm")
-
- MCFG_DEVICE_ADD("msm", MSM5205, MSM5202_CLOCK) /* actually MSM5202 */
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("essnd", es8712_device, msm_int))
- MCFG_MSM6585_PRESCALER_SELECTOR(S48_4B) /* 8 kHz */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ es8712_device &essnd(ES8712(config, "essnd", 0));
+ essnd.msm_write_handler().set("msm", FUNC(msm5205_device::data_w));
+ essnd.set_msm_tag("msm");
+
+ msm5205_device &msm(MSM5205(config, "msm", MSM5202_CLOCK)); /* actually MSM5202 */
+ msm.vck_legacy_callback().set("essnd", FUNC(es8712_device::msm_int));
+ msm.set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */
+ msm.add_route(ALL_OUTPUTS, "mono", 1.0);
ym2203_device &ym1(YM2203(config, "ym1", YM2203_CLOCK)); /* 3 MHz */
ym1.port_a_read_callback().set_ioport("YM_PortA");
diff --git a/src/mame/includes/cybiko.h b/src/mame/includes/cybiko.h
index 5e0b1f1f556..6f34ede8423 100644
--- a/src/mame/includes/cybiko.h
+++ b/src/mame/includes/cybiko.h
@@ -17,6 +17,8 @@
#ifndef MAME_INCLUDES_CYBIKO_H
#define MAME_INCLUDES_CYBIKO_H
+#include "bus/rs232/rs232.h"
+
#include "cpu/h8/h8s2245.h"
#include "cpu/h8/h8s2320.h"
@@ -46,6 +48,7 @@ public:
, m_flash1(*this, "flash1")
, m_nvram(*this, "nvram")
, m_input(*this, "A.%u", 0)
+ , m_debug_serial(*this, "debug_serial")
{ }
DECLARE_WRITE16_MEMBER(serflash_w);
@@ -66,7 +69,7 @@ public:
DECLARE_WRITE16_MEMBER(cybiko_usb_w);
int cybiko_key_r( offs_t offset, int mem_mask);
- required_device<cpu_device> m_maincpu;
+ required_device<h8_device> m_maincpu;
required_device<hd66421_device> m_crtc;
required_device<speaker_sound_device> m_speaker;
required_device<pcf8593_device> m_rtc;
@@ -74,6 +77,7 @@ public:
optional_device<at45db041_device> m_flash1;
required_device<nvram_device> m_nvram;
optional_ioport_array<15> m_input;
+ required_device<rs232_port_device> m_debug_serial;
void init_cybikoxt();
void init_cybiko();
virtual void machine_start() override;