summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/bus/isa/sb16.cpp12
-rw-r--r--src/devices/bus/isa/sb16.h2
-rw-r--r--src/devices/bus/isa/stereo_fx.cpp14
-rw-r--r--src/devices/bus/isa/stereo_fx.h2
-rw-r--r--src/devices/bus/pc_kbd/keytro.cpp24
-rw-r--r--src/devices/bus/pc_kbd/keytro.h3
-rw-r--r--src/devices/bus/pc_kbd/msnat.cpp20
-rw-r--r--src/devices/bus/pc_kbd/msnat.h3
-rw-r--r--src/devices/cpu/mcs51/mcs51.h27
-rw-r--r--src/devices/machine/i2cmem.cpp17
-rw-r--r--src/devices/machine/i2cmem.h12
-rw-r--r--src/devices/machine/ncr5385.h1
-rw-r--r--src/devices/sound/qs1000.cpp26
-rw-r--r--src/devices/sound/samples.h11
-rw-r--r--src/devices/sound/upd7759.h1
-rw-r--r--src/mame/drivers/applix.cpp20
-rw-r--r--src/mame/drivers/armedf.cpp8
-rw-r--r--src/mame/drivers/artmagic.cpp8
-rw-r--r--src/mame/drivers/barata.cpp14
-rw-r--r--src/mame/drivers/basic52.cpp40
-rw-r--r--src/mame/drivers/bionicc.cpp8
-rw-r--r--src/mame/drivers/blktiger.cpp11
-rw-r--r--src/mame/drivers/cardline.cpp18
-rw-r--r--src/mame/drivers/cdi.cpp46
-rw-r--r--src/mame/drivers/controlid.cpp16
-rw-r--r--src/mame/drivers/dec0.cpp25
-rw-r--r--src/mame/drivers/dec8.cpp67
-rw-r--r--src/mame/drivers/djboy.cpp19
-rw-r--r--src/mame/drivers/eolith.cpp10
-rw-r--r--src/mame/drivers/fireball.cpp20
-rw-r--r--src/mame/drivers/hprot1.cpp14
-rw-r--r--src/mame/drivers/hvyunit.cpp20
-rw-r--r--src/mame/drivers/icatel.cpp18
-rw-r--r--src/mame/drivers/karnov.cpp17
-rw-r--r--src/mame/drivers/limenko.cpp10
-rw-r--r--src/mame/drivers/m72.cpp128
-rw-r--r--src/mame/drivers/maygay1b.cpp14
-rw-r--r--src/mame/drivers/maygayv1.cpp12
-rw-r--r--src/mame/drivers/mephistp.cpp14
-rw-r--r--src/mame/drivers/micro3d.cpp18
-rw-r--r--src/mame/drivers/minicom.cpp25
-rw-r--r--src/mame/drivers/minitel_2_rpic.cpp44
-rw-r--r--src/mame/drivers/peplus.cpp34
-rw-r--r--src/mame/drivers/pes.cpp24
-rw-r--r--src/mame/drivers/piggypas.cpp62
-rw-r--r--src/mame/drivers/rbmk.cpp10
-rw-r--r--src/mame/drivers/segas16a.cpp174
-rw-r--r--src/mame/drivers/segas16b.cpp178
-rw-r--r--src/mame/drivers/sliver.cpp10
-rw-r--r--src/mame/drivers/snowbros.cpp315
-rw-r--r--src/mame/drivers/spinb.cpp106
-rw-r--r--src/mame/drivers/splus.cpp38
-rw-r--r--src/mame/drivers/sslam.cpp144
-rw-r--r--src/mame/drivers/superqix.cpp306
-rw-r--r--src/mame/drivers/system1.cpp560
-rw-r--r--src/mame/drivers/tecnbras.cpp16
-rw-r--r--src/mame/drivers/thedeep.cpp62
-rw-r--r--src/mame/drivers/ti630.cpp47
-rw-r--r--src/mame/drivers/tigeroad.cpp8
-rw-r--r--src/mame/drivers/trs80dt1.cpp39
-rw-r--r--src/mame/drivers/tumbleb.cpp187
-rw-r--r--src/mame/drivers/vp415.cpp53
-rw-r--r--src/mame/drivers/vt220.cpp35
-rw-r--r--src/mame/includes/bionicc.h4
-rw-r--r--src/mame/includes/blktiger.h3
-rw-r--r--src/mame/includes/dec0.h5
-rw-r--r--src/mame/includes/dec8.h3
-rw-r--r--src/mame/includes/djboy.h3
-rw-r--r--src/mame/includes/m72.h5
-rw-r--r--src/mame/includes/snowbros.h3
-rw-r--r--src/mame/includes/sslam.h42
-rw-r--r--src/mame/includes/superqix.h61
-rw-r--r--src/mame/includes/system1.h7
-rw-r--r--src/mame/includes/thedeep.h3
-rw-r--r--src/mame/includes/tigeroad.h2
-rw-r--r--src/mame/includes/tumbleb.h5
-rw-r--r--src/mame/machine/segaic16.h21
-rw-r--r--src/mame/machine/wangpckb.cpp24
-rw-r--r--src/mame/video/pcd.cpp19
-rw-r--r--src/mame/video/sslam.cpp14
-rw-r--r--src/mame/video/superqix.cpp4
81 files changed, 1764 insertions, 1711 deletions
diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp
index 5a9b70cf208..de675136a6e 100644
--- a/src/devices/bus/isa/sb16.cpp
+++ b/src/devices/bus/isa/sb16.cpp
@@ -410,12 +410,12 @@ const tiny_rom_entry *sb16_lle_device::device_rom_region() const
}
MACHINE_CONFIG_START(sb16_lle_device::device_add_mconfig)
- MCFG_DEVICE_ADD("sb16_cpu", I80C52, XTAL(24'000'000))
- MCFG_DEVICE_IO_MAP(sb16_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, sb16_lle_device, p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, sb16_lle_device, p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, sb16_lle_device, p2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, sb16_lle_device, p2_w))
+ I80C52(config, m_cpu, XTAL(24'000'000));
+ m_cpu->set_addrmap(AS_IO, &sb16_lle_device::sb16_io);
+ m_cpu->port_in_cb<1>().set(FUNC(sb16_lle_device::p1_r));
+ m_cpu->port_out_cb<1>().set(FUNC(sb16_lle_device::p1_w));
+ m_cpu->port_in_cb<2>().set(FUNC(sb16_lle_device::p2_r));
+ m_cpu->port_out_cb<2>().set(FUNC(sb16_lle_device::p2_w));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/devices/bus/isa/sb16.h b/src/devices/bus/isa/sb16.h
index b75a7cd8e5d..4eb9be9d804 100644
--- a/src/devices/bus/isa/sb16.h
+++ b/src/devices/bus/isa/sb16.h
@@ -92,7 +92,7 @@ private:
required_device<dac_word_interface> m_ldac;
required_device<dac_word_interface> m_rdac;
required_device<pc_joy_device> m_joy;
- required_device<cpu_device> m_cpu;
+ required_device<i80c52_device> m_cpu;
// internal state
bool m_data_in;
diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp
index 977b2fc4a5a..a8959fbe109 100644
--- a/src/devices/bus/isa/stereo_fx.cpp
+++ b/src/devices/bus/isa/stereo_fx.cpp
@@ -115,13 +115,13 @@ const tiny_rom_entry *stereo_fx_device::device_rom_region() const
}
MACHINE_CONFIG_START(stereo_fx_device::device_add_mconfig)
- MCFG_DEVICE_ADD("stereo_fx_cpu", I80C31, XTAL(30'000'000))
- MCFG_DEVICE_IO_MAP(stereo_fx_io)
- MCFG_DEVICE_PROGRAM_MAP(stereo_fx_rom)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, stereo_fx_device, p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8("ldac", dac_byte_interface, data_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, stereo_fx_device, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, stereo_fx_device, p3_w))
+ I80C31(config, m_cpu, XTAL(30'000'000));
+ m_cpu->set_addrmap(AS_PROGRAM, &stereo_fx_device::stereo_fx_rom);
+ m_cpu->set_addrmap(AS_IO, &stereo_fx_device::stereo_fx_io);
+ m_cpu->port_in_cb<1>().set(FUNC(stereo_fx_device::p1_r));
+ m_cpu->port_out_cb<1>().set("ldac", FUNC(dac_byte_interface::data_w));
+ m_cpu->port_in_cb<3>().set(FUNC(stereo_fx_device::p3_r));
+ m_cpu->port_out_cb<3>().set(FUNC(stereo_fx_device::p3_w));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/devices/bus/isa/stereo_fx.h b/src/devices/bus/isa/stereo_fx.h
index 5242adcfbef..c3fa08339b8 100644
--- a/src/devices/bus/isa/stereo_fx.h
+++ b/src/devices/bus/isa/stereo_fx.h
@@ -38,7 +38,7 @@ protected:
void dack_w(int line, uint8_t data) override;
required_device<pc_joy_device> m_joy;
- required_device<cpu_device> m_cpu;
+ required_device<i80c31_device> m_cpu;
private:
// internal state
diff --git a/src/devices/bus/pc_kbd/keytro.cpp b/src/devices/bus/pc_kbd/keytro.cpp
index dbc88723147..72149e8ddea 100644
--- a/src/devices/bus/pc_kbd/keytro.cpp
+++ b/src/devices/bus/pc_kbd/keytro.cpp
@@ -69,7 +69,6 @@ are attached to two switches. The keys appear twice in the keyboard matrix.
#include "emu.h"
#include "keytro.h"
-#include "cpu/mcs51/mcs51.h"
/***************************************************************************
@@ -421,17 +420,18 @@ void pc_kbd_keytronic_pc3270_device::device_reset()
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(pc_kbd_keytronic_pc3270_device::device_add_mconfig)
- MCFG_DEVICE_ADD("kb_keytr", I8051, 11060250)
- MCFG_DEVICE_PROGRAM_MAP(keytronic_pc3270_program)
- MCFG_DEVICE_IO_MAP(keytronic_pc3270_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, pc_kbd_keytronic_pc3270_device, p1_read))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, pc_kbd_keytronic_pc3270_device, p1_write))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, pc_kbd_keytronic_pc3270_device, p2_read))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, pc_kbd_keytronic_pc3270_device, p2_write))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, pc_kbd_keytronic_pc3270_device, p3_read))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, pc_kbd_keytronic_pc3270_device, p3_write))
-MACHINE_CONFIG_END
+void pc_kbd_keytronic_pc3270_device::device_add_mconfig(machine_config &config)
+{
+ I8051(config, m_cpu, 11060250);
+ m_cpu->set_addrmap(AS_PROGRAM, &pc_kbd_keytronic_pc3270_device::keytronic_pc3270_program);
+ m_cpu->set_addrmap(AS_IO, &pc_kbd_keytronic_pc3270_device::keytronic_pc3270_io);
+ m_cpu->port_in_cb<1>().set(FUNC(pc_kbd_keytronic_pc3270_device::p1_read));
+ m_cpu->port_out_cb<1>().set(FUNC(pc_kbd_keytronic_pc3270_device::p1_write));
+ m_cpu->port_in_cb<2>().set(FUNC(pc_kbd_keytronic_pc3270_device::p2_read));
+ m_cpu->port_out_cb<2>().set(FUNC(pc_kbd_keytronic_pc3270_device::p2_write));
+ m_cpu->port_in_cb<3>().set(FUNC(pc_kbd_keytronic_pc3270_device::p3_read));
+ m_cpu->port_out_cb<3>().set(FUNC(pc_kbd_keytronic_pc3270_device::p3_write));
+}
ioport_constructor pc_kbd_keytronic_pc3270_device::device_input_ports() const
diff --git a/src/devices/bus/pc_kbd/keytro.h b/src/devices/bus/pc_kbd/keytro.h
index 4bfc637e8f2..c1e86e92f82 100644
--- a/src/devices/bus/pc_kbd/keytro.h
+++ b/src/devices/bus/pc_kbd/keytro.h
@@ -11,6 +11,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "pc_kbdc.h"
//**************************************************************************
@@ -58,7 +59,7 @@ protected:
void keytronic_pc3270_io(address_map &map);
void keytronic_pc3270_program(address_map &map);
- required_device<cpu_device> m_cpu;
+ required_device<i8051_device> m_cpu;
uint8_t m_p1;
uint8_t m_p1_data;
diff --git a/src/devices/bus/pc_kbd/msnat.cpp b/src/devices/bus/pc_kbd/msnat.cpp
index 2adde2d83c1..67919240d72 100644
--- a/src/devices/bus/pc_kbd/msnat.cpp
+++ b/src/devices/bus/pc_kbd/msnat.cpp
@@ -12,7 +12,6 @@ TODO:
#include "emu.h"
#include "msnat.h"
-#include "cpu/mcs51/mcs51.h"
/***************************************************************************
@@ -245,15 +244,16 @@ void pc_kbd_microsoft_natural_device::device_reset()
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(pc_kbd_microsoft_natural_device::device_add_mconfig)
- MCFG_DEVICE_ADD("ms_natrl_cpu", I8051, XTAL(6'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, pc_kbd_microsoft_natural_device, p0_read))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, pc_kbd_microsoft_natural_device, p0_write))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, pc_kbd_microsoft_natural_device, p1_write))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, pc_kbd_microsoft_natural_device, p2_write))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, pc_kbd_microsoft_natural_device, p3_read))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, pc_kbd_microsoft_natural_device, p3_write))
-MACHINE_CONFIG_END
+void pc_kbd_microsoft_natural_device::device_add_mconfig(machine_config &config)
+{
+ I8051(config, m_cpu, XTAL(6'000'000));
+ m_cpu->port_in_cb<0>().set(FUNC(pc_kbd_microsoft_natural_device::p0_read));
+ m_cpu->port_out_cb<0>().set(FUNC(pc_kbd_microsoft_natural_device::p0_write));
+ m_cpu->port_out_cb<1>().set(FUNC(pc_kbd_microsoft_natural_device::p1_write));
+ m_cpu->port_out_cb<2>().set(FUNC(pc_kbd_microsoft_natural_device::p2_write));
+ m_cpu->port_in_cb<3>().set(FUNC(pc_kbd_microsoft_natural_device::p3_read));
+ m_cpu->port_out_cb<3>().set(FUNC(pc_kbd_microsoft_natural_device::p3_write));
+}
ioport_constructor pc_kbd_microsoft_natural_device::device_input_ports() const
diff --git a/src/devices/bus/pc_kbd/msnat.h b/src/devices/bus/pc_kbd/msnat.h
index c4eb79c8bcc..d4453c8b64d 100644
--- a/src/devices/bus/pc_kbd/msnat.h
+++ b/src/devices/bus/pc_kbd/msnat.h
@@ -11,6 +11,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "pc_kbdc.h"
//**************************************************************************
@@ -38,7 +39,7 @@ protected:
virtual DECLARE_WRITE_LINE_MEMBER(data_write) override;
private:
- required_device<cpu_device> m_cpu;
+ required_device<i8051_device> m_cpu;
required_ioport_array<8> m_p2_r;
required_ioport_array<8> m_p1_r;
diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h
index fd0e05fe5d7..40e07c2ba79 100644
--- a/src/devices/cpu/mcs51/mcs51.h
+++ b/src/devices/cpu/mcs51/mcs51.h
@@ -32,33 +32,6 @@
#pragma once
-#define MCFG_MCS51_PORT_P0_IN_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_in_cb(0, DEVCB_##_devcb);
-#define MCFG_MCS51_PORT_P0_OUT_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_out_cb(0, DEVCB_##_devcb);
-
-#define MCFG_MCS51_PORT_P1_IN_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_in_cb(1, DEVCB_##_devcb);
-#define MCFG_MCS51_PORT_P1_OUT_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_out_cb(1, DEVCB_##_devcb);
-
-#define MCFG_MCS51_PORT_P2_IN_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_in_cb(2, DEVCB_##_devcb);
-#define MCFG_MCS51_PORT_P2_OUT_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_out_cb(2, DEVCB_##_devcb);
-
-#define MCFG_MCS51_PORT_P3_IN_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_in_cb(3, DEVCB_##_devcb);
-#define MCFG_MCS51_PORT_P3_OUT_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_port_out_cb(3, DEVCB_##_devcb);
-
-#define MCFG_MCS51_SERIAL_RX_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_serial_rx_cb(DEVCB_##_devcb);
-
-#define MCFG_MCS51_SERIAL_TX_CB(_devcb) \
- downcast<mcs51_cpu_device &>(*device).set_serial_tx_cb(DEVCB_##_devcb);
-
-
enum
{
MCS51_PC=1, MCS51_SP, MCS51_PSW, MCS51_ACC, MCS51_B, MCS51_DPTR, MCS51_DPH, MCS51_DPL, MCS51_IE, MCS51_IP,
diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp
index 1e8c2c181a2..94670ff5326 100644
--- a/src/devices/machine/i2cmem.cpp
+++ b/src/devices/machine/i2cmem.cpp
@@ -59,7 +59,7 @@ static inline void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level
// device type definition
DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory")
-
+DEFINE_DEVICE_TYPE(X2404P, x2404p_device, "x2404p", "X2404P I2C Memory")
//**************************************************************************
// LIVE DEVICE
@@ -69,8 +69,8 @@ DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory")
// i2cmem_device - constructor
//-------------------------------------------------
-i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock )
- : device_t(mconfig, I2CMEM, tag, owner, clock),
+i2cmem_device::i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_nvram_interface(mconfig, *this),
m_region(*this, DEVICE_SELF),
m_slave_address( I2CMEM_SLAVE_ADDRESS ),
@@ -89,8 +89,17 @@ i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, de
{
}
+i2cmem_device::i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : i2cmem_device(mconfig, I2CMEM, tag, owner, clock)
+{
+}
-
+x2404p_device::x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : i2cmem_device(mconfig, X2404P, tag, owner, clock)
+{
+ set_page_size(8);
+ set_data_size(0x200);
+}
//-------------------------------------------------
// device_start - device-specific startup
diff --git a/src/devices/machine/i2cmem.h b/src/devices/machine/i2cmem.h
index 32a40dba6af..d67fa463c2e 100644
--- a/src/devices/machine/i2cmem.h
+++ b/src/devices/machine/i2cmem.h
@@ -89,7 +89,7 @@ class i2cmem_device :
{
public:
// construction/destruction
- i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock );
+ i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
i2cmem_device & set_address(int address) { m_slave_address = address; return *this; }
i2cmem_device & set_page_size(int page_size) { m_page_size = page_size; return *this; }
@@ -109,6 +109,9 @@ public:
DECLARE_READ_LINE_MEMBER( read_sda );
protected:
+ // construction/destruction
+ i2cmem_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;
virtual void device_reset() override;
@@ -146,8 +149,15 @@ protected:
int m_page_offset;
};
+class x2404p_device : public i2cmem_device
+{
+public:
+ // construction/destruction
+ x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
// device type definition
DECLARE_DEVICE_TYPE(I2CMEM, i2cmem_device)
+DECLARE_DEVICE_TYPE(X2404P, x2404p_device)
#endif // MAME_MACHINE_I2CMEM_H
diff --git a/src/devices/machine/ncr5385.h b/src/devices/machine/ncr5385.h
index 8cbe4ea9e79..3a60ca0a6c8 100644
--- a/src/devices/machine/ncr5385.h
+++ b/src/devices/machine/ncr5385.h
@@ -65,6 +65,7 @@ public:
ncr5385_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_int.set_callback(std::forward<Object>(cb)); }
+ auto irq() { return m_int.bind(); }
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/sound/qs1000.cpp b/src/devices/sound/qs1000.cpp
index e79359d250f..458dfa5852d 100644
--- a/src/devices/sound/qs1000.cpp
+++ b/src/devices/sound/qs1000.cpp
@@ -195,18 +195,20 @@ const tiny_rom_entry *qs1000_device::device_rom_region() const
//-------------------------------------------------
// device_add_mconfig - add machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(qs1000_device::device_add_mconfig)
- MCFG_DEVICE_ADD("cpu", I8052, DERIVED_CLOCK(1, 1))
- MCFG_DEVICE_PROGRAM_MAP(qs1000_prg_map)
- MCFG_DEVICE_IO_MAP(qs1000_io_map)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, qs1000_device, p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, qs1000_device, p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, qs1000_device, p2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, qs1000_device, p2_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, qs1000_device, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, qs1000_device, p3_w))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, qs1000_device, data_to_i8052))
-MACHINE_CONFIG_END
+
+void qs1000_device::device_add_mconfig(machine_config &config)
+{
+ I8052(config, m_cpu, DERIVED_CLOCK(1, 1));
+ m_cpu->set_addrmap(AS_PROGRAM, &qs1000_device::qs1000_prg_map);
+ m_cpu->set_addrmap(AS_IO, &qs1000_device::qs1000_io_map);
+ m_cpu->port_in_cb<1>().set(FUNC(qs1000_device::p1_r));
+ m_cpu->port_out_cb<1>().set(FUNC(qs1000_device::p1_w));
+ m_cpu->port_in_cb<2>().set(FUNC(qs1000_device::p2_r));
+ m_cpu->port_out_cb<2>().set(FUNC(qs1000_device::p2_w));
+ m_cpu->port_in_cb<3>().set(FUNC(qs1000_device::p3_r));
+ m_cpu->port_out_cb<3>().set(FUNC(qs1000_device::p3_w));
+ m_cpu->serial_rx_cb().set(FUNC(qs1000_device::data_to_i8052));
+}
//-------------------------------------------------
diff --git a/src/devices/sound/samples.h b/src/devices/sound/samples.h
index be5684bc37c..f3b6033021f 100644
--- a/src/devices/sound/samples.h
+++ b/src/devices/sound/samples.h
@@ -56,7 +56,18 @@ public:
// configuration helpers
void set_channels(uint8_t channels) { m_channels = channels; }
void set_samples_names(const char *const *names) { m_names = names; }
+
+ // start callback helpers
template <typename Object> void set_samples_start_callback(Object &&cb) { m_samples_start_cb = std::forward<Object>(cb); }
+ void set_samples_start_callback(start_cb_delegate callback) { m_samples_start_cb = callback; }
+ template <class FunctionClass> void set_samples_start_callback(const char *devname, void (FunctionClass::*callback)(), const char *name)
+ {
+ set_samples_start_callback(start_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ }
+ template <class FunctionClass> void set_samples_start_callback(void (FunctionClass::*callback)(), const char *name)
+ {
+ set_samples_start_callback(start_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
// getters
bool playing(uint8_t channel) const;
diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h
index 88ff1b5271c..4f119025185 100644
--- a/src/devices/sound/upd7759.h
+++ b/src/devices/sound/upd7759.h
@@ -103,6 +103,7 @@ class upd7759_device : public upd775x_device
{
public:
template <class Object> devcb_base &set_drq_callback(Object &&cb) { return m_drqcallback.set_callback(std::forward<Object>(cb)); }
+ auto drq() { return m_drqcallback.bind(); }
upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = STANDARD_CLOCK);
diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp
index 6a1ffb04994..f0bdabb9ec8 100644
--- a/src/mame/drivers/applix.cpp
+++ b/src/mame/drivers/applix.cpp
@@ -853,18 +853,20 @@ MACHINE_CONFIG_START(applix_state::applix)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", M68000, 30_MHz_XTAL / 4) // MC68000-P10 @ 7.5 MHz
MCFG_DEVICE_PROGRAM_MAP(applix_mem)
+
MCFG_DEVICE_ADD("subcpu", Z80, 16_MHz_XTAL / 2) // Z80H
MCFG_DEVICE_PROGRAM_MAP(subcpu_mem)
MCFG_DEVICE_IO_MAP(subcpu_io)
- MCFG_DEVICE_ADD("kbdcpu", I8051, 11060250)
- MCFG_DEVICE_PROGRAM_MAP(keytronic_pc3270_program)
- MCFG_DEVICE_IO_MAP(keytronic_pc3270_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, applix_state, p1_read))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, applix_state, p1_write))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, applix_state, p2_read))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, applix_state, p2_write))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, applix_state, p3_read))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, applix_state, p3_write))
+
+ i8051_device &kbdcpu(I8051(config, "kbdcpu", 11060250));
+ kbdcpu.set_addrmap(AS_PROGRAM, &applix_state::keytronic_pc3270_program);
+ kbdcpu.set_addrmap(AS_IO, &applix_state::keytronic_pc3270_io);
+ kbdcpu.port_in_cb<1>().set(FUNC(applix_state::p1_read));
+ kbdcpu.port_out_cb<1>().set(FUNC(applix_state::p1_write));
+ kbdcpu.port_in_cb<2>().set(FUNC(applix_state::p2_read));
+ kbdcpu.port_out_cb<2>().set(FUNC(applix_state::p2_write));
+ kbdcpu.port_in_cb<3>().set(FUNC(applix_state::p3_read));
+ kbdcpu.port_out_cb<3>().set(FUNC(applix_state::p3_write));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp
index 751130d5235..82e63e58ac2 100644
--- a/src/mame/drivers/armedf.cpp
+++ b/src/mame/drivers/armedf.cpp
@@ -1560,10 +1560,10 @@ MACHINE_CONFIG_START(bigfghtr_state::bigfghtr)
MCFG_DEVICE_PROGRAM_MAP(bigfghtr_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", armedf_state, irq1_line_assert)
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(16'000'000)/2) // verified
- MCFG_DEVICE_PROGRAM_MAP(bigfghtr_mcu_map)
- MCFG_DEVICE_IO_MAP(bigfghtr_mcu_io_map)
- MCFG_MCS51_PORT_P1_IN_CB(CONSTANT(0xdf)) // bit 5: bus contention related?
+ i8751_device &mcu(I8751(config, "mcu", XTAL(16'000'000)/2)); // verified
+ mcu.set_addrmap(AS_PROGRAM, &bigfghtr_state::bigfghtr_mcu_map);
+ mcu.set_addrmap(AS_IO, &bigfghtr_state::bigfghtr_mcu_io_map);
+ mcu.port_in_cb<1>().set_constant(0xdf); // bit 5: bus contention related?
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index e9ed3809715..65c7b55bf3d 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -881,10 +881,10 @@ MACHINE_CONFIG_START(artmagic_state::shtstar)
YM2149(config, "aysnd", 3686400/2).add_route(ALL_OUTPUTS, "mono", 0.10);
/*gun board cpu*/
- MCFG_DEVICE_ADD("guncpu", I80C31, 6000000)
- MCFG_DEVICE_IO_MAP(shtstar_guncpu_io_map)
- MCFG_DEVICE_PROGRAM_MAP(shtstar_guncpu_map)
- MCFG_MCS51_PORT_P1_IN_CB(CONSTANT(0)) // ?
+ i80c31_device &guncpu(I80C31(config, "guncpu", 6000000));
+ guncpu.set_addrmap(AS_PROGRAM, &artmagic_state::shtstar_guncpu_map);
+ guncpu.set_addrmap(AS_IO, &artmagic_state::shtstar_guncpu_io_map);
+ guncpu.port_in_cb<1>().set_constant(0); // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/barata.cpp b/src/mame/drivers/barata.cpp
index c635ef52099..90e72d01e12 100644
--- a/src/mame/drivers/barata.cpp
+++ b/src/mame/drivers/barata.cpp
@@ -62,7 +62,7 @@ private:
unsigned char row_selection;
void fpga_send(unsigned char cmd);
virtual void machine_start() override { m_digits.resolve(); m_lamps.resolve(); }
- required_device<cpu_device> m_maincpu;
+ required_device<i8051_device> m_maincpu;
output_finder<4> m_digits;
output_finder<16> m_lamps;
};
@@ -309,12 +309,12 @@ READ8_MEMBER(barata_state::port2_r)
MACHINE_CONFIG_START(barata_state::barata)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8051, CPU_CLOCK)
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, barata_state, port0_w))
- MCFG_MCS51_PORT_P1_IN_CB(IOPORT("PORT1"))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, barata_state, port2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, barata_state, port2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, barata_state, fpga_w))
+ I8051(config, m_maincpu, CPU_CLOCK);
+ m_maincpu->port_out_cb<0>().set(FUNC(barata_state::port0_w));
+ m_maincpu->port_in_cb<1>().set_ioport("PORT1");
+ m_maincpu->port_in_cb<2>().set(FUNC(barata_state::port2_r));
+ m_maincpu->port_out_cb<2>().set(FUNC(barata_state::port2_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(barata_state::fpga_w));
config.set_default_layout(layout_barata);
diff --git a/src/mame/drivers/basic52.cpp b/src/mame/drivers/basic52.cpp
index 9d04b0cb9b1..3ed021fffb6 100644
--- a/src/mame/drivers/basic52.cpp
+++ b/src/mame/drivers/basic52.cpp
@@ -105,32 +105,34 @@ void basic52_state::kbd_put(u8 data)
m_term_data = data;
}
-MACHINE_CONFIG_START(basic52_state::basic31)
+void basic52_state::basic31(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8031, XTAL(11'059'200))
- MCFG_DEVICE_PROGRAM_MAP(basic52_mem)
- MCFG_DEVICE_IO_MAP(basic52_io)
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, basic52_state, unk_r))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(m_terminal, generic_terminal_device, write))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, basic52_state, from_term))
+ I8031(config, m_maincpu, XTAL(11'059'200));
+ m_maincpu->set_addrmap(AS_PROGRAM, &basic52_state::basic52_mem);
+ m_maincpu->set_addrmap(AS_IO, &basic52_state::basic52_io);
+ m_maincpu->port_in_cb<3>().set(FUNC(basic52_state::unk_r));
+ m_maincpu->serial_tx_cb().set(m_terminal, FUNC(generic_terminal_device::write));
+ m_maincpu->serial_rx_cb().set(FUNC(basic52_state::from_term));
/* video hardware */
- MCFG_DEVICE_ADD(m_terminal, GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(basic52_state, kbd_put))
+ GENERIC_TERMINAL(config, m_terminal, 0);
+ m_terminal->set_keyboard_callback(KEYBOARDCB_PUT(basic52_state, kbd_put));
- MCFG_DEVICE_ADD("ppi8255", I8255, 0)
-MACHINE_CONFIG_END
+ I8255(config, "ppi8255", 0);
+}
-MACHINE_CONFIG_START(basic52_state::basic52)
+void basic52_state::basic52(machine_config &config)
+{
basic31(config);
/* basic machine hardware */
- MCFG_DEVICE_REPLACE("maincpu", I8052, XTAL(11'059'200))
- MCFG_DEVICE_PROGRAM_MAP(basic52_mem)
- MCFG_DEVICE_IO_MAP(basic52_io)
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, basic52_state, unk_r))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(m_terminal, generic_terminal_device, write))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, basic52_state, from_term))
-MACHINE_CONFIG_END
+ I8052(config.replace(), m_maincpu, XTAL(11'059'200));
+ m_maincpu->set_addrmap(AS_PROGRAM, &basic52_state::basic52_mem);
+ m_maincpu->set_addrmap(AS_IO, &basic52_state::basic52_io);
+ m_maincpu->port_in_cb<3>().set(FUNC(basic52_state::unk_r));
+ m_maincpu->serial_tx_cb().set(m_terminal, FUNC(generic_terminal_device::write));
+ m_maincpu->serial_rx_cb().set(FUNC(basic52_state::from_term));
+}
/* ROM definition */
ROM_START( basic52 )
diff --git a/src/mame/drivers/bionicc.cpp b/src/mame/drivers/bionicc.cpp
index 90509c086cc..003dccc8ea1 100644
--- a/src/mame/drivers/bionicc.cpp
+++ b/src/mame/drivers/bionicc.cpp
@@ -405,10 +405,10 @@ MACHINE_CONFIG_START(bionicc_state::bionicc)
MCFG_DEVICE_PERIODIC_INT_DRIVER(bionicc_state, nmi_line_pulse, 4*60)
/* Protection MCU Intel C8751H-88 runs at 24MHz / 4 = 6MHz */
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(24'000'000) / 4)
- MCFG_DEVICE_IO_MAP(mcu_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, bionicc_state, out1_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, bionicc_state, out3_w))
+ I8751(config, m_mcu, XTAL(24'000'000) / 4);
+ m_mcu->set_addrmap(AS_IO, &bionicc_state::mcu_io);
+ m_mcu->port_out_cb<1>().set(FUNC(bionicc_state::out1_w));
+ m_mcu->port_out_cb<3>().set(FUNC(bionicc_state::out3_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/blktiger.cpp b/src/mame/drivers/blktiger.cpp
index d49d094e458..ae241fc20bd 100644
--- a/src/mame/drivers/blktiger.cpp
+++ b/src/mame/drivers/blktiger.cpp
@@ -18,7 +18,6 @@
#include "emu.h"
#include "includes/blktiger.h"
-#include "cpu/mcs51/mcs51.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
@@ -296,16 +295,16 @@ MACHINE_CONFIG_START(blktiger_state::blktiger)
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(24'000'000)/4) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(blktiger_map)
MCFG_DEVICE_IO_MAP(blktiger_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", blktiger_state, irq0_line_hold)
+ MCFG_DEVICE_VBLANK_INT_DRIVER("screen", blktiger_state, irq0_line_hold)
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(blktiger_sound_map)
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(24'000'000)/4) /* ??? */
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, blktiger_state, blktiger_from_main_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, blktiger_state, blktiger_to_main_w))
+ I8751(config, m_mcu, XTAL(24'000'000)/4); /* ??? */
+ m_mcu->port_in_cb<0>().set(FUNC(blktiger_state::blktiger_from_main_r));
+ m_mcu->port_out_cb<0>().set(FUNC(blktiger_state::blktiger_to_main_w));
// other ports unknown
- //MCFG_DEVICE_VBLANK_INT_DRIVER("screen", blktiger_state, irq0_line_hold)
+ //m_mcu->set_vblank_int("screen", FUNC(blktiger_state::irq0_line_hold));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/cardline.cpp b/src/mame/drivers/cardline.cpp
index 62ce1754afa..f120bd28803 100644
--- a/src/mame/drivers/cardline.cpp
+++ b/src/mame/drivers/cardline.cpp
@@ -78,7 +78,7 @@ protected:
uint8_t m_video;
uint8_t m_hsync_q;
- required_device<cpu_device> m_maincpu;
+ required_device<i80c32_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
@@ -90,7 +90,7 @@ void cardline_state::machine_start()
m_lamps.resolve();
m_video = 0;
m_hsync_q = 1;
- for (int i=0; i < 0x2000; i++)
+ for (int i = 0; i < 0x2000; i++)
m_maincpu.target()->space(AS_IO).write_byte(i, 0x73);
save_item(NAME(m_video));
save_item(NAME(m_hsync_q));
@@ -325,13 +325,13 @@ PALETTE_INIT_MEMBER(cardline_state, cardline)
MACHINE_CONFIG_START(cardline_state::cardline)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C32, MASTER_CLOCK)
- MCFG_MCS51_PORT1_CONFIG(0x10)
- MCFG_DEVICE_PROGRAM_MAP(mem_prg)
- MCFG_DEVICE_IO_MAP(mem_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, cardline_state, hsync_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, cardline_state, video_w))
- //MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cardline_state, irq1_line_hold)
+ I80C32(config, m_maincpu, MASTER_CLOCK);
+ m_maincpu->set_port_forced_input(1, 0x10);
+ m_maincpu->set_addrmap(AS_PROGRAM, &cardline_state::mem_prg);
+ m_maincpu->set_addrmap(AS_IO, &cardline_state::mem_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(cardline_state::hsync_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(cardline_state::video_w));
+ //m_maincpu->set_vblank_int("screen", FUNC(cardline_state::irq1_line_hold));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp
index 5bf11a65c8a..00c987e9332 100644
--- a/src/mame/drivers/cdi.cpp
+++ b/src/mame/drivers/cdi.cpp
@@ -930,39 +930,37 @@ READ8_MEMBER( cdi_state::quizard_mcu_p1_r )
return machine().rand();
}
-MACHINE_CONFIG_START(cdi_state::quizard1)
+void cdi_state::quizard1(machine_config &config)
+{
quizard(config);
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard1 )
-
- MCFG_DEVICE_ADD("mcu", I8751, 8000000)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, cdi_state, quizard_mcu_p1_r))
-// MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cdi_state, irq0_line_pulse)
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard1)
-MACHINE_CONFIG_END
+ i8751_device &mcu(I8751(config, "mcu", 8000000));
+ mcu.port_in_cb<1>().set(FUNC(cdi_state::quizard_mcu_p1_r));
+// mcu.set_vblank_int("screen", FUNC(cdi_state::irq0_line_pulse));
+}
-MACHINE_CONFIG_START(cdi_state::quizard2)
+void cdi_state::quizard2(machine_config &config)
+{
quizard(config);
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard2 )
-MACHINE_CONFIG_END
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard2)
+}
-MACHINE_CONFIG_START(cdi_state::quizard3)
+void cdi_state::quizard3(machine_config &config)
+{
quizard(config);
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard3 )
-MACHINE_CONFIG_END
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard3)
+}
-MACHINE_CONFIG_START(cdi_state::quizard4)
+void cdi_state::quizard4(machine_config &config)
+{
quizard(config);
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4 )
-
- MCFG_DEVICE_ADD("mcu", I8751, 8000000)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, cdi_state, quizard_mcu_p1_r))
-// MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cdi_state, irq0_line_pulse)
-
-MACHINE_CONFIG_END
-
-
-
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4)
+ i8751_device &mcu(I8751(config, "mcu", 8000000));
+ mcu.port_in_cb<1>().set(FUNC(cdi_state::quizard_mcu_p1_r));
+// mcu.set_vblank_int("screen", FUNC(cdi_state::irq0_line_pulse));
+}
/*************************
* Rom Load *
diff --git a/src/mame/drivers/controlid.cpp b/src/mame/drivers/controlid.cpp
index 5308bfbc65e..2ae522d8f27 100644
--- a/src/mame/drivers/controlid.cpp
+++ b/src/mame/drivers/controlid.cpp
@@ -144,14 +144,14 @@ PALETTE_INIT_MEMBER(controlidx628_state, controlidx628)
MACHINE_CONFIG_START(controlidx628_state::controlidx628)
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu", AT89S52, XTAL(11'059'200))
- MCFG_DEVICE_IO_MAP(io_map)
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, controlidx628_state, p0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, controlidx628_state, p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, controlidx628_state, p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, controlidx628_state, p2_r))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, controlidx628_state, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, controlidx628_state, p3_w))
+ at89s52_device &maincpu(AT89S52(config, "maincpu", XTAL(11'059'200)));
+ maincpu.set_addrmap(AS_IO, &controlidx628_state::io_map);
+ maincpu.port_out_cb<0>().set(FUNC(controlidx628_state::p0_w));
+ maincpu.port_in_cb<1>().set(FUNC(controlidx628_state::p1_r));
+ maincpu.port_out_cb<1>().set(FUNC(controlidx628_state::p1_w));
+ maincpu.port_in_cb<2>().set(FUNC(controlidx628_state::p2_r));
+ maincpu.port_in_cb<3>().set(FUNC(controlidx628_state::p3_r));
+ maincpu.port_out_cb<3>().set(FUNC(controlidx628_state::p3_w));
// video hardware
MCFG_SCREEN_ADD("screen", LCD)
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index a6d59622aa0..1a12ba87611 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -334,7 +334,6 @@ Notes:
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
#include "cpu/z80/z80.h"
-#include "cpu/mcs51/mcs51.h"
#include "cpu/m6805/m68705.h"
#include "sound/2203intf.h"
#include "sound/3812intf.h"
@@ -1892,12 +1891,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::hbarrel)
dec0(config);
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec0_state, dec0_mcu_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port0_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port3_w))
+ i8751_device &mcu(I8751(config, m_mcu, XTAL(8'000'000)));
+ mcu.port_in_cb<0>().set(FUNC(dec0_state::dec0_mcu_port0_r));
+ mcu.port_out_cb<0>().set(FUNC(dec0_state::dec0_mcu_port0_w));
+ mcu.port_out_cb<1>().set(FUNC(dec0_state::dec0_mcu_port1_w));
+ mcu.port_out_cb<2>().set(FUNC(dec0_state::dec0_mcu_port2_w));
+ mcu.port_out_cb<3>().set(FUNC(dec0_state::dec0_mcu_port3_w));
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
@@ -1907,12 +1906,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::baddudes)
dec0(config);
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec0_state, dec0_mcu_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port0_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, dec0_state, dec0_mcu_port3_w))
+ i8751_device &mcu(I8751(config, m_mcu, XTAL(8'000'000)));
+ mcu.port_in_cb<0>().set(FUNC(dec0_state::dec0_mcu_port0_r));
+ mcu.port_out_cb<0>().set(FUNC(dec0_state::dec0_mcu_port0_w));
+ mcu.port_out_cb<1>().set(FUNC(dec0_state::dec0_mcu_port1_w));
+ mcu.port_out_cb<2>().set(FUNC(dec0_state::dec0_mcu_port2_w));
+ mcu.port_out_cb<3>().set(FUNC(dec0_state::dec0_mcu_port3_w));
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index 1699f73bcea..79e9fc357ce 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -47,7 +47,6 @@ To do:
#include "cpu/m6502/m6502.h"
#include "cpu/m6809/hd6309.h"
#include "cpu/m6809/m6809.h"
-#include "cpu/mcs51/mcs51.h"
#include "machine/deco222.h"
#include "sound/2203intf.h"
#include "sound/3526intf.h"
@@ -2007,13 +2006,13 @@ MACHINE_CONFIG_START(dec8_state::shackled)
MCFG_DEVICE_PROGRAM_MAP(ym3526_s_map)
/* NMIs are caused by the main CPU */
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec8_state, i8751_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec8_state, i8751_port0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, dec8_state, i8751_port1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec8_state, i8751_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec8_state, shackled_mcu_to_main_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("I8751"))
+ I8751(config, m_mcu, XTAL(8'000'000));
+ m_mcu->port_in_cb<0>().set(FUNC(dec8_state::i8751_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(dec8_state::i8751_port0_w));
+ m_mcu->port_in_cb<1>().set(FUNC(dec8_state::i8751_port1_r));
+ m_mcu->port_out_cb<1>().set(FUNC(dec8_state::i8751_port1_w));
+ m_mcu->port_out_cb<2>().set(FUNC(dec8_state::shackled_mcu_to_main_w));
+ m_mcu->port_in_cb<3>().set_ioport("I8751");
// MCFG_QUANTUM_TIME(attotime::from_hz(100000))
MCFG_QUANTUM_PERFECT_CPU("maincpu") // needs heavy sync, otherwise one of the two CPUs will miss an irq and makes the game to hang
@@ -2069,13 +2068,13 @@ MACHINE_CONFIG_START(dec8_state::gondo)
MCFG_DEVICE_PROGRAM_MAP(oscar_s_map)
/* NMIs are caused by the main CPU */
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec8_state, i8751_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec8_state, i8751_port0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, dec8_state, i8751_port1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec8_state, i8751_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec8_state, gondo_mcu_to_main_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("I8751"))
+ I8751(config, m_mcu, XTAL(8'000'000));
+ m_mcu->port_in_cb<0>().set(FUNC(dec8_state::i8751_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(dec8_state::i8751_port0_w));
+ m_mcu->port_in_cb<1>().set(FUNC(dec8_state::i8751_port1_r));
+ m_mcu->port_out_cb<1>().set(FUNC(dec8_state::i8751_port1_w));
+ m_mcu->port_out_cb<2>().set(FUNC(dec8_state::gondo_mcu_to_main_w));
+ m_mcu->port_in_cb<3>().set_ioport("I8751");
/* video hardware */
MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8)
@@ -2129,13 +2128,13 @@ MACHINE_CONFIG_START(dec8_state::garyoret)
MCFG_DEVICE_PROGRAM_MAP(oscar_s_map)
/* NMIs are caused by the main CPU */
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec8_state, i8751_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec8_state, i8751_port0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, dec8_state, i8751_port1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec8_state, i8751_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec8_state, gondo_mcu_to_main_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("I8751"))
+ I8751(config, m_mcu, XTAL(8'000'000));
+ m_mcu->port_in_cb<0>().set(FUNC(dec8_state::i8751_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(dec8_state::i8751_port0_w));
+ m_mcu->port_in_cb<1>().set(FUNC(dec8_state::i8751_port1_r));
+ m_mcu->port_out_cb<1>().set(FUNC(dec8_state::i8751_port1_w));
+ m_mcu->port_out_cb<2>().set(FUNC(dec8_state::gondo_mcu_to_main_w));
+ m_mcu->port_in_cb<3>().set_ioport("I8751");
/* video hardware */
MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8)
@@ -2189,13 +2188,13 @@ MACHINE_CONFIG_START(dec8_state::ghostb)
MCFG_DEVICE_PROGRAM_MAP(dec8_s_map)
/* NMIs are caused by the main CPU */
- MCFG_DEVICE_ADD("mcu", I8751, 3000000*4)
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec8_state, i8751_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec8_state, i8751_port0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, dec8_state, i8751_port1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, dec8_state, i8751_port1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec8_state, gondo_mcu_to_main_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("I8751"))
+ I8751(config, m_mcu, 3000000*4);
+ m_mcu->port_in_cb<0>().set(FUNC(dec8_state::i8751_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(dec8_state::i8751_port0_w));
+ m_mcu->port_in_cb<1>().set(FUNC(dec8_state::i8751_port1_r));
+ m_mcu->port_out_cb<1>().set(FUNC(dec8_state::i8751_port1_w));
+ m_mcu->port_out_cb<3>().set(FUNC(dec8_state::gondo_mcu_to_main_w));
+ m_mcu->port_in_cb<3>().set_ioport("I8751");
/* video hardware */
MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8)
@@ -2374,11 +2373,11 @@ MACHINE_CONFIG_START(dec8_state::srdarwin)
MCFG_DEVICE_PROGRAM_MAP(dec8_s_map)
/* NMIs are caused by the main CPU */
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000)) /* unknown frequency */
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, dec8_state, i8751_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, dec8_state, i8751_port0_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, dec8_state, srdarwin_mcu_to_main_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("I8751"))
+ I8751(config, m_mcu, XTAL(8'000'000)); /* unknown frequency */
+ m_mcu->port_in_cb<0>().set(FUNC(dec8_state::i8751_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(dec8_state::i8751_port0_w));
+ m_mcu->port_out_cb<2>().set(FUNC(dec8_state::srdarwin_mcu_to_main_w));
+ m_mcu->port_in_cb<0>().set_ioport("I8751");
MCFG_QUANTUM_PERFECT_CPU("maincpu") /* needed for stability with emulated MCU or sometimes commands get missed and game crashes at bosses */
diff --git a/src/mame/drivers/djboy.cpp b/src/mame/drivers/djboy.cpp
index 1a2761b80b8..0387de96fe4 100644
--- a/src/mame/drivers/djboy.cpp
+++ b/src/mame/drivers/djboy.cpp
@@ -142,7 +142,6 @@ Notes:
#include "includes/djboy.h"
#include "cpu/z80/z80.h"
-#include "cpu/mcs51/mcs51.h"
#include "sound/2203intf.h"
#include "sound/okim6295.h"
#include "screen.h"
@@ -496,15 +495,15 @@ MACHINE_CONFIG_START(djboy_state::djboy)
MCFG_DEVICE_IO_MAP(soundcpu_port_am)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", djboy_state, irq0_line_hold)
- MCFG_DEVICE_ADD("beast", I80C51, 12_MHz_XTAL / 2) // 6.000MHz, verified
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, djboy_state, beast_p0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, djboy_state, beast_p0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, djboy_state, beast_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, djboy_state, beast_p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, djboy_state, beast_p2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, djboy_state, beast_p2_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, djboy_state, beast_p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, djboy_state, beast_p3_w))
+ I80C51(config, m_beast, 12_MHz_XTAL / 2); // 6.000MHz, verified
+ m_beast->port_in_cb<0>().set(FUNC(djboy_state::beast_p0_r));
+ m_beast->port_out_cb<0>().set(FUNC(djboy_state::beast_p0_w));
+ m_beast->port_in_cb<1>().set(FUNC(djboy_state::beast_p1_r));
+ m_beast->port_out_cb<1>().set(FUNC(djboy_state::beast_p1_w));
+ m_beast->port_in_cb<2>().set(FUNC(djboy_state::beast_p2_r));
+ m_beast->port_out_cb<2>().set(FUNC(djboy_state::beast_p2_w));
+ m_beast->port_in_cb<3>().set(FUNC(djboy_state::beast_p3_r));
+ m_beast->port_out_cb<3>().set(FUNC(djboy_state::beast_p3_w));
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp
index bc5fcedbaed..4ce6fcd539e 100644
--- a/src/mame/drivers/eolith.cpp
+++ b/src/mame/drivers/eolith.cpp
@@ -543,11 +543,11 @@ MACHINE_CONFIG_START(eolith_state::eolith45)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith_state, eolith_speedup, "screen", 0, 1)
/* Sound CPU */
- MCFG_DEVICE_ADD("soundcpu", I8032, XTAL(12'000'000))
- MCFG_DEVICE_PROGRAM_MAP(sound_prg_map)
- MCFG_DEVICE_IO_MAP(sound_io_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, eolith_state, sound_p1_w))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, eolith_state, soundcpu_to_qs1000)) // Sound CPU -> QS1000 CPU serial link
+ I8032(config, m_soundcpu, XTAL(12'000'000));
+ m_soundcpu->set_addrmap(AS_PROGRAM, &eolith_state::sound_prg_map);
+ m_soundcpu->set_addrmap(AS_IO, &eolith_state::sound_io_map);
+ m_soundcpu->port_out_cb<1>().set(FUNC(eolith_state::sound_p1_w));
+ m_soundcpu->serial_tx_cb().set(FUNC(eolith_state::soundcpu_to_qs1000)); // Sound CPU -> QS1000 CPU serial link
MCFG_MACHINE_RESET_OVERRIDE(eolith_state,eolith)
diff --git a/src/mame/drivers/fireball.cpp b/src/mame/drivers/fireball.cpp
index 6600279273f..c95f1cfade6 100644
--- a/src/mame/drivers/fireball.cpp
+++ b/src/mame/drivers/fireball.cpp
@@ -84,7 +84,7 @@ private:
uint8_t m_display_data;
virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
- required_device<cpu_device> m_maincpu;
+ required_device<i8031_device> m_maincpu;
required_device<ay8912_device> m_ay;
required_device<eeprom_serial_x24c44_device> m_eeprom;
output_finder<8> m_digits;
@@ -494,14 +494,16 @@ TIMER_DEVICE_CALLBACK_MEMBER( fireball_state::int_0 )
MACHINE_CONFIG_START(fireball_state::fireball)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8031, CPU_CLK) //
- MCFG_DEVICE_PROGRAM_MAP(fireball_map)
- MCFG_DEVICE_IO_MAP(fireball_io_map)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, fireball_state, p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, fireball_state, p1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, fireball_state, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, fireball_state, p3_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("int_0", fireball_state, int_0, attotime::from_hz(555)) //9ms from scope reading 111Hz take care of this in the handler
+ I8031(config, m_maincpu, CPU_CLK); //
+ m_maincpu->set_addrmap(AS_PROGRAM, &fireball_state::fireball_map);
+ m_maincpu->set_addrmap(AS_IO, &fireball_state::fireball_io_map);
+ m_maincpu->port_in_cb<1>().set(FUNC(fireball_state::p1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(fireball_state::p1_w));
+ m_maincpu->port_in_cb<3>().set(FUNC(fireball_state::p3_r));
+ m_maincpu->port_out_cb<3>().set(FUNC(fireball_state::p3_w));
+
+ //9ms from scope reading 111Hz take care of this in the handler
+ TIMER(config, "int_0", 0).configure_periodic(timer_device::expired_delegate(FUNC(fireball_state::int_0), this), attotime::from_hz(555));
EEPROM_X24C44_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/hprot1.cpp b/src/mame/drivers/hprot1.cpp
index d81f856498d..24d756c9b18 100644
--- a/src/mame/drivers/hprot1.cpp
+++ b/src/mame/drivers/hprot1.cpp
@@ -88,7 +88,7 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
+ required_device<i80c31_device> m_maincpu;
required_device<hd44780_device> m_lcdc;
};
@@ -245,12 +245,12 @@ HD44780_PIXEL_UPDATE(hprot1_state::hprot1_pixel_update)
MACHINE_CONFIG_START(hprot1_state::hprot1)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, XTAL(10'000'000))
- MCFG_DEVICE_PROGRAM_MAP(i80c31_prg)
- MCFG_DEVICE_IO_MAP(i80c31_io)
- MCFG_MCS51_PORT_P1_IN_CB(IOPORT("inputs"))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, hprot1_state, henry_p1_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, hprot1_state, henry_p3_w))
+ I80C31(config, m_maincpu, XTAL(10'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &hprot1_state::i80c31_prg);
+ m_maincpu->set_addrmap(AS_IO, &hprot1_state::i80c31_io);
+ m_maincpu->port_in_cb<1>().set_ioport("inputs");
+ m_maincpu->port_out_cb<1>().set(FUNC(hprot1_state::henry_p1_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(hprot1_state::henry_p3_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", LCD)
diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp
index 525750f2772..ed5a01ffbe2 100644
--- a/src/mame/drivers/hvyunit.cpp
+++ b/src/mame/drivers/hvyunit.cpp
@@ -107,7 +107,7 @@ private:
/* Devices */
required_device<cpu_device> m_mastercpu;
required_device<cpu_device> m_slavecpu;
- required_device<cpu_device> m_mermaid;
+ required_device<i80c51_device> m_mermaid;
required_device<cpu_device> m_soundcpu;
required_device<kaneko_pandora_device> m_pandora;
required_device<gfxdecode_device> m_gfxdecode;
@@ -635,15 +635,15 @@ MACHINE_CONFIG_START(hvyunit_state::hvyunit)
MCFG_DEVICE_IO_MAP(sound_io)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", hvyunit_state, irq0_line_hold)
- MCFG_DEVICE_ADD("mermaid", I80C51, XTAL(12'000'000)/2) /* 6MHz verified on PCB */
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, hvyunit_state, mermaid_p0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, hvyunit_state, mermaid_p0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, hvyunit_state, mermaid_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, hvyunit_state, mermaid_p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, hvyunit_state, mermaid_p2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, hvyunit_state, mermaid_p2_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, hvyunit_state, mermaid_p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, hvyunit_state, mermaid_p3_w))
+ I80C51(config, m_mermaid, XTAL(12'000'000)/2); /* 6MHz verified on PCB */
+ m_mermaid->port_in_cb<0>().set(FUNC(hvyunit_state::mermaid_p0_r));
+ m_mermaid->port_out_cb<0>().set(FUNC(hvyunit_state::mermaid_p0_w));
+ m_mermaid->port_in_cb<1>().set(FUNC(hvyunit_state::mermaid_p1_r));
+ m_mermaid->port_out_cb<1>().set(FUNC(hvyunit_state::mermaid_p1_w));
+ m_mermaid->port_in_cb<2>().set(FUNC(hvyunit_state::mermaid_p2_r));
+ m_mermaid->port_out_cb<2>().set(FUNC(hvyunit_state::mermaid_p2_w));
+ m_mermaid->port_in_cb<3>().set(FUNC(hvyunit_state::mermaid_p3_r));
+ m_mermaid->port_out_cb<3>().set(FUNC(hvyunit_state::mermaid_p3_w));
GENERIC_LATCH_8(config, m_mermaidlatch);
m_mermaidlatch->data_pending_callback().set_inputline(m_mermaid, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/icatel.cpp b/src/mame/drivers/icatel.cpp
index 0b4828950e8..5d670832121 100644
--- a/src/mame/drivers/icatel.cpp
+++ b/src/mame/drivers/icatel.cpp
@@ -74,7 +74,7 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
+ required_device<i80c31_device> m_maincpu;
required_device<hd44780_device> m_lcdc;
};
@@ -254,14 +254,14 @@ HD44780_PIXEL_UPDATE(icatel_state::icatel_pixel_update)
MACHINE_CONFIG_START(icatel_state::icatel)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, XTAL(2'097'152))
- MCFG_DEVICE_PROGRAM_MAP(i80c31_prg)
- MCFG_DEVICE_DATA_MAP(i80c31_data)
- MCFG_DEVICE_IO_MAP(i80c31_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, icatel_state, i80c31_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, icatel_state, i80c31_p1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, icatel_state, i80c31_p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, icatel_state, i80c31_p3_w))
+ I80C31(config, m_maincpu, XTAL(2'097'152));
+ m_maincpu->set_addrmap(AS_PROGRAM, &icatel_state::i80c31_prg);
+ m_maincpu->set_addrmap(AS_DATA, &icatel_state::i80c31_data);
+ m_maincpu->set_addrmap(AS_IO, &icatel_state::i80c31_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(icatel_state::i80c31_p1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(icatel_state::i80c31_p1_w));
+ m_maincpu->port_in_cb<3>().set(FUNC(icatel_state::i80c31_p3_r));
+ m_maincpu->port_out_cb<3>().set(FUNC(icatel_state::i80c31_p3_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", LCD)
diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp
index e830f63dd56..bfd08cd9e87 100644
--- a/src/mame/drivers/karnov.cpp
+++ b/src/mame/drivers/karnov.cpp
@@ -832,15 +832,16 @@ void karnov_state::chelnovjbl_mcu_map(address_map &map)
}
-MACHINE_CONFIG_START(karnov_state::chelnovjbl)
+void karnov_state::chelnovjbl(machine_config &config)
+{
karnov(config);
- MCFG_DEVICE_ADD("mcu", I8031, 2000000) // ??mhz
- MCFG_DEVICE_PROGRAM_MAP(chelnovjbl_mcu_map)
-// MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, karnov_state, p1_r))
-// MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, karnov_state, p1_w))
-// MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, karnov_state, p3_r))
-// MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, karnov_state, p3_w))
-MACHINE_CONFIG_END
+ i8031_device &mcu(I8031(config, "mcu", 2000000)); // ??mhz
+ mcu.set_addrmap(AS_PROGRAM, &karnov_state::chelnovjbl_mcu_map);
+// mcu.port_in_cb<1>().set(FUNC(karnov_state::p1_r));
+// mcu.port_out_cb<1>().set(FUNC(karnov_state::p1_w));
+// mcu.port_in_cb<3>().set(FUNC(karnov_state::p3_r));
+// mcu.port_out_cb<3>().set(FUNC(karnov_state::p3_w));
+}
diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp
index 3a709cd28d9..9ec24d9ff16 100644
--- a/src/mame/drivers/limenko.cpp
+++ b/src/mame/drivers/limenko.cpp
@@ -750,11 +750,11 @@ MACHINE_CONFIG_START(limenko_state::spotty)
MCFG_DEVICE_IO_MAP(spotty_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", limenko_state, irq0_line_hold)
- MCFG_DEVICE_ADD("audiocpu", AT89C4051, 4000000) /* 4 MHz */
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, limenko_state, spotty_sound_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8("oki", okim6295_device, write)) //? sound latch and ?
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, limenko_state, spotty_sound_cmd_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, limenko_state, spotty_sound_cmd_w)) //not sure about anything...
+ at89c4051_device &audiocpu(AT89C4051(config, "audiocpu", 4000000)); /* 4 MHz */
+ audiocpu.port_in_cb<1>().set(FUNC(limenko_state::spotty_sound_r));
+ audiocpu.port_out_cb<1>().set("oki", FUNC(okim6295_device::write)); //? sound latch and ?
+ audiocpu.port_in_cb<3>().set(FUNC(limenko_state::spotty_sound_cmd_r));
+ audiocpu.port_out_cb<3>().set(FUNC(limenko_state::spotty_sound_cmd_w)); //not sure about anything...
EEPROM_93C46_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index b95dffc2804..ed0965b93c9 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -188,7 +188,6 @@ other supported games as well.
#include "includes/m72.h"
#include "includes/iremipt.h"
-#include "cpu/mcs51/mcs51.h"
#include "cpu/nec/nec.h"
#include "cpu/nec/v25.h"
#include "cpu/z80/z80.h"
@@ -1802,7 +1801,8 @@ static GFXDECODE_START( gfx_majtitle )
GFXDECODE_END
-MACHINE_CONFIG_START(m72_state::m72_audio_chips)
+void m72_state::m72_audio_chips(machine_config &config)
+{
/* sound hardware */
SPEAKER(config, "speaker").front_center();
@@ -1812,60 +1812,62 @@ MACHINE_CONFIG_START(m72_state::m72_audio_chips)
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline(m_soundcpu, 0);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("soundirq", rst_neg_buffer_device, inta_cb)
+ m_soundcpu->set_irq_acknowledge_callback("soundirq", FUNC(rst_neg_buffer_device::inta_cb));
- MCFG_DEVICE_ADD("m72", IREM_M72_AUDIO)
+ IREM_M72_AUDIO(config, "m72");
ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_CLOCK));
ymsnd.irq_handler().set("soundirq", FUNC(rst_neg_buffer_device::rst28_w));
ymsnd.add_route(ALL_OUTPUTS, "speaker", 1.0);
- MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) // unknown DAC
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
-MACHINE_CONFIG_END
+ DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.2); // unknown DAC
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
+ vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
+}
MACHINE_CONFIG_START(m72_state::m72_base)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",V30,MASTER_CLOCK/2/2) /* 16 MHz external freq (8MHz internal) */
- MCFG_DEVICE_PROGRAM_MAP(m72_map)
- MCFG_DEVICE_IO_MAP(m72_portmap)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
- MCFG_DEVICE_ADD("soundcpu",Z80, SOUND_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(sound_ram_map)
- MCFG_DEVICE_IO_MAP(sound_portmap)
+ V30(config, m_maincpu, MASTER_CLOCK/2/2); /* 16 MHz external freq (8MHz internal) */
+ m_maincpu->set_addrmap(AS_PROGRAM, &m72_state::m72_map);
+ m_maincpu->set_addrmap(AS_IO, &m72_state::m72_portmap);
+ m_maincpu->set_irq_acknowledge_callback("upd71059c", FUNC(pic8259_device::inta_cb));
+
+ Z80(config, m_soundcpu, SOUND_CLOCK);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &m72_state::sound_ram_map);
+ m_soundcpu->set_addrmap(AS_IO, &m72_state::sound_portmap);
PIC8259(config, m_upd71059c, 0);
m_upd71059c->out_int_callback().set_inputline(m_maincpu, 0);
/* video hardware */
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m72)
- MCFG_PALETTE_ADD("palette", 512)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_m72);
+ PALETTE(config, m_palette, 512);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
- MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256);
+ m_screen->set_screen_update(FUNC(m72_state::screen_update));
+ m_screen->set_palette(m_palette);
MCFG_VIDEO_START_OVERRIDE(m72_state,m72)
m72_audio_chips(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(m72_state::m72)
+void m72_state::m72(machine_config &config)
+{
m72_base(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, fake_nmi, 128*55) /* clocked by V1? (Vigilante) */
- /* IRQs are generated by main Z80 and YM2151 */
-MACHINE_CONFIG_END
+ m_soundcpu->set_periodic_int(FUNC(m72_state::fake_nmi), attotime::from_hz(128*55)); /* clocked by V1? (Vigilante) */
+ /* IRQs are generated by main Z80 and YM2151 */
+}
-MACHINE_CONFIG_START(m72_state::m72_8751)
+void m72_state::m72_8751(machine_config &config)
+{
m72_base(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(m72_protected_map)
- MCFG_DEVICE_IO_MAP(m72_protected_portmap)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m72_state::m72_protected_map);
+ m_maincpu->set_addrmap(AS_IO, &m72_state::m72_protected_portmap);
MB8421_MB8431_16BIT(config, m_dpram);
//m_dpram->intl_callback().set(m_upd71059c, FUNC(pic8259_device::ir3_w)); // not actually used?
@@ -1875,46 +1877,40 @@ MACHINE_CONFIG_START(m72_state::m72_8751)
mculatch.data_pending_callback().set_inputline(m_mcu, MCS51_INT1_LINE);
mculatch.set_separate_acknowledge(true);
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000)) /* Uses its own XTAL */
- MCFG_DEVICE_IO_MAP(mcu_io_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, m72_state, mcu_port1_w))
-MACHINE_CONFIG_END
+ I8751(config, m_mcu, XTAL(8'000'000)); /* Uses its own XTAL */
+ m_mcu->set_addrmap(AS_IO, &m72_state::mcu_io_map);
+ m_mcu->port_out_cb<1>().set(FUNC(m72_state::mcu_port1_w));
+}
-MACHINE_CONFIG_START(m72_state::rtype)
+void m72_state::rtype(machine_config &config)
+{
m72_base(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(rtype_map)
-
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(rtype_sound_portmap)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m72_state::rtype_map);
+ m_soundcpu->set_addrmap(AS_IO, &m72_state::rtype_sound_portmap);
- MCFG_DEVICE_REMOVE("m72")
- MCFG_DEVICE_REMOVE("dac")
- MCFG_DEVICE_REMOVE("vref")
-MACHINE_CONFIG_END
+ config.device_remove("m72");
+ config.device_remove("dac");
+ config.device_remove("vref");
+}
-MACHINE_CONFIG_START(m72_state::m72_xmultipl)
+void m72_state::m72_xmultipl(machine_config &config)
+{
m72_8751(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(xmultiplm72_map)
-
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
- /* IRQs are generated by main Z80 and YM2151 */
-
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &m72_state::xmultiplm72_map);
+ m_soundcpu->set_periodic_int(FUNC(m72_state::nmi_line_pulse), attotime::from_hz(128*55)); /* clocked by V1? (Vigilante) */
+ /* IRQs are generated by main Z80 and YM2151 */
+}
-MACHINE_CONFIG_START(m72_state::m72_dbreed)
+void m72_state::m72_dbreed(machine_config &config)
+{
m72_base(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(dbreedm72_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m72_state::dbreedm72_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
- /* IRQs are generated by main Z80 and YM2151 */
-MACHINE_CONFIG_END
+ m_soundcpu->set_periodic_int(FUNC(m72_state::nmi_line_pulse), attotime::from_hz(128*55)); /* clocked by V1? (Vigilante) */
+ /* IRQs are generated by main Z80 and YM2151 */
+}
@@ -1965,7 +1961,7 @@ MACHINE_CONFIG_START(m72_state::rtype2)
MCFG_DEVICE_IO_MAP(m84_portmap)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
- MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK)
+ MCFG_DEVICE_ADD(m_soundcpu, Z80, SOUND_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(sound_rom_map)
MCFG_DEVICE_IO_MAP(rtype2_sound_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
@@ -2008,7 +2004,7 @@ MACHINE_CONFIG_START(m72_state::cosmccop)
MCFG_DEVICE_PROGRAM_MAP(kengo_map)
MCFG_DEVICE_IO_MAP(m84_v33_portmap)
- MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK)
+ MCFG_DEVICE_ADD(m_soundcpu, Z80, SOUND_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(sound_rom_map)
MCFG_DEVICE_IO_MAP(rtype2_sound_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
@@ -2055,7 +2051,7 @@ MACHINE_CONFIG_START(m72_state::m82)
MCFG_DEVICE_PROGRAM_MAP(m82_map)
MCFG_DEVICE_IO_MAP(m82_portmap)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
- MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK)
+ MCFG_DEVICE_ADD(m_soundcpu, Z80, SOUND_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(sound_rom_map)
MCFG_DEVICE_IO_MAP(rtype2_sound_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
@@ -2090,7 +2086,7 @@ MACHINE_CONFIG_START(m72_state::poundfor)
MCFG_DEVICE_PROGRAM_MAP(rtype2_map)
MCFG_DEVICE_IO_MAP(poundfor_portmap)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
- MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK)
+ MCFG_DEVICE_ADD(m_soundcpu, Z80, SOUND_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(sound_rom_map)
MCFG_DEVICE_IO_MAP(poundfor_sound_portmap)
MCFG_DEVICE_PERIODIC_INT_DRIVER(m72_state, fake_nmi, 128*55) /* clocked by V1? (Vigilante) */
diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp
index 79afee44c9a..cb203d2c0eb 100644
--- a/src/mame/drivers/maygay1b.cpp
+++ b/src/mame/drivers/maygay1b.cpp
@@ -767,13 +767,13 @@ MACHINE_CONFIG_START(maygay1b_state::maygay_m1)
MCFG_DEVICE_ADD("maincpu", MC6809, M1_MASTER_CLOCK/2) // claimed to be 4 MHz
MCFG_DEVICE_PROGRAM_MAP(m1_memmap)
- MCFG_DEVICE_ADD("mcu", I80C51, 2000000) // EP840034.A-P-80C51AVW
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, maygay1b_state, mcu_port0_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, maygay1b_state, mcu_port0_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, maygay1b_state, mcu_port1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, maygay1b_state, mcu_port2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, maygay1b_state, mcu_port2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, maygay1b_state, mcu_port3_w))
+ I80C51(config, m_mcu, 2000000); // EP840034.A-P-80C51AVW
+ m_mcu->port_in_cb<0>().set(FUNC(maygay1b_state::mcu_port0_r));
+ m_mcu->port_out_cb<0>().set(FUNC(maygay1b_state::mcu_port0_w));
+ m_mcu->port_out_cb<1>().set(FUNC(maygay1b_state::mcu_port1_w));
+ m_mcu->port_in_cb<2>().set(FUNC(maygay1b_state::mcu_port2_r));
+ m_mcu->port_out_cb<2>().set(FUNC(maygay1b_state::mcu_port2_w));
+ m_mcu->port_out_cb<3>().set(FUNC(maygay1b_state::mcu_port3_w));
MCFG_DEVICE_ADD("duart68681", MC68681, M1_DUART_CLOCK)
MCFG_MC68681_IRQ_CALLBACK(WRITELINE(*this, maygay1b_state, duart_irq_handler))
diff --git a/src/mame/drivers/maygayv1.cpp b/src/mame/drivers/maygayv1.cpp
index 141a82de1e6..f027400471f 100644
--- a/src/mame/drivers/maygayv1.cpp
+++ b/src/mame/drivers/maygayv1.cpp
@@ -882,12 +882,12 @@ MACHINE_CONFIG_START(maygayv1_state::maygayv1)
MCFG_DEVICE_ADD("maincpu", M68000, MASTER_CLOCK / 2)
MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_ADD("soundcpu", I8052, SOUND_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(sound_prg)
- MCFG_DEVICE_DATA_MAP(sound_data)
- MCFG_DEVICE_IO_MAP(sound_io)
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, maygayv1_state, data_from_i8031))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, maygayv1_state, data_to_i8031))
+ I8052(config, m_soundcpu, SOUND_CLOCK);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &maygayv1_state::sound_prg);
+ m_soundcpu->set_addrmap(AS_DATA, &maygayv1_state::sound_data);
+ m_soundcpu->set_addrmap(AS_IO, &maygayv1_state::sound_io);
+ m_soundcpu->serial_tx_cb().set(FUNC(maygayv1_state::data_from_i8031));
+ m_soundcpu->serial_rx_cb().set(FUNC(maygayv1_state::data_to_i8031));
/* U25 ST 2 9148 EF68B21P */
pia6821_device &pia(PIA6821(config, "pia", 0));
diff --git a/src/mame/drivers/mephistp.cpp b/src/mame/drivers/mephistp.cpp
index eb3d27e56a8..aedff4d87b3 100644
--- a/src/mame/drivers/mephistp.cpp
+++ b/src/mame/drivers/mephistp.cpp
@@ -180,13 +180,13 @@ MACHINE_CONFIG_START(mephisto_pinball_state::mephisto)
//i8155_device &i8155_2(I8155(config, "ic9", XTAL(18'000'000)/6));
//i8155_2.out_to_callback().set(FUNC(mephisto_pinball_state::clk_shift_w));
- MCFG_DEVICE_ADD("soundcpu", I8051, XTAL(12'000'000))
- MCFG_DEVICE_PROGRAM_MAP(mephisto_8051_map) // EA tied high for external program ROM
- MCFG_DEVICE_IO_MAP(mephisto_8051_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, mephisto_pinball_state, ay8910_read))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, mephisto_pinball_state, ay8910_write))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, mephisto_pinball_state, t0_t1_w))
- MCFG_MCS51_SERIAL_RX_CB(CONSTANT(0)) // from MUART
+ i8051_device &soundcpu(I8051(config, "soundcpu", XTAL(12'000'000)));
+ soundcpu.set_addrmap(AS_PROGRAM, &mephisto_pinball_state::mephisto_8051_map); // EA tied high for external program ROM
+ soundcpu.set_addrmap(AS_IO, &mephisto_pinball_state::mephisto_8051_io);
+ soundcpu.port_in_cb<1>().set(FUNC(mephisto_pinball_state::ay8910_read));
+ soundcpu.port_out_cb<1>().set(FUNC(mephisto_pinball_state::ay8910_write));
+ soundcpu.port_out_cb<3>().set(FUNC(mephisto_pinball_state::t0_t1_w));
+ soundcpu.serial_rx_cb().set_constant(0); // from MUART
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index a355be529d5..10034b78637 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -321,15 +321,15 @@ MACHINE_CONFIG_START(micro3d_state::micro3d)
scc8530_device &scc(SCC8530N(config, "scc", 32_MHz_XTAL / 2 / 2));
scc.out_txdb_callback().set("monitor_drmath", FUNC(rs232_port_device::write_txd));
- MCFG_DEVICE_ADD("audiocpu", I8051, 11.0592_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP(soundmem_prg)
- MCFG_DEVICE_IO_MAP(soundmem_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, micro3d_state, micro3d_sound_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, micro3d_state, micro3d_sound_p1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, micro3d_state, micro3d_sound_p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, micro3d_state, micro3d_sound_p3_w))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, micro3d_state, data_from_i8031))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, micro3d_state, data_to_i8031))
+ I8051(config, m_audiocpu, 11.0592_MHz_XTAL);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &micro3d_state::soundmem_prg);
+ m_audiocpu->set_addrmap(AS_IO, &micro3d_state::soundmem_io);
+ m_audiocpu->port_in_cb<1>().set(FUNC(micro3d_state::micro3d_sound_p1_r));
+ m_audiocpu->port_out_cb<1>().set(FUNC(micro3d_state::micro3d_sound_p1_w));
+ m_audiocpu->port_in_cb<3>().set(FUNC(micro3d_state::micro3d_sound_p3_r));
+ m_audiocpu->port_out_cb<3>().set(FUNC(micro3d_state::micro3d_sound_p3_w));
+ m_audiocpu->serial_tx_cb().set(FUNC(micro3d_state::data_from_i8031));
+ m_audiocpu->serial_rx_cb().set(FUNC(micro3d_state::data_to_i8031));
MCFG_DEVICE_ADD("duart", MC68681, 3.6864_MHz_XTAL)
MCFG_MC68681_IRQ_CALLBACK(WRITELINE(*this, micro3d_state, duart_irq_handler))
diff --git a/src/mame/drivers/minicom.cpp b/src/mame/drivers/minicom.cpp
index 8b61f4273be..d759d20b58b 100644
--- a/src/mame/drivers/minicom.cpp
+++ b/src/mame/drivers/minicom.cpp
@@ -70,7 +70,7 @@ private:
int m_digit_index;
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
+ required_device<i87c52_device> m_maincpu;
output_finder<20> m_digits;
};
@@ -219,24 +219,25 @@ void minicom_state::init_minicom()
{
}
-MACHINE_CONFIG_START(minicom_state::minicom)
+void minicom_state::minicom(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I87C52, XTAL(10'000'000)) /*FIX-ME: verify the correct clock frequency */
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, minicom_state, i87c52_p0_w))
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, minicom_state, i87c52_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, minicom_state, i87c52_p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, minicom_state, i87c52_p2_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, minicom_state, i87c52_p2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, minicom_state, i87c52_p3_w))
+ I87C52(config, m_maincpu, XTAL(10'000'000)); /*FIX-ME: verify the correct clock frequency */
+ m_maincpu->port_out_cb<0>().set(FUNC(minicom_state::i87c52_p0_w));
+ m_maincpu->port_in_cb<1>().set(FUNC(minicom_state::i87c52_p1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(minicom_state::i87c52_p1_w));
+ m_maincpu->port_in_cb<2>().set(FUNC(minicom_state::i87c52_p2_r));
+ m_maincpu->port_out_cb<2>().set(FUNC(minicom_state::i87c52_p2_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(minicom_state::i87c52_p3_w));
/* video hardware */
/* fluorescent 14-segment display forming a row of 20 characters */
config.set_default_layout(layout_minicom);
-/* TODO: Map the keyboard rows/cols inputs (43-key, 4-row keyboard) */
+ /* TODO: Map the keyboard rows/cols inputs (43-key, 4-row keyboard) */
-/* TODO: Treat the modem as a sound device. That may be an interesting challenge... :-) */
-MACHINE_CONFIG_END
+ /* TODO: Treat the modem as a sound device. That may be an interesting challenge... :-) */
+}
ROM_START( minicom )
ROM_REGION( 0x2000, "maincpu", 0 )
diff --git a/src/mame/drivers/minitel_2_rpic.cpp b/src/mame/drivers/minitel_2_rpic.cpp
index 6dbee1fa3ab..e4bdc694d62 100644
--- a/src/mame/drivers/minitel_2_rpic.cpp
+++ b/src/mame/drivers/minitel_2_rpic.cpp
@@ -97,7 +97,7 @@ public:
void minitel2(machine_config &config);
private:
- required_device<cpu_device> m_maincpu;
+ required_device<i80c32_device> m_maincpu;
required_device<ts9347_device> m_ts9347;
required_device<palette_device> m_palette;
@@ -401,29 +401,31 @@ static INPUT_PORTS_START( minitel2 )
INPUT_PORTS_END
-MACHINE_CONFIG_START(minitel_state::minitel2)
+void minitel_state::minitel2(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C32, XTAL(14'318'181)) //verified on pcb
- MCFG_DEVICE_PROGRAM_MAP(mem_prg)
- MCFG_DEVICE_IO_MAP(mem_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, minitel_state, port1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, minitel_state, port1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, minitel_state, port3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, minitel_state, port3_w))
-
- MCFG_DEVICE_ADD("ts9347", TS9347, 0)
- MCFG_EF9345_PALETTE("palette")
- MCFG_TIMER_DRIVER_ADD_SCANLINE("minitel_sl", minitel_state, minitel_scanline, "screen", 0, 10)
+ I80C32(config, m_maincpu, XTAL(14'318'181)); //verified on pcb
+ m_maincpu->set_addrmap(AS_PROGRAM, &minitel_state::mem_prg);
+ m_maincpu->set_addrmap(AS_IO, &minitel_state::mem_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(minitel_state::port1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(minitel_state::port1_w));
+ m_maincpu->port_in_cb<3>().set(FUNC(minitel_state::port3_r));
+ m_maincpu->port_out_cb<3>().set(FUNC(minitel_state::port3_w));
+
+ TS9347(config, m_ts9347, 0);
+ m_ts9347->set_palette_tag(m_palette);
+
+ TIMER(config, "minitel_sl", 0).configure_scanline(FUNC(minitel_state::minitel_scanline), "screen", 0, 10);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_UPDATE_DEVICE("ts9347", ts9347_device, screen_update)
- MCFG_SCREEN_SIZE(512, 312)
- MCFG_SCREEN_VISIBLE_AREA(2, 512-10, 0, 278-1)
- MCFG_PALETTE_ADD("palette", 8+1)
-
-MACHINE_CONFIG_END
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_screen_update("ts9347", FUNC(ts9347_device::screen_update));
+ screen.set_size(512, 312);
+ screen.set_visarea(2, 512-10, 0, 278-1);
+
+ PALETTE(config, m_palette, 8+1);
+}
ROM_START( minitel2 )
diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp
index 90bb8f22996..59c5e954156 100644
--- a/src/mame/drivers/peplus.cpp
+++ b/src/mame/drivers/peplus.cpp
@@ -267,7 +267,7 @@ protected:
virtual void video_start() override;
private:
- required_device<cpu_device> m_maincpu;
+ required_device<i80c32_device> m_maincpu;
required_device<r6545_1_device> m_crtc;
required_device<i2cmem_device> m_i2cmem;
required_device<screen_device> m_screen;
@@ -1373,25 +1373,25 @@ void peplus_state::machine_start()
MACHINE_CONFIG_START(peplus_state::peplus)
// basic machine hardware
- MCFG_DEVICE_ADD(m_maincpu, I80C32, XTAL(20'000'000)/2) /* 10MHz */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_IO_MAP(main_iomap)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, peplus_state, paldata_w<0>))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, peplus_state, paldata_w<1>))
+ I80C32(config, m_maincpu, XTAL(20'000'000)/2); /* 10MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &peplus_state::main_map);
+ m_maincpu->set_addrmap(AS_IO, &peplus_state::main_iomap);
+ m_maincpu->port_out_cb<1>().set(FUNC(peplus_state::paldata_w<0>));
+ m_maincpu->port_out_cb<3>().set(FUNC(peplus_state::paldata_w<1>));
NVRAM(config, "cmos", nvram_device::DEFAULT_ALL_0);
// video hardware
- MCFG_SCREEN_ADD(m_screen, RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE((52+1)*8, (31+1)*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 25*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(peplus_state, screen_update)
- MCFG_SCREEN_PALETTE(m_palette)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_size((52+1)*8, (31+1)*8);
+ m_screen->set_visarea(0*8, 40*8-1, 0*8, 25*8-1);
+ m_screen->set_screen_update(FUNC(peplus_state::screen_update));
+ m_screen->set_palette(m_palette);
- MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_peplus)
- MCFG_PALETTE_ADD(m_palette, 16*16*2)
- MCFG_PALETTE_INIT_OWNER(peplus_state, peplus)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_peplus);
+
+ PALETTE(config, m_palette, 16*16*2).set_init(FUNC(peplus_state::palette_init_peplus));
R6545_1(config, m_crtc, XTAL(20'000'000)/8/3);
m_crtc->set_screen(m_screen);
@@ -1400,13 +1400,13 @@ MACHINE_CONFIG_START(peplus_state::peplus)
m_crtc->set_on_update_addr_change_callback(FUNC(peplus_state::crtc_addr), this);
m_crtc->out_vsync_callback().set(FUNC(peplus_state::crtc_vsync));
- MCFG_X2404P_ADD(m_i2cmem)
+ X2404P(config, m_i2cmem);
// sound hardware
SPEAKER(config, "mono").front_center();
AY8912(config, "aysnd", XTAL(20'000'000)/12).add_route(ALL_OUTPUTS, "mono", 0.75);
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/pes.cpp b/src/mame/drivers/pes.cpp
index b3ccd756979..7abd62cd632 100644
--- a/src/mame/drivers/pes.cpp
+++ b/src/mame/drivers/pes.cpp
@@ -247,22 +247,24 @@ INPUT_PORTS_END
/******************************************************************************
Machine Drivers
******************************************************************************/
-MACHINE_CONFIG_START(pes_state::pes)
+
+void pes_state::pes(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(i80c31_mem)
- MCFG_DEVICE_IO_MAP(i80c31_io)
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, pes_state, data_from_i8031))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, pes_state, data_to_i8031))
+ I80C31(config, m_maincpu, CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &pes_state::i80c31_mem);
+ m_maincpu->set_addrmap(AS_IO, &pes_state::i80c31_io);
+ m_maincpu->serial_tx_cb().set(FUNC(pes_state::data_from_i8031));
+ m_maincpu->serial_rx_cb().set(FUNC(pes_state::data_to_i8031));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("tms5220", TMS5220C, 720000) /* 720Khz clock, 10khz output */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ TMS5220C(config, m_speech, 720000); /* 720Khz clock, 10khz output */
+ m_speech->add_route(ALL_OUTPUTS, "mono", 1.0);
- MCFG_DEVICE_ADD(m_terminal, GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(pes_state, pes_kbd_input))
-MACHINE_CONFIG_END
+ GENERIC_TERMINAL(config, m_terminal, 0);
+ m_terminal->set_keyboard_callback(KEYBOARDCB_PUT(pes_state, pes_kbd_input));
+}
/******************************************************************************
ROM Definitions
diff --git a/src/mame/drivers/piggypas.cpp b/src/mame/drivers/piggypas.cpp
index 264a368357c..f4f0165e835 100644
--- a/src/mame/drivers/piggypas.cpp
+++ b/src/mame/drivers/piggypas.cpp
@@ -201,57 +201,57 @@ HD44780_PIXEL_UPDATE(piggypas_state::piggypas_pixel_update)
bitmap.pix16(y, (line * 8 + pos) * 6 + x) = state;
}
-MACHINE_CONFIG_START(piggypas_state::piggypas)
-
+void piggypas_state::piggypas(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, XTAL(8'448'000)) // OKI M80C31F or M80C154S
- MCFG_DEVICE_PROGRAM_MAP(piggypas_map)
- MCFG_DEVICE_IO_MAP(piggypas_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, piggypas_state, led_strobe_w))
- MCFG_MCS51_PORT_P3_IN_CB(IOPORT("IN2"))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, piggypas_state, mcs51_tx_callback))
-// MCFG_DEVICE_VBLANK_INT_DRIVER("screen", piggypas_state, irq0_line_hold)
+ I80C31(config, m_maincpu, XTAL(8'448'000)); // OKI M80C31F or M80C154S
+ m_maincpu->set_addrmap(AS_PROGRAM, &piggypas_state::piggypas_map);
+ m_maincpu->set_addrmap(AS_IO, &piggypas_state::piggypas_io);
+ m_maincpu->port_out_cb<1>().set(FUNC(piggypas_state::led_strobe_w));
+ m_maincpu->port_in_cb<3>().set_ioport("IN2");
+ m_maincpu->serial_tx_cb().set(FUNC(piggypas_state::mcs51_tx_callback));
+// m_maincpu->set_vblank_int("screen", FUNC(piggypas_state::irq0_line_hold));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // DS1220AD
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_SCREEN_SIZE(16*6, 8)
- MCFG_SCREEN_VISIBLE_AREA(0, 16*6-1, 0, 8-1)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(50);
+ screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
+ screen.set_size(16*6, 8);
+ screen.set_visarea(0, 16*6-1, 0, 8-1);
+ screen.set_palette("palette");
- MCFG_PALETTE_ADD("palette", 2)
+ PALETTE(config, "palette", 2);
config.set_default_layout(layout_piggypas);
- MCFG_HD44780_ADD("hd44780")
- MCFG_HD44780_LCD_SIZE(1, 16)
- MCFG_HD44780_PIXEL_UPDATE_CB(piggypas_state, piggypas_pixel_update)
+ hd44780_device &hd44780(HD44780(config, "hd44780"));
+ hd44780.set_lcd_size(1, 16);
+ hd44780.set_pixel_update_cb(FUNC(piggypas_state::piggypas_pixel_update), this);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(8'448'000) / 8, okim6295_device::PIN7_HIGH) // clock and pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ okim6295_device &oki(OKIM6295(config, "oki", XTAL(8'448'000) / 8, okim6295_device::PIN7_HIGH)); // clock and pin 7 not verified
+ oki.add_route(ALL_OUTPUTS, "mono", 1.0);
i8255_device &ppi(I8255A(config, "ppi")); // OKI M82C55A-2
ppi.in_pa_callback().set_ioport("IN1");
ppi.out_pb_callback().set(FUNC(piggypas_state::ctrl_w));
ppi.in_pc_callback().set_ioport("IN0");
- MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
-MACHINE_CONFIG_END
+ TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
+}
-MACHINE_CONFIG_START(piggypas_state::fidlstix)
+void piggypas_state::fidlstix(machine_config &config)
+{
piggypas(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(fidlstix_io)
- MCFG_MCS51_SERIAL_TX_CB(NOOP)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, piggypas_state, lcd_latch_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, piggypas_state, lcd_latch_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, piggypas_state, lcd_control_w))
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_IO, &piggypas_state::fidlstix_io);
+ m_maincpu->serial_tx_cb().set_nop();
+ m_maincpu->port_in_cb<1>().set(FUNC(piggypas_state::lcd_latch_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(piggypas_state::lcd_latch_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(piggypas_state::lcd_control_w));
+}
diff --git a/src/mame/drivers/rbmk.cpp b/src/mame/drivers/rbmk.cpp
index f971b2bef54..7f1d6311c00 100644
--- a/src/mame/drivers/rbmk.cpp
+++ b/src/mame/drivers/rbmk.cpp
@@ -93,7 +93,7 @@ private:
required_shared_ptr<uint16_t> m_vidram;
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_mcu;
+ required_device<at89c4051_device> m_mcu;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -570,10 +570,10 @@ MACHINE_CONFIG_START(rbmk_state::rbmk)
MCFG_DEVICE_PROGRAM_MAP(rbmk_mem)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rbmk_state, irq1_line_hold)
- MCFG_DEVICE_ADD("mcu", AT89C4051, 22000000 / 4) // frequency isn't right
- MCFG_DEVICE_PROGRAM_MAP(mcu_mem)
- MCFG_DEVICE_IO_MAP(mcu_io)
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, rbmk_state, mcu_io_mux_w))
+ AT89C4051(config, m_mcu, 22000000 / 4); // frequency isn't right
+ m_mcu->set_addrmap(AS_PROGRAM, &rbmk_state::mcu_mem);
+ m_mcu->set_addrmap(AS_IO, &rbmk_state::mcu_io);
+ m_mcu->port_out_cb<3>().set(FUNC(rbmk_state::mcu_io_mux_w));
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_rbmk)
diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp
index dd705344ea8..46ca54d69c9 100644
--- a/src/mame/drivers/segas16a.cpp
+++ b/src/mame/drivers/segas16a.cpp
@@ -1963,16 +1963,16 @@ GFXDECODE_END
// GENERIC MACHINE DRIVERS
//**************************************************************************
-MACHINE_CONFIG_START(segas16a_state::system16a)
-
+void segas16a_state::system16a(machine_config &config)
+{
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu", M68000, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(system16a_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16a_state, irq4_line_hold)
+ M68000(config, m_maincpu, 10000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16a_state::system16a_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16a_state::irq4_line_hold));
- MCFG_DEVICE_ADD("soundcpu", Z80, 4000000)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(sound_portmap)
+ Z80(config, m_soundcpu, 4000000);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16a_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas16a_state::sound_portmap);
N7751(config, m_n7751, 6000000);
m_n7751->bus_in_cb().set(FUNC(segas16a_state::n7751_rom_r));
@@ -1998,18 +1998,18 @@ MACHINE_CONFIG_START(segas16a_state::system16a)
m_i8255->out_pc_callback().set(FUNC(segas16a_state::tilemap_sound_w));
// video hardware
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE(342,262) // to be verified
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(segas16a_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_size(342, 262); // to be verified
+ m_screen->set_visarea(0*8, 40*8-1, 0*8, 28*8-1);
+ m_screen->set_screen_update(FUNC(segas16a_state::screen_update));
+ m_screen->set_palette(m_palette);
SEGA_SYS16A_SPRITES(config, m_sprites, 0);
SEGAIC16VID(config, m_segaic16vid, 0, "gfxdecode");
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segas16a)
- MCFG_PALETTE_ADD("palette", 2048*3)
+ GFXDECODE(config, "gfxdecode", m_palette, gfx_segas16a);
+ PALETTE(config, m_palette, 2048*3);
// sound hardware
SPEAKER(config, "speaker").front_center();
@@ -2020,75 +2020,79 @@ MACHINE_CONFIG_START(segas16a_state::system16a)
m_ymsnd->port_write_handler().set(FUNC(segas16a_state::n7751_control_w));
m_ymsnd->add_route(ALL_OUTPUTS, "speaker", 0.43);
- MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
-MACHINE_CONFIG_END
+ DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
+ vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1089a)
+void segas16a_state::system16a_fd1089a(machine_config &config)
+{
system16a(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1089A, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(system16a_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16a_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1089A(config.replace(), m_maincpu, 10000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16a_state::system16a_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16a_state::irq4_line_hold));
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1089b)
+void segas16a_state::system16a_fd1089b(machine_config &config)
+{
system16a(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1089B, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(system16a_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16a_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1089B(config.replace(), m_maincpu, 10000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16a_state::system16a_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16a_state::irq4_line_hold));
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1094)
+void segas16a_state::system16a_fd1094(machine_config &config)
+{
system16a(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1094, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(system16a_map)
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16a_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1094(config.replace(), m_maincpu, 10000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16a_state::system16a_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &segas16a_state::decrypted_opcodes_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16a_state::irq4_line_hold));
+}
-MACHINE_CONFIG_START(segas16a_state::aceattaca_fd1094)
+void segas16a_state::aceattaca_fd1094(machine_config &config)
+{
system16a_fd1094(config);
- MCFG_DEVICE_ADD("cxdio", CXD1095, 0)
-MACHINE_CONFIG_END
-
+ CXD1095(config, "cxdio", 0);
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_i8751)
+void segas16a_state::system16a_i8751(machine_config &config)
+{
system16a(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_VBLANK_INT_REMOVE()
+ m_maincpu->set_vblank_int(device_interrupt_delegate(), nullptr);
- MCFG_DEVICE_ADD("mcu", I8751, 8000000)
- MCFG_DEVICE_IO_MAP(mcu_io_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, segas16a_state, mcu_control_w))
-
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, segas16a_state, i8751_main_cpu_vblank_w))
-MACHINE_CONFIG_END
+ I8751(config, m_mcu, 8000000);
+ m_mcu->set_addrmap(AS_IO, &segas16a_state::mcu_io_map);
+ m_mcu->port_out_cb<1>().set(FUNC(segas16a_state::mcu_control_w));
+ m_screen->screen_vblank().set(FUNC(segas16a_state::i8751_main_cpu_vblank_w));
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_no7751)
+void segas16a_state::system16a_no7751(machine_config &config)
+{
system16a(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(sound_no7751_portmap)
+ m_soundcpu->set_addrmap(AS_IO, &segas16a_state::sound_no7751_portmap);
- MCFG_DEVICE_REMOVE("n7751")
- MCFG_DEVICE_REMOVE("dac")
- MCFG_DEVICE_REMOVE("vref")
+ config.device_remove("n7751");
+ config.device_remove("dac");
+ config.device_remove("vref");
YM2151(config.replace(), m_ymsnd, 4000000);
m_ymsnd->add_route(ALL_OUTPUTS, "speaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_no7751p)
+void segas16a_state::system16a_no7751p(machine_config &config)
+{
system16a_no7751(config);
- MCFG_DEVICE_REPLACE("soundcpu", SEGA_315_5177, 4000000)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(sound_no7751_portmap)
- MCFG_DEVICE_OPCODES_MAP(sound_decrypted_opcodes_map)
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":sound_decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5177(config.replace(), m_soundcpu, 4000000));
+ z80.set_addrmap(AS_PROGRAM, &segas16a_state::sound_map);
+ z80.set_addrmap(AS_IO, &segas16a_state::sound_no7751_portmap);
+ z80.set_addrmap(AS_OPCODES, &segas16a_state::sound_decrypted_opcodes_map);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
/*
static MACHINE_CONFIG_START( system16a_i8751_no7751 )
@@ -2102,44 +2106,44 @@ static MACHINE_CONFIG_START( system16a_i8751_no7751 )
MACHINE_CONFIG_END
*/
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1089a_no7751)
+void segas16a_state::system16a_fd1089a_no7751(machine_config &config)
+{
system16a_fd1089a(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(sound_no7751_portmap)
+ m_soundcpu->set_addrmap(AS_IO, &segas16a_state::sound_no7751_portmap);
- MCFG_DEVICE_REMOVE("n7751")
- MCFG_DEVICE_REMOVE("dac")
- MCFG_DEVICE_REMOVE("vref")
+ config.device_remove("n7751");
+ config.device_remove("dac");
+ config.device_remove("vref");
YM2151(config.replace(), m_ymsnd, 4000000);
m_ymsnd->add_route(ALL_OUTPUTS, "speaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1089b_no7751)
+void segas16a_state::system16a_fd1089b_no7751(machine_config &config)
+{
system16a_fd1089b(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(sound_no7751_portmap)
+ m_soundcpu->set_addrmap(AS_IO, &segas16a_state::sound_no7751_portmap);
- MCFG_DEVICE_REMOVE("n7751")
- MCFG_DEVICE_REMOVE("dac")
- MCFG_DEVICE_REMOVE("vref")
+ config.device_remove("n7751");
+ config.device_remove("dac");
+ config.device_remove("vref");
YM2151(config.replace(), m_ymsnd, 4000000);
m_ymsnd->add_route(ALL_OUTPUTS, "speaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16a_state::system16a_fd1094_no7751)
+void segas16a_state::system16a_fd1094_no7751(machine_config &config)
+{
system16a_fd1094(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(sound_no7751_portmap)
+ m_soundcpu->set_addrmap(AS_IO, &segas16a_state::sound_no7751_portmap);
- MCFG_DEVICE_REMOVE("n7751")
- MCFG_DEVICE_REMOVE("dac")
- MCFG_DEVICE_REMOVE("vref")
+ config.device_remove("n7751");
+ config.device_remove("dac");
+ config.device_remove("vref");
YM2151(config.replace(), m_ymsnd, 4000000);
m_ymsnd->add_route(ALL_OUTPUTS, "speaker", 1.0);
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index e7f3e4069ae..1bb18fc01a7 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -3711,32 +3711,31 @@ GFXDECODE_END
// GENERIC MACHINE DRIVERS
//**************************************************************************
-MACHINE_CONFIG_START(segas16b_state::system16b)
-
+void segas16b_state::system16b(machine_config &config)
+{
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu", M68000, MASTER_CLOCK_10MHz)
- MCFG_DEVICE_PROGRAM_MAP(system16b_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16b_state, irq4_line_hold)
+ M68000(config, m_maincpu, MASTER_CLOCK_10MHz);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::system16b_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16b_state::irq4_line_hold));
- MCFG_DEVICE_ADD("soundcpu", Z80, MASTER_CLOCK_10MHz/2)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(sound_portmap)
+ Z80(config, m_soundcpu, MASTER_CLOCK_10MHz/2);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16b_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas16b_state::sound_portmap);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("mapper", SEGA_315_5195_MEM_MAPPER, MASTER_CLOCK_10MHz)
- MCFG_SEGA_315_5195_CPU("maincpu")
- MCFG_SEGA_315_5195_MAPPER_HANDLER(segas16b_state, memory_mapper)
- MCFG_SEGA_315_5195_PBF_CALLBACK(INPUTLINE("soundcpu", 0))
+ SEGA_315_5195_MEM_MAPPER(config, m_mapper, MASTER_CLOCK_10MHz, m_maincpu);
+ m_mapper->set_mapper(FUNC(segas16b_state::memory_mapper));
+ m_mapper->pbf().set_inputline("soundcpu", 0);
// video hardware
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segas16b)
- MCFG_PALETTE_ADD("palette", 2048*3)
+ GFXDECODE(config, m_gfxdecode, "palette", gfx_segas16b);
+ PALETTE(config, "palette", 2048*3);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(segas16b_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224);
+ m_screen->set_screen_update(FUNC(segas16b_state::screen_update));
+ m_screen->set_palette("palette");
SEGA_SYS16B_SPRITES(config, m_sprites, 0);
SEGAIC16VID(config, m_segaic16vid, 0, m_gfxdecode);
@@ -3746,41 +3745,45 @@ MACHINE_CONFIG_START(segas16b_state::system16b)
YM2151(config, m_ym2151, MASTER_CLOCK_8MHz/2).add_route(ALL_OUTPUTS, "mono", 0.43);
- MCFG_DEVICE_ADD("upd", UPD7759)
- MCFG_UPD7759_MD(0)
- MCFG_UPD7759_DRQ_CALLBACK(WRITELINE(*this, segas16b_state,upd7759_generate_nmi))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.48)
-MACHINE_CONFIG_END
+ UPD7759(config, m_upd7759);
+ m_upd7759->md_w(0);
+ m_upd7759->drq().set(FUNC(segas16b_state::upd7759_generate_nmi));
+ m_upd7759->add_route(ALL_OUTPUTS, "mono", 0.48);
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_mc8123)
+void segas16b_state::system16b_mc8123(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_REPLACE("soundcpu", MC8123, MASTER_CLOCK_10MHz/2)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(sound_portmap)
- MCFG_DEVICE_OPCODES_MAP(sound_decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ MC8123(config.replace(), m_soundcpu, MASTER_CLOCK_10MHz/2);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16b_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas16b_state::sound_portmap);
+ m_soundcpu->set_addrmap(AS_OPCODES, &segas16b_state::sound_decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_fd1089a)
+void segas16b_state::system16b_fd1089a(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1089A, MASTER_CLOCK_10MHz)
- MCFG_DEVICE_PROGRAM_MAP(system16b_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16b_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1089A(config.replace(), m_maincpu, MASTER_CLOCK_10MHz);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::system16b_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16b_state::irq4_line_hold));
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_fd1089b)
+void segas16b_state::system16b_fd1089b(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1089B, MASTER_CLOCK_10MHz)
- MCFG_DEVICE_PROGRAM_MAP(system16b_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16b_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1089B(config.replace(), m_maincpu, MASTER_CLOCK_10MHz);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::system16b_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16b_state::irq4_line_hold));
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_fd1094)
+void segas16b_state::system16b_fd1094(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_REPLACE("maincpu", FD1094, MASTER_CLOCK_10MHz)
- MCFG_DEVICE_PROGRAM_MAP(system16b_map)
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16b_state, irq4_line_hold)
-MACHINE_CONFIG_END
+ FD1094(config.replace(), m_maincpu, MASTER_CLOCK_10MHz);
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::system16b_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &segas16b_state::decrypted_opcodes_map);
+ m_maincpu->set_vblank_int("screen", FUNC(segas16b_state::irq4_line_hold));
+}
void segas16b_state::aceattacb_fd1094(machine_config &config)
{
@@ -3794,22 +3797,20 @@ void segas16b_state::aceattacb_fd1094(machine_config &config)
m_cxdio->in_portb_cb().set_ioport("HANDX2");
}
-
-MACHINE_CONFIG_START(segas16b_state::system16b_i8751)
+void segas16b_state::system16b_i8751(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas16b_state, i8751_main_cpu_vblank)
+ m_maincpu->set_vblank_int("screen", FUNC(segas16b_state::i8751_main_cpu_vblank));
- MCFG_DEVICE_ADD("mcu", I8751, MASTER_CLOCK_8MHz)
- MCFG_DEVICE_IO_MAP(mcu_io_map)
- MCFG_MCS51_PORT_P1_IN_CB(IOPORT("SERVICE"))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, segas16b_state, spin_68k_w))
+ I8751(config, m_mcu, MASTER_CLOCK_8MHz);
+ m_mcu->set_addrmap(AS_IO, &segas16b_state::mcu_io_map);
+ m_mcu->port_in_cb<1>().set_ioport("SERVICE");
+ m_mcu->port_out_cb<1>().set(FUNC(segas16b_state::spin_68k_w));
- MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ config.m_minimum_quantum = attotime::from_hz(6000);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("mcu", INPUT_LINE_IRQ0))
-MACHINE_CONFIG_END
+ m_screen->screen_vblank().set_inputline(m_mcu, INPUT_LINE_IRQ0);
+}
// same as the above, but with custom Sega ICs
@@ -3820,35 +3821,37 @@ void segas16b_state::rom_5797_fragment(machine_config &config)
SEGA_315_5250_COMPARE_TIMER(config, m_cmptimer_2, 0);
}
-MACHINE_CONFIG_START(segas16b_state::system16b_5797)
+void segas16b_state::system16b_5797(machine_config &config)
+{
system16b(config);
rom_5797_fragment(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_i8751_5797)
+void segas16b_state::system16b_i8751_5797(machine_config &config)
+{
system16b_i8751(config);
rom_5797_fragment(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_fd1094_5797)
+void segas16b_state::system16b_fd1094_5797(machine_config &config)
+{
system16b_fd1094(config);
rom_5797_fragment(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(segas16b_state::system16b_split)
+void segas16b_state::system16b_split(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(system16b_bootleg_map)
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map_x)
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::system16b_bootleg_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &segas16b_state::decrypted_opcodes_map_x);
- MCFG_DEVICE_REMOVE("mapper")
+ config.device_remove("mapper");
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PROGRAM_MAP(bootleg_sound_map)
- MCFG_DEVICE_IO_MAP(bootleg_sound_portmap)
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16b_state::bootleg_sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas16b_state::bootleg_sound_portmap);
GENERIC_LATCH_8(config, m_soundlatch);
-MACHINE_CONFIG_END
+}
void segas16b_state::tilemap_16b_fpointbl_fill_latch(int i, uint16_t* latched_pageselect, uint16_t* latched_yscroll, uint16_t* latched_xscroll, uint16_t* textram)
{
@@ -3876,19 +3879,18 @@ void segas16b_state::tilemap_16b_fpointbl_fill_latch(int i, uint16_t* latched_pa
// printf("%02x returning latched page select %04x scrollx %04x scrolly %04x\n", i, latched_pageselect[i], latched_xscroll[i], latched_yscroll[i]);
}
-MACHINE_CONFIG_START(segas16b_state::fpointbl)
+void segas16b_state::fpointbl(machine_config &config)
+{
system16b(config);
- MCFG_DEVICE_REMOVE("mapper")
- MCFG_DEVICE_REMOVE("sprites")
+ config.device_remove("mapper");
+ config.device_remove("sprites");
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(fpointbl_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::fpointbl_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PROGRAM_MAP(fpointbl_sound_map)
- MCFG_DEVICE_IO_MAP(bootleg_sound_portmap)
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16b_state::fpointbl_sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &segas16b_state::bootleg_sound_portmap);
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, 0);
@@ -3898,20 +3900,18 @@ MACHINE_CONFIG_START(segas16b_state::fpointbl)
m_sprites->set_local_originy(-2); // some other gfx don't have identical alignment to original tho (flickey character over 'good luck')
m_segaic16vid->set_pagelatch_cb(FUNC(segas16b_state::tilemap_16b_fpointbl_fill_latch), this);
+}
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(segas16b_state::fpointbla)
+void segas16b_state::fpointbla(machine_config &config)
+{
fpointbl(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(map_fpointbla)
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map_fpointbla)
+ m_maincpu->set_addrmap(AS_PROGRAM, &segas16b_state::map_fpointbla);
+ m_maincpu->set_addrmap(AS_OPCODES, &segas16b_state::decrypted_opcodes_map_fpointbla);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_PROGRAM_MAP(bootleg_sound_map)
+ m_soundcpu->set_addrmap(AS_PROGRAM, &segas16b_state::bootleg_sound_map);
m_sprites->set_local_originx(60); // these align the pieces with the playfield
- MACHINE_CONFIG_END
+}
MACHINE_CONFIG_START(segas16b_state::lockonph)
diff --git a/src/mame/drivers/sliver.cpp b/src/mame/drivers/sliver.cpp
index 1f94cc5d072..28621979a7c 100644
--- a/src/mame/drivers/sliver.cpp
+++ b/src/mame/drivers/sliver.cpp
@@ -111,7 +111,7 @@ private:
int m_tmp_counter;
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
+ required_device<i8051_device> m_audiocpu;
required_device<screen_device> m_screen;
required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<uint8_t> m_colorram;
@@ -523,10 +523,10 @@ MACHINE_CONFIG_START(sliver_state::sliver)
MCFG_TIMER_DRIVER_ADD_PERIODIC("obj_actel", sliver_state, obj_irq_cb, attotime::from_hz(60)) /* unknown clock, causes "obj actel ready error" without this */
// irq 2 valid but not used?
- MCFG_DEVICE_ADD("audiocpu", I8051, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(soundmem_prg)
- MCFG_DEVICE_IO_MAP(soundmem_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, sliver_state, oki_setbank))
+ I8051(config, m_audiocpu, 8000000);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &sliver_state::soundmem_prg);
+ m_audiocpu->set_addrmap(AS_IO, &sliver_state::soundmem_io);
+ m_audiocpu->port_out_cb<1>().set(FUNC(sliver_state::oki_setbank));
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index 71f1af51e78..3d1f1541797 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -84,7 +84,6 @@ a joystick. This is not an emulation bug.
#include "sound/ym2151.h"
#include "sound/3812intf.h"
-#include "screen.h"
#include "speaker.h"
@@ -1724,31 +1723,30 @@ MACHINE_RESET_MEMBER(snowbros_state,finalttr)
m_hyperpac_ram[0x2000/2 + i] = PROTDATA[i];
}
-MACHINE_CONFIG_START(snowbros_state::snowbros)
-
+void snowbros_state::snowbros(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) /* 8 Mhz - confirmed */
- MCFG_DEVICE_PROGRAM_MAP(snowbros_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ M68000(config, m_maincpu, XTAL(16'000'000)/2); /* 8 Mhz - confirmed */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::snowbros_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
WATCHDOG_TIMER(config, "watchdog");
- MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(12'000'000)/2) /* 6 MHz - confirmed */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(sound_io_map)
+ Z80(config, m_soundcpu, XTAL(12'000'000)/2); /* 6 MHz - confirmed */
+ m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &snowbros_state::sound_io_map);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(57.5) /* ~57.5 - confirmed */
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 262)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_snowbros)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, snowbros_state, screen_vblank_snowbros))
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_snowbros)
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(57.5); /* ~57.5 - confirmed */
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(32*8, 262);
+ m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbros));
+ m_screen->screen_vblank().set(FUNC(snowbros_state::screen_vblank_snowbros));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_snowbros);
+ PALETTE(config, m_palette, 256).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
KANEKO_PANDORA(config, m_pandora, 0);
m_pandora->set_gfxdecode_tag(m_gfxdecode);
@@ -1761,44 +1759,41 @@ MACHINE_CONFIG_START(snowbros_state::snowbros)
GENERIC_LATCH_8(config, "soundlatch2");
- MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(12'000'000)/4) /* 3 MHz - confirmed */
- MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
-
+ ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4)); /* 3 MHz - confirmed */
+ ymsnd.irq_handler().set_inputline("soundcpu", 0);
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(snowbros_state::wintbob)
+void snowbros_state::wintbob(machine_config &config)
+{
snowbros(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(10000000) /* 10mhz - Confirmed */
- MCFG_DEVICE_PROGRAM_MAP(wintbob_map)
+ m_maincpu->set_clock(10000000); /* 10mhz - Confirmed */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::wintbob_map);
- MCFG_DEVICE_REMOVE("pandora")
+ config.device_remove("pandora");
/* video hardware */
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_wb)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_wintbob)
- MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
-MACHINE_CONFIG_END
+ m_gfxdecode->set_info(gfx_wb);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_wintbob));
+ m_screen->screen_vblank().set_nop();
+}
-MACHINE_CONFIG_START(snowbros_state::semicom)
+void snowbros_state::semicom(machine_config &config)
+{
snowbros(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(XTAL(12'000'000)) /* 12MHz - Confirmed */
- MCFG_DEVICE_PROGRAM_MAP(hyperpac_map)
+ m_maincpu->set_clock(XTAL(12'000'000)); /* 12MHz - Confirmed */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::hyperpac_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_CLOCK(XTAL(16'000'000)/4) /* 4MHz - Confirmed */
- MCFG_DEVICE_PROGRAM_MAP(hyperpac_sound_map)
- MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_IO)
+ m_soundcpu->set_clock(XTAL(16'000'000)/4); /* 4MHz - Confirmed */
+ m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::hyperpac_sound_map);
+ m_soundcpu->set_addrmap(AS_IO, address_map_constructor());
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_hyperpac)
+ m_gfxdecode->set_info(gfx_hyperpac);
m_soundlatch->data_pending_callback().set_nop();
@@ -1810,52 +1805,51 @@ MACHINE_CONFIG_START(snowbros_state::semicom)
ymsnd.add_route(0, "mono", 0.10);
ymsnd.add_route(1, "mono", 0.10);
- MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) /* 1MHz & pin 7 High - Confirmed */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
-
+ OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* 1MHz & pin 7 High - Confirmed */
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(snowbros_state::semicom_mcu)
+void snowbros_state::semicom_mcu(machine_config &config)
+{
semicom(config);
/* basic machine hardware */
-
- MCFG_DEVICE_ADD("protection", AT89C52, XTAL(16'000'000))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, snowbros_state, prot_p0_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, snowbros_state, prot_p1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, snowbros_state, prot_p2_w))
-MACHINE_CONFIG_END
+ at89c52_device &prot(AT89C52(config, "protection", XTAL(16'000'000)));
+ prot.port_out_cb<0>().set(FUNC(snowbros_state::prot_p0_w));
+ prot.port_out_cb<1>().set(FUNC(snowbros_state::prot_p1_w));
+ prot.port_out_cb<2>().set(FUNC(snowbros_state::prot_p2_w));
+}
-MACHINE_CONFIG_START(snowbros_state::semiprot)
+void snowbros_state::semiprot(machine_config &config)
+{
semicom(config);
- MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, semiprot )
-MACHINE_CONFIG_END
-
+ MCFG_MACHINE_RESET_OVERRIDE(snowbros_state, semiprot)
+}
-MACHINE_CONFIG_START(snowbros_state::honeydol)
+void snowbros_state::honeydol(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(12'000'000)) /* MC68000P12 @ 12MHz */
- MCFG_DEVICE_PROGRAM_MAP(honeydol_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ M68000(config, m_maincpu, XTAL(12'000'000)); /* MC68000P12 @ 12MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::honeydol_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
- MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(16'000'000)/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
- MCFG_DEVICE_PROGRAM_MAP(honeydol_sound_map)
- MCFG_DEVICE_IO_MAP(honeydol_sound_io_map)
+ Z80(config, m_soundcpu, XTAL(16'000'000)/4); /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
+ m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::honeydol_sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &snowbros_state::honeydol_sound_io_map);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(57.5)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 262)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_honeydol)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_honeydol)
- MCFG_PALETTE_ADD("palette", 0x800/2)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(57.5);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(32*8, 262);
+ m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_honeydol));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_honeydol);
+ PALETTE(config, m_palette, 0x800/2).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1863,40 +1857,38 @@ MACHINE_CONFIG_START(snowbros_state::honeydol)
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(12'000'000)/4) /* 3Mhz */
- MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-
+ ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4)); /* 3Mhz */
+ ymsnd.irq_handler().set_inputline("soundcpu", 0);
+ ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
- MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) /* freq? */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(snowbros_state::twinadv)
+ OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
+void snowbros_state::twinadv(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(12'000'000)) /* 12MHz like Honey Dolls ? */
- MCFG_DEVICE_PROGRAM_MAP(twinadv_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ M68000(config, m_maincpu, XTAL(12'000'000)); /* 12MHz like Honey Dolls ? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::twinadv_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
WATCHDOG_TIMER(config, "watchdog");
- MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(16'000'000)/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_IO_MAP(twinadv_sound_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", snowbros_state, irq0_line_hold)
+ Z80(config, m_soundcpu, XTAL(16'000'000)/4); /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
+ m_soundcpu->set_addrmap(AS_PROGRAM, &snowbros_state::sound_map);
+ m_soundcpu->set_addrmap(AS_IO, &snowbros_state::twinadv_sound_io_map);
+ m_soundcpu->set_vblank_int("screen", FUNC(snowbros_state::irq0_line_hold));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(57.5)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 262)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_twinadv)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_twinadv)
- MCFG_PALETTE_ADD("palette", 0x100)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(57.5);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(32*8, 262);
+ m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_twinadv));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_twinadv);
+ PALETTE(config, m_palette, 0x100).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1907,9 +1899,9 @@ MACHINE_CONFIG_START(snowbros_state::twinadv)
GENERIC_LATCH_8(config, "soundlatch2");
/* sound hardware */
- MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) /* freq? */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); /* freq? */
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
/*
@@ -1930,87 +1922,82 @@ Intel P8752 (mcu)
*/
-MACHINE_CONFIG_START(snowbros_state::finalttr)
+void snowbros_state::finalttr(machine_config &config)
+{
semicom(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(XTAL(12'000'000))
- MCFG_DEVICE_PROGRAM_MAP(finalttr_map)
+ m_maincpu->set_clock(XTAL(12'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::finalttr_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_CLOCK(XTAL(3'579'545))
+ m_soundcpu->set_clock(XTAL(3'579'545));
- MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, finalttr )
+ MCFG_MACHINE_RESET_OVERRIDE(snowbros_state, finalttr)
ym2151_device &ymsnd(YM2151(config.replace(), "ymsnd", XTAL(3'579'545))); /* possible but less likely 4MHz (12MHz/3) */
ymsnd.irq_handler().set_inputline(m_soundcpu, 0);
ymsnd.add_route(0, "mono", 0.08);
ymsnd.add_route(1, "mono", 0.08);
- MCFG_DEVICE_REPLACE("oki", OKIM6295, 999900, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-MACHINE_CONFIG_END
+ m_oki->set_clock(999900);
+}
-MACHINE_CONFIG_START(snowbros_state::_4in1)
+void snowbros_state::_4in1(machine_config &config)
+{
semicom(config);
/* basic machine hardware */
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_snowbros)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(snowbros_state::snowbro3) /* PCB has 16MHz & 12MHz OSCs */
+ m_gfxdecode->set_info(gfx_snowbros);
+}
+void snowbros_state::snowbro3(machine_config &config) /* PCB has 16MHz & 12MHz OSCs */
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(12'000'000)) /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */
- MCFG_DEVICE_PROGRAM_MAP(snowbros3_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1)
+ M68000(config, m_maincpu, XTAL(12'000'000)); /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::snowbros3_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros3_irq), "screen", 0, 1);
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_snowbro3)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sb3)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(32*8, 32*8);
+ m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbro3));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_sb3);
+ PALETTE(config, m_palette, 512).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
-
-
-
-MACHINE_CONFIG_START(snowbros_state::yutnori)
+ OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
+void snowbros_state::yutnori(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2)
- MCFG_DEVICE_PROGRAM_MAP(yutnori_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
+ M68000(config, m_maincpu, XTAL(16'000'000)/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &snowbros_state::yutnori_map);
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(snowbros_state::snowbros_irq), "screen", 0, 1);
// WATCHDOG_TIMER(config, "watchdog"); // maybe
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(57.5)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 262)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(snowbros_state, screen_update_snowbros)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, snowbros_state, screen_vblank_snowbros))
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_hyperpac)
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(57.5);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(32*8, 262);
+ m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ m_screen->set_screen_update(FUNC(snowbros_state::screen_update_snowbros));
+ m_screen->screen_vblank().set(FUNC(snowbros_state::screen_vblank_snowbros));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_hyperpac);
+ PALETTE(config, m_palette, 256).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
KANEKO_PANDORA(config, m_pandora, 0);
m_pandora->set_gfxdecode_tag(m_gfxdecode);
@@ -2018,16 +2005,16 @@ MACHINE_CONFIG_START(snowbros_state::yutnori)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki1", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ okim6295_device &oki1(OKIM6295(config, "oki1", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
+ oki1.add_route(ALL_OUTPUTS, "mono", 1.0);
- MCFG_DEVICE_ADD("oki2", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ okim6295_device &oki2(OKIM6295(config, "oki2", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
+ oki2.add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
/***************************************************************************
- Game driver(s)
+ ROM definitions
***************************************************************************/
diff --git a/src/mame/drivers/spinb.cpp b/src/mame/drivers/spinb.cpp
index f86b60db8b9..b4233cadbd0 100644
--- a/src/mame/drivers/spinb.cpp
+++ b/src/mame/drivers/spinb.cpp
@@ -137,7 +137,7 @@ private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_musiccpu;
- required_device<cpu_device> m_dmdcpu;
+ required_device<i8031_device> m_dmdcpu;
required_device<msm5205_device> m_msm_a;
required_device<msm5205_device> m_msm_m;
required_device<ttl7474_device> m_ic5a;
@@ -640,47 +640,53 @@ uint32_t spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
return 0;
}
-MACHINE_CONFIG_START(spinb_state::spinb)
+void spinb_state::spinb(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(5'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(spinb_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(spinb_state, irq0_line_hold, 160) // NE556 adjustable (if faster, then jolypark has a stack problem)
- MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(5'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(spinb_audio_map)
- MCFG_DEVICE_ADD("musiccpu", Z80, XTAL(5'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(spinb_music_map)
- MCFG_DEVICE_ADD("dmdcpu",I8031, XTAL(16'000'000))
- MCFG_DEVICE_PROGRAM_MAP(dmd_mem)
- MCFG_DEVICE_IO_MAP(dmd_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, spinb_state, p1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, spinb_state, p3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, spinb_state, p3_w))
+ Z80(config, m_maincpu, XTAL(5'000'000) / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &spinb_state::spinb_map);
+ m_maincpu->set_periodic_int(FUNC(spinb_state::irq0_line_hold), attotime::from_hz(160)); // NE556 adjustable (if faster, then jolypark has a stack problem)
+
+ Z80(config, m_audiocpu, XTAL(5'000'000) / 2);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &spinb_state::spinb_audio_map);
+
+ Z80(config, m_musiccpu, XTAL(5'000'000) / 2);
+ m_musiccpu->set_addrmap(AS_PROGRAM, &spinb_state::spinb_music_map);
+
+ I8031(config, m_dmdcpu, XTAL(16'000'000));
+ m_dmdcpu->set_addrmap(AS_PROGRAM, &spinb_state::dmd_mem);
+ m_dmdcpu->set_addrmap(AS_IO, &spinb_state::dmd_io);
+ m_dmdcpu->port_out_cb<1>().set(FUNC(spinb_state::p1_w));
+ m_dmdcpu->port_in_cb<3>().set(FUNC(spinb_state::p3_r));
+ m_dmdcpu->port_out_cb<3>().set(FUNC(spinb_state::p3_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
/* Video */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_UPDATE_DRIVER(spinb_state, screen_update)
- MCFG_SCREEN_SIZE(128, 32)
- MCFG_SCREEN_VISIBLE_AREA(0, 127, 0, 31)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_PALETTE_ADD( "palette", 3 )
- MCFG_PALETTE_INIT_OWNER(spinb_state, spinb)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
+ screen.set_screen_update(FUNC(spinb_state::screen_update));
+ screen.set_size(128, 32);
+ screen.set_visarea(0, 127, 0, 31);
+ screen.set_palette("palette");
+
+ PALETTE(config, "palette", 3).set_init(FUNC(spinb_state::palette_init_spinb));
/* Sound */
genpin_audio(config);
+
SPEAKER(config, "msmavol").front_center();
- MCFG_DEVICE_ADD("msm_a", MSM5205, XTAL(384'000))
- MCFG_MSM5205_VCK_CALLBACK(WRITELINE("ic5a", ttl7474_device, clock_w))
- MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 4KHz 4-bit */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmavol", 1.0)
+ MSM5205(config, m_msm_a, XTAL(384'000));
+ m_msm_a->vck_callback().set("ic5a", FUNC(ttl7474_device::clock_w));
+ m_msm_a->set_prescaler_selector(msm5205_device::S48_4B); /* 4KHz 4-bit */
+ m_msm_a->add_route(ALL_OUTPUTS, "msmavol", 1.0);
+
SPEAKER(config, "msmmvol").front_center();
- MCFG_DEVICE_ADD("msm_m", MSM5205, XTAL(384'000))
- MCFG_MSM5205_VCK_CALLBACK(WRITELINE("ic5m", ttl7474_device, clock_w))
- MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 4KHz 4-bit */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmmvol", 1.0)
+ MSM5205(config, m_msm_m, XTAL(384'000));
+ m_msm_m->vck_callback().set("ic5m", FUNC(ttl7474_device::clock_w));
+ m_msm_m->set_prescaler_selector(msm5205_device::S48_4B); /* 4KHz 4-bit */
+ m_msm_m->add_route(ALL_OUTPUTS, "msmmvol", 1.0);
/* Devices */
i8255_device &ppi60(I8255A(config, "ppi60"));
@@ -738,26 +744,28 @@ MACHINE_CONFIG_START(spinb_state::spinb)
HC157(config, m_ic14m, 0); // actually IC15 on Jolly Park
m_ic14m->out_callback().set("msm_m", FUNC(msm5205_device::data_w));
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(spinb_state::jolypark)
+void spinb_state::jolypark(machine_config &config)
+{
spinb(config);
- MCFG_DEVICE_REPLACE("msm_a", MSM6585, XTAL(640'000))
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("ic5a", ttl7474_device, clock_w))
- MCFG_MSM6585_PRESCALER_SELECTOR(S40)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmavol", 1.0)
- MCFG_DEVICE_REPLACE("msm_m", MSM6585, XTAL(640'000))
- MCFG_MSM6585_VCK_CALLBACK(WRITELINE("ic5m", ttl7474_device, clock_w))
- MCFG_MSM6585_PRESCALER_SELECTOR(S40)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmmvol", 1.0)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(spinb_state::vrnwrld)
+
+ MSM6585(config.replace(), m_msm_a, XTAL(640'000));
+ m_msm_a->vck_callback().set("ic5a", FUNC(ttl7474_device::clock_w));
+ m_msm_a->set_prescaler_selector(msm6585_device::S40);
+ m_msm_a->add_route(ALL_OUTPUTS, "msmavol", 1.0);
+
+ MSM6585(config.replace(), m_msm_m, XTAL(640'000));
+ m_msm_m->vck_callback().set("ic5m", FUNC(ttl7474_device::clock_w));
+ m_msm_m->set_prescaler_selector(msm6585_device::S40);
+ m_msm_m->add_route(ALL_OUTPUTS, "msmmvol", 1.0);
+}
+
+void spinb_state::vrnwrld(machine_config &config)
+{
jolypark(config);
- /* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(vrnwrld_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &spinb_state::vrnwrld_map);
+}
/*-------------------------------------------------------------------
diff --git a/src/mame/drivers/splus.cpp b/src/mame/drivers/splus.cpp
index e7fc884cbee..2266caac22a 100644
--- a/src/mame/drivers/splus.cpp
+++ b/src/mame/drivers/splus.cpp
@@ -134,8 +134,8 @@ private:
required_ioport m_i20;
required_ioport m_i30;
required_ioport m_sensor;
- required_device<cpu_device> m_maincpu;
- required_device<i2cmem_device> m_i2cmem;
+ required_device<i80c32_device> m_maincpu;
+ required_device<x2404p_device> m_i2cmem;
output_finder<9> m_digits;
output_finder<5,8> m_leds;
};
@@ -677,34 +677,36 @@ INPUT_PORTS_END
* Machine Driver *
*************************/
-MACHINE_CONFIG_START(splus_state::splus) // basic machine hardware
- MCFG_DEVICE_ADD("maincpu", I80C32, CPU_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(splus_map)
- MCFG_DEVICE_IO_MAP(splus_iomap)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, splus_state, splus_p1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, splus_state, splus_p3_r))
+void splus_state::splus(machine_config &config) // basic machine hardware
+{
+ I80C32(config, m_maincpu, CPU_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &splus_state::splus_map);
+ m_maincpu->set_addrmap(AS_IO, &splus_state::splus_iomap);
+ m_maincpu->port_out_cb<1>().set(FUNC(splus_state::splus_p1_w));
+ m_maincpu->port_in_cb<3>().set(FUNC(splus_state::splus_p3_r));
// Fill NVRAM
NVRAM(config, "cmosl", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "cmosh", nvram_device::DEFAULT_ALL_0);
// video hardware (ALL FAKE, NO VIDEO)
- MCFG_PALETTE_ADD("palette", 16*16)
- MCFG_SCREEN_ADD("scrn", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_UPDATE_DRIVER(splus_state, screen_update)
- MCFG_SCREEN_SIZE((52+1)*8, (31+1)*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 25*8-1)
- MCFG_SCREEN_PALETTE("palette")
+ PALETTE(config, "palette", 16*16);
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_screen_update(FUNC(splus_state::screen_update));
+ screen.set_size((52+1)*8, (31+1)*8);
+ screen.set_visarea(0*8, 40*8-1, 0*8, 25*8-1);
+ screen.set_palette("palette");
- MCFG_X2404P_ADD("i2cmem")
+ X2404P(config, m_i2cmem);
// sound hardware
SPEAKER(config, "mono").front_center();
AY8912(config, "aysnd", SOUND_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.75);
-MACHINE_CONFIG_END
+}
/*************************
* Rom Load *
diff --git a/src/mame/drivers/sslam.cpp b/src/mame/drivers/sslam.cpp
index f02fb30cbf7..239e3cc4945 100644
--- a/src/mame/drivers/sslam.cpp
+++ b/src/mame/drivers/sslam.cpp
@@ -86,7 +86,6 @@ Notes:
#include "includes/sslam.h"
#include "cpu/m68000/m68000.h"
-#include "cpu/mcs51/mcs51.h"
#include "screen.h"
#include "speaker.h"
@@ -365,7 +364,7 @@ WRITE8_MEMBER(sslam_state::sslam_snd_w)
-WRITE16_MEMBER(sslam_state::powerbls_sound_w)
+WRITE16_MEMBER(powerbls_state::powerbls_sound_w)
{
m_soundlatch->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(MCS51_INT1_LINE, HOLD_LINE);
@@ -399,10 +398,10 @@ void sslam_state::sslam_program_map(address_map &map)
map(0xf00000, 0xffffff).ram(); /* Main RAM */
}
-void sslam_state::powerbls_map(address_map &map)
+void powerbls_state::powerbls_map(address_map &map)
{
map(0x000000, 0x07ffff).rom();
- map(0x100000, 0x103fff).ram().w(FUNC(sslam_state::powerbls_bg_tileram_w)).share("bg_tileram");
+ map(0x100000, 0x103fff).ram().w(FUNC(powerbls_state::powerbls_bg_tileram_w)).share("bg_tileram");
map(0x104000, 0x107fff).ram(); // not used
map(0x110000, 0x11000d).ram().share("regs");
map(0x200000, 0x200001).nopw();
@@ -413,7 +412,7 @@ void sslam_state::powerbls_map(address_map &map)
map(0x300014, 0x300015).portr("IN2");
map(0x30001a, 0x30001b).portr("DSW1");
map(0x30001c, 0x30001d).portr("DSW2");
- map(0x30001e, 0x30001f).w(FUNC(sslam_state::powerbls_sound_w));
+ map(0x30001e, 0x30001f).w(FUNC(powerbls_state::powerbls_sound_w));
map(0x304000, 0x304001).nopw();
map(0xff0000, 0xffffff).ram(); /* Main RAM */
}
@@ -691,73 +690,92 @@ GFXDECODE_END
/* Machine Driver */
-MACHINE_CONFIG_START(sslam_state::sslam)
+void sslam_state::machine_start()
+{
+ m_track = 0;
+ m_melody = 0;
+ m_bar = 0;
+
+ save_item(NAME(m_track));
+ save_item(NAME(m_melody));
+ save_item(NAME(m_bar));
+ save_item(NAME(m_snd_bank));
+
+ m_music_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sslam_state::music_playback),this));
+}
+
+void powerbls_state::machine_start()
+{
+ sslam_state::machine_start();
+ save_item(NAME(m_oki_control));
+ save_item(NAME(m_oki_command));
+ save_item(NAME(m_oki_bank));
+}
+
+void sslam_state::sslam(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 12000000) /* 12 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sslam_program_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sslam_state, irq2_line_hold)
+ M68000(config, m_maincpu, 12000000); /* 12 MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &sslam_state::sslam_program_map);
+ m_maincpu->set_vblank_int("screen", FUNC(sslam_state::irq2_line_hold));
- MCFG_DEVICE_ADD("audiocpu", I8051, 12000000)
- MCFG_DEVICE_DISABLE() /* Internal code is not dumped - 2 boards were protected */
+ I8051(config, m_audiocpu, 12000000);
+ m_audiocpu->set_disable(); /* Internal code is not dumped - 2 boards were protected */
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 39*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(sslam_state, screen_update_sslam)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(58);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(1*8, 39*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(sslam_state::screen_update));
+ screen.set_palette(m_palette);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sslam)
- MCFG_PALETTE_ADD("palette", 0x800)
- MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_sslam);
- MCFG_VIDEO_START_OVERRIDE(sslam_state,sslam)
+ PALETTE(config, m_palette, 0x800).set_format(PALETTE_FORMAT_RRRRGGGGBBBBRGBx);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sslam_state::powerbls)
+ OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH);
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.80);
+}
+void powerbls_state::powerbls(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 12000000) /* 12 MHz */
- MCFG_DEVICE_PROGRAM_MAP(powerbls_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sslam_state, irq2_line_hold)
+ M68000(config, m_maincpu, 12000000); /* 12 MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &powerbls_state::powerbls_map);
+ m_maincpu->set_vblank_int("screen", FUNC(sslam_state::irq2_line_hold));
- MCFG_DEVICE_ADD("audiocpu", I80C51, 12000000) /* 83C751 */
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, sslam_state, playmark_snd_control_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, sslam_state, playmark_snd_command_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, sslam_state, playmark_oki_w))
+ I80C51(config, m_audiocpu, 12000000); /* 83C751 */
+ m_audiocpu->port_out_cb<1>().set(FUNC(powerbls_state::playmark_snd_control_w));
+ m_audiocpu->port_in_cb<3>().set(FUNC(powerbls_state::playmark_snd_command_r));
+ m_audiocpu->port_out_cb<3>().set(FUNC(powerbls_state::playmark_oki_w));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(sslam_state, screen_update_powerbls)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(58);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(powerbls_state::screen_update));
+ screen.set_palette(m_palette);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_powerbls)
- MCFG_PALETTE_ADD("palette", 0x200)
- MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_powerbls);
- MCFG_VIDEO_START_OVERRIDE(sslam_state,powerbls)
+ PALETTE(config, m_palette, 0x200).set_format(PALETTE_FORMAT_RRRRGGGGBBBBRGBx);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) /* verified on original PCB */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH); /* verified on original PCB */
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.80);
+}
@@ -913,29 +931,7 @@ ROM_START( powerbals )
ROM_COPY( "oki", 0x00000,0x80000, 0x20000)
ROM_END
-void sslam_state::init_sslam()
-{
- m_track = 0;
- m_melody = 0;
- m_bar = 0;
-
- save_item(NAME(m_track));
- save_item(NAME(m_melody));
- save_item(NAME(m_bar));
- save_item(NAME(m_snd_bank));
-
- m_music_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sslam_state::music_playback),this));
-}
-
-void sslam_state::init_powerbls()
-{
- save_item(NAME(m_oki_control));
- save_item(NAME(m_oki_command));
- save_item(NAME(m_oki_bank));
-}
-
-
-GAME( 1993, sslam, 0, sslam, sslam, sslam_state, init_sslam, ROT0, "Playmark", "Super Slam (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, sslama, sslam, sslam, sslam, sslam_state, init_sslam, ROT0, "Playmark", "Super Slam (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, sslamb, sslam, sslam, sslam, sslam_state, init_sslam, ROT0, "Playmark", "Super Slam (set 3)", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, powerbals,powerbal, powerbls, powerbls, sslam_state, init_powerbls, ROT0, "Playmark", "Power Balls (Super Slam conversion)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, sslam, 0, sslam, sslam, sslam_state, empty_init, ROT0, "Playmark", "Super Slam (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, sslama, sslam, sslam, sslam, sslam_state, empty_init, ROT0, "Playmark", "Super Slam (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, sslamb, sslam, sslam, sslam, sslam_state, empty_init, ROT0, "Playmark", "Super Slam (set 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1994, powerbals,powerbal, powerbls, powerbls, powerbls_state, empty_init, ROT0, "Playmark", "Power Balls (Super Slam conversion)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/superqix.cpp b/src/mame/drivers/superqix.cpp
index 57234698124..79ff2197f78 100644
--- a/src/mame/drivers/superqix.cpp
+++ b/src/mame/drivers/superqix.cpp
@@ -173,8 +173,6 @@ code at z80:0093:
#include "includes/superqix.h"
#include "cpu/z80/z80.h"
-#include "cpu/mcs51/mcs51.h"
-#include "cpu/m6805/m68705.h"
#include "screen.h"
#include "speaker.h"
@@ -230,12 +228,12 @@ The MCU acts this way:
CUSTOM_INPUT_MEMBER(superqix_state::fromz80_semaphore_input_r)
{
- return (m_Z80HasWritten ? 1 : 0);
+ return (m_z80_has_written ? 1 : 0);
}
CUSTOM_INPUT_MEMBER(superqix_state::frommcu_semaphore_input_r)
{
- return (m_MCUHasWritten ? 1 : 0);
+ return (m_mcu_has_written ? 1 : 0);
}
TIMER_CALLBACK_MEMBER(superqix_state::z80_semaphore_assert_cb)
@@ -247,7 +245,7 @@ TIMER_CALLBACK_MEMBER(superqix_state::z80_semaphore_assert_cb)
title screen.
perestro and perestrof seem to completely ignore the semaphores.
*/
- if (m_mcu.found()) m_Z80HasWritten = 1;
+ if (m_mcu.found()) m_z80_has_written = 1;
}
TIMER_CALLBACK_MEMBER(superqix_state::mcu_port2_w_cb)
@@ -273,20 +271,20 @@ TIMER_CALLBACK_MEMBER(superqix_state::mcu_port2_w_cb)
m_maincpu->set_input_line(INPUT_LINE_RESET, BIT(m_port2_raw, 5) ? CLEAR_LINE : ASSERT_LINE);
// bit 6 = 74ls174@1J.d1 = the mcu->z80 semaphore, visible un-inverted on AY-3-8910 #1 @3P Port B bit 6
- m_MCUHasWritten = BIT(m_port2_raw, 6);
+ m_mcu_has_written = BIT(m_port2_raw, 6);
}
- // bit 7 = TODO: PROBABLY resets the m_Z80HasWritten semaphore on falling edge (or level? this needs more tracing)
+ // bit 7 = TODO: PROBABLY resets the m_z80_has_written semaphore on falling edge (or level? this needs more tracing)
if (BIT(changed_m_port2, 7) && !BIT(m_port2_raw, 7))
{
- m_Z80HasWritten = 0;
+ m_z80_has_written = 0;
}
}
TIMER_CALLBACK_MEMBER(superqix_state::mcu_port3_w_cb)
{
// the ay #2 iob bus and the mcu port 3 are literally directly connected together, so technically the result could be a binary AND of the two...
- m_fromMCU = param;
+ m_from_mcu = param;
}
TIMER_CALLBACK_MEMBER(superqix_state::z80_ay1_sync_address_w_cb)
@@ -298,7 +296,7 @@ TIMER_CALLBACK_MEMBER(superqix_state::z80_ay1_sync_address_w_cb)
TIMER_CALLBACK_MEMBER(superqix_state::z80_ay2_iob_w_cb)
{
// the ay #2 iob bus and the mcu port 3 are literally directly connected together, so technically the result could be a binary AND of the two...
- m_fromZ80 = param;
+ m_from_z80 = param;
}
WRITE8_MEMBER(superqix_state::z80_ay1_sync_address_w)
@@ -308,8 +306,8 @@ WRITE8_MEMBER(superqix_state::z80_ay1_sync_address_w)
READ8_MEMBER(superqix_state::z80_ay2_iob_r)
{
-// logerror("%0s: read mcu answer (%02x)\n",machine().describe_context(),m_fromMCU);
- return m_fromMCU;
+// logerror("%0s: read mcu answer (%02x)\n",machine().describe_context(), m_from_mcu);
+ return m_from_mcu;
}
READ8_MEMBER(superqix_state::z80_semaphore_assert_r)
@@ -351,8 +349,8 @@ TIMER_CALLBACK_MEMBER(superqix_state::bootleg_mcu_port1_w_cb)
if (BIT(changed_m_bl_port1, 7) && BIT(m_bl_port1, 7)) // on rising edge of p1.7
{
- if ((m_bl_port1 & 0x70) != 0x70) logerror("WARNING: port3 out latched to m_fromMCU while port3 multiplexer set to a non-open-bus value!\n");
- m_fromMCU = m_bl_port3_out; // latch port3 out to ay2 iob bus
+ if ((m_bl_port1 & 0x70) != 0x70) logerror("WARNING: port3 out latched to m_from_mcu while port3 multiplexer set to a non-open-bus value!\n");
+ m_from_mcu = m_bl_port3_out; // latch port3 out to ay2 iob bus
//note we are not doing a synchronize here, because this callback is
//already after a synchronize, and doing another one would be redundant
}
@@ -377,12 +375,12 @@ READ8_MEMBER(superqix_state::bootleg_mcu_port3_r)
}
else if ((m_bl_port1 & 0x40) == 0)
{
- return m_fromZ80;
+ return m_from_z80;
}
// There are eight vertically mounted single resistors on the 8031 bootleg
// pcb to (presumably, needs tracing) pull this bus high when no input is
// selected.
- // It is possible that the value of m_fromMCU will be read here rather than
+ // It is possible that the value of m_from_mcu will be read here rather than
// 0xff, the circuit of the bootleg pcb needs to be fully traced out to
// prove this.
return 0xff;
@@ -404,8 +402,8 @@ WRITE8_MEMBER(superqix_state::mcu_port2_w)
READ8_MEMBER(superqix_state::mcu_port3_r)
{
-// logerror("%s: read Z80 command %02x\n",machine().describe_context(),m_fromZ80);
- return m_fromZ80;
+// logerror("%s: read Z80 command %02x\n",machine().describe_context(), m_from_z80);
+ return m_from_z80;
}
@@ -710,10 +708,10 @@ The Prebillian/Hotsmash hardware seems to be an evolution of the arkanoid hardwa
arkanoid:
Port A[7:0] <> bidir comms with z80
Port B[7:0] <- input MUX (where does the paddle select bit come from??? port a bit 0?)
-PortC[0] <- m_Z80HasWritten
-PortC[1] <- m_MCUHasWritten
-PortC[2] -> high - clear m_Z80HasWritten and deassert MCU /INT; low - allow m_fromZ80 to be read at port A
-PortC[3] -> high - latch port A contents into m_fromMCU and set m_MCUHasWritten; low - do nothing.
+PortC[0] <- m_z80_has_written
+PortC[1] <- m_mcu_has_written
+PortC[2] -> high - clear m_z80_has_written and deassert MCU /INT; low - allow m_from_z80 to be read at port A
+PortC[3] -> high - latch port A contents into m_from_mcu and set m_mcu_has_written; low - do nothing.
hotsmash/prebillian:
PortA[] <- input MUX
@@ -797,107 +795,107 @@ int hotsmash_state::read_inputs(int player) // if called with player=1, we're mu
return (launchbtn_state<<4 | ((m_dial_oldpos[player] & 1) << 3) | (m_dial_sign[player] << 2) | (newpos_plunger&2) | ((newpos_plunger^(newpos_plunger>>1))&1) );
}
-READ8_MEMBER(hotsmash_state::hotsmash_68705_portA_r)
+READ8_MEMBER(hotsmash_state::hotsmash_68705_porta_r)
{
- return m_portA_in;
+ return m_porta_in;
}
-WRITE8_MEMBER(hotsmash_state::hotsmash_68705_portB_w)
+WRITE8_MEMBER(hotsmash_state::hotsmash_68705_portb_w)
{
- m_portB_out = data;
+ m_portb_out = data;
}
-WRITE8_MEMBER(hotsmash_state::hotsmash_68705_portC_w)
+WRITE8_MEMBER(hotsmash_state::hotsmash_68705_portc_w)
{
- u8 const changed_m_portC_out = m_portC_out ^ data;
- m_portC_out = data;
- //logerror("%s: MCU setting MUX port to %d\n", machine().describe_context(), m_portC_out & 0x07);
+ u8 const changed_m_portc_out = m_portc_out ^ data;
+ m_portc_out = data;
+ //logerror("%s: MCU setting MUX port to %d\n", machine().describe_context(), m_portc_out & 0x07);
// maybe on the RISING edge of the latch bit, the semaphores are updated, like TaitoSJ?
- /*if (BIT(changed_m_portC_out, 3) && BIT(m_portC_out, 3))
+ /*if (BIT(changed_m_portc_out, 3) && BIT(m_portc_out, 3))
{
- switch (m_portC_out & 0x07)
+ switch (m_portc_out & 0x07)
{
case 0x03:
- m_Z80HasWritten = 0;
+ m_z80_has_written = 0;
break;
case 0x05:
- m_MCUHasWritten = 1;
+ m_mcu_has_written = 1;
break;
default:
break;
}
}*/
- // on the falling edge of the latch bit, update port A and (if applicable) m_portB_out latches
- if (BIT(changed_m_portC_out, 3) && !BIT(m_portC_out, 3))
+ // on the falling edge of the latch bit, update port A and (if applicable) m_portb_out latches
+ if (BIT(changed_m_portc_out, 3) && !BIT(m_portc_out, 3))
{
- switch (m_portC_out & 0x07)
+ switch (m_portc_out & 0x07)
{
case 0x0: // dsw A
case 0x1: // dsw B
- m_portA_in = m_dsw[m_portC_out & 0x01]->read();
+ m_porta_in = m_dsw[m_portc_out & 0x01]->read();
break;
case 0x3: // Read command from Z80 to MCU, the z80->mcu semaphore is cleared on the rising edge
- //logerror("%s: command %02x read by MCU; Z80HasWritten: %d (and will be 0 after this); MCUHasWritten: %d\n",machine().describe_context(),m_fromZ80,m_Z80HasWritten, m_MCUHasWritten);
+ //logerror("%s: command %02x read by MCU; Z80HasWritten: %d (and will be 0 after this); MCUHasWritten: %d\n",machine().describe_context(), m_from_z80, m_z80_has_written, m_mcu_has_written);
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
- m_portA_in = m_fromZ80;
- m_Z80HasWritten = 0;
+ m_porta_in = m_from_z80;
+ m_z80_has_written = 0;
break;
case 0x5: // latch response from MCU to Z80; the mcu->z80 semaphore is set on the rising edge
- m_fromMCU = m_portB_out;
- //logerror("%s: response %02x written by MCU; Z80HasWritten: %d; MCUHasWritten: %d (and will be 1 after this)\n",machine().describe_context(),m_fromMCU,m_Z80HasWritten, m_MCUHasWritten);
- m_MCUHasWritten = 1;
- m_portA_in = 0xff;
+ m_from_mcu = m_portb_out;
+ //logerror("%s: response %02x written by MCU; Z80HasWritten: %d; MCUHasWritten: %d (and will be 1 after this)\n",machine().describe_context(), m_from_mcu, m_z80_has_written, m_mcu_has_written);
+ m_mcu_has_written = 1;
+ m_porta_in = 0xff;
break;
case 0x6:
case 0x7:
- m_portA_in = read_inputs(m_portC_out & 0x01);
+ m_porta_in = read_inputs(m_portc_out & 0x01);
break;
- default: // cases 2 and 4 presumably latch open bus/0xFF; implication from the superqix bootleg is that reading port 4 may clear the m_MCUHasWritten flag, but the hotsmash MCU never touches it. Needs hardware tests/tracing to prove.
- logerror("%s: MCU attempted to read mux port %d which is invalid!\n", machine().describe_context(), m_portC_out & 0x07);
- m_portA_in = 0xff;
+ default: // cases 2 and 4 presumably latch open bus/0xFF; implication from the superqix bootleg is that reading port 4 may clear the m_mcu_has_written flag, but the hotsmash MCU never touches it. Needs hardware tests/tracing to prove.
+ logerror("%s: MCU attempted to read mux port %d which is invalid!\n", machine().describe_context(), m_portc_out & 0x07);
+ m_porta_in = 0xff;
break;
}
//if ((m_portC_out & 0x07) < 6) logerror("%s: MCU latched %02x from mux input %d m_portA_in\n", machine().describe_context(), m_portA_in, m_portC_out & 0x07);
}
}
-WRITE8_MEMBER(hotsmash_state::hotsmash_Z80_mcu_w)
+WRITE8_MEMBER(hotsmash_state::hotsmash_z80_mcu_w)
{
- m_fromZ80 = data;
- //if ((m_fromZ80 != 0x04) && (m_fromZ80 != 0x08))
- // logerror("%s: z80 write to MCU %02x; Z80HasWritten: %d (and will be 1 after this); MCUHasWritten: %d\n",machine().describe_context(),m_fromZ80, m_Z80HasWritten, m_MCUHasWritten);
- m_Z80HasWritten = 1; // set the semaphore, and assert interrupt on the mcu
+ m_from_z80 = data;
+ //if ((m_from_z80 != 0x04) && (m_from_z80 != 0x08))
+ // logerror("%s: z80 write to MCU %02x; Z80HasWritten: %d (and will be 1 after this); MCUHasWritten: %d\n",machine().describe_context(), m_from_z80, m_z80_has_written, m_mcu_has_written);
+ m_z80_has_written = 1; // set the semaphore, and assert interrupt on the mcu
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(250)); //boost the interleave temporarily, or the game will crash.
m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
}
-READ8_MEMBER(hotsmash_state::hotsmash_Z80_mcu_r)
+READ8_MEMBER(hotsmash_state::hotsmash_z80_mcu_r)
{
if(!machine().side_effects_disabled())
{
- //if ((m_fromZ80 != 0x04) && (m_fromZ80 != 0x08))
- // logerror("%s: z80 read from MCU %02x; Z80HasWritten: %d; MCUHasWritten: %d (and will be 0 after this)\n",machine().describe_context(),m_fromMCU, m_Z80HasWritten, m_MCUHasWritten);
- m_MCUHasWritten = 0;
+ //if ((m_from_z80 != 0x04) && (m_from_z80 != 0x08))
+ // logerror("%s: z80 read from MCU %02x; Z80HasWritten: %d; MCUHasWritten: %d (and will be 0 after this)\n",machine().describe_context(), m_from_mcu, m_z80_has_written, m_mcu_has_written);
+ m_mcu_has_written = 0;
}
// return the last value the 68705 wrote, but do not mark that we've read it
- return m_fromMCU;
+ return m_from_mcu;
}
CUSTOM_INPUT_MEMBER(hotsmash_state::pbillian_semaphore_input_r)
{
ioport_value res = 0;
- // bit 0x40 is PROBABLY latch 1 on 74ls74.7c, is high if m_Z80HasWritten is clear
- if (!m_Z80HasWritten)
+ // bit 0x40 is PROBABLY latch 1 on 74ls74.7c, is high if m_z80_has_written is clear
+ if (!m_z80_has_written)
res |= 0x01;
- // bit 0x80 is PROBABLY latch 2 on 74ls74.7c, is high if m_MCUHasWritten is clear
+ // bit 0x80 is PROBABLY latch 2 on 74ls74.7c, is high if m_mcu_has_written is clear
// prebillian code at 0x6771 will wait in a loop reading ay port E forever and waiting
// for bit 7 to be clear before it will read from the mcu
- if (!m_MCUHasWritten)
+ if (!m_mcu_has_written)
res |= 0x02;
return res;
}
@@ -907,10 +905,10 @@ void superqix_state_base::machine_init_common()
{
// commmon 68705/8751/HLE
- save_item(NAME(m_MCUHasWritten));
- save_item(NAME(m_Z80HasWritten));
- save_item(NAME(m_fromMCU));
- save_item(NAME(m_fromZ80));
+ save_item(NAME(m_mcu_has_written));
+ save_item(NAME(m_z80_has_written));
+ save_item(NAME(m_from_mcu));
+ save_item(NAME(m_from_z80));
//general machine stuff
save_item(NAME(m_invert_coin_lockout));
@@ -941,8 +939,8 @@ void hotsmash_state::machine_init_common()
superqix_state_base::machine_init_common();
// 68705 related
- save_item(NAME(m_portB_out));
- save_item(NAME(m_portC_out));
+ save_item(NAME(m_portb_out));
+ save_item(NAME(m_portc_out));
// spinner quadrature stuff
save_item(NAME(m_dial_oldpos));
@@ -962,7 +960,7 @@ MACHINE_RESET_MEMBER(superqix_state, superqix)
}
}
-MACHINE_START_MEMBER(superqix_state, superqix)
+void superqix_state::machine_start()
{
/* configure the banks */
membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
@@ -970,7 +968,7 @@ MACHINE_START_MEMBER(superqix_state, superqix)
machine_init_common();
}
-MACHINE_START_MEMBER(hotsmash_state, pbillian)
+void hotsmash_state::machine_start()
{
/* configure the banks */
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
@@ -996,7 +994,7 @@ void hotsmash_state::pbillian_port_map(address_map &map)
//AM_RANGE(0x0200, 0x03ff) AM_RAM // looks like leftover crap from a dev board which had double the color ram? zeroes written here, never read.
map(0x0401, 0x0401).r(m_ay1, FUNC(ay8910_device::data_r)); // ay i/o ports connect to "SYSTEM" and "BUTTONS" inputs which includes mcu semaphore flags
map(0x0402, 0x0403).w(m_ay1, FUNC(ay8910_device::data_address_w));
- map(0x0408, 0x0408).rw(FUNC(hotsmash_state::hotsmash_Z80_mcu_r), FUNC(hotsmash_state::hotsmash_Z80_mcu_w));
+ map(0x0408, 0x0408).rw(FUNC(hotsmash_state::hotsmash_z80_mcu_r), FUNC(hotsmash_state::hotsmash_z80_mcu_w));
map(0x0410, 0x0410).w(FUNC(hotsmash_state::pbillian_0410_w)); /* Coin Counters, ROM bank, NMI enable, Flipscreen */
map(0x0418, 0x0418).r(FUNC(hotsmash_state::nmi_ack_r));
map(0x0419, 0x0419).nopw(); // ??? is this a watchdog, or something else? manual reset of mcu semaphores? manual nmi TRIGGER? used by prebillian
@@ -1351,34 +1349,31 @@ INTERRUPT_GEN_MEMBER(superqix_state::sqix_timer_irq)
-MACHINE_CONFIG_START(hotsmash_state::pbillian)
- MCFG_DEVICE_ADD("maincpu", Z80,XTAL(12'000'000)/2) /* 6 MHz, ROHM Z80B */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_IO_MAP(pbillian_port_map)
-
- MCFG_DEVICE_ADD("mcu", M68705P5, XTAL(12'000'000)/4) /* 3mhz???? */
- MCFG_M68705_PORTA_R_CB(READ8(*this, hotsmash_state, hotsmash_68705_portA_r))
- MCFG_M68705_PORTB_W_CB(WRITE8(*this, hotsmash_state, hotsmash_68705_portB_w))
- MCFG_M68705_PORTC_W_CB(WRITE8(*this, hotsmash_state, hotsmash_68705_portC_w))
+void hotsmash_state::pbillian(machine_config &config)
+{
+ Z80(config, m_maincpu, XTAL(12'000'000)/2); /* 6 MHz, ROHM Z80B */
+ m_maincpu->set_addrmap(AS_PROGRAM, &hotsmash_state::main_map);
+ m_maincpu->set_addrmap(AS_IO, &hotsmash_state::pbillian_port_map);
- //MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_MACHINE_START_OVERRIDE(hotsmash_state, pbillian)
+ m68705p5_device &mcu(M68705P5(config, m_mcu, XTAL(12'000'000)/4)); /* 3mhz???? */
+ mcu.porta_r_cb().set(FUNC(hotsmash_state::hotsmash_68705_porta_r));
+ mcu.portb_w_cb().set(FUNC(hotsmash_state::hotsmash_68705_portb_w));
+ mcu.portc_w_cb().set(FUNC(hotsmash_state::hotsmash_68705_portc_w));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(256, 256)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(hotsmash_state, screen_update_pbillian)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, hotsmash_state, vblank_irq))
+ 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(256, 256);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(hotsmash_state::screen_update_pbillian));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set(FUNC(hotsmash_state::vblank_irq));
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pbillian)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_FORMAT_CLASS(1, hotsmash_state, BBGGRRII)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_pbillian);
- MCFG_VIDEO_START_OVERRIDE(hotsmash_state, pbillian)
+ PALETTE(config, m_palette, 512);
+ m_palette->set_format(raw_to_rgb_converter(1, &hotsmash_state::BBGGRRII_decoder));
SPEAKER(config, "mono").front_center();
@@ -1387,43 +1382,40 @@ MACHINE_CONFIG_START(hotsmash_state::pbillian)
m_ay1->port_b_read_callback().set_ioport("SYSTEM");
m_ay1->add_route(ALL_OUTPUTS, "mono", 0.30);
- MCFG_DEVICE_ADD("samples", SAMPLES)
- MCFG_SAMPLES_CHANNELS(1)
- MCFG_SAMPLES_START_CB(hotsmash_state, pbillian_sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(superqix_state::sqix)
+ SAMPLES(config, m_samples);
+ m_samples->set_channels(1);
+ m_samples->set_samples_start_callback(FUNC(hotsmash_state::pbillian_sh_start));
+ m_samples->add_route(ALL_OUTPUTS, "mono", 0.50);
+}
+void superqix_state::sqix(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(12'000'000)/2) /* Z80B, 12 MHz / 2 (6 MHz), verified from pcb tracing */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_IO_MAP(sqix_port_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(superqix_state, sqix_timer_irq, 4*60) /* ??? */
-
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(12'000'000)/2) /* i8751-88, 12 MHz / 2 (6 MHz), verified from pcb tracing */
- MCFG_MCS51_PORT_P0_IN_CB(IOPORT("SYSTEM"))
- MCFG_MCS51_PORT_P1_IN_CB(IOPORT("DSW1"))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, superqix_state, mcu_port2_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, superqix_state, mcu_port3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, superqix_state, mcu_port3_w))
-
- MCFG_MACHINE_START_OVERRIDE(superqix_state,superqix)
+ Z80(config, m_maincpu, XTAL(12'000'000)/2); /* Z80B, 12 MHz / 2 (6 MHz), verified from pcb tracing */
+ m_maincpu->set_addrmap(AS_PROGRAM, &superqix_state::main_map);
+ m_maincpu->set_addrmap(AS_IO, &superqix_state::sqix_port_map);
+ m_maincpu->set_periodic_int(FUNC(superqix_state::sqix_timer_irq), attotime::from_hz(4*60)); /* ??? */
+
+ i8751_device &mcu(I8751(config, m_mcu, XTAL(12'000'000)/2)); /* i8751-88, 12 MHz / 2 (6 MHz), verified from pcb tracing */
+ mcu.port_in_cb<0>().set_ioport("SYSTEM");
+ mcu.port_in_cb<1>().set_ioport("DSW1");
+ mcu.port_out_cb<2>().set(FUNC(superqix_state::mcu_port2_w));
+ mcu.port_in_cb<3>().set(FUNC(superqix_state::mcu_port3_r));
+ mcu.port_out_cb<3>().set(FUNC(superqix_state::mcu_port3_w));
/* 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(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(superqix_state, screen_update_superqix)
- MCFG_SCREEN_PALETTE("palette")
+ 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(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(superqix_state::screen_update_superqix));
+ screen.set_palette(m_palette);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sqix)
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_PALETTE_FORMAT_CLASS(1, superqix_state, BBGGRRII)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_sqix);
- MCFG_VIDEO_START_OVERRIDE(superqix_state,superqix)
+ PALETTE(config, m_palette, 256);
+ m_palette->set_format(raw_to_rgb_converter(1, &superqix_state_base::BBGGRRII_decoder));
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1440,59 +1432,29 @@ MACHINE_CONFIG_START(superqix_state::sqix)
m_ay2->port_b_read_callback().set(FUNC(superqix_state::z80_ay2_iob_r));
m_ay2->port_b_write_callback().set(FUNC(superqix_state::z80_ay2_iob_w));
m_ay2->add_route(ALL_OUTPUTS, "mono", 0.25);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(superqix_state::sqix_8031)
+void superqix_state::sqix_8031(machine_config &config)
+{
sqix(config);
- MCFG_DEVICE_REPLACE("mcu", I8031, XTAL(12'000'000)/2) /* p8031ah, clock not verified */
- MCFG_DEVICE_PROGRAM_MAP(sqix_8031_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, superqix_state, bootleg_mcu_port1_w))
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, superqix_state, bootleg_mcu_port3_r))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, superqix_state, bootleg_mcu_port3_w))
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(superqix_state::sqix_nomcu)
-
- /* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, 12000000/2) /* 6 MHz */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_IO_MAP(sqix_port_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(superqix_state, sqix_timer_irq, 4*60) /* ??? */
-
- MCFG_MACHINE_START_OVERRIDE(superqix_state,superqix)
-
- /* 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(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(superqix_state, screen_update_superqix)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sqix)
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_PALETTE_FORMAT_CLASS(1, superqix_state, BBGGRRII)
-
- MCFG_VIDEO_START_OVERRIDE(superqix_state,superqix)
+ i8031_device &mcu(I8031(config.replace(), m_mcu, XTAL(12'000'000)/2)); /* p8031ah, clock not verified */
+ mcu.set_addrmap(AS_PROGRAM, &superqix_state::sqix_8031_map);
+ mcu.port_out_cb<1>().set(FUNC(superqix_state::bootleg_mcu_port1_w));
+ mcu.port_in_cb<3>().set(FUNC(superqix_state::bootleg_mcu_port3_r));
+ mcu.port_out_cb<3>().set(FUNC(superqix_state::bootleg_mcu_port3_w));
+}
- /* sound hardware */
- SPEAKER(config, "mono").front_center();
+void superqix_state::sqix_nomcu(machine_config &config)
+{
+ sqix(config);
- AY8910(config, m_ay1, 12000000/8);
- m_ay1->set_flags(AY8910_SINGLE_OUTPUT); // ?
- m_ay1->port_a_read_callback().set_ioport("P1");
- m_ay1->port_b_read_callback().set_ioport("P2");
- m_ay1->add_route(ALL_OUTPUTS, "mono", 0.25);
+ config.device_remove("mcu");
- AY8910(config, m_ay2, 12000000/8);
- m_ay2->set_flags(AY8910_SINGLE_OUTPUT); // ?
- m_ay2->port_a_read_callback().set_ioport("DSW2");
m_ay2->port_b_read_callback().set(FUNC(superqix_state::bootleg_in0_r));
- m_ay2->add_route(ALL_OUTPUTS, "mono", 0.25);
-MACHINE_CONFIG_END
+ m_ay2->port_b_write_callback().set_nop();
+}
@@ -1765,7 +1727,7 @@ void superqix_state_base::init_hotsmash()
m_invert_p2_spinner = true;
}
-
+/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME */
GAME( 1986, pbillian, 0, pbillian, pbillian, hotsmash_state, init_pbillian, ROT0, "Kaneko / Taito", "Prebillian", MACHINE_SUPPORTS_SAVE )
GAME( 1987, hotsmash, 0, pbillian, hotsmash, hotsmash_state, init_hotsmash, ROT90, "Kaneko / Taito", "Vs. Hot Smash", MACHINE_SUPPORTS_SAVE )
GAME( 1987, sqix, 0, sqix, superqix, superqix_state, init_sqix, ROT90, "Kaneko / Taito", "Super Qix (World/Japan, V1.2)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index cd3fef74a5b..e6f795a22c7 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -222,7 +222,6 @@ seem to have access to.
#include "emu.h"
#include "includes/system1.h"
-#include "cpu/mcs51/mcs51.h"
#include "machine/segacrpt_device.h"
#include "machine/mc8123.h"
#include "sound/sn76496.h"
@@ -2161,17 +2160,18 @@ GFXDECODE_END
*************************************/
/* original board with 64kbit ROMs and an 8255 PPI for outputs */
-MACHINE_CONFIG_START(system1_state::sys1ppi)
-
+void system1_state::sys1ppi(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK) /* not really, see notes above */
- MCFG_DEVICE_PROGRAM_MAP(system1_map)
- MCFG_DEVICE_IO_MAP(system1_ppi_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", system1_state, irq0_line_hold)
+ Z80(config, m_maincpu, MASTER_CLOCK); /* not really, see notes above */
+ m_maincpu->set_addrmap(AS_PROGRAM, &system1_state::system1_map);
+ m_maincpu->set_addrmap(AS_IO, &system1_state::system1_ppi_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(system1_state::irq0_line_hold));
- MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("soundirq", system1_state, soundirq_gen, "screen", 32, 64)
+ Z80(config, m_soundcpu, SOUND_CLOCK/2);
+ m_soundcpu->set_addrmap(AS_PROGRAM, &system1_state::sound_map);
+
+ TIMER(config, "soundirq", 0).configure_scanline(FUNC(system1_state::soundirq_gen), "screen", 32, 64);
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@@ -2181,403 +2181,417 @@ MACHINE_CONFIG_START(system1_state::sys1ppi)
m_ppi8255->out_pc_callback().set(FUNC(system1_state::sound_control_w));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) /* needed for proper hardware collisions */
- MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 640, 0, 512, 260, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(system1_state, screen_update_system1)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); /* needed for proper hardware collisions */
+ m_screen->set_raw(MASTER_CLOCK/2, 640, 0, 512, 260, 0, 224);
+ m_screen->set_screen_update(FUNC(system1_state::screen_update_system1));
+ m_screen->set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_system1);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_system1)
- MCFG_PALETTE_ADD("palette", 2048)
- MCFG_PALETTE_FORMAT(BBGGGRRR)
+ PALETTE(config, m_palette, 2048).set_format(PALETTE_FORMAT_BBGGGRRR);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("sn1", SN76489A, SOUND_CLOCK/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DEVICE_ADD("sn2", SN76489A, SOUND_CLOCK/2) /* selectable via jumper */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
-
-
+ SN76489A(config, "sn1", SOUND_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.50);
+ /* 2nd SN's clock is selectable via jumper */
+ SN76489A(config, "sn2", SOUND_CLOCK/2).add_route(ALL_OUTPUTS, "mono", 0.50);
+}
/* reduced visible area for scrolling games */
-MACHINE_CONFIG_START(system1_state::sys1ppis)
+void system1_state::sys1ppis(machine_config &config)
+{
sys1ppi(config);
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1)
-MACHINE_CONFIG_END
-
-
-
-
-
+ m_screen->set_visarea(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1);
+}
/* revised board with 128kbit ROMs and a Z80 PIO for outputs */
-MACHINE_CONFIG_START(system1_state::sys1pio)
+void system1_state::sys1pio(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(system1_pio_io_map)
+ m_maincpu->set_addrmap(AS_IO, &system1_state::system1_pio_io_map);
- MCFG_DEVICE_REMOVE("ppi8255")
+ config.device_remove("ppi8255");
Z80PIO(config, m_pio, MASTER_CLOCK);
m_pio->out_pa_callback().set(FUNC(system1_state::soundport_w));
m_pio->out_ardy_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
m_pio->out_pb_callback().set(FUNC(system1_state::videomode_w));
-MACHINE_CONFIG_END
-
-#define ENCRYPTED_SYS1PPI_MAPS \
- MCFG_DEVICE_PROGRAM_MAP(system1_map) \
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) \
- MCFG_DEVICE_IO_MAP(system1_ppi_io_map) \
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", system1_state, irq0_line_hold)
+}
-#define ENCRYPTED_SYS1PIO_MAPS \
- MCFG_DEVICE_PROGRAM_MAP(system1_map) \
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) \
- MCFG_DEVICE_IO_MAP(system1_pio_io_map) \
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", system1_state, irq0_line_hold)
+void system1_state::encrypted_sys1ppi_maps(machine_config &config)
+{
+ m_maincpu->set_addrmap(AS_PROGRAM, &system1_state::system1_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::decrypted_opcodes_map);
+ m_maincpu->set_addrmap(AS_IO, &system1_state::system1_ppi_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(system1_state::irq0_line_hold));
+}
-#define ENCRYPTED_SYS2_MC8123_MAPS \
- MCFG_DEVICE_PROGRAM_MAP(system1_map) \
- MCFG_DEVICE_OPCODES_MAP(banked_decrypted_opcodes_map) \
- MCFG_DEVICE_IO_MAP(system1_ppi_io_map) \
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", system1_state, irq0_line_hold)
+void system1_state::encrypted_sys1pio_maps(machine_config &config)
+{
+ m_maincpu->set_addrmap(AS_PROGRAM, &system1_state::system1_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::decrypted_opcodes_map);
+ m_maincpu->set_addrmap(AS_IO, &system1_state::system1_pio_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(system1_state::irq0_line_hold));
+}
+void system1_state::encrypted_sys2_mc8123_maps(machine_config &config)
+{
+ m_maincpu->set_addrmap(AS_PROGRAM, &system1_state::system1_map);
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::banked_decrypted_opcodes_map);
+ m_maincpu->set_addrmap(AS_IO, &system1_state::system1_ppi_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(system1_state::irq0_line_hold));
+}
-MACHINE_CONFIG_START(system1_state::sys1pioxb)
+void system1_state::sys1pioxb(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", MC8123, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
-MACHINE_CONFIG_END
+ MC8123(config.replace(), m_maincpu, MASTER_CLOCK);
+ encrypted_sys1pio_maps(config);
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5178)
+void system1_state::sys1ppix_315_5178(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5178, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5178(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5179)
+void system1_state::sys1ppix_315_5179(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5179, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5179(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5051)
+void system1_state::sys1ppix_315_5051(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5051, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5051(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5048)
+void system1_state::sys1ppix_315_5048(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5048, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5048(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5033)
+void system1_state::sys1ppix_315_5033(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5033, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5033(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5065)
+void system1_state::sys1ppix_315_5065(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5065, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
+ segacrpt_z80_device &z80(SEGA_315_5065(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppix_315_5098)
+void system1_state::sys1ppix_315_5098(machine_config &config)
+{
sys1ppi(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5098, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5098(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5177)
+void system1_state::sys1piox_315_5177(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5177, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5177(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5162)
+void system1_state::sys1piox_315_5162(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5162, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5162(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_317_0006)
+void system1_state::sys1piox_317_0006(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_317_0006, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_317_0006(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5135)
+void system1_state::sys1piox_315_5135(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5135, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5135(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5132)
+void system1_state::sys1piox_315_5132(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5132, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5132(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5155)
+void system1_state::sys1piox_315_5155(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5155, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5155(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5110)
+void system1_state::sys1piox_315_5110(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5110, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5110(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5051)
+void system1_state::sys1piox_315_5051(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5051, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5051(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5098)
+void system1_state::sys1piox_315_5098(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5098, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5098(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5102)
+void system1_state::sys1piox_315_5102(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5102, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
+ segacrpt_z80_device &z80(SEGA_315_5102(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5133)
+void system1_state::sys1piox_315_5133(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5133, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
+ segacrpt_z80_device &z80(SEGA_315_5133(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5093)
+void system1_state::sys1piox_315_5093(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5093, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5093(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piox_315_5065)
+void system1_state::sys1piox_315_5065(machine_config &config)
+{
sys1pio(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5065, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5065(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
/* reduced visible area for scrolling games */
-MACHINE_CONFIG_START(system1_state::sys1pios)
+void system1_state::sys1pios(machine_config &config)
+{
sys1pio(config);
+ m_screen->set_visarea(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1);
+}
- /* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(system1_state::sys1piosx_315_5099)
- sys1pios(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5065, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+void system1_state::sys1piosx_315_5099(machine_config &config)
+{
+ sys1pio(config);
+ segacrpt_z80_device &z80(SEGA_315_5099(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1piosx_315_spat)
+void system1_state::sys1piosx_315_spat(machine_config &config)
+{
sys1pios(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_SPAT, MASTER_CLOCK)
- ENCRYPTED_SYS1PIO_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
+ segacrpt_z80_device &z80(SEGA_315_SPAT(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1pio_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppisx_315_5064)
+void system1_state::sys1ppisx_315_5064(machine_config &config)
+{
sys1ppis(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5064, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrpt_z80_device &z80(SEGA_315_5064(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys1ppisx_315_5041)
+void system1_state::sys1ppisx_315_5041(machine_config &config)
+{
sys1ppis(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5041, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
-
-
-
-
+ segacrpt_z80_device &z80(SEGA_315_5041(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
/* this describes the additional 8751 MCU when present */
-MACHINE_CONFIG_START(system1_state::mcu)
-
+void system1_state::mcu(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_VBLANK_INT_REMOVE()
+ m_maincpu->set_vblank_int(device_interrupt_delegate(), nullptr);
- MCFG_DEVICE_ADD("mcu", I8751, SOUND_CLOCK)
- MCFG_DEVICE_IO_MAP(mcu_io_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, system1_state, mcu_control_w))
+ I8751(config, m_mcu, SOUND_CLOCK);
+ m_mcu->set_addrmap(AS_IO, &system1_state::mcu_io_map);
+ m_mcu->port_out_cb<1>().set(FUNC(system1_state::mcu_control_w));
- MCFG_DEVICE_MODIFY("screen")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("mcu", MCS51_INT0_LINE))
+ m_screen->screen_vblank().set_inputline("mcu", MCS51_INT0_LINE);
// This interrupt is driven by pin 15 of a PAL16R4 (315-5138 on Choplifter), based on the vertical count.
// The actual duty cycle likely differs from VBLANK, which is another output from the same PAL.
- MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_t0", system1_state, mcu_t0_callback, attotime::from_usec(2500))
-MACHINE_CONFIG_END
-
-
+ TIMER(config, "mcu_t0", 0).configure_periodic(timer_device::expired_delegate(FUNC(system1_state::mcu_t0_callback), this), attotime::from_usec(2500));
+}
/* alternate program map with RAM/collision swapped */
-MACHINE_CONFIG_START(system1_state::nob)
+void system1_state::nob(machine_config &config)
+{
sys1ppi(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(nobo_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &system1_state::nobo_map);
+}
-MACHINE_CONFIG_START(system1_state::nobm)
+void system1_state::nobm(machine_config &config)
+{
nob(config);
/* basic machine hardware */
- MCFG_DEVICE_ADD("mcu", I8751, SOUND_CLOCK)
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, system1_state, nob_mcu_latch_r))
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, system1_state, nob_mcu_latch_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, system1_state, nob_mcu_status_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, system1_state, nob_mcu_control_p2_w))
-MACHINE_CONFIG_END
+ I8751(config, m_mcu, SOUND_CLOCK);
+ m_mcu->port_in_cb<0>().set(FUNC(system1_state::nob_mcu_latch_r));
+ m_mcu->port_out_cb<0>().set(FUNC(system1_state::nob_mcu_latch_w));
+ m_mcu->port_out_cb<1>().set(FUNC(system1_state::nob_mcu_status_w));
+ m_mcu->port_out_cb<2>().set(FUNC(system1_state::nob_mcu_control_p2_w));
+}
/* system2 video */
-MACHINE_CONFIG_START(system1_state::sys2)
+void system1_state::sys2(machine_config &config)
+{
sys1ppi(config);
MCFG_MACHINE_START_OVERRIDE(system1_state,system2)
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(system1_state,system2)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(system1_state, screen_update_system2)
-MACHINE_CONFIG_END
+ m_screen->set_screen_update(FUNC(system1_state::screen_update_system2));
+}
-MACHINE_CONFIG_START(system1_state::sys2x)
+void system1_state::sys2x(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(system1_state::sys2_315_5177)
+void system1_state::sys2_315_5177(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5177, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5177(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys2_315_5176)
+void system1_state::sys2_315_5176(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_315_5176, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_315_5176(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys2_317_0006)
+void system1_state::sys2_317_0006(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_317_0006, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
+ segacrp2_z80_device &z80(SEGA_317_0006(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys2_317_0007)
+void system1_state::sys2_317_0007(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_REPLACE("maincpu", SEGA_317_0007, MASTER_CLOCK)
- ENCRYPTED_SYS1PPI_MAPS
- MCFG_SEGAZ80_SET_DECRYPTED_TAG(":decrypted_opcodes")
-MACHINE_CONFIG_END
-
+ segacrp2_z80_device &z80(SEGA_317_0007(config.replace(), m_maincpu, MASTER_CLOCK));
+ encrypted_sys1ppi_maps(config);
+ z80.set_decrypted_tag(":decrypted_opcodes");
+}
-MACHINE_CONFIG_START(system1_state::sys2xb)
+void system1_state::sys2xb(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_REPLACE("maincpu", MC8123, MASTER_CLOCK)
- ENCRYPTED_SYS2_MC8123_MAPS
-MACHINE_CONFIG_END
+ MC8123(config.replace(), m_maincpu, MASTER_CLOCK);
+ encrypted_sys2_mc8123_maps(config);
+}
-MACHINE_CONFIG_START(system1_state::sys2xboot)
+void system1_state::sys2xboot(machine_config &config)
+{
sys2(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(banked_decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::banked_decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(system1_state::sys2m)
+void system1_state::sys2m(machine_config &config)
+{
sys2(config);
mcu(config);
-MACHINE_CONFIG_END
+}
/* system2 with rowscroll */
-MACHINE_CONFIG_START(system1_state::sys2row)
+void system1_state::sys2row(machine_config &config)
+{
sys2(config);
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(system1_state, screen_update_system2_rowscroll)
-MACHINE_CONFIG_END
+ m_screen->set_screen_update(FUNC(system1_state::screen_update_system2_rowscroll));
+}
-MACHINE_CONFIG_START(system1_state::sys2rowxb)
+void system1_state::sys2rowxb(machine_config &config)
+{
sys2row(config);
- MCFG_DEVICE_REPLACE("maincpu", MC8123, MASTER_CLOCK)
- ENCRYPTED_SYS2_MC8123_MAPS
-MACHINE_CONFIG_END
+ MC8123(config.replace(), m_maincpu, MASTER_CLOCK);
+ encrypted_sys2_mc8123_maps(config);
+}
-MACHINE_CONFIG_START(system1_state::sys2rowxboot)
+void system1_state::sys2rowxboot(machine_config &config)
+{
sys2row(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(banked_decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_OPCODES, &system1_state::banked_decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(system1_state::sys2rowm)
+void system1_state::sys2rowm(machine_config &config)
+{
sys2row(config);
mcu(config);
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/tecnbras.cpp b/src/mame/drivers/tecnbras.cpp
index 0a2cc9d769a..0af732566d4 100644
--- a/src/mame/drivers/tecnbras.cpp
+++ b/src/mame/drivers/tecnbras.cpp
@@ -50,7 +50,7 @@ private:
void i80c31_io(address_map &map);
void i80c31_prg(address_map &map);
- required_device<cpu_device> m_maincpu;
+ required_device<i80c31_device> m_maincpu;
output_finder<14 * 7> m_dmds;
int m_xcoord;
@@ -111,12 +111,13 @@ void tecnbras_state::machine_reset()
{
}
-MACHINE_CONFIG_START(tecnbras_state::tecnbras)
+void tecnbras_state::tecnbras(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, 12_MHz_XTAL) // verified on pcb
- MCFG_DEVICE_PROGRAM_MAP(i80c31_prg)
- MCFG_DEVICE_IO_MAP(i80c31_io)
- MCFG_MCS51_PORT_P1_OUT_CB(NOOP) // buzzer ?
+ I80C31(config, m_maincpu, 12_MHz_XTAL); // verified on pcb
+ m_maincpu->set_addrmap(AS_PROGRAM, &tecnbras_state::i80c31_prg);
+ m_maincpu->set_addrmap(AS_IO, &tecnbras_state::i80c31_io);
+ m_maincpu->port_out_cb<1>().set_nop(); // buzzer ?
/* TODO: Add an I2C RTC (Phillips PCF8583P)
pin 6 (SCL): cpu T0/P3.4 (pin 14)
@@ -134,8 +135,7 @@ MACHINE_CONFIG_START(tecnbras_state::tecnbras)
/* video hardware */
config.set_default_layout(layout_tecnbras);
-
-MACHINE_CONFIG_END
+}
ROM_START( tecnbras )
ROM_REGION( 0x8000, "maincpu", 0 )
diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp
index eb41aa0897f..e610b2e8f7b 100644
--- a/src/mame/drivers/thedeep.cpp
+++ b/src/mame/drivers/thedeep.cpp
@@ -30,7 +30,6 @@ Notes:
#include "includes/thedeep.h"
#include "cpu/m6502/m65c02.h"
-#include "cpu/mcs51/mcs51.h"
#include "cpu/z80/z80.h"
#include "sound/2203intf.h"
#include "screen.h"
@@ -401,40 +400,39 @@ INTERRUPT_GEN_MEMBER(thedeep_state::mcu_irq)
m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
}
-MACHINE_CONFIG_START(thedeep_state::thedeep)
-
+void thedeep_state::thedeep(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(12'000'000)/2) /* verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, interrupt, "screen", 0, 1)
+ Z80(config, m_maincpu, XTAL(12'000'000)/2); /* verified on pcb */
+ m_maincpu->set_addrmap(AS_PROGRAM, &thedeep_state::main_map);
+
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(thedeep_state::interrupt), "screen", 0, 1);
- MCFG_DEVICE_ADD("audiocpu", M65C02, XTAL(12'000'000)/8) /* verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(audio_map)
+ M65C02(config, m_audiocpu, XTAL(12'000'000)/8); /* verified on pcb */
+ m_audiocpu->set_addrmap(AS_PROGRAM, &thedeep_state::audio_map);
/* IRQ by YM2203, NMI by when sound latch written by main cpu */
/* MCU is a i8751 running at 8Mhz (8mhz xtal)*/
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(8'000'000))
- MCFG_MCS51_PORT_P0_IN_CB(READ8(*this, thedeep_state, p0_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, thedeep_state, p1_w))
- MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, thedeep_state, from_main_r))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, thedeep_state, to_main_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, thedeep_state, p3_w))
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", thedeep_state, mcu_irq) // unknown source, but presumably vblank
- MCFG_DEVICE_DISABLE()
-
+ I8751(config, m_mcu, XTAL(8'000'000));
+ m_mcu->port_in_cb<0>().set(FUNC(thedeep_state::p0_r));
+ m_mcu->port_out_cb<1>().set(FUNC(thedeep_state::p1_w));
+ m_mcu->port_in_cb<1>().set(FUNC(thedeep_state::from_main_r));
+ m_mcu->port_out_cb<2>().set(FUNC(thedeep_state::to_main_w));
+ m_mcu->port_out_cb<3>().set(FUNC(thedeep_state::p3_w));
+ m_mcu->set_vblank_int("screen", FUNC(thedeep_state::mcu_irq)); // unknown source, but presumably vblank
+ m_mcu->set_disable();
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(0x100, 0xf8)
- MCFG_SCREEN_VISIBLE_AREA(0, 0x100-1, 0, 0xf8-1)
- MCFG_SCREEN_UPDATE_DRIVER(thedeep_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_thedeep)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_INIT_OWNER(thedeep_state, thedeep)
+ 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(0x100, 0xf8);
+ screen.set_visarea(0, 0x100-1, 0, 0xf8-1);
+ screen.set_screen_update(FUNC(thedeep_state::screen_update));
+ screen.set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_thedeep);
+ PALETTE(config, m_palette, 512).set_init(FUNC(thedeep_state::palette_init_thedeep));
DECO_MXC06(config, m_spritegen, 0);
m_spritegen->set_gfx_region(0);
@@ -447,10 +445,10 @@ MACHINE_CONFIG_START(thedeep_state::thedeep)
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/4) /* verified on pcb */
- MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ ym2203_device &ym(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); /* verified on pcb */
+ ym.irq_handler().set_inputline("audiocpu", 0);
+ ym.add_route(ALL_OUTPUTS, "mono", 1.0);
+}
diff --git a/src/mame/drivers/ti630.cpp b/src/mame/drivers/ti630.cpp
index 185ce0c11a2..d3e607ea505 100644
--- a/src/mame/drivers/ti630.cpp
+++ b/src/mame/drivers/ti630.cpp
@@ -64,7 +64,7 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
+ required_device<i80c31_device> m_maincpu;
required_device<hd44780_device> m_lcdc;
};
@@ -137,31 +137,32 @@ static GFXDECODE_START( gfx_ti630 )
GFXDECODE_ENTRY( "hd44780:cgrom", 0x0000, ti630_charlayout, 0, 1 )
GFXDECODE_END
-MACHINE_CONFIG_START(ti630_state::ti630)
+void ti630_state::ti630(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I80C31, XTAL(10'000'000))
- MCFG_DEVICE_PROGRAM_MAP(i80c31_prg)
- MCFG_DEVICE_IO_MAP(i80c31_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, ti630_state, i80c31_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, ti630_state, i80c31_p1_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, ti630_state, i80c31_p3_w))
+ I80C31(config, m_maincpu, XTAL(10'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &ti630_state::i80c31_prg);
+ m_maincpu->set_addrmap(AS_IO, &ti630_state::i80c31_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(ti630_state::i80c31_p1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(ti630_state::i80c31_p1_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(ti630_state::i80c31_p3_w));
/* video hardware */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_SCREEN_SIZE(6*16, 9*2)
- MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_PALETTE_ADD("palette", 2)
- MCFG_PALETTE_INIT_OWNER(ti630_state, ti630)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ti630)
-
- MCFG_HD44780_ADD("hd44780")
- MCFG_HD44780_LCD_SIZE(2, 16)
-MACHINE_CONFIG_END
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
+ screen.set_size(6*16, 9*2);
+ screen.set_visarea(0, 6*16-1, 0, 9*2-1);
+ screen.set_palette("palette");
+
+ PALETTE(config, "palette", 2).set_init(FUNC(ti630_state::palette_init_ti630));
+
+ GFXDECODE(config, "gfxdecode", "palette", gfx_ti630);
+
+ HD44780(config, m_lcdc, 0);
+ m_lcdc->set_lcd_size(2, 16);
+}
ROM_START( ti630 )
ROM_REGION( 0x10000, "maincpu", 0 )
diff --git a/src/mame/drivers/tigeroad.cpp b/src/mame/drivers/tigeroad.cpp
index bf4a7525738..065ca1417ee 100644
--- a/src/mame/drivers/tigeroad.cpp
+++ b/src/mame/drivers/tigeroad.cpp
@@ -701,10 +701,10 @@ MACHINE_CONFIG_START(f1dream_state::f1dream)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(f1dream_map)
- MCFG_DEVICE_ADD("mcu", I8751, XTAL(10'000'000)) /* ??? */
- MCFG_DEVICE_IO_MAP(f1dream_mcu_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, f1dream_state, out1_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, f1dream_state, out3_w))
+ I8751(config, m_mcu, XTAL(10'000'000)); /* ??? */
+ m_mcu->set_addrmap(AS_IO, &f1dream_state::f1dream_mcu_io);
+ m_mcu->port_out_cb<1>().set(FUNC(f1dream_state::out1_w));
+ m_mcu->port_out_cb<3>().set(FUNC(f1dream_state::out3_w));
MACHINE_CONFIG_END
/* same as above but with additional Z80 for samples playback */
diff --git a/src/mame/drivers/trs80dt1.cpp b/src/mame/drivers/trs80dt1.cpp
index 6361c125660..d8c787c1efa 100644
--- a/src/mame/drivers/trs80dt1.cpp
+++ b/src/mame/drivers/trs80dt1.cpp
@@ -73,7 +73,7 @@ private:
virtual void machine_start() override;
required_shared_ptr<u8> m_p_videoram;
required_region_ptr<u8> m_p_chargen;
- required_device<cpu_device> m_maincpu;
+ required_device<i8051_device> m_maincpu;
required_device<palette_device> m_palette;
required_device<i8276_device> m_crtc;
required_device<x2210_device> m_nvram;
@@ -310,22 +310,24 @@ I8275_DRAW_CHARACTER_MEMBER( trs80dt1_state::crtc_update_row )
}
-MACHINE_CONFIG_START(trs80dt1_state::trs80dt1)
+void trs80dt1_state::trs80dt1(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8051, 7372800)
- MCFG_DEVICE_PROGRAM_MAP(prg_map)
- MCFG_DEVICE_IO_MAP(io_map)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, trs80dt1_state, port1_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, trs80dt1_state, port3_w))
+ I8051(config, m_maincpu, 7372800);
+ m_maincpu->set_addrmap(AS_PROGRAM, &trs80dt1_state::prg_map);
+ m_maincpu->set_addrmap(AS_IO, &trs80dt1_state::io_map);
+ m_maincpu->port_out_cb<1>().set(FUNC(trs80dt1_state::port1_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(trs80dt1_state::port3_w));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_UPDATE_DEVICE("crtc", i8276_device, screen_update)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(40*12, 16*16)
- MCFG_SCREEN_VISIBLE_AREA(0, 40*12-1, 0, 16*16-1)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trs80dt1 )
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_screen_update("crtc", FUNC(i8276_device::screen_update));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(40*12, 16*16);
+ screen.set_visarea(0, 40*12-1, 0, 16*16-1);
+
+ GFXDECODE(config, "gfxdecode", m_palette, gfx_trs80dt1);
I8276(config, m_crtc, 12480000 / 8);
m_crtc->set_character_width(8);
@@ -335,7 +337,8 @@ MACHINE_CONFIG_START(trs80dt1_state::trs80dt1)
m_crtc->irq_wr_callback().append(m_7474, FUNC(ttl7474_device::d_w));
m_crtc->vrtc_wr_callback().set(m_7474, FUNC(ttl7474_device::clock_w));
m_crtc->set_screen("screen");
- MCFG_PALETTE_ADD("palette", 3)
+
+ PALETTE(config, "palette", 3);
X2210(config, "nvram");
@@ -344,9 +347,9 @@ MACHINE_CONFIG_START(trs80dt1_state::trs80dt1)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("beeper", BEEP, 2000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ BEEP(config, m_beep, 2000);
+ m_beep->add_route(ALL_OUTPUTS, "mono", 0.50);
+}
ROM_START( trs80dt1 )
diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp
index 1ce3e9cfc78..d6f2eb659f2 100644
--- a/src/mame/drivers/tumbleb.cpp
+++ b/src/mame/drivers/tumbleb.cpp
@@ -308,7 +308,6 @@ Stephh's notes (based on the games M68000 code and some tests) :
#include "sound/ym2151.h"
#include "sound/3812intf.h"
#include "sound/okim6295.h"
-#include "screen.h"
#include "speaker.h"
@@ -2270,36 +2269,36 @@ MACHINE_RESET_MEMBER(tumbleb_state,htchctch)
MACHINE_RESET_CALL_MEMBER(tumbleb);
}
-MACHINE_CONFIG_START(tumbleb_state::htchctch)
-
+void tumbleb_state::htchctch(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 15000000) /* verified */
- MCFG_DEVICE_PROGRAM_MAP(htchctch_main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tumbleb_state, irq6_line_hold)
+ M68000(config, m_maincpu, 15000000); /* verified */
+ m_maincpu->set_addrmap(AS_PROGRAM, &tumbleb_state::htchctch_main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(tumbleb_state::irq6_line_hold));
- MCFG_DEVICE_ADD("audiocpu", Z80, 15000000/4) /* verified on dquizgo */
- MCFG_DEVICE_PROGRAM_MAP(semicom_sound_map)
+ Z80(config, m_audiocpu, 15000000/4); /* verified on dquizgo */
+ m_audiocpu->set_addrmap(AS_PROGRAM, &tumbleb_state::semicom_sound_map);
MCFG_MACHINE_START_OVERRIDE(tumbleb_state,tumbleb)
MCFG_MACHINE_RESET_OVERRIDE(tumbleb_state,htchctch)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2400)) // ?? cookbib needs it above ~2400 or the Joystick on the How to Play screen is the wrong colour?!
- MCFG_SCREEN_SIZE(40*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_semicom)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2400)); // ?? cookbib needs it above ~2400 or the Joystick on the How to Play screen is the wrong colour?!
+ m_screen->set_size(40*8, 32*8);
+ m_screen->set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_semicom));
+ m_screen->set_palette(m_palette);
DECO_SPRITE(config, m_sprgen, 0);
m_sprgen->set_gfx_region(3);
m_sprgen->set_is_bootleg(true);
m_sprgen->set_gfxdecode_tag(m_gfxdecode);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb)
- MCFG_PALETTE_ADD("palette", 1024)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_tumbleb);
+
+ PALETTE(config, m_palette, 1024).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
MCFG_VIDEO_START_OVERRIDE(tumbleb_state,tumblepb)
@@ -2314,102 +2313,97 @@ MACHINE_CONFIG_START(tumbleb_state::htchctch)
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.10);
/* correct for cookie & bibi and hatch catch, (4096000/4) */
- MCFG_DEVICE_ADD("oki", OKIM6295, 1024000, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 1024000, okim6295_device::PIN7_HIGH);
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(tumbleb_state::cookbib)
+void tumbleb_state::cookbib(machine_config &config)
+{
htchctch(config);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_semicom_altoffsets)
-MACHINE_CONFIG_END
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_semicom_altoffsets));
+}
-MACHINE_CONFIG_START(tumbleb_state::chokchok)
+void tumbleb_state::chokchok(machine_config &config)
+{
htchctch(config);
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
+ m_palette->set_format(PALETTE_FORMAT_xxxxBBBBGGGGRRRR);
// some PCBs have left factory with a 3.57mhz while some have a 4.096 which matches other games, assuming the former are factory errors
- MCFG_DEVICE_REPLACE("oki", OKIM6295, 4096000/4, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ m_oki->set_clock(4096000/4);
+}
-MACHINE_CONFIG_START(tumbleb_state::cookbib_mcu)
+void tumbleb_state::cookbib_mcu(machine_config &config)
+{
htchctch(config);
/* basic machine hardware */
- MCFG_DEVICE_ADD("protection", AT89C52, 16000000)
- MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, tumbleb_state, prot_p0_w))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, tumbleb_state, prot_p1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, tumbleb_state, prot_p2_w))
+ at89c52_device &prot(AT89C52(config, "protection", 16000000));
+ prot.port_out_cb<0>().set(FUNC(tumbleb_state::prot_p0_w));
+ prot.port_out_cb<1>().set(FUNC(tumbleb_state::prot_p1_w));
+ prot.port_out_cb<2>().set(FUNC(tumbleb_state::prot_p2_w));
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_semicom_altoffsets)
-MACHINE_CONFIG_END
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_semicom_altoffsets));
+}
-MACHINE_CONFIG_START(tumbleb_state::bcstory)
+void tumbleb_state::bcstory(machine_config &config)
+{
htchctch(config);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_bcstory)
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_bcstory));
subdevice<ym2151_device>("ymsnd")->set_clock(3427190);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(tumbleb_state::semibase)
+void tumbleb_state::semibase(machine_config &config)
+{
bcstory(config);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_semibase)
-MACHINE_CONFIG_END
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_semibase));
+}
-MACHINE_CONFIG_START(tumbleb_state::sdfight)
+void tumbleb_state::sdfight(machine_config &config)
+{
bcstory(config);
MCFG_VIDEO_START_OVERRIDE(tumbleb_state,sdfight)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_sdfight)
-MACHINE_CONFIG_END
-
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_sdfight));
+}
-MACHINE_CONFIG_START(tumbleb_state::metlsavr)
+void tumbleb_state::metlsavr(machine_config &config)
+{
cookbib(config);
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
+ m_palette->set_format(PALETTE_FORMAT_xxxxBBBBGGGGRRRR);
subdevice<ym2151_device>("ymsnd")->set_clock(3427190);
-MACHINE_CONFIG_END
-
-
-
-
-MACHINE_CONFIG_START(tumbleb_state::suprtrio)
+}
+void tumbleb_state::suprtrio(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 14000000) /* 14mhz should be correct, but lots of sprite flicker later in game */
- MCFG_DEVICE_PROGRAM_MAP(suprtrio_main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tumbleb_state, irq6_line_hold)
+ M68000(config, m_maincpu, 14000000); /* 14mhz should be correct, but lots of sprite flicker later in game */
+ m_maincpu->set_addrmap(AS_PROGRAM, &tumbleb_state::suprtrio_main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(tumbleb_state::irq6_line_hold));
- MCFG_DEVICE_ADD("audiocpu", Z80, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(suprtrio_sound_map)
+ Z80(config, m_audiocpu, 8000000);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &tumbleb_state::suprtrio_sound_map);
MCFG_MACHINE_START_OVERRIDE(tumbleb_state,tumbleb)
MCFG_MACHINE_RESET_OVERRIDE(tumbleb_state,tumbleb)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
- MCFG_SCREEN_SIZE(40*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8-1, 31*8-2)
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_suprtrio)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(529));
+ m_screen->set_size(40*8, 32*8);
+ m_screen->set_visarea(0*8, 40*8-1, 1*8-1, 31*8-2);
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_suprtrio));
+ m_screen->set_palette("palette");
DECO_SPRITE(config, m_sprgen, 0);
m_sprgen->set_gfx_region(3);
m_sprgen->set_is_bootleg(true);
m_sprgen->set_gfxdecode_tag(m_gfxdecode);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suprtrio)
- MCFG_PALETTE_ADD("palette", 1024)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_suprtrio);
+
+ PALETTE(config, m_palette, 1024).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
MCFG_VIDEO_START_OVERRIDE(tumbleb_state,suprtrio)
@@ -2418,46 +2412,45 @@ MACHINE_CONFIG_START(tumbleb_state::suprtrio)
GENERIC_LATCH_8(config, m_soundlatch);
- MCFG_DEVICE_ADD("oki", OKIM6295, 875000, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(tumbleb_state::pangpang)
+ OKIM6295(config, m_oki, 875000, okim6295_device::PIN7_HIGH);
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.50);
+}
+void tumbleb_state::pangpang(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 14000000)
- MCFG_DEVICE_PROGRAM_MAP(pangpang_main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tumbleb_state, tumbleb2_interrupt)
+ M68000(config, m_maincpu, 14000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &tumbleb_state::pangpang_main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(tumbleb_state::tumbleb2_interrupt));
MCFG_MACHINE_START_OVERRIDE(tumbleb_state,tumbleb)
MCFG_MACHINE_RESET_OVERRIDE(tumbleb_state,tumbleb)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(58)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1529))
- MCFG_SCREEN_SIZE(40*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_pangpang)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(58);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1529));
+ m_screen->set_size(40*8, 32*8);
+ m_screen->set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
+ m_screen->set_screen_update(FUNC(tumbleb_state::screen_update_pangpang));
+ m_screen->set_palette(m_palette);
DECO_SPRITE(config, m_sprgen, 0);
m_sprgen->set_gfx_region(3);
m_sprgen->set_is_bootleg(true);
m_sprgen->set_gfxdecode_tag(m_gfxdecode);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb)
- MCFG_PALETTE_ADD("palette", 1024)
- MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
+ GFXDECODE(config, m_gfxdecode, "palette", gfx_tumbleb);
+ PALETTE(config, m_palette, 1024).set_format(PALETTE_FORMAT_xxxxBBBBGGGGRRRR);
MCFG_VIDEO_START_OVERRIDE(tumbleb_state,pangpang)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 8000000/10, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 8000000/10, okim6295_device::PIN7_HIGH);
+ m_oki->add_route(ALL_OUTPUTS, "mono", 0.70);
+}
/******************************************************************************/
diff --git a/src/mame/drivers/vp415.cpp b/src/mame/drivers/vp415.cpp
index 2708b42affc..acc47971e58 100644
--- a/src/mame/drivers/vp415.cpp
+++ b/src/mame/drivers/vp415.cpp
@@ -489,11 +489,12 @@ static INPUT_PORTS_START( vp415 )
PORT_DIPSETTING( 0x00, "Off" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(vp415_state::vp415)
+void vp415_state::vp415(machine_config &config)
+{
// Module W: CPU Datagrabber
- MCFG_DEVICE_ADD(DATACPU_TAG, Z80, XTAL(8'000'000)/2) // 8MHz through a /2 flip-flop divider, per schematic
- MCFG_DEVICE_PROGRAM_MAP(z80_program_map)
- MCFG_DEVICE_IO_MAP(z80_io_map)
+ Z80(config, m_datacpu, XTAL(8'000'000)/2); // 8MHz through a /2 flip-flop divider, per schematic
+ m_datacpu->set_addrmap(AS_PROGRAM, &vp415_state::z80_program_map);
+ m_datacpu->set_addrmap(AS_IO, &vp415_state::z80_io_map);
I8041(config, m_datamcu, XTAL(4'000'000)); // Verified on schematic
m_datamcu->p1_in_cb().set(FUNC(vp415_state::data_mcu_port1_r));
@@ -502,17 +503,17 @@ MACHINE_CONFIG_START(vp415_state::vp415)
m_datamcu->p2_out_cb().set(FUNC(vp415_state::data_mcu_port2_w));
m_datamcu->set_addrmap(AS_PROGRAM, &vp415_state::datamcu_program_map);
- MCFG_DEVICE_ADD(SCSI_TAG, NCR5385, XTAL(8'000'000)/2) // Same clock signal as above, per schematic
- MCFG_NCR5385_INT_CB(WRITELINE(*this, vp415_state, cpu_int1_w))
+ NCR5385(config, m_scsi, XTAL(8'000'000)/2); // Same clock signal as above, per schematic
+ m_scsi->irq().set(FUNC(vp415_state::cpu_int1_w));
// Module S: Control
- MCFG_DEVICE_ADD(CTRLCPU_TAG, I8031, XTAL(11'059'200)) // 11.059MHz, per schematic
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, vp415_state, ctrl_cpu_port1_w));
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, vp415_state, ctrl_cpu_port1_r));
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, vp415_state, ctrl_cpu_port3_w));
- MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, vp415_state, ctrl_cpu_port3_r));
- MCFG_DEVICE_PROGRAM_MAP(ctrl_program_map)
- MCFG_DEVICE_IO_MAP(ctrl_io_map)
+ I8031(config, m_ctrlcpu, XTAL(11'059'200)); // 11.059MHz, per schematic
+ m_ctrlcpu->port_out_cb<1>().set(FUNC(vp415_state::ctrl_cpu_port1_w));;
+ m_ctrlcpu->port_in_cb<1>().set(FUNC(vp415_state::ctrl_cpu_port1_r));
+ m_ctrlcpu->port_out_cb<3>().set(FUNC(vp415_state::ctrl_cpu_port3_w));
+ m_ctrlcpu->port_in_cb<3>().set(FUNC(vp415_state::ctrl_cpu_port3_r));
+ m_ctrlcpu->set_addrmap(AS_PROGRAM, &vp415_state::ctrl_program_map);
+ m_ctrlcpu->set_addrmap(AS_IO, &vp415_state::ctrl_io_map);
I8041(config, m_ctrlmcu, XTAL(4'000'000)); // Verified on schematic
m_ctrlmcu->p1_in_cb().set(FUNC(vp415_state::ctrl_mcu_port1_r));
@@ -522,11 +523,11 @@ MACHINE_CONFIG_START(vp415_state::vp415)
m_ctrlmcu->set_addrmap(AS_PROGRAM, &vp415_state::ctrlmcu_program_map);
// Module R: Drive
- MCFG_DEVICE_ADD(DRIVECPU_TAG, I8031, XTAL(12'000'000)) // 12MHz, per schematic
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, vp415_state, drive_cpu_port1_w));
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, vp415_state, drive_cpu_port3_w));
- MCFG_DEVICE_PROGRAM_MAP(drive_program_map)
- MCFG_DEVICE_IO_MAP(drive_io_map)
+ I8031(config, m_drivecpu, XTAL(12'000'000)); // 12MHz, per schematic
+ m_drivecpu->port_out_cb<1>().set(FUNC(vp415_state::drive_cpu_port1_w));
+ m_drivecpu->port_out_cb<3>().set(FUNC(vp415_state::drive_cpu_port3_w));
+ m_drivecpu->set_addrmap(AS_PROGRAM, &vp415_state::drive_program_map);
+ m_drivecpu->set_addrmap(AS_IO, &vp415_state::drive_io_map);
i8155_device &i8155(I8155(config, I8155_TAG, 0));
i8155.out_pa_callback().set(CHARGEN_TAG, FUNC(mb88303_device::da_w));
@@ -538,18 +539,18 @@ MACHINE_CONFIG_START(vp415_state::vp415)
ppi.out_pb_callback().set(FUNC(vp415_state::drive_i8255_pb_w));
ppi.in_pc_callback().set(FUNC(vp415_state::drive_i8255_pc_r));
- MCFG_DEVICE_ADD(CHARGEN_TAG, MB88303, 0)
+ MB88303(config, m_chargen, 0);
saa1043_device &saa1043(SAA1043(config, SYNCGEN_TAG, XTAL(5'000'000)));
saa1043.v2_callback().set(FUNC(vp415_state::refv_w));
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_UPDATE_DRIVER(vp415_state, screen_update)
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
-MACHINE_CONFIG_END
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(320, 240);
+ screen.set_visarea(0, 319, 0, 239);
+ screen.set_screen_update(FUNC(vp415_state::screen_update));
+}
ROM_START(vp415)
/* Module R */
diff --git a/src/mame/drivers/vt220.cpp b/src/mame/drivers/vt220.cpp
index 3d9939755cf..a1060367aa7 100644
--- a/src/mame/drivers/vt220.cpp
+++ b/src/mame/drivers/vt220.cpp
@@ -57,7 +57,7 @@ private:
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_vt220(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
+ required_device<i8051_device> m_maincpu;
required_device<ram_device> m_ram;
void vt220_io(address_map &map);
void vt220_mem(address_map &map);
@@ -107,30 +107,31 @@ uint32_t vt220_state::screen_update_vt220(screen_device &screen, bitmap_ind16 &b
}
-MACHINE_CONFIG_START(vt220_state::vt220)
+void vt220_state::vt220(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8051, XTAL(11'059'200)) // from schematic for earlier version
- MCFG_DEVICE_PROGRAM_MAP(vt220_mem)
- MCFG_DEVICE_IO_MAP(vt220_io)
- MCFG_MCS51_PORT_P1_IN_CB(CONSTANT(0)) // ???
+ I8051(config, m_maincpu, XTAL(11'059'200)); // from schematic for earlier version
+ m_maincpu->set_addrmap(AS_PROGRAM, &vt220_state::vt220_mem);
+ m_maincpu->set_addrmap(AS_IO, &vt220_state::vt220_io);
+ m_maincpu->port_in_cb<1>().set_constant(0); // ???
- MCFG_DEVICE_ADD("duart", SCN2681, XTAL(3'686'400))
- MCFG_MC68681_IRQ_CALLBACK(INPUTLINE("maincpu", MCS51_INT1_LINE))
+ scn2681_device &duart(SCN2681(config, "duart", XTAL(3'686'400)));
+ duart.irq_cb().set_inputline("maincpu", MCS51_INT1_LINE);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- 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(vt220_state, screen_update_vt220)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(50);
+ 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(vt220_state::screen_update_vt220));
+ screen.set_palette("palette");
- MCFG_PALETTE_ADD_MONOCHROME("palette")
+ PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome));
/* internal ram */
RAM(config, RAM_TAG).set_default_size("16K");
-MACHINE_CONFIG_END
+}
MACHINE_CONFIG_START(vt220_state::vt220a)
vt220(config);
diff --git a/src/mame/includes/bionicc.h b/src/mame/includes/bionicc.h
index 236d1f2c200..dd579b24f54 100644
--- a/src/mame/includes/bionicc.h
+++ b/src/mame/includes/bionicc.h
@@ -11,11 +11,11 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "machine/gen_latch.h"
#include "machine/timer.h"
#include "video/bufsprite.h"
#include "video/tigeroad_spr.h"
-#include "cpu/mcs51/mcs51.h"
#include "emupal.h"
class bionicc_state : public driver_device
@@ -76,7 +76,7 @@ private:
/* devices */
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_mcu;
+ required_device<i8751_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<tigeroad_spr_device> m_spritegen;
diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h
index cbe2d1cd9ab..f2dbc03422d 100644
--- a/src/mame/includes/blktiger.h
+++ b/src/mame/includes/blktiger.h
@@ -10,6 +10,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "video/bufsprite.h"
#include "emupal.h"
@@ -49,7 +50,7 @@ public:
uint8_t m_i8751_latch;
/* devices */
- optional_device<cpu_device> m_mcu;
+ optional_device<i8751_device> m_mcu;
required_device<cpu_device> m_audiocpu;
DECLARE_READ8_MEMBER(blktiger_from_mcu_r);
DECLARE_WRITE8_MEMBER(blktiger_to_mcu_w);
diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h
index d4915849aa2..00eaf0fdc7c 100644
--- a/src/mame/includes/dec0.h
+++ b/src/mame/includes/dec0.h
@@ -5,14 +5,15 @@
#pragma once
-#include "machine/74157.h"
#include "cpu/h6280/h6280.h"
+#include "cpu/mcs51/mcs51.h"
+#include "machine/74157.h"
#include "machine/bankdev.h"
#include "machine/gen_latch.h"
+#include "sound/msm5205.h"
#include "video/bufsprite.h"
#include "video/decbac06.h"
#include "video/decmxc06.h"
-#include "sound/msm5205.h"
#include "emupal.h"
class dec0_state : public driver_device
diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h
index b659e023ef0..8065bff241e 100644
--- a/src/mame/includes/dec8.h
+++ b/src/mame/includes/dec8.h
@@ -5,6 +5,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "machine/gen_latch.h"
#include "machine/input_merger.h"
#include "sound/msm5205.h"
@@ -64,7 +65,7 @@ private:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_subcpu;
required_device<cpu_device> m_audiocpu;
- optional_device<cpu_device> m_mcu;
+ optional_device<i8751_device> m_mcu;
optional_device<input_merger_device> m_nmigate;
required_device<buffered_spriteram8_device> m_spriteram;
optional_device<msm5205_device> m_msm;
diff --git a/src/mame/includes/djboy.h b/src/mame/includes/djboy.h
index 29f42aac49b..873dadbb918 100644
--- a/src/mame/includes/djboy.h
+++ b/src/mame/includes/djboy.h
@@ -6,6 +6,7 @@
*************************************************************************/
+#include "cpu/mcs51/mcs51.h"
#include "machine/gen_latch.h"
#include "machine/timer.h"
#include "video/kan_pand.h"
@@ -76,7 +77,7 @@ private:
required_device<cpu_device> m_mastercpu;
required_device<cpu_device> m_slavecpu;
required_device<cpu_device> m_soundcpu;
- required_device<cpu_device> m_beast;
+ required_device<i80c51_device> m_beast;
required_device<kaneko_pandora_device> m_pandora;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 9f24463e962..a3af6dab5a0 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -11,10 +11,11 @@
#pragma once
#include "audio/m72.h"
-#include "sound/dac.h"
+#include "cpu/mcs51/mcs51.h"
#include "machine/mb8421.h"
#include "machine/pic8259.h"
#include "machine/upd4701.h"
+#include "sound/dac.h"
#include "emupal.h"
#include "screen.h"
@@ -91,7 +92,7 @@ public:
private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
- optional_device<cpu_device> m_mcu;
+ optional_device<i8751_device> m_mcu;
optional_device<mb8421_mb8431_16_device> m_dpram;
optional_device<dac_byte_interface> m_dac;
optional_device<m72_audio_device> m_audio;
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index 8ab85ad38d5..4e2fbb35296 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -10,6 +10,7 @@
#include "sound/okim6295.h"
#include "video/kan_pand.h" // for the original pandora
#include "emupal.h"
+#include "screen.h"
class snowbros_state : public driver_device
{
@@ -21,6 +22,7 @@ public:
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_screen(*this, "screen"),
m_soundlatch(*this, "soundlatch"),
m_pandora(*this, "pandora"),
m_hyperpac_ram(*this, "hyperpac_ram"),
@@ -55,6 +57,7 @@ private:
optional_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
optional_device<generic_latch_8_device> m_soundlatch; // not snowbro3
optional_device<kaneko_pandora_device> m_pandora;
diff --git a/src/mame/includes/sslam.h b/src/mame/includes/sslam.h
index 36acaccb5fa..52e3cfcd63d 100644
--- a/src/mame/includes/sslam.h
+++ b/src/mame/includes/sslam.h
@@ -5,6 +5,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "emupal.h"
@@ -28,14 +29,15 @@ public:
{ }
void sslam(machine_config &config);
- void powerbls(machine_config &config);
void init_sslam();
- void init_powerbls();
-private:
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
+ required_device<mcs51_cpu_device> m_audiocpu;
required_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -64,30 +66,50 @@ private:
tilemap_t *m_md_tilemap;
int m_sprites_x_offset;
- DECLARE_WRITE16_MEMBER(powerbls_sound_w);
DECLARE_READ8_MEMBER(playmark_snd_command_r);
DECLARE_WRITE8_MEMBER(playmark_oki_w);
DECLARE_WRITE8_MEMBER(playmark_snd_control_w);
DECLARE_WRITE16_MEMBER(sslam_tx_tileram_w);
DECLARE_WRITE16_MEMBER(sslam_md_tileram_w);
DECLARE_WRITE16_MEMBER(sslam_bg_tileram_w);
- DECLARE_WRITE16_MEMBER(powerbls_bg_tileram_w);
DECLARE_WRITE8_MEMBER(sslam_snd_w);
TILE_GET_INFO_MEMBER(get_sslam_tx_tile_info);
TILE_GET_INFO_MEMBER(get_sslam_md_tile_info);
TILE_GET_INFO_MEMBER(get_sslam_bg_tile_info);
- TILE_GET_INFO_MEMBER(get_powerbls_bg_tile_info);
DECLARE_VIDEO_START(sslam);
DECLARE_VIDEO_START(powerbls);
- uint32_t screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(music_playback);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void sslam_play(int track, int data);
- void powerbls_map(address_map &map);
void sslam_program_map(address_map &map);
};
+class powerbls_state : public sslam_state
+{
+public:
+ powerbls_state(const machine_config &mconfig, device_type type, const char *tag) :
+ sslam_state(mconfig, type, tag)
+ { }
+
+ void powerbls(machine_config &config);
+
+ void init_powerbls();
+
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
+ void powerbls_map(address_map &map);
+
+ TILE_GET_INFO_MEMBER(get_powerbls_bg_tile_info);
+
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE16_MEMBER(powerbls_sound_w);
+ DECLARE_WRITE16_MEMBER(powerbls_bg_tileram_w);
+};
+
#endif // MAME_INCLUDES_SSLAM_H
diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h
index 54198e65958..5eccd818fc8 100644
--- a/src/mame/includes/superqix.h
+++ b/src/mame/includes/superqix.h
@@ -5,6 +5,8 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
+#include "cpu/m6805/m68705.h"
#include "sound/ay8910.h"
#include "sound/samples.h"
#include "emupal.h"
@@ -15,6 +17,7 @@ public:
superqix_state_base(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this,"maincpu")
+ , m_mcu(*this, "mcu")
, m_spriteram(*this, "spriteram")
, m_videoram(*this, "videoram")
, m_bitmapram(*this, "bitmapram")
@@ -22,7 +25,6 @@ public:
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
, m_ay1(*this, "ay1")
- , m_mcu(*this, "mcu")
{ }
void init_perestro();
@@ -31,8 +33,11 @@ public:
void init_pbillian();
void init_hotsmash();
+ TILE_GET_INFO_MEMBER(sqix_get_bg_tile_info);
+
protected:
required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_mcu;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_videoram;
optional_shared_ptr<uint8_t> m_bitmapram;
@@ -40,13 +45,12 @@ protected:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<ay8910_device> m_ay1;
- optional_device<cpu_device> m_mcu;
// commmon 68705/8751/HLE
- uint8_t m_fromMCU; // byte latch for 68705/8751->z80 comms
- uint8_t m_fromZ80; // byte latch for z80->68705/8751 comms
- bool m_Z80HasWritten; // z80 has written to latch flag
- bool m_MCUHasWritten; // 68705/8751 has written to latch flag
+ uint8_t m_from_mcu; // byte latch for 68705/8751->z80 comms
+ uint8_t m_from_z80; // byte latch for z80->68705/8751 comms
+ bool m_z80_has_written; // z80 has written to latch flag
+ bool m_mcu_has_written; // 68705/8751 has written to latch flag
//general machine stuff
bool m_invert_coin_lockout;
@@ -64,7 +68,6 @@ protected:
DECLARE_WRITE8_MEMBER(superqix_bitmapram2_w);
DECLARE_WRITE8_MEMBER(superqix_0410_w);
- TILE_GET_INFO_MEMBER(sqix_get_bg_tile_info);
DECLARE_VIDEO_START(superqix);
DECLARE_PALETTE_DECODER(BBGGRRII);
uint32_t screen_update_superqix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -92,8 +95,12 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(fromz80_semaphore_input_r);
DECLARE_CUSTOM_INPUT_MEMBER(frommcu_semaphore_input_r);
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
private:
- required_device<ay8910_device> m_ay2;
+ required_device<ay8910_device> m_ay2;
// 8031 and/or 8751 MCU related
uint8_t m_bl_port1;
@@ -143,8 +150,8 @@ public:
, m_samples(*this, "samples")
, m_samples_region(*this, "samples")
, m_samplebuf()
- , m_portB_out(0xff)
- , m_portC_out(0xff)
+ , m_portb_out(0xff)
+ , m_portc_out(0xff)
, m_dial_oldpos{ 0, 0 }
, m_dial_sign{ 0, 0 }
{
@@ -154,12 +161,16 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(pbillian_semaphore_input_r);
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
private:
- DECLARE_READ8_MEMBER(hotsmash_68705_portA_r);
- DECLARE_WRITE8_MEMBER(hotsmash_68705_portB_w);
- DECLARE_WRITE8_MEMBER(hotsmash_68705_portC_w);
- DECLARE_WRITE8_MEMBER(hotsmash_Z80_mcu_w);
- DECLARE_READ8_MEMBER(hotsmash_Z80_mcu_r);
+ DECLARE_READ8_MEMBER(hotsmash_68705_porta_r);
+ DECLARE_WRITE8_MEMBER(hotsmash_68705_portb_w);
+ DECLARE_WRITE8_MEMBER(hotsmash_68705_portc_w);
+ DECLARE_WRITE8_MEMBER(hotsmash_z80_mcu_w);
+ DECLARE_READ8_MEMBER(hotsmash_z80_mcu_r);
DECLARE_WRITE8_MEMBER(pbillian_sample_trigger_w);
DECLARE_WRITE8_MEMBER(pbillian_0410_w);
@@ -183,19 +194,19 @@ private:
void pbillian_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_ioport_array<2> m_dsw;
- required_ioport_array<2> m_dials;
- optional_ioport_array<2> m_plungers;
- optional_ioport_array<2> m_launchbtns;
- optional_device<samples_device> m_samples;
- optional_region_ptr<u8> m_samples_region;
+ required_ioport_array<2> m_dsw;
+ required_ioport_array<2> m_dials;
+ optional_ioport_array<2> m_plungers;
+ optional_ioport_array<2> m_launchbtns;
+ optional_device<samples_device> m_samples;
+ optional_region_ptr<u8> m_samples_region;
- std::unique_ptr<s16[]> m_samplebuf;
+ std::unique_ptr<s16[]> m_samplebuf;
// 68705 related
- u8 m_portA_in;
- u8 m_portB_out;
- u8 m_portC_out;
+ u8 m_porta_in;
+ u8 m_portb_out;
+ u8 m_portc_out;
// spinner quadrature stuff
int m_dial_oldpos[2];
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index 033b1d14303..e9e248db230 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -5,6 +5,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "cpu/z80/z80.h"
#include "machine/z80pio.h"
#include "machine/gen_latch.h"
@@ -166,6 +167,10 @@ private:
DECLARE_WRITE8_MEMBER(system1_paletteram_w);
DECLARE_WRITE8_MEMBER(sound_control_w);
+ void encrypted_sys1ppi_maps(machine_config &config);
+ void encrypted_sys1pio_maps(machine_config &config);
+ void encrypted_sys2_mc8123_maps(machine_config &config);
+
TILE_GET_INFO_MEMBER(tile_get_info);
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -188,7 +193,7 @@ private:
void dakkochn_custom_w(uint8_t data, uint8_t prevdata);
required_device<z80_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
- optional_device<cpu_device> m_mcu;
+ optional_device<i8751_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index 1052d334be4..ff8f48102c6 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -5,6 +5,7 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "machine/gen_latch.h"
#include "machine/timer.h"
#include "video/decmxc06.h"
@@ -40,7 +41,7 @@ protected:
private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<cpu_device> m_mcu;
+ required_device<i8751_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<deco_mxc06_device> m_spritegen;
diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h
index b0cc9813f0e..9696abb5932 100644
--- a/src/mame/includes/tigeroad.h
+++ b/src/mame/includes/tigeroad.h
@@ -142,6 +142,6 @@ private:
DECLARE_WRITE16_MEMBER(blktiger_to_mcu_w);
- required_device<cpu_device> m_mcu;
+ required_device<i8751_device> m_mcu;
uint8_t m_old_p3;
};
diff --git a/src/mame/includes/tumbleb.h b/src/mame/includes/tumbleb.h
index aab68d672ef..5d389ae5e4c 100644
--- a/src/mame/includes/tumbleb.h
+++ b/src/mame/includes/tumbleb.h
@@ -6,9 +6,10 @@
#pragma once
#include "machine/gen_latch.h"
-#include "video/decospr.h"
#include "sound/okim6295.h"
+#include "video/decospr.h"
#include "emupal.h"
+#include "screen.h"
class tumbleb_state : public driver_device
{
@@ -26,6 +27,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
+ m_screen(*this, "screen"),
m_soundlatch(*this, "soundlatch")
{ }
@@ -89,6 +91,7 @@ private:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<decospr_device> m_sprgen;
+ required_device<screen_device> m_screen;
optional_device<generic_latch_8_device> m_soundlatch;
uint8_t m_semicom_prot_offset;
diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h
index 48b6c0c3b59..5739e85855f 100644
--- a/src/mame/machine/segaic16.h
+++ b/src/mame/machine/segaic16.h
@@ -86,6 +86,14 @@ public:
typedef device_delegate<void (sega_315_5195_mapper_device &, uint8_t)> mapper_delegate;
// construction/destruction
+ template <typename T>
+ sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : sega_315_5195_mapper_device(mconfig, tag, owner, clock)
+ {
+ m_cpu.set_tag(std::forward<T>(cpu_tag));
+ m_cpuregion.set_tag(std::forward<T>(cpu_tag));
+ }
+
sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
@@ -94,9 +102,22 @@ public:
m_cpu.set_tag(cpu);
m_cpuregion.set_tag(cpu);
}
+
void set_mapper(mapper_delegate callback) { m_mapper = callback; }
+ template <class FunctionClass> void set_mapper(const char *devname
+ , void (FunctionClass::*callback)(sega_315_5195_mapper_device &, uint8_t), const char *name)
+ {
+ set_mapper(mapper_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ }
+ template <class FunctionClass> void set_mapper(void (FunctionClass::*callback)(sega_315_5195_mapper_device &, uint8_t), const char *name)
+ {
+ set_mapper(mapper_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ }
+
template<class Object> devcb_base &set_pbf_callback(Object &&object) { return m_pbf_callback.set_callback(std::forward<Object>(object)); }
template<class Object> devcb_base &set_mcu_int_callback(Object &&object) { return m_mcu_int_callback.set_callback(std::forward<Object>(object)); }
+ auto pbf() { return m_pbf_callback.bind(); }
+ auto mcu_int() { return m_mcu_int_callback.bind(); }
// public interface
DECLARE_READ8_MEMBER( read );
diff --git a/src/mame/machine/wangpckb.cpp b/src/mame/machine/wangpckb.cpp
index 736ace381f4..26c26b7204d 100644
--- a/src/mame/machine/wangpckb.cpp
+++ b/src/mame/machine/wangpckb.cpp
@@ -110,21 +110,21 @@ void wangpc_keyboard_device::wangpc_keyboard_io(address_map &map)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(wangpc_keyboard_device::device_add_mconfig)
- MCFG_DEVICE_ADD(I8051_TAG, I8051, XTAL(4'000'000))
- MCFG_DEVICE_IO_MAP(wangpc_keyboard_io)
- MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, wangpc_keyboard_device, kb_p1_r))
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, wangpc_keyboard_device, kb_p1_w))
- MCFG_MCS51_PORT_P2_OUT_CB(WRITE8(*this, wangpc_keyboard_device, kb_p2_w))
- MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, wangpc_keyboard_device, kb_p3_w))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, wangpc_keyboard_device, mcs51_tx_callback))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, wangpc_keyboard_device, mcs51_rx_callback))
+void wangpc_keyboard_device::device_add_mconfig(machine_config &config)
+{
+ I8051(config, m_maincpu, XTAL(4'000'000));
+ m_maincpu->set_addrmap(AS_IO, &wangpc_keyboard_device::wangpc_keyboard_io);
+ m_maincpu->port_in_cb<1>().set(FUNC(wangpc_keyboard_device::kb_p1_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(wangpc_keyboard_device::kb_p1_w));
+ m_maincpu->port_out_cb<2>().set(FUNC(wangpc_keyboard_device::kb_p2_w));
+ m_maincpu->port_out_cb<3>().set(FUNC(wangpc_keyboard_device::kb_p3_w));
+ m_maincpu->serial_tx_cb().set(FUNC(wangpc_keyboard_device::mcs51_tx_callback));
+ m_maincpu->serial_rx_cb().set(FUNC(wangpc_keyboard_device::mcs51_rx_callback));
// sound hardware
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD(SN76496_TAG, SN76496, 2000000) // ???
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-MACHINE_CONFIG_END
+ SN76496(config, SN76496_TAG, 2000000).add_route(ALL_OUTPUTS, "mono", 1.00); // ???
+}
//-------------------------------------------------
diff --git a/src/mame/video/pcd.cpp b/src/mame/video/pcd.cpp
index dd0952032aa..12d6f62a323 100644
--- a/src/mame/video/pcd.cpp
+++ b/src/mame/video/pcd.cpp
@@ -146,20 +146,21 @@ void pcx_video_device::pcx_attr_ram(address_map &map)
map(0x0000, 0x07ff).ram();
}
-MACHINE_CONFIG_START(pcx_video_device::device_add_mconfig)
- MCFG_DEVICE_ADD("graphics", I8031, 24_MHz_XTAL / 2)
- MCFG_DEVICE_PROGRAM_MAP(pcx_vid_map)
- MCFG_DEVICE_IO_MAP(pcx_vid_io)
- MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, pcx_video_device, p1_w))
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(*this, pcx_video_device, tx_callback))
- MCFG_MCS51_SERIAL_RX_CB(READ8(*this, pcx_video_device, rx_callback))
+void pcx_video_device::device_add_mconfig(machine_config &config)
+{
+ i8031_device &gfx(I8031(config, "graphics", 24_MHz_XTAL / 2));
+ gfx.set_addrmap(AS_PROGRAM, &pcx_video_device::pcx_vid_map);
+ gfx.set_addrmap(AS_IO, &pcx_video_device::pcx_vid_io);
+ gfx.port_out_cb<1>().set(FUNC(pcx_video_device::p1_w));
+ gfx.serial_tx_cb().set(FUNC(pcx_video_device::tx_callback));
+ gfx.serial_rx_cb().set(FUNC(pcx_video_device::rx_callback));
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(24_MHz_XTAL, 1272, 0, 960, 381, 0, 350);
screen.set_screen_update("crtc", FUNC(scn2672_device::screen_update));
- MCFG_PALETTE_ADD_MONOCHROME("palette")
+ PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome));
SCN2672(config, m_crtc, 24_MHz_XTAL / 12); // used with SCB2673B
m_crtc->intr_callback().set_inputline("graphics", MCS51_INT0_LINE);
@@ -168,7 +169,7 @@ MACHINE_CONFIG_START(pcx_video_device::device_add_mconfig)
m_crtc->set_screen("screen");
m_crtc->set_addrmap(0, &pcx_video_device::pcx_char_ram);
m_crtc->set_addrmap(1, &pcx_video_device::pcx_attr_ram);
-MACHINE_CONFIG_END
+}
SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels)
diff --git a/src/mame/video/sslam.cpp b/src/mame/video/sslam.cpp
index 77cbfc0d2e3..279998e6920 100644
--- a/src/mame/video/sslam.cpp
+++ b/src/mame/video/sslam.cpp
@@ -120,7 +120,7 @@ WRITE16_MEMBER(sslam_state::sslam_bg_tileram_w)
m_bg_tilemap->mark_tile_dirty(offset);
}
-TILE_GET_INFO_MEMBER(sslam_state::get_powerbls_bg_tile_info)
+TILE_GET_INFO_MEMBER(powerbls_state::get_powerbls_bg_tile_info)
{
int code = m_bg_tileram[tile_index*2+1] & 0x0fff;
int colr = (m_bg_tileram[tile_index*2+1] & 0xf000) >> 12;
@@ -131,13 +131,13 @@ TILE_GET_INFO_MEMBER(sslam_state::get_powerbls_bg_tile_info)
SET_TILE_INFO_MEMBER(1,code,colr,0);
}
-WRITE16_MEMBER(sslam_state::powerbls_bg_tileram_w)
+WRITE16_MEMBER(powerbls_state::powerbls_bg_tileram_w)
{
COMBINE_DATA(&m_bg_tileram[offset]);
m_bg_tilemap->mark_tile_dirty(offset>>1);
}
-VIDEO_START_MEMBER(sslam_state,sslam)
+void sslam_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_md_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(sslam_state::get_sslam_md_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
@@ -150,15 +150,15 @@ VIDEO_START_MEMBER(sslam_state,sslam)
save_item(NAME(m_sprites_x_offset));
}
-VIDEO_START_MEMBER(sslam_state,powerbls)
+void powerbls_state::video_start()
{
- m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(sslam_state::get_powerbls_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(powerbls_state::get_powerbls_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_sprites_x_offset = -21;
save_item(NAME(m_sprites_x_offset));
}
-uint32_t sslam_state::screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t sslam_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (!(m_regs[6] & 1))
{
@@ -196,7 +196,7 @@ uint32_t sslam_state::screen_update_sslam(screen_device &screen, bitmap_ind16 &b
return 0;
}
-uint32_t sslam_state::screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t powerbls_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (!(m_regs[6] & 1))
{
diff --git a/src/mame/video/superqix.cpp b/src/mame/video/superqix.cpp
index b153246381a..6c9f620c4de 100644
--- a/src/mame/video/superqix.cpp
+++ b/src/mame/video/superqix.cpp
@@ -49,12 +49,12 @@ TILE_GET_INFO_MEMBER(superqix_state_base::sqix_get_bg_tile_info)
***************************************************************************/
-VIDEO_START_MEMBER(hotsmash_state, pbillian)
+void hotsmash_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(hotsmash_state::pb_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8,32,32);
}
-VIDEO_START_MEMBER(superqix_state_base, superqix)
+void superqix_state::video_start()
{
m_fg_bitmap[0] = std::make_unique<bitmap_ind16>(256, 256);
m_fg_bitmap[1] = std::make_unique<bitmap_ind16>(256, 256);