From 61a555c34750cab2c7dd2c8fd5bab1ede1ee175e Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Thu, 27 Dec 2018 00:17:16 +0100 Subject: [PATCH] -devices/machine/msm6253: Removed MCFG macros and added devcb3 support, nw -devices/machine/timer: Added device support to configure_scanline, nw -devices/sound/2612intf: Removed MCFG macros. -drivers/cegac2, segajw, segam1, segas18, segas24, segas32, segaufo, seta, shangha3: Removed MACHINE_CONFIG, mw --- src/devices/machine/msm6253.cpp | 33 +- src/devices/machine/msm6253.h | 52 +- src/devices/machine/timer.h | 5 + src/devices/sound/2612intf.h | 3 - src/devices/video/315_5124.h | 11 +- src/devices/video/315_5313.h | 14 +- src/mame/drivers/segac2.cpp | 53 +- src/mame/drivers/segajw.cpp | 44 +- src/mame/drivers/segam1.cpp | 57 +- src/mame/drivers/segas18.cpp | 114 +-- src/mame/drivers/segas24.cpp | 60 +- src/mame/drivers/segas32.cpp | 218 ++-- src/mame/drivers/segaufo.cpp | 18 +- src/mame/drivers/segaybd.cpp | 8 +- src/mame/drivers/seta.cpp | 1681 ++++++++++++++++--------------- src/mame/drivers/shangha3.cpp | 155 ++- src/mame/includes/segas32.h | 4 +- src/mame/includes/seta.h | 2 +- src/mame/machine/model1io.cpp | 8 +- src/mame/machine/model1io2.cpp | 8 +- src/mame/video/seta.cpp | 4 +- 21 files changed, 1249 insertions(+), 1303 deletions(-) diff --git a/src/devices/machine/msm6253.cpp b/src/devices/machine/msm6253.cpp index 96722247d08..b96eeecf9e5 100644 --- a/src/devices/machine/msm6253.cpp +++ b/src/devices/machine/msm6253.cpp @@ -25,13 +25,9 @@ DEFINE_DEVICE_TYPE(MSM6253, msm6253_device, "msm6253", "OKI MSM6253 A/D Converte msm6253_device::msm6253_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MSM6253, tag, owner, clock) - , m_analog_ports(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG}) + , m_analog_input_cb{{*this}, {*this}, {*this}, {*this}} , m_shift_register(0) { - m_analog_input_cb[0] = port_read_delegate(FUNC(msm6253_device::port_read<0>), this); - m_analog_input_cb[1] = port_read_delegate(FUNC(msm6253_device::port_read<1>), this); - m_analog_input_cb[2] = port_read_delegate(FUNC(msm6253_device::port_read<2>), this); - m_analog_input_cb[3] = port_read_delegate(FUNC(msm6253_device::port_read<3>), this); } //------------------------------------------------- @@ -41,37 +37,12 @@ msm6253_device::msm6253_device(const machine_config &mconfig, const char *tag, d void msm6253_device::device_start() { for (int port = 0; port < 4; port++) - { - // resolve each callback - m_analog_input_cb[port].bind_relative_to(*owner()); - - // ensure that any configured ports truly are analog - if (m_analog_ports[port].found()) - { - for (ioport_field &field : m_analog_ports[port]->fields()) - if (!field.is_analog() && field.type() != IPT_UNKNOWN && field.type() != IPT_UNUSED) - throw emu_fatalerror("Port %s is not an analog port\n", m_analog_ports[port]->tag()); - } - } + m_analog_input_cb[port].resolve_safe(0); // save our state save_item(NAME(m_shift_register)); } -//------------------------------------------------- -// port_read - helper to read configured ports -//------------------------------------------------- - -template -ioport_value msm6253_device::port_read() -{ - if (m_analog_ports[port].found()) - return m_analog_ports[port]->read(); - - logerror("%s: Read from unassigned IN%d\n", machine().describe_context(), port); - return 0xff; -} - //------------------------------------------------- // address_w - write from address bus to select // one of four internal latches diff --git a/src/devices/machine/msm6253.h b/src/devices/machine/msm6253.h index 25a17585221..af57f6e7640 100644 --- a/src/devices/machine/msm6253.h +++ b/src/devices/machine/msm6253.h @@ -23,38 +23,6 @@ #pragma once -//************************************************************************** -// CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_MSM6253_IN0_ANALOG_PORT(_input) \ - downcast(*device).set_input_tag<0>(_input); -#define MCFG_MSM6253_IN1_ANALOG_PORT(_input) \ - downcast(*device).set_input_tag<1>(_input); -#define MCFG_MSM6253_IN2_ANALOG_PORT(_input) \ - downcast(*device).set_input_tag<2>(_input); -#define MCFG_MSM6253_IN3_ANALOG_PORT(_input) \ - downcast(*device).set_input_tag<3>(_input); - -#define MCFG_MSM6253_IN0_ANALOG_READ(_class, _method) \ - downcast(*device).set_input_cb<0>(&_class::_method, #_class "::" #_method, this); -#define MCFG_MSM6253_IN1_ANALOG_READ(_class, _method) \ - downcast(*device).set_input_cb<1>(&_class::_method, #_class "::" #_method, this); -#define MCFG_MSM6253_IN2_ANALOG_READ(_class, _method) \ - downcast(*device).set_input_cb<2>(&_class::_method, #_class "::" #_method, this); -#define MCFG_MSM6253_IN3_ANALOG_READ(_class, _method) \ - downcast(*device).set_input_cb<3>(&_class::_method, #_class "::" #_method, this); - -#define MCFG_MSM6253_IN0_ANALOG_DEVREAD(_tag, _class, _method) \ - downcast(*device).set_input_cb<0>(&_class::_method, #_class "::" #_method, _tag); -#define MCFG_MSM6253_IN1_ANALOG_DEVREAD(_tag, _class, _method) \ - downcast(*device).set_input_cb<1>(&_class::_method, #_class "::" #_method, _tag); -#define MCFG_MSM6253_IN2_ANALOG_DEVREAD(_tag, _class, _method) \ - downcast(*device).set_input_cb<2>(&_class::_method, #_class "::" #_method, _tag); -#define MCFG_MSM6253_IN3_ANALOG_DEVREAD(_tag, _class, _method) \ - downcast(*device).set_input_cb<3>(&_class::_method, #_class "::" #_method, _tag); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -64,23 +32,11 @@ class msm6253_device : public device_t { public: - typedef device_delegate port_read_delegate; - // construction/destruction msm6253_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration - template void set_input_tag(const char *tag) { m_analog_ports[P].set_tag(tag); } - template void set_input_cb(T &&... args) { m_analog_input_cb[P] = port_read_delegate(std::forward(args)...); } - template void set_input_cb(port_read_delegate callback) { m_analog_input_cb[P] = callback; } - template void set_input_cb(const char *devname, ioport_value (FunctionClass::*callback)(), const char *name) - { - set_input_cb

(port_read_delegate(callback, name, devname, static_cast(nullptr))); - } - template void set_input_cb(ioport_value (FunctionClass::*callback)(), const char *name) - { - set_input_cb

(port_read_delegate(callback, name, nullptr, static_cast(nullptr))); - } + template auto input() { return m_analog_input_cb[Port].bind(); } // write handlers WRITE8_MEMBER(address_w); @@ -96,12 +52,8 @@ protected: virtual void device_start() override; private: - // helpers - template ioport_value port_read(); - // input configuration - optional_ioport_array<4> m_analog_ports; - port_read_delegate m_analog_input_cb[4]; + devcb_read8 m_analog_input_cb[4]; // private data u8 m_shift_register; diff --git a/src/devices/machine/timer.h b/src/devices/machine/timer.h index 022647061ca..e27c8a8cc53 100644 --- a/src/devices/machine/timer.h +++ b/src/devices/machine/timer.h @@ -111,6 +111,11 @@ public: { configure_scanline(expired_delegate(callback, name, nullptr, static_cast(nullptr)), screen, first_vpos, increment); } + template void configure_scanline(const char *devname, void (FunctionClass::*callback)(timer_device &, void *, s32), + const char *name, const char *screen, int first_vpos, int increment) + { + configure_scanline(expired_delegate(callback, name, devname, static_cast(nullptr)), screen, first_vpos, increment); + } template void set_callback(Object &&cb) { m_callback = std::forward(cb); } template void set_callback(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name) diff --git a/src/devices/sound/2612intf.h b/src/devices/sound/2612intf.h index 63f6ee22ec0..5dc31593685 100644 --- a/src/devices/sound/2612intf.h +++ b/src/devices/sound/2612intf.h @@ -6,9 +6,6 @@ #pragma once -#define MCFG_YM2612_IRQ_HANDLER(cb) \ - downcast(*device).set_irq_handler((DEVCB_##cb)); - class ym2612_device : public device_t, public device_sound_interface { public: diff --git a/src/devices/video/315_5124.h b/src/devices/video/315_5124.h index ff2a884341d..21891c1efef 100644 --- a/src/devices/video/315_5124.h +++ b/src/devices/video/315_5124.h @@ -54,11 +54,14 @@ public: sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); sega315_5124_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, uint8_t reg_num_mask, int max_sprite_zoom_hcount, int max_sprite_zoom_vcount, const uint8_t *line_timing); - void set_signal_type(bool is_pal) { m_is_pal = is_pal; } + void set_is_pal(bool is_pal) { m_is_pal = is_pal; } template devcb_base &set_int_callback(Object &&cb) { return m_int_cb.set_callback(std::forward(cb)); } template devcb_base &set_csync_callback(Object &&cb) { return m_csync_cb.set_callback(std::forward(cb)); } template devcb_base &set_pause_callback(Object &&cb) { return m_pause_cb.set_callback(std::forward(cb)); } + auto irq() { return m_int_cb.bind(); } + auto csync() { return m_csync_cb.bind(); } + auto pause() { return m_pause_cb.bind(); } DECLARE_READ8_MEMBER( data_read ); DECLARE_WRITE8_MEMBER( data_write ); @@ -256,7 +259,7 @@ protected: #define MCFG_SEGA315_5124_SET_SCREEN MCFG_VIDEO_SET_SCREEN #define MCFG_SEGA315_5124_IS_PAL(_bool) \ - downcast(*device).set_signal_type(_bool); + downcast(*device).set_is_pal(_bool); #define MCFG_SEGA315_5124_INT_CB(_devcb) \ downcast(*device).set_int_callback(DEVCB_##_devcb); @@ -271,7 +274,7 @@ protected: #define MCFG_SEGA315_5246_SET_SCREEN MCFG_VIDEO_SET_SCREEN #define MCFG_SEGA315_5246_IS_PAL(_bool) \ - downcast(*device).set_signal_type(_bool); + downcast(*device).set_is_pal(_bool); #define MCFG_SEGA315_5246_INT_CB(_devcb) \ downcast(*device).set_int_callback(DEVCB_##_devcb); @@ -286,7 +289,7 @@ protected: #define MCFG_SEGA315_5377_SET_SCREEN MCFG_VIDEO_SET_SCREEN #define MCFG_SEGA315_5377_IS_PAL(_bool) \ - downcast(*device).set_signal_type(_bool); + downcast(*device).set_is_pal(_bool); #define MCFG_SEGA315_5377_INT_CB(_devcb) \ downcast(*device).set_int_callback(DEVCB_##_devcb); diff --git a/src/devices/video/315_5313.h b/src/devices/video/315_5313.h index a52e85d7d8e..f2aae550f8b 100644 --- a/src/devices/video/315_5313.h +++ b/src/devices/video/315_5313.h @@ -13,7 +13,7 @@ #define MCFG_SEGA315_5313_IS_PAL(_bool) \ - downcast(*device).set_signal_type(_bool); + downcast(*device).set_is_pal(_bool); #define MCFG_SEGA315_5313_INT_CB(_devcb) \ downcast(*device).set_int_callback(DEVCB_##_devcb); @@ -34,10 +34,10 @@ downcast(*device).set_alt_timing(_data); #define MCFG_SEGA315_5313_PAL_WRITE_BASE(_data) \ - downcast(*device).set_palwrite_base(_data); + downcast(*device).set_pal_write_base(_data); #define MCFG_SEGA315_5313_PALETTE(_palette_tag) \ - downcast(*device).set_palette_tag(_palette_tag); + downcast(*device).set_palette(_palette_tag); // Temporary solution while 32x VDP mixing and scanline interrupting is moved outside MD VDP @@ -70,9 +70,13 @@ public: template devcb_base &set_sndirqline_callback(Object &&cb) { return m_sndirqline_callback.set_callback(std::forward(cb)); } template devcb_base &set_lv6irqline_callback(Object &&cb) { return m_lv6irqline_callback.set_callback(std::forward(cb)); } template devcb_base &set_lv4irqline_callback(Object &&cb) { return m_lv4irqline_callback.set_callback(std::forward(cb)); } + auto snd_irq() { return m_sndirqline_callback.bind(); } + auto lv6_irq() { return m_lv6irqline_callback.bind(); } + auto lv4_irq() { return m_lv4irqline_callback.bind(); } + void set_alt_timing(int use_alt_timing) { m_use_alt_timing = use_alt_timing; } - void set_palwrite_base(int palwrite_base) { m_palwrite_base = palwrite_base; } - template void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward(tag)); } + void set_pal_write_base(int palwrite_base) { m_palwrite_base = palwrite_base; } + template void set_palette(T &&tag) { m_palette.set_tag(std::forward(tag)); } template void set_md_32x_scanline(Object &&cb) { m_32x_scanline_func = std::forward(cb); } template void set_md_32x_interrupt(Object &&cb) { m_32x_interrupt_func = std::forward(cb); } diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp index 5da9d8f151a..ecbff2aae66 100644 --- a/src/mame/drivers/segac2.cpp +++ b/src/mame/drivers/segac2.cpp @@ -563,7 +563,7 @@ WRITE8_MEMBER(segac2_state::prot_w) m_sp_palbase = new_sp_palbase; m_bg_palbase = new_bg_palbase; recompute_palette_tables(); - if (LOG_PALETTE) logerror("Set palbank: %d/%d (scan=%d)\n", m_bg_palbase, m_sp_palbase, m_screen->vpos()); + if (LOG_PALETTE && m_screen) logerror("Set palbank: %d/%d (scan=%d)\n", m_bg_palbase, m_sp_palbase, m_screen->vpos()); } } @@ -1542,15 +1542,16 @@ WRITE_LINE_MEMBER(segac2_state::vdp_lv4irqline_callback_c2) } -MACHINE_CONFIG_START(segac2_state::segac) - +void segac2_state::segac(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XL2_CLOCK/6) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(md_base_state,genesis_int_callback) + M68000(config, m_maincpu, XL2_CLOCK/6); + m_maincpu->set_addrmap(AS_PROGRAM, &segac2_state::main_map); + m_maincpu->set_irq_acknowledge_callback(FUNC(md_base_state::genesis_int_callback)); MCFG_MACHINE_START_OVERRIDE(segac2_state,segac2) MCFG_MACHINE_RESET_OVERRIDE(segac2_state,segac2) + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // borencha requires 0xff fill or there is no sound (it lacks some of the init code of the borench set) sega_315_5296_device &io(SEGA_315_5296(config, "io", XL2_CLOCK/6)); // clock divider guessed @@ -1564,36 +1565,36 @@ MACHINE_CONFIG_START(segac2_state::segac) io.out_ph_callback().set(FUNC(segac2_state::io_porth_w)); /* video hardware */ - MCFG_DEVICE_ADD("gen_vdp", SEGA315_5313, XL2_CLOCK, "maincpu") - MCFG_SEGA315_5313_IS_PAL(false) - MCFG_SEGA315_5313_SND_IRQ_CALLBACK(WRITELINE(*this, segac2_state, vdp_sndirqline_callback_c2)); - MCFG_SEGA315_5313_LV6_IRQ_CALLBACK(WRITELINE(*this, segac2_state, vdp_lv6irqline_callback_c2)); - MCFG_SEGA315_5313_LV4_IRQ_CALLBACK(WRITELINE(*this, segac2_state, vdp_lv4irqline_callback_c2)); - MCFG_SEGA315_5313_ALT_TIMING(1); - MCFG_VIDEO_SET_SCREEN("megadriv") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + SEGA315_5313(config, m_vdp, XL2_CLOCK, m_maincpu); + m_vdp->set_is_pal(false); + m_vdp->snd_irq().set(FUNC(segac2_state::vdp_sndirqline_callback_c2)); + m_vdp->lv6_irq().set(FUNC(segac2_state::vdp_lv6irqline_callback_c2)); + m_vdp->lv4_irq().set(FUNC(segac2_state::vdp_lv4irqline_callback_c2)); + m_vdp->set_alt_timing(1); + m_vdp->set_screen("megadriv"); + m_vdp->add_route(ALL_OUTPUTS, "mono", 0.5); - MCFG_TIMER_DEVICE_ADD_SCANLINE("scantimer", "gen_vdp", sega315_5313_device, megadriv_scanline_timer_callback_alt_timing, "megadriv", 0, 1) + TIMER(config, "scantimer").configure_scanline("gen_vdp", FUNC(sega315_5313_device::megadriv_scanline_timer_callback_alt_timing), "megadriv", 0, 1); - MCFG_SCREEN_ADD("megadriv", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 262) - MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(segac2_state, screen_update_segac2_new) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, segac2_state, screen_vblank_megadriv)) + screen_device &screen(SCREEN(config, "megadriv", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(512, 262); + screen.set_visarea(0, 32*8-1, 0, 28*8-1); + screen.set_screen_update(FUNC(segac2_state::screen_update_segac2_new)); + screen.screen_vblank().set(FUNC(segac2_state::screen_vblank_megadriv)); - MCFG_PALETTE_ADD("palette", 2048*3) + PALETTE(config, m_palette, 2048*3); MCFG_VIDEO_START_OVERRIDE(segac2_state,segac2_new) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM3438, XL2_CLOCK/7) - MCFG_YM2612_IRQ_HANDLER(WRITELINE(*this, segac2_state, segac2_irq2_interrupt)) - MCFG_SOUND_ROUTE(0, "mono", 0.50) + ym3438_device &ymsnd(YM3438(config, "ymsnd", XL2_CLOCK/7)); + ymsnd.irq_handler().set(FUNC(segac2_state::segac2_irq2_interrupt)); + ymsnd.add_route(0, "mono", 0.50); /* right channel not connected */ -MACHINE_CONFIG_END +} void segac2_state::segac2(machine_config &config) diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp index e581a2531fe..a56672dcd86 100644 --- a/src/mame/drivers/segajw.cpp +++ b/src/mame/drivers/segajw.cpp @@ -370,17 +370,18 @@ void segajw_state::ramdac_map(address_map &map) map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); } -MACHINE_CONFIG_START(segajw_state::segajw) +void segajw_state::segajw(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",M68000,8000000) // unknown clock - MCFG_DEVICE_PROGRAM_MAP(segajw_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segajw_state, irq4_line_hold) + M68000(config, m_maincpu, 8000000); // unknown clock + m_maincpu->set_addrmap(AS_PROGRAM, &segajw_state::segajw_map); + m_maincpu->set_vblank_int("screen", FUNC(segajw_state::irq4_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) // unknown clock - MCFG_DEVICE_PROGRAM_MAP(segajw_audiocpu_map) - MCFG_DEVICE_IO_MAP(segajw_audiocpu_io_map) + Z80(config, m_audiocpu, 4000000); // unknown clock + m_audiocpu->set_addrmap(AS_PROGRAM, &segajw_state::segajw_audiocpu_map); + m_audiocpu->set_addrmap(AS_IO, &segajw_state::segajw_audiocpu_io_map); - MCFG_QUANTUM_TIME(attotime::from_hz(2000)) + config.m_minimum_quantum = attotime::from_hz(2000); NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); @@ -399,19 +400,20 @@ MACHINE_CONFIG_START(segajw_state::segajw) io1c.out_pg_callback().set(FUNC(segajw_state::coinlockout_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_UPDATE_DEVICE("hd63484", hd63484_device, update_screen) - MCFG_SCREEN_SIZE(720, 480) - MCFG_SCREEN_VISIBLE_AREA(0, 720-1, 0, 448-1) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_screen_update("hd63484", FUNC(hd63484_device::update_screen)); + screen.set_size(720, 480); + screen.set_visarea(0, 720-1, 0, 448-1); + screen.set_palette("palette"); - MCFG_PALETTE_ADD("palette", 16) + PALETTE(config, "palette", 16); ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette")); ramdac.set_addrmap(0, &segajw_state::ramdac_map); - MCFG_HD63484_ADD("hd63484", 8000000, segajw_hd63484_map) // unknown clock + hd63484_device &hd63484(HD63484(config, "hd63484", 8000000)); + hd63484.set_addrmap(0, &segajw_state::segajw_hd63484_map); // unknown clock /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -421,10 +423,10 @@ MACHINE_CONFIG_START(segajw_state::segajw) GENERIC_LATCH_8(config, "soundlatch2"); - MCFG_DEVICE_ADD("ymsnd", YM3438, 8000000) // unknown clock - MCFG_YM2612_IRQ_HANDLER(INPUTLINE("maincpu", 5)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + ym3438_device &ymsnd(YM3438(config, "ymsnd", 8000000)); // unknown clock + ymsnd.irq_handler().set_inputline("maincpu", 5); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); +} /*************************************************************************** diff --git a/src/mame/drivers/segam1.cpp b/src/mame/drivers/segam1.cpp index 7a764e05996..4820baf7263 100644 --- a/src/mame/drivers/segam1.cpp +++ b/src/mame/drivers/segam1.cpp @@ -53,6 +53,8 @@ public: segam1_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_m1comm(*this, "m1comm") , m_screen(*this, "screen") , m_palette(*this, "palette") , m_paletteram(*this, "paletteram") @@ -73,6 +75,8 @@ private: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; + required_device m_audiocpu; + required_device m_m1comm; required_device m_screen; required_device m_palette; required_shared_ptr m_paletteram; @@ -348,18 +352,18 @@ INPUT_PORTS_END -MACHINE_CONFIG_START(segam1_state::segam1) +void segam1_state::segam1(machine_config &config) +{ + M68000(config, m_maincpu, XTAL(20'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &segam1_state::segam1_map); + m_maincpu->set_vblank_int("screen", FUNC(segam1_state::irq4_line_hold)); - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(20'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(segam1_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segam1_state, irq4_line_hold) + Z80(config, m_audiocpu, 4000000); // unknown clock + m_audiocpu->set_addrmap(AS_PROGRAM, &segam1_state::segam1_sound_map); + m_audiocpu->set_addrmap(AS_IO, &segam1_state::segam1_sound_io_map); - MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) // unknown clock - MCFG_DEVICE_PROGRAM_MAP(segam1_sound_map) - MCFG_DEVICE_IO_MAP(segam1_sound_io_map) - - MCFG_DEVICE_ADD("m1comm", Z80, 4000000) // unknown clock - MCFG_DEVICE_PROGRAM_MAP(segam1_comms_map) + Z80(config, m_m1comm, 4000000); // unknown clock + m_m1comm->set_addrmap(AS_PROGRAM, &segam1_state::segam1_comms_map); sega_315_5296_device &io1(SEGA_315_5296(config, "io1", 0)); // unknown clock io1.in_pa_callback().set_ioport("INA"); @@ -372,7 +376,7 @@ MACHINE_CONFIG_START(segam1_state::segam1) sega_315_5296_device &io2(SEGA_315_5296(config, "io2", 0)); // unknown clock io2.in_pg_callback().set_ioport("ING"); - MCFG_DEVICE_ADD("uart", I8251, 4000000) // unknown clock + I8251(config, "uart", 4000000); // unknown clock mb8421_device &dpram(MB8421(config, "dpram")); dpram.intl_callback().set_inputline("m1comm", 0); @@ -380,32 +384,31 @@ MACHINE_CONFIG_START(segam1_state::segam1) S24TILE(config, m_tile, 0, 0x3fff).set_palette(m_palette); S24MIXER(config, m_mixer, 0); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) - MCFG_SCREEN_RAW_PARAMS(16000000, 656, 0, 496, 424, 0, 384) // copied from segas24.cpp; may not be accurate - MCFG_SCREEN_UPDATE_DRIVER(segam1_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + m_screen->set_raw(16000000, 656, 0, 496, 424, 0, 384); // copied from segas24.cpp; may not be accurate + m_screen->set_screen_update(FUNC(segam1_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 8192*2) + PALETTE(config, m_palette, 8192*2); // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline("audiocpu", INPUT_LINE_NMI); - MCFG_DEVICE_ADD("ymsnd", YM3438, 8000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) - //MCFG_YM2612_IRQ_HANDLER(WRITELINE(*this, segam1_state, ym3438_irq_handler)) -MACHINE_CONFIG_END + YM3438(config, m_ymsnd, 8000000); + m_ymsnd->add_route(ALL_OUTPUTS, "mono", 0.40); + //m_ymsnd->irq_handler().set(FUNC(segam1_state::ym3438_irq_handler)); +} -MACHINE_CONFIG_START(segam1_state::unkm1) +void segam1_state::unkm1(machine_config &config) +{ segam1(config); - MCFG_DEVICE_MODIFY("audiocpu") - MCFG_DEVICE_PROGRAM_MAP(unkm1_sound_map) + m_audiocpu->set_addrmap(AS_PROGRAM, &segam1_state::unkm1_sound_map); - MCFG_DEVICE_MODIFY("m1comm") - MCFG_DEVICE_DISABLE() // not dumped yet -MACHINE_CONFIG_END + m_m1comm->set_disable(); // not dumped yet +} ROM_START( bingpty ) // 1994/05/01 string diff --git a/src/mame/drivers/segas18.cpp b/src/mame/drivers/segas18.cpp index 1c160bd3e47..24684a8281c 100644 --- a/src/mame/drivers/segas18.cpp +++ b/src/mame/drivers/segas18.cpp @@ -1307,18 +1307,18 @@ WRITE_LINE_MEMBER(segas18_state::vdp_lv4irqline_callback_s18) * *************************************/ -MACHINE_CONFIG_START(segas18_state::system18) - +void segas18_state::system18(machine_config &config) +{ // basic machine hardware - MCFG_DEVICE_ADD("maincpu", M68000, 10000000) - MCFG_DEVICE_PROGRAM_MAP(system18_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas18_state, irq4_line_hold) + M68000(config, m_maincpu, 10000000); + m_maincpu->set_addrmap(AS_PROGRAM, &segas18_state::system18_map); + m_maincpu->set_vblank_int("screen", FUNC(segas18_state::irq4_line_hold)); - MCFG_DEVICE_ADD("soundcpu", Z80, 8000000) - MCFG_DEVICE_PROGRAM_MAP(sound_map) - MCFG_DEVICE_IO_MAP(sound_portmap) + Z80(config, m_soundcpu, 8000000); + m_soundcpu->set_addrmap(AS_PROGRAM, &segas18_state::sound_map); + m_soundcpu->set_addrmap(AS_IO, &segas18_state::sound_portmap); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); SEGA_315_5195_MEM_MAPPER(config, m_mapper, 10000000, m_maincpu); m_mapper->set_mapper(FUNC(segas18_state::memory_mapper), this); @@ -1336,28 +1336,28 @@ MACHINE_CONFIG_START(segas18_state::system18) m_io->out_cnt1_callback().set(m_segaic16vid, FUNC(segaic16_video_device::set_display_enable)); m_io->out_cnt2_callback().set(FUNC(segas18_state::set_vdp_enable)); - MCFG_DEVICE_ADD("gen_vdp", SEGA315_5313, 15000000, "maincpu") // ??? Frequency is a complete guess - MCFG_SEGA315_5313_IS_PAL(false) - MCFG_SEGA315_5313_SND_IRQ_CALLBACK(WRITELINE(*this, segas18_state, vdp_sndirqline_callback_s18)); - MCFG_SEGA315_5313_LV6_IRQ_CALLBACK(WRITELINE(*this, segas18_state, vdp_lv6irqline_callback_s18)); - MCFG_SEGA315_5313_LV4_IRQ_CALLBACK(WRITELINE(*this, segas18_state, vdp_lv4irqline_callback_s18)); - MCFG_SEGA315_5313_ALT_TIMING(1); - MCFG_SEGA315_5313_PAL_WRITE_BASE(0x2000); - MCFG_SEGA315_5313_PALETTE("palette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.0) + SEGA315_5313(config, m_vdp, 15000000, m_maincpu); // ??? Frequency is a complete guess + m_vdp->set_is_pal(false); + m_vdp->snd_irq().set(FUNC(segas18_state::vdp_sndirqline_callback_s18)); + m_vdp->lv6_irq().set(FUNC(segas18_state::vdp_lv6irqline_callback_s18)); + m_vdp->lv4_irq().set(FUNC(segas18_state::vdp_lv4irqline_callback_s18)); + m_vdp->set_alt_timing(1); + m_vdp->set_pal_write_base(0x2000); + m_vdp->set_palette(m_palette); + m_vdp->add_route(ALL_OUTPUTS, "mono", 0.0); - MCFG_TIMER_DEVICE_ADD_SCANLINE("scantimer", "gen_vdp", sega315_5313_device, megadriv_scanline_timer_callback_alt_timing, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline("gen_vdp", FUNC(sega315_5313_device::megadriv_scanline_timer_callback_alt_timing), "screen", 0, 1); // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.23) // verified on pcb - MCFG_SCREEN_SIZE(342,262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(segas18_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(57.23); // verified on pcb + m_screen->set_size(342,262); + m_screen->set_visarea(0*8, 40*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(segas18_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segas18) - MCFG_PALETTE_ADD("palette", 2048*3+2048 + 64*3) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_segas18); + PALETTE(config, m_palette, 2048*3+2048 + 64*3); SEGA_SYS16B_SPRITES(config, m_sprites, 0); SEGAIC16VID(config, m_segaic16vid, 0, m_gfxdecode); @@ -1365,28 +1365,28 @@ MACHINE_CONFIG_START(segas18_state::system18) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ym1", YM3438, 8000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) - MCFG_YM2612_IRQ_HANDLER(INPUTLINE("soundcpu", INPUT_LINE_IRQ0)) + ym3438_device &ym1(YM3438(config, "ym1", 8000000)); + ym1.add_route(ALL_OUTPUTS, "mono", 0.40); + ym1.irq_handler().set_inputline("soundcpu", INPUT_LINE_IRQ0); - MCFG_DEVICE_ADD("ym2", YM3438, 8000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + ym3438_device &ym2(YM3438(config, "ym2", 8000000)); + ym2.add_route(ALL_OUTPUTS, "mono", 0.40); - MCFG_DEVICE_ADD("rfsnd", RF5C68, 10000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, pcm_map) -MACHINE_CONFIG_END + rf5c68_device &rfsnd(RF5C68(config, "rfsnd", 10000000)); + rfsnd.add_route(ALL_OUTPUTS, "mono", 1.0); + rfsnd.set_addrmap(0, &segas18_state::pcm_map); +} - -MACHINE_CONFIG_START(segas18_state::system18_fd1094) +void segas18_state::system18_fd1094(machine_config &config) +{ system18(config); // basic machine hardware - MCFG_DEVICE_REPLACE("maincpu", FD1094, 10000000) - MCFG_DEVICE_PROGRAM_MAP(system18_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas18_state, irq4_line_hold) -MACHINE_CONFIG_END + FD1094(config.replace(), m_maincpu, 10000000); + m_maincpu->set_addrmap(AS_PROGRAM, &segas18_state::system18_map); + m_maincpu->set_addrmap(AS_OPCODES, &segas18_state::decrypted_opcodes_map); + m_maincpu->set_vblank_int("screen", FUNC(segas18_state::irq4_line_hold)); +} void segas18_state::lghost_fd1094(machine_config &config) { @@ -1436,33 +1436,33 @@ void segas18_state::wwally(machine_config &config) m_upd4701[2]->set_porty_tag("TRACKY3"); } -MACHINE_CONFIG_START(segas18_state::system18_i8751) +void segas18_state::system18_i8751(machine_config &config) +{ system18(config); // basic machine hardware - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_VBLANK_INT_REMOVE() + m_maincpu->set_vblank_int(device_interrupt_delegate(), nullptr); m_mapper->mcu_int().set_inputline(m_mcu, INPUT_LINE_IRQ1); - MCFG_DEVICE_ADD("mcu", I8751, 8000000) - MCFG_DEVICE_IO_MAP(mcu_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas18_state, irq0_line_hold) -MACHINE_CONFIG_END + I8751(config, m_mcu, 8000000); + m_mcu->set_addrmap(AS_IO, &segas18_state::mcu_io_map); + m_mcu->set_vblank_int("screen", FUNC(segas18_state::irq0_line_hold)); +} -MACHINE_CONFIG_START(segas18_state::system18_fd1094_i8751) +void segas18_state::system18_fd1094_i8751(machine_config &config) +{ system18_fd1094(config); // basic machine hardware - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_VBLANK_INT_REMOVE() + m_maincpu->set_vblank_int(device_interrupt_delegate(), nullptr); m_mapper->mcu_int().set_inputline(m_mcu, INPUT_LINE_IRQ1); - MCFG_DEVICE_ADD("mcu", I8751, 8000000) - MCFG_DEVICE_IO_MAP(mcu_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas18_state, irq0_line_hold) -MACHINE_CONFIG_END + I8751(config, m_mcu, 8000000); + m_mcu->set_addrmap(AS_IO, &segas18_state::mcu_io_map); + m_mcu->set_vblank_int("screen", FUNC(segas18_state::irq0_line_hold)); +} diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp index 01c55262261..77c2952bf85 100644 --- a/src/mame/drivers/segas24.cpp +++ b/src/mame/drivers/segas24.cpp @@ -1916,17 +1916,17 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(segas24_state::system24) - +void segas24_state::system24(machine_config &config) +{ /* basic machine hardware */ M68000(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->set_addrmap(AS_PROGRAM, &segas24_state::cpu1_map); - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", segas24_state, irq_vbl, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(segas24_state::irq_vbl), "screen", 0, 1); M68000(config, m_subcpu, MASTER_CLOCK/2); m_subcpu->set_addrmap(AS_PROGRAM, &segas24_state::cpu2_map); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); sega_315_5296_device &io(SEGA_315_5296(config, "io", VIDEO_CLOCK/2)); io.in_pa_callback().set_ioport("P1"); @@ -1940,22 +1940,22 @@ MACHINE_CONFIG_START(segas24_state::system24) io.out_cnt1_callback().set(FUNC(segas24_state::cnt1)); io.out_cnt2_callback().set("ymsnd", FUNC(ym2151_device::reset_w)); - MCFG_TIMER_DRIVER_ADD("irq_timer", segas24_state, irq_timer_cb) - MCFG_TIMER_DRIVER_ADD("irq_timer_clear", segas24_state, irq_timer_clear_cb) - MCFG_TIMER_ADD_NONE("frc_timer") - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_frc", segas24_state, irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1)) + TIMER(config, "irq_timer").configure_generic(FUNC(segas24_state::irq_timer_cb)); + TIMER(config, "irq_timer_clear").configure_generic(FUNC(segas24_state::irq_timer_clear_cb)); + TIMER(config, "frc_timer").configure_generic(timer_device::expired_delegate()); + TIMER(config, "irq_frc").configure_periodic(FUNC(segas24_state::irq_frc_cb), attotime::from_hz(FRC_CLOCK_MODE1)); S24TILE(config, m_vtile, 0, 0xfff).set_palette("palette"); S24SPRITE(config, m_vsprite, 0); S24MIXER(config, m_vmixer, 0); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) - MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) - MCFG_SCREEN_UPDATE_DRIVER(segas24_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + m_screen->set_raw(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/); + m_screen->set_screen_update(FUNC(segas24_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 8192*2) + PALETTE(config, m_palette, 8192*2); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -1965,10 +1965,12 @@ MACHINE_CONFIG_START(segas24_state::system24) ymsnd.add_route(0, "lspeaker", 0.50); ymsnd.add_route(1, "rspeaker", 0.50); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // 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); +} void segas24_state::system24_rom(machine_config &config) { @@ -1999,7 +2001,8 @@ void segas24_state::system24_floppy_rom(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &segas24_state::rombd_cpu2_map); } -MACHINE_CONFIG_START(segas24_state::system24_floppy_hotrod) +void segas24_state::system24_floppy_hotrod(machine_config &config) +{ system24_floppy(config); m_maincpu->set_addrmap(AS_PROGRAM, &segas24_state::hotrod_cpu1_map); m_subcpu->set_addrmap(AS_PROGRAM, &segas24_state::hotrod_cpu2_map); @@ -2012,14 +2015,14 @@ MACHINE_CONFIG_START(segas24_state::system24_floppy_hotrod) upd2.set_portx_tag("DIAL3"); upd2.set_porty_tag("DIAL4"); - MCFG_DEVICE_ADD("adc1", MSM6253, 0) // IC5 - 33k/33p R/C clock - MCFG_MSM6253_IN0_ANALOG_PORT("PEDAL1") - MCFG_MSM6253_IN1_ANALOG_PORT("PEDAL2") - MCFG_MSM6253_IN2_ANALOG_PORT("PEDAL3") - MCFG_MSM6253_IN3_ANALOG_PORT("PEDAL4") + msm6253_device &adc1(MSM6253(config, "adc1", 0)); // IC5 - 33k/33p R/C clock + adc1.input<0>().set_ioport("PEDAL1"); + adc1.input<1>().set_ioport("PEDAL2"); + adc1.input<2>().set_ioport("PEDAL3"); + adc1.input<3>().set_ioport("PEDAL4"); - MCFG_DEVICE_ADD("adc2", MSM6253, 0) // IC2 - 33k/33p R/C clock -MACHINE_CONFIG_END + MSM6253(config, "adc2", 0); // IC2 - 33k/33p R/C clock +} void segas24_state::system24_floppy_fd1094(machine_config &config) { @@ -2029,7 +2032,8 @@ void segas24_state::system24_floppy_fd1094(machine_config &config) m_subcpu->set_addrmap(AS_OPCODES, &segas24_state::decrypted_opcodes_map); } -MACHINE_CONFIG_START(segas24_state::system24_floppy_fd_upd) +void segas24_state::system24_floppy_fd_upd(machine_config &config) +{ system24_floppy_fd1094(config); m_maincpu->set_addrmap(AS_PROGRAM, &segas24_state::roughrac_cpu1_map); m_subcpu->set_addrmap(AS_PROGRAM, &segas24_state::roughrac_cpu2_map); @@ -2037,7 +2041,7 @@ MACHINE_CONFIG_START(segas24_state::system24_floppy_fd_upd) upd4701_device &upd4701(UPD4701A(config, "upd4701")); // IC4 on 834-6510 I/O board upd4701.set_portx_tag("DIAL1"); upd4701.set_porty_tag("DIAL2"); -MACHINE_CONFIG_END +} void segas24_state::dcclub(machine_config &config) { diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp index dc27583457b..2e7e05711e6 100644 --- a/src/mame/drivers/segas32.cpp +++ b/src/mame/drivers/segas32.cpp @@ -2306,12 +2306,12 @@ GFXDECODE_END *************************************/ -MACHINE_CONFIG_START(segas32_state::device_add_mconfig) - +void segas32_state::device_add_mconfig(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", V60, MASTER_CLOCK/2) - MCFG_DEVICE_PROGRAM_MAP(system32_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas32_state, start_of_vblank_int) + V60(config, m_maincpu, MASTER_CLOCK/2); + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_state::system32_map); + m_maincpu->set_vblank_int("screen", FUNC(segas32_state::start_of_vblank_int)); Z80(config, m_soundcpu, MASTER_CLOCK/4); m_soundcpu->set_addrmap(AS_PROGRAM, &segas32_state::system32_sound_map); @@ -2334,39 +2334,39 @@ MACHINE_CONFIG_START(segas32_state::device_add_mconfig) EEPROM_93C46_16BIT(config, "eeprom"); - MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback) - MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback) + TIMER(config, "v60_irq0").configure_generic(FUNC(segas32_state::signal_v60_irq_callback)); + TIMER(config, "v60_irq1").configure_generic(FUNC(segas32_state::signal_v60_irq_callback)); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segas32) - MCFG_PALETTE_ADD("palette", 0x4000) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_segas32); + PALETTE(config, m_palette, 0x4000); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(52*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(segas32_state, screen_update_system32) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(52*8, 262); + m_screen->set_visarea(0*8, 52*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(segas32_state::screen_update_system32)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ym1", YM3438, MASTER_CLOCK/4) - MCFG_YM2612_IRQ_HANDLER(WRITELINE(*this, segas32_state, ym3438_irq_handler)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.40) + ym3438_device &ym1(YM3438(config, "ym1", MASTER_CLOCK/4)); + ym1.irq_handler().set(FUNC(segas32_state::ym3438_irq_handler)); + ym1.add_route(0, "lspeaker", 0.40); + ym1.add_route(1, "rspeaker", 0.40); - MCFG_DEVICE_ADD("ym2", YM3438, MASTER_CLOCK/4) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.40) + ym3438_device &ym2(YM3438(config, "ym2", MASTER_CLOCK/4)); + ym2.add_route(0, "lspeaker", 0.40); + ym2.add_route(1, "rspeaker", 0.40); - MCFG_DEVICE_ADD("rfsnd", RF5C68, RFC_CLOCK/4) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.55) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.55) - MCFG_DEVICE_ADDRESS_MAP(0, rf5c68_map) + rf5c68_device &rfsnd(RF5C68(config, "rfsnd", RFC_CLOCK/4)); + rfsnd.add_route(0, "lspeaker", 0.55); + rfsnd.add_route(1, "rspeaker", 0.55); + rfsnd.set_addrmap(0, &segas32_state::rf5c68_map); S32COMM(config, m_s32comm, 0); -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_S32_REGULAR_DEVICE, segas32_regular_state, "segas32_pcb_regular", "Sega System 32 regular PCB") @@ -2386,18 +2386,18 @@ void segas32_state::system32_analog_map(address_map &map) map(0xc00050, 0xc00057).mirror(0x0fff80).rw("adc", FUNC(msm6253_device::d7_r), FUNC(msm6253_device::address_w)).umask16(0x00ff); } -MACHINE_CONFIG_START(segas32_analog_state::device_add_mconfig) +void segas32_analog_state::device_add_mconfig(machine_config &config) +{ segas32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(system32_analog_map) + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_analog_state::system32_analog_map); - MCFG_DEVICE_ADD("adc", MSM6253, 0) - MCFG_MSM6253_IN0_ANALOG_PORT("ANALOG1") - MCFG_MSM6253_IN1_ANALOG_PORT("ANALOG2") - MCFG_MSM6253_IN2_ANALOG_PORT("ANALOG3") - MCFG_MSM6253_IN3_ANALOG_PORT("ANALOG4") -MACHINE_CONFIG_END + msm6253_device &adc(MSM6253(config, "adc", 0)); + adc.input<0>().set_ioport("ANALOG1"); + adc.input<1>().set_ioport("ANALOG2"); + adc.input<2>().set_ioport("ANALOG3"); + adc.input<3>().set_ioport("ANALOG4"); +} DEFINE_DEVICE_TYPE(SEGA_S32_ANALOG_DEVICE, segas32_analog_state, "segas32_pcb_analog", "Sega System 32 analog PCB") @@ -2425,11 +2425,11 @@ void segas32_trackball_state::system32_trackball_map(address_map &map) map(0xc00050, 0xc00057).mirror(0x0fff80).rw("upd3", FUNC(upd4701_device::read_xy), FUNC(upd4701_device::reset_xy_w)).umask16(0x00ff); } -MACHINE_CONFIG_START(segas32_trackball_state::device_add_mconfig) +void segas32_trackball_state::device_add_mconfig(machine_config &config) +{ segas32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(system32_trackball_map) + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_trackball_state::system32_trackball_map); upd4701_device &upd1(UPD4701A(config, "upd1")); upd1.set_portx_tag("TRACKX1"); @@ -2444,7 +2444,7 @@ MACHINE_CONFIG_START(segas32_trackball_state::device_add_mconfig) upd3.set_porty_tag("TRACKY3"); // 837-8685 I/O board has an unpopulated space for a fourth UPD4701A -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_S32_TRACKBALL_DEVICE, segas32_trackball_state, "segas32_pcb_trackball", "Sega System 32 trackball PCB") @@ -2464,17 +2464,17 @@ void segas32_state::system32_4player_map(address_map &map) map(0xc00060, 0xc00067).mirror(0x0fff80).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask16(0x00ff); } -MACHINE_CONFIG_START(segas32_4player_state::device_add_mconfig) +void segas32_4player_state::device_add_mconfig(machine_config &config) +{ segas32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(system32_4player_map) + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_4player_state::system32_4player_map); i8255_device &ppi(I8255A(config, "ppi")); ppi.in_pa_callback().set_ioport("EXTRA1"); ppi.in_pb_callback().set_ioport("EXTRA2"); ppi.in_pc_callback().set_ioport("EXTRA3"); -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_S32_4PLAYER_DEVICE, segas32_4player_state, "segas32_pcb_4player", "Sega System 32 4-player/fighting PCB") @@ -2499,18 +2499,18 @@ void segas32_state::ga2_main_map(address_map &map) map(0xa00000, 0xa00fff).rw("dpram", FUNC(mb8421_device::right_r), FUNC(mb8421_device::right_w)).umask16(0x00ff); } -MACHINE_CONFIG_START(segas32_v25_state::device_add_mconfig) +void segas32_v25_state::device_add_mconfig(machine_config &config) +{ segas32_4player_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ga2_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_v25_state::ga2_main_map); - MCFG_DEVICE_ADD("dpram", MB8421, 0) + MB8421(config, "dpram", 0); /* add a V25 for protection */ - MCFG_DEVICE_ADD("mcu", V25, 10000000) - MCFG_DEVICE_PROGRAM_MAP(v25_map) -MACHINE_CONFIG_END + v25_device &mcu(V25(config, "mcu", 10000000)); + mcu.set_addrmap(AS_PROGRAM, &segas32_v25_state::v25_map); +} DEFINE_DEVICE_TYPE(SEGA_S32_V25_DEVICE, segas32_v25_state, "segas32_pcb_v25", "Sega System 32 V25 PCB") @@ -2523,19 +2523,20 @@ segas32_v25_state::segas32_v25_state(const machine_config &mconfig, const char * -MACHINE_CONFIG_START(segas32_upd7725_state::device_add_mconfig) +void segas32_upd7725_state::device_add_mconfig(machine_config &config) +{ segas32_analog_state::device_add_mconfig(config); /* add a upd7725; this is on the 837-8341 daughterboard which plugs into the socket on the master pcb's ROM board where an fd1149 could go */ - MCFG_DEVICE_ADD("dsp", UPD7725, 8000000) // TODO: Find real clock speed for the upd7725; this is a canned oscillator on the 837-8341 pcb - MCFG_DEVICE_PROGRAM_MAP(upd7725_prg_map) - MCFG_DEVICE_DATA_MAP(upd7725_data_map) - MCFG_DEVICE_DISABLE() // TODO: disable for now, needs DMA pins and interrupts implemented in upd7725 core + upd7725_device &dsp(UPD7725(config, "dsp", 8000000)); // TODO: Find real clock speed for the upd7725; this is a canned oscillator on the 837-8341 pcb + dsp.set_addrmap(AS_PROGRAM, &segas32_upd7725_state::upd7725_prg_map); + dsp.set_addrmap(AS_DATA, &segas32_upd7725_state::upd7725_data_map); + dsp.set_disable(); // TODO: disable for now, needs DMA pins and interrupts implemented in upd7725 core // TODO: find /INT source for upd7725 // TODO: figure out how the p0 and p1 lines from the upd7725 affect the mainboard; do they select one of four (or 8) latches to/from the mainboard? // TODO: trace out the 837-8341 pcb // See HLE of this dsp in /src/mame/machine/segas32.cpp : arescue_dsp_r and arescue_dsp_w -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_S32_UPD7725_DEVICE, segas32_upd7725_state, "segas32_pcb_upd7725", "Sega System 32 uPD7725 PCB") @@ -2589,26 +2590,26 @@ void segas32_cd_state::cdrom_config(device_t *device) MCFG_SOUND_ROUTE( 1, "^^rspeaker", 0.30 ) } -MACHINE_CONFIG_START(segas32_cd_state::device_add_mconfig) +void segas32_cd_state::device_add_mconfig(machine_config &config) +{ segas32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(system32_cd_map) + m_maincpu->set_addrmap(AS_PROGRAM, &segas32_cd_state::system32_cd_map); mb89352_device &scsictrl(MB89352A(config, "mb89352", 8000000)); scsictrl.set_scsi_port("scsi"); scsictrl.irq_cb().set(FUNC(segas32_cd_state::scsi_irq_w)); scsictrl.drq_cb().set(FUNC(segas32_cd_state::scsi_drq_w)); - MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0) - MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_0) - MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config) + scsi_port_device &scsi(SCSI_PORT(config, "scsi")); + scsi.set_slot_device(1, "cdrom", SCSICD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0)); + scsi.slot(1).set_option_machine_config("cdrom", cdrom_config); cxd1095_device &cxdio(CXD1095(config, "cxdio", 0)); cxdio.out_porta_cb().set(FUNC(segas32_cd_state::lamps1_w)); cxdio.out_portb_cb().set(FUNC(segas32_cd_state::lamps2_w)); cxdio.in_portd_cb().set_constant(0xff); // Ports C-E used for IEEE-488 printer interface -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_S32_CD_DEVICE, segas32_cd_state, "segas32_pcb_cd", "Sega System 32 CD PCB") @@ -2620,15 +2621,16 @@ segas32_cd_state::segas32_cd_state(const machine_config &mconfig, const char *ta -MACHINE_CONFIG_START(sega_multi32_state::device_add_mconfig) +void sega_multi32_state::device_add_mconfig(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", V70, MULTI32_CLOCK/2) - MCFG_DEVICE_PROGRAM_MAP(multi32_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segas32_state, start_of_vblank_int) + V70(config, m_maincpu, MULTI32_CLOCK/2); + m_maincpu->set_addrmap(AS_PROGRAM, &sega_multi32_state::multi32_map); + m_maincpu->set_vblank_int("screen", FUNC(segas32_state::start_of_vblank_int)); - MCFG_DEVICE_ADD("soundcpu", Z80, MASTER_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(multi32_sound_map) - MCFG_DEVICE_IO_MAP(multi32_sound_portmap) + Z80(config, m_soundcpu, MASTER_CLOCK/4); + m_soundcpu->set_addrmap(AS_PROGRAM, &sega_multi32_state::multi32_sound_map); + m_soundcpu->set_addrmap(AS_IO, &sega_multi32_state::multi32_sound_portmap); sega_315_5296_device &io_chip_0(SEGA_315_5296(config, "io_chip_0", 0)); // unknown clock io_chip_0.in_pa_callback().set_ioport("P1_A"); @@ -2657,42 +2659,42 @@ MACHINE_CONFIG_START(sega_multi32_state::device_add_mconfig) EEPROM_93C46_16BIT(config, "eeprom"); - MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback) - MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback) + TIMER(config, "v60_irq0").configure_generic(FUNC(segas32_state::signal_v60_irq_callback)); + TIMER(config, "v60_irq1").configure_generic(FUNC(segas32_state::signal_v60_irq_callback)); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_segas32) - MCFG_PALETTE_ADD("palette", 0x8000) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_segas32); + PALETTE(config, m_palette, 0x8000); config.set_default_layout(layout_dualhsxs); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(52*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(segas32_state, screen_update_multi32_left) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(52*8, 262); + m_screen->set_visarea(0*8, 52*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(segas32_state::screen_update_multi32_left)); - MCFG_SCREEN_ADD("screen2", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(52*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(segas32_state, screen_update_multi32_right) + screen_device &screen2(SCREEN(config, "screen2", SCREEN_TYPE_RASTER)); + screen2.set_refresh_hz(60); + screen2.set_size(52*8, 262); + screen2.set_visarea(0*8, 52*8-1, 0*8, 28*8-1); + screen2.set_screen_update(FUNC(segas32_state::screen_update_multi32_right)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymsnd", YM3438, MASTER_CLOCK/4) - MCFG_YM2612_IRQ_HANDLER(WRITELINE(*this, segas32_state, ym3438_irq_handler)) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(0, "rspeaker", 0.40) + ym3438_device &ymsnd(YM3438(config, "ymsnd", MASTER_CLOCK/4)); + ymsnd.irq_handler().set(FUNC(segas32_state::ym3438_irq_handler)); + ymsnd.add_route(1, "lspeaker", 0.40); + ymsnd.add_route(0, "rspeaker", 0.40); - MCFG_DEVICE_ADD("sega", MULTIPCM, MASTER_CLOCK/4) - MCFG_DEVICE_ADDRESS_MAP(0, multipcm_map) - MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(0, "rspeaker", 1.0) + MULTIPCM(config, m_multipcm, MASTER_CLOCK/4); + m_multipcm->set_addrmap(0, &sega_multi32_state::multipcm_map); + m_multipcm->add_route(1, "lspeaker", 1.0); + m_multipcm->add_route(0, "rspeaker", 1.0); S32COMM(config, m_s32comm, 0); -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_MULTI32_DEVICE, sega_multi32_state, "segas32_pcb_multi", "Sega Multi 32") @@ -2717,25 +2719,25 @@ void sega_multi32_analog_state::multi32_analog_map(address_map &map) map(0xc00060, 0xc00060).mirror(0x07ff80).w(FUNC(sega_multi32_analog_state::analog_bank_w)); } -MACHINE_CONFIG_START(sega_multi32_analog_state::device_add_mconfig) +void sega_multi32_analog_state::device_add_mconfig(machine_config &config) +{ sega_multi32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multi32_analog_map) + m_maincpu->set_addrmap(AS_PROGRAM, &sega_multi32_analog_state::multi32_analog_map); - MCFG_DEVICE_ADD("adc", MSM6253, 0) - MCFG_MSM6253_IN0_ANALOG_PORT("ANALOG1") - MCFG_MSM6253_IN1_ANALOG_PORT("ANALOG2") - MCFG_MSM6253_IN2_ANALOG_READ(sega_multi32_analog_state, in2_analog_read) - MCFG_MSM6253_IN3_ANALOG_READ(sega_multi32_analog_state, in3_analog_read) -MACHINE_CONFIG_END + msm6253_device &adc(MSM6253(config, "adc", 0)); + adc.input<0>().set_ioport("ANALOG1"); + adc.input<1>().set_ioport("ANALOG2"); + adc.input<2>().set(FUNC(sega_multi32_analog_state::in2_analog_read)); + adc.input<3>().set(FUNC(sega_multi32_analog_state::in3_analog_read)); +} -ioport_value sega_multi32_analog_state::in2_analog_read() +READ8_MEMBER(sega_multi32_analog_state::in2_analog_read) { return m_analog_ports[m_analog_bank * 4 + 2].read_safe(0); } -ioport_value sega_multi32_analog_state::in3_analog_read() +READ8_MEMBER(sega_multi32_analog_state::in3_analog_read) { return m_analog_ports[m_analog_bank * 4 + 3].read_safe(0); } @@ -2762,17 +2764,17 @@ void segas32_state::multi32_6player_map(address_map &map) map(0xc00060, 0xc00067).mirror(0x07ff80).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)).umask32(0x00ff00ff); } -MACHINE_CONFIG_START(sega_multi32_6player_state::device_add_mconfig) +void sega_multi32_6player_state::device_add_mconfig(machine_config &config) +{ sega_multi32_state::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multi32_6player_map) + m_maincpu->set_addrmap(AS_PROGRAM, &sega_multi32_6player_state::multi32_6player_map); i8255_device &ppi(I8255A(config, "ppi")); ppi.in_pa_callback().set_ioport("EXTRA1"); ppi.in_pb_callback().set_ioport("EXTRA2"); ppi.in_pc_callback().set_ioport("EXTRA3"); -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(SEGA_MULTI32_6PLAYER_DEVICE, sega_multi32_6player_state, "segas32_pcb_multi_6player", "Sega Multi 32 6-player PCB") diff --git a/src/mame/drivers/segaufo.cpp b/src/mame/drivers/segaufo.cpp index 078d778842c..d1fc9bfcb6e 100644 --- a/src/mame/drivers/segaufo.cpp +++ b/src/mame/drivers/segaufo.cpp @@ -777,15 +777,15 @@ void ufo_state::machine_start() save_item(NAME(m_stepper)); } -MACHINE_CONFIG_START(ufo_state::newufo) - +void ufo_state::newufo(machine_config &config) +{ /* basic machine hardware */ Z80(config, m_maincpu, XTAL(16'000'000)/2); m_maincpu->set_addrmap(AS_PROGRAM, &ufo_state::ufo_map); m_maincpu->set_addrmap(AS_IO, &ufo_state::ufo_portmap); - MCFG_TIMER_DRIVER_ADD_PERIODIC("motor_timer", ufo_state, simulate_xyz, attotime::from_hz(MOTOR_SPEED)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("update_timer", ufo_state, update_info, attotime::from_hz(60)) + TIMER(config, "motor_timer").configure_periodic(FUNC(ufo_state::simulate_xyz), attotime::from_hz(MOTOR_SPEED)); + TIMER(config, "update_timer").configure_periodic(FUNC(ufo_state::update_info), attotime::from_hz(60)); SEGA_315_5296(config, m_io1, XTAL(16'000'000)); // all ports set to input @@ -819,11 +819,11 @@ MACHINE_CONFIG_START(ufo_state::newufo) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ym", YM3438, XTAL(16'000'000)/2) - MCFG_YM2612_IRQ_HANDLER(INPUTLINE("maincpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.40) - MCFG_SOUND_ROUTE(1, "mono", 0.40) -MACHINE_CONFIG_END + ym3438_device &ym(YM3438(config, "ym", XTAL(16'000'000)/2)); + ym.irq_handler().set_inputline("maincpu", 0); + ym.add_route(0, "mono", 0.40); + ym.add_route(1, "mono", 0.40); +} void ufo_state::ufomini(machine_config &config) { diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp index fcd9eadfca3..aa3bf44c8e7 100644 --- a/src/mame/drivers/segaybd.cpp +++ b/src/mame/drivers/segaybd.cpp @@ -1304,10 +1304,10 @@ void segaybd_state::yboard(machine_config &config) // FMCS and CKOT connect to CS and OSC IN on MSM6253 below msm6253_device &adc(MSM6253(config, "adc", 0)); - adc.set_input_tag<0>("ADC.0"); - adc.set_input_tag<1>("ADC.1"); - adc.set_input_tag<2>("ADC.2"); - adc.set_input_cb<3>(FUNC(segaybd_state::analog_mux)); + adc.input<0>().set_ioport("ADC.0"); + adc.input<1>().set_ioport("ADC.1"); + adc.input<2>().set_ioport("ADC.2"); + adc.input<3>().set(FUNC(segaybd_state::analog_mux)); SEGA_315_5248_MULTIPLIER(config, "multiplier_main", 0); SEGA_315_5248_MULTIPLIER(config, "multiplier_subx", 0); diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 8e18531eaf8..64f32d50c13 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -7848,32 +7848,32 @@ TIMER_DEVICE_CALLBACK_MEMBER(seta_state::tndrcade_sub_interrupt) m_subcpu->set_input_line(0, HOLD_LINE); } -MACHINE_CONFIG_START(seta_state::tndrcade) - +void seta_state::tndrcade(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(tndrcade_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::tndrcade_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - MCFG_DEVICE_ADD("sub", M65C02, 16000000/8) /* 2 MHz */ - MCFG_DEVICE_PROGRAM_MAP(tndrcade_sub_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, tndrcade_sub_interrupt, "screen", 0, 1) + M65C02(config, m_subcpu, 16000000/8); /* 2 MHz */ + m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::tndrcade_sub_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::tndrcade_sub_interrupt), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) @@ -7887,10 +7887,10 @@ MACHINE_CONFIG_START(seta_state::tndrcade) ym1.add_route(ALL_OUTPUTS, "lspeaker", 0.35); ym1.add_route(ALL_OUTPUTS, "rspeaker", 0.35); - MCFG_DEVICE_ADD("ym2", YM3812, 16000000/4) /* 4 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + ym3812_device &ym2(YM3812(config, "ym2", 16000000/4)); /* 4 MHz */ + ym2.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + ym2.add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} /*************************************************************************** @@ -7903,32 +7903,32 @@ MACHINE_CONFIG_END /* twineagl lev 3 = lev 2 + lev 1 ! */ -MACHINE_CONFIG_START(seta_state::twineagl) - +void seta_state::twineagl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(downtown_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::downtown_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_assert)); - MCFG_DEVICE_ADD("sub", M65C02, 16000000/8) /* 2 MHz */ - MCFG_DEVICE_PROGRAM_MAP(twineagl_sub_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1) + M65C02(config, m_subcpu, 16000000/8); /* 2 MHz */ + m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::twineagl_sub_map); + TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) // Possibly lower than 60Hz, Correct? - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); // Possibly lower than 60Hz, Correct? + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_downtown) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,twineagl_1_layer) @@ -7938,9 +7938,9 @@ MACHINE_CONFIG_START(seta_state::twineagl) GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -7949,32 +7949,32 @@ MACHINE_CONFIG_END /* downtown lev 3 = lev 2 + lev 1 ! */ -MACHINE_CONFIG_START(seta_state::downtown) - +void seta_state::downtown(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(downtown_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, XTAL(16'000'000)/2); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::downtown_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - MCFG_DEVICE_ADD("sub", M65C02, XTAL(16'000'000)/8) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(downtown_sub_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1) + M65C02(config, m_subcpu, XTAL(16'000'000)/8); /* verified on pcb */ + m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::downtown_sub_map); + TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); /* verified on pcb */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_downtown) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) @@ -7984,9 +7984,9 @@ MACHINE_CONFIG_START(seta_state::downtown) GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 0.50); +} /*************************************************************************** @@ -8017,18 +8017,18 @@ void usclssic_state::machine_start() } -MACHINE_CONFIG_START(usclssic_state::usclssic) - +void usclssic_state::usclssic(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(usclssic_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", usclssic_state, calibr50_interrupt, "screen", 0, 1) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &usclssic_state::usclssic_map); + TIMER(config, "scantimer").configure_scanline(FUNC(usclssic_state::calibr50_interrupt), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - MCFG_DEVICE_ADD("sub", M65C02, 16000000/8) /* 2 MHz */ - MCFG_DEVICE_PROGRAM_MAP(calibr50_sub_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", usclssic_state, irq0_line_assert) + M65C02(config, m_subcpu, 16000000/8); /* 2 MHz */ + m_subcpu->set_addrmap(AS_PROGRAM, &usclssic_state::calibr50_sub_map); + m_subcpu->set_vblank_int("screen", FUNC(usclssic_state::irq0_line_assert)); UPD4701A(config, m_upd4701); m_upd4701->set_portx_tag("TRACKX"); @@ -8046,19 +8046,19 @@ MACHINE_CONFIG_START(usclssic_state::usclssic) m_seta001->set_gfxbank_callback(FUNC(usclssic_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(usclssic_state, screen_update_usclssic) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(usclssic_state::screen_update_usclssic)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_usclssic) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_usclssic); - MCFG_PALETTE_ADD("palette", 16*32 + 64*32*2) /* sprites, layer */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x400) - MCFG_PALETTE_INIT_OWNER(usclssic_state,usclssic) /* layer is 6 planes deep */ + PALETTE(config, m_palette, 16*32 + 64*32*2); /* sprites, layer */ + m_palette->set_indirect_entries(0x400); + m_palette->set_init(FUNC(usclssic_state::palette_init_usclssic)); /* layer is 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(usclssic_state,seta_1_layer) @@ -8069,9 +8069,9 @@ MACHINE_CONFIG_START(usclssic_state::usclssic) m_soundlatch[0]->data_pending_callback().set_inputline(m_subcpu, INPUT_LINE_NMI); m_soundlatch[0]->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -8083,20 +8083,20 @@ MACHINE_CONFIG_END Test mode shows a 16ms and 4ms counters. I wonder if every game has 5 ints per frame */ -MACHINE_CONFIG_START(seta_state::calibr50) - +void seta_state::calibr50(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(calibr50_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1) + M68000(config, m_maincpu, XTAL(16'000'000)/2); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::calibr50_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::calibr50_interrupt), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_DEVICE_ADD("sub", M65C02, XTAL(16'000'000)/8) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(calibr50_sub_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(seta_state, irq0_line_assert, 4*60) // IRQ: 4/frame + M65C02(config, m_subcpu, XTAL(16'000'000)/8); /* verified on pcb */ + m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::calibr50_sub_map); + m_subcpu->set_periodic_int(FUNC(seta_state::irq0_line_assert), attotime::from_hz(4*60)); // IRQ: 4/frame upd4701_device &upd4701(UPD4701A(config, "upd4701")); upd4701.set_portx_tag("ROT1"); @@ -8109,16 +8109,16 @@ MACHINE_CONFIG_START(seta_state::calibr50) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); /* verified on pcb */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_downtown) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) @@ -8131,9 +8131,9 @@ MACHINE_CONFIG_START(seta_state::calibr50) GENERIC_LATCH_8(config, m_soundlatch[1]); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 0.50); +} /*************************************************************************** @@ -8142,32 +8142,32 @@ MACHINE_CONFIG_END /* metafox lev 3 = lev 2 + lev 1 ! */ -MACHINE_CONFIG_START(seta_state::metafox) - +void seta_state::metafox(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(downtown_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::downtown_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_assert)); - MCFG_DEVICE_ADD("sub", M65C02, 16000000/8) /* 2 MHz */ - MCFG_DEVICE_PROGRAM_MAP(metafox_sub_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1) + M65C02(config, m_subcpu, 16000000/8); /* 2 MHz */ + m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::metafox_sub_map); + TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_downtown) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) @@ -8177,46 +8177,46 @@ MACHINE_CONFIG_START(seta_state::metafox) GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** Athena no Hatena? ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::atehate) - +void seta_state::atehate(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(atehate_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::atehate_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -8229,118 +8229,118 @@ MACHINE_CONFIG_END samples are bankswitched */ -MACHINE_CONFIG_START(seta_state::blandia) - +void seta_state::blandia(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(blandia_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blandia_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta_state, screen_vblank_seta_buffer_sprites)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_blandia) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_blandia); - MCFG_PALETTE_ADD("palette", (16*32+64*32*4)*2) /* sprites, layer1, layer2, palette effect */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600*2) - MCFG_PALETTE_INIT_OWNER(seta_state,blandia) /* layers 1&2 are 6 planes deep */ + PALETTE(config, m_palette, (16*32+64*32*4)*2); /* sprites, layer1, layer2, palette effect */ + m_palette->set_indirect_entries(0x600*2); + m_palette->set_init(FUNC(seta_state::palette_init_blandia)); /* layers 1&2 are 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, blandia_x1_map) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(seta_state::blandiap) + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); + m_x1->set_addrmap(0, &seta_state::blandia_x1_map); +} +void seta_state::blandiap(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(blandiap_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blandiap_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta_state, screen_vblank_seta_buffer_sprites)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_blandia) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_blandia); - MCFG_PALETTE_ADD("palette", (16*32+64*32*4)*2) /* sprites, layer1, layer2, palette effect */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600*2) - MCFG_PALETTE_INIT_OWNER(seta_state,blandia) /* layers 1&2 are 6 planes deep */ + PALETTE(config, m_palette, (16*32+64*32*4)*2); /* sprites, layer1, layer2, palette effect */ + m_palette->set_indirect_entries(0x600*2); + m_palette->set_init(FUNC(seta_state::palette_init_blandia)); /* layers 1&2 are 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, blandia_x1_map) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); + m_x1->set_addrmap(0, &seta_state::blandia_x1_map); +} /*************************************************************************** Block Carnival ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::blockcar) - +void seta_state::blockcar(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(blockcar_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_hold) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blockcar_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} void seta_state::blockcarb_sound_map(address_map &map) @@ -8359,24 +8359,24 @@ void seta_state::blockcarb_sound_portmap(address_map &map) // AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_DEVREAD(m_soundlatch[0], generic_latch_8_device, read) } -MACHINE_CONFIG_START(seta_state::blockcarb) +void seta_state::blockcarb(machine_config &config) +{ blockcar(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(blockcarb_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_hold) + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blockcarb_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) // unk freq - MCFG_DEVICE_PROGRAM_MAP(blockcarb_sound_map) - MCFG_DEVICE_IO_MAP(blockcarb_sound_portmap) + Z80(config, m_audiocpu, 4000000); // unk freq + m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::blockcarb_sound_map); + m_audiocpu->set_addrmap(AS_IO, &seta_state::blockcarb_sound_portmap); /* the sound hardware / program is ripped from Tetris (S16B) */ - MCFG_DEVICE_REMOVE("x1snd") + config.device_remove("x1snd"); - MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified + .add_route(ALL_OUTPUTS, "mono", 1.0); +} @@ -8384,74 +8384,75 @@ MACHINE_CONFIG_END Daioh ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::daioh) - +void seta_state::daioh(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)) /* 16 MHz, MC68000-16, Verified from PCB */ - MCFG_DEVICE_PROGRAM_MAP(daioh_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, XTAL(16'000'000)); /* 16 MHz, MC68000-16, Verified from PCB */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::daioh_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); /* verified on PCB */; + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer1, layer2 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer1, layer2 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, XTAL(16'000'000)) /* 16 MHz, Verified from PCB audio */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, XTAL(16'000'000)); /* 16 MHz, Verified from PCB audio */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** Daioh (prototype) ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::daiohp) - +void seta_state::daiohp(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)) /* 16 MHz, MC68000-16, Verified from PCB */ - MCFG_DEVICE_PROGRAM_MAP(daiohp_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, XTAL(16'000'000)); /* 16 MHz, MC68000-16, Verified from PCB */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::daiohp_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); /* verified on PCB */; + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_daiohp) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer1, layer2 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_daiohp); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer1, layer2 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, XTAL(16'000'000)) /* 16 MHz, Verified from PCB audio */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, XTAL(16'000'000)); /* 16 MHz, Verified from PCB audio */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** Dragon Unit, Quiz Kokology, Strike Gunner @@ -8463,65 +8464,65 @@ MACHINE_CONFIG_END lev 2 drives the game */ -MACHINE_CONFIG_START(seta_state::drgnunit) - +void seta_state::drgnunit(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(drgnunit_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::drgnunit_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta_state, screen_vblank_seta_buffer_sprites)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_downtown) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /* Same as qzkklogy, but with a 16MHz CPU and different layout for the layer's tiles */ -MACHINE_CONFIG_START(seta_state::qzkklgy2) - +void seta_state::qzkklgy2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(drgnunit_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::drgnunit_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta_state, screen_vblank_seta_buffer_sprites)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_qzkklgy2) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_qzkklgy2); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) @@ -8529,10 +8530,11 @@ MACHINE_CONFIG_START(seta_state::qzkklgy2) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} + /*************************************************************************** The Roulette @@ -8551,12 +8553,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(setaroul_state::interrupt) // lev 6: RS232 } -MACHINE_CONFIG_START(setaroul_state::setaroul) - +void setaroul_state::setaroul(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(setaroul_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", setaroul_state, interrupt, "screen", 0, 1) + M68000(config, m_maincpu, XTAL(16'000'000)/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &setaroul_state::setaroul_map); + TIMER(config, "scantimer").configure_scanline(FUNC(setaroul_state::interrupt), "screen", 0, 1); + WATCHDOG_TIMER(config, "watchdog"); MCFG_MACHINE_START_OVERRIDE(setaroul_state, setaroul) @@ -8570,23 +8573,23 @@ MACHINE_CONFIG_START(setaroul_state::setaroul) /* devices */ UPD4992(config, m_rtc); // ! Actually D4911C ! - MCFG_DEVICE_ADD ("acia0", ACIA6850, 0) - MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) + ACIA6850(config, "acia0", 0); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(setaroul_state, screen_update) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, setaroul_state, screen_vblank)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(setaroul_state::screen_update)); + screen.screen_vblank().set(FUNC(setaroul_state::screen_vblank)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_setaroul) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_setaroul); - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_INIT_OWNER(setaroul_state,setaroul) + PALETTE(config, m_palette, 512); + m_palette->set_init(FUNC(setaroul_state::palette_init_setaroul)); MCFG_VIDEO_START_OVERRIDE(setaroul_state,setaroul_1_layer) @@ -8594,24 +8597,25 @@ MACHINE_CONFIG_START(setaroul_state::setaroul) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, XTAL(16'000'000)) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + X1_010(config, m_x1, XTAL(16'000'000)); /* 16 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); // layout config.set_default_layout(layout_setaroul); -MACHINE_CONFIG_END +} + /*************************************************************************** Eight Force ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::eightfrc) - +void seta_state::eightfrc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); SETA001_SPRITE(config, m_seta001, 0); @@ -8619,26 +8623,26 @@ MACHINE_CONFIG_START(seta_state::eightfrc) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer1, layer2 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer1, layer2 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, blandia_x1_map) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); + m_x1->set_addrmap(0, &seta_state::blandia_x1_map); +} /*************************************************************************** @@ -8650,12 +8654,12 @@ MACHINE_CONFIG_END lev 1 == lev 3 (writes to $500000, bit 4 -> 1 then 0) lev 2 drives the game */ -MACHINE_CONFIG_START(seta_state::extdwnhl) - +void seta_state::extdwnhl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(extdwnhl_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::extdwnhl_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); SETA001_SPRITE(config, m_seta001, 0); @@ -8663,19 +8667,19 @@ MACHINE_CONFIG_START(seta_state::extdwnhl) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_zingzip) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_zingzip); - MCFG_PALETTE_ADD("palette", 16*32+16*32+64*32*2) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,zingzip) /* layer 1 gfx is 6 planes deep */ + PALETTE(config, m_palette, 16*32+16*32+64*32*2); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_zingzip)); /* layer 1 gfx is 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) @@ -8683,10 +8687,10 @@ MACHINE_CONFIG_START(seta_state::extdwnhl) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} /*************************************************************************** @@ -8709,15 +8713,15 @@ MACHINE_START_MEMBER(seta_state,wrofaero){ uPD71054_timer_init(); } lev 2: VBlank lev 4: Sound (generated by a timer mapped at $d00000-6 ?) */ -MACHINE_CONFIG_START(seta_state::gundhara) - +void seta_state::gundhara(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); #if USE_uPD71054_TIMER - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); #else - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); #endif // USE_uPD71054_TIMER WATCHDOG_TIMER(config, "watchdog"); @@ -8731,28 +8735,29 @@ MACHINE_CONFIG_START(seta_state::gundhara) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jjsquawk) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); - MCFG_PALETTE_ADD("palette", 16*32+64*32*4) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,gundhara) /* layers are 6 planes deep (seta_state,but have only 4 palettes) */ + PALETTE(config, m_palette, 16*32+64*32*4); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_gundhara)); /* layers are 6 planes deep (seta_state,but have only 4 palettes) */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** Zombie Raid @@ -8764,12 +8769,12 @@ MACHINE_START_MEMBER(zombraid_state,zombraid) m_gun_recoil.resolve(); } -MACHINE_CONFIG_START(zombraid_state::zombraid) +void zombraid_state::zombraid(machine_config &config) +{ gundhara(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(zombraid_map) + m_maincpu->set_addrmap(AS_PROGRAM, &zombraid_state::zombraid_map); MCFG_MACHINE_START_OVERRIDE(zombraid_state, zombraid) @@ -8778,9 +8783,8 @@ MACHINE_CONFIG_START(zombraid_state::zombraid) adc0834_device &adc(ADC0834(config, "adc", 0)); adc.set_input_callback(FUNC(zombraid_state::adc_cb)); - MCFG_DEVICE_MODIFY("x1snd") - MCFG_DEVICE_ADDRESS_MAP(0, zombraid_x1_map) -MACHINE_CONFIG_END + m_x1->set_addrmap(0, &zombraid_state::zombraid_x1_map); +} /*************************************************************************** J.J.Squawkers @@ -8790,12 +8794,12 @@ MACHINE_CONFIG_END lev 1 == lev 3 (writes to $500000, bit 4 -> 1 then 0) lev 2 drives the game */ -MACHINE_CONFIG_START(seta_state::jjsquawk) - +void seta_state::jjsquawk(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); SETA001_SPRITE(config, m_seta001, 0); @@ -8803,75 +8807,77 @@ MACHINE_CONFIG_START(seta_state::jjsquawk) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jjsquawk) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); - MCFG_PALETTE_ADD("palette", 16*32+64*32*4) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,jjsquawk) /* layers are 6 planes deep */ + PALETTE(config, m_palette, 16*32+64*32*4); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_jjsquawk)); /* layers are 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(seta_state::jjsquawb) + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} +void seta_state::jjsquawb(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(jjsquawb_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::jjsquawb_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jjsquawk) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); - MCFG_PALETTE_ADD("palette", 16*32+64*32*4) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,jjsquawk) /* layers are 6 planes deep */ + PALETTE(config, m_palette, 16*32+64*32*4); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_jjsquawk)); /* layers are 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** (Kamen) Masked Riders Club Battle Race ***************************************************************************/ /* kamenrid: lev 2 by vblank, lev 4 by timer */ -MACHINE_CONFIG_START(seta_state::kamenrid) - +void seta_state::kamenrid(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(kamenrid_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::kamenrid_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); + WATCHDOG_TIMER(config, "watchdog"); pit8254_device &pit(PIT8254(config, "pit", 0)); // uPD71054C @@ -8883,25 +8889,26 @@ MACHINE_CONFIG_START(seta_state::kamenrid) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** Orbs @@ -8909,28 +8916,28 @@ MACHINE_CONFIG_END /* The CPU clock has been verified/measured, PCB only has one OSC and it's 14.318180 MHz */ -MACHINE_CONFIG_START(seta_state::orbs) - +void seta_state::orbs(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 14318180/2) /* 7.143 MHz */ - MCFG_DEVICE_PROGRAM_MAP(orbs_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 14318180/2); /* 7.143 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::orbs_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(1*8, 39*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(1*8, 39*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_orbs) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_orbs); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) @@ -8938,24 +8945,22 @@ MACHINE_CONFIG_START(seta_state::orbs) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 14318180) /* 14.318180 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - - + X1_010(config, m_x1, 14318180); /* 14.318180 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} /*************************************************************************** Kero Kero Keroppi no Issyoni Asobou ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::keroppij) - +void seta_state::keroppij(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 14318180/2) /* 7.143 MHz */ - MCFG_DEVICE_PROGRAM_MAP(keroppi_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 14318180/2); /* 7.143 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::keroppi_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE(seta_state,keroppi) @@ -8964,16 +8969,16 @@ MACHINE_CONFIG_START(seta_state::keroppij) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_orbs) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_orbs); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) @@ -8981,26 +8986,28 @@ MACHINE_CONFIG_START(seta_state::keroppij) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 14318180) /* 14.318180 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 14318180); /* 14.318180 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(seta_state::keroppi) +void seta_state::keroppi(machine_config &config) +{ keroppij(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_tndrcade) -MACHINE_CONFIG_END + m_gfxdecode->set_info(gfx_tndrcade); +} + /*************************************************************************** Krazy Bowl ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::krzybowl) - +void seta_state::krzybowl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(krzybowl_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::krzybowl_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); upd4701_device &upd1(UPD4701A(config, "upd1")); upd1.set_portx_tag("TRACK1_X"); @@ -9015,25 +9022,25 @@ MACHINE_CONFIG_START(seta_state::krzybowl) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(1*8, 39*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(1*8, 39*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -9041,12 +9048,12 @@ MACHINE_CONFIG_END ***************************************************************************/ /* madshark: lev 2 by vblank, lev 4 by timer */ -MACHINE_CONFIG_START(seta_state::madshark) - +void seta_state::madshark(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(madshark_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::madshark_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); pit8254_device &pit(PIT8254(config, "pit", 0)); // uPD71054C pit.set_clk<0>(16000000/2/8); @@ -9059,28 +9066,29 @@ MACHINE_CONFIG_START(seta_state::madshark) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jjsquawk) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); - MCFG_PALETTE_ADD("palette", 16*32+64*32*4) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,jjsquawk) /* layers are 6 planes deep */ + PALETTE(config, m_palette, 16*32+64*32*4); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_jjsquawk)); /* layers are 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** Magical Speed @@ -9089,12 +9097,12 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(seta_state,magspeed){ m_leds.resolve(); } /* magspeed: lev 2 by vblank, lev 4 by timer */ -MACHINE_CONFIG_START(seta_state::magspeed) - +void seta_state::magspeed(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(magspeed_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::magspeed_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); WATCHDOG_TIMER(config, "watchdog"); @@ -9109,25 +9117,25 @@ MACHINE_CONFIG_START(seta_state::magspeed) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -9136,12 +9144,12 @@ MACHINE_CONFIG_END /* msgundam lev 2 == lev 6 ! */ -MACHINE_CONFIG_START(seta_state::msgundam) - +void seta_state::msgundam(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(msgundam_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::msgundam_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); pit8254_device &pit(PIT8254(config, "pit", 0)); // uPD71054C pit.set_clk<0>(16000000/2/8); @@ -9152,26 +9160,26 @@ MACHINE_CONFIG_START(seta_state::msgundam) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(56.66) /* between 56 and 57 to match a real PCB's game speed */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta_state, screen_vblank_seta_buffer_sprites)) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(56.66); /* between 56 and 57 to match a real PCB's game speed */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} @@ -9179,28 +9187,28 @@ MACHINE_CONFIG_END Oishii Puzzle ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::oisipuzl) - +void seta_state::oisipuzl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(oisipuzl_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::oisipuzl_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,oisipuzl_2_layers) // flip is inverted for the tilemaps @@ -9208,10 +9216,11 @@ MACHINE_CONFIG_START(seta_state::oisipuzl) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} + /*************************************************************************** Triple Fun @@ -9219,28 +9228,28 @@ MACHINE_CONFIG_END /* same as oisipuzl but with different interrupts and sound */ -MACHINE_CONFIG_START(seta_state::triplfun) - +void seta_state::triplfun(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(triplfun_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_hold) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::triplfun_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,oisipuzl_2_layers) // flip is inverted for the tilemaps @@ -9248,10 +9257,11 @@ MACHINE_CONFIG_START(seta_state::triplfun) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki", OKIM6295, 792000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + okim6295_device &oki(OKIM6295(config, "oki", 792000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified + oki.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + oki.add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} + /*************************************************************************** Pro Mahjong Kiwame @@ -9263,12 +9273,12 @@ WRITE_LINE_MEMBER(kiwame_state::kiwame_vblank) m_tmp68301->external_interrupt_0(); } -MACHINE_CONFIG_START(kiwame_state::kiwame) - +void kiwame_state::kiwame(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD(m_maincpu, M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(kiwame_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("tmp68301", tmp68301_device, irq_callback) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &kiwame_state::kiwame_map); + m_maincpu->set_irq_acknowledge_callback("tmp68301", FUNC(tmp68301_device::irq_callback)); tmp68301_device &tmp68301(TMP68301(config, "tmp68301", 0)); tmp68301.set_cputag(m_maincpu); @@ -9281,17 +9291,17 @@ MACHINE_CONFIG_START(kiwame_state::kiwame) m_seta001->set_gfxbank_callback(FUNC(kiwame_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 56*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(kiwame_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, kiwame_state, kiwame_vblank)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 56*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(kiwame_state::screen_update_seta_no_layers)); + screen.screen_vblank().set(FUNC(kiwame_state::kiwame_vblank)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(kiwame_state,seta_no_layers) @@ -9299,11 +9309,10 @@ MACHINE_CONFIG_START(kiwame_state::kiwame) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); +} /*************************************************************************** @@ -9312,12 +9321,13 @@ MACHINE_CONFIG_END /* pretty much like wrofaero, but ints are 1&2, not 2&4 */ -MACHINE_CONFIG_START(seta_state::rezon) - +void seta_state::rezon(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); + WATCHDOG_TIMER(config, "watchdog"); SETA001_SPRITE(config, m_seta001, 0); @@ -9325,26 +9335,25 @@ MACHINE_CONFIG_START(seta_state::rezon) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer1, layer2 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer1, layer2 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -9353,37 +9362,37 @@ MACHINE_CONFIG_END /* thunderl lev 2 = lev 3 - other levels lead to an error */ -MACHINE_CONFIG_START(seta_state::thunderl) - +void seta_state::thunderl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(thunderl_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::thunderl_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} void seta_state::thunderlbl_sound_map(address_map &map) @@ -9402,18 +9411,17 @@ void seta_state::thunderlbl_sound_portmap(address_map &map) map(0xc0, 0xc0).mirror(0x3f).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); } - -MACHINE_CONFIG_START(seta_state::thunderlbl) +void seta_state::thunderlbl(machine_config &config) +{ thunderl(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(thunderlbl_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::thunderlbl_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - MCFG_DEVICE_ADD("audiocpu", Z80, 10000000/2) - MCFG_DEVICE_PROGRAM_MAP(thunderlbl_sound_map) - MCFG_DEVICE_IO_MAP(thunderlbl_sound_portmap) + Z80(config, m_audiocpu, 10000000/2); + m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::thunderlbl_sound_map); + m_audiocpu->set_addrmap(AS_IO, &seta_state::thunderlbl_sound_portmap); /* the sound hardware / program is ripped from Tetris (S16B) */ config.device_remove("x1snd"); @@ -9422,153 +9430,152 @@ MACHINE_CONFIG_START(seta_state::thunderlbl) GENERIC_LATCH_8(config, m_soundlatch[0]); m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(seta_state::wiggie) - +void seta_state::wiggie(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wiggie_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wiggie_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - MCFG_DEVICE_ADD("audiocpu", Z80, 16000000/4) /* 4 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wiggie_sound_map) + Z80(config, m_audiocpu, 16000000/4); /* 4 MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::wiggie_sound_map); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_wiggie) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_wiggie); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); GENERIC_LATCH_8(config, m_soundlatch[0]); m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(seta_state::superbar) +void seta_state::superbar(machine_config &config) +{ wiggie(config); + m_gfxdecode->set_info(gfx_superbar); +} - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_superbar) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(seta_state::wits) - +void seta_state::wits(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(thunderl_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq2_line_assert) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::thunderl_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** Ultraman Club / SD Gundam Neo Battling ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::umanclub) - +void seta_state::umanclub(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(umanclub_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_hold) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::umanclub_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tndrcade) - MCFG_PALETTE_ADD("palette", 512) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); + PALETTE(config, m_palette, 512); MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** Ultra Toukond Densetsu ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::utoukond) - +void seta_state::utoukond(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(utoukond_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::utoukond_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - MCFG_DEVICE_ADD("audiocpu", Z80, 16000000/4) /* 4 MHz */ - MCFG_DEVICE_PROGRAM_MAP(utoukond_sound_map) - MCFG_DEVICE_IO_MAP(utoukond_sound_io_map) + Z80(config, m_audiocpu, 16000000/4); /* 4 MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::utoukond_sound_map); + m_audiocpu->set_addrmap(AS_IO, &seta_state::utoukond_sound_io_map); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer2, layer1 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer2, layer1 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) @@ -9580,30 +9587,30 @@ MACHINE_CONFIG_START(seta_state::utoukond) m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0); m_soundlatch[0]->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + X1_010(config, m_x1, 16000000); + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); - MCFG_DEVICE_ADD("ymsnd", YM3438, 16000000/4) /* 4 MHz */ - MCFG_YM2612_IRQ_HANDLER(WRITELINE(*this, seta_state, utoukond_ym3438_interrupt)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.30) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.30) -MACHINE_CONFIG_END + ym3438_device &ymsnd(YM3438(config, "ymsnd", 16000000/4)); /* 4 MHz */ + ymsnd.irq_handler().set(FUNC(seta_state::utoukond_ym3438_interrupt)); + ymsnd.add_route(0, "lspeaker", 0.30); + ymsnd.add_route(1, "rspeaker", 0.30); +} /*************************************************************************** War of Aero ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::wrofaero) - +void seta_state::wrofaero(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); #if USE_uPD71054_TIMER - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, wrofaero_interrupt) + m_maincpu->set_vblank_int("screen", FUNC(seta_state::wrofaero_interrupt)); #else - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); #endif // USE_uPD71054_TIMER WATCHDOG_TIMER(config, "watchdog"); @@ -9617,27 +9624,25 @@ MACHINE_CONFIG_START(seta_state::wrofaero) m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_msgundam) - MCFG_PALETTE_ADD("palette", 512 * 3) /* sprites, layer1, layer2 */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + PALETTE(config, m_palette, 512 * 3); /* sprites, layer1, layer2 */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - - + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -9649,12 +9654,12 @@ MACHINE_CONFIG_END at int 1 is necessary: it plays the background music. */ -MACHINE_CONFIG_START(seta_state::zingzip) - +void seta_state::zingzip(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(wrofaero_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", seta_state, irq3_line_hold) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); + m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); @@ -9663,81 +9668,80 @@ MACHINE_CONFIG_START(seta_state::zingzip) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57.42) // taken from other games but seems to better match PCB videos - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57.42); // taken from other games but seems to better match PCB videos + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_zingzip) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_zingzip); - MCFG_PALETTE_ADD("palette", 16*32+16*32+64*32*2) /* sprites, layer2, layer1 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,zingzip) /* layer 1 gfx is 6 planes deep */ + PALETTE(config, m_palette, 16*32+16*32+64*32*2); /* sprites, layer2, layer1 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_zingzip)); /* layer 1 gfx is 6 planes deep */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(seta_state::zingzipbl) +void seta_state::zingzipbl(machine_config &config) +{ zingzip(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_zingzipbl) + m_gfxdecode->set_info(gfx_zingzipbl); - MCFG_DEVICE_REMOVE("maincpu") + M68000(config.replace(), m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::zingzipbl_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(zingzipbl_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + config.device_remove("x1snd"); - MCFG_DEVICE_REMOVE("x1snd") + OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); +} - MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END /*************************************************************************** Pairs Love ***************************************************************************/ -MACHINE_CONFIG_START(seta_state::pairlove) - +void seta_state::pairlove(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000/2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(pairlove_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1) + M68000(config, m_maincpu, 16000000/2); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::pairlove_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_no_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pairlove) - MCFG_PALETTE_ADD("palette", 2048) /* sprites only */ + GFXDECODE(config, m_gfxdecode, m_palette, gfx_pairlove); + PALETTE(config, m_palette, 2048); /* sprites only */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + X1_010(config, m_x1, 16000000); /* 16 MHz */ + m_x1->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** @@ -9755,43 +9759,44 @@ TIMER_DEVICE_CALLBACK_MEMBER(seta_state::crazyfgt_interrupt) m_maincpu->set_input_line(1, HOLD_LINE); } -MACHINE_CONFIG_START(seta_state::crazyfgt) - +void seta_state::crazyfgt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(crazyfgt_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, crazyfgt_interrupt, "screen", 0, 1) + M68000(config, m_maincpu, 16000000); /* 16 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::crazyfgt_map); + TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::crazyfgt_interrupt), "screen", 0, 1); SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag(m_gfxdecode); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback), this); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_crazyfgt) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_crazyfgt); - MCFG_PALETTE_ADD("palette", 16*32+64*32*4) /* sprites, layer1, layer2 */ - MCFG_PALETTE_INDIRECT_ENTRIES(0x600) - MCFG_PALETTE_INIT_OWNER(seta_state,gundhara) /* layers are 6 planes deep (seta_state,but have only 4 palettes) */ + PALETTE(config, m_palette, 16*32+64*32*4); /* sprites, layer1, layer2 */ + m_palette->set_indirect_entries(0x600); + m_palette->set_init(FUNC(seta_state::palette_init_gundhara)); /* layers are 6 planes deep (seta_state,but have only 4 palettes) */ MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM3812, 16000000/4) /* 4 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ym3812_device &ymsnd(YM3812(config, "ymsnd", 16000000/4)); /* 4 MHz */ + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); + + okim6295_device &oki(OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH)); // clock? + oki.add_route(ALL_OUTPUTS, "mono", 1.0); +} - MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) // clock? - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END /*************************************************************************** Jockey Club @@ -9824,12 +9829,13 @@ MACHINE_START_MEMBER(jockeyc_state, jockeyc) } -MACHINE_CONFIG_START(jockeyc_state::jockeyc) - +void jockeyc_state::jockeyc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) // TMP68000N-8 - MCFG_DEVICE_PROGRAM_MAP(jockeyc_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", jockeyc_state, interrupt, "screen", 0, 1) + M68000(config, m_maincpu, XTAL(16'000'000)/2); // TMP68000N-8 + m_maincpu->set_addrmap(AS_PROGRAM, &jockeyc_state::jockeyc_map); + TIMER(config, "scantimer").configure_scanline(FUNC(jockeyc_state::interrupt), "screen", 0, 1); + WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(2.0)); // jockeyc: watchdog test error if over 2.5s SETA001_SPRITE(config, m_seta001, 0); @@ -9841,23 +9847,23 @@ MACHINE_CONFIG_START(jockeyc_state::jockeyc) MCFG_MACHINE_START_OVERRIDE(jockeyc_state, jockeyc) /* devices */ UPD4992(config, m_rtc); // ! Actually D4911C ! - MCFG_DEVICE_ADD ("acia0", ACIA6850, 0) - MCFG_TICKET_DISPENSER_ADD("hopper1", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) - MCFG_TICKET_DISPENSER_ADD("hopper2", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) + ACIA6850(config, "acia0", 0); + TICKET_DISPENSER(config, "hopper1", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper2", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_seta_layers) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(seta_state::screen_update_seta_layers)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jockeyc) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_jockeyc); - MCFG_PALETTE_ADD("palette", 512 * 1) - MCFG_PALETTE_INIT_OWNER(seta_state,palette_init_RRRRRGGGGGBBBBB_proms) + PALETTE(config, m_palette, 512); + m_palette->set_init(FUNC(seta_state::palette_init_RRRRRGGGGGBBBBB_proms)); MCFG_VIDEO_START_OVERRIDE(jockeyc_state,jockeyc_1_layer) @@ -9865,13 +9871,13 @@ MACHINE_CONFIG_START(jockeyc_state::jockeyc) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("x1snd", X1_010, 16000000) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + X1_010(config, m_x1, 16000000); + m_x1->add_route(0, "lspeaker", 1.0); + m_x1->add_route(1, "rspeaker", 1.0); // layout config.set_default_layout(layout_jockeyc); -MACHINE_CONFIG_END +} /*************************************************************************** @@ -9884,23 +9890,24 @@ MACHINE_START_MEMBER(jockeyc_state, inttoote) m_out_itstart.resolve(); } -MACHINE_CONFIG_START(jockeyc_state::inttoote) +void jockeyc_state::inttoote(machine_config &config) +{ jockeyc(config); - MCFG_DEVICE_REMOVE("maincpu") - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)) // TMP68HC000N-16 - MCFG_DEVICE_PROGRAM_MAP(inttoote_map) + M68000(config.replace(), m_maincpu, XTAL(16'000'000)); // TMP68HC000N-16 + m_maincpu->set_addrmap(AS_PROGRAM, &jockeyc_state::inttoote_map); MCFG_MACHINE_START_OVERRIDE(jockeyc_state, inttoote) - // I/O board (not hooked up yet) - MCFG_DEVICE_ADD("pia0", PIA6821, 0) - MCFG_DEVICE_ADD("pia1", PIA6821, 0) - MCFG_DEVICE_ADD ("acia1", ACIA6850, 0) - MCFG_DEVICE_ADD ("acia2", ACIA6850, 0) + // I/O board (not hooked up yet) + PIA6821(config, "pia0", 0); + PIA6821(config, "pia1", 0); + + ACIA6850(config, "acia1", 0); + ACIA6850(config, "acia2", 0); // layout config.set_default_layout(layout_inttoote); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/shangha3.cpp b/src/mame/drivers/shangha3.cpp index 91afe495cc4..0a585c60f10 100644 --- a/src/mame/drivers/shangha3.cpp +++ b/src/mame/drivers/shangha3.cpp @@ -445,29 +445,28 @@ static GFXDECODE_START( gfx_shangha3 ) GFXDECODE_END -MACHINE_CONFIG_START(shangha3_state::shangha3) - +void shangha3_state::shangha3(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 48_MHz_XTAL/3) // TMP68HC000N-16 - MCFG_DEVICE_PROGRAM_MAP(shangha3_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) + M68000(config, m_maincpu, 48_MHz_XTAL/3); // TMP68HC000N-16 + m_maincpu->set_addrmap(AS_PROGRAM, &shangha3_state::shangha3_map); + m_maincpu->set_vblank_int("screen", FUNC(shangha3_state::irq4_line_assert)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) -// MCFG_SCREEN_REFRESH_RATE(60) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) -// MCFG_SCREEN_SIZE(24*16, 16*16) -// MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1) - MCFG_SCREEN_RAW_PARAMS(48_MHz_XTAL/6,512,0,24*16,263,1*16,15*16) /* refresh rate is unknown */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); +// m_screen->set_refresh_hz(60); +// m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ +// m_screen->set_size(24*16, 16*16); +// m_screen->set_visarea(0*16, 24*16-1, 1*16, 15*16-1); + m_screen->set_raw(48_MHz_XTAL/6, 512, 0, 24*16, 263, 1*16, 15*16); /* refresh rate is unknown */ + m_screen->set_screen_update(FUNC(shangha3_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_shangha3); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_shangha3) - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(RRRRRGGGGGBBBBBx) - MCFG_PALETTE_ENABLE_SHADOWS() + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_RRRRRGGGGGBBBBBx); + m_palette->enable_shadows(); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -477,38 +476,36 @@ MACHINE_CONFIG_START(shangha3_state::shangha3) aysnd.port_b_read_callback().set_ioport("DSW2"); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("oki", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH) // pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(shangha3_state::heberpop) + OKIM6295(config, m_oki, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // pin 7 not verified + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} +void shangha3_state::heberpop(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 48_MHz_XTAL/3) // TMP68HC000N-16 like the others?? - MCFG_DEVICE_PROGRAM_MAP(heberpop_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) + M68000(config, m_maincpu, 48_MHz_XTAL/3); // TMP68HC000N-16 like the others?? + m_maincpu->set_addrmap(AS_PROGRAM, &shangha3_state::heberpop_map); + m_maincpu->set_vblank_int("screen", FUNC(shangha3_state::irq4_line_assert)); - MCFG_DEVICE_ADD("audiocpu", Z80, 48_MHz_XTAL/8) /* 6 MHz ??? */ - MCFG_DEVICE_PROGRAM_MAP(heberpop_sound_map) - MCFG_DEVICE_IO_MAP(heberpop_sound_io_map) /* NMI triggered by YM3438 */ + Z80(config, m_audiocpu, 48_MHz_XTAL/8); /* 6 MHz ??? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &shangha3_state::heberpop_sound_map); + m_audiocpu->set_addrmap(AS_IO, &shangha3_state::heberpop_sound_io_map); /* NMI triggered by YM3438 */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) -// MCFG_SCREEN_REFRESH_RATE(60) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) -// MCFG_SCREEN_SIZE(24*16, 16*16) -// MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1) - MCFG_SCREEN_RAW_PARAMS(48_MHz_XTAL/6,512,0,24*16,263,1*16,15*16) /* refresh rate is unknown */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); +// m_screen->set_refresh_hz(60); +// m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ +// m_screen->set_size(24*16, 16*16); +// m_screen->set_visarea(0*16, 24*16-1, 1*16, 15*16-1); + m_screen->set_raw(48_MHz_XTAL/6, 512, 0, 24*16, 263, 1*16, 15*16); /* refresh rate is unknown */ + m_screen->set_screen_update(FUNC(shangha3_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_shangha3); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_shangha3) - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(RRRRRGGGGGBBBBBx) - MCFG_PALETTE_ENABLE_SHADOWS() + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_RRRRRGGGGGBBBBBx); + m_palette->enable_shadows(); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -516,43 +513,41 @@ MACHINE_CONFIG_START(shangha3_state::heberpop) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); - MCFG_DEVICE_ADD("ymsnd", YM3438, 48_MHz_XTAL/6) /* 8 MHz? */ - MCFG_YM2612_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) - MCFG_SOUND_ROUTE(0, "mono", 0.40) - MCFG_SOUND_ROUTE(1, "mono", 0.40) + ym3438_device &ymsnd(YM3438(config, "ymsnd", 48_MHz_XTAL/6)); /* 8 MHz? */ + ymsnd.irq_handler().set_inputline("audiocpu", INPUT_LINE_NMI); + ymsnd.add_route(0, "mono", 0.40); + ymsnd.add_route(1, "mono", 0.40); - MCFG_DEVICE_ADD("oki", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH) // pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(shangha3_state::blocken) + OKIM6295(config, m_oki, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // pin 7 not verified + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} +void shangha3_state::blocken(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 48_MHz_XTAL/3) // TMP68HC000N-16 - MCFG_DEVICE_PROGRAM_MAP(blocken_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) + M68000(config, m_maincpu, 48_MHz_XTAL/3); // TMP68HC000N-16 + m_maincpu->set_addrmap(AS_PROGRAM, &shangha3_state::blocken_map); + m_maincpu->set_vblank_int("screen", FUNC(shangha3_state::irq4_line_assert)); - MCFG_DEVICE_ADD("audiocpu", Z80, 48_MHz_XTAL/8) /* 6 MHz? */ - MCFG_DEVICE_PROGRAM_MAP(heberpop_sound_map) - MCFG_DEVICE_IO_MAP(heberpop_sound_io_map) /* NMI triggered by YM3438 */ + Z80(config, m_audiocpu, 48_MHz_XTAL/8); /* 6 MHz? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &shangha3_state::heberpop_sound_map); + m_audiocpu->set_addrmap(AS_IO, &shangha3_state::heberpop_sound_io_map); /* NMI triggered by YM3438 */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) -// MCFG_SCREEN_REFRESH_RATE(60) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) -// MCFG_SCREEN_SIZE(24*16, 16*16) -// MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1) - MCFG_SCREEN_RAW_PARAMS(48_MHz_XTAL/6,512,0,24*16,263,1*16,15*16) /* refresh rate is unknown */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); +// m_screen->set_refresh_hz(60); +// m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ +// m_screen->set_size(24*16, 16*16); +// m_screen->set_visarea(0*16, 24*16-1, 1*16, 15*16-1); + m_screen->set_raw(48_MHz_XTAL/6, 512, 0, 24*16, 263, 1*16, 15*16); /* refresh rate is unknown */ + m_screen->set_screen_update(FUNC(shangha3_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_shangha3); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_shangha3) - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(RRRRRGGGGGBBBBBx) - MCFG_PALETTE_ENABLE_SHADOWS() + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_RRRRRGGGGGBBBBBx); + m_palette->enable_shadows(); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -560,15 +555,15 @@ MACHINE_CONFIG_START(shangha3_state::blocken) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); - MCFG_DEVICE_ADD("ymsnd", YM3438, 48_MHz_XTAL/6) /* 8 MHz? */ - MCFG_YM2612_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) - MCFG_SOUND_ROUTE(0, "mono", 0.40) - MCFG_SOUND_ROUTE(1, "mono", 0.40) + ym3438_device &ymsnd(YM3438(config, "ymsnd", 48_MHz_XTAL/6)); /* 8 MHz? */ + ymsnd.irq_handler().set_inputline("audiocpu", INPUT_LINE_NMI); + ymsnd.add_route(0, "mono", 0.40); + ymsnd.add_route(1, "mono", 0.40); - MCFG_DEVICE_ADD("oki", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_DEVICE_ADDRESS_MAP(0, blocken_oki_map) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, m_oki, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki->set_addrmap(0, &shangha3_state::blocken_oki_map); + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h index 3381a55ef55..ba5ac52b05c 100644 --- a/src/mame/includes/segas32.h +++ b/src/mame/includes/segas32.h @@ -371,8 +371,8 @@ class sega_multi32_analog_state : public sega_multi32_state public: sega_multi32_analog_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ioport_value in2_analog_read(); - ioport_value in3_analog_read(); + DECLARE_READ8_MEMBER(in2_analog_read); + DECLARE_READ8_MEMBER(in3_analog_read); DECLARE_WRITE8_MEMBER(analog_bank_w); void multi32_analog_map(address_map &map); diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 2ed826daffb..f56dc3c580d 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -124,7 +124,7 @@ public: void init_eightfrc(); void init_pairlove(); - DECLARE_PALETTE_INIT(palette_init_RRRRRGGGGGBBBBB_proms); + DECLARE_PALETTE_INIT(RRRRRGGGGGBBBBB_proms); SETA001_SPRITE_GFXBANK_CB_MEMBER(setac_gfxbank_callback); diff --git a/src/mame/machine/model1io.cpp b/src/mame/machine/model1io.cpp index ae48abdebd5..b6d255d6c92 100644 --- a/src/mame/machine/model1io.cpp +++ b/src/mame/machine/model1io.cpp @@ -148,10 +148,10 @@ void model1io_device::device_add_mconfig(machine_config &config) io.in_pg_callback().set(FUNC(model1io_device::io_pg_r)); msm6253_device &adc(MSM6253(config, "adc", 0)); - adc.set_input_cb<0>(FUNC(model1io_device::analog0_r), this); - adc.set_input_cb<1>(FUNC(model1io_device::analog1_r), this); - adc.set_input_cb<2>(FUNC(model1io_device::analog2_r), this); - adc.set_input_cb<3>(FUNC(model1io_device::analog3_r), this); + adc.input<0>().set(FUNC(model1io_device::analog0_r)); + adc.input<1>().set(FUNC(model1io_device::analog1_r)); + adc.input<2>().set(FUNC(model1io_device::analog2_r)); + adc.input<3>().set(FUNC(model1io_device::analog3_r)); } diff --git a/src/mame/machine/model1io2.cpp b/src/mame/machine/model1io2.cpp index 32ca0218772..40ea9e28d6c 100644 --- a/src/mame/machine/model1io2.cpp +++ b/src/mame/machine/model1io2.cpp @@ -182,10 +182,10 @@ MACHINE_CONFIG_START( model1io2_device::device_add_mconfig ) MB3773(config, m_watchdog, 0); msm6253_device &adc(MSM6253(config, "adc", 32_MHz_XTAL / 16 / 4)); - adc.set_input_cb<0>(FUNC(model1io2_device::analog0_r), this); - adc.set_input_cb<1>(FUNC(model1io2_device::analog1_r), this); - adc.set_input_cb<2>(FUNC(model1io2_device::analog2_r), this); - adc.set_input_cb<3>(FUNC(model1io2_device::analog3_r), this); + adc.input<0>().set(FUNC(model1io2_device::analog0_r)); + adc.input<1>().set(FUNC(model1io2_device::analog1_r)); + adc.input<2>().set(FUNC(model1io2_device::analog2_r)); + adc.input<3>().set(FUNC(model1io2_device::analog3_r)); // diagnostic LCD display screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); diff --git a/src/mame/video/seta.cpp b/src/mame/video/seta.cpp index cc393930549..500877a5e5c 100644 --- a/src/mame/video/seta.cpp +++ b/src/mame/video/seta.cpp @@ -571,7 +571,7 @@ PALETTE_INIT_MEMBER(seta_state,zingzip) } // color prom -PALETTE_INIT_MEMBER(seta_state,palette_init_RRRRRGGGGGBBBBB_proms) +PALETTE_INIT_MEMBER(seta_state,RRRRRGGGGGBBBBB_proms) { const uint8_t *color_prom = memregion("proms")->base(); int x; @@ -587,7 +587,7 @@ PALETTE_INIT_MEMBER(setaroul_state,setaroul) m_gfxdecode->gfx(0)->set_granularity(16); m_gfxdecode->gfx(1)->set_granularity(16); - PALETTE_INIT_NAME(palette_init_RRRRRGGGGGBBBBB_proms)(palette); + palette_init_RRRRRGGGGGBBBBB_proms(palette); } PALETTE_INIT_MEMBER(usclssic_state,usclssic)