From c96b8ee28070f46d3f3b3bfe0a6dfd4065385f28 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sun, 16 Dec 2018 02:51:30 +0100 Subject: -cpu/cop400, dsp16, hmcs40: Removed MCFG macros. [Ryan Holtz] -drivers/advision, cidelsa, hh_cop400, hh_hmcs40, play_2, test_t400, thayers: Removed MACHINE_CONFIG macros. [Ryan Holtz] -machine/alpha8201: Removed MACHINE_CONFIG macros. [Ryan Holtz] --- src/devices/cpu/cop400/cop400.h | 76 +-- src/devices/cpu/dsp16/dsp16.h | 76 +-- src/devices/cpu/hmcs40/hmcs40.cpp | 53 +- src/devices/cpu/hmcs40/hmcs40.h | 44 +- src/devices/sound/msm5205.h | 1 + src/devices/sound/qsound.cpp | 15 +- src/mame/drivers/advision.cpp | 47 +- src/mame/drivers/cidelsa.cpp | 36 +- src/mame/drivers/hh_cop400.cpp | 384 +++++++------ src/mame/drivers/hh_hmcs40.cpp | 1119 ++++++++++++++++++------------------- src/mame/drivers/looping.cpp | 14 +- src/mame/drivers/newbrain.cpp | 49 +- src/mame/drivers/play_2.cpp | 21 +- src/mame/drivers/test_t400.cpp | 26 +- src/mame/drivers/thayers.cpp | 49 +- src/mame/includes/advision.h | 3 +- src/mame/machine/alpha8201.cpp | 23 +- src/mame/machine/alpha8201.h | 3 +- 18 files changed, 947 insertions(+), 1092 deletions(-) diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h index 383b89372a1..e97f8a135a7 100644 --- a/src/devices/cpu/cop400/cop400.h +++ b/src/devices/cpu/cop400/cop400.h @@ -13,46 +13,6 @@ #pragma once -// i/o pins - -// L pins: 8-bit bi-directional -#define MCFG_COP400_READ_L_CB(_devcb) \ - downcast(*device).set_read_l_callback(DEVCB_##_devcb); -#define MCFG_COP400_WRITE_L_CB(_devcb) \ - downcast(*device).set_write_l_callback(DEVCB_##_devcb); -// output state when pins are in tri-state, default 0 -#define MCFG_COP400_READ_L_TRISTATE_CB(_devcb) \ - downcast(*device).set_read_l_tristate_callback(DEVCB_##_devcb); - -// G pins: 4-bit bi-directional -#define MCFG_COP400_READ_G_CB(_devcb) \ - downcast(*device).set_read_g_callback(DEVCB_##_devcb); -#define MCFG_COP400_WRITE_G_CB(_devcb) \ - downcast(*device).set_write_g_callback(DEVCB_##_devcb); - -// D outputs: 4-bit general purpose output -#define MCFG_COP400_WRITE_D_CB(_devcb) \ - downcast(*device).set_write_d_callback(DEVCB_##_devcb); - -// IN inputs: 4-bit general purpose input -#define MCFG_COP400_READ_IN_CB(_devcb) \ - downcast(*device).set_read_in_callback(DEVCB_##_devcb); - -// SI/SO lines: serial in/out or counter/gen.purpose -#define MCFG_COP400_READ_SI_CB(_devcb) \ - downcast(*device).set_read_si_callback(DEVCB_##_devcb); -#define MCFG_COP400_WRITE_SO_CB(_devcb) \ - downcast(*device).set_write_so_callback(DEVCB_##_devcb); - -// SK output line: logic-controlled clock or gen.purpose -#define MCFG_COP400_WRITE_SK_CB(_devcb) \ - downcast(*device).set_write_sk_callback(DEVCB_##_devcb); - -// CKI/CKO lines: only CKO input here -#define MCFG_COP400_READ_CKO_CB(_devcb) \ - downcast(*device).set_read_cko_callback(DEVCB_##_devcb); - - /*************************************************************************** CONSTANTS ***************************************************************************/ @@ -110,40 +70,36 @@ enum cop400_cko_bond { COP400_CKO_GENERAL_PURPOSE_INPUT }; - -#define MCFG_COP400_CONFIG(_cki, _cko, _microbus) \ - downcast(*device).set_cki(_cki); \ - downcast(*device).set_cko(_cko); \ - downcast(*device).set_microbus(_microbus); - - class cop400_cpu_device : public cpu_device { public: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - // configuration helpers - template devcb_base &set_read_l_callback(Object &&cb) { return m_read_l.set_callback(std::forward(cb)); } - template devcb_base &set_read_l_tristate_callback(Object &&cb) { return m_read_l_tristate.set_callback(std::forward(cb)); } - template devcb_base &set_write_l_callback(Object &&cb) { return m_write_l.set_callback(std::forward(cb)); } - template devcb_base &set_read_g_callback(Object &&cb) { return m_read_g.set_callback(std::forward(cb)); } - template devcb_base &set_write_g_callback(Object &&cb) { return m_write_g.set_callback(std::forward(cb)); } - template devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward(cb)); } - template devcb_base &set_read_in_callback(Object &&cb) { return m_read_in.set_callback(std::forward(cb)); } - template devcb_base &set_read_si_callback(Object &&cb) { return m_read_si.set_callback(std::forward(cb)); } - template devcb_base &set_write_so_callback(Object &&cb) { return m_write_so.set_callback(std::forward(cb)); } - template devcb_base &set_write_sk_callback(Object &&cb) { return m_write_sk.set_callback(std::forward(cb)); } - template devcb_base &set_read_cko_callback(Object &&cb) { return m_read_cko.set_callback(std::forward(cb)); } + // L pins: 8-bit bi-directional auto read_l() { return m_read_l.bind(); } - auto read_l_tristate() { return m_read_l_tristate.bind(); } auto write_l() { return m_write_l.bind(); } + + // output state when pins are in tri-state, default 0 + auto read_l_tristate() { return m_read_l_tristate.bind(); } + + // G pins: 4-bit bi-directional auto read_g() { return m_read_g.bind(); } auto write_g() { return m_write_g.bind(); } + + // D outputs: 4-bit general purpose output auto write_d() { return m_write_d.bind(); } + + // IN inputs: 4-bit general purpose input auto read_in() { return m_read_in.bind(); } + + // SI/SO lines: serial in/out or counter/gen.purpose auto read_si() { return m_read_si.bind(); } auto write_so() { return m_write_so.bind(); } + + // SK output line: logic-controlled clock or gen.purpose auto write_sk() { return m_write_sk.bind(); } + + // CKI/CKO lines: only CKO input here auto read_cko() { return m_read_cko.bind(); } void set_config(cop400_cki_bond cki, cop400_cko_bond cko, bool has_microbus) diff --git a/src/devices/cpu/dsp16/dsp16.h b/src/devices/cpu/dsp16/dsp16.h index c0fca2c9960..1f08a6ed6a0 100644 --- a/src/devices/cpu/dsp16/dsp16.h +++ b/src/devices/cpu/dsp16/dsp16.h @@ -17,81 +17,31 @@ #include #include - -#define MCFG_DSP16_EXM(exm) \ - downcast(*device).exm_w(exm); - -#define MCFG_DSP16_EXM_HIGH() \ - downcast(*device).exm_w(1); - -#define MCFG_DSP16_EXM_LOW() \ - downcast(*device).exm_w(0); - -#define MCFG_DSP16_IACK_CB(obj) \ - downcast(*device).set_iack_cb(DEVCB_##obj); - -#define MCFG_DSP16_ICK_CB(obj) \ - downcast(*device).set_ick_cb(DEVCB_##obj); - -#define MCFG_DSP16_ILD_CB(obj) \ - downcast(*device).set_ild_cb(DEVCB_##obj); - -#define MCFG_DSP16_DO_CB(obj) \ - downcast(*device).set_do_cb(DEVCB_##obj); - -#define MCFG_DSP16_OCK_CB(obj) \ - downcast(*device).set_ock_cb(DEVCB_##obj); - -#define MCFG_DSP16_OLD_CB(obj) \ - downcast(*device).set_old_cb(DEVCB_##obj); - -#define MCFG_DSP16_OSE_CB(obj) \ - downcast(*device).set_ose_cb(DEVCB_##obj); - -#define MCFG_DSP16_PIO_R_CB(obj) \ - downcast(*device).set_pio_r_cb(DEVCB_##obj); - -#define MCFG_DSP16_PIO_W_CB(obj) \ - downcast(*device).set_pio_w_cb(DEVCB_##obj); - -#define MCFG_DSP16_PDB_W_CB(obj) \ - downcast(*device).set_pdb_w_cb(DEVCB_##obj); - -#define MCFG_DSP16_PSEL_CB(obj) \ - downcast(*device).set_psel_cb(DEVCB_##obj); - -#define MCFG_DSP16_PIDS_CB(obj) \ - downcast(*device).set_pids_cb(DEVCB_##obj); - -#define MCFG_DSP16_PODS_CB(obj) \ - downcast(*device).set_pods_cb(DEVCB_##obj); - - class dsp16_device_base : public cpu_device, protected dsp16_disassembler::cpu { public: DECLARE_WRITE_LINE_MEMBER(exm_w); // interrupt output callbacks - template devcb_base *set_iack_cb(Obj &&cb) { return &m_iack_cb.set_callback(std::forward(cb)); } + auto iack_cb() { return m_iack_cb.bind(); } // serial output callbacks - template devcb_base *set_ick_cb(Obj &&cb) { return &m_ick_cb.set_callback(std::forward(cb)); } - template devcb_base *set_ild_cb(Obj &&cb) { return &m_ild_cb.set_callback(std::forward(cb)); } - template devcb_base *set_do_cb(Obj &&cb) { return &m_do_cb.set_callback(std::forward(cb)); } - template devcb_base *set_ock_cb(Obj &&cb) { return &m_ock_cb.set_callback(std::forward(cb)); } - template devcb_base *set_old_cb(Obj &&cb) { return &m_old_cb.set_callback(std::forward(cb)); } - template devcb_base *set_ose_cb(Obj &&cb) { return &m_ose_cb.set_callback(std::forward(cb)); } + auto ick_cb() { return m_ick_cb.bind(); } + auto ild_cb() { return m_ild_cb.bind(); } + auto do_cb() { return m_do_cb.bind(); } + auto ock_cb() { return m_ock_cb.bind(); } + auto old_cb() { return m_old_cb.bind(); } + auto ose_cb() { return m_ose_cb.bind(); } // high-level active parallel I/O callbacks - template devcb_base *set_pio_r_cb(Obj &&cb) { return &m_pio_r_cb.set_callback(std::forward(cb)); } - template devcb_base *set_pio_w_cb(Obj &&cb) { return &m_pio_w_cb.set_callback(std::forward(cb)); } + auto pio_r_cb() { return m_pio_r_cb.bind(); } + auto pio_w_cb() { return m_pio_w_cb.bind(); } // low-level parallel I/O callbacks - template devcb_base *set_pdb_w_cb(Obj &&cb) { return &m_pdb_w_cb.set_callback(std::forward(cb)); } - template devcb_base *set_psel_cb(Obj &&cb) { return &m_psel_cb.set_callback(std::forward(cb)); } - template devcb_base *set_pids_cb(Obj &&cb) { return &m_pids_cb.set_callback(std::forward(cb)); } - template devcb_base *set_pods_cb(Obj &&cb) { return &m_pods_cb.set_callback(std::forward(cb)); } + auto pdb_w_cb() { return m_pdb_w_cb.bind(); } + auto psel_cb() { return m_psel_cb.bind(); } + auto pids_cb() { return m_pids_cb.bind(); } + auto pods_cb() { return m_pods_cb.bind(); } // interrupt outputs DECLARE_READ_LINE_MEMBER(iack_r) { return m_iack_out; } diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp index bc1cbb8c8ab..795ab3de985 100644 --- a/src/devices/cpu/hmcs40/hmcs40.cpp +++ b/src/devices/cpu/hmcs40/hmcs40.cpp @@ -94,8 +94,8 @@ hmcs40_cpu_device::hmcs40_cpu_device(const machine_config &mconfig, device_type , m_family(family) , m_polarity(polarity) , m_stack_levels(stack_levels) - , m_read_r0(*this), m_read_r1(*this), m_read_r2(*this), m_read_r3(*this), m_read_r4(*this), m_read_r5(*this), m_read_r6(*this), m_read_r7(*this) - , m_write_r0(*this), m_write_r1(*this), m_write_r2(*this), m_write_r3(*this), m_write_r4(*this), m_write_r5(*this), m_write_r6(*this), m_write_r7(*this) + , m_read_r{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_write_r{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} , m_read_d(*this) , m_write_d(*this) { @@ -206,23 +206,11 @@ void hmcs40_cpu_device::device_start() reset_prescaler(); // resolve callbacks - m_read_r0.resolve_safe(m_polarity & 0xf); - m_read_r1.resolve_safe(m_polarity & 0xf); - m_read_r2.resolve_safe(m_polarity & 0xf); - m_read_r3.resolve_safe(m_polarity & 0xf); - m_read_r4.resolve_safe(m_polarity & 0xf); - m_read_r5.resolve_safe(m_polarity & 0xf); - m_read_r6.resolve_safe(m_polarity & 0xf); - m_read_r7.resolve_safe(m_polarity & 0xf); - - m_write_r0.resolve_safe(); - m_write_r1.resolve_safe(); - m_write_r2.resolve_safe(); - m_write_r3.resolve_safe(); - m_write_r4.resolve_safe(); - m_write_r5.resolve_safe(); - m_write_r6.resolve_safe(); - m_write_r7.resolve_safe(); + for (int i = 0; i < 8; i++) + { + m_read_r[i].resolve_safe(m_polarity & 0xf); + m_write_r[i].resolve_safe(); + } m_read_d.resolve_safe(m_polarity); m_write_d.resolve_safe(); @@ -337,19 +325,7 @@ void hmcs40_cpu_device::device_reset() u8 hmcs40_cpu_device::read_r(int index) { index &= 7; - u8 inp = 0; - - switch (index) - { - case 0: inp = m_read_r0(index, 0xff); break; - case 1: inp = m_read_r1(index, 0xff); break; - case 2: inp = m_read_r2(index, 0xff); break; - case 3: inp = m_read_r3(index, 0xff); break; - case 4: inp = m_read_r4(index, 0xff); break; - case 5: inp = m_read_r5(index, 0xff); break; - case 6: inp = m_read_r6(index, 0xff); break; - case 7: inp = m_read_r7(index, 0xff); break; - } + u8 inp = m_read_r[index](index, 0xff); if (m_polarity) return (inp & m_r[index]) & 0xf; @@ -362,18 +338,7 @@ void hmcs40_cpu_device::write_r(int index, u8 data) index &= 7; data &= 0xf; m_r[index] = data; - - switch (index) - { - case 0: m_write_r0(index, data, 0xff); break; - case 1: m_write_r1(index, data, 0xff); break; - case 2: m_write_r2(index, data, 0xff); break; - case 3: m_write_r3(index, data, 0xff); break; - case 4: m_write_r4(index, data, 0xff); break; - case 5: m_write_r5(index, data, 0xff); break; - case 6: m_write_r6(index, data, 0xff); break; - case 7: m_write_r7(index, data, 0xff); break; - } + m_write_r[index](index, data, 0xff); } int hmcs40_cpu_device::read_d(int index) diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h index ffa5ea26d5e..4da14642ed9 100644 --- a/src/devices/cpu/hmcs40/hmcs40.h +++ b/src/devices/cpu/hmcs40/hmcs40.h @@ -14,18 +14,6 @@ // I/O ports setup -// max 8 4-bit R ports -#define MCFG_HMCS40_READ_R_CB(R, _devcb) \ - downcast(*device).set_read_r##R##_callback(DEVCB_##_devcb); -#define MCFG_HMCS40_WRITE_R_CB(R, _devcb) \ - downcast(*device).set_write_r##R##_callback(DEVCB_##_devcb); - -// 16-bit discrete -#define MCFG_HMCS40_READ_D_CB(_devcb) \ - downcast(*device).set_read_d_callback(DEVCB_##_devcb); -#define MCFG_HMCS40_WRITE_D_CB(_devcb) \ - downcast(*device).set_write_d_callback(DEVCB_##_devcb); - enum { HMCS40_INPUT_LINE_INT0 = 0, @@ -105,27 +93,13 @@ public: PORT_R7X }; - // configuration helpers - template devcb_base &set_read_r0_callback(Object &&cb) { return m_read_r0.set_callback(std::forward(cb)); } - template devcb_base &set_read_r1_callback(Object &&cb) { return m_read_r1.set_callback(std::forward(cb)); } - template devcb_base &set_read_r2_callback(Object &&cb) { return m_read_r2.set_callback(std::forward(cb)); } - template devcb_base &set_read_r3_callback(Object &&cb) { return m_read_r3.set_callback(std::forward(cb)); } - template devcb_base &set_read_r4_callback(Object &&cb) { return m_read_r4.set_callback(std::forward(cb)); } - template devcb_base &set_read_r5_callback(Object &&cb) { return m_read_r5.set_callback(std::forward(cb)); } - template devcb_base &set_read_r6_callback(Object &&cb) { return m_read_r6.set_callback(std::forward(cb)); } - template devcb_base &set_read_r7_callback(Object &&cb) { return m_read_r7.set_callback(std::forward(cb)); } - - template devcb_base &set_write_r0_callback(Object &&cb) { return m_write_r0.set_callback(std::forward(cb)); } - template devcb_base &set_write_r1_callback(Object &&cb) { return m_write_r1.set_callback(std::forward(cb)); } - template devcb_base &set_write_r2_callback(Object &&cb) { return m_write_r2.set_callback(std::forward(cb)); } - template devcb_base &set_write_r3_callback(Object &&cb) { return m_write_r3.set_callback(std::forward(cb)); } - template devcb_base &set_write_r4_callback(Object &&cb) { return m_write_r4.set_callback(std::forward(cb)); } - template devcb_base &set_write_r5_callback(Object &&cb) { return m_write_r5.set_callback(std::forward(cb)); } - template devcb_base &set_write_r6_callback(Object &&cb) { return m_write_r6.set_callback(std::forward(cb)); } - template devcb_base &set_write_r7_callback(Object &&cb) { return m_write_r7.set_callback(std::forward(cb)); } - - template devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward(cb)); } - template devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward(cb)); } + // max 8 4-bit R ports + template auto read_r() { return m_read_r[Bit].bind(); } + template auto write_r() { return m_write_r[Bit].bind(); } + + // 16-bit discrete + auto read_d() { return m_read_d.bind(); } + auto write_d() { return m_write_d.bind(); } protected: enum @@ -214,8 +188,8 @@ protected: u16 m_d; // D pins state // i/o handlers - devcb_read8 m_read_r0, m_read_r1, m_read_r2, m_read_r3, m_read_r4, m_read_r5, m_read_r6, m_read_r7; - devcb_write8 m_write_r0, m_write_r1, m_write_r2, m_write_r3, m_write_r4, m_write_r5, m_write_r6, m_write_r7; + devcb_read8 m_read_r[8]; + devcb_write8 m_write_r[8]; devcb_read16 m_read_d; devcb_write16 m_write_d; diff --git a/src/devices/sound/msm5205.h b/src/devices/sound/msm5205.h index b4d69bc2029..073ce06f7a3 100644 --- a/src/devices/sound/msm5205.h +++ b/src/devices/sound/msm5205.h @@ -47,6 +47,7 @@ public: template devcb_base &set_vck_callback(Object &&cb) { return m_vck_cb.set_callback(std::forward(cb)); } template devcb_base &set_vck_legacy_callback(Object &&cb) { return m_vck_legacy_cb.set_callback(std::forward(cb)); } auto vck_callback() { return m_vck_cb.bind(); } + auto vck_legacy_callback() { return m_vck_legacy_cb.bind(); } // reset signal should keep for 2cycle of VCLK DECLARE_WRITE_LINE_MEMBER(reset_w); diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index bb6d3da1573..eff89290ada 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -190,13 +190,14 @@ const tiny_rom_entry *qsound_device::device_rom_region() const // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(qsound_device::device_add_mconfig) - MCFG_DEVICE_ADD("dsp", DSP16A, DERIVED_CLOCK(1, 1)) - MCFG_DEVICE_IO_MAP(dsp_io_map) - MCFG_DSP16_OCK_CB(WRITELINE(*this, qsound_device, dsp_ock_w)) - MCFG_DSP16_PIO_R_CB(READ16(*this, qsound_device, dsp_pio_r)) - MCFG_DSP16_PIO_W_CB(WRITE16(*this, qsound_device, dsp_pio_w)) -MACHINE_CONFIG_END +void qsound_device::device_add_mconfig(machine_config &config) +{ + DSP16A(config, m_dsp, DERIVED_CLOCK(1, 1)); + m_dsp->set_addrmap(AS_IO, &qsound_device::dsp_io_map); + m_dsp->ock_cb().set(FUNC(qsound_device::dsp_ock_w)); + m_dsp->pio_r_cb().set(FUNC(qsound_device::dsp_pio_r)); + m_dsp->pio_w_cb().set(FUNC(qsound_device::dsp_pio_w)); +} //------------------------------------------------- diff --git a/src/mame/drivers/advision.cpp b/src/mame/drivers/advision.cpp index e037269cb4f..bbe2e64d6ee 100644 --- a/src/mame/drivers/advision.cpp +++ b/src/mame/drivers/advision.cpp @@ -20,7 +20,6 @@ #include "emu.h" #include "includes/advision.h" -#include "cpu/cop400/cop400.h" #include "sound/volt_reg.h" #include "screen.h" #include "softlist.h" @@ -62,7 +61,8 @@ INPUT_PORTS_END /* Machine Driver */ -MACHINE_CONFIG_START(advision_state::advision) +void advision_state::advision(machine_config &config) +{ /* basic machine hardware */ I8048(config, m_maincpu, XTAL(11'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &advision_state::program_map); @@ -72,36 +72,37 @@ MACHINE_CONFIG_START(advision_state::advision) m_maincpu->p2_out_cb().set(FUNC(advision_state::av_control_w)); m_maincpu->t1_in_cb().set(FUNC(advision_state::vsync_r)); - MCFG_DEVICE_ADD(COP411_TAG, COP411, 52631*4) // COP411L-KCN/N, R11=82k, C8=56pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_RAM_POWER_SUPPLY, false) - MCFG_COP400_READ_L_CB(READ8(*this, advision_state, sound_cmd_r)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, advision_state, sound_g_w)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, advision_state, sound_d_w)) + COP411(config, m_soundcpu, 52631*4); // COP411L-KCN/N, R11=82k, C8=56pF + m_soundcpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_RAM_POWER_SUPPLY, false); + m_soundcpu->read_l().set(FUNC(advision_state::sound_cmd_r)); + m_soundcpu->write_g().set(FUNC(advision_state::sound_g_w)); + m_soundcpu->write_d().set(FUNC(advision_state::sound_d_w)); /* video hardware */ - MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) - MCFG_SCREEN_REFRESH_RATE(4*15) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_UPDATE_DRIVER(advision_state, screen_update) - MCFG_SCREEN_SIZE(320, 200) - MCFG_SCREEN_VISIBLE_AREA(84, 235, 60, 142) - MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(advision_state, advision) + screen_device &screen(SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(4*15); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_screen_update(FUNC(advision_state::screen_update)); + screen.set_size(320, 200); + screen.set_visarea(84, 235, 60, 142); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 8).set_init(FUNC(advision_state::palette_init_advision)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_2BIT_BINARY_WEIGHTED, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // 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) + DAC_2BIT_BINARY_WEIGHTED(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // 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); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "advision_cart") - MCFG_GENERIC_MANDATORY + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "advision_cart").set_must_be_loaded(true); /* Software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","advision") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("advision"); +} /* ROMs */ diff --git a/src/mame/drivers/cidelsa.cpp b/src/mame/drivers/cidelsa.cpp index d5aed3fcb4e..a731271fa6d 100644 --- a/src/mame/drivers/cidelsa.cpp +++ b/src/mame/drivers/cidelsa.cpp @@ -400,7 +400,8 @@ void cidelsa_state::machine_reset() /* Machine Drivers */ -MACHINE_CONFIG_START(cidelsa_state::destryer) +void cidelsa_state::destryer(machine_config &config) +{ /* basic system hardware */ cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, DESTRYER_CHR1)); cpu.set_addrmap(AS_PROGRAM, &cidelsa_state::destryer_map); @@ -413,9 +414,10 @@ MACHINE_CONFIG_START(cidelsa_state::destryer) /* sound and video hardware */ destryer_video(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(cidelsa_state::destryera) +void cidelsa_state::destryera(machine_config &config) +{ /* basic system hardware */ cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, DESTRYER_CHR1)); cpu.set_addrmap(AS_PROGRAM, &cidelsa_state::destryera_map); @@ -428,9 +430,10 @@ MACHINE_CONFIG_START(cidelsa_state::destryera) /* sound and video hardware */ destryer_video(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(cidelsa_state::altair) +void cidelsa_state::altair(machine_config &config) +{ /* basic system hardware */ cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, ALTAIR_CHR1)); cpu.set_addrmap(AS_PROGRAM, &cidelsa_state::altair_map); @@ -461,9 +464,10 @@ MACHINE_CONFIG_START(cidelsa_state::altair) /* sound and video hardware */ altair_video(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(draco_state::draco) +void draco_state::draco(machine_config &config) +{ /* basic system hardware */ cdp1802_device &cpu(CDP1802(config, CDP1802_TAG, DRACO_CHR1)); cpu.set_addrmap(AS_PROGRAM, &draco_state::draco_map); @@ -475,14 +479,14 @@ MACHINE_CONFIG_START(draco_state::draco) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_DEVICE_ADD(COP402N_TAG, COP402, DRACO_SND_CHR1) - MCFG_DEVICE_PROGRAM_MAP(draco_sound_map) - MCFG_COP400_CONFIG( COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false ) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, draco_state, sound_bankswitch_w)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, draco_state, sound_g_w)) - MCFG_COP400_READ_L_CB(READ8(*this, draco_state, psg_r)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, draco_state, psg_w)) - MCFG_COP400_READ_IN_CB(READ8(*this, draco_state, sound_in_r)) + cop402_cpu_device &cop(COP402(config, COP402N_TAG, DRACO_SND_CHR1)); + cop.set_addrmap(AS_PROGRAM, &draco_state::draco_sound_map); + cop.set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); + cop.write_d().set(FUNC(draco_state::sound_bankswitch_w)); + cop.write_g().set(FUNC(draco_state::sound_g_w)); + cop.read_l().set(FUNC(draco_state::psg_r)); + cop.write_l().set(FUNC(draco_state::psg_w)); + cop.read_in().set(FUNC(draco_state::sound_in_r)); /* input/output hardware */ cdp1852_device &ic29(CDP1852(config, "ic29")); // clock is really tied to CDP1869 CMSEL (pin 37) @@ -503,7 +507,7 @@ MACHINE_CONFIG_START(draco_state::draco) /* sound and video hardware */ draco_video(config); -MACHINE_CONFIG_END +} /* ROMs */ diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp index 3f0804681a6..ac2871d1a2d 100644 --- a/src/mame/drivers/hh_cop400.cpp +++ b/src/mame/drivers/hh_cop400.cpp @@ -62,7 +62,7 @@ public: { } // devices - required_device m_maincpu; + required_device m_maincpu; optional_ioport_array<6> m_inp_matrix; // max 6 output_finder<0x20, 0x20> m_out_x; output_finder<0x20> m_out_a; @@ -313,24 +313,23 @@ static INPUT_PORTS_START( ctstein ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Blue Button") INPUT_PORTS_END -MACHINE_CONFIG_START(ctstein_state::ctstein) - +void ctstein_state::ctstein(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP421, 850000) // approximation - RC osc. R=12K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_G_CB(WRITE8(*this, ctstein_state, write_g)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, ctstein_state, write_l)) - MCFG_COP400_WRITE_SK_CB(WRITELINE("speaker", speaker_sound_device, level_w)) - MCFG_COP400_READ_L_CB(READ8(*this, ctstein_state, read_l)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP421(config, m_maincpu, 850000); // approximation - RC osc. R=12K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_g().set(FUNC(ctstein_state::write_g)); + m_maincpu->write_l().set(FUNC(ctstein_state::write_l)); + m_maincpu->write_sk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + m_maincpu->read_l().set(FUNC(ctstein_state::read_l)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_ctstein); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -455,39 +454,36 @@ static INPUT_PORTS_START( h2hsoccerc ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) INPUT_PORTS_END -MACHINE_CONFIG_START(h2hbaskbc_state::h2hbaskbc) - +void h2hbaskbc_state::h2hbaskbc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP420, 850000) // approximation - RC osc. R=43K, C=101pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, h2hbaskbc_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, h2hbaskbc_state, write_g)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, h2hbaskbc_state, write_l)) - MCFG_COP400_READ_IN_CB(READ8(*this, h2hbaskbc_state, read_in)) - MCFG_COP400_WRITE_SO_CB(WRITELINE("speaker", speaker_sound_device, level_w)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP420(config, m_maincpu, 850000); // approximation - RC osc. R=43K, C=101pF + m_maincpu->set_config(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(h2hbaskbc_state::write_d)); + m_maincpu->write_g().set(FUNC(h2hbaskbc_state::write_g)); + m_maincpu->write_l().set(FUNC(h2hbaskbc_state::write_l)); + m_maincpu->read_in().set(FUNC(h2hbaskbc_state::read_in)); + m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_h2hbaskbc); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} -MACHINE_CONFIG_START(h2hbaskbc_state::h2hhockeyc) +void h2hbaskbc_state::h2hhockeyc(machine_config &config) +{ h2hbaskbc(config); - - /* basic machine hardware */ config.set_default_layout(layout_h2hhockeyc); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(h2hbaskbc_state::h2hsoccerc) +void h2hbaskbc_state::h2hsoccerc(machine_config &config) +{ h2hbaskbc(config); - - /* basic machine hardware */ config.set_default_layout(layout_h2hsoccerc); -MACHINE_CONFIG_END +} @@ -581,31 +577,32 @@ static INPUT_PORTS_START( einvaderc ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) INPUT_PORTS_END -MACHINE_CONFIG_START(einvaderc_state::einvaderc) - +void einvaderc_state::einvaderc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP444L, 850000) // approximation - RC osc. R=47K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_READ_IN_CB(IOPORT("IN.0")) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, einvaderc_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, einvaderc_state, write_g)) - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, einvaderc_state, write_sk)) - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, einvaderc_state, write_so)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, einvaderc_state, write_l)) + COP444L(config, m_maincpu, 850000); // approximation - RC osc. R=47K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->read_in().set_ioport("IN.0"); + m_maincpu->write_d().set(FUNC(einvaderc_state::write_d)); + m_maincpu->write_g().set(FUNC(einvaderc_state::write_g)); + m_maincpu->write_sk().set(FUNC(einvaderc_state::write_sk)); + m_maincpu->write_so().set(FUNC(einvaderc_state::write_so)); + m_maincpu->write_l().set(FUNC(einvaderc_state::write_l)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(913, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 913-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(913, 1080); + screen.set_visarea(0, 913-1, 0, 1080-1); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_einvaderc); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -710,26 +707,25 @@ static INPUT_PORTS_START( unkeinv ) PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_SENSITIVITY(10) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, unkeinv_state, position_changed, nullptr) INPUT_PORTS_END -MACHINE_CONFIG_START(unkeinv_state::unkeinv) - +void unkeinv_state::unkeinv(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP421, 850000) // frequency guessed - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_G_CB(WRITE8(*this, unkeinv_state, write_g)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, unkeinv_state, write_d)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, unkeinv_state, write_l)) - MCFG_COP400_READ_L_CB(READ8(*this, unkeinv_state, read_l)) - MCFG_COP400_READ_L_TRISTATE_CB(CONSTANT(0xff)) - MCFG_COP400_WRITE_SO_CB(WRITELINE("speaker", speaker_sound_device, level_w)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP421(config, m_maincpu, 850000); // frequency guessed + m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_g().set(FUNC(unkeinv_state::write_g)); + m_maincpu->write_d().set(FUNC(unkeinv_state::write_d)); + m_maincpu->write_l().set(FUNC(unkeinv_state::write_l)); + m_maincpu->read_l().set(FUNC(unkeinv_state::read_l)); + m_maincpu->read_l_tristate().set_constant(0xff); + m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_unkeinv); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -866,27 +862,26 @@ void lchicken_state::machine_start() save_item(NAME(m_motor_pos)); } -MACHINE_CONFIG_START(lchicken_state::lchicken) - +void lchicken_state::lchicken(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP421, 850000) // approximation - RC osc. R=12K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_L_CB(WRITE8(*this, lchicken_state, write_l)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, lchicken_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, lchicken_state, write_g)) - MCFG_COP400_READ_G_CB(READ8(*this, lchicken_state, read_g)) - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, lchicken_state, write_so)) - MCFG_COP400_READ_SI_CB(READLINE(*this, lchicken_state, read_si)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("chicken_motor", lchicken_state, motor_sim_tick, attotime::from_msec(6000/0x100)) // ~6sec for a full rotation - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP421(config, m_maincpu, 850000); // approximation - RC osc. R=12K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_l().set(FUNC(lchicken_state::write_l)); + m_maincpu->write_d().set(FUNC(lchicken_state::write_d)); + m_maincpu->write_g().set(FUNC(lchicken_state::write_g)); + m_maincpu->read_g().set(FUNC(lchicken_state::read_g)); + m_maincpu->write_so().set(FUNC(lchicken_state::write_so)); + m_maincpu->read_si().set(FUNC(lchicken_state::read_si)); + + TIMER(config, "chicken_motor").configure_periodic(FUNC(lchicken_state::motor_sim_tick), attotime::from_msec(6000/0x100)); // ~6sec for a full rotation + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_lchicken); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -976,25 +971,24 @@ static INPUT_PORTS_START( funjacks ) PORT_CONFSETTING( 0x08, "2" ) INPUT_PORTS_END -MACHINE_CONFIG_START(funjacks_state::funjacks) - +void funjacks_state::funjacks(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP410, 1000000) // approximation - RC osc. R=47K, C=56pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, funjacks_state, write_d)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, funjacks_state, write_l)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, funjacks_state, write_g)) - MCFG_COP400_READ_L_CB(READ8(*this, funjacks_state, read_l)) - MCFG_COP400_READ_G_CB(READ8(*this, funjacks_state, read_g)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP410(config, m_maincpu, 1000000); // approximation - RC osc. R=47K, C=56pF + m_maincpu->set_config(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(funjacks_state::write_d)); + m_maincpu->write_l().set(FUNC(funjacks_state::write_l)); + m_maincpu->write_g().set(FUNC(funjacks_state::write_g)); + m_maincpu->read_l().set(FUNC(funjacks_state::read_l)); + m_maincpu->read_g().set(FUNC(funjacks_state::read_g)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_funjacks); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1071,25 +1065,24 @@ INPUT_CHANGED_MEMBER(funrlgl_state::reset_button) m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); } -MACHINE_CONFIG_START(funrlgl_state::funrlgl) - +void funrlgl_state::funrlgl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP410, 1000000) // approximation - RC osc. R=51K, C=91pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, funrlgl_state, write_d)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, funrlgl_state, write_l)) - MCFG_COP400_READ_L_TRISTATE_CB(CONSTANT(0xff)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, funrlgl_state, write_g)) - MCFG_COP400_READ_G_CB(IOPORT("IN.0")) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP410(config, m_maincpu, 1000000); // approximation - RC osc. R=51K, C=91pF + m_maincpu->set_config(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(funrlgl_state::write_d)); + m_maincpu->write_l().set(FUNC(funrlgl_state::write_l)); + m_maincpu->read_l_tristate().set_constant(0xff); + m_maincpu->write_g().set(FUNC(funrlgl_state::write_g)); + m_maincpu->read_g().set_ioport("IN.0"); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_funrlgl); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1207,25 +1200,24 @@ static INPUT_PORTS_START( mdallas ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("North") // N INPUT_PORTS_END -MACHINE_CONFIG_START(mdallas_state::mdallas) - +void mdallas_state::mdallas(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP444L, 1000000) // approximation - RC osc. R=57K, C=101pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_L_CB(WRITE8(*this, mdallas_state, write_l)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, mdallas_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, mdallas_state, write_g)) - MCFG_COP400_READ_IN_CB(READ8(*this, mdallas_state, read_in)) - MCFG_COP400_WRITE_SO_CB(WRITELINE("speaker", speaker_sound_device, level_w)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP444L(config, m_maincpu, 1000000); // approximation - RC osc. R=57K, C=101pF + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_l().set(FUNC(mdallas_state::write_l)); + m_maincpu->write_d().set(FUNC(mdallas_state::write_d)); + m_maincpu->write_g().set(FUNC(mdallas_state::write_g)); + m_maincpu->read_in().set(FUNC(mdallas_state::read_in)); + m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_mdallas); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1291,23 +1283,22 @@ static INPUT_PORTS_START( plus1 ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(plus1_state::plus1) - +void plus1_state::plus1(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP410, 1000000) // approximation - RC osc. R=51K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, plus1_state, write_d)) - MCFG_COP400_READ_G_CB(IOPORT("IN.0")) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, plus1_state, write_l)) - MCFG_COP400_READ_L_CB(READ8(*this, plus1_state, read_l)) + COP410(config, m_maincpu, 1000000); // approximation - RC osc. R=51K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(plus1_state::write_d)); + m_maincpu->read_g().set_ioport("IN.0"); + m_maincpu->write_l().set(FUNC(plus1_state::write_l)); + m_maincpu->read_l().set(FUNC(plus1_state::read_l)); /* no visual feedback! */ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1419,25 +1410,24 @@ static INPUT_PORTS_START( lightfgt ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_COCKTAIL INPUT_PORTS_END -MACHINE_CONFIG_START(lightfgt_state::lightfgt) - +void lightfgt_state::lightfgt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP421, 950000) // approximation - RC osc. R=82K, C=56pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, lightfgt_state, write_so)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, lightfgt_state, write_d)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, lightfgt_state, write_l)) - MCFG_COP400_WRITE_SK_CB(WRITELINE("speaker", speaker_sound_device, level_w)) - MCFG_COP400_READ_G_CB(READ8(*this, lightfgt_state, read_g)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP421(config, m_maincpu, 950000); // approximation - RC osc. R=82K, C=56pF + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_so().set(FUNC(lightfgt_state::write_so)); + m_maincpu->write_d().set(FUNC(lightfgt_state::write_d)); + m_maincpu->write_l().set(FUNC(lightfgt_state::write_l)); + m_maincpu->write_sk().set(m_speaker, FUNC(speaker_sound_device::level_w)); + m_maincpu->read_g().set(FUNC(lightfgt_state::read_g)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_lightfgt); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1573,27 +1563,29 @@ base pulled high with 4.7K resistor, connects directly to G3, 1K resistor to G2, */ -MACHINE_CONFIG_START(bship82_state::bship82) - +void bship82_state::bship82(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP420, 750000) // approximation - RC osc. R=14K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, bship82_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8("dac", dac_byte_interface, data_w)) - MCFG_COP400_READ_L_CB(READ8(*this, bship82_state, read_l)) - MCFG_COP400_READ_IN_CB(READ8(*this, bship82_state, read_in)) - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, bship82_state, write_so)) - MCFG_COP400_READ_SI_CB(IOPORT("IN.4")) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP420(config, m_maincpu, 750000); // approximation - RC osc. R=14K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(bship82_state::write_d)); + m_maincpu->write_g().set("dac", FUNC(dac_byte_interface::data_w)); + m_maincpu->read_l().set(FUNC(bship82_state::read_l)); + m_maincpu->read_in().set(FUNC(bship82_state::read_in)); + m_maincpu->write_so().set(FUNC(bship82_state::write_so)); + m_maincpu->read_si().set_ioport("IN.4"); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_bship82); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("dac", DAC_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.125) // see above - 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_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.125); // see above + 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); +} @@ -1705,22 +1697,22 @@ static INPUT_PORTS_START( qkracer ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Tables") INPUT_PORTS_END -MACHINE_CONFIG_START(qkracer_state::qkracer) - +void qkracer_state::qkracer(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP420, 1000000) // approximation - RC osc. R=47K, C=100pF - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_32, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, qkracer_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, qkracer_state, write_g)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, qkracer_state, write_l)) - MCFG_COP400_READ_IN_CB(READ8(*this, qkracer_state, read_in)) - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, qkracer_state, write_sk)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP420(config, m_maincpu, 1000000); // approximation - RC osc. R=47K, C=100pF + m_maincpu->set_config(COP400_CKI_DIVISOR_32, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(qkracer_state::write_d)); + m_maincpu->write_g().set(FUNC(qkracer_state::write_g)); + m_maincpu->write_l().set(FUNC(qkracer_state::write_l)); + m_maincpu->read_in().set(FUNC(qkracer_state::read_in)); + m_maincpu->write_sk().set(FUNC(qkracer_state::write_sk)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_qkracer); /* no sound! */ -MACHINE_CONFIG_END +} @@ -1796,26 +1788,28 @@ static INPUT_PORTS_START( vidchal ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) // TODO: light sensor INPUT_PORTS_END -MACHINE_CONFIG_START(vidchal_state::vidchal) - +void vidchal_state::vidchal(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", COP420, 900000) // approximation - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_D_CB(WRITE8(*this, vidchal_state, write_d)) - MCFG_COP400_WRITE_G_CB(WRITE8("dac", dac_byte_interface, data_w)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, vidchal_state, write_l)) - MCFG_COP400_READ_IN_CB(IOPORT("IN.0")) - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, vidchal_state, write_sk)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1)) + COP420(config, m_maincpu, 900000); // approximation + m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + m_maincpu->write_d().set(FUNC(vidchal_state::write_d)); + m_maincpu->write_g().set("dac", FUNC(dac_byte_interface::data_w)); + m_maincpu->write_l().set(FUNC(vidchal_state::write_l)); + m_maincpu->read_in().set_ioport("IN.0"); + m_maincpu->write_sk().set(FUNC(vidchal_state::write_sk)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_cop400_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_vidchal); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("dac", DAC_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.125) // 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_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.125); // 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); +} diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index 35c30d63887..294cd054d54 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -125,7 +125,7 @@ public: { } // devices - required_device m_maincpu; + required_device m_maincpu; optional_device m_audiocpu; optional_device m_soundlatch; optional_device m_soundlatch2; @@ -429,28 +429,29 @@ static INPUT_PORTS_START( bambball ) PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END -MACHINE_CONFIG_START(bambball_state::bambball) - +void bambball_state::bambball(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38750, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, bambball_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bambball_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bambball_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bambball_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bambball_state, grid_w)) + HD38750(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(bambball_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(bambball_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bambball_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bambball_state::plate_w)); + m_maincpu->write_d().set(FUNC(bambball_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 478) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 478-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 478); + screen.set_visarea(0, 1920-1, 0, 478-1); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -564,29 +565,29 @@ static INPUT_PORTS_START( bmboxing ) PORT_BIT( 0xfff8, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(bmboxing_state::bmboxing) - +void bmboxing_state::bmboxing(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38750, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, bmboxing_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bmboxing_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bmboxing_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bmboxing_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bmboxing_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.4")) + HD38750(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(bmboxing_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(bmboxing_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bmboxing_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bmboxing_state::plate_w)); + m_maincpu->write_d().set(FUNC(bmboxing_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.4"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 529) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 529-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 529); + screen.set_visarea(0, 1920-1, 0, 529-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -688,28 +689,28 @@ INPUT_CHANGED_MEMBER(bfriskyt_state::input_changed) update_int1(); } -MACHINE_CONFIG_START(bfriskyt_state::bfriskyt) - +void bfriskyt_state::bfriskyt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bfriskyt_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bfriskyt_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bfriskyt_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bfriskyt_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bfriskyt_state, grid_w)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(bfriskyt_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bfriskyt_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bfriskyt_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bfriskyt_state::plate_w)); + m_maincpu->write_d().set(FUNC(bfriskyt_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 675) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 675-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 675); + screen.set_visarea(0, 1920-1, 0, 675-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -797,29 +798,29 @@ static INPUT_PORTS_START( packmon ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) INPUT_PORTS_END -MACHINE_CONFIG_START(packmon_state::packmon) - +void packmon_state::packmon(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, packmon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, packmon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, packmon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, packmon_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, packmon_state, grid_w)) - MCFG_HMCS40_READ_D_CB(READ16(*this, packmon_state, input_r)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(packmon_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(packmon_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(packmon_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(packmon_state::plate_w)); + m_maincpu->write_d().set(FUNC(packmon_state::grid_w)); + m_maincpu->read_d().set(FUNC(packmon_state::input_r)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 766) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 766-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 766); + screen.set_visarea(0, 1920-1, 0, 766-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -931,28 +932,28 @@ INPUT_CHANGED_MEMBER(msthawk_state::input_changed) update_int0(); } -MACHINE_CONFIG_START(msthawk_state::msthawk) - +void msthawk_state::msthawk(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, msthawk_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, msthawk_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, msthawk_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, msthawk_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, msthawk_state, grid_w)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(msthawk_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(msthawk_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(msthawk_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(msthawk_state::plate_w)); + m_maincpu->write_d().set(FUNC(msthawk_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 696) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 696-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 696); + screen.set_visarea(0, 1920-1, 0, 696-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1051,29 +1052,29 @@ INPUT_CHANGED_MEMBER(bzaxxon_state::input_changed) update_int1(); } -MACHINE_CONFIG_START(bzaxxon_state::bzaxxon) - +void bzaxxon_state::bzaxxon(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 450000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bzaxxon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bzaxxon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bzaxxon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bzaxxon_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bzaxxon_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.5")) + HD38800(config, m_maincpu, 450000); // approximation + m_maincpu->write_r<0>().set(FUNC(bzaxxon_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bzaxxon_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bzaxxon_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bzaxxon_state::plate_w)); + m_maincpu->write_d().set(FUNC(bzaxxon_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.5"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(613, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 613-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(613, 1080); + screen.set_visarea(0, 613-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1166,31 +1167,31 @@ INPUT_CHANGED_MEMBER(zackman_state::input_changed) update_int0(); } -MACHINE_CONFIG_START(zackman_state::zackman) - +void zackman_state::zackman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, zackman_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, zackman_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(zackman_state::plate_w)); + m_maincpu->write_d().set(FUNC(zackman_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(487, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 487-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(487, 1080); + screen.set_visarea(0, 487-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1292,32 +1293,32 @@ INPUT_CHANGED_MEMBER(bpengo_state::input_changed) update_int0(); } -MACHINE_CONFIG_START(bpengo_state::bpengo) - +void bpengo_state::bpengo(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, bpengo_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bpengo_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.5")) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(bpengo_state::plate_w)); + m_maincpu->write_d().set(FUNC(bpengo_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.5"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 759) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 759-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 759); + screen.set_visarea(0, 1920-1, 0, 759-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1416,31 +1417,31 @@ INPUT_CHANGED_MEMBER(bbtime_state::input_changed) update_int0(); } -MACHINE_CONFIG_START(bbtime_state::bbtime) - +void bbtime_state::bbtime(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, bbtime_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bbtime_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(bbtime_state::plate_w)); + m_maincpu->write_d().set(FUNC(bbtime_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(379, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 379-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(379, 1080); + screen.set_visarea(0, 379-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1515,30 +1516,30 @@ static INPUT_PORTS_START( bdoramon ) PORT_CONFSETTING( 0x08, DEF_STR( On ) ) INPUT_PORTS_END -MACHINE_CONFIG_START(bdoramon_state::bdoramon) - +void bdoramon_state::bdoramon(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bdoramon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bdoramon_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bdoramon_state, plate_w)) - MCFG_HMCS40_READ_R_CB(2, IOPORT("IN.3")) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bdoramon_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bdoramon_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.2")) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(bdoramon_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bdoramon_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bdoramon_state::plate_w)); + m_maincpu->read_r<2>().set_ioport("IN.3"); + m_maincpu->write_r<3>().set(FUNC(bdoramon_state::plate_w)); + m_maincpu->write_d().set(FUNC(bdoramon_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.2"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 668) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 668-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 668); + screen.set_visarea(0, 1920-1, 0, 668-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1607,29 +1608,29 @@ static INPUT_PORTS_START( bultrman ) PORT_BIT( 0xff8f, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(bultrman_state::bultrman) - +void bultrman_state::bultrman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 350000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, bultrman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, bultrman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, bultrman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, bultrman_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, bultrman_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.1")) + HD38800(config, m_maincpu, 350000); // approximation + m_maincpu->write_r<0>().set(FUNC(bultrman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(bultrman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(bultrman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(bultrman_state::plate_w)); + m_maincpu->write_d().set(FUNC(bultrman_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.1"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 673) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 673-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 673); + screen.set_visarea(0, 1920-1, 0, 673-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1695,30 +1696,30 @@ static INPUT_PORTS_START( machiman ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY INPUT_PORTS_END -MACHINE_CONFIG_START(machiman_state::machiman) - +void machiman_state::machiman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, machiman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, machiman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, machiman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, machiman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, machiman_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, machiman_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.1")) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(machiman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(machiman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(machiman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(machiman_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(machiman_state::plate_w)); + m_maincpu->write_d().set(FUNC(machiman_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.1"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1534, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 1534-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1534, 1080); + screen.set_visarea(0, 1534-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1842,27 +1843,27 @@ static INPUT_PORTS_START( pairmtch ) PORT_BIT( 0x86bf, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(pairmtch_state::pairmtch) - +void pairmtch_state::pairmtch(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, pairmtch_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, pairmtch_state, plate_w)) - MCFG_HMCS40_READ_R_CB(4, READ8(*this, pairmtch_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, pairmtch_state, sound_w)) - MCFG_HMCS40_READ_R_CB(5, READ8("soundlatch2", generic_latch_8_device, read)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, pairmtch_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, pairmtch_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.2")) - - MCFG_DEVICE_ADD("audiocpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, pairmtch_state, sound2_w)) - MCFG_HMCS40_READ_R_CB(2, READ8("soundlatch", generic_latch_8_device, read)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, pairmtch_state, speaker_w)) - - MCFG_QUANTUM_PERFECT_CPU("maincpu") - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<2>().set(FUNC(pairmtch_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(pairmtch_state::plate_w)); + m_maincpu->read_r<4>().set(FUNC(pairmtch_state::input_r)); + m_maincpu->write_r<5>().set(FUNC(pairmtch_state::sound_w)); + m_maincpu->read_r<5>().set(m_soundlatch2, FUNC(generic_latch_8_device::read)); + m_maincpu->write_r<6>().set(FUNC(pairmtch_state::plate_w)); + m_maincpu->write_d().set(FUNC(pairmtch_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.2"); + + hmcs40_cpu_device &audiocpu(HD38820(config, m_audiocpu, 400000)); // approximation + audiocpu.write_r<2>().set(FUNC(pairmtch_state::sound2_w)); + audiocpu.read_r<2>().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + audiocpu.write_d().set(FUNC(pairmtch_state::speaker_w)); + + config.m_perfect_cpu_quantum = subtag("maincpu"); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_pairmtch); /* sound hardware */ @@ -1871,9 +1872,8 @@ MACHINE_CONFIG_START(pairmtch_state::pairmtch) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1964,29 +1964,29 @@ static INPUT_PORTS_START( alnattck ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Fire") INPUT_PORTS_END -MACHINE_CONFIG_START(alnattck_state::alnattck) - +void alnattck_state::alnattck(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, alnattck_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, alnattck_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, alnattck_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, alnattck_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, alnattck_state, grid_w)) - MCFG_HMCS40_READ_D_CB(READ16(*this, alnattck_state, input_r)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(alnattck_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(alnattck_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(alnattck_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(alnattck_state::plate_w)); + m_maincpu->write_d().set(FUNC(alnattck_state::grid_w)); + m_maincpu->read_d().set(FUNC(alnattck_state::input_r)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 700) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 700-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 700); + screen.set_visarea(0, 1920-1, 0, 700-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2090,33 +2090,33 @@ void cdkong_state::machine_start() save_item(NAME(m_speaker_volume)); } -MACHINE_CONFIG_START(cdkong_state::cdkong) - +void cdkong_state::cdkong(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, cdkong_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, cdkong_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.1")) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(cdkong_state::plate_w)); + m_maincpu->write_d().set(FUNC(cdkong_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.1"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(605, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 605-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(605, 1080); + screen.set_visarea(0, 605-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_TIMER_DRIVER_ADD_PERIODIC("speaker_decay", cdkong_state, speaker_decay_sim, attotime::from_msec(1)) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); + TIMER(config, "speaker_decay").configure_periodic(FUNC(cdkong_state::speaker_decay_sim), attotime::from_msec(1)); +} @@ -2222,28 +2222,28 @@ INPUT_CHANGED_MEMBER(cgalaxn_state::player_switch) prepare_display(); } -MACHINE_CONFIG_START(cgalaxn_state::cgalaxn) - +void cgalaxn_state::cgalaxn(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, cgalaxn_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, cgalaxn_state, grid_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, cgalaxn_state, grid_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, cgalaxn_state, grid_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, cgalaxn_state, plate_w)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(cgalaxn_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(cgalaxn_state::grid_w)); + m_maincpu->write_r<2>().set(FUNC(cgalaxn_state::grid_w)); + m_maincpu->write_r<3>().set(FUNC(cgalaxn_state::grid_w)); + m_maincpu->write_d().set(FUNC(cgalaxn_state::plate_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(526, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 526-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(526, 1080); + screen.set_visarea(0, 526-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2340,31 +2340,31 @@ static INPUT_PORTS_START( cpacman ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) INPUT_PORTS_END -MACHINE_CONFIG_START(cpacman_state::cpacman) - +void cpacman_state::cpacman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, cpacman_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, cpacman_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, cpacman_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(cpacman_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(cpacman_state::plate_w)); + m_maincpu->write_d().set(FUNC(cpacman_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(484, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 484-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(484, 1080); + screen.set_visarea(0, 484-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2456,31 +2456,31 @@ static INPUT_PORTS_START( cmspacmn ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) INPUT_PORTS_END -MACHINE_CONFIG_START(cmspacmn_state::cmspacmn) - +void cmspacmn_state::cmspacmn(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, cmspacmn_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, cmspacmn_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, cmspacmn_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(cmspacmn_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(cmspacmn_state::plate_w)); + m_maincpu->write_d().set(FUNC(cmspacmn_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(481, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 481-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(481, 1080); + screen.set_visarea(0, 481-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2602,25 +2602,24 @@ static INPUT_PORTS_START( sag ) PORT_CONFSETTING( 0x02, "2" ) INPUT_PORTS_END -MACHINE_CONFIG_START(sag_state::sag) - +void sag_state::sag(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 450000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, sag_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, sag_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, sag_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, sag_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, sag_state, grid_w)) - MCFG_HMCS40_READ_D_CB(READ16(*this, sag_state, input_r)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + HD38800(config, m_maincpu, 450000); // approximation + m_maincpu->write_r<0>().set(FUNC(sag_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(sag_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(sag_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(sag_state::plate_w)); + m_maincpu->write_d().set(FUNC(sag_state::grid_w)); + m_maincpu->read_d().set(FUNC(sag_state::input_r)); + + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_sag); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2717,31 +2716,31 @@ static INPUT_PORTS_START( egalaxn2 ) PORT_CONFSETTING( 0x04, "2" ) INPUT_PORTS_END -MACHINE_CONFIG_START(egalaxn2_state::egalaxn2) - +void egalaxn2_state::egalaxn2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(*this, egalaxn2_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, egalaxn2_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set(FUNC(egalaxn2_state::input_r)); + m_maincpu->write_r<1>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(egalaxn2_state::plate_w)); + m_maincpu->write_d().set(FUNC(egalaxn2_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(505, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 505-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(505, 1080); + screen.set_visarea(0, 505-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -2802,14 +2801,14 @@ static INPUT_PORTS_START( epacman2 ) PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END -MACHINE_CONFIG_START(epacman2_state::epacman2) +void epacman2_state::epacman2(machine_config &config) +{ egalaxn2(config); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_SIZE(505, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 505-1, 0, 1080-1) -MACHINE_CONFIG_END + subdevice("screen")->set_size(505, 1080); + subdevice("screen")->set_visarea(0, 505-1, 0, 1080-1); +} @@ -2968,40 +2967,40 @@ void eturtles_state::machine_start() save_item(NAME(m_cop_irq)); } -MACHINE_CONFIG_START(eturtles_state::eturtles) - +void eturtles_state::eturtles(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, eturtles_state, grid_w)) - - MCFG_DEVICE_ADD("audiocpu", COP411, 215000) // approximation - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, eturtles_state, speaker_w)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, eturtles_state, cop_irq_w)) - MCFG_COP400_READ_L_CB(READ8(*this, eturtles_state, cop_latch_r)) - MCFG_COP400_READ_G_CB(READ8(*this, eturtles_state, cop_ack_r)) - - MCFG_QUANTUM_PERFECT_CPU("maincpu") + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_d().set(FUNC(eturtles_state::grid_w)); + + cop411_cpu_device &audiocpu(COP411(config, m_audiocpu, 215000)); // approximation + audiocpu.set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + audiocpu.write_sk().set(FUNC(eturtles_state::speaker_w)); + audiocpu.write_d().set(FUNC(eturtles_state::cop_irq_w)); + audiocpu.read_l().set(FUNC(eturtles_state::cop_latch_r)); + audiocpu.read_g().set(FUNC(eturtles_state::cop_ack_r)); + + config.m_perfect_cpu_quantum = subtag("maincpu"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(484, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 484-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(484, 1080); + screen.set_visarea(0, 484-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3077,39 +3076,39 @@ static INPUT_PORTS_START( estargte ) PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(estargte_state::estargte) - +void estargte_state::estargte(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, eturtles_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, eturtles_state, grid_w)) - - MCFG_DEVICE_ADD("audiocpu", COP411, 190000) // approximation - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, eturtles_state, speaker_w)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, eturtles_state, cop_irq_w)) - MCFG_COP400_READ_L_CB(READ8(*this, estargte_state, cop_data_r)) - - MCFG_QUANTUM_PERFECT_CPU("maincpu") + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(eturtles_state::plate_w)); + m_maincpu->write_d().set(FUNC(eturtles_state::grid_w)); + + cop411_cpu_device &audiocpu(COP411(config, m_audiocpu, 190000)); // approximation + audiocpu.set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed + audiocpu.write_sk().set(FUNC(eturtles_state::speaker_w)); + audiocpu.write_d().set(FUNC(eturtles_state::cop_irq_w)); + audiocpu.read_l().set(FUNC(estargte_state::cop_data_r)); + + config.m_perfect_cpu_quantum = subtag("maincpu"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 854) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 854-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 854); + screen.set_visarea(0, 1920-1, 0, 854-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3202,29 +3201,29 @@ static INPUT_PORTS_START( ghalien ) PORT_CONFSETTING( 0x8000, "Professional" ) INPUT_PORTS_END -MACHINE_CONFIG_START(ghalien_state::ghalien) - +void ghalien_state::ghalien(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, ghalien_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, ghalien_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, ghalien_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, ghalien_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, ghalien_state, grid_w)) - MCFG_HMCS40_READ_D_CB(READ16(*this, ghalien_state, input_r)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(ghalien_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(ghalien_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(ghalien_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(ghalien_state::plate_w)); + m_maincpu->write_d().set(FUNC(ghalien_state::grid_w)); + m_maincpu->read_d().set(FUNC(ghalien_state::input_r)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 699) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 699-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 699); + screen.set_visarea(0, 1920-1, 0, 699-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3328,29 +3327,29 @@ INPUT_CHANGED_MEMBER(gckong_state::input_changed) update_int1(); } -MACHINE_CONFIG_START(gckong_state::gckong) - +void gckong_state::gckong(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, gckong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, gckong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, gckong_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, gckong_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, gckong_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.5")) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(gckong_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(gckong_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(gckong_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(gckong_state::plate_w)); + m_maincpu->write_d().set(FUNC(gckong_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.5"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(506, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 506-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(506, 1080); + screen.set_visarea(0, 506-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3446,31 +3445,31 @@ INPUT_CHANGED_MEMBER(gdigdug_state::input_changed) update_int1(); } -MACHINE_CONFIG_START(gdigdug_state::gdigdug) - +void gdigdug_state::gdigdug(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, gdigdug_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, gdigdug_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(gdigdug_state::plate_w)); + m_maincpu->write_d().set(FUNC(gdigdug_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(476, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 476-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(476, 1080); + screen.set_visarea(0, 476-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3607,31 +3606,31 @@ INPUT_PORTS_END static const s16 mwcbaseb_speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 }; -MACHINE_CONFIG_START(mwcbaseb_state::mwcbaseb) - +void mwcbaseb_state::mwcbaseb(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, mwcbaseb_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, mwcbaseb_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, mwcbaseb_state, plate_w)) - MCFG_HMCS40_READ_R_CB(4, READ8(*this, mwcbaseb_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, mwcbaseb_state, speaker_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, mwcbaseb_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, mwcbaseb_state, grid_w)) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<1>().set(FUNC(mwcbaseb_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(mwcbaseb_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(mwcbaseb_state::plate_w)); + m_maincpu->read_r<4>().set(FUNC(mwcbaseb_state::input_r)); + m_maincpu->write_r<5>().set(FUNC(mwcbaseb_state::speaker_w)); + m_maincpu->write_r<6>().set(FUNC(mwcbaseb_state::plate_w)); + m_maincpu->write_d().set(FUNC(mwcbaseb_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 478) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 478-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 478); + screen.set_visarea(0, 1920-1, 0, 478-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SPEAKER_LEVELS(8, mwcbaseb_speaker_levels) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); + m_speaker->set_levels(8, mwcbaseb_speaker_levels); +} @@ -3694,32 +3693,32 @@ static INPUT_PORTS_START( pbqbert ) PORT_BIT( 0xe1ff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(pbqbert_state::pbqbert) - +void pbqbert_state::pbqbert(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(*this, pbqbert_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, pbqbert_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.0")) + HD38820(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(pbqbert_state::plate_w)); + m_maincpu->write_d().set(FUNC(pbqbert_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.0"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(603, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 603-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(603, 1080); + screen.set_visarea(0, 603-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3818,28 +3817,28 @@ INPUT_CHANGED_MEMBER(kingman_state::input_changed) update_int0(); } -MACHINE_CONFIG_START(kingman_state::kingman) - +void kingman_state::kingman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, kingman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, kingman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, kingman_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, kingman_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, kingman_state, grid_w)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(kingman_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(kingman_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(kingman_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(kingman_state::plate_w)); + m_maincpu->write_d().set(FUNC(kingman_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(374, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 374-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(374, 1080); + screen.set_visarea(0, 374-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -3938,28 +3937,28 @@ INPUT_CHANGED_MEMBER(tmtron_state::input_changed) update_int1(); } -MACHINE_CONFIG_START(tmtron_state::tmtron) - +void tmtron_state::tmtron(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38800, 400000) // approximation - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, tmtron_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, tmtron_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, tmtron_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, tmtron_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, tmtron_state, grid_w)) + HD38800(config, m_maincpu, 400000); // approximation + m_maincpu->write_r<0>().set(FUNC(tmtron_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(tmtron_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(tmtron_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(tmtron_state::plate_w)); + m_maincpu->write_d().set(FUNC(tmtron_state::grid_w)); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(1920, 662) - MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 662-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(1920, 662); + screen.set_visarea(0, 1920-1, 0, 662-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -4031,29 +4030,29 @@ static INPUT_PORTS_START( vinvader ) PORT_BIT( 0xfff5, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -MACHINE_CONFIG_START(vinvader_state::vinvader) - +void vinvader_state::vinvader(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", HD38750, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, IOPORT("IN.0")) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, vinvader_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, vinvader_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, vinvader_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, vinvader_state, grid_w)) - MCFG_HMCS40_READ_D_CB(IOPORT("IN.1")) + HD38750(config, m_maincpu, 400000); // approximation + m_maincpu->read_r<0>().set_ioport("IN.0"); + m_maincpu->write_r<1>().set(FUNC(vinvader_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(vinvader_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(vinvader_state::plate_w)); + m_maincpu->write_d().set(FUNC(vinvader_state::grid_w)); + m_maincpu->read_d().set_ioport("IN.1"); /* video hardware */ - MCFG_SCREEN_SVG_ADD("screen", "svg") - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(233, 1080) - MCFG_SCREEN_VISIBLE_AREA(0, 233-1, 0, 1080-1) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); + screen.set_svg_region("svg"); + screen.set_refresh_hz(50); + screen.set_size(233, 1080); + screen.set_visarea(0, 233-1, 0, 1080-1); + TIMER(config, "display_decay").configure_periodic(FUNC(hh_hmcs40_state::display_decay_tick), attotime::from_msec(1)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp index 7ccf5fdfad5..56cdd2ca1b3 100644 --- a/src/mame/drivers/looping.cpp +++ b/src/mame/drivers/looping.cpp @@ -634,13 +634,13 @@ MACHINE_CONFIG_START(looping_state::looping) m_audiocpu->set_addrmap(AS_PROGRAM, &looping_state::looping_sound_map); m_audiocpu->set_addrmap(AS_IO, &looping_state::looping_sound_io_map); - MCFG_DEVICE_ADD("mcu", COP420, COP_CLOCK) - MCFG_COP400_CONFIG( COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false ) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, looping_state, cop_l_w)) - MCFG_COP400_READ_L_CB(READ8(*this, looping_state, cop_unk_r)) - MCFG_COP400_READ_G_CB(READ8(*this, looping_state, cop_unk_r)) - MCFG_COP400_READ_IN_CB(READ8(*this, looping_state, cop_unk_r)) - MCFG_COP400_READ_SI_CB(READLINE(*this, looping_state, cop_serial_r)) + cop420_cpu_device &cop(COP420(config, "mcu", COP_CLOCK)); + cop.set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); + cop.write_l().set(FUNC(looping_state::cop_l_w)); + cop.read_l().set(FUNC(looping_state::cop_unk_r)); + cop.read_g().set(FUNC(looping_state::cop_unk_r)); + cop.read_in().set(FUNC(looping_state::cop_unk_r)); + cop.read_si().set(FUNC(looping_state::cop_serial_r)); ls259_device &mainlatch(LS259(config, "mainlatch")); // C9 on CPU board // Q0 = A16 diff --git a/src/mame/drivers/newbrain.cpp b/src/mame/drivers/newbrain.cpp index 7cbc246be9c..24516b7d654 100644 --- a/src/mame/drivers/newbrain.cpp +++ b/src/mame/drivers/newbrain.cpp @@ -811,19 +811,19 @@ void newbrain_state::device_timer(emu_timer &timer, device_timer_id id, int para MACHINE_CONFIG_START(newbrain_state::newbrain) // basic system hardware - MCFG_DEVICE_ADD(Z80_TAG, Z80, XTAL(16'000'000)/4) - MCFG_DEVICE_PROGRAM_MAP(newbrain_mreq) - MCFG_DEVICE_IO_MAP(newbrain_iorq) - - MCFG_DEVICE_ADD(COP420_TAG, COP420, XTAL(16'000'000)/4) - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, true) - MCFG_COP400_READ_G_CB(READ8(*this, newbrain_state, cop_g_r)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, newbrain_state, cop_g_w)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, newbrain_state, cop_d_w)) - MCFG_COP400_READ_IN_CB(READ8(*this, newbrain_state, cop_in_r)) - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, newbrain_state, k1_w)) - MCFG_COP400_WRITE_SK_CB(WRITELINE(*this, newbrain_state, k2_w)) - MCFG_COP400_READ_SI_CB(READLINE(*this, newbrain_state, tdi_r)) + Z80(config, m_maincpu, XTAL(16'000'000)/4); + m_maincpu->set_addrmap(AS_PROGRAM, &newbrain_state::newbrain_mreq); + m_maincpu->set_addrmap(AS_IO, &newbrain_state::newbrain_iorq); + + COP420(config, m_cop, XTAL(16'000'000)/4); + m_cop->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, true); + m_cop->read_g().set(FUNC(newbrain_state::cop_g_r)); + m_cop->write_g().set(FUNC(newbrain_state::cop_g_w)); + m_cop->write_d().set(FUNC(newbrain_state::cop_d_w)); + m_cop->read_in().set(FUNC(newbrain_state::cop_in_r)); + m_cop->write_so().set(FUNC(newbrain_state::k1_w)); + m_cop->write_sk().set(FUNC(newbrain_state::k2_w)); + m_cop->read_si().set(FUNC(newbrain_state::tdi_r)); // video hardware newbrain_video(config); @@ -831,11 +831,11 @@ MACHINE_CONFIG_START(newbrain_state::newbrain) // devices MCFG_NEWBRAIN_EXPANSION_SLOT_ADD(NEWBRAIN_EXPANSION_SLOT_TAG, XTAL(16'000'000)/4, newbrain_expansion_cards, "eim") - MCFG_CASSETTE_ADD(CASSETTE_TAG) - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) + CASSETTE(config, m_cassette1); + m_cassette1->set_default_state((cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED)); - MCFG_CASSETTE_ADD(CASSETTE2_TAG) - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) + CASSETTE(config, m_cassette2); + m_cassette2->set_default_state((cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED)); RS232_PORT(config, RS232_V24_TAG, default_rs232_devices, nullptr); RS232_PORT(config, RS232_PRN_TAG, default_rs232_devices, nullptr); @@ -849,30 +849,33 @@ MACHINE_CONFIG_END // MACHINE_CONFIG( newbrain_ad ) //------------------------------------------------- -MACHINE_CONFIG_START(newbrain_state::newbrain_ad) +void newbrain_state::newbrain_ad(machine_config &config) +{ newbrain(config); config.set_default_layout(layout_newbrain); -MACHINE_CONFIG_END +} //------------------------------------------------- // MACHINE_CONFIG( newbrain_a ) //------------------------------------------------- -MACHINE_CONFIG_START(newbrain_state::newbrain_a) +void newbrain_state::newbrain_a(machine_config &config) +{ newbrain(config); config.set_default_layout(layout_newbraina); -MACHINE_CONFIG_END +} //------------------------------------------------- // MACHINE_CONFIG( newbrain_md ) //------------------------------------------------- -MACHINE_CONFIG_START(newbrain_state::newbrain_md) +void newbrain_state::newbrain_md(machine_config &config) +{ newbrain(config); config.set_default_layout(layout_newbrain); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/play_2.cpp b/src/mame/drivers/play_2.cpp index 2b22ec37f48..7b53690b9ca 100644 --- a/src/mame/drivers/play_2.cpp +++ b/src/mame/drivers/play_2.cpp @@ -395,19 +395,20 @@ MACHINE_CONFIG_START(play_2_state::play_2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) MACHINE_CONFIG_END -MACHINE_CONFIG_START(play_2_state::zira) +void play_2_state::zira(machine_config &config) +{ play_2(config); - MCFG_DEVICE_ADD("cop402", COP402, 2_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(zira_sound_map) - MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, play_2_state, sound_d_w)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, play_2_state, sound_g_w)) - MCFG_COP400_READ_L_CB(READ8(*this, play_2_state, psg_r)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, play_2_state, psg_w)) - MCFG_COP400_READ_IN_CB(READ8(*this, play_2_state, sound_in_r)) + cop402_cpu_device &cop402(COP402(config, "cop402", 2_MHz_XTAL)); + cop402.set_addrmap(AS_PROGRAM, &play_2_state::zira_sound_map); + cop402.set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); + cop402.write_d().set(FUNC(play_2_state::sound_d_w)); + cop402.write_g().set(FUNC(play_2_state::sound_g_w)); + cop402.read_l().set(FUNC(play_2_state::psg_r)); + cop402.write_l().set(FUNC(play_2_state::psg_w)); + cop402.read_in().set(FUNC(play_2_state::sound_in_r)); AY8910(config, m_aysnd1, 2_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.00); -MACHINE_CONFIG_END +} void play_2_state::init_zira() { diff --git a/src/mame/drivers/test_t400.cpp b/src/mame/drivers/test_t400.cpp index 6f560c84d86..cdefb163259 100644 --- a/src/mame/drivers/test_t400.cpp +++ b/src/mame/drivers/test_t400.cpp @@ -23,7 +23,7 @@ public: private: DECLARE_WRITE8_MEMBER( port_l_w ); - required_device m_maincpu; + required_device m_maincpu; }; WRITE8_MEMBER( t400_test_suite_state::port_l_w ) @@ -31,17 +31,19 @@ WRITE8_MEMBER( t400_test_suite_state::port_l_w ) // printf("L: %u\n", data); } -MACHINE_CONFIG_START(t400_test_suite_state::test_t410) - MCFG_DEVICE_ADD("maincpu", COP410, 1000000) - MCFG_COP400_CONFIG( COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false ) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, t400_test_suite_state, port_l_w)) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(t400_test_suite_state::test_t420) - MCFG_DEVICE_ADD("maincpu", COP420, 1000000) - MCFG_COP400_CONFIG( COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, true ) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, t400_test_suite_state, port_l_w)) -MACHINE_CONFIG_END +void t400_test_suite_state::test_t410(machine_config &config) +{ + COP410(config, m_maincpu, 1000000); + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); + m_maincpu->write_l().set(FUNC(t400_test_suite_state::port_l_w)); +} + +void t400_test_suite_state::test_t420(machine_config &config) +{ + COP420(config, m_maincpu, 1000000); + m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, true); + m_maincpu->write_l().set(FUNC(t400_test_suite_state::port_l_w)); +} ROM_START( test410 ) ROM_REGION( 0x200, "maincpu", 0 ) diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp index 8f8c03be365..c0acd9ecbc8 100644 --- a/src/mame/drivers/thayers.cpp +++ b/src/mame/drivers/thayers.cpp @@ -798,39 +798,42 @@ void thayers_state::machine_reset() /* Machine Driver */ -MACHINE_CONFIG_START(thayers_state::thayers) - +void thayers_state::thayers(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(4'000'000)) - MCFG_DEVICE_PROGRAM_MAP(thayers_map) - MCFG_DEVICE_IO_MAP(thayers_io_map) - - MCFG_DEVICE_ADD("mcu", COP421, XTAL(4'000'000)/2) // COP421L-PCA/N - MCFG_COP400_CONFIG( COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false ) - MCFG_COP400_READ_L_CB(READ8(*this, thayers_state, cop_l_r)) - MCFG_COP400_WRITE_L_CB(WRITE8(*this, thayers_state, cop_l_w)) - MCFG_COP400_READ_G_CB(READ8(*this, thayers_state, cop_g_r)) - MCFG_COP400_WRITE_G_CB(WRITE8(*this, thayers_state, cop_g_w)) - MCFG_COP400_WRITE_D_CB(WRITE8(*this, thayers_state, cop_d_w)) - MCFG_COP400_READ_SI_CB(READLINE(*this, thayers_state, kbdata_r)) - MCFG_COP400_WRITE_SO_CB(WRITELINE(*this, thayers_state, kbclk_w)) - - MCFG_LASERDISC_PR7820_ADD("laserdisc") + Z80(config, m_maincpu, XTAL(4'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &thayers_state::thayers_map); + m_maincpu->set_addrmap(AS_IO, &thayers_state::thayers_io_map); + + cop421_cpu_device &mcu(COP421(config, "mcu", XTAL(4'000'000)/2)); // COP421L-PCA/N + mcu.set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); + mcu.read_l().set(FUNC(thayers_state::cop_l_r)); + mcu.write_l().set(FUNC(thayers_state::cop_l_w)); + mcu.read_g().set(FUNC(thayers_state::cop_g_r)); + mcu.write_g().set(FUNC(thayers_state::cop_g_w)); + mcu.write_d().set(FUNC(thayers_state::cop_d_w)); + mcu.read_si().set(FUNC(thayers_state::kbdata_r)); + mcu.write_so().set(FUNC(thayers_state::kbclk_w)); /* video hardware */ - MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") + PIONEER_PR7820(config, m_pr7820, 0); + m_pr7820->set_screen("screen"); - MCFG_PALETTE_ADD("palette", 256) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_SELF_RENDER); + screen.set_raw(XTAL(14'318'181)*2, 910, 0, 704, 525, 44, 524); + screen.set_screen_update("laserdisc", FUNC(laserdisc_device::screen_update)); + + PALETTE(config, "palette", 256); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); // SSI 263 @ 2MHz - MCFG_DEVICE_MODIFY("laserdisc") - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + m_pr7820->add_route(0, "lspeaker", 1.0); + m_pr7820->add_route(1, "rspeaker", 1.0); +} /* ROMs */ diff --git a/src/mame/includes/advision.h b/src/mame/includes/advision.h index d98595643d5..d18614577ec 100644 --- a/src/mame/includes/advision.h +++ b/src/mame/includes/advision.h @@ -12,6 +12,7 @@ #include "bus/generic/slot.h" #include "bus/generic/carts.h" +#include "cpu/cop400/cop400.h" #include "cpu/mcs48/mcs48.h" #include "sound/dac.h" #include "emupal.h" @@ -35,7 +36,7 @@ public: { } required_device m_maincpu; - required_device m_soundcpu; + required_device m_soundcpu; required_device m_dac; required_device m_cart; required_memory_bank m_bank1; diff --git a/src/mame/machine/alpha8201.cpp b/src/mame/machine/alpha8201.cpp index 53cc7fec7b7..5e517ed4596 100644 --- a/src/mame/machine/alpha8201.cpp +++ b/src/mame/machine/alpha8201.cpp @@ -272,7 +272,6 @@ Notes: ***************************************************************************/ #include "emu.h" -#include "cpu/hmcs40/hmcs40.h" #include "alpha8201.h" /**************************************************************************/ @@ -316,17 +315,17 @@ void alpha_8201_device::device_start() // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(alpha_8201_device::device_add_mconfig) - - MCFG_DEVICE_ADD("mcu", HD44801, DERIVED_CLOCK(1,1)) // 8H - MCFG_HMCS40_READ_R_CB(0, READ8(*this, alpha_8201_device, mcu_data_r)) - MCFG_HMCS40_READ_R_CB(1, READ8(*this, alpha_8201_device, mcu_data_r)) - MCFG_HMCS40_WRITE_R_CB(0, WRITE8(*this, alpha_8201_device, mcu_data_w)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(*this, alpha_8201_device, mcu_data_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(*this, alpha_8201_device, mcu_data_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(*this, alpha_8201_device, mcu_data_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(*this, alpha_8201_device, mcu_d_w)) -MACHINE_CONFIG_END +void alpha_8201_device::device_add_mconfig(machine_config &config) +{ + HD44801(config, m_mcu, DERIVED_CLOCK(1,1)); // 8H + m_mcu->read_r<0>().set(FUNC(alpha_8201_device::mcu_data_r)); + m_mcu->read_r<1>().set(FUNC(alpha_8201_device::mcu_data_r)); + m_mcu->write_r<0>().set(FUNC(alpha_8201_device::mcu_data_w)); + m_mcu->write_r<1>().set(FUNC(alpha_8201_device::mcu_data_w)); + m_mcu->write_r<2>().set(FUNC(alpha_8201_device::mcu_data_w)); + m_mcu->write_r<3>().set(FUNC(alpha_8201_device::mcu_data_w)); + m_mcu->write_d().set(FUNC(alpha_8201_device::mcu_d_w)); +} //------------------------------------------------- // device_reset - device-specific reset diff --git a/src/mame/machine/alpha8201.h b/src/mame/machine/alpha8201.h index 76a5f69c4d0..b7d446cec9c 100644 --- a/src/mame/machine/alpha8201.h +++ b/src/mame/machine/alpha8201.h @@ -9,6 +9,7 @@ #ifndef MAME_MACHINE_ALPHA8201_H #define MAME_MACHINE_ALPHA8201_H +#include "cpu/hmcs40/hmcs40.h" class alpha_8201_device : public device_t { @@ -29,7 +30,7 @@ protected: virtual void device_add_mconfig(machine_config &config) override; private: // devices/pointers - required_device m_mcu; + required_device m_mcu; // internal state int m_bus; // shared RAM bus direction -- cgit v1.2.3