From d9130865c6d05c1c9a46d8ef7782a81e0167d3c1 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sun, 9 Dec 2018 16:56:46 +0100 Subject: -mb86235, sh7604, sharc: Removed MCFG macros, nw -gticlub, model2, n64, nwk-tr: Removed MACHINE_CONFIG macros, nw --- src/devices/cpu/mb86235/mb86235.h | 17 +-- src/devices/cpu/sh/sh7604_bus.h | 7 - src/devices/cpu/sh/sh7604_sci.h | 7 - src/devices/cpu/sh/sh7604_wdt.h | 7 - src/devices/cpu/sharc/sharc.h | 3 - src/devices/machine/timer.h | 13 +- src/mame/drivers/gticlub.cpp | 124 +++++++-------- src/mame/drivers/model2.cpp | 311 +++++++++++++++++++------------------- src/mame/drivers/n64.cpp | 4 +- src/mame/drivers/nwk-tr.cpp | 90 +++++------ src/mame/includes/model2.h | 31 ++-- 11 files changed, 292 insertions(+), 322 deletions(-) diff --git a/src/devices/cpu/mb86235/mb86235.h b/src/devices/cpu/mb86235/mb86235.h index 2df714f9bd4..b520844be37 100644 --- a/src/devices/cpu/mb86235/mb86235.h +++ b/src/devices/cpu/mb86235/mb86235.h @@ -15,19 +15,8 @@ #include "cpu/drcuml.h" #include "machine/gen_fifo.h" -#define MCFG_MB86235_FIFOIN(tag) \ - downcast(*device).set_fifoin_tag(tag); - -#define MCFG_MB86235_FIFOOUT0(tag) \ - downcast(*device).set_fifoout0_tag(tag); - -#define MCFG_MB86235_FIFOOUT1(tag) \ - downcast(*device).set_fifoout1_tag(tag); - class mb86235_frontend; - - class mb86235_device : public cpu_device { friend class mb86235_frontend; @@ -37,9 +26,9 @@ public: mb86235_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t clock); virtual ~mb86235_device() override; - void set_fifoin_tag(const char *tag) { m_fifoin.set_tag(tag); } - void set_fifoout0_tag(const char *tag) { m_fifoout0.set_tag(tag); } - void set_fifoout1_tag(const char *tag) { m_fifoout1.set_tag(tag); } + template void set_fifoin_tag(T &&fifo_tag) { m_fifoin.set_tag(std::forward(fifo_tag)); } + template void set_fifoout0_tag(T &&fifo_tag) { m_fifoout0.set_tag(std::forward(fifo_tag)); } + template void set_fifoout1_tag(T &&fifo_tag) { m_fifoout1.set_tag(std::forward(fifo_tag)); } void unimplemented_op(); void unimplemented_alu(); diff --git a/src/devices/cpu/sh/sh7604_bus.h b/src/devices/cpu/sh/sh7604_bus.h index 237fd888f0b..672934aa5ae 100644 --- a/src/devices/cpu/sh/sh7604_bus.h +++ b/src/devices/cpu/sh/sh7604_bus.h @@ -13,13 +13,6 @@ -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_SH7604_BUS_ADD(_tag,_freq) \ - MCFG_DEVICE_ADD(_tag, SH7604_BUS, _freq) - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/cpu/sh/sh7604_sci.h b/src/devices/cpu/sh/sh7604_sci.h index 5e90383ad3e..a4f12da1275 100644 --- a/src/devices/cpu/sh/sh7604_sci.h +++ b/src/devices/cpu/sh/sh7604_sci.h @@ -13,13 +13,6 @@ -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_SH7604_SCI_ADD(_tag,_freq) \ - MCFG_DEVICE_ADD(_tag, SH7604_SCI, _freq) - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/cpu/sh/sh7604_wdt.h b/src/devices/cpu/sh/sh7604_wdt.h index e92b84edca5..70490ba8153 100644 --- a/src/devices/cpu/sh/sh7604_wdt.h +++ b/src/devices/cpu/sh/sh7604_wdt.h @@ -13,13 +13,6 @@ -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_SH7604_WDT_ADD(_tag,_freq) \ - MCFG_DEVICE_ADD(_tag, SH7604_WDT, _freq) - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/cpu/sharc/sharc.h b/src/devices/cpu/sharc/sharc.h index 797899ef98e..731a0ac1464 100644 --- a/src/devices/cpu/sharc/sharc.h +++ b/src/devices/cpu/sharc/sharc.h @@ -73,9 +73,6 @@ #define OP_USERFLAG_CALL 0x10000000 -#define MCFG_SHARC_BOOT_MODE(boot_mode) \ - downcast(*device).set_boot_mode(adsp21062_device::boot_mode); - class sharc_frontend; class adsp21062_device : public cpu_device diff --git a/src/devices/machine/timer.h b/src/devices/machine/timer.h index c09132afb16..8fc08cf2972 100644 --- a/src/devices/machine/timer.h +++ b/src/devices/machine/timer.h @@ -73,7 +73,7 @@ public: typedef device_delegate expired_delegate; // construction/destruction - timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); // inline configuration helpers template void configure_generic(Object &&cb) @@ -81,12 +81,23 @@ public: m_type = TIMER_TYPE_GENERIC; m_callback = std::forward(cb); } + template void configure_generic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name) + { + configure_generic(expired_delegate(callback, name, nullptr, static_cast(nullptr))); + } + template void configure_periodic(Object &&cb, const attotime &period) { m_type = TIMER_TYPE_PERIODIC; m_callback = std::forward(cb); m_period = period; } + template void configure_periodic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name, + const attotime &period) + { + configure_periodic(expired_delegate(callback, name, nullptr, static_cast(nullptr)), period); + } + template void configure_scanline(Object &&cb, const char *screen, int first_vpos, int increment) { m_type = TIMER_TYPE_SCANLINE; diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index ab530dc2b46..7e47f5acf4d 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -954,21 +954,21 @@ uint32_t gticlub_state::screen_update_rscreen(screen_device &screen, bitmap_rgb3 return 0; } -MACHINE_CONFIG_START(gticlub_state::gticlub) - +void gticlub_state::gticlub(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", PPC403GA, XTAL(64'000'000)/2) /* PowerPC 403GA 32MHz */ - MCFG_DEVICE_PROGRAM_MAP(gticlub_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gticlub_state, gticlub_vblank) + PPC403GA(config, m_maincpu, XTAL(64'000'000)/2); /* PowerPC 403GA 32MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, >iclub_state::gticlub_map); + m_maincpu->set_vblank_int("screen", FUNC(gticlub_state::gticlub_vblank)); - MCFG_DEVICE_ADD("audiocpu", M68000, XTAL(64'000'000)/4) /* 16MHz */ - MCFG_DEVICE_PROGRAM_MAP(sound_memmap) + M68000(config, m_audiocpu, XTAL(64'000'000)/4); /* 16MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, >iclub_state::sound_memmap); - MCFG_DEVICE_ADD("dsp", ADSP21062, XTAL(36'000'000)) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_EPROM) - MCFG_DEVICE_DATA_MAP(sharc_map) + ADSP21062(config, m_dsp, XTAL(36'000'000)); + m_dsp->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM); + m_dsp->set_addrmap(AS_DATA, >iclub_state::sharc_map); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); EEPROM_93C56_16BIT(config, "eeprom"); @@ -982,13 +982,13 @@ MACHINE_CONFIG_START(gticlub_state::gticlub) K056230(config, m_k056230, "maincpu"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 384) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) - MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_gticlub) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(512, 384); + screen.set_visarea(0, 511, 0, 383); + screen.set_screen_update(FUNC(gticlub_state::screen_update_gticlub)); - MCFG_PALETTE_ADD("palette", 65536) + PALETTE(config, m_palette, 65536); MCFG_VIDEO_START_OVERRIDE(gticlub_state,gticlub) @@ -999,7 +999,7 @@ MACHINE_CONFIG_START(gticlub_state::gticlub) m_k001604_1->set_roz_mem_offset(0); m_k001604_1->set_palette(m_palette); - MCFG_DEVICE_ADD("k001005", K001005, 0, "k001006_1") + K001005(config, m_k001005, 0, "k001006_1"); K001006(config, m_k001006_1, 0); m_k001006_1->set_gfx_region("gfx1"); @@ -1017,14 +1017,14 @@ MACHINE_CONFIG_START(gticlub_state::gticlub) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("rfsnd", RF5C400, XTAL(33'868'800)/2) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + rf5c400_device &rfsnd(RF5C400(config, "rfsnd", XTAL(33'868'800)/2)); + rfsnd.add_route(0, "lspeaker", 1.0); + rfsnd.add_route(1, "rspeaker", 1.0); KONPPC(config, m_konppc, 0); m_konppc->set_num_boards(1); m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_GTICLUB); -MACHINE_CONFIG_END +} void gticlub_state::thunderh(machine_config &config) { @@ -1053,24 +1053,24 @@ MACHINE_RESET_MEMBER(gticlub_state,hangplt) m_dsp2->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -MACHINE_CONFIG_START(gticlub_state::hangplt) - +void gticlub_state::hangplt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", PPC403GA, XTAL(64'000'000)/2) /* PowerPC 403GA 32MHz */ - MCFG_DEVICE_PROGRAM_MAP(hangplt_map) + PPC403GA(config, m_maincpu, XTAL(64'000'000)/2); /* PowerPC 403GA 32MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, >iclub_state::hangplt_map); - MCFG_DEVICE_ADD("audiocpu", M68000, XTAL(64'000'000)/4) /* 16MHz */ - MCFG_DEVICE_PROGRAM_MAP(sound_memmap) + M68000(config, m_audiocpu, XTAL(64'000'000)/4); /* 16MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, >iclub_state::sound_memmap); - MCFG_DEVICE_ADD("dsp", ADSP21062, XTAL(36'000'000)) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_EPROM) - MCFG_DEVICE_DATA_MAP(hangplt_sharc0_map) + ADSP21062(config, m_dsp, XTAL(36'000'000)); + m_dsp->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM); + m_dsp->set_addrmap(AS_DATA, >iclub_state::hangplt_sharc0_map); - MCFG_DEVICE_ADD("dsp2", ADSP21062, XTAL(36'000'000)) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_EPROM) - MCFG_DEVICE_DATA_MAP(hangplt_sharc1_map) + ADSP21062(config, m_dsp2, XTAL(36'000'000)); + m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM); + m_dsp2->set_addrmap(AS_DATA, >iclub_state::hangplt_sharc1_map); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); EEPROM_93C56_16BIT(config, "eeprom"); @@ -1082,37 +1082,37 @@ MACHINE_CONFIG_START(gticlub_state::hangplt) K056230(config, m_k056230, "maincpu"); - MCFG_DEVICE_ADD("voodoo0", VOODOO_1, STD_VOODOO_1_CLOCK) - MCFG_VOODOO_FBMEM(2) - MCFG_VOODOO_TMUMEM(2,2) - MCFG_VOODOO_SCREEN_TAG("lscreen") - MCFG_VOODOO_CPU_TAG("dsp") - MCFG_VOODOO_VBLANK_CB(WRITELINE(*this, gticlub_state,voodoo_vblank_0)) + VOODOO_1(config, m_voodoo[0], STD_VOODOO_1_CLOCK); + m_voodoo[0]->set_fbmem(2); + m_voodoo[0]->set_tmumem(2,2); + m_voodoo[0]->set_screen_tag("lscreen"); + m_voodoo[0]->set_cpu_tag(m_dsp); + m_voodoo[0]->vblank_callback().set(FUNC(gticlub_state::voodoo_vblank_0)); - MCFG_DEVICE_ADD("voodoo1", VOODOO_1, STD_VOODOO_1_CLOCK) - MCFG_VOODOO_FBMEM(2) - MCFG_VOODOO_TMUMEM(2,2) - MCFG_VOODOO_SCREEN_TAG("rscreen") - MCFG_VOODOO_CPU_TAG("dsp2") - MCFG_VOODOO_VBLANK_CB(WRITELINE(*this, gticlub_state,voodoo_vblank_1)) + VOODOO_1(config, m_voodoo[1], STD_VOODOO_1_CLOCK); + m_voodoo[1]->set_fbmem(2); + m_voodoo[1]->set_tmumem(2,2); + m_voodoo[1]->set_screen_tag("rscreen"); + m_voodoo[1]->set_cpu_tag(m_dsp2); + m_voodoo[1]->vblank_callback().set(FUNC(gticlub_state::voodoo_vblank_1)); K033906(config, "k033906_1", 0, "voodoo0"); K033906(config, "k033906_2", 0, "voodoo1"); /* video hardware */ - MCFG_PALETTE_ADD("palette", 65536) + PALETTE(config, m_palette, 65536); - MCFG_SCREEN_ADD("lscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 384) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) - MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_lscreen) + screen_device &lscreen(SCREEN(config, "lscreen", SCREEN_TYPE_RASTER)); + lscreen.set_refresh_hz(60); + lscreen.set_size(512, 384); + lscreen.set_visarea(0, 511, 0, 383); + lscreen.set_screen_update(FUNC(gticlub_state::screen_update_lscreen)); - MCFG_SCREEN_ADD("rscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 384) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) - MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_rscreen) + screen_device &rscreen(SCREEN(config, "rscreen", SCREEN_TYPE_RASTER)); + rscreen.set_refresh_hz(60); + rscreen.set_size(512, 384); + rscreen.set_visarea(0, 511, 0, 383); + rscreen.set_screen_update(FUNC(gticlub_state::screen_update_rscreen)); K001604(config, m_k001604_1, 0); m_k001604_1->set_layer_size(0); @@ -1134,14 +1134,14 @@ MACHINE_CONFIG_START(gticlub_state::hangplt) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("rfsnd", RF5C400, XTAL(33'868'800)/2) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + rf5c400_device &rfsnd(RF5C400(config, "rfsnd", XTAL(33'868'800)/2)); + rfsnd.add_route(0, "lspeaker", 1.0); + rfsnd.add_route(1, "rspeaker", 1.0); KONPPC(config, m_konppc, 0); m_konppc->set_num_boards(2); m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_HANGPLT); -MACHINE_CONFIG_END +} /*************************************************************************/ diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index 0f3901a0f8b..a07834f5242 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -158,7 +158,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb) m_timerrun[tnum] = 0; } -MACHINE_START_MEMBER( model2_state, model2 ) +void model2_state::machine_start() { // initialize custom debugger pool, @see machine/model2.cpp debug_init(); @@ -183,9 +183,9 @@ MACHINE_START_MEMBER( model2_state, model2 ) save_item(NAME(m_geo_read_start_address)); } -MACHINE_START_MEMBER(model2_tgp_state,model2_tgp) +void model2_tgp_state::machine_start() { - MACHINE_START_CALL_MEMBER(model2); + model2_state::machine_start(); m_copro_fifo_in->setup(16, [this]() { m_copro_tgp->stall(); }, @@ -206,9 +206,9 @@ MACHINE_START_MEMBER(model2_tgp_state,model2_tgp) [ ]() { }); } -MACHINE_START_MEMBER(model2b_state,model2b) +void model2b_state::machine_start() { - MACHINE_START_CALL_MEMBER(model2); + model2_state::machine_start(); m_copro_fifo_in->setup(16, [ ]() { }, @@ -228,9 +228,9 @@ MACHINE_START_MEMBER(model2b_state,model2b) [this]() { m_copro_adsp->set_flag_input(1, m_copro_fifo_in->is_full()); }); } -MACHINE_START_MEMBER(model2c_state,model2c) +void model2c_state::machine_start() { - MACHINE_START_CALL_MEMBER(model2); + model2_state::machine_start(); m_copro_fifo_in->setup(16, [ ]() { }, @@ -250,10 +250,8 @@ MACHINE_START_MEMBER(model2c_state,model2c) [ ]() { }); } -MACHINE_RESET_MEMBER( model2_state, model2_common ) +void model2_state::machine_reset() { - int i; - m_intreq = 0; m_intena = 0; m_coproctl = 0; @@ -269,14 +267,14 @@ MACHINE_RESET_MEMBER( model2_state, model2_common ) m_timerrun[0] = m_timerrun[1] = m_timerrun[2] = m_timerrun[3] = 0; - for (i=0; i<4; i++) + for (int i = 0; i < 4; i++) m_timers[i]->reset(); m_uart->write_cts(0); // initialize bufferram to a sane default // TODO: HW can probably parse this at will somehow ... - for (i=0;i<0x20000/4;i++) + for (int i = 0; i < 0x20000/4; i++) m_bufferram[i] = 0x07800f0f; m_copro_fifo_in->clear(); @@ -285,7 +283,7 @@ MACHINE_RESET_MEMBER( model2_state, model2_common ) m_geo_read_start_address = 0; } -MACHINE_RESET_MEMBER(model2_state,model2_scsp) +void model2_state::reset_model2_scsp() { membank("bank4")->set_base(memregion("samples")->base() + 0x200000); membank("bank5")->set_base(memregion("samples")->base() + 0x600000); @@ -295,29 +293,24 @@ MACHINE_RESET_MEMBER(model2_state,model2_scsp) m_audiocpu->reset(); } -MACHINE_RESET_MEMBER(model2_tgp_state,model2_tgp) +void model2_tgp_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER(model2_common); + model2_state::machine_reset(); // hold TGP in halt until we have code m_copro_tgp->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } -MACHINE_RESET_MEMBER(model2o_state,model2o) -{ - MACHINE_RESET_CALL_MEMBER(model2_tgp); -} - -MACHINE_RESET_MEMBER(model2a_state,model2a) +void model2a_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER(model2_tgp); - MACHINE_RESET_CALL_MEMBER(model2_scsp); + model2_tgp_state::machine_reset(); + reset_model2_scsp(); } -MACHINE_RESET_MEMBER(model2b_state,model2b) +void model2b_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER(model2_common); - MACHINE_RESET_CALL_MEMBER(model2_scsp); + model2_state::machine_reset(); + reset_model2_scsp(); m_copro_adsp->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); @@ -327,10 +320,10 @@ MACHINE_RESET_MEMBER(model2b_state,model2b) m_copro_adsp->set_input_line(SHARC_INPUT_FLAG1, CLEAR_LINE); } -MACHINE_RESET_MEMBER(model2c_state,model2c) +void model2c_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER(model2_common); - MACHINE_RESET_CALL_MEMBER(model2_scsp); + model2_state::machine_reset(); + reset_model2_scsp(); m_copro_tgpx4->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } @@ -2422,35 +2415,42 @@ WRITE8_MEMBER(model2_state::scsp_irq) #define VIDEO_CLOCK XTAL(32'000'000) -MACHINE_CONFIG_START(model2_state::model2_timers) - MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((uintptr_t)0) - MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((uintptr_t)1) - MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((uintptr_t)2) - MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((uintptr_t)3) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(model2_state::model2_screen) +void model2_state::model2_timers(machine_config &config) +{ + timer_device &timer0(TIMER(config, "timer0")); + timer0.configure_generic(FUNC(model2_state::model2_timer_cb)); + timer0.set_ptr((void *)(uintptr_t)0); + timer_device &timer1(TIMER(config, "timer1")); + timer1.configure_generic(FUNC(model2_state::model2_timer_cb)); + timer1.set_ptr((void *)(uintptr_t)1); + timer_device &timer2(TIMER(config, "timer2")); + timer2.configure_generic(FUNC(model2_state::model2_timer_cb)); + timer2.set_ptr((void *)(uintptr_t)2); + timer_device &timer3(TIMER(config, "timer3")); + timer3.configure_generic(FUNC(model2_state::model2_timer_cb)); + timer3.set_ptr((void *)(uintptr_t)3); +} + +void model2_state::model2_screen(machine_config &config) +{ S24TILE(config, m_tiles, 0, 0x3fff); m_tiles->set_palette(m_palette); m_tiles->xhout_write_callback().set(FUNC(model2_state::horizontal_sync_w)); m_tiles->xvout_write_callback().set(FUNC(model2_state::vertical_sync_w)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); // TODO: from System 24, might not be accurate for Model 2 - MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) - MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2) + m_screen->set_raw(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/); + m_screen->set_screen_update(FUNC(model2_state::screen_update_model2)); - MCFG_PALETTE_ADD("palette", 8192) -MACHINE_CONFIG_END + PALETTE(config, m_palette, 8192); +} -MACHINE_CONFIG_START(model2_state::model2_scsp) - MCFG_DEVICE_ADD("audiocpu", M68000, 45158000/4) // SCSP Clock / 2 - MCFG_DEVICE_PROGRAM_MAP(model2_snd) +void model2_state::model2_scsp(machine_config &config) +{ + M68000(config, m_audiocpu, 45158000/4); // SCSP Clock / 2 + m_audiocpu->set_addrmap(AS_PROGRAM, &model2_state::model2_snd); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -2468,19 +2468,21 @@ MACHINE_CONFIG_START(model2_state::model2_scsp) clock_device &uart_clock(CLOCK(config, "uart_clock", 500000)); // 16 times 31.25MHz (standard Sega/MIDI sound data rate) uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc)); uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc)); -MACHINE_CONFIG_END +} /* original Model 2 */ -MACHINE_CONFIG_START(model2o_state::model2o) - MCFG_DEVICE_ADD("maincpu", I960, 25000000) - MCFG_DEVICE_PROGRAM_MAP(model2o_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1) +void model2o_state::model2o(machine_config &config) +{ + I960(config, m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &model2o_state::model2o_mem); + + TIMER(config, "scantimer").configure_scanline(FUNC(model2_state::model2_interrupt), "screen", 0, 1); - MCFG_DEVICE_ADD("copro_tgp", MB86234, 16000000) - MCFG_DEVICE_PROGRAM_MAP(copro_tgp_prog_map) - MCFG_DEVICE_DATA_MAP(copro_tgp_data_map) - MCFG_DEVICE_IO_MAP(copro_tgp_io_map) - MCFG_DEVICE_ADDRESS_MAP(mb86233_device::AS_RF, copro_tgp_rf_map) + MB86234(config, m_copro_tgp, 16000000); + m_copro_tgp->set_addrmap(AS_PROGRAM, &model2o_state::copro_tgp_prog_map); + m_copro_tgp->set_addrmap(AS_DATA, &model2o_state::copro_tgp_data_map); + m_copro_tgp->set_addrmap(AS_IO, &model2o_state::copro_tgp_io_map); + m_copro_tgp->set_addrmap(mb86233_device::AS_RF, &model2o_state::copro_tgp_rf_map); ADDRESS_MAP_BANK(config, m_copro_tgp_bank, 0); m_copro_tgp_bank->set_addrmap(0, &model2o_state::copro_tgp_bank_map); @@ -2493,9 +2495,6 @@ MACHINE_CONFIG_START(model2o_state::model2o) GENERIC_FIFO_U32(config, m_copro_fifo_in, 0); GENERIC_FIFO_U32(config, m_copro_fifo_out, 0); - MCFG_MACHINE_START_OVERRIDE(model2_tgp_state,model2_tgp) - MCFG_MACHINE_RESET_OVERRIDE(model2o_state,model2o) - NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1); model1io_device &ioboard(SEGA_MODEL1IO(config, "ioboard", 0)); @@ -2521,7 +2520,7 @@ MACHINE_CONFIG_START(model2o_state::model2o) uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc)); M2COMM(config, "m2comm", 0); -MACHINE_CONFIG_END +} READ8_MEMBER(model2_state::driveio_portg_r) { @@ -2554,11 +2553,12 @@ void model2_state::drive_io_map(address_map &map) map(0x80, 0x83).rw("driveadc", FUNC(msm6253_device::d0_r), FUNC(msm6253_device::address_w)); } -MACHINE_CONFIG_START(model2_state::sj25_0207_01) - MCFG_DEVICE_ADD("drivecpu", Z80, XTAL(8'000'000)/2) // confirmed - MCFG_DEVICE_PROGRAM_MAP(drive_map) - MCFG_DEVICE_IO_MAP(drive_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", model2_state, irq0_line_hold) +void model2_state::sj25_0207_01(machine_config &config) +{ + Z80(config, m_drivecpu, XTAL(8'000'000)/2); // confirmed + m_drivecpu->set_addrmap(AS_PROGRAM, &model2_state::drive_map); + m_drivecpu->set_addrmap(AS_IO, &model2_state::drive_io_map); + m_drivecpu->set_vblank_int("screen", FUNC(model2_state::irq0_line_hold)); sega_315_5296_device &driveio1(SEGA_315_5296(config, "driveio1", 0)); // unknown clock driveio1.out_pd_callback().set(FUNC(model2_state::driveio_port_w)); @@ -2568,7 +2568,7 @@ MACHINE_CONFIG_START(model2_state::sj25_0207_01) SEGA_315_5296(config, "driveio2", 0); // unknown clock MSM6253(config, "driveadc", 0); -MACHINE_CONFIG_END +} void model2o_state::daytona(machine_config &config) { @@ -2583,19 +2583,19 @@ void model2o_state::daytona(machine_config &config) ioboard.output_callback().set(FUNC(model2o_state::daytona_output_w)); } -MACHINE_CONFIG_START(model2o_maxx_state::daytona_maxx) +void model2o_maxx_state::daytona_maxx(machine_config &config) +{ daytona(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2o_maxx_mem) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &model2o_maxx_state::model2o_maxx_mem); +} -MACHINE_CONFIG_START(model2o_gtx_state::daytona_gtx) +void model2o_gtx_state::daytona_gtx(machine_config &config) +{ daytona(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2o_gtx_mem) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &model2o_gtx_state::model2o_gtx_mem); +} void model2o_state::desert(machine_config &config) { @@ -2608,7 +2608,8 @@ void model2o_state::desert(machine_config &config) ioboard.output_callback().set(FUNC(model2o_state::desert_output_w)); } -MACHINE_CONFIG_START(model2o_state::vcop) +void model2o_state::vcop(machine_config &config) +{ model2o(config); model1io2_device &ioboard(SEGA_MODEL1IO2(config.replace(), "ioboard", 0)); @@ -2625,19 +2626,20 @@ MACHINE_CONFIG_START(model2o_state::vcop) ioboard.set_lightgun_p2y_tag("P2_Y"); config.set_default_layout(layout_model1io2); -MACHINE_CONFIG_END +} /* 2A-CRX */ -MACHINE_CONFIG_START(model2a_state::model2a) - MCFG_DEVICE_ADD("maincpu", I960, 25000000) - MCFG_DEVICE_PROGRAM_MAP(model2a_crx_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1) +void model2a_state::model2a(machine_config &config) +{ + I960(config, m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &model2a_state::model2a_crx_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(model2_state::model2_interrupt), "screen", 0, 1); - MCFG_DEVICE_ADD("copro_tgp", MB86234, 16000000) - MCFG_DEVICE_PROGRAM_MAP(copro_tgp_prog_map) - MCFG_DEVICE_DATA_MAP(copro_tgp_data_map) - MCFG_DEVICE_IO_MAP(copro_tgp_io_map) - MCFG_DEVICE_ADDRESS_MAP(mb86233_device::AS_RF, copro_tgp_rf_map) + MB86234(config, m_copro_tgp, 16000000); + m_copro_tgp->set_addrmap(AS_PROGRAM, &model2a_state::copro_tgp_prog_map); + m_copro_tgp->set_addrmap(AS_DATA, &model2a_state::copro_tgp_data_map); + m_copro_tgp->set_addrmap(AS_IO, &model2a_state::copro_tgp_io_map); + m_copro_tgp->set_addrmap(mb86233_device::AS_RF, &model2a_state::copro_tgp_rf_map); ADDRESS_MAP_BANK(config, m_copro_tgp_bank, 0); m_copro_tgp_bank->set_addrmap(0, &model2a_state::copro_tgp_bank_map); @@ -2650,9 +2652,6 @@ MACHINE_CONFIG_START(model2a_state::model2a) GENERIC_FIFO_U32(config, m_copro_fifo_in, 0); GENERIC_FIFO_U32(config, m_copro_fifo_out, 0); - MCFG_MACHINE_START_OVERRIDE(model2_tgp_state,model2_tgp) - MCFG_MACHINE_RESET_OVERRIDE(model2a_state,model2a) - EEPROM_93C46_16BIT(config, "eeprom"); NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1); @@ -2667,7 +2666,7 @@ MACHINE_CONFIG_START(model2a_state::model2a) model2_scsp(config); M2COMM(config, "m2comm", 0); -MACHINE_CONFIG_END +} void model2a_state::manxtt(machine_config &config) { @@ -2726,27 +2725,25 @@ uint16_t model2_state::crypt_read_callback(uint32_t addr) return ((dat&0xff00)>>8)|((dat&0x00ff)<<8); } -MACHINE_CONFIG_START(model2a_state::model2a_5881) +void model2a_state::model2a_5881(machine_config &config) +{ model2a(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2a_5881_mem) - - MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) - MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &model2a_state::model2a_5881_mem); + SEGA315_5881_CRYPT(config, m_cryptdevice, 0); + m_cryptdevice->set_read_cb(FUNC(model2a_state::crypt_read_callback)); +} -MACHINE_CONFIG_START(model2a_state::model2a_0229) +void model2a_state::model2a_0229(machine_config &config) +{ model2a(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2a_0229_mem) + m_maincpu->set_addrmap(AS_PROGRAM, &model2a_state::model2a_0229_mem); - MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) - MCFG_DEVICE_ADDRESS_MAP(0, sega_0229_map) -MACHINE_CONFIG_END + SEGA315_5838_COMP(config, m_0229crypt, 0); + m_0229crypt->set_addrmap(0, model2a_state::sega_0229_map); +} void model2a_state::zeroguna(machine_config &config) { @@ -2757,27 +2754,26 @@ void model2a_state::zeroguna(machine_config &config) } /* 2B-CRX */ -MACHINE_CONFIG_START(model2b_state::model2b) - MCFG_DEVICE_ADD("maincpu", I960, 25000000) - MCFG_DEVICE_PROGRAM_MAP(model2b_crx_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1) +void model2b_state::model2b(machine_config &config) +{ + I960(config, m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &model2b_state::model2b_crx_mem); + + TIMER(config, "scantimer", 0).configure_scanline(FUNC(model2_state::model2_interrupt), "screen", 0, 1); - MCFG_DEVICE_ADD("copro_adsp", ADSP21062, 40000000) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_HOST) - MCFG_DEVICE_DATA_MAP(copro_sharc_map) + ADSP21062(config, m_copro_adsp, 40000000); + m_copro_adsp->set_boot_mode(adsp21062_device::BOOT_MODE_HOST); + m_copro_adsp->set_addrmap(AS_DATA, &model2b_state::copro_sharc_map); - //MCFG_DEVICE_ADD("dsp2", ADSP21062, 40000000) - //MCFG_SHARC_BOOT_MODE(BOOT_MODE_HOST) - //MCFG_DEVICE_DATA_MAP(geo_sharc_map) + //ADSP21062(config, m_dsp2, 40000000); + //m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_HOST); + //m_dsp2->set_addrmap(AS_DATA, &model2b_state::geo_sharc_map); - MCFG_QUANTUM_TIME(attotime::from_hz(18000)) + config.m_minimum_quantum = attotime::from_hz(18000); GENERIC_FIFO_U32(config, m_copro_fifo_in, 0); GENERIC_FIFO_U32(config, m_copro_fifo_out, 0); - MCFG_MACHINE_START_OVERRIDE(model2b_state,model2b) - MCFG_MACHINE_RESET_OVERRIDE(model2b_state,model2b) - EEPROM_93C46_16BIT(config, "eeprom"); NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1); @@ -2792,27 +2788,27 @@ MACHINE_CONFIG_START(model2b_state::model2b) model2_scsp(config); M2COMM(config, "m2comm", 0); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(model2b_state::model2b_5881) +void model2b_state::model2b_5881(machine_config &config) +{ model2b(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2b_5881_mem) + m_maincpu->set_addrmap(AS_PROGRAM, &model2b_state::model2b_5881_mem); - MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) - MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) -MACHINE_CONFIG_END + SEGA315_5881_CRYPT(config, m_cryptdevice, 0); + m_cryptdevice->set_read_cb(FUNC(model2b_state::crypt_read_callback)); +} -MACHINE_CONFIG_START(model2b_state::model2b_0229) +void model2b_state::model2b_0229(machine_config &config) +{ model2b(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2b_0229_mem) + m_maincpu->set_addrmap(AS_PROGRAM, &model2b_state::model2b_0229_mem); - MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) - MCFG_DEVICE_ADDRESS_MAP(0, sega_0229_map) -MACHINE_CONFIG_END + SEGA315_5838_COMP(config, m_0229crypt, 0); + m_0229crypt->set_addrmap(0, model2b_state::sega_0229_map); +} void model2b_state::indy500(machine_config &config) { @@ -2837,12 +2833,13 @@ void model2b_state::rchase2_ioport_map(address_map &map) map(0x00, 0x07).rw("ioexp", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write)); } -MACHINE_CONFIG_START( model2b_state::rchase2 ) +void model2b_state::rchase2(machine_config &config) +{ model2b(config); - MCFG_DEVICE_ADD("iocpu", Z80, 4000000) - MCFG_DEVICE_PROGRAM_MAP(rchase2_iocpu_map) - MCFG_DEVICE_IO_MAP(rchase2_ioport_map) + z80_device &iocpu(Z80(config, "iocpu", 4000000)); + iocpu.set_addrmap(AS_PROGRAM, &model2b_state::rchase2_iocpu_map); + iocpu.set_addrmap(AS_IO, &model2b_state::rchase2_ioport_map); CXD1095(config, "ioexp", 0); @@ -2853,7 +2850,7 @@ MACHINE_CONFIG_START( model2b_state::rchase2 ) io.an_port_callback<1>().set_ioport("P1_X"); io.an_port_callback<2>().set_ioport("P2_Y"); io.an_port_callback<3>().set_ioport("P1_Y"); -MACHINE_CONFIG_END +} void model2b_state::gunblade(machine_config &config) { @@ -2884,23 +2881,21 @@ void model2b_state::zerogun(machine_config &config) } /* 2C-CRX */ -MACHINE_CONFIG_START(model2c_state::model2c) - MCFG_DEVICE_ADD("maincpu", I960, 25000000) - MCFG_DEVICE_PROGRAM_MAP(model2c_crx_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2c_state, model2c_interrupt, "screen", 0, 1) +void model2c_state::model2c(machine_config &config) +{ + I960(config, m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &model2c_state::model2c_crx_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(model2c_state::model2c_interrupt), "screen", 0, 1); - MCFG_DEVICE_ADD("copro_tgpx4", MB86235, 40000000) - MCFG_DEVICE_PROGRAM_MAP(copro_tgpx4_map) - MCFG_DEVICE_DATA_MAP(copro_tgpx4_data_map) - MCFG_MB86235_FIFOIN("copro_fifo_in") - MCFG_MB86235_FIFOOUT0("copro_fifo_out") + MB86235(config, m_copro_tgpx4, 40000000); + m_copro_tgpx4->set_addrmap(AS_PROGRAM, &model2c_state::copro_tgpx4_map); + m_copro_tgpx4->set_addrmap(AS_DATA, &model2c_state::copro_tgpx4_data_map); + m_copro_tgpx4->set_fifoin_tag(m_copro_fifo_in); + m_copro_tgpx4->set_fifoout0_tag(m_copro_fifo_out); GENERIC_FIFO_U32(config, m_copro_fifo_in, 0); GENERIC_FIFO_U32(config, m_copro_fifo_out, 0); - MCFG_MACHINE_START_OVERRIDE(model2c_state,model2c) - MCFG_MACHINE_RESET_OVERRIDE(model2c_state,model2c) - EEPROM_93C46_16BIT(config, "eeprom"); NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1); @@ -2915,7 +2910,7 @@ MACHINE_CONFIG_START(model2c_state::model2c) model2_scsp(config); M2COMM(config, "m2comm", 0); -MACHINE_CONFIG_END +} void model2c_state::skisuprg(machine_config &config) { @@ -2973,15 +2968,15 @@ void model2c_state::hotd(machine_config &config) io.serial_ch2_wr_callback().set(FUNC(model2c_state::lightgun_mux_w)); } -MACHINE_CONFIG_START(model2c_state::model2c_5881) +void model2c_state::model2c_5881(machine_config &config) +{ model2c(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(model2c_5881_mem) + m_maincpu->set_addrmap(AS_PROGRAM, &model2c_state::model2c_5881_mem); - MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) - MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) -MACHINE_CONFIG_END + SEGA315_5881_CRYPT(config, m_cryptdevice, 0); + m_cryptdevice->set_read_cb(FUNC(model2c_state::crypt_read_callback)); +} void model2c_state::overrev2c(machine_config &config) { diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 7c59945aadc..a7e8b51103e 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -427,8 +427,8 @@ INTERRUPT_GEN_MEMBER(n64_mess_state::n64_reset_poll) m_rcp_periphs->poll_reset_button((ioport("RESET")->read() & 1) ? true : false); } -MACHINE_CONFIG_START(n64_mess_state::n64) - +void n64_mess_state::n64(machine_config &config) +{ /* basic machine hardware */ VR4300BE(config, m_vr4300, 93750000); m_vr4300->set_force_no_drc(true); diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index d5ad65e0dc7..371b88fcf05 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -830,26 +830,26 @@ void nwktr_state::machine_reset() m_dsp2->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -MACHINE_CONFIG_START(nwktr_state::nwktr) - +void nwktr_state::nwktr(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", PPC403GA, XTAL(64'000'000)/2) /* PowerPC 403GA 32MHz */ - MCFG_DEVICE_PROGRAM_MAP(nwktr_map) + PPC403GA(config, m_maincpu, XTAL(64'000'000)/2); /* PowerPC 403GA 32MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &nwktr_state::nwktr_map); - MCFG_DEVICE_ADD("audiocpu", M68000, XTAL(64'000'000)/4) /* 16MHz */ - MCFG_DEVICE_PROGRAM_MAP(sound_memmap) + M68000(config, m_audiocpu, XTAL(64'000'000)/4); /* 16MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &nwktr_state::sound_memmap); - MCFG_DEVICE_ADD("dsp", ADSP21062, XTAL(36'000'000)) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_EPROM) - MCFG_DEVICE_DATA_MAP(sharc0_map) + ADSP21062(config, m_dsp, XTAL(36'000'000)); + m_dsp->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM); + m_dsp->set_addrmap(AS_DATA, &nwktr_state::sharc0_map); - MCFG_DEVICE_ADD("dsp2", ADSP21062, XTAL(36'000'000)) - MCFG_SHARC_BOOT_MODE(BOOT_MODE_EPROM) - MCFG_DEVICE_DATA_MAP(sharc1_map) + ADSP21062(config, m_dsp2, XTAL(36'000'000)); + m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM); + m_dsp2->set_addrmap(AS_DATA, &nwktr_state::sharc1_map); - MCFG_QUANTUM_TIME(attotime::from_hz(9000)) + config.m_minimum_quantum = attotime::from_hz(9000); - MCFG_DEVICE_ADD("m48t58", M48T58, 0) + M48T58(config, "m48t58", 0); ADC12138(config, m_adc12138, 0); m_adc12138->set_ipt_convert_callback(FUNC(nwktr_state::adc12138_input_callback)); @@ -858,33 +858,33 @@ MACHINE_CONFIG_START(nwktr_state::nwktr) K033906(config, "k033906_2", 0, "voodoo1"); /* video hardware */ - MCFG_DEVICE_ADD("voodoo0", VOODOO_1, STD_VOODOO_1_CLOCK) - MCFG_VOODOO_FBMEM(2) - MCFG_VOODOO_TMUMEM(2,2) - MCFG_VOODOO_SCREEN_TAG("lscreen") - MCFG_VOODOO_CPU_TAG("dsp") - MCFG_VOODOO_VBLANK_CB(WRITELINE(*this, nwktr_state,voodoo_vblank_0)) - - MCFG_DEVICE_ADD("voodoo1", VOODOO_1, STD_VOODOO_1_CLOCK) - MCFG_VOODOO_FBMEM(2) - MCFG_VOODOO_TMUMEM(2, 2) - MCFG_VOODOO_SCREEN_TAG("rscreen") - MCFG_VOODOO_CPU_TAG("dsp2") - MCFG_VOODOO_VBLANK_CB(WRITELINE(*this, nwktr_state, voodoo_vblank_1)) - - MCFG_SCREEN_ADD("lscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 384) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) - MCFG_SCREEN_UPDATE_DRIVER(nwktr_state, screen_update_lscreen) - - MCFG_SCREEN_ADD("rscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(512, 384) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) - MCFG_SCREEN_UPDATE_DRIVER(nwktr_state, screen_update_rscreen) - - MCFG_PALETTE_ADD("palette", 65536) + VOODOO_1(config, m_voodoo[0], STD_VOODOO_1_CLOCK); + m_voodoo[0]->set_fbmem(2); + m_voodoo[0]->set_tmumem(2,2); + m_voodoo[0]->set_screen_tag("lscreen"); + m_voodoo[0]->set_cpu_tag(m_dsp); + m_voodoo[0]->vblank_callback().set(FUNC(nwktr_state::voodoo_vblank_0)); + + VOODOO_1(config, m_voodoo[1], STD_VOODOO_1_CLOCK); + m_voodoo[1]->set_fbmem(2); + m_voodoo[1]->set_tmumem(2,2); + m_voodoo[1]->set_screen_tag("rscreen"); + m_voodoo[1]->set_cpu_tag(m_dsp); + m_voodoo[1]->vblank_callback().set(FUNC(nwktr_state::voodoo_vblank_1)); + + screen_device &lscreen(SCREEN(config, "lscreen", SCREEN_TYPE_RASTER)); + lscreen.set_refresh_hz(60); + lscreen.set_size(512, 384); + lscreen.set_visarea(0, 511, 0, 383); + lscreen.set_screen_update(FUNC(nwktr_state::screen_update_lscreen)); + + screen_device &rscreen(SCREEN(config, "rscreen", SCREEN_TYPE_RASTER)); + rscreen.set_refresh_hz(60); + rscreen.set_size(512, 384); + rscreen.set_visarea(0, 511, 0, 383); + rscreen.set_screen_update(FUNC(nwktr_state::screen_update_rscreen)); + + PALETTE(config, m_palette, 65536); K001604(config, m_k001604, 0); m_k001604->set_layer_size(0); @@ -899,14 +899,14 @@ MACHINE_CONFIG_START(nwktr_state::nwktr) K056800(config, m_k056800, XTAL(16'934'400)); m_k056800->int_callback().set_inputline(m_audiocpu, M68K_IRQ_2); - MCFG_DEVICE_ADD("rfsnd", RF5C400, XTAL(16'934'400)) // as per Guru readme above - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + rf5c400_device &rfsnd(RF5C400(config, "rfsnd", XTAL(16'934'400))); // as per Guru readme above + rfsnd.add_route(0, "lspeaker", 1.0); + rfsnd.add_route(1, "rspeaker", 1.0); KONPPC(config, m_konppc, 0); m_konppc->set_num_boards(2); m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_NWKTR); -MACHINE_CONFIG_END +} void nwktr_state::thrilld(machine_config &config) { diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index 4172bcdf759..a8332fc65e3 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -92,6 +92,9 @@ public: void init_srallyc(); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + required_shared_ptr m_workram; required_shared_ptr m_bufferram; std::unique_ptr m_fbvramA; @@ -210,8 +213,7 @@ protected: DECLARE_WRITE8_MEMBER(driveio_port_w); void push_geo_data(uint32_t data); DECLARE_VIDEO_START(model2); - DECLARE_MACHINE_RESET(model2_common); - DECLARE_MACHINE_RESET(model2_scsp); + void reset_model2_scsp(); uint32_t screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // DECLARE_WRITE_LINE_MEMBER(screen_vblank_model2); // DECLARE_WRITE_LINE_MEMBER(sound_ready_w); @@ -325,9 +327,10 @@ public: m_copro_tgp_bank(*this, "copro_tgp_bank") {} - DECLARE_MACHINE_START(model2_tgp); - protected: + virtual void machine_start() override; + virtual void machine_reset() override; + required_device m_copro_tgp; required_shared_ptr m_copro_tgp_program; required_region_ptr m_copro_tgp_tables; @@ -362,8 +365,6 @@ protected: DECLARE_WRITE32_MEMBER(copro_atan_w); DECLARE_READ32_MEMBER(copro_atan_r); - DECLARE_MACHINE_RESET(model2_tgp); - void model2_tgp_mem(address_map &map); void copro_tgp_prog_map(address_map &map); @@ -389,8 +390,6 @@ public: : model2_tgp_state(mconfig, type, tag) {} - DECLARE_MACHINE_RESET(model2o); - void model2o(machine_config &config); void daytona(machine_config &config); void desert(machine_config &config); @@ -460,8 +459,6 @@ public: : model2_tgp_state(mconfig, type, tag) {} - DECLARE_MACHINE_RESET(model2a); - void manxtt(machine_config &config); void manxttdx(machine_config &config); void model2a(machine_config &config); @@ -473,6 +470,8 @@ public: void zeroguna(machine_config &config); protected: + virtual void machine_reset() override; + void model2a_crx_mem(address_map &map); void model2a_5881_mem(address_map &map); void model2a_0229_mem(address_map &map); @@ -492,9 +491,6 @@ public: m_copro_adsp(*this, "copro_adsp") {} - DECLARE_MACHINE_RESET(model2b); - DECLARE_MACHINE_START(model2b); - void model2b(machine_config &config); void model2b_0229(machine_config &config); void model2b_5881(machine_config &config); @@ -505,6 +501,9 @@ public: void zerogun(machine_config &config); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + required_device m_copro_adsp; DECLARE_WRITE32_MEMBER(copro_function_port_w); @@ -542,9 +541,6 @@ public: m_copro_tgpx4_program(*this, "copro_tgpx4_program") {} - DECLARE_MACHINE_RESET(model2c); - DECLARE_MACHINE_START(model2c); - void model2c(machine_config &config); void model2c_5881(machine_config &config); void skisuprg(machine_config &config); @@ -557,6 +553,9 @@ public: void topskatr(machine_config &config); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + required_device m_copro_tgpx4; required_shared_ptr m_copro_tgpx4_program; -- cgit v1.2.3