diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-12-20 05:36:31 +0100 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-12-20 05:36:55 +0100 |
commit | 32650ee591aad59123d549770ee38b2f627b6236 (patch) | |
tree | a2a304a9cb28f3bf5394ba5e50edbffb5ce2d232 /src/mame | |
parent | ef14630b0f6e1e6e0f87d1e309c195f9c1f4ae63 (diff) |
-bus/nes/jaleco, pt554, bus/nes_ctrl/ctrl, hori, joypad: Removed MCFG and MACHINE_CONFIG macros. [Ryan Holtz]
-sound/asc, lmc1992, nes_apu, samples, video/ppu2c0x, ppu2c0x_vt: Removed MCFG macros. [Ryan Holtz]
-audio/astrof, carnival, cclimber, cinemat, depthch, invinco, pulsar, spacefb, targ, tranqgun, turbo, vicdual
vicdual-97271p, zaxxon: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-drivers/8080bw, astinvad, atarist, blockade, cham24, circus, cosmic, equites, famibox, gottlieb, gotya, gridlee,
homerun, m10, m14, m63, mcr, meadows, mmagic, multigam, mw8080bw, nes, nes_vt, ninjakd2, playch10,
safarir, segag80v, starcrus, starfire, suna8, super80, tankbatt, tattack, thief, tmnt, tnzs, triplhnt, vsnes: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-machine/genpin, mm1kb: Removed MACHINE_CONFIG macros. [Ryan Holtz]
Diffstat (limited to 'src/mame')
65 files changed, 2808 insertions, 2946 deletions
diff --git a/src/mame/audio/astrof.cpp b/src/mame/audio/astrof.cpp index 3969227b5d3..89e334a6672 100644 --- a/src/mame/audio/astrof.cpp +++ b/src/mame/audio/astrof.cpp @@ -139,13 +139,14 @@ static const char *const astrof_sample_names[] = nullptr }; -MACHINE_CONFIG_START(astrof_state::astrof_audio) +void astrof_state::astrof_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(astrof_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(astrof_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/audio/carnival.cpp b/src/mame/audio/carnival.cpp index c19f4d5a942..d3bc5db7cc7 100644 --- a/src/mame/audio/carnival.cpp +++ b/src/mame/audio/carnival.cpp @@ -197,8 +197,8 @@ void vicdual_state::mboard_map(address_map &map) } -MACHINE_CONFIG_START(vicdual_state::carnival_audio) - +void vicdual_state::carnival_audio(machine_config &config) +{ /* music board */ I8039(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &vicdual_state::mboard_map); @@ -209,8 +209,8 @@ MACHINE_CONFIG_START(vicdual_state::carnival_audio) AY8912(config, m_psg, XTAL(3'579'545)/3).add_route(ALL_OUTPUTS, "mono", 0.25); /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(10) - MCFG_SAMPLES_NAMES(carnival_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(10); + m_samples->set_samples_names(carnival_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/audio/cclimber.cpp b/src/mame/audio/cclimber.cpp index 1288bdae653..e09c01bd642 100644 --- a/src/mame/audio/cclimber.cpp +++ b/src/mame/audio/cclimber.cpp @@ -57,16 +57,17 @@ void cclimber_audio_device::device_start() // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(cclimber_audio_device::device_add_mconfig) +void cclimber_audio_device::device_add_mconfig(machine_config &config) +{ ay8910_device &aysnd(AY8910(config, "aysnd", SND_CLOCK/2)); aysnd.port_a_write_callback().set(FUNC(cclimber_audio_device::sample_select_w)); aysnd.add_route(ALL_OUTPUTS, ":speaker", 0.5); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(cclimber_audio_device, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":speaker", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(cclimber_audio_device::sh_start)); + m_samples->add_route(ALL_OUTPUTS, ":speaker", 0.5); +} WRITE8_MEMBER(cclimber_audio_device::sample_select_w) diff --git a/src/mame/audio/cinemat.cpp b/src/mame/audio/cinemat.cpp index 5646df01736..e624ab6e8d5 100644 --- a/src/mame/audio/cinemat.cpp +++ b/src/mame/audio/cinemat.cpp @@ -147,7 +147,8 @@ WRITE_LINE_MEMBER(cinemat_state::spacewar_sound4_w) } } -MACHINE_CONFIG_START(cinemat_state::spacewar_sound) +void cinemat_state::spacewar_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::spacewar_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::spacewar_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::spacewar_sound2_w)); @@ -156,11 +157,11 @@ MACHINE_CONFIG_START(cinemat_state::spacewar_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(spacewar_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(spacewar_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -200,18 +201,19 @@ WRITE_LINE_MEMBER(cinemat_state::barrier_sound2_w) m_samples->start(2, 2); } -MACHINE_CONFIG_START(cinemat_state::barrier_sound) +void cinemat_state::barrier_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::barrier_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::barrier_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::barrier_sound2_w)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(barrier_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(barrier_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -256,18 +258,19 @@ WRITE_LINE_MEMBER(cinemat_state::speedfrk_start_led_w) m_led = !state; } -MACHINE_CONFIG_START(cinemat_state::speedfrk_sound) +void cinemat_state::speedfrk_sound(machine_config &config) +{ m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::speedfrk_start_led_w)); m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::speedfrk_sound3_w)); m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::speedfrk_sound4_w)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(speedfrk_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(speedfrk_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -337,7 +340,8 @@ WRITE_LINE_MEMBER(cinemat_state::starhawk_sound7_w) m_samples->stop(3); } -MACHINE_CONFIG_START(cinemat_state::starhawk_sound) +void cinemat_state::starhawk_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::starhawk_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::starhawk_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::starhawk_sound2_w)); @@ -347,11 +351,11 @@ MACHINE_CONFIG_START(cinemat_state::starhawk_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(starhawk_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(starhawk_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -415,7 +419,8 @@ WRITE_LINE_MEMBER(cinemat_16level_state::sundance_sound7_w) m_samples->start(5, 5); } -MACHINE_CONFIG_START(cinemat_16level_state::sundance_sound) +void cinemat_16level_state::sundance_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_16level_state::sundance_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_16level_state::sundance_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_16level_state::sundance_sound2_w)); @@ -425,11 +430,11 @@ MACHINE_CONFIG_START(cinemat_16level_state::sundance_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(sundance_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(sundance_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -497,16 +502,17 @@ WRITE_LINE_MEMBER(cinemat_state::tailg_sound_w) } } -MACHINE_CONFIG_START(cinemat_state::tailg_sound) +void cinemat_state::tailg_sound(machine_config &config) +{ m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::tailg_sound_w)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(tailg_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(tailg_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -566,7 +572,8 @@ WRITE_LINE_MEMBER(cinemat_state::warrior_sound4_w) m_samples->start(4, 4); } -MACHINE_CONFIG_START(cinemat_state::warrior_sound) +void cinemat_state::warrior_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::warrior_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::warrior_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::warrior_sound2_w)); @@ -575,11 +582,11 @@ MACHINE_CONFIG_START(cinemat_state::warrior_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(warrior_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(warrior_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -665,7 +672,8 @@ WRITE_LINE_MEMBER(cinemat_state::armora_sound3_w) m_samples->stop(6); } -MACHINE_CONFIG_START(cinemat_state::armora_sound) +void cinemat_state::armora_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::armora_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::armora_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::armora_sound2_w)); @@ -674,11 +682,11 @@ MACHINE_CONFIG_START(cinemat_state::armora_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(7) - MCFG_SAMPLES_NAMES(armora_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(7); + m_samples->set_samples_names(armora_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -761,7 +769,8 @@ WRITE_LINE_MEMBER(cinemat_state::ripoff_sound7_w) m_samples->start(4, 4); } -MACHINE_CONFIG_START(cinemat_state::ripoff_sound) +void cinemat_state::ripoff_sound(machine_config &config) +{ m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::ripoff_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::ripoff_sound2_w)); m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::ripoff_sound3_w)); @@ -770,11 +779,11 @@ MACHINE_CONFIG_START(cinemat_state::ripoff_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(ripoff_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(ripoff_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -877,7 +886,8 @@ WRITE_LINE_MEMBER(cinemat_state::starcas_sound3_w) m_samples->start(7, 7); } -MACHINE_CONFIG_START(cinemat_state::starcas_sound) +void cinemat_state::starcas_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::starcas_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::starcas_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::starcas_sound2_w)); @@ -886,11 +896,11 @@ MACHINE_CONFIG_START(cinemat_state::starcas_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(starcas_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(starcas_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} @@ -1010,18 +1020,19 @@ WRITE_LINE_MEMBER(cinemat_64level_state::solarq_sound0_w) } } -MACHINE_CONFIG_START(cinemat_64level_state::solarq_sound) +void cinemat_64level_state::solarq_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_64level_state::solarq_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_64level_state::solarq_sound1_w)); m_outlatch->q_out_cb<4>().set(FUNC(cinemat_64level_state::solarq_sound4_w)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(solarq_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(solarq_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} @@ -1147,7 +1158,8 @@ WRITE_LINE_MEMBER(cinemat_color_state::boxingb_sound3_w) m_samples->start(11, 11); } -MACHINE_CONFIG_START(cinemat_color_state::boxingb_sound) +void cinemat_color_state::boxingb_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_color_state::boxingb_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_color_state::boxingb_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_color_state::boxingb_sound2_w)); @@ -1156,11 +1168,11 @@ MACHINE_CONFIG_START(cinemat_color_state::boxingb_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(12) - MCFG_SAMPLES_NAMES(boxingb_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(12); + m_samples->set_samples_names(boxingb_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -1263,7 +1275,8 @@ WRITE_LINE_MEMBER(cinemat_state::wotw_sound3_w) m_samples->start(7, 7); } -MACHINE_CONFIG_START(cinemat_state::wotw_sound) +void cinemat_state::wotw_sound(machine_config &config) +{ m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::wotw_sound0_w)); m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::wotw_sound1_w)); m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::wotw_sound2_w)); @@ -1272,11 +1285,11 @@ MACHINE_CONFIG_START(cinemat_state::wotw_sound) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(wotw_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(wotw_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/audio/depthch.cpp b/src/mame/audio/depthch.cpp index 15f92dfc617..fa91754e077 100644 --- a/src/mame/audio/depthch.cpp +++ b/src/mame/audio/depthch.cpp @@ -83,11 +83,11 @@ WRITE8_MEMBER( vicdual_state::depthch_audio_w ) } -MACHINE_CONFIG_START(vicdual_state::depthch_audio) - +void vicdual_state::depthch_audio(machine_config &config) +{ /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(depthch_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(depthch_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/audio/invinco.cpp b/src/mame/audio/invinco.cpp index 22a51709079..bf0811b2209 100644 --- a/src/mame/audio/invinco.cpp +++ b/src/mame/audio/invinco.cpp @@ -94,11 +94,11 @@ WRITE8_MEMBER( vicdual_state::invinco_audio_w ) } -MACHINE_CONFIG_START(vicdual_state::invinco_audio) - +void vicdual_state::invinco_audio(machine_config &config) +{ /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(invinco_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(invinco_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/audio/pulsar.cpp b/src/mame/audio/pulsar.cpp index 1aae442a9ae..63daee06b11 100644 --- a/src/mame/audio/pulsar.cpp +++ b/src/mame/audio/pulsar.cpp @@ -171,11 +171,11 @@ WRITE8_MEMBER( vicdual_state::pulsar_audio_2_w ) } -MACHINE_CONFIG_START(vicdual_state::pulsar_audio) - +void vicdual_state::pulsar_audio(machine_config &config) +{ /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(12) - MCFG_SAMPLES_NAMES(pulsar_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(12); + m_samples->set_samples_names(pulsar_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/audio/spacefb.cpp b/src/mame/audio/spacefb.cpp index 3128fd58a13..a6e3055d130 100644 --- a/src/mame/audio/spacefb.cpp +++ b/src/mame/audio/spacefb.cpp @@ -77,14 +77,17 @@ static const char *const spacefb_sample_names[] = }; -MACHINE_CONFIG_START(spacefb_state::spacefb_audio) +void spacefb_state::spacefb_audio(machine_config &config) +{ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(spacefb_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); + + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(spacefb_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 1.0); +} diff --git a/src/mame/audio/targ.cpp b/src/mame/audio/targ.cpp index 11320a14ba9..77d2c1fb150 100644 --- a/src/mame/audio/targ.cpp +++ b/src/mame/audio/targ.cpp @@ -176,33 +176,34 @@ SAMPLES_START_CB_MEMBER(exidy_state::targ_audio_start) } -MACHINE_CONFIG_START(exidy_state::spectar_audio) - +void exidy_state::spectar_audio(machine_config &config) +{ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(sample_names) - MCFG_SAMPLES_START_CB(exidy_state, spectar_audio_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) - - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(sample_names); + m_samples->set_samples_start_callback(FUNC(exidy_state::spectar_audio_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); -MACHINE_CONFIG_START(exidy_state::targ_audio) + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.99); + 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); +} +void exidy_state::targ_audio(machine_config &config) +{ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(sample_names) - MCFG_SAMPLES_START_CB(exidy_state, targ_audio_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(sample_names); + m_samples->set_samples_start_callback(FUNC(exidy_state::targ_audio_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.99); + 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); +} diff --git a/src/mame/audio/tranqgun.cpp b/src/mame/audio/tranqgun.cpp index 40c320ca967..c63845f5097 100644 --- a/src/mame/audio/tranqgun.cpp +++ b/src/mame/audio/tranqgun.cpp @@ -140,11 +140,11 @@ WRITE8_MEMBER( vicdual_state::tranqgun_audio_w ) } -MACHINE_CONFIG_START(vicdual_state::tranqgun_audio) - +void vicdual_state::tranqgun_audio(machine_config &config) +{ /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(tranqgun_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(tranqgun_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/audio/turbo.cpp b/src/mame/audio/turbo.cpp index 08fd950006d..642e924a4c6 100644 --- a/src/mame/audio/turbo.cpp +++ b/src/mame/audio/turbo.cpp @@ -183,53 +183,53 @@ static const char *const turbo_sample_names[] = }; -MACHINE_CONFIG_START(turbo_state::turbo_samples) - +void turbo_state::turbo_samples(machine_config &config) +{ /* this is the cockpit speaker configuration */ SPEAKER(config, "fspeaker", 0.0, 0.0, 1.0); // front SPEAKER(config, "bspeaker", 0.0, 0.0, -0.5); // back SPEAKER(config, "lspeaker", -0.2, 0.0, 1.0); // left SPEAKER(config, "rspeaker", 0.2, 0.0, 1.0); // right - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(10) - MCFG_SAMPLES_NAMES(turbo_sample_names) + SAMPLES(config, m_samples); + m_samples->set_channels(10); + m_samples->set_samples_names(turbo_sample_names); /* channel 0 = CRASH.S -> CRASH.S/SM */ - MCFG_SOUND_ROUTE(0, "fspeaker", 0.25) + m_samples->add_route(0, "fspeaker", 0.25); /* channel 1 = TRIG1-4 -> ALARM.M/F/R/L */ - MCFG_SOUND_ROUTE(1, "fspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.25) + m_samples->add_route(1, "fspeaker", 0.25); + m_samples->add_route(1, "rspeaker", 0.25); + m_samples->add_route(1, "lspeaker", 0.25); /* channel 2 = SLIP/SPIN -> SKID.F/R/L/M */ - MCFG_SOUND_ROUTE(2, "fspeaker", 0.25) - MCFG_SOUND_ROUTE(2, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(2, "lspeaker", 0.25) + m_samples->add_route(2, "fspeaker", 0.25); + m_samples->add_route(2, "rspeaker", 0.25); + m_samples->add_route(2, "lspeaker", 0.25); /* channel 3 = CRASH.L -> CRASH.L/LM */ - MCFG_SOUND_ROUTE(3, "bspeaker", 0.25) + m_samples->add_route(3, "bspeaker", 0.25); /* channel 4 = AMBU -> AMBULANCE/AMBULANCE.M */ - MCFG_SOUND_ROUTE(4, "fspeaker", 0.25) + m_samples->add_route(4, "fspeaker", 0.25); /* channel 5 = ACCEL+BSEL -> MYCAR.F/W/M + MYCAR0.F/M + MYCAR1.F/M */ - MCFG_SOUND_ROUTE(5, "fspeaker", 0.25) - MCFG_SOUND_ROUTE(5, "bspeaker", 0.25) + m_samples->add_route(5, "fspeaker", 0.25); + m_samples->add_route(5, "bspeaker", 0.25); /* channel 6 = OSEL -> OCAR.F/FM */ - MCFG_SOUND_ROUTE(6, "fspeaker", 0.25) + m_samples->add_route(6, "fspeaker", 0.25); /* channel 7 = OSEL -> OCAR.L/LM */ - MCFG_SOUND_ROUTE(7, "lspeaker", 0.25) + m_samples->add_route(7, "lspeaker", 0.25); /* channel 8 = OSEL -> OCAR.R/RM */ - MCFG_SOUND_ROUTE(8, "rspeaker", 0.25) + m_samples->add_route(8, "rspeaker", 0.25); /* channel 9 = OSEL -> OCAR.W/WM */ - MCFG_SOUND_ROUTE(9, "bspeaker", 0.25) -MACHINE_CONFIG_END + m_samples->add_route(9, "bspeaker", 0.25); +} /* Cockpit: CN2 1+2 -> FRONT @@ -429,46 +429,47 @@ static const char *const subroc3d_sample_names[] = nullptr }; -MACHINE_CONFIG_START(turbo_state::subroc3d_samples) +void turbo_state::subroc3d_samples(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(12) - MCFG_SAMPLES_NAMES(subroc3d_sample_names) + SAMPLES(config, m_samples); + m_samples->set_channels(12); + m_samples->set_samples_names(subroc3d_sample_names); /* MISSILE in channels 0 and 1 */ - MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) + m_samples->add_route(0, "lspeaker", 0.25); + m_samples->add_route(1, "rspeaker", 0.25); /* TORPEDO in channels 2 and 3 */ - MCFG_SOUND_ROUTE(2, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(3, "rspeaker", 0.25) + m_samples->add_route(2, "lspeaker", 0.25); + m_samples->add_route(3, "rspeaker", 0.25); /* FIGHTER in channels 4 and 5 */ - MCFG_SOUND_ROUTE(4, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(5, "rspeaker", 0.25) + m_samples->add_route(4, "lspeaker", 0.25); + m_samples->add_route(5, "rspeaker", 0.25); /* HIT in channels 6 and 7 */ - MCFG_SOUND_ROUTE(6, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(7, "rspeaker", 0.25) + m_samples->add_route(6, "lspeaker", 0.25); + m_samples->add_route(7, "rspeaker", 0.25); /* FIRE sound in channel 8 */ - MCFG_SOUND_ROUTE(8, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(8, "rspeaker", 0.25) + m_samples->add_route(8, "lspeaker", 0.25); + m_samples->add_route(8, "rspeaker", 0.25); /* SHIP EXP sound in channel 9 */ - MCFG_SOUND_ROUTE(9, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(9, "rspeaker", 0.25) + m_samples->add_route(9, "lspeaker", 0.25); + m_samples->add_route(9, "rspeaker", 0.25); /* ALARM TRIG sound in channel 10 */ - MCFG_SOUND_ROUTE(10, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(10, "rspeaker", 0.25) + m_samples->add_route(10, "lspeaker", 0.25); + m_samples->add_route(10, "rspeaker", 0.25); /* PROLOGUE sound in channel 11 */ - MCFG_SOUND_ROUTE(11, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(11, "rspeaker", 0.25) -MACHINE_CONFIG_END + m_samples->add_route(11, "lspeaker", 0.25); + m_samples->add_route(11, "rspeaker", 0.25); +} @@ -575,13 +576,14 @@ static const char *const buckrog_sample_names[]= }; -MACHINE_CONFIG_START(turbo_state::buckrog_samples) +void turbo_state::buckrog_samples(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(buckrog_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(buckrog_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.25); +} diff --git a/src/mame/audio/vicdual-97271p.cpp b/src/mame/audio/vicdual-97271p.cpp index 6daeb676d89..6d202e73a15 100644 --- a/src/mame/audio/vicdual-97271p.cpp +++ b/src/mame/audio/vicdual-97271p.cpp @@ -86,15 +86,16 @@ s97271p_device::s97271p_device(const machine_config &mconfig, const char *tag, d // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(s97271p_device::device_add_mconfig) +void s97271p_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "mono").front_center(); /* samples */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(13) - MCFG_SAMPLES_NAMES(nsub_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(13); + m_samples->set_samples_names(nsub_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); +} //------------------------------------------------- // device_start - device-specific startup diff --git a/src/mame/audio/vicdual.cpp b/src/mame/audio/vicdual.cpp index e0ab608bd7b..8a21e9fd788 100644 --- a/src/mame/audio/vicdual.cpp +++ b/src/mame/audio/vicdual.cpp @@ -111,15 +111,16 @@ static const char *const frogs_sample_names[] = }; -MACHINE_CONFIG_START(vicdual_state::frogs_audio) - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(frogs_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) +void vicdual_state::frogs_audio(machine_config &config) +{ + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(frogs_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.35); - MCFG_DEVICE_ADD("discrete", DISCRETE, frogs_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, frogs_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} TIMER_CALLBACK_MEMBER( vicdual_state::frogs_croak_callback ) @@ -444,11 +445,11 @@ static DISCRETE_SOUND_START(headon_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(vicdual_state::headon_audio) - - MCFG_DEVICE_ADD("discrete", DISCRETE, headon_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END +void vicdual_state::headon_audio(machine_config &config) +{ + DISCRETE(config, m_discrete, headon_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} WRITE8_MEMBER( vicdual_state::headon_audio_w ) { @@ -590,12 +591,13 @@ static const char *const brdrline_sample_names[] = }; -MACHINE_CONFIG_START(vicdual_state::brdrline_audio) - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(7) - MCFG_SAMPLES_NAMES(brdrline_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) -MACHINE_CONFIG_END +void vicdual_state::brdrline_audio(machine_config &config) +{ + SAMPLES(config, m_samples); + m_samples->set_channels(7); + m_samples->set_samples_names(brdrline_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.35); +} WRITE8_MEMBER( vicdual_state::brdrline_audio_w ) { diff --git a/src/mame/audio/zaxxon.cpp b/src/mame/audio/zaxxon.cpp index 8220bf1885f..cada06e9bc0 100644 --- a/src/mame/audio/zaxxon.cpp +++ b/src/mame/audio/zaxxon.cpp @@ -92,12 +92,13 @@ static const char *const zaxxon_sample_names[] = }; -MACHINE_CONFIG_START(zaxxon_state::zaxxon_samples) - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(12) - MCFG_SAMPLES_NAMES(zaxxon_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END +void zaxxon_state::zaxxon_samples(machine_config &config) +{ + SAMPLES(config, m_samples); + m_samples->set_channels(12); + m_samples->set_samples_names(zaxxon_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); +} @@ -192,12 +193,13 @@ static const char *const congo_sample_names[] = }; -MACHINE_CONFIG_START(zaxxon_state::congo_samples) - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(congo_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END +void zaxxon_state::congo_samples(machine_config &config) +{ + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(congo_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); +} diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp index 1cde5338f2f..5cb882ade9a 100644 --- a/src/mame/drivers/8080bw.cpp +++ b/src/mame/drivers/8080bw.cpp @@ -407,12 +407,12 @@ INPUT_PORTS_END /* same as regular invaders, but with a color board added */ -MACHINE_CONFIG_START(_8080bw_state::invadpt2) +void _8080bw_state::invadpt2(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(invadpt2_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::invadpt2_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* 60 Hz signal clocks two LS161. Ripple carry will */ @@ -420,17 +420,17 @@ MACHINE_CONFIG_START(_8080bw_state::invadpt2) WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invadpt2)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ invaders_samples_audio(config); -MACHINE_CONFIG_END +} @@ -451,13 +451,13 @@ void _8080bw_state::spacerng_io_map(address_map &map) map(0x06, 0x06).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); } -MACHINE_CONFIG_START(_8080bw_state::spacerng) +void _8080bw_state::spacerng(machine_config &config) +{ invadpt2(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(spacerng_io_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::spacerng_io_map); +} @@ -494,28 +494,27 @@ static INPUT_PORTS_START( spcewars ) PORT_DIPSETTING( 0x08, "2000" ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::spcewars) +void _8080bw_state::spcewars(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(spcewars_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::spcewars_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* sound hardware */ invaders_samples_audio(config); /* extra audio channel */ - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invaders) -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invaders)); +} /*******************************************************/ @@ -538,17 +537,18 @@ void _8080bw_state::spcewarla_io_map(address_map &map) map(0x0c, 0x0c).w(m_mb14241, FUNC(mb14241_device::shift_data_w)); } -MACHINE_CONFIG_START(_8080bw_state::spcewarla) +void _8080bw_state::spcewarla(machine_config &config) +{ spcewars(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(spcewarla_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::spcewarla_io_map); WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); - MCFG_PALETTE_ADD_3BIT_RBG("palette") - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2) -MACHINE_CONFIG_END + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); + + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invadpt2)); +} /*******************************************************/ @@ -605,14 +605,13 @@ static INPUT_PORTS_START( astropal ) PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::astropal) +void _8080bw_state::astropal(machine_config &config) +{ invaders(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(astropal_io_map) - -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::astropal_io_map); +} @@ -659,25 +658,26 @@ static INPUT_PORTS_START( cosmo ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) /* must be HIGH normally or the joystick won't work */ INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::cosmo) +void _8080bw_state::cosmo(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(cosmo_map) - MCFG_DEVICE_IO_MAP(cosmo_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::cosmo_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::cosmo_io_map); + WATCHDOG_TIMER(config, m_watchdog); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_cosmo) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_cosmo)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); /* sound hardware */ invaders_samples_audio(config); -MACHINE_CONFIG_END +} @@ -819,30 +819,30 @@ void _8080bw_state::spacecom_io_map(address_map &map) map(0x44, 0x44).portr("IN2").w(FUNC(_8080bw_state::invaders_audio_2_w)); } -MACHINE_CONFIG_START(_8080bw_state::spacecom) - +void _8080bw_state::spacecom(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080A, XTAL(18'000'000) / 10) // divider guessed + I8080A(config, m_maincpu, XTAL(18'000'000) / 10); // divider guessed // TODO: move irq handling away from mw8080.c, this game runs on custom hardware - MCFG_DEVICE_PROGRAM_MAP(spacecom_map) - MCFG_DEVICE_IO_MAP(spacecom_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::spacecom_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::spacecom_io_map); MCFG_MACHINE_START_OVERRIDE(mw8080bw_state, mw8080bw) MCFG_MACHINE_RESET_OVERRIDE(mw8080bw_state, mw8080bw) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_spacecom) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_spacecom)); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ invaders_audio(config); -MACHINE_CONFIG_END +} void _8080bw_state::init_spacecom() { @@ -933,34 +933,33 @@ static INPUT_PORTS_START( invrvnge ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::invrvnge) +void _8080bw_state::invrvnge(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(invrvnge_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::invrvnge_io_map); WATCHDOG_TIMER(config, m_watchdog); - MCFG_DEVICE_ADD("audiocpu", M6808, XTAL(4'000'000)/2) // MC6808P - MCFG_DEVICE_PROGRAM_MAP(invrvnge_sound_map) + M6808(config, "audiocpu", XTAL(4'000'000)/2).set_addrmap(AS_PROGRAM, &_8080bw_state::invrvnge_sound_map); // MC6808P /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invadpt2)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); AY8910(config, "ay1", XTAL(4'000'000)/2).add_route(ALL_OUTPUTS, "mono", 0.5); -MACHINE_CONFIG_END +} @@ -1072,11 +1071,11 @@ void _8080bw_state::starw1_io_map(address_map &map) map(0x07, 0x07).nopw(); /* writes 89 at boot */ } -MACHINE_CONFIG_START(_8080bw_state::starw1) +void _8080bw_state::starw1(machine_config &config) +{ invadpt2(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(starw1_io_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::starw1_io_map); +} /*******************************************************/ /* */ @@ -1114,68 +1113,68 @@ static INPUT_PORTS_START( lrescue ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:8" ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::lrescue) +void _8080bw_state::lrescue(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(lrescue_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::lrescue_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invadpt2)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(lrescue_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(lrescue_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.75); /* extra audio channel */ - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(_8080bw_state::escmars) + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); +} +void _8080bw_state::escmars(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080, XTAL(18'000'000) / 10) // divider guessed - MCFG_DEVICE_PROGRAM_MAP(escmars_map) - MCFG_DEVICE_IO_MAP(lrescue_io_map) + I8080(config, m_maincpu, XTAL(18'000'000) / 10); // divider guessed + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::escmars_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::lrescue_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state, extra_8080bw) MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state, mw8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MW8080BW_PIXEL_CLOCK, MW8080BW_HTOTAL, MW8080BW_HBEND, MW8080BW_HPIXCOUNT, MW8080BW_VTOTAL, MW8080BW_VBEND, MW8080BW_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_mw8080bw) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MW8080BW_PIXEL_CLOCK, MW8080BW_HTOTAL, MW8080BW_HBEND, MW8080BW_HPIXCOUNT, MW8080BW_VTOTAL, MW8080BW_VBEND, MW8080BW_VBSTART); + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_mw8080bw)); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(lrescue_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(lrescue_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.75); /* extra audio channel */ - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); +} @@ -1243,28 +1242,27 @@ void _8080bw_state::cosmicmo_io_map(address_map &map) map(0x06, 0x06).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); } -MACHINE_CONFIG_START(_8080bw_state::cosmicmo) +void _8080bw_state::cosmicmo(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(cosmicmo_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", _8080bw_state, irq0_line_hold) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::cosmicmo_io_map); + m_maincpu->set_vblank_int("screen", FUNC(_8080bw_state::irq0_line_hold)); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* sound hardware */ invaders_audio(config); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invaders) -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invaders)); +} /*******************************************************/ @@ -1395,29 +1393,28 @@ MACHINE_START_MEMBER(_8080bw_state,rollingc) MACHINE_START_CALL_MEMBER(mw8080bw); } -MACHINE_CONFIG_START(_8080bw_state::rollingc) +void _8080bw_state::rollingc(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(rollingc_map) - MCFG_DEVICE_IO_MAP(rollingc_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::rollingc_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::rollingc_io_map); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_rollingc) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_rollingc)); - MCFG_PALETTE_ADD("palette", 16) - MCFG_PALETTE_INIT_OWNER(_8080bw_state, rollingc) + PALETTE(config, m_palette, 16); + m_palette->set_init(FUNC(_8080bw_state::palette_init_rollingc)); /* sound hardware */ invaders_samples_audio(config); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,rollingc) -MACHINE_CONFIG_END +} @@ -1538,28 +1535,29 @@ MACHINE_RESET_MEMBER(_8080bw_state,schaser) MACHINE_RESET_CALL_MEMBER(mw8080bw); } -MACHINE_CONFIG_START(_8080bw_state::schaser) +void _8080bw_state::schaser(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu",I8080,1996800) /* 19.968MHz / 10 */ - MCFG_DEVICE_PROGRAM_MAP(schaser_map) - MCFG_DEVICE_IO_MAP(schaser_io_map) + I8080(config.replace(), m_maincpu, 1996800); /* 19.968MHz / 10 */ + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::schaser_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::schaser_io_map); WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,schaser) MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,schaser) - MCFG_TIMER_DRIVER_ADD("schaser_sh_555", _8080bw_state, schaser_effect_555_cb) + TIMER(config, "schaser_sh_555").configure_generic(FUNC(_8080bw_state::schaser_effect_555_cb)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_schaser) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_schaser)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1580,9 +1578,9 @@ MACHINE_CONFIG_START(_8080bw_state::schaser) snsnd.set_enable(1); snsnd.add_route(0, "discrete", 1.0, 0); - MCFG_DEVICE_ADD("discrete", DISCRETE, schaser_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, schaser_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} @@ -1673,36 +1671,36 @@ MACHINE_START_MEMBER(_8080bw_state,schasercv) MACHINE_START_CALL_MEMBER(mw8080bw); } -MACHINE_CONFIG_START(_8080bw_state::schasercv) +void _8080bw_state::schasercv(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(schaser_map) - MCFG_DEVICE_IO_MAP(schasercv_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::schaser_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::schasercv_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state, schasercv) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_schasercv) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_schasercv)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ invaders_samples_audio(config); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); +} -MACHINE_CONFIG_START(_8080bw_state::crashrd) +void _8080bw_state::crashrd(machine_config &config) +{ schaser(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(crashrd_io_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::crashrd_io_map); +} @@ -1772,25 +1770,26 @@ MACHINE_START_MEMBER(_8080bw_state,sflush) MACHINE_START_CALL_MEMBER(mw8080bw); } -MACHINE_CONFIG_START(_8080bw_state::sflush) +void _8080bw_state::sflush(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu",M6800,1500000) // ? - MCFG_DEVICE_PROGRAM_MAP(sflush_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", _8080bw_state, irq0_line_hold) + M6800(config.replace(), m_maincpu, 1500000); // ? + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::sflush_map); + m_maincpu->set_vblank_int("screen", FUNC(_8080bw_state::irq0_line_hold)); + MCFG_MACHINE_START_OVERRIDE(_8080bw_state,sflush) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_sflush) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_sflush)); - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(_8080bw_state, sflush) -MACHINE_CONFIG_END + PALETTE(config, m_palette, 8); + m_palette->set_init(FUNC(_8080bw_state::palette_init_sflush)); +} @@ -1877,23 +1876,24 @@ static INPUT_PORTS_START( lupin3a ) PORT_DIPSETTING( 0x10, DEF_STR( Japanese ) ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::lupin3) +void _8080bw_state::lupin3(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(lupin3_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::lupin3_io_map); + WATCHDOG_TIMER(config, m_watchdog); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_indianbt)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1914,26 +1914,28 @@ MACHINE_CONFIG_START(_8080bw_state::lupin3) snsnd.set_enable(1); snsnd.add_route(ALL_OUTPUTS, "mono", 0.5); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(lupin3_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(lupin3_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("discrete", DISCRETE, indianbt_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, indianbt_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(_8080bw_state::lupin3a) +void _8080bw_state::lupin3a(machine_config &config) +{ lupin3(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(schaser_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::schaser_map); + MCFG_MACHINE_START_OVERRIDE(_8080bw_state,sflush) + /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_lupin3) - MCFG_DEVICE_REMOVE("palette") - MCFG_PALETTE_ADD_3BIT_RBG("palette") -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_lupin3)); + + PALETTE(config.replace(), m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); +} @@ -2043,34 +2045,35 @@ static INPUT_PORTS_START( polaris ) PORT_ADJUSTER( 90, "Sub Volume VR3" ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::polaris) +void _8080bw_state::polaris(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu",I8080,1996800) /* 19.968MHz / 10 */ - MCFG_DEVICE_PROGRAM_MAP(schaser_map) - MCFG_DEVICE_IO_MAP(polaris_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", _8080bw_state, polaris_interrupt) + I8080(config.replace(), m_maincpu, 1996800); /* 19.968MHz / 10 */ + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::schaser_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::polaris_io_map); + m_maincpu->set_vblank_int("screen", FUNC(_8080bw_state::polaris_interrupt)); WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,polaris) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_polaris) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_polaris)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, polaris_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, polaris_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} @@ -2175,29 +2178,29 @@ static INPUT_PORTS_START( ballbomb ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::ballbomb) +void _8080bw_state::ballbomb(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(ballbomb_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::ballbomb_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_ballbomb) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_ballbomb)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ invaders_samples_audio(config); - MCFG_DEVICE_ADD("discrete", DISCRETE, ballbomb_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, ballbomb_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} @@ -2257,22 +2260,21 @@ static INPUT_PORTS_START( yosakdon ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::yosakdon) +void _8080bw_state::yosakdon(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(yosakdon_map) - MCFG_DEVICE_IO_MAP(yosakdon_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::yosakdon_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::yosakdon_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* sound hardware */ invaders_samples_audio(config); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invaders) -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invaders)); +} @@ -2423,53 +2425,55 @@ void _8080bw_state::indianbtbr_io_map(address_map &map) } -MACHINE_CONFIG_START(_8080bw_state::indianbt) +void _8080bw_state::indianbt(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(indianbt_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::indianbt_io_map); + WATCHDOG_TIMER(config, m_watchdog); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_indianbt)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); /* sound hardware */ invaders_samples_audio(config); - MCFG_DEVICE_ADD("discrete", DISCRETE, indianbt_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, indianbt_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.25); +} -MACHINE_CONFIG_START(_8080bw_state::indianbtbr) +void _8080bw_state::indianbtbr(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(schaser_map) - MCFG_DEVICE_IO_MAP(indianbtbr_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::schaser_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::indianbtbr_io_map); + WATCHDOG_TIMER(config, m_watchdog); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_indianbt)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); /* sound hardware */ invaders_samples_audio(config); -MACHINE_CONFIG_END +} @@ -2525,26 +2529,27 @@ static INPUT_PORTS_START( steelwkr ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::steelwkr) +void _8080bw_state::steelwkr(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(steelwkr_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::steelwkr_io_map); + MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invadpt2) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invadpt2)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ invaders_samples_audio(config); -MACHINE_CONFIG_END +} @@ -2745,30 +2750,30 @@ void _8080bw_state::shuttlei_io_map(address_map &map) } -MACHINE_CONFIG_START(_8080bw_state::shuttlei) - +void _8080bw_state::shuttlei(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080, XTAL(18'000'000) / 9) + I8080(config, m_maincpu, XTAL(18'000'000) / 9); // TODO: move irq handling away from mw8080.cpp, this game runs on custom hardware - MCFG_DEVICE_PROGRAM_MAP(shuttlei_map) - MCFG_DEVICE_IO_MAP(shuttlei_io_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::shuttlei_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::shuttlei_io_map); MCFG_MACHINE_START_OVERRIDE(_8080bw_state, extra_8080bw) MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state, mw8080bw) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 24*8-1) - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_shuttlei) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 24*8-1); + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_shuttlei)); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ invaders_samples_audio(config); -MACHINE_CONFIG_END +} @@ -2871,14 +2876,14 @@ static INPUT_PORTS_START( darthvdr ) INVADERS_CAB_TYPE_PORT INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::darthvdr) +void _8080bw_state::darthvdr(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(darthvdr_map) - MCFG_DEVICE_IO_MAP(darthvdr_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", _8080bw_state, irq0_line_hold) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::darthvdr_map); + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::darthvdr_io_map); + m_maincpu->set_vblank_int("screen", FUNC(_8080bw_state::irq0_line_hold)); MCFG_MACHINE_START_OVERRIDE(_8080bw_state,darthvdr) MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,darthvdr) @@ -2887,9 +2892,8 @@ MACHINE_CONFIG_START(_8080bw_state::darthvdr) invaders_samples_audio(config); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invaders) -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invaders)); +} @@ -2946,27 +2950,27 @@ static INPUT_PORTS_START( vortex ) PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::vortex) +void _8080bw_state::vortex(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(vortex_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::vortex_io_map); + MCFG_MACHINE_START_OVERRIDE(_8080bw_state,extra_8080bw) WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_usec(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL))); /* video hardware */ // TODO: replace with modified invaders color renderer code allowing midscanline color writes - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_invaders) + m_screen->set_screen_update(FUNC(_8080bw_state::screen_update_invaders)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ invaders_audio(config); -MACHINE_CONFIG_END +} /* decrypt function for vortex */ void _8080bw_state::init_vortex() @@ -3254,20 +3258,20 @@ MACHINE_START_MEMBER(_8080bw_state, claybust) MACHINE_START_CALL_MEMBER(mw8080bw); } -MACHINE_CONFIG_START(_8080bw_state::claybust) +void _8080bw_state::claybust(machine_config &config) +{ invaders(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(claybust_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::claybust_io_map); - MCFG_TIMER_DRIVER_ADD("claybust_gun", _8080bw_state, claybust_gun_callback) + TIMER(config, "claybust_gun").configure_generic(FUNC(_8080bw_state::claybust_gun_callback)); MCFG_MACHINE_START_OVERRIDE(_8080bw_state, claybust) /* sound hardware */ // TODO: discrete sound -MACHINE_CONFIG_END +} @@ -3371,19 +3375,19 @@ static INPUT_PORTS_START( attackfc ) INPUT_PORTS_END -MACHINE_CONFIG_START(_8080bw_state::attackfc) +void _8080bw_state::attackfc(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(attackfc_io_map) + m_maincpu->set_addrmap(AS_IO, &_8080bw_state::attackfc_io_map); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* sound hardware */ // TODO: custom discrete -MACHINE_CONFIG_END +} void _8080bw_state::init_attackfc() @@ -3511,17 +3515,17 @@ WRITE8_MEMBER(_8080bw_state::invmulti_bank_w) membank("bank2")->set_entry(bank); } -MACHINE_CONFIG_START(_8080bw_state::invmulti) +void _8080bw_state::invmulti(machine_config &config) +{ invaders(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(invmulti_map) + m_maincpu->set_addrmap(AS_PROGRAM, &_8080bw_state::invmulti_map); - EEPROM_93C46_8BIT(config, "eeprom"); + EEPROM_93C46_8BIT(config, m_eeprom); MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state, mw8080bw) -MACHINE_CONFIG_END +} void _8080bw_state::init_invmulti() { diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp index b0f0efb45e7..5ef752ce9b8 100644 --- a/src/mame/drivers/astinvad.cpp +++ b/src/mame/drivers/astinvad.cpp @@ -668,12 +668,12 @@ static const char *const astinvad_sample_names[] = * *************************************/ -MACHINE_CONFIG_START(astinvad_state::kamikaze) - +void astinvad_state::kamikaze(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(kamikaze_map) - MCFG_DEVICE_IO_MAP(kamikaze_portmap) + Z80(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &astinvad_state::kamikaze_map); + m_maincpu->set_addrmap(AS_IO, &astinvad_state::kamikaze_portmap); MCFG_MACHINE_START_OVERRIDE(astinvad_state, kamikaze) MCFG_MACHINE_RESET_OVERRIDE(astinvad_state, kamikaze) @@ -688,23 +688,24 @@ MACHINE_CONFIG_START(astinvad_state::kamikaze) m_ppi8255_1->out_pb_callback().set(FUNC(astinvad_state::kamikaze_sound2_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 32, 256) - MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_astinvad) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(VIDEO_CLOCK, 320, 0, 256, 256, 32, 256); + m_screen->set_screen_update(FUNC(astinvad_state::screen_update_astinvad)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(astinvad_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(astinvad_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(astinvad_state::spcking2) +void astinvad_state::spcking2(machine_config &config) +{ kamikaze(config); /* basic machine hardware */ @@ -713,19 +714,17 @@ MACHINE_CONFIG_START(astinvad_state::spcking2) m_ppi8255_1->out_pc_callback().set(FUNC(astinvad_state::spcking2_sound3_w)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 16, 240) - MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_spcking2) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(astinvad_state::spaceint) + m_screen->set_raw(VIDEO_CLOCK, 320, 0, 256, 256, 16, 240); + m_screen->set_screen_update(FUNC(astinvad_state::screen_update_spcking2)); +} +void astinvad_state::spaceint(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK) /* a guess */ - MCFG_DEVICE_PROGRAM_MAP(spaceint_map) - MCFG_DEVICE_IO_MAP(spaceint_portmap) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", astinvad_state, irq0_line_hold) + Z80(config, m_maincpu, MASTER_CLOCK); /* a guess */ + m_maincpu->set_addrmap(AS_PROGRAM, &astinvad_state::spaceint_map); + m_maincpu->set_addrmap(AS_IO, &astinvad_state::spaceint_portmap); + m_maincpu->set_vblank_int("screen", FUNC(astinvad_state::irq0_line_hold)); MCFG_MACHINE_START_OVERRIDE(astinvad_state, spaceint) MCFG_MACHINE_RESET_OVERRIDE(astinvad_state, spaceint) @@ -733,22 +732,23 @@ MACHINE_CONFIG_START(astinvad_state::spaceint) /* video hardware */ MCFG_VIDEO_START_OVERRIDE(astinvad_state, spaceint) - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_spaceint) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 1*8, 31*8-1); + m_screen->set_refresh_hz(60); + m_screen->set_screen_update(FUNC(astinvad_state::screen_update_spaceint)); - MCFG_PALETTE_ADD_3BIT_RBG("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rbg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(astinvad_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(astinvad_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp index 36a57fda4ca..4b86c5348d4 100644 --- a/src/mame/drivers/atarist.cpp +++ b/src/mame/drivers/atarist.cpp @@ -1994,72 +1994,47 @@ static void atari_floppies(device_slot_interface &device) // MACHINE CONFIGURATION //************************************************************************** -void st_state::keyboard(machine_config &config) +void st_state::common(machine_config &config) { - hd6301_cpu_device &ikbd(HD6301(config, HD6301V1_TAG, Y2/8)); - ikbd.set_addrmap(AS_PROGRAM, &st_state::ikbd_map); - ikbd.in_p1_cb().set(FUNC(st_state::ikbd_port1_r)); - ikbd.in_p2_cb().set(FUNC(st_state::ikbd_port2_r)); - ikbd.out_p2_cb().set(FUNC(st_state::ikbd_port2_w)); - ikbd.out_p3_cb().set(FUNC(st_state::ikbd_port3_w)); - ikbd.in_p4_cb().set(FUNC(st_state::ikbd_port4_r)); - ikbd.out_p4_cb().set(FUNC(st_state::ikbd_port4_w)); -} - -//------------------------------------------------- -// MACHINE_CONFIG( st ) -//------------------------------------------------- - -MACHINE_CONFIG_START(st_state::st) // basic machine hardware - MCFG_DEVICE_ADD(M68000_TAG, M68000, Y2/4) - MCFG_DEVICE_PROGRAM_MAP(st_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(st_state,atarist_int_ack) + M68000(config, m_maincpu, Y2/4); + m_maincpu->set_irq_acknowledge_callback(FUNC(st_state::atarist_int_ack)); keyboard(config); - // video hardware - MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) - MCFG_SCREEN_UPDATE_DRIVER(st_state, screen_update) - MCFG_SCREEN_RAW_PARAMS(Y2/2, ATARIST_HTOT_PAL*2, ATARIST_HBEND_PAL*2, ATARIST_HBSTART_PAL*2, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL) - - MCFG_PALETTE_ADD("palette", 16) - - // sound hardware - SPEAKER(config, "mono").front_center(); - ym2149_device &ym2149(YM2149(config, YM2149_TAG, Y2/16)); - ym2149.set_flags(AY8910_SINGLE_OUTPUT); - ym2149.set_resistors_load(RES_K(1), 0, 0); - ym2149.port_a_write_callback().set(FUNC(st_state::psg_pa_w)); - ym2149.port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); - ym2149.add_route(ALL_OUTPUTS, "mono", 1.00); + // sound + YM2149(config, m_ymsnd, Y2/16); + m_ymsnd->set_flags(AY8910_SINGLE_OUTPUT); + m_ymsnd->set_resistors_load(RES_K(1), 0, 0); + m_ymsnd->port_a_write_callback().set(FUNC(st_state::psg_pa_w)); + m_ymsnd->port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); // devices - WD1772(config, m_fdc, Y2/4); m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert(); m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w)); - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats) + FLOPPY_CONNECTOR(config, WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats); + FLOPPY_CONNECTOR(config, WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats); - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(m_mfp, mc68901_device, i0_w)) + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->busy_handler().set(m_mfp, FUNC(mc68901_device::i0_w)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + m_centronics->set_output_latch(cent_data_out); MC68901(config, m_mfp, Y2/8); m_mfp->set_timer_clock(Y1); m_mfp->set_rx_clock(0); m_mfp->set_tx_clock(0); - m_mfp->out_irq_cb().set_inputline(M68000_TAG, M68K_IRQ_6); + m_mfp->out_irq_cb().set_inputline(m_maincpu, M68K_IRQ_6); m_mfp->out_tdo_cb().set(FUNC(st_state::mfp_tdo_w)); - m_mfp->out_so_cb().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); + m_mfp->out_so_cb().set(m_rs232, FUNC(rs232_port_device::write_txd)); - rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); - rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); - rs232.dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); - rs232.cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); - rs232.ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); + RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); + m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); + m_rs232->dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); + m_rs232->cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); + m_rs232->ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); ACIA6850(config, m_acia0, 0); m_acia0->txd_handler().set(FUNC(st_state::ikbd_tx_w)); @@ -2072,260 +2047,177 @@ MACHINE_CONFIG_START(st_state::st) input_merger_device &aciairq(INPUT_MERGER_ANY_HIGH(config, "aciairq")); aciairq.output_handler().set(m_mfp, FUNC(mc68901_device::i4_w)).invert(); - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxd)) - - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") + MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(m_acia1, FUNC(acia6850_device::write_rxd)); + MIDI_PORT(config, "mdout", midiout_slot, "midiout"); - MCFG_DEVICE_ADD("acia_clock", CLOCK, Y2/64) // 500kHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, st_state, write_acia_clock)) + CLOCK(config, "acia_clock", Y2/64).signal_handler().set(FUNC(st_state::write_acia_clock)); // 500kHz // cartridge - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "st_cart") - MCFG_GENERIC_EXTENSIONS("bin,rom") - MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH) - MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG) - MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart") - - // internal ram - RAM(config, m_ram) - .set_default_size("1M") // 1040ST - .set_extra_options("512K,256K"); // 520ST, 260ST + GENERIC_CARTSLOT(config, m_cart, generic_linear_slot, "st_cart", "bin,rom"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_endian(ENDIANNESS_BIG); // software lists - MCFG_SOFTWARE_LIST_ADD("flop_list", "st_flop") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "flop_list").set_original("st_flop"); +} +void st_state::keyboard(machine_config &config) +{ + hd6301_cpu_device &ikbd(HD6301(config, HD6301V1_TAG, Y2/8)); + ikbd.set_addrmap(AS_PROGRAM, &st_state::ikbd_map); + ikbd.in_p1_cb().set(FUNC(st_state::ikbd_port1_r)); + ikbd.in_p2_cb().set(FUNC(st_state::ikbd_port2_r)); + ikbd.out_p2_cb().set(FUNC(st_state::ikbd_port2_w)); + ikbd.out_p3_cb().set(FUNC(st_state::ikbd_port3_w)); + ikbd.in_p4_cb().set(FUNC(st_state::ikbd_port4_r)); + ikbd.out_p4_cb().set(FUNC(st_state::ikbd_port4_w)); +} //------------------------------------------------- -// MACHINE_CONFIG( megast ) +// MACHINE_CONFIG( st ) //------------------------------------------------- -MACHINE_CONFIG_START(megast_state::megast) - // basic machine hardware - MCFG_DEVICE_ADD(M68000_TAG, M68000, Y2/4) - MCFG_DEVICE_PROGRAM_MAP(megast_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(st_state,atarist_int_ack) +void st_state::st(machine_config &config) +{ + common(config); - keyboard(config); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &st_state::st_map); // video hardware - MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) - MCFG_SCREEN_UPDATE_DRIVER(megast_state, screen_update) - MCFG_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_screen_update(FUNC(st_state::screen_update)); + m_screen->set_raw(Y2/2, ATARIST_HTOT_PAL*2, ATARIST_HBEND_PAL*2, ATARIST_HBSTART_PAL*2, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL); - MCFG_PALETTE_ADD("palette", 16) + PALETTE(config, m_palette, 16); // sound hardware SPEAKER(config, "mono").front_center(); - ym2149_device &ym2149(YM2149(config, YM2149_TAG, Y2/16)); - ym2149.set_flags(AY8910_SINGLE_OUTPUT); - ym2149.set_resistors_load(RES_K(1), 0, 0); - ym2149.port_a_write_callback().set(FUNC(st_state::psg_pa_w)); - ym2149.port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); - ym2149.add_route(ALL_OUTPUTS, "mono", 1.00); + m_ymsnd->add_route(ALL_OUTPUTS, "mono", 1.00); - // devices - RP5C15(config, RP5C15_TAG, XTAL(32'768)); - - WD1772(config, m_fdc, Y2/4); - m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert(); - m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w)); - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats) + // cartridge + SOFTWARE_LIST(config, "cart_list").set_original("st_cart"); - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(m_mfp, mc68901_device, i0_w)) + // internal ram + RAM(config, m_ram); + m_ram->set_default_size("1M"); // 1040ST + m_ram->set_extra_options("512K,256K"); // 520ST, 260ST +} - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - MC68901(config, m_mfp, Y2/8); - m_mfp->set_timer_clock(Y1); - m_mfp->set_rx_clock(0); - m_mfp->set_tx_clock(0); - m_mfp->out_irq_cb().set_inputline(M68000_TAG, M68K_IRQ_6); - m_mfp->out_tdo_cb().set(FUNC(st_state::mfp_tdo_w)); - m_mfp->out_so_cb().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); - - rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); - rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); - rs232.dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); - rs232.cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); - rs232.ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); +//------------------------------------------------- +// MACHINE_CONFIG( megast ) +//------------------------------------------------- - ACIA6850(config, m_acia0, 0); - m_acia0->txd_handler().set(FUNC(st_state::ikbd_tx_w)); - m_acia0->irq_handler().set("aciairq", FUNC(input_merger_device::in_w<0>)); +void megast_state::megast(machine_config &config) +{ + common(config); - ACIA6850(config, m_acia1, 0); - m_acia1->txd_handler().set("mdout", FUNC(midi_port_device::write_txd)); - m_acia1->irq_handler().set("aciairq", FUNC(input_merger_device::in_w<1>)); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &megast_state::megast_map); - input_merger_device &aciairq(INPUT_MERGER_ANY_HIGH(config, "aciairq")); - aciairq.output_handler().set(m_mfp, FUNC(mc68901_device::i4_w)).invert(); + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_screen_update(FUNC(megast_state::screen_update)); + m_screen->set_raw(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL); - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxd)) + PALETTE(config, m_palette, 16); - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") + // sound hardware + SPEAKER(config, "mono").front_center(); + m_ymsnd->add_route(ALL_OUTPUTS, "mono", 1.00); - MCFG_DEVICE_ADD("acia_clock", CLOCK, Y2/64) // 500kHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, st_state, write_acia_clock)) + // devices + RP5C15(config, RP5C15_TAG, XTAL(32'768)); // cartridge - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "st_cart") - MCFG_GENERIC_EXTENSIONS("bin,rom") - MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH) - MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG) - MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart") + SOFTWARE_LIST(config, "cart_list").set_original("st_cart"); // internal ram - RAM(config, m_ram) - .set_default_size("4M") // Mega ST 4 - .set_extra_options("2M,1M"); // Mega ST 2, Mega ST 1 - - // software lists - MCFG_SOFTWARE_LIST_ADD("flop_list", "st_flop") -MACHINE_CONFIG_END + RAM(config, m_ram); + m_ram->set_default_size("4M"); // Mega ST 4 + m_ram->set_extra_options("2M,1M"); // Mega ST 2, Mega ST 1 +} //------------------------------------------------- // MACHINE_CONFIG( ste ) //------------------------------------------------- -MACHINE_CONFIG_START(ste_state::ste) - // basic machine hardware - MCFG_DEVICE_ADD(M68000_TAG, M68000, Y2/4) - MCFG_DEVICE_PROGRAM_MAP(ste_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(st_state,atarist_int_ack) +void ste_state::ste(machine_config &config) +{ + common(config); - keyboard(config); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &ste_state::ste_map); // video hardware - MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) - MCFG_SCREEN_UPDATE_DRIVER(ste_state, screen_update) - MCFG_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_screen_update(FUNC(ste_state::screen_update)); + m_screen->set_raw(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL); - MCFG_PALETTE_ADD("palette", 512) + PALETTE(config, m_palette, 512); // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - - ym2149_device &ym2149(YM2149(config, YM2149_TAG, Y2/16)); - ym2149.set_flags(AY8910_SINGLE_OUTPUT); - ym2149.set_resistors_load(RES_K(1), 0, 0); - ym2149.port_a_write_callback().set(FUNC(st_state::psg_pa_w)); - ym2149.port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); - ym2149.add_route(0, "lspeaker", 0.50); - ym2149.add_route(0, "rspeaker", 0.50); + m_ymsnd->add_route(0, "lspeaker", 0.50); + m_ymsnd->add_route(0, "rspeaker", 0.50); /* MCFG_DEVICE_ADD("custom", CUSTOM, 0) // DAC MCFG_SOUND_ROUTE(0, "rspeaker", 0.50) MCFG_SOUND_ROUTE(1, "lspeaker", 0.50) */ - MCFG_LMC1992_ADD(LMC1992_TAG /* ,atariste_lmc1992_intf */) - - // devices - - WD1772(config, m_fdc, Y2/4); - m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert(); - m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w)); - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, nullptr, st_state::floppy_formats) - - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(m_mfp, mc68901_device, i0_w)) - - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MC68901(config, m_mfp, Y2/8); - m_mfp->set_timer_clock(Y1); - m_mfp->set_rx_clock(0); - m_mfp->set_tx_clock(0); - m_mfp->out_irq_cb().set_inputline(M68000_TAG, M68K_IRQ_6); - m_mfp->out_tdo_cb().set(FUNC(st_state::mfp_tdo_w)); - m_mfp->out_so_cb().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); - - rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); - rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); - rs232.dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); - rs232.cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); - rs232.ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); - - ACIA6850(config, m_acia0, 0); - m_acia0->txd_handler().set(FUNC(st_state::ikbd_tx_w)); - m_acia0->irq_handler().set("aciairq", FUNC(input_merger_device::in_w<0>)); - - ACIA6850(config, m_acia1, 0); - m_acia1->txd_handler().set("mdout", FUNC(midi_port_device::write_txd)); - m_acia1->irq_handler().set("aciairq", FUNC(input_merger_device::in_w<1>)); - - input_merger_device &aciairq(INPUT_MERGER_ANY_HIGH(config, "aciairq")); - aciairq.output_handler().set(m_mfp, FUNC(mc68901_device::i4_w)).invert(); - - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxd)) - - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") - - MCFG_DEVICE_ADD("acia_clock", CLOCK, Y2/64) // 500kHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, st_state, write_acia_clock)) + LMC1992(config, LMC1992_TAG); // cartridge - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "st_cart") - MCFG_GENERIC_EXTENSIONS("bin,rom") - MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH) - MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG) // MCFG_SOFTWARE_LIST_ADD("cart_list", "ste_cart") // internal ram - RAM(config, m_ram) - .set_default_size("1M") // 1040STe - .set_extra_options("512K"); // 520STe - - // software lists - MCFG_SOFTWARE_LIST_ADD("flop_list", "st_flop") -MACHINE_CONFIG_END + RAM(config, m_ram); + m_ram->set_default_size("1M"); // 1040STe + m_ram->set_extra_options("512K"); // 520STe +} //------------------------------------------------- // MACHINE_CONFIG( megaste ) //------------------------------------------------- -MACHINE_CONFIG_START(megaste_state::megaste) +void megaste_state::megaste(machine_config &config) +{ ste(config); - MCFG_DEVICE_MODIFY(M68000_TAG) - MCFG_DEVICE_PROGRAM_MAP(megaste_map) + m_maincpu->set_addrmap(AS_PROGRAM, &megaste_state::megaste_map); RP5C15(config, RP5C15_TAG, XTAL(32'768)); SCC8530(config, Z8530_TAG, Y2/4); /* internal ram */ - m_ram->set_default_size("4M") // Mega STe 4 - .set_extra_options("2M,1M"); // Mega STe 2, Mega STe 1 -MACHINE_CONFIG_END + m_ram->set_default_size("4M"); // Mega STe 4 + m_ram->set_extra_options("2M,1M"); // Mega STe 2, Mega STe 1 +} //------------------------------------------------- // MACHINE_CONFIG( stbook ) //------------------------------------------------- #if 0 -static MACHINE_CONFIG_START(stbook_state::stbook) +void stbook_state::stbook(machine_config &config) +{ // basic machine hardware - MCFG_DEVICE_ADD(M68000_TAG, M68000, U517/2) - MCFG_DEVICE_PROGRAM_MAP(stbook_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(st_state,atarist_int_ack) + M68000(config, m_maincpu, U517/2); + m_maincpu->set_addrmap(AS_PROGRAM, &stbook_state::stbook_map); + m_maincpu->set_irq_acknowledge_callback(FUNC(st_state::atarist_int_ack)); //MCFG_DEVICE_ADD(COP888_TAG, COP888, Y700) // video hardware - MCFG_SCREEN_ADD(SCREEN_TAG, LCD) - MCFG_SCREEN_UPDATE_DRIVER(stbook_state, screen_update) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(640, 400) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399) + SCREEN(config, m_screen, SCREEN_TYPE_LCD); + m_screen->set_screen_update(FUNC(stbook_state::screen_update)); + m_screen->set_refresh_hz(60); + m_screen->set_size(640, 400); + m_screen->set_visarea(0, 639, 0, 399); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); // sound hardware SPEAKER(config, "mono").front_center(); @@ -2347,21 +2239,21 @@ static MACHINE_CONFIG_START(stbook_state::stbook) WD1772(config, m_fdc, U517/2); m_fdc->intrq_wr_callback().set(m_mfp, FUNC(mc68901_device::i5_w)).invert(); m_fdc->drq_wr_callback().set(FUNC(st_state::fdc_drq_w)); - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", 0, st_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, 0, st_state::floppy_formats) + FLOPPY_CONNECTOR(config, WD1772_TAG ":0", atari_floppies, "35dd", 0, st_state::floppy_formats); + FLOPPY_CONNECTOR(config, WD1772_TAG ":1", atari_floppies, 0, 0, st_state::floppy_formats); - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(m_mfp, mc68901_device, i0_w)) + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->busy_handler().set(m_mfp, FUNC(mc68901_device::i0_w)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out"); + m_centronics->set_output_latch(cent_data_out); - rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); - rs232.rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); - rs232.dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); - rs232.cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); - rs232.ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); + RS232_PORT(config, m_rs232, default_rs232_devices, nullptr); + m_rs232->rxd_handler().set(m_mfp, FUNC(mc68901_device::write_rx)); + m_rs232->dcd_handler().set(m_mfp, FUNC(mc68901_device::i1_w)); + m_rs232->cts_handler().set(m_mfp, FUNC(mc68901_device::i2_w)); + m_rs232->ri_handler().set(m_mfp, FUNC(mc68901_device::i6_w)); - // device hardware ACIA6850(config, m_acia0, 0); m_acia0->txd_handler().set(FUNC(st_state::ikbd_tx_w)); m_acia0->irq_handler().set("aciairq", FUNC(input_merger_device::in_w<0>)); @@ -2373,24 +2265,20 @@ static MACHINE_CONFIG_START(stbook_state::stbook) input_merger_device &aciairq(INPUT_MERGER_ANY_HIGH(config, "aciairq")); aciairq.output_handler().set(m_mfp, FUNC(mc68901_device::i4_w)).invert(); - MCFG_SERIAL_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(MC6850_1_TAG, acia6850_device, write_rxd)) - - MCFG_SERIAL_PORT_ADD("mdout", midiout_slot, "midiout") + MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(m_acia1, FUNC(acia6850_device::write_rxd)); + MIDI_PORT(config, "mdout", midiout_slot, "midiout"); - MCFG_DEVICE_ADD("acia_clock", CLOCK, U517/2/16) // 500kHz - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, st_state, write_acia_clock)) + CLOCK(config, "acia_clock", Y2/64).signal_handler().set(FUNC(st_state::write_acia_clock)); // 500kHz // cartridge - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "st_cart") - MCFG_GENERIC_EXTENSIONS("bin,rom") - MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH) - MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG) - MCFG_SOFTWARE_LIST_ADD("cart_list", "st_cart") + GENERIC_CARTSLOT(config, m_cart, generic_linear_slot, "st_cart", "bin,rom"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_endian(ENDIANNESS_BIG); + SOFTWARE_LIST(config, "cart_list").set_original("st_cart"); /* internal ram */ RAM(config, m_ram).set_default_size("4M").set_extra_options("1M"); -MACHINE_CONFIG_END +} #endif //------------------------------------------------- diff --git a/src/mame/drivers/blockade.cpp b/src/mame/drivers/blockade.cpp index 596dd8e974f..9b5ee5d52a7 100644 --- a/src/mame/drivers/blockade.cpp +++ b/src/mame/drivers/blockade.cpp @@ -68,7 +68,7 @@ private: required_shared_ptr<uint8_t> m_videoram; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; - required_device<discrete_device> m_discrete; + required_device<discrete_sound_device> m_discrete; required_device<samples_device> m_samples; emu_timer *m_vblank_timer; @@ -468,32 +468,33 @@ void blockade_state::device_timer(emu_timer &timer, device_timer_id id, int para // MACHINE DEFINTIONS //************************************************************************** -MACHINE_CONFIG_START(blockade_state::blockade) - MCFG_DEVICE_ADD("maincpu", I8080A, XTAL(20'790'000) / 10) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_IO_MAP(main_io_map) +void blockade_state::blockade(machine_config &config) +{ + I8080A(config, m_maincpu, XTAL(20'790'000) / 10); + m_maincpu->set_addrmap(AS_PROGRAM, &blockade_state::main_map); + m_maincpu->set_addrmap(AS_IO, &blockade_state::main_io_map); // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(XTAL(20'790'000) / 4, 330, 0, 256, 262, 0, 224) - MCFG_SCREEN_UPDATE_DRIVER(blockade_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(XTAL(20'790'000) / 4, 330, 0, 256, 262, 0, 224); + m_screen->set_screen_update(FUNC(blockade_state::screen_update)); + m_screen->set_palette("palette"); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_blockade) + GFXDECODE(config, m_gfxdecode, "palette", gfx_blockade); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(blockade_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(blockade_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("discrete", DISCRETE, blockade_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, blockade_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} //************************************************************************** diff --git a/src/mame/drivers/cham24.cpp b/src/mame/drivers/cham24.cpp index 1d109114f3c..d1722d7b7ab 100644 --- a/src/mame/drivers/cham24.cpp +++ b/src/mame/drivers/cham24.cpp @@ -288,25 +288,26 @@ void cham24_state::init_cham24() { } -MACHINE_CONFIG_START(cham24_state::cham24) +void cham24_state::cham24(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(cham24_map) + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &cham24_state::cham24_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu", ppu2c0x_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(32*8, 262); + screen.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); - MCFG_PPU2C02_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C02(config, m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} ROM_START( cham24 ) ROM_REGION(0x10000, "maincpu", ROMREGION_ERASE00) diff --git a/src/mame/drivers/circus.cpp b/src/mame/drivers/circus.cpp index 12f013fe63f..4c7cd546801 100644 --- a/src/mame/drivers/circus.cpp +++ b/src/mame/drivers/circus.cpp @@ -283,72 +283,69 @@ void circus_state::machine_reset() } -MACHINE_CONFIG_START(circus_state::circus) - +void circus_state::circus(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(11'289'000) / 16) /* 705.562kHz */ - MCFG_DEVICE_PROGRAM_MAP(circus_map) - + M6502(config, m_maincpu, XTAL(11'289'000) / 16); /* 705.562kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &circus_state::circus_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) /* needed for proper hardware collisions */ - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3500) /* frames per second, vblank duration (complete guess) */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(circus_state, screen_update_circus) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_ALWAYS_UPDATE); /* needed for proper hardware collisions */ + screen.set_refresh_hz(57); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(3500)); /* (complete guess) */ + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 31*8-1, 0*8, 32*8-1); + screen.set_screen_update(FUNC(circus_state::screen_update_circus)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_circus) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_circus); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(circus_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) - - MCFG_DEVICE_ADD("discrete", DISCRETE, circus_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(circus_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.80); -MACHINE_CONFIG_START(circus_state::robotbwl) + DISCRETE(config, m_discrete, circus_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.50); +} +void circus_state::robotbwl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(11'289'000) / 16) /* 705.562kHz */ - MCFG_DEVICE_PROGRAM_MAP(circus_map) + M6502(config, m_maincpu, XTAL(11'289'000) / 16); /* 705.562kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &circus_state::circus_map); // does not generate irq! - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3500) /* frames per second, vblank duration (complete guess) */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(circus_state, screen_update_robotbwl) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(3500)); /* (complete guess) */ + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 31*8-1, 0*8, 32*8-1); + screen.set_screen_update(FUNC(circus_state::screen_update_robotbwl)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_robotbwl) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_robotbwl); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(robotbwl_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(robotbwl_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.80); - MCFG_DEVICE_ADD("discrete", DISCRETE, robotbwl_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, robotbwl_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} TIMER_DEVICE_CALLBACK_MEMBER(circus_state::crash_scanline) { @@ -358,71 +355,69 @@ TIMER_DEVICE_CALLBACK_MEMBER(circus_state::crash_scanline) m_maincpu->set_input_line(0, ASSERT_LINE); } -MACHINE_CONFIG_START(circus_state::crash) - +void circus_state::crash(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(11'289'000) / 16) /* 705.562kHz */ - MCFG_DEVICE_PROGRAM_MAP(circus_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", circus_state, crash_scanline, "screen", 0, 1) - + M6502(config, m_maincpu, XTAL(11'289'000) / 16); /* 705.562kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &circus_state::circus_map); + TIMER(config, "scantimer").configure_scanline(FUNC(circus_state::crash_scanline), "screen", 0, 1); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3500) /* frames per second, vblank duration (complete guess) */) - MCFG_SCREEN_SIZE(40*8, 40*8) //TODO - MCFG_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(circus_state, screen_update_crash) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(3500)); /* (complete guess) */ + screen.set_size(40*8, 40*8); // TODO // to do what? + screen.set_visarea(0*8, 31*8-1, 0*8, 32*8-1); + screen.set_screen_update(FUNC(circus_state::screen_update_crash)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_circus) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_circus); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(crash_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) - - MCFG_DEVICE_ADD("discrete", DISCRETE, crash_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(crash_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.80); -MACHINE_CONFIG_START(circus_state::ripcord) + DISCRETE(config, m_discrete, crash_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.80); +} +void circus_state::ripcord(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(11'289'000) / 16) /* 705.562kHz */ - MCFG_DEVICE_PROGRAM_MAP(circus_map) - + M6502(config, m_maincpu, XTAL(11'289'000) / 16); /* 705.562kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &circus_state::circus_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) /* needed for proper hardware collisions */ - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3500) /* frames per second, vblank duration (complete guess) */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(circus_state, screen_update_ripcord) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_ALWAYS_UPDATE); /* needed for proper hardware collisions */ + screen.set_refresh_hz(57); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(3500)); /* (complete guess) */ + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 31*8-1, 0*8, 32*8-1); + screen.set_screen_update(FUNC(circus_state::screen_update_ripcord)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_circus) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_circus); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(ripcord_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(ripcord_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.80); - MCFG_DEVICE_ADD("discrete", DISCRETE, circus_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, circus_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/cosmic.cpp b/src/mame/drivers/cosmic.cpp index f9bce981824..46f7906e704 100644 --- a/src/mame/drivers/cosmic.cpp +++ b/src/mame/drivers/cosmic.cpp @@ -1005,21 +1005,21 @@ MACHINE_RESET_MEMBER(cosmic_state,cosmicg) m_maincpu->set_input_line(INT_9980A_RESET, CLEAR_LINE); } -MACHINE_CONFIG_START(cosmic_state::cosmic) - +void cosmic_state::cosmic(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80,Z80_MASTER_CLOCK/6) /* 1.8026 MHz */ + Z80(config, m_maincpu, Z80_MASTER_CLOCK/6); /* 1.8026 MHz */ MCFG_MACHINE_START_OVERRIDE(cosmic_state,cosmic) MCFG_MACHINE_RESET_OVERRIDE(cosmic_state,cosmic) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) - MCFG_SCREEN_PALETTE("palette") -MACHINE_CONFIG_END + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 4*8, 28*8-1); + m_screen->set_palette(m_palette); +} TIMER_DEVICE_CALLBACK_MEMBER(cosmic_state::panic_scanline) { @@ -1033,64 +1033,62 @@ TIMER_DEVICE_CALLBACK_MEMBER(cosmic_state::panic_scanline) } -MACHINE_CONFIG_START(cosmic_state::panic) +void cosmic_state::panic(machine_config &config) +{ cosmic(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(panic_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cosmic_state, panic_scanline, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &cosmic_state::panic_map); + TIMER(config, "scantimer").configure_scanline(FUNC(cosmic_state::panic_scanline), "screen", 0, 1); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_panic) - MCFG_PALETTE_ADD("palette", 16+8*4) - MCFG_PALETTE_INDIRECT_ENTRIES(16) - MCFG_PALETTE_INIT_OWNER(cosmic_state,panic) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_panic); + PALETTE(config, m_palette, 16+8*4); + m_palette->set_indirect_entries(16); + m_palette->set_init(FUNC(cosmic_state::palette_init_panic)); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_panic) + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_panic)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(9) - MCFG_SAMPLES_NAMES(panic_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) - - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(9); + m_samples->set_samples_names(panic_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + 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); +} -MACHINE_CONFIG_START(cosmic_state::cosmica) +void cosmic_state::cosmica(machine_config &config) +{ cosmic(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(cosmica_map) + m_maincpu->set_addrmap(AS_PROGRAM, &cosmic_state::cosmica_map); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cosmica) - MCFG_PALETTE_ADD("palette", 8+16*4) - MCFG_PALETTE_INDIRECT_ENTRIES(8) - MCFG_PALETTE_INIT_OWNER(cosmic_state,cosmica) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_cosmica); + PALETTE(config, m_palette, 8+16*4); + m_palette->set_indirect_entries(8); + m_palette->set_init(FUNC(cosmic_state::palette_init_cosmica)); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_cosmica) + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_cosmica)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(13) - MCFG_SAMPLES_NAMES(cosmica_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(cosmic_state::cosmicg) + SAMPLES(config, m_samples); + m_samples->set_channels(13); + m_samples->set_samples_names(cosmica_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); +} +void cosmic_state::cosmicg(machine_config &config) +{ /* basic machine hardware */ TMS9980A(config, m_maincpu, COSMICG_MASTER_CLOCK); // 9.828 MHz Crystal m_maincpu->set_addrmap(AS_PROGRAM, &cosmic_state::cosmicg_map); @@ -1100,90 +1098,87 @@ MACHINE_CONFIG_START(cosmic_state::cosmicg) MCFG_MACHINE_RESET_OVERRIDE(cosmic_state,cosmicg) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_cosmicg) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 4*8, 28*8-1); + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_cosmicg)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 16) - MCFG_PALETTE_INIT_OWNER(cosmic_state,cosmicg) + PALETTE(config, m_palette, 16); + m_palette->set_init(FUNC(cosmic_state::palette_init_cosmicg)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(9) - MCFG_SAMPLES_NAMES(cosmicg_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(9); + m_samples->set_samples_names(cosmicg_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // NE556 - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // NE556 + 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); // Other DACs include 3-bit binary-weighted (100K/50K/25K) DAC combined with another NE556 for attack march -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cosmic_state::magspot) +void cosmic_state::magspot(machine_config &config) +{ cosmic(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu", Z80, Z80_MASTER_CLOCK/4) /* 2.704 MHz, verified via schematics */ - MCFG_DEVICE_PROGRAM_MAP(magspot_map) + Z80(config.replace(), m_maincpu, Z80_MASTER_CLOCK/4); /* 2.704 MHz, verified via schematics */ + m_maincpu->set_addrmap(AS_PROGRAM, &cosmic_state::magspot_map); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_panic) - MCFG_PALETTE_ADD("palette", 16+8*4) - MCFG_PALETTE_INDIRECT_ENTRIES(16) - MCFG_PALETTE_INIT_OWNER(cosmic_state,magspot) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_panic); + PALETTE(config, m_palette, 16+8*4); + m_palette->set_indirect_entries(16); + m_palette->set_init(FUNC(cosmic_state::palette_init_magspot)); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_magspot) + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_magspot)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END - + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + 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); +} -MACHINE_CONFIG_START(cosmic_state::devzone) +void cosmic_state::devzone(machine_config &config) +{ magspot(config); - /* basic machine hardware */ - /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_devzone) -MACHINE_CONFIG_END - + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_devzone)); +} -MACHINE_CONFIG_START(cosmic_state::nomnlnd) +void cosmic_state::nomnlnd(machine_config &config) +{ cosmic(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(magspot_map) + m_maincpu->set_addrmap(AS_PROGRAM, &cosmic_state::magspot_map); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_panic) - MCFG_PALETTE_ADD("palette", 16+8*4) - MCFG_PALETTE_INDIRECT_ENTRIES(16) - MCFG_PALETTE_INIT_OWNER(cosmic_state,nomnlnd) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_panic); + PALETTE(config, m_palette, 16+8*4); + m_palette->set_indirect_entries(16); + m_palette->set_init(FUNC(cosmic_state::palette_init_nomnlnd)); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cosmic_state, screen_update_nomnlnd) + m_screen->set_screen_update(FUNC(cosmic_state::screen_update_nomnlnd)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + 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); +} ROM_START( panic ) diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp index 58db8700c7f..ac783bbb00b 100644 --- a/src/mame/drivers/equites.cpp +++ b/src/mame/drivers/equites.cpp @@ -1038,8 +1038,8 @@ static const char *const alphamc07_sample_names[] = #define MSM5232_BASE_VOLUME 1.0 // the sound board is the same in all games -MACHINE_CONFIG_START(equites_state::common_sound) - +void equites_state::common_sound(machine_config &config) +{ I8085A(config, m_audiocpu, 6.144_MHz_XTAL); /* verified on pcb */ m_audiocpu->set_addrmap(AS_PROGRAM, &equites_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &equites_state::sound_portmap); @@ -1056,37 +1056,40 @@ MACHINE_CONFIG_START(equites_state::common_sound) GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("msm", MSM5232, MSM5232_MAX_CLOCK) // will be adjusted at runtime through PORT_ADJUSTER - MCFG_MSM5232_SET_CAPACITORS(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6) // verified - MCFG_MSM5232_GATE_HANDLER_CB(WRITELINE(*this, equites_state, equites_msm5232_gate)) - MCFG_SOUND_ROUTE(0, "speaker", MSM5232_BASE_VOLUME/2.2) // pin 28 2'-1 : 22k resistor - MCFG_SOUND_ROUTE(1, "speaker", MSM5232_BASE_VOLUME/1.5) // pin 29 4'-1 : 15k resistor - MCFG_SOUND_ROUTE(2, "speaker", MSM5232_BASE_VOLUME) // pin 30 8'-1 : 10k resistor - MCFG_SOUND_ROUTE(3, "speaker", MSM5232_BASE_VOLUME) // pin 31 16'-1 : 10k resistor - MCFG_SOUND_ROUTE(4, "speaker", MSM5232_BASE_VOLUME/2.2) // pin 36 2'-2 : 22k resistor - MCFG_SOUND_ROUTE(5, "speaker", MSM5232_BASE_VOLUME/1.5) // pin 35 4'-2 : 15k resistor - MCFG_SOUND_ROUTE(6, "speaker", MSM5232_BASE_VOLUME) // pin 34 8'-2 : 10k resistor - MCFG_SOUND_ROUTE(7, "speaker", MSM5232_BASE_VOLUME) // pin 33 16'-2 : 10k resistor - MCFG_SOUND_ROUTE(8, "speaker", 1.0) // pin 1 SOLO 8' (this actually feeds an analog section) - MCFG_SOUND_ROUTE(9, "speaker", 1.0) // pin 2 SOLO 16' (this actually feeds an analog section) - MCFG_SOUND_ROUTE(10,"speaker", 0.12) // pin 22 Noise Output (this actually feeds an analog section) + MSM5232(config, m_msm, MSM5232_MAX_CLOCK); // will be adjusted at runtime through PORT_ADJUSTER + m_msm->set_capacitors(0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6); // verified + m_msm->gate().set(FUNC(equites_state::equites_msm5232_gate)); + m_msm->add_route(0, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 28 2'-1 : 22k resistor + m_msm->add_route(1, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 29 4'-1 : 15k resistor + m_msm->add_route(2, "speaker", MSM5232_BASE_VOLUME); // pin 30 8'-1 : 10k resistor + m_msm->add_route(3, "speaker", MSM5232_BASE_VOLUME); // pin 31 16'-1 : 10k resistor + m_msm->add_route(4, "speaker", MSM5232_BASE_VOLUME/2.2); // pin 36 2'-2 : 22k resistor + m_msm->add_route(5, "speaker", MSM5232_BASE_VOLUME/1.5); // pin 35 4'-2 : 15k resistor + m_msm->add_route(6, "speaker", MSM5232_BASE_VOLUME); // pin 34 8'-2 : 10k resistor + m_msm->add_route(7, "speaker", MSM5232_BASE_VOLUME); // pin 33 16'-2 : 10k resistor + m_msm->add_route(8, "speaker", 1.0); // pin 1 SOLO 8' (this actually feeds an analog section) + m_msm->add_route(9, "speaker", 1.0); // pin 2 SOLO 16' (this actually feeds an analog section) + m_msm->add_route(10,"speaker", 0.12); // pin 22 Noise Output (this actually feeds an analog section) ay8910_device &aysnd(AY8910(config, "aysnd", 6.144_MHz_XTAL/4)); /* verified on pcb */ aysnd.port_a_write_callback().set(FUNC(equites_state::equites_8910porta_w)); aysnd.port_b_write_callback().set(FUNC(equites_state::equites_8910portb_w)); aysnd.add_route(ALL_OUTPUTS, "speaker", 0.15); - MCFG_DEVICE_ADD("dac1", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("dac2", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(alphamc07_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) -MACHINE_CONFIG_END + DAC_6BIT_R2R(config, m_dac_1, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC + DAC_6BIT_R2R(config, m_dac_2, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); + + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(alphamc07_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.3); +} /******************************************************************************/ @@ -1152,13 +1155,12 @@ void equites_state::machine_reset() m_audiocpu->set_input_line(I8085_TRAP_LINE, CLEAR_LINE); } - -MACHINE_CONFIG_START(equites_state::equites) - +void equites_state::equites(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 12_MHz_XTAL/4) /* 68000P8 running at 3mhz! verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(equites_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, equites_scanline, "screen", 0, 1) + M68000(config, m_maincpu, 12_MHz_XTAL/4); /* 68000P8 running at 3mhz! verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &equites_state::equites_map); + TIMER(config, "scantimer").configure_scanline(FUNC(equites_state::equites_scanline), "screen", 0, 1); LS259(config, m_mainlatch); m_mainlatch->q_out_cb<1>().set(FUNC(equites_state::flip_screen_w)); @@ -1167,49 +1169,48 @@ MACHINE_CONFIG_START(equites_state::equites) common_sound(config); - MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, 4000000/8) // 8303 or 8304 (same device!) - MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu") + ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!) + + config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu"); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 3*8, 29*8-1) - MCFG_SCREEN_UPDATE_DRIVER(equites_state, screen_update_equites) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_equites) - MCFG_PALETTE_ADD("palette", 0x180) - MCFG_PALETTE_INDIRECT_ENTRIES(0x100) - MCFG_PALETTE_INIT_OWNER(equites_state,equites) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 3*8, 29*8-1); + m_screen->set_screen_update(FUNC(equites_state::screen_update_equites)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_equites); + PALETTE(config, m_palette, 0x180); + m_palette->set_indirect_entries(0x100); + m_palette->set_init(FUNC(equites_state::palette_init_equites)); MCFG_VIDEO_START_OVERRIDE(equites_state,equites) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(gekisou_state::gekisou) +void gekisou_state::gekisou(machine_config &config) +{ equites(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(gekisou_map) + m_maincpu->set_addrmap(AS_PROGRAM, &gekisou_state::gekisou_map); // mcu not dumped, so add simulated mcu - MCFG_DEVICE_ADD("mcu", ALPHA8301L, 4000000/8) - MCFG_DEVICE_PROGRAM_MAP(mcu_map) + ALPHA8301L(config, "mcu", 4000000/8).set_addrmap(AS_PROGRAM, &gekisou_state::mcu_map); // gekisou has battery-backed RAM to store settings NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(splndrbt_state::splndrbt) +} +void splndrbt_state::splndrbt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 24_MHz_XTAL/4) /* 68000P8 running at 6mhz, verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(splndrbt_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", splndrbt_state, splndrbt_scanline, "screen", 0, 1) + M68000(config, m_maincpu, 24_MHz_XTAL/4); /* 68000P8 running at 6mhz, verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &splndrbt_state::splndrbt_map); + TIMER(config, "scantimer").configure_scanline(FUNC(splndrbt_state::splndrbt_scanline), "screen", 0, 1); LS259(config, m_mainlatch); m_mainlatch->q_out_cb<0>().set(FUNC(equites_state::flip_screen_w)); @@ -1219,32 +1220,32 @@ MACHINE_CONFIG_START(splndrbt_state::splndrbt) common_sound(config); - MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, 4000000/8) // 8303 or 8304 (same device!) - MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu") + ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!) + config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(splndrbt_state, screen_update_splndrbt) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_splndrbt) - MCFG_PALETTE_ADD("palette", 0x280) - MCFG_PALETTE_INDIRECT_ENTRIES(0x100) - MCFG_PALETTE_INIT_OWNER(splndrbt_state,splndrbt) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 4*8, 28*8-1); + m_screen->set_screen_update(FUNC(splndrbt_state::screen_update_splndrbt)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_splndrbt); + PALETTE(config, m_palette, 0x280); + m_palette->set_indirect_entries(0x100); + m_palette->set_init(FUNC(splndrbt_state::palette_init_splndrbt)); MCFG_VIDEO_START_OVERRIDE(splndrbt_state,splndrbt) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(splndrbt_state::hvoltage) +void splndrbt_state::hvoltage(machine_config &config) +{ splndrbt(config); // mcu not dumped, so add simulated mcu - MCFG_DEVICE_ADD("mcu", ALPHA8301L, 4000000/8) - MCFG_DEVICE_PROGRAM_MAP(mcu_map) -MACHINE_CONFIG_END + ALPHA8301L(config, "mcu", 4000000/8).set_addrmap(AS_PROGRAM, &splndrbt_state::mcu_map); +} diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp index 21eab88fc63..8a7141d4581 100644 --- a/src/mame/drivers/famibox.cpp +++ b/src/mame/drivers/famibox.cpp @@ -525,25 +525,26 @@ void famibox_state::machine_start() m_coins = 0; } -MACHINE_CONFIG_START(famibox_state::famibox) +void famibox_state::famibox(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(famibox_map) + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &famibox_state::famibox_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu", ppu2c0x_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(32*8, 262); + screen.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); - MCFG_PPU2C02_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C02(config, m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} ROM_START(famibox) diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index c669a50d62c..3add7405656 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -201,6 +201,7 @@ VBlank duration: 1/VSYNC * (16/256) = 1017.6 us #include "machine/nvram.h" #include "machine/watchdog.h" +#include "sound/dac.h" #include "speaker.h" @@ -673,14 +674,15 @@ static const char *const qbert_knocker_names[] = nullptr /* end of array */ }; -MACHINE_CONFIG_START(gottlieb_state::qbert_knocker) +void gottlieb_state::qbert_knocker(machine_config &config) +{ SPEAKER(config, "knocker", 0.0, 0.0, 1.0); - MCFG_DEVICE_ADD("knocker_sam", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(qbert_knocker_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "knocker", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_knocker_sample); + m_knocker_sample->set_channels(1); + m_knocker_sample->set_samples_names(qbert_knocker_names); + m_knocker_sample->add_route(ALL_OUTPUTS, "knocker", 1.0); +} @@ -1756,29 +1758,28 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(gottlieb_state::gottlieb_core) - +void gottlieb_state::gottlieb_core(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8088, CPU_CLOCK/3) - MCFG_DEVICE_PROGRAM_MAP(gottlieb_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gottlieb_state, interrupt) + I8088(config, m_maincpu, CPU_CLOCK/3); + m_maincpu->set_addrmap(AS_PROGRAM, &gottlieb_state::gottlieb_map); + m_maincpu->set_vblank_int("screen", FUNC(gottlieb_state::interrupt)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 16); /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_RAW_PARAMS(SYSTEM_CLOCK/4, GOTTLIEB_VIDEO_HCOUNT, 0, GOTTLIEB_VIDEO_HBLANK, GOTTLIEB_VIDEO_VCOUNT, 0, GOTTLIEB_VIDEO_VBLANK) - MCFG_SCREEN_UPDATE_DRIVER(gottlieb_state, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(SYSTEM_CLOCK/4, GOTTLIEB_VIDEO_HCOUNT, 0, GOTTLIEB_VIDEO_HBLANK, GOTTLIEB_VIDEO_VCOUNT, 0, GOTTLIEB_VIDEO_VBLANK); + m_screen->set_screen_update(FUNC(gottlieb_state::screen_update)); GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode); PALETTE(config, m_palette, 16); // basic speaker configuration SPEAKER(config, "speaker").front_center(); -MACHINE_CONFIG_END - +} void gottlieb_state::gottlieb1(machine_config &config) { @@ -1792,21 +1793,25 @@ void gottlieb_state::gottlieb2(machine_config &config) GOTTLIEB_SOUND_REV2(config, m_r2_sound, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); } -MACHINE_CONFIG_START(gottlieb_state::g2laser) +void gottlieb_state::g2laser(machine_config &config) +{ gottlieb_core(config); GOTTLIEB_SOUND_REV2(config, m_r2_sound, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); - MCFG_LASERDISC_PR8210_ADD("laserdisc") - MCFG_LASERDISC_AUDIO(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)) - MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update) - MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) - MCFG_LASERDISC_OVERLAY_PALETTE("palette") - MCFG_SOUND_ROUTE(0, "speaker", 1.0) + PIONEER_PR8210(config, m_laserdisc, 0); + m_laserdisc->set_audio(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)); + m_laserdisc->set_overlay(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, FUNC(gottlieb_state::screen_update)); + m_laserdisc->set_overlay_clip(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8); + m_laserdisc->set_overlay_palette("palette"); + m_laserdisc->add_route(0, "speaker", 1.0); + m_laserdisc->set_screen(m_screen); /* right channel is processed as data */ - MCFG_DEVICE_REMOVE("screen") - MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") -MACHINE_CONFIG_END + SCREEN(config.replace(), m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_SELF_RENDER); + m_screen->set_raw(XTAL(14'318'181)*2, 910, 0, 704, 525, 44, 524); + m_screen->set_screen_update("laserdisc", FUNC(laserdisc_device::screen_update)); +} @@ -1823,58 +1828,60 @@ void gottlieb_state::gottlieb1_votrax(machine_config &config) GOTTLIEB_SOUND_REV1_VOTRAX(config, m_r1_sound, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); } - -MACHINE_CONFIG_START(gottlieb_state::reactor) +void gottlieb_state::reactor(machine_config &config) +{ gottlieb1_votrax(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(reactor_map) - - MCFG_DEVICE_REMOVE("nvram") -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &gottlieb_state::reactor_map); + config.device_remove("nvram"); +} -MACHINE_CONFIG_START(gottlieb_state::qbert) +void gottlieb_state::qbert(machine_config &config) +{ gottlieb1_votrax(config); /* sound hardware */ qbert_knocker(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(gottlieb_state::tylz) +void gottlieb_state::tylz(machine_config &config) +{ gottlieb1_votrax(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(gottlieb_state::screwloo) +void gottlieb_state::screwloo(machine_config &config) +{ gottlieb2(config); MCFG_VIDEO_START_OVERRIDE(gottlieb_state,screwloo) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(gottlieb_state::cobram3) +void gottlieb_state::cobram3(machine_config &config) +{ gottlieb_core(config); GOTTLIEB_SOUND_REV2(config, m_r2_sound, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); m_r2_sound->enable_cobram3_mods(); - MCFG_LASERDISC_PR8210_ADD("laserdisc") - MCFG_LASERDISC_AUDIO(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)) - MCFG_LASERDISC_OVERLAY_DRIVER(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb_state, screen_update) - MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) - MCFG_LASERDISC_OVERLAY_PALETTE("palette") - MCFG_SOUND_ROUTE(0, "speaker", 1.0) + PIONEER_PR8210(config, m_laserdisc, 0); + m_laserdisc->set_audio(laserdisc_device::audio_delegate(&gottlieb_state::laserdisc_audio_process, this)); + m_laserdisc->set_overlay(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, FUNC(gottlieb_state::screen_update)); + m_laserdisc->set_overlay_clip(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8); + m_laserdisc->set_overlay_palette("palette"); + m_laserdisc->add_route(0, "speaker", 1.0); + m_laserdisc->set_screen(m_screen); /* right channel is processed as data */ - MCFG_DEVICE_REMOVE("screen") - MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") + SCREEN(config.replace(), m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_SELF_RENDER); + m_screen->set_raw(XTAL(14'318'181)*2, 910, 0, 704, 525, 44, 524); + m_screen->set_screen_update("laserdisc", FUNC(laserdisc_device::screen_update)); /* sound hardware */ - MCFG_DEVICE_MODIFY("r2sound:dac") - MCFG_SOUND_ROUTES_RESET() - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "r2sound", 1.00) -MACHINE_CONFIG_END + subdevice<dac_8bit_r2r_device>("r2sound:dac")->reset_routes(); + subdevice<dac_8bit_r2r_device>("r2sound:dac")->add_route(ALL_OUTPUTS, "r2sound", 1.00); +} /************************************* diff --git a/src/mame/drivers/gotya.cpp b/src/mame/drivers/gotya.cpp index 63e3c256c8a..c1106e010a0 100644 --- a/src/mame/drivers/gotya.cpp +++ b/src/mame/drivers/gotya.cpp @@ -209,37 +209,37 @@ void gotya_state::machine_reset() m_theme_playing = 0; } -MACHINE_CONFIG_START(gotya_state::gotya) - +void gotya_state::gotya(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80,18432000/6) /* 3.072 MHz ??? */ - MCFG_DEVICE_PROGRAM_MAP(gotya_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gotya_state, irq0_line_hold) + Z80(config, m_maincpu, 18432000/6); /* 3.072 MHz ??? */ + m_maincpu->set_addrmap(AS_PROGRAM, &gotya_state::gotya_map); + m_maincpu->set_vblank_int("screen", FUNC(gotya_state::irq0_line_hold)); WATCHDOG_TIMER(config, "watchdog"); /* 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(36*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(gotya_state, screen_update_gotya) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_gotya) - MCFG_PALETTE_ADD("palette", 16*4) - MCFG_PALETTE_INDIRECT_ENTRIES(32) - MCFG_PALETTE_INIT_OWNER(gotya_state, gotya) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(36*8, 32*8); + screen.set_visarea(0, 36*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(gotya_state::screen_update_gotya)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_gotya); + PALETTE(config, m_palette, 16*4); + m_palette->set_indirect_entries(32); + m_palette->set_init(FUNC(gotya_state::palette_init_gotya)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp index a796146039f..4bd8b56548e 100644 --- a/src/mame/drivers/gridlee.cpp +++ b/src/mame/drivers/gridlee.cpp @@ -396,11 +396,11 @@ static const char *const sample_names[] = * *************************************/ -MACHINE_CONFIG_START(gridlee_state::gridlee) - +void gridlee_state::gridlee(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6809, GRIDLEE_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(cpu1_map) + M6809(config, m_maincpu, GRIDLEE_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &gridlee_state::cpu1_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -414,25 +414,24 @@ MACHINE_CONFIG_START(gridlee_state::gridlee) m_latch->q_out_cb<7>().set(FUNC(gridlee_state::cocktail_flip_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(GRIDLEE_PIXEL_CLOCK, GRIDLEE_HTOTAL, GRIDLEE_HBEND, GRIDLEE_HBSTART, GRIDLEE_VTOTAL, GRIDLEE_VBEND, GRIDLEE_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(gridlee_state, screen_update_gridlee) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(GRIDLEE_PIXEL_CLOCK, GRIDLEE_HTOTAL, GRIDLEE_HBEND, GRIDLEE_HBSTART, GRIDLEE_VTOTAL, GRIDLEE_VBEND, GRIDLEE_VBSTART); + m_screen->set_screen_update(FUNC(gridlee_state::screen_update_gridlee)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_INIT_OWNER(gridlee_state,gridlee) + PALETTE(config, m_palette, 2048); + m_palette->set_init(FUNC(gridlee_state::palette_init_gridlee)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("gridlee", GRIDLEE, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + GRIDLEE(config, "gridlee", 0).add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.40); +} diff --git a/src/mame/drivers/homerun.cpp b/src/mame/drivers/homerun.cpp index 6f8ffa8303a..3dc40648493 100644 --- a/src/mame/drivers/homerun.cpp +++ b/src/mame/drivers/homerun.cpp @@ -350,13 +350,13 @@ void homerun_state::machine_reset() /**************************************************************************/ -MACHINE_CONFIG_START(homerun_state::dynashot) - +void homerun_state::dynashot(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(20'000'000)/4) - MCFG_DEVICE_PROGRAM_MAP(homerun_memmap) - MCFG_DEVICE_IO_MAP(homerun_iomap) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", homerun_state, irq0_line_hold) + Z80(config, m_maincpu, XTAL(20'000'000)/4); + m_maincpu->set_addrmap(AS_PROGRAM, &homerun_state::homerun_memmap); + m_maincpu->set_addrmap(AS_IO, &homerun_state::homerun_iomap); + m_maincpu->set_vblank_int("screen", FUNC(homerun_state::irq0_line_hold)); i8255_device &ppi(I8255A(config, "ppi8255")); ppi.out_pa_callback().set(FUNC(homerun_state::homerun_scrollhi_w)); @@ -364,16 +364,13 @@ MACHINE_CONFIG_START(homerun_state::dynashot) ppi.out_pc_callback().set(FUNC(homerun_state::homerun_scrollx_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) -// MCFG_SCREEN_REFRESH_RATE(60) -// MCFG_SCREEN_SIZE(256, 256) -// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_RAW_PARAMS(XTAL(20'000'000)/4,328,0,256,253,0,240) - MCFG_SCREEN_UPDATE_DRIVER(homerun_state, screen_update_homerun) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(XTAL(20'000'000)/4,328,0,256,253,0,240); + m_screen->set_screen_update(FUNC(homerun_state::screen_update_homerun)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_homerun) - MCFG_PALETTE_ADD("palette", 16*4) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_homerun); + PALETTE(config, m_palette, 16*4); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -382,32 +379,33 @@ MACHINE_CONFIG_START(homerun_state::dynashot) ymsnd.port_a_read_callback().set_ioport("DSW"); ymsnd.port_b_write_callback().set(FUNC(homerun_state::homerun_banking_w)); ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(homerun_state::homerun) +void homerun_state::homerun(machine_config &config) +{ dynashot(config); /* sound hardware */ - MCFG_DEVICE_ADD("d7756", UPD7756) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + UPD7756(config, m_d7756); + m_d7756->add_route(ALL_OUTPUTS, "mono", 0.75); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(homerun_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(homerun_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(homerun_state::ganjaja) +void homerun_state::ganjaja(machine_config &config) +{ dynashot(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PERIODIC_INT_DRIVER(homerun_state, irq0_line_hold, 4*60) // ? + m_maincpu->set_periodic_int(FUNC(homerun_state::irq0_line_hold), attotime::from_hz(4*60)); // ? /* sound hardware */ - MCFG_DEVICE_ADD("d7756", UPD7756) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) -MACHINE_CONFIG_END + UPD7756(config, m_d7756); + m_d7756->add_route(ALL_OUTPUTS, "mono", 0.75); +} diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp index c10c017db51..6d12beace7c 100644 --- a/src/mame/drivers/m10.cpp +++ b/src/mame/drivers/m10.cpp @@ -812,27 +812,26 @@ static const char *const m10_sample_names[] = * *************************************/ -MACHINE_CONFIG_START(m10_state::m10) - +void m10_state::m10(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502,IREMM10_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(m10_main) + M6502(config, m_maincpu, IREMM10_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &m10_state::m10_main); MCFG_MACHINE_START_OVERRIDE(m10_state,m10) MCFG_MACHINE_RESET_OVERRIDE(m10_state,m10) - //MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m10_state, m10_interrupt) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(IREMM10_PIXEL_CLOCK, IREMM10_HTOTAL, IREMM10_HBEND, IREMM10_HBSTART, IREMM10_VTOTAL, IREMM10_VBEND, IREMM10_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(m10_state, screen_update_m10) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(IREMM10_PIXEL_CLOCK, IREMM10_HTOTAL, IREMM10_HBEND, IREMM10_HBSTART, IREMM10_VTOTAL, IREMM10_VBEND, IREMM10_VBSTART); + m_screen->set_screen_update(FUNC(m10_state::screen_update_m10)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m10) - MCFG_PALETTE_ADD("palette", 2*8) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_m10); + + PALETTE(config, m_palette, 2*8); + m_palette->set_init(FUNC(m10_state::palette_init_m10)); - MCFG_PALETTE_INIT_OWNER(m10_state,m10) MCFG_VIDEO_START_OVERRIDE(m10_state,m10) /* 74LS123 */ @@ -859,63 +858,57 @@ MACHINE_CONFIG_START(m10_state::m10) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(m10_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(m10_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(m10_state::m11) +void m10_state::m11(machine_config &config) +{ m10(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(m11_main) - //MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m10_state, m11_interrupt) - - /* sound hardware */ -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(m10_state::m15) + m_maincpu->set_addrmap(AS_PROGRAM, &m10_state::m11_main); +} +void m10_state::m15(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502,IREMM15_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(m15_main) + M6502(config, m_maincpu, IREMM15_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &m10_state::m15_main); + m_maincpu->set_vblank_int("screen", FUNC(m10_state::m15_interrupt)); MCFG_MACHINE_START_OVERRIDE(m10_state,m10) MCFG_MACHINE_RESET_OVERRIDE(m10_state,m10) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m10_state, m15_interrupt) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(IREMM15_PIXEL_CLOCK, IREMM15_HTOTAL, IREMM15_HBEND, IREMM15_HBSTART, IREMM15_VTOTAL, IREMM15_VBEND, IREMM15_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(m10_state, screen_update_m15) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(IREMM15_PIXEL_CLOCK, IREMM15_HTOTAL, IREMM15_HBEND, IREMM15_HBSTART, IREMM15_VTOTAL, IREMM15_VBEND, IREMM15_VBSTART); + m_screen->set_screen_update(FUNC(m10_state::screen_update_m15)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfxdecode_device::empty) - MCFG_PALETTE_ADD("palette", 2*8) + GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty); + + PALETTE(config, m_palette, 2*8); + m_palette->set_init(FUNC(m10_state::palette_init_m10)); - MCFG_PALETTE_INIT_OWNER(m10_state,m10) MCFG_VIDEO_START_OVERRIDE(m10_state, m15 ) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(m10_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(m10_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(m10_state::headoni) +void m10_state::headoni(machine_config &config) +{ m15(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK(11730000/16) -MACHINE_CONFIG_END + m_maincpu->set_clock(11730000/16); +} /************************************* * diff --git a/src/mame/drivers/m14.cpp b/src/mame/drivers/m14.cpp index dbd075795b7..4bd7334a609 100644 --- a/src/mame/drivers/m14.cpp +++ b/src/mame/drivers/m14.cpp @@ -432,40 +432,38 @@ void m14_state::machine_reset() } -MACHINE_CONFIG_START(m14_state::m14) - +void m14_state::m14(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",I8085A,6000000) //guess: 6 Mhz internally divided by 2 - MCFG_DEVICE_PROGRAM_MAP(m14_map) - MCFG_DEVICE_IO_MAP(m14_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m14_state, m14_irq) + I8085A(config, m_maincpu, 6000000); //guess: 6 Mhz internally divided by 2 + m_maincpu->set_addrmap(AS_PROGRAM, &m14_state::m14_map); + m_maincpu->set_addrmap(AS_IO, &m14_state::m14_io_map); + m_maincpu->set_vblank_int("screen", FUNC(m14_state::m14_irq)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) //not accurate - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(m14_state, screen_update_m14) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m14) - MCFG_PALETTE_ADD("palette", 0x20) - MCFG_PALETTE_INIT_OWNER(m14_state, m14) - + 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(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(m14_state::screen_update_m14)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_m14); + PALETTE(config, m_palette, 0x20); + m_palette->set_init(FUNC(m14_state::palette_init_m14)); /* sound hardware */ - SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(m14_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6) + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(m14_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.6); // MCFG_DEVICE_ADD("discrete", DISCRETE) // MCFG_DISCRETE_INTF(m14) // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp index 117f237230b..6da1e777bd0 100644 --- a/src/mame/drivers/m63.cpp +++ b/src/mame/drivers/m63.cpp @@ -759,9 +759,9 @@ INTERRUPT_GEN_MEMBER(m63_state::vblank_irq) MACHINE_CONFIG_START(m63_state::m63) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",Z80,XTAL(12'000'000)/4) /* 3 MHz */ - MCFG_DEVICE_PROGRAM_MAP(m63_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m63_state, vblank_irq) + Z80(config, m_maincpu, XTAL(12'000'000)/4); /* 3 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &m63_state::m63_map); + m_maincpu->set_vblank_int("screen", FUNC(m63_state::vblank_irq)); ls259_device &outlatch(LS259(config, "outlatch")); // probably chip at E7 obscured by pulldown resistor outlatch.q_out_cb<0>().set(FUNC(m63_state::nmi_mask_w)); @@ -782,18 +782,18 @@ MACHINE_CONFIG_START(m63_state::m63) MCFG_MACHINE_RESET_OVERRIDE(m63_state,m63) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(m63_state, screen_update_m63) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m63) - MCFG_PALETTE_ADD("palette", 256+4) - - MCFG_PALETTE_INIT_OWNER(m63_state,m63) + 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(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(m63_state::screen_update_m63)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_m63); + PALETTE(config, m_palette, 256+4); + m_palette->set_init(FUNC(m63_state::palette_init_m63)); + MCFG_VIDEO_START_OVERRIDE(m63_state,m63) /* sound hardware */ @@ -802,47 +802,49 @@ MACHINE_CONFIG_START(m63_state::m63) GENERIC_LATCH_8(config, m_soundlatch); AY8910(config, m_ay1, XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25); - AY8910(config, m_ay2, XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 1.00); /* ????? */ -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(m63_state::atomboy) +void m63_state::atomboy(machine_config &config) +{ m63(config); - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_PERIODIC_INT_DRIVER(m63_state, snd_irq, 60/2) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(m63_state::fghtbskt) + m_soundcpu->set_periodic_int(FUNC(m63_state::snd_irq), attotime::from_hz(60/2)); +} +void m63_state::fghtbskt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(12'000'000)/4) /* 3 MHz */ - MCFG_DEVICE_PROGRAM_MAP(fghtbskt_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m63_state, vblank_irq) + Z80(config, m_maincpu, XTAL(12'000'000)/4); /* 3 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &m63_state::fghtbskt_map); + m_maincpu->set_vblank_int("screen", FUNC(m63_state::vblank_irq)); ls259_device &outlatch(LS259(config, "outlatch")); outlatch.q_out_cb<1>().set(FUNC(m63_state::nmi_mask_w)); outlatch.q_out_cb<2>().set(FUNC(m63_state::fghtbskt_flipscreen_w)); //outlatch.q_out_cb<7>().set(FUNC(m63_state::fghtbskt_samples_w)); - MCFG_DEVICE_ADD("soundcpu", I8039,XTAL(12'000'000)/4) /* ????? */ - MCFG_DEVICE_PROGRAM_MAP(i8039_map) - MCFG_DEVICE_IO_MAP(i8039_port_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(m63_state, snd_irq, 60/2) + I8039(config, m_soundcpu, XTAL(12'000'000)/4); /* ????? */ + m_soundcpu->set_addrmap(AS_PROGRAM, &m63_state::i8039_map); + m_soundcpu->set_addrmap(AS_IO, &m63_state::i8039_port_map); + m_soundcpu->set_periodic_int(FUNC(m63_state::snd_irq), attotime::from_hz(60/2)); MCFG_MACHINE_START_OVERRIDE(m63_state,m63) MCFG_MACHINE_RESET_OVERRIDE(m63_state,m63) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(m63_state, screen_update_m63) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fghtbskt) - MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256) + 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(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(m63_state::screen_update_m63)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_fghtbskt); + PALETTE(config, m_palette, 256); + m_palette->set_prom_region("proms"); + m_palette->set_init("palette", FUNC(palette_device::palette_init_RRRRGGGGBBBB_proms)); + MCFG_VIDEO_START_OVERRIDE(m63_state,m63) /* sound hardware */ @@ -852,11 +854,11 @@ MACHINE_CONFIG_START(m63_state::fghtbskt) AY8910(config, m_ay1, XTAL(12'000'000)/8).add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(m63_state, fghtbskt_sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(m63_state::fghtbskt_sh_start)); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} /*************************************************************************** diff --git a/src/mame/drivers/mcr.cpp b/src/mame/drivers/mcr.cpp index d2631c3c10f..d3a74881da2 100644 --- a/src/mame/drivers/mcr.cpp +++ b/src/mame/drivers/mcr.cpp @@ -1749,15 +1749,15 @@ static const char *const twotiger_sample_names[] = *************************************/ /* 90009 CPU board plus 90908/90913/91483 sound board */ -MACHINE_CONFIG_START(mcr_state::mcr_90009) - +void mcr_state::mcr_90009(machine_config &config) +{ /* basic machine hardware */ Z80(config, m_maincpu, MAIN_OSC_MCR_I/8); m_maincpu->set_daisy_config(mcr_daisy_chain); m_maincpu->set_addrmap(AS_PROGRAM, &mcr_state::cpu_90009_map); m_maincpu->set_addrmap(AS_IO, &mcr_state::cpu_90009_portmap); - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr_state, mcr_interrupt, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(mcr_state::mcr_interrupt), "screen", 0, 1); Z80CTC(config, m_ctc, MAIN_OSC_MCR_I/8 /* same as "maincpu" */); m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); @@ -1768,40 +1768,39 @@ MACHINE_CONFIG_START(mcr_state::mcr_90009) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_REFRESH_RATE(30) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*16, 30*16) - MCFG_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 0*16, 30*16-1) - MCFG_SCREEN_UPDATE_DRIVER(mcr_state, screen_update_mcr) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mcr) - MCFG_PALETTE_ADD("palette", 32) - MCFG_PALETTE_FORMAT(xxxxRRRRBBBBGGGG) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + screen.set_refresh_hz(30); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(32*16, 30*16); + screen.set_visarea(0*16, 32*16-1, 0*16, 30*16-1); + screen.set_screen_update(FUNC(mcr_state::screen_update_mcr)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_mcr); + PALETTE(config, m_palette, 32).set_format(PALETTE_FORMAT_xxxxRRRRBBBBGGGG); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ssio", MIDWAY_SSIO) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - + MIDWAY_SSIO(config, m_ssio); + m_ssio->add_route(0, "lspeaker", 1.0); + m_ssio->add_route(1, "rspeaker", 1.0); +} /* as above, but in a casino cabinet */ -MACHINE_CONFIG_START(mcr_dpoker_state::mcr_90009_dp) +void mcr_dpoker_state::mcr_90009_dp(machine_config &config) +{ mcr_90009(config); /* basic machine hardware */ - MCFG_TIMER_DRIVER_ADD("coinin", mcr_dpoker_state, coin_in_callback) - MCFG_TIMER_DRIVER_ADD("hopper", mcr_dpoker_state, hopper_callback) -MACHINE_CONFIG_END - + TIMER(config, "coinin").configure_generic(FUNC(mcr_dpoker_state::coin_in_callback)); + TIMER(config, "hopper").configure_generic(FUNC(mcr_dpoker_state::hopper_callback)); +} /* 90010 CPU board plus 90908/90913/91483 sound board */ -MACHINE_CONFIG_START(mcr_state::mcr_90010) +void mcr_state::mcr_90010(machine_config &config) +{ mcr_90009(config); /* basic machine hardware */ @@ -1809,41 +1808,39 @@ MACHINE_CONFIG_START(mcr_state::mcr_90010) m_maincpu->set_addrmap(AS_IO, &mcr_state::cpu_90010_portmap); /* video hardware */ - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(64) - MCFG_PALETTE_FORMAT(xxxxRRRRBBBBGGGG) -MACHINE_CONFIG_END - + m_palette->set_entries(64); + m_palette->set_format(PALETTE_FORMAT_xxxxRRRRBBBBGGGG); +} /* as above, plus 8-track tape */ -MACHINE_CONFIG_START(mcr_state::mcr_90010_tt) +void mcr_state::mcr_90010_tt(machine_config &config) +{ mcr_90010(config); /* sound hardware */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(twotiger_sample_names) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_names(twotiger_sample_names); + m_samples->add_route(0, "lspeaker", 0.25); + m_samples->add_route(1, "rspeaker", 0.25); +} /* 91475 CPU board plus 90908/90913/91483 sound board plus cassette interface */ -MACHINE_CONFIG_START(mcr_state::mcr_91475) +void mcr_state::mcr_91475(machine_config &config) +{ mcr_90010(config); /* video hardware */ - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(128) - MCFG_PALETTE_FORMAT(xxxxRRRRBBBBGGGG) + m_palette->set_entries(128); + m_palette->set_format(PALETTE_FORMAT_xxxxRRRRBBBBGGGG); /* sound hardware */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(journey_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(journey_sample_names); + m_samples->add_route(ALL_OUTPUTS, "lspeaker", 0.25); + m_samples->add_route(ALL_OUTPUTS, "rspeaker", 0.25); +} /* 91490 CPU board plus 90908/90913/91483 sound board */ @@ -1861,18 +1858,20 @@ void mcr_state::mcr_91490(machine_config & config) /* 91490 CPU board plus 90908/90913/91483 sound board plus Squawk n' Talk sound board */ -MACHINE_CONFIG_START(mcr_state::mcr_91490_snt) +void mcr_state::mcr_91490_snt(machine_config &config) +{ mcr_91490(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("snt", MIDWAY_SQUAWK_N_TALK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + MIDWAY_SQUAWK_N_TALK(config, m_squawk_n_talk); + m_squawk_n_talk->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_squawk_n_talk->add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} /* 91490 CPU board plus 90908/90913/91483 sound board plus Squawk n' Talk sound board plus IPU */ -MACHINE_CONFIG_START(mcr_nflfoot_state::mcr_91490_ipu) +void mcr_nflfoot_state::mcr_91490_ipu(machine_config &config) +{ mcr_91490_snt(config); /* basic machine hardware */ @@ -1881,8 +1880,7 @@ MACHINE_CONFIG_START(mcr_nflfoot_state::mcr_91490_ipu) m_ipu->set_addrmap(AS_PROGRAM, &mcr_nflfoot_state::ipu_91695_map); m_ipu->set_addrmap(AS_IO, &mcr_nflfoot_state::ipu_91695_portmap); - MCFG_TIMER_MODIFY("scantimer") - MCFG_TIMER_DRIVER_CALLBACK(mcr_nflfoot_state, ipu_interrupt) + subdevice<timer_device>("scantimer")->set_callback(FUNC(mcr_nflfoot_state::ipu_interrupt)); Z80CTC(config, m_ipu_ctc, 7372800/2 /* same as "ipu" */); m_ipu_ctc->intr_callback().set_inputline(m_ipu, INPUT_LINE_IRQ0); @@ -1897,18 +1895,19 @@ MACHINE_CONFIG_START(mcr_nflfoot_state::mcr_91490_ipu) m_ipu_sio->out_int_callback().set_inputline(m_ipu, INPUT_LINE_IRQ0); m_ipu_sio->out_txda_callback().set(FUNC(mcr_nflfoot_state::sio_txda_w)); m_ipu_sio->out_txdb_callback().set(FUNC(mcr_nflfoot_state::sio_txdb_w)); -MACHINE_CONFIG_END +} /* 91490 CPU board plus 90908/90913/91483 sound board plus Turbo Cheap Squeak sound board */ -MACHINE_CONFIG_START(mcr_state::mcr_91490_tcs) +void mcr_state::mcr_91490_tcs(machine_config &config) +{ mcr_91490(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("tcs", MIDWAY_TURBO_CHEAP_SQUEAK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + MIDWAY_TURBO_CHEAP_SQUEAK(config, m_turbo_cheap_squeak); + m_turbo_cheap_squeak->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_turbo_cheap_squeak->add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} diff --git a/src/mame/drivers/meadows.cpp b/src/mame/drivers/meadows.cpp index ca3c9ef57de..bf92c2823fe 100644 --- a/src/mame/drivers/meadows.cpp +++ b/src/mame/drivers/meadows.cpp @@ -621,109 +621,109 @@ static const char *const bowl3d_sample_names[] = * *************************************/ -MACHINE_CONFIG_START(meadows_state::meadows) - +void meadows_state::meadows(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/8) /* 5MHz / 8 = 625 kHz */ - MCFG_DEVICE_PROGRAM_MAP(meadows_main_map) + S2650(config, m_maincpu, MASTER_CLOCK/8); /* 5MHz / 8 = 625 kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &meadows_state::meadows_main_map); - MCFG_DEVICE_ADD("audiocpu", S2650, MASTER_CLOCK/8) /* 5MHz / 8 = 625 kHz */ - MCFG_DEVICE_PROGRAM_MAP(audio_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(meadows_state, audio_interrupt, (double)5000000/131072) + S2650(config, m_audiocpu, MASTER_CLOCK/8); /* 5MHz / 8 = 625 kHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &meadows_state::audio_map); + m_audiocpu->set_periodic_int(FUNC(meadows_state::audio_interrupt), attotime::from_hz((double)5000000/131072)); - MCFG_QUANTUM_TIME(attotime::from_hz(600)) + config.m_minimum_quantum = attotime::from_hz(600); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 30*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(meadows_state, screen_update_meadows) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, meadows_state, meadows_vblank_irq)) // one interrupt per frame!? + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 30*8); + m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + m_screen->set_screen_update(FUNC(meadows_state::screen_update_meadows)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(meadows_state::meadows_vblank_irq)); // one interrupt per frame!? - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_meadows) - MCFG_PALETTE_ADD_MONOCHROME("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_meadows); + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* audio hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 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) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(meadows_state::minferno) + DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 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); + + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_start_callback(FUNC(meadows_state::meadows_sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 1.0); +} +void meadows_state::minferno(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/24) /* 5MHz / 8 / 3 = 208.33 kHz */ - MCFG_DEVICE_PROGRAM_MAP(minferno_main_map) - MCFG_DEVICE_DATA_MAP(minferno_data_map) + S2650(config, m_maincpu, MASTER_CLOCK/24); /* 5MHz / 8 / 3 = 208.33 kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &meadows_state::minferno_main_map); + m_maincpu->set_addrmap(AS_DATA, &meadows_state::minferno_data_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 24*8-1) - MCFG_SCREEN_UPDATE_DRIVER(meadows_state, screen_update_meadows) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, meadows_state, minferno_vblank_irq)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 1*8, 24*8-1); + m_screen->set_screen_update(FUNC(meadows_state::screen_update_meadows)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(meadows_state::minferno_vblank_irq)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_minferno) - MCFG_PALETTE_ADD_MONOCHROME("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_minferno); + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* audio hardware */ // TODO -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(meadows_state::bowl3d) +} +void meadows_state::bowl3d(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/8) /* 5MHz / 8 = 625 kHz */ - MCFG_DEVICE_PROGRAM_MAP(bowl3d_main_map) + S2650(config, m_maincpu, MASTER_CLOCK/8); /* 5MHz / 8 = 625 kHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &meadows_state::bowl3d_main_map); - MCFG_DEVICE_ADD("audiocpu", S2650, MASTER_CLOCK/8) /* 5MHz / 8 = 625 kHz */ - MCFG_DEVICE_PROGRAM_MAP(audio_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(meadows_state, audio_interrupt, (double)5000000/131072) + S2650(config, m_audiocpu, MASTER_CLOCK/8); /* 5MHz / 8 = 625 kHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &meadows_state::audio_map); + m_audiocpu->set_periodic_int(FUNC(meadows_state::audio_interrupt), attotime::from_hz((double)5000000/131072)); - MCFG_QUANTUM_TIME(attotime::from_hz(600)) + config.m_minimum_quantum = attotime::from_hz(600); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 30*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(meadows_state, screen_update_meadows) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, meadows_state, meadows_vblank_irq)) // one interrupt per frame!? + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 30*8); + m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + m_screen->set_screen_update(FUNC(meadows_state::screen_update_meadows)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(meadows_state::meadows_vblank_irq)); // one interrupt per frame!? - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_meadows) - MCFG_PALETTE_ADD_MONOCHROME("palette") + GFXDECODE(config, m_gfxdecode, m_palette, gfx_meadows); + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* audio hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 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) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) - - MCFG_DEVICE_ADD("samples2", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(bowl3d_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END - - + DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 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); + + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_start_callback(FUNC(meadows_state::meadows_sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 1.0); + + samples_device &samples2(SAMPLES(config, "samples2")); + samples2.set_channels(1); + samples2.set_samples_names(bowl3d_sample_names); + samples2.add_route(ALL_OUTPUTS, "speaker", 1.0); +} /************************************* * diff --git a/src/mame/drivers/mmagic.cpp b/src/mame/drivers/mmagic.cpp index 088ae0252c6..d5dd9491fd5 100644 --- a/src/mame/drivers/mmagic.cpp +++ b/src/mame/drivers/mmagic.cpp @@ -306,27 +306,29 @@ void mmagic_state::machine_start() // MACHINE DEFINTIONS //************************************************************************** -MACHINE_CONFIG_START(mmagic_state::mmagic) +void mmagic_state::mmagic(machine_config &config) +{ // basic machine hardware - MCFG_DEVICE_ADD("maincpu", I8085A, 6.144_MHz_XTAL) // NEC D8085A - MCFG_DEVICE_PROGRAM_MAP(mmagic_mem) - MCFG_DEVICE_IO_MAP(mmagic_io) + I8085A(config, m_maincpu, 6.144_MHz_XTAL); // NEC D8085A + m_maincpu->set_addrmap(AS_PROGRAM, &mmagic_state::mmagic_mem); + m_maincpu->set_addrmap(AS_IO, &mmagic_state::mmagic_io); // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(6.144_MHz_XTAL, 384, 0, 256, 264, 0, 192) - MCFG_SCREEN_UPDATE_DRIVER(mmagic_state, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(6.144_MHz_XTAL, 384, 0, 256, 264, 0, 192); + m_screen->set_screen_update(FUNC(mmagic_state::screen_update)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8); + m_palette->set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(mmagic_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(mmagic_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.5); // TODO: replace samples with SN76477 + discrete sound -MACHINE_CONFIG_END +} //************************************************************************** diff --git a/src/mame/drivers/multigam.cpp b/src/mame/drivers/multigam.cpp index cf6dced861b..cd4b919dbca 100644 --- a/src/mame/drivers/multigam.cpp +++ b/src/mame/drivers/multigam.cpp @@ -1206,48 +1206,49 @@ MACHINE_START_MEMBER(multigam_state,supergm3) m_multigmc_mmc3_6000_ram = std::make_unique<uint8_t[]>(0x2000); } -MACHINE_CONFIG_START(multigam_state::multigam) +void multigam_state::multigam(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(multigam_map) + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &multigam_state::multigam_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu", ppu2c0x_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(32*8, 262); + screen.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); - MCFG_PPU2C02_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C02(config, m_ppu); + m_ppu->set_cpu_tag("maincpu"); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(multigam_state::multigm3) +void multigam_state::multigm3(machine_config &config) +{ multigam(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multigm3_map) + m_maincpu->set_addrmap(AS_PROGRAM, &multigam_state::multigm3_map); MCFG_MACHINE_START_OVERRIDE(multigam_state, multigm3 ) MCFG_MACHINE_RESET_OVERRIDE(multigam_state, multigm3 ) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(multigam_state::multigmt) +void multigam_state::multigmt(machine_config &config) +{ multigam(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multigmt_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &multigam_state::multigmt_map); +} -MACHINE_CONFIG_START(multigam_state::supergm3) +void multigam_state::supergm3(machine_config &config) +{ multigam(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(supergm3_map) + m_maincpu->set_addrmap(AS_PROGRAM, &multigam_state::supergm3_map); MCFG_MACHINE_START_OVERRIDE(multigam_state,supergm3) -MACHINE_CONFIG_END +} ROM_START( multigam ) ROM_REGION( 0x10000, "maincpu", 0 ) diff --git a/src/mame/drivers/mw8080bw.cpp b/src/mame/drivers/mw8080bw.cpp index 972dedb478e..86827f050ab 100644 --- a/src/mame/drivers/mw8080bw.cpp +++ b/src/mame/drivers/mw8080bw.cpp @@ -230,19 +230,20 @@ void mw8080bw_state::main_map(address_map &map) * *************************************/ -MACHINE_CONFIG_START(mw8080bw_state::mw8080bw_root) - +void mw8080bw_state::mw8080bw_root(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",I8080,MW8080BW_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(main_map) + I8080(config, m_maincpu, MW8080BW_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &mw8080bw_state::main_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,mw8080bw) MCFG_MACHINE_RESET_OVERRIDE(mw8080bw_state,mw8080bw) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MW8080BW_PIXEL_CLOCK, MW8080BW_HTOTAL, MW8080BW_HBEND, MW8080BW_HPIXCOUNT, MW8080BW_VTOTAL, MW8080BW_VBEND, MW8080BW_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(mw8080bw_state, screen_update_mw8080bw) -MACHINE_CONFIG_END + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MW8080BW_PIXEL_CLOCK, MW8080BW_HTOTAL, MW8080BW_HBEND, MW8080BW_HPIXCOUNT, MW8080BW_VTOTAL, MW8080BW_VBEND, MW8080BW_VBSTART); + m_screen->set_screen_update(FUNC(mw8080bw_state::screen_update_mw8080bw)); +} @@ -407,21 +408,20 @@ static INPUT_PORTS_START( seawolf ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::seawolf) +void mw8080bw_state::seawolf(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(seawolf_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::seawolf_io_map); /* there is no watchdog */ /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ seawolf_audio(config); - -MACHINE_CONFIG_END +} @@ -509,21 +509,20 @@ static INPUT_PORTS_START( gunfight ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::gunfight) +void mw8080bw_state::gunfight(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(gunfight_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::gunfight_io_map); /* there is no watchdog */ /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ gunfight_audio(config); - -MACHINE_CONFIG_END +} @@ -739,21 +738,20 @@ static INPUT_PORTS_START( tornbase ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::tornbase) +void mw8080bw_state::tornbase(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(tornbase_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::tornbase_io_map); /* there is no watchdog */ /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ tornbase_audio(config); - -MACHINE_CONFIG_END +} @@ -848,22 +846,21 @@ static INPUT_PORTS_START( lagunar ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::zzzap) +void mw8080bw_state::zzzap(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(zzzap_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::zzzap_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_MONOSTABLE(RES_M(1), CAP_U(1))); /* 1.1s */ /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ /* zzzap_audio(config); */ - -MACHINE_CONFIG_END +} @@ -961,20 +958,20 @@ static INPUT_PORTS_START( maze ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::maze) +void mw8080bw_state::maze(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(maze_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::maze_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,maze) WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))); /* 2.97s */ /* audio hardware */ maze_audio(config); - -MACHINE_CONFIG_END +} @@ -1054,23 +1051,23 @@ static INPUT_PORTS_START( boothill ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::boothill) +void mw8080bw_state::boothill(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(boothill_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::boothill_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,boothill) WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))); /* 2.97s */ /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ boothill_audio(config); - -MACHINE_CONFIG_END +} @@ -1162,19 +1159,18 @@ static INPUT_PORTS_START( checkmat ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::checkmat) +void mw8080bw_state::checkmat(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(checkmat_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::checkmat_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))); /* 2.97s */ /* audio hardware */ checkmat_audio(config); - -MACHINE_CONFIG_END +} @@ -1290,23 +1286,23 @@ static INPUT_PORTS_START( desertgu ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::desertgu) +void mw8080bw_state::desertgu(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(desertgu_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::desertgu_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,desertgu) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ desertgu_audio(config); - -MACHINE_CONFIG_END +} @@ -1493,22 +1489,21 @@ static INPUT_PORTS_START( einning ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::dplay) +void mw8080bw_state::dplay(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(dplay_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::dplay_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ dplay_audio(config); - -MACHINE_CONFIG_END +} @@ -1589,23 +1584,23 @@ static INPUT_PORTS_START( gmissile ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::gmissile) +void mw8080bw_state::gmissile(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(gmissile_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::gmissile_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,gmissile) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ gmissile_audio(config); - -MACHINE_CONFIG_END +} @@ -1684,23 +1679,23 @@ static INPUT_PORTS_START( m4 ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::m4) +void mw8080bw_state::m4(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(m4_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::m4_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,m4) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ m4_audio(config); - -MACHINE_CONFIG_END +} @@ -1854,23 +1849,23 @@ static INPUT_PORTS_START( clowns1 ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::clowns) +void mw8080bw_state::clowns(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(clowns_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::clowns_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ clowns_audio(config); - -MACHINE_CONFIG_END +} @@ -1951,23 +1946,23 @@ static INPUT_PORTS_START( spacwalk ) PORT_ADJUSTER( 40, "R507 - Music Volume" ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::spacwalk) +void mw8080bw_state::spacwalk(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(spacwalk_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::spacwalk_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ spacwalk_audio(config); - -MACHINE_CONFIG_END +} @@ -2035,22 +2030,21 @@ static INPUT_PORTS_START( shuffle ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::shuffle) +void mw8080bw_state::shuffle(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(shuffle_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::shuffle_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ shuffle_audio(config); - -MACHINE_CONFIG_END +} @@ -2123,22 +2117,21 @@ static INPUT_PORTS_START( dogpatch ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::dogpatch) +void mw8080bw_state::dogpatch(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(dogpatch_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::dogpatch_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ dogpatch_audio(config); - -MACHINE_CONFIG_END +} @@ -2274,32 +2267,33 @@ static INPUT_PORTS_START( spcenctr ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::spcenctr) +void mw8080bw_state::spcenctr(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(spcenctr_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::spcenctr_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,spcenctr) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* timers */ - MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeon", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ)) - MCFG_TIMER_PARAM(true) /* indicates strobe ON */ + timer_device &strobeon(TIMER(config, "strobeon")); + strobeon.configure_periodic(FUNC(mw8080bw_state::spcenctr_strobe_timer_callback), attotime::from_hz(SPCENCTR_STROBE_FREQ)); + strobeon.config_param(true); /* indicates strobe ON */ - MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeoff", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ)) - MCFG_TIMER_START_DELAY(attotime::from_hz(SPCENCTR_STROBE_FREQ) * (100 - SPCENCTR_STROBE_DUTY_CYCLE) / 100) - MCFG_TIMER_PARAM(false) /* indicates strobe OFF */ + timer_device &strobeoff(TIMER(config, "strobeoff")); + strobeoff.configure_periodic(FUNC(mw8080bw_state::spcenctr_strobe_timer_callback), attotime::from_hz(SPCENCTR_STROBE_FREQ)); + strobeoff.set_start_delay(attotime::from_hz(SPCENCTR_STROBE_FREQ) * (100 - SPCENCTR_STROBE_DUTY_CYCLE) / 100); + strobeoff.config_param(false); /* indicates strobe OFF */ /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(mw8080bw_state, screen_update_spcenctr) + m_screen->set_screen_update(FUNC(mw8080bw_state::screen_update_spcenctr)); /* audio hardware */ spcenctr_audio(config); - -MACHINE_CONFIG_END +} @@ -2371,28 +2365,27 @@ static INPUT_PORTS_START( phantom2 ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::phantom2) +void mw8080bw_state::phantom2(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(phantom2_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::phantom2_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,phantom2) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(mw8080bw_state, screen_update_phantom2) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, mw8080bw_state, screen_vblank_phantom2)) + m_screen->set_screen_update(FUNC(mw8080bw_state::screen_update_phantom2)); + m_screen->screen_vblank().set(FUNC(mw8080bw_state::screen_vblank_phantom2)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ phantom2_audio(config); - -MACHINE_CONFIG_END +} @@ -2513,22 +2506,21 @@ static INPUT_PORTS_START( bowler ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::bowler) +void mw8080bw_state::bowler(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(bowler_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::bowler_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ bowler_audio(config); - -MACHINE_CONFIG_END +} @@ -2725,27 +2717,26 @@ static INPUT_PORTS_START( invaders ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::invaders) +void mw8080bw_state::invaders(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(invaders_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::invaders_io_map); + MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,invaders) WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(mw8080bw_state, screen_update_invaders) + m_screen->set_screen_update(FUNC(mw8080bw_state::screen_update_invaders)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ invaders_audio(config); - -MACHINE_CONFIG_END +} @@ -2811,22 +2802,21 @@ static INPUT_PORTS_START( blueshrk ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::blueshrk) +void mw8080bw_state::blueshrk(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(blueshrk_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::blueshrk_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ blueshrk_audio(config); - -MACHINE_CONFIG_END +} @@ -2914,22 +2904,21 @@ static INPUT_PORTS_START( invad2ct ) INPUT_PORTS_END -MACHINE_CONFIG_START(mw8080bw_state::invad2ct) +void mw8080bw_state::invad2ct(machine_config &config) +{ mw8080bw_root(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(invad2ct_io_map) + m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::invad2ct_io_map); WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ)); /* add shifter */ - MB14241(config, "mb14241"); + MB14241(config, m_mb14241); /* audio hardware */ invad2ct_audio(config); - -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp index d7f787efb32..e7113c8cd1b 100644 --- a/src/mame/drivers/nes.cpp +++ b/src/mame/drivers/nes.cpp @@ -16,7 +16,6 @@ #include "includes/nes.h" #include "cpu/m6502/n2a03.h" -#include "screen.h" #include "softlist.h" #include "speaker.h" @@ -49,120 +48,115 @@ static INPUT_PORTS_START( famicom ) INPUT_PORTS_END -MACHINE_CONFIG_START(nes_state::nes) +void nes_state::nes(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(nes_map) + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_state::nes_map); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60.0988) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.0988); // This isn't used so much to calulate the vblank duration (the PPU code tracks that manually) but to determine // the number of cycles in each scanline for the PPU scanline timer. Since the PPU has 20 vblank scanlines + 2 // non-rendering scanlines, we compensate. This ends up being 2500 cycles for the non-rendering portion, 2273 // cycles for the actual vblank period. - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((113.66/(NTSC_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_NTSC-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(nes_state, screen_update_nes) + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((113.66/(NTSC_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_NTSC-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); + m_screen->set_size(32*8, 262); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + m_screen->set_screen_update(FUNC(nes_state::screen_update_nes)); - MCFG_PPU2C02_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C02(config, m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); // note APU sound level here was specified as 0.90, not 0.50 like the others // not sure how to adjust it when it's inside the CPU? - MCFG_NES_CONTROL_PORT_ADD("ctrl1", nes_control_port1_devices, "joypad") - MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) - MCFG_NES_CONTROL_PORT_ADD("ctrl2", nes_control_port2_devices, "joypad") - MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) - - MCFG_DEVICE_ADD("nes_slot", NES_CART_SLOT, NTSC_APU_CLOCK, nes_cart, nullptr) - MCFG_SOFTWARE_LIST_ADD("cart_list", "nes") - MCFG_SOFTWARE_LIST_ADD("ade_list", "nes_ade") // Camerica/Codemasters Aladdin Deck Enhancer mini-carts - MCFG_SOFTWARE_LIST_ADD("ntb_list", "nes_ntbrom") // Sunsoft Nantettate! Baseball mini-carts - MCFG_SOFTWARE_LIST_ADD("kstudio_list", "nes_kstudio") // Bandai Karaoke Studio expansion carts - MCFG_SOFTWARE_LIST_ADD("datach_list", "nes_datach") // Bandai Datach Joint ROM System mini-carts -MACHINE_CONFIG_END + NES_CONTROL_PORT(config, m_ctrl1, nes_control_port1_devices, "joypad"); + m_ctrl1->set_brightpixel_callback(FUNC(nes_state::bright_pixel)); + NES_CONTROL_PORT(config, m_ctrl2, nes_control_port2_devices, "joypad"); + m_ctrl2->set_brightpixel_callback(FUNC(nes_state::bright_pixel)); + + NES_CART_SLOT(config, m_cartslot, NTSC_APU_CLOCK, nes_cart, nullptr); + SOFTWARE_LIST(config, "cart_list").set_original("nes"); + SOFTWARE_LIST(config, "ade_list").set_original("nes_ade"); // Camerica/Codemasters Aladdin Deck Enhancer mini-carts + SOFTWARE_LIST(config, "ntb_list").set_original("nes_ntbrom"); // Sunsoft Nantettate! Baseball mini-carts + SOFTWARE_LIST(config, "kstudio_list").set_original("nes_kstudio"); // Bandai Karaoke Studio expansion carts + SOFTWARE_LIST(config, "datach_list").set_original("nes_datach"); // Bandai Datach Joint ROM System mini-carts +} -MACHINE_CONFIG_START(nes_state::nespal) +void nes_state::nespal(machine_config &config) +{ nes(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK(PAL_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(nes_map) + m_maincpu->set_clock(PAL_APU_CLOCK); - MCFG_DEVICE_REMOVE("ppu") - MCFG_PPU2C07_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C07(config.replace(), m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - MCFG_DEVICE_MODIFY("nes_slot") - MCFG_DEVICE_CLOCK(PAL_APU_CLOCK) + m_cartslot->set_clock(PAL_APU_CLOCK); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(50.0070) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))) - MCFG_SCREEN_SIZE(32*8, 312) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(nes_state::famicom) + m_screen->set_refresh_hz(50.0070); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); + m_screen->set_size(32*8, 312); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); +} + +void nes_state::famicom(machine_config &config) +{ nes(config); - MCFG_DEVICE_REMOVE("ctrl1") - MCFG_DEVICE_REMOVE("ctrl2") - MCFG_NES_CONTROL_PORT_ADD("ctrl1", fc_control_port1_devices, "joypad") - MCFG_NES_CONTROL_PORT_ADD("ctrl2", fc_control_port2_devices, "joypad") - MCFG_FC_EXPANSION_PORT_ADD("exp", fc_expansion_devices, nullptr) - MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) - - MCFG_SOFTWARE_LIST_ADD("flop_list", "famicom_flop") - MCFG_SOFTWARE_LIST_ADD("cass_list", "famicom_cass") -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(nes_state::nespalc) + NES_CONTROL_PORT(config.replace(), m_ctrl1, fc_control_port1_devices, "joypad"); + NES_CONTROL_PORT(config.replace(), m_ctrl2, fc_control_port2_devices, "joypad"); + NES_CONTROL_PORT(config, m_exp, fc_expansion_devices, nullptr); + m_exp->set_brightpixel_callback(FUNC(nes_state::bright_pixel)); + + SOFTWARE_LIST(config, "flop_list").set_original("famicom_flop"); + SOFTWARE_LIST(config, "cass_list").set_original("famicom_cass"); +} + +void nes_state::nespalc(machine_config &config) +{ nespal(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_CLOCK(PALC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(nes_map) + m_maincpu->set_clock(PALC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_state::nes_map); /* UMC 6538 and friends -- extends time for rendering dummy scanlines */ - MCFG_DEVICE_REMOVE("ppu") - MCFG_PPUPALC_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_PALC(config.replace(), m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline("maincpu", INPUT_LINE_NMI); - MCFG_DEVICE_MODIFY("nes_slot") - MCFG_DEVICE_CLOCK(PALC_APU_CLOCK) + m_cartslot->set_clock(PALC_APU_CLOCK); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(50.0070) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((113.66/(PALC_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE_PALC+1+2))) -MACHINE_CONFIG_END + m_screen->set_refresh_hz(50.0070); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((113.66/(PALC_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE_PALC+1+2))); +} -MACHINE_CONFIG_START(nes_state::famipalc) +void nes_state::famipalc(machine_config &config) +{ nespalc(config); - MCFG_DEVICE_REMOVE("ctrl1") - MCFG_DEVICE_REMOVE("ctrl2") - MCFG_NES_CONTROL_PORT_ADD("ctrl1", fc_control_port1_devices, "joypad") - MCFG_NES_CONTROL_PORT_ADD("ctrl2", fc_control_port2_devices, "joypad") - MCFG_FC_EXPANSION_PORT_ADD("exp", fc_expansion_devices, nullptr) - MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) + NES_CONTROL_PORT(config.replace(), m_ctrl1, fc_control_port1_devices, "joypad"); + NES_CONTROL_PORT(config.replace(), m_ctrl2, fc_control_port2_devices, "joypad"); + NES_CONTROL_PORT(config, m_exp, fc_expansion_devices, nullptr); + m_exp->set_brightpixel_callback(FUNC(nes_state::bright_pixel)); - MCFG_SOFTWARE_LIST_ADD("cass_list", "famicom_cass") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cass_list").set_original("famicom_cass"); +} -MACHINE_CONFIG_START(nes_state::suborkbd) +void nes_state::suborkbd(machine_config &config) +{ famipalc(config); /* TODO: emulate the parallel port bus! */ - MCFG_DEVICE_MODIFY("exp") - MCFG_SLOT_DEFAULT_OPTION("subor_keyboard") - MCFG_SLOT_FIXED(true) -MACHINE_CONFIG_END + m_exp->set_default_option("subor_keyboard"); + m_exp->set_fixed(true); +} void nes_state::setup_disk(nes_disksys_device *slot) { @@ -192,7 +186,6 @@ void nes_state::setup_disk(nes_disksys_device *slot) } } - MACHINE_START_MEMBER( nes_state, fds ) { m_ciram = std::make_unique<uint8_t[]>(0x800); @@ -213,22 +206,23 @@ MACHINE_RESET_MEMBER( nes_state, fds ) m_maincpu->reset(); } -MACHINE_CONFIG_START(nes_state::fds) +void nes_state::fds(machine_config &config) +{ famicom(config); - MCFG_MACHINE_START_OVERRIDE( nes_state, fds ) - MCFG_MACHINE_RESET_OVERRIDE( nes_state, fds ) - MCFG_DEVICE_REMOVE("nes_slot") - MCFG_DEVICE_ADD("disk", NES_DISKSYS, 0) + MCFG_MACHINE_START_OVERRIDE(nes_state, fds) + MCFG_MACHINE_RESET_OVERRIDE(nes_state, fds) - MCFG_DEVICE_REMOVE("cart_list") - MCFG_DEVICE_REMOVE("cass_list") - MCFG_DEVICE_REMOVE("ade_list") - MCFG_DEVICE_REMOVE("ntb_list") - MCFG_DEVICE_REMOVE("kstudio_list") - MCFG_DEVICE_REMOVE("datach_list") -MACHINE_CONFIG_END + config.device_remove("nes_slot"); + NES_DISKSYS(config, "disk", 0); + config.device_remove("cart_list"); + config.device_remove("cass_list"); + config.device_remove("ade_list"); + config.device_remove("ntb_list"); + config.device_remove("kstudio_list"); + config.device_remove("datach_list"); +} MACHINE_START_MEMBER( nes_state, famitwin ) { @@ -258,17 +252,17 @@ MACHINE_RESET_MEMBER( nes_state, famitwin ) m_maincpu->reset(); } -MACHINE_CONFIG_START(nes_state::famitwin) +void nes_state::famitwin(machine_config &config) +{ famicom(config); MCFG_MACHINE_START_OVERRIDE( nes_state, famitwin ) MCFG_MACHINE_RESET_OVERRIDE( nes_state, famitwin ) - MCFG_DEVICE_MODIFY("nes_slot") - MCFG_NES_CARTRIDGE_NOT_MANDATORY + m_cartslot->set_must_be_loaded(false); - MCFG_DEVICE_ADD("disk", NES_DISKSYS, 0) -MACHINE_CONFIG_END + NES_DISKSYS(config, "disk", 0); +} diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index 179bb1d3b00..aa6d19a83cf 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -92,6 +92,7 @@ public: : nes_base_state(mconfig, type, tag) , m_ntram(nullptr) , m_chrram(nullptr) + , m_screen(*this, "screen") , m_ppu(*this, "ppu") , m_apu(*this, "apu") , m_prg(*this, "prg") @@ -227,6 +228,7 @@ private: virtual void machine_start() override; virtual void machine_reset() override; + required_device<screen_device> m_screen; required_device<ppu_vt03_device> m_ppu; required_device<nesapu_device> m_apu; required_device<address_map_bank_device> m_prg; @@ -1347,32 +1349,32 @@ static const uint8_t descram_ppu_2012_2017[5][6] = { {0x4, 0x7, 0x2, 0x6, 0x5, 0x3}, }; -MACHINE_CONFIG_START(nes_vt_state::nes_vt) +void nes_vt_state::nes_vt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502_VTSCR, NTSC_APU_CLOCK) // selectable speed? - MCFG_DEVICE_PROGRAM_MAP(nes_vt_map) + M6502_VTSCR(config, m_maincpu, NTSC_APU_CLOCK); // selectable speed? + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_map); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60.0988) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((113.66/(NTSC_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_NTSC-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu", ppu2c0x_device, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.0988); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((113.66/(NTSC_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_NTSC-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); + m_screen->set_size(32*8, 262); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + m_screen->set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "ppu", vt03_gfx_helper) + GFXDECODE(config, "gfxdecode", "ppu", vt03_gfx_helper); - MCFG_PPU_VT03_ADD("ppu") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) - MCFG_PPU_VT03_READ_BG_CB(READ8(*this, nes_vt_state,chr_r)) - MCFG_PPU_VT03_READ_SP_CB(READ8(*this, nes_vt_state,spr_r)) + PPU_VT03(config, m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + m_ppu->read_bg().set(FUNC(nes_vt_state::chr_r)); + m_ppu->read_sp().set(FUNC(nes_vt_state::spr_r)); ADDRESS_MAP_BANK(config, "prg").set_map(&nes_vt_state::prg_map).set_options(ENDIANNESS_LITTLE, 8, 15, 0x8000); - MCFG_NES_CONTROL_PORT_ADD("ctrl1", nes_control_port1_devices, "joypad") - //MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) - MCFG_NES_CONTROL_PORT_ADD("ctrl2", nes_control_port2_devices, "joypad") - //MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) + NES_CONTROL_PORT(config, m_ctrl1, nes_control_port1_devices, "joypad"); + NES_CONTROL_PORT(config, m_ctrl2, nes_control_port2_devices, "joypad"); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1381,116 +1383,106 @@ MACHINE_CONFIG_START(nes_vt_state::nes_vt) than just using 2 APUs as registers in the 2nd one affect the PCM channel mode but the DMA control still comes from the 1st, but in the new mode, sound always outputs via the 2nd. Probably need to split the APU into interface and sound gen logic. */ - MCFG_DEVICE_ADD("apu", NES_APU, NTSC_APU_CLOCK) - MCFG_NES_APU_IRQ_HANDLER(WRITELINE(*this, nes_vt_state, apu_irq)) - MCFG_NES_APU_MEM_READ_CALLBACK(READ8(*this, nes_vt_state, apu_read_mem)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + NES_APU(config, m_apu, NTSC_APU_CLOCK); + m_apu->irq().set(FUNC(nes_vt_state::apu_irq)); + m_apu->mem_read().set(FUNC(nes_vt_state::apu_read_mem)); + m_apu->add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_hum) +void nes_vt_state::nes_vt_hum(machine_config &config) +{ nes_vt(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_hum_map) + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_hum_map); - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_DESCRAMBLE(descram_ppu_2012_2017[3]); -MACHINE_CONFIG_END + m_ppu->set_201x_descramble(descram_ppu_2012_2017[3]); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_pjoy) +void nes_vt_state::nes_vt_pjoy(machine_config &config) +{ nes_vt(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_pjoy_map) - - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_DESCRAMBLE(descram_ppu_2012_2017[2]); -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_pjoy_map); + m_ppu->set_201x_descramble(descram_ppu_2012_2017[2]); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_sp69) +void nes_vt_state::nes_vt_sp69(machine_config &config) +{ nes_vt(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_sp69_map) - - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_DESCRAMBLE(descram_ppu_2012_2017[4]); -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_sp69_map); + m_ppu->set_201x_descramble(descram_ppu_2012_2017[4]); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_xx) +void nes_vt_state::nes_vt_xx(machine_config &config) +{ nes_vt(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_xx_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_xx_map); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_cy) +void nes_vt_state::nes_vt_cy(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_cy_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_cy_map); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_bt) +void nes_vt_state::nes_vt_bt(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_bt_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_bt_map); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_dg) +void nes_vt_state::nes_vt_dg(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_dg_map) - - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(50.0070) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))) - MCFG_SCREEN_SIZE(32*8, 312) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(nes_vt_state::nes_vt_vg ) - nes_vt_dg(config); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_dg_map); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_hh_map) + m_screen->set_refresh_hz(50.0070); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); + m_screen->set_size(32*8, 312); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); +} - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_PAL_MODE(PAL_MODE_NEW_VG); +void nes_vt_state::nes_vt_vg(machine_config &config) +{ + nes_vt_dg(config); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_hh_map); -MACHINE_CONFIG_END + m_ppu->set_palette_mode(PAL_MODE_NEW_VG);; +} // New mystery handheld architecture, VTxx derived -MACHINE_CONFIG_START(nes_vt_state::nes_vt_hh) +void nes_vt_state::nes_vt_hh(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_hh_map) - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_PAL_MODE(PAL_MODE_NEW_RGB); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_hh_map); + m_ppu->set_palette_mode(PAL_MODE_NEW_RGB); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(50.0070) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))) - MCFG_SCREEN_SIZE(32*8, 312) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) -MACHINE_CONFIG_END + m_screen->set_refresh_hz(50.0070); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((106.53/(PAL_APU_CLOCK.dvalue()/1000000)) * + (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL-ppu2c0x_device::VBLANK_FIRST_SCANLINE+1+2))); + m_screen->set_size(32*8, 312); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); +} static INPUT_PORTS_START( nes_vt ) PORT_START("CARTSEL") INPUT_PORTS_END -MACHINE_CONFIG_START(nes_vt_state::nes_vt_fp) +void nes_vt_state::nes_vt_fp(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_fp_map) + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_fp_map); - MCFG_PPU_VT03_MODIFY("ppu") - MCFG_PPU_VT03_SET_PAL_MODE(PAL_MODE_NEW_RGB12); -MACHINE_CONFIG_END + m_ppu->set_palette_mode(PAL_MODE_NEW_RGB12); +} -MACHINE_CONFIG_START(nes_vt_state::nes_vt_fa) +void nes_vt_state::nes_vt_fa(machine_config &config) +{ nes_vt_xx(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nes_vt_fa_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_fa_map); +} static INPUT_PORTS_START( nes_vt_fp ) diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp index fae4c66587a..67528ba4bf9 100644 --- a/src/mame/drivers/ninjakd2.cpp +++ b/src/mame/drivers/ninjakd2.cpp @@ -966,133 +966,129 @@ void omegaf_state::machine_reset() /*****************************************************************************/ -MACHINE_CONFIG_START(ninjakd2_state::ninjakd2_core) - +void ninjakd2_state::ninjakd2_core(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, MAIN_CLOCK_12/2) /* verified */ - MCFG_DEVICE_PROGRAM_MAP(ninjakd2_main_cpu) + Z80(config, m_maincpu, MAIN_CLOCK_12/2); /* verified */ + m_maincpu->set_addrmap(AS_PROGRAM, &ninjakd2_state::ninjakd2_main_cpu); - MCFG_DEVICE_ADD("soundcpu", Z80, MAIN_CLOCK_5) /* verified */ - MCFG_DEVICE_PROGRAM_MAP(ninjakd2_sound_cpu) - MCFG_DEVICE_IO_MAP(ninjakd2_sound_io) + Z80(config, m_soundcpu, MAIN_CLOCK_5); /* verified */ + m_soundcpu->set_addrmap(AS_PROGRAM, &ninjakd2_state::ninjakd2_sound_cpu); + m_soundcpu->set_addrmap(AS_IO, &ninjakd2_state::ninjakd2_sound_io); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.61) /* verified on pcb */ - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(ninjakd2_state, screen_update_ninjakd2) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ninjakd2_state, screen_vblank_ninjakd2)) - MCFG_SCREEN_PALETTE(m_palette) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ninjakd2) - MCFG_PALETTE_ADD("palette", 0x300) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.61); /* verified on pcb */ + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 4*8, 28*8-1); + m_screen->set_screen_update(FUNC(ninjakd2_state::screen_update_ninjakd2)); + m_screen->screen_vblank().set(FUNC(ninjakd2_state::screen_vblank_ninjakd2)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ninjakd2); + PALETTE(config, m_palette, 0x300); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); /* sound hardware */ SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - MCFG_DEVICE_ADD("2203.1", YM2203, MAIN_CLOCK_12/8) /* verified */ - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.10) - MCFG_SOUND_ROUTE(1, "mono", 0.10) - MCFG_SOUND_ROUTE(2, "mono", 0.10) - MCFG_SOUND_ROUTE(3, "mono", 0.50) - - MCFG_DEVICE_ADD("2203.2", YM2203, MAIN_CLOCK_12/8) /* verified */ - MCFG_SOUND_ROUTE(0, "mono", 0.10) - MCFG_SOUND_ROUTE(1, "mono", 0.10) - MCFG_SOUND_ROUTE(2, "mono", 0.10) - MCFG_SOUND_ROUTE(3, "mono", 0.50) - - MCFG_DEVICE_ADD("pcm", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(ninjakd2_state, ninjakd2_init_samples) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(ninjakd2_state::ninjakd2) + ym2203_device &ym2203_1(YM2203(config, "2203.1", MAIN_CLOCK_12/8)); /* verified */ + ym2203_1.irq_handler().set_inputline("soundcpu", 0); + ym2203_1.add_route(0, "mono", 0.10); + ym2203_1.add_route(1, "mono", 0.10); + ym2203_1.add_route(2, "mono", 0.10); + ym2203_1.add_route(3, "mono", 0.50); + + ym2203_device &ym2203_2(YM2203(config, "2203.2", MAIN_CLOCK_12/8)); /* verified */ + ym2203_2.add_route(0, "mono", 0.10); + ym2203_2.add_route(1, "mono", 0.10); + ym2203_2.add_route(2, "mono", 0.10); + ym2203_2.add_route(3, "mono", 0.50); + + SAMPLES(config, m_pcm); + m_pcm->set_channels(1); + m_pcm->set_samples_start_callback(FUNC(ninjakd2_state::ninjakd2_init_samples)); + m_pcm->add_route(ALL_OUTPUTS, "mono", 0.80); +} + +void ninjakd2_state::ninjakd2(machine_config &config) +{ ninjakd2_core(config); - MCFG_DEVICE_REPLACE("soundcpu", MC8123, MAIN_CLOCK_5) /* verified */ - MCFG_DEVICE_PROGRAM_MAP(ninjakd2_sound_cpu) - MCFG_DEVICE_IO_MAP(ninjakd2_sound_io) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) -MACHINE_CONFIG_END + MC8123(config.replace(), m_soundcpu, MAIN_CLOCK_5); /* verified */ + m_soundcpu->set_addrmap(AS_PROGRAM, &ninjakd2_state::ninjakd2_sound_cpu); + m_soundcpu->set_addrmap(AS_IO, &ninjakd2_state::ninjakd2_sound_io); + m_soundcpu->set_addrmap(AS_OPCODES, &ninjakd2_state::decrypted_opcodes_map); +} -MACHINE_CONFIG_START(ninjakd2_state::ninjakd2b) +void ninjakd2_state::ninjakd2b(machine_config &config) +{ ninjakd2_core(config); - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_PROGRAM_MAP(ninjakd2_sound_cpu) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) -MACHINE_CONFIG_END + m_soundcpu->set_addrmap(AS_PROGRAM, &ninjakd2_state::ninjakd2_sound_cpu); + m_soundcpu->set_addrmap(AS_OPCODES, &ninjakd2_state::decrypted_opcodes_map); +} -MACHINE_CONFIG_START(mnight_state::mnight) +void mnight_state::mnight(machine_config &config) +{ ninjakd2_core(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(mnight_main_cpu) - - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_PROGRAM_MAP(ninjakid_nopcm_sound_cpu) + m_maincpu->set_addrmap(AS_PROGRAM, &mnight_state::mnight_main_cpu); + m_soundcpu->set_addrmap(AS_PROGRAM, &mnight_state::ninjakid_nopcm_sound_cpu); /* video hardware */ MCFG_VIDEO_START_OVERRIDE(mnight_state,mnight) /* sound hardware */ - MCFG_DEVICE_REMOVE("pcm") -MACHINE_CONFIG_END + config.device_remove("pcm"); +} -MACHINE_CONFIG_START(mnight_state::arkarea) +void mnight_state::arkarea(machine_config &config) +{ mnight(config); /* video hardware */ MCFG_VIDEO_START_OVERRIDE(mnight_state,arkarea) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(robokid_state::robokid) +void robokid_state::robokid(machine_config &config) +{ mnight(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(robokid_main_cpu) - - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_PROGRAM_MAP(ninjakid_nopcm_sound_cpu) + m_maincpu->set_addrmap(AS_PROGRAM, &robokid_state::robokid_main_cpu); + m_soundcpu->set_addrmap(AS_PROGRAM, &robokid_state::ninjakid_nopcm_sound_cpu); /* video hardware */ - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_robokid) - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(0x400) // RAM is this large, but still only 0x300 colors used - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + m_gfxdecode->set_info(gfx_robokid); + m_palette->set_entries(0x400); // RAM is this large, but still only 0x300 colors used + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(robokid_state,robokid) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(robokid_state,screen_update_robokid) -MACHINE_CONFIG_END -MACHINE_CONFIG_START(omegaf_state::omegaf) + m_screen->set_screen_update(FUNC(robokid_state::screen_update_robokid)); +} + +void omegaf_state::omegaf(machine_config &config) +{ robokid(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(omegaf_main_cpu) + m_maincpu->set_addrmap(AS_PROGRAM, &omegaf_state::omegaf_main_cpu); - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_PROGRAM_MAP(ninjakid_nopcm_sound_cpu) + m_soundcpu->set_addrmap(AS_PROGRAM, &omegaf_state::ninjakid_nopcm_sound_cpu); // MCFG_MACHINE_START_OVERRIDE(ninjakd2_state,omegaf) // MCFG_MACHINE_RESET_OVERRIDE(ninjakd2_state,omegaf) /* video hardware */ MCFG_VIDEO_START_OVERRIDE(omegaf_state,omegaf) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(omegaf_state,screen_update_omegaf) -MACHINE_CONFIG_END + + m_screen->set_screen_update(FUNC(omegaf_state::screen_update_omegaf)); +} diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp index d32393c6e0c..3380cc639d4 100644 --- a/src/mame/drivers/playch10.cpp +++ b/src/mame/drivers/playch10.cpp @@ -644,7 +644,8 @@ WRITE_LINE_MEMBER(playch10_state::vblank_irq) } } -MACHINE_CONFIG_START(playch10_state::playch10) +void playch10_state::playch10(machine_config &config) +{ // basic machine hardware Z80(config, m_maincpu, 8000000/2); // 4 MHz m_maincpu->set_addrmap(AS_PROGRAM, &playch10_state::bios_map); @@ -669,23 +670,22 @@ MACHINE_CONFIG_START(playch10_state::playch10) outlatch2.parallel_out_cb().set(FUNC(playch10_state::cart_sel_w)).rshift(3).mask(0x0f); // video hardware - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_playch10) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(playch10_state, playch10) + GFXDECODE(config, m_gfxdecode, "palette", gfx_playch10); + PALETTE(config, "palette", 256).set_init(FUNC(playch10_state::palette_init_playch10)); config.set_default_layout(layout_playch10); - MCFG_SCREEN_ADD("top", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(playch10_state, screen_update_playch10_top) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, playch10_state, vblank_irq)) + screen_device &top(SCREEN(config, "top", SCREEN_TYPE_RASTER)); + top.set_refresh_hz(60); + top.set_size(32*8, 262); + top.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + top.set_screen_update(FUNC(playch10_state::screen_update_playch10_top)); + top.screen_vblank().set(FUNC(playch10_state::vblank_irq)); - MCFG_SCREEN_ADD("bottom", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(playch10_state, screen_update_playch10_bottom) + screen_device &bottom(SCREEN(config, "bottom", SCREEN_TYPE_RASTER)); + bottom.set_refresh_hz(60); + bottom.set_size(32*8, 262); + bottom.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + bottom.set_screen_update(FUNC(playch10_state::screen_update_playch10_bottom)); PPU_2C03B(config, m_ppu, 0); m_ppu->set_screen("bottom"); @@ -696,7 +696,7 @@ MACHINE_CONFIG_START(playch10_state::playch10) SPEAKER(config, "mono").front_center(); RP5H01(config, m_rp5h01, 0); -MACHINE_CONFIG_END +} void playch10_state::playchnv(machine_config &config) { @@ -704,11 +704,12 @@ void playch10_state::playchnv(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); } -MACHINE_CONFIG_START(playch10_state::playch10_hboard) +void playch10_state::playch10_hboard(machine_config &config) +{ playch10(config); MCFG_VIDEO_START_OVERRIDE(playch10_state,playch10_hboard) MCFG_MACHINE_START_OVERRIDE(playch10_state,playch10_hboard) -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/safarir.cpp b/src/mame/drivers/safarir.cpp index 16f03d73f77..f8b8a58498b 100644 --- a/src/mame/drivers/safarir.cpp +++ b/src/mame/drivers/safarir.cpp @@ -306,13 +306,14 @@ static const char *const safarir_sample_names[] = }; -MACHINE_CONFIG_START(safarir_state::safarir_audio) +void safarir_state::safarir_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(safarir_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(safarir_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} @@ -406,28 +407,27 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(safarir_state::safarir) - +void safarir_state::safarir(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080A, XTAL(18'000'000)/12) /* 1.5 MHz ? */ - MCFG_DEVICE_PROGRAM_MAP(main_map) + I8080A(config, m_maincpu, XTAL(18'000'000)/12); /* 1.5 MHz ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &safarir_state::main_map); /* video hardware */ - MCFG_PALETTE_ADD("palette", 2*8) - MCFG_PALETTE_INIT_OWNER(safarir_state, safarir) + PALETTE(config, "palette", 2*8).set_init(FUNC(safarir_state::palette_init_safarir)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_safarir) + GFXDECODE(config, m_gfxdecode, "palette", gfx_safarir); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 26*8-1) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_UPDATE_DRIVER(safarir_state, screen_update_safarir) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 0*8, 26*8-1); + screen.set_refresh_hz(60); + screen.set_screen_update(FUNC(safarir_state::screen_update_safarir)); + screen.set_palette("palette"); /* audio hardware */ safarir_audio(config); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/segag80v.cpp b/src/mame/drivers/segag80v.cpp index 9e085848812..9fc7e572b84 100644 --- a/src/mame/drivers/segag80v.cpp +++ b/src/mame/drivers/segag80v.cpp @@ -892,70 +892,68 @@ static const char *const zektor_sample_names[] = * *************************************/ -MACHINE_CONFIG_START(segag80v_state::g80v_base) - +void segag80v_state::g80v_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, VIDEO_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_OPCODES_MAP(opcodes_map) - MCFG_DEVICE_IO_MAP(main_portmap) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", segag80v_state, irq0_line_hold) - + Z80(config, m_maincpu, VIDEO_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &segag80v_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &segag80v_state::opcodes_map); + m_maincpu->set_addrmap(AS_IO, &segag80v_state::main_portmap); + m_maincpu->set_vblank_int("screen", FUNC(segag80v_state::irq0_line_hold)); /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_VECTOR); + m_screen->set_refresh_hz(40); + m_screen->set_size(400, 300); + m_screen->set_visarea(512, 1536, 640-32, 1408+32); + m_screen->set_screen_update(FUNC(segag80v_state::screen_update_segag80v)); - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(40) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(512, 1536, 640-32, 1408+32) - MCFG_SCREEN_UPDATE_DRIVER(segag80v_state, screen_update_segag80v) - - MCFG_VECTOR_ADD("vector") + VECTOR(config, m_vector); /* sound hardware */ SPEAKER(config, "speaker").front_center(); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(segag80v_state::elim2) +void segag80v_state::elim2(machine_config &config) +{ g80v_base(config); /* custom sound board */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(elim_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END - + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(elim_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 1.0); +} -MACHINE_CONFIG_START(segag80v_state::spacfury) +void segag80v_state::spacfury(machine_config &config) +{ g80v_base(config); /* custom sound board */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(spacfury_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(spacfury_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.1); /* speech board */ sega_speech_board(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(segag80v_state::zektor) +void segag80v_state::zektor(machine_config &config) +{ g80v_base(config); /* custom sound board */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(8) - MCFG_SAMPLES_NAMES(zektor_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) + SAMPLES(config, m_samples); + m_samples->set_channels(8); + m_samples->set_samples_names(zektor_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.1); AY8912(config, m_aysnd, VIDEO_CLOCK/4/2).add_route(ALL_OUTPUTS, "speaker", 0.33); /* speech board */ sega_speech_board(config); -MACHINE_CONFIG_END +} void segag80v_state::tacscan(machine_config &config) diff --git a/src/mame/drivers/starcrus.cpp b/src/mame/drivers/starcrus.cpp index a9783f9369a..92fbcc08d20 100644 --- a/src/mame/drivers/starcrus.cpp +++ b/src/mame/drivers/starcrus.cpp @@ -140,35 +140,35 @@ static const char *const starcrus_sample_names[] = }; -MACHINE_CONFIG_START(starcrus_state::starcrus) - +void starcrus_state::starcrus(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", I8080,9750000/9) /* 8224 chip is a divide by 9 */ - MCFG_DEVICE_PROGRAM_MAP(starcrus_map) - MCFG_DEVICE_IO_MAP(starcrus_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", starcrus_state, irq0_line_hold) + I8080(config, m_maincpu, 9750000/9); /* 8224 chip is a divide by 9 */ + m_maincpu->set_addrmap(AS_PROGRAM, &starcrus_state::starcrus_map); + m_maincpu->set_addrmap(AS_IO, &starcrus_state::starcrus_io_map); + m_maincpu->set_vblank_int("screen", FUNC(starcrus_state::irq0_line_hold)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(starcrus_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(57); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 0*8, 32*8-1); + screen.set_screen_update(FUNC(starcrus_state::screen_update)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_starcrus) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_starcrus); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, m_palette, 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(starcrus_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(starcrus_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** diff --git a/src/mame/drivers/starfire.cpp b/src/mame/drivers/starfire.cpp index 45c08749097..18175becd56 100644 --- a/src/mame/drivers/starfire.cpp +++ b/src/mame/drivers/starfire.cpp @@ -327,34 +327,31 @@ INTERRUPT_GEN_MEMBER(starfire_state::vblank_int) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } - -MACHINE_CONFIG_START(starfire_state::fireone) - +void starfire_state::fireone(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, STARFIRE_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", starfire_state, vblank_int) + Z80(config, m_maincpu, STARFIRE_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &starfire_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(starfire_state::vblank_int)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(STARFIRE_PIXEL_CLOCK, STARFIRE_HTOTAL, STARFIRE_HBEND, STARFIRE_HBSTART, STARFIRE_VTOTAL, STARFIRE_VBEND, STARFIRE_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(starfire_state, screen_update_starfire) - - /* sound hardware */ -MACHINE_CONFIG_END - + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(STARFIRE_PIXEL_CLOCK, STARFIRE_HTOTAL, STARFIRE_HBEND, STARFIRE_HBSTART, STARFIRE_VTOTAL, STARFIRE_VBEND, STARFIRE_VBSTART); + m_screen->set_screen_update(FUNC(starfire_state::screen_update_starfire)); +} -MACHINE_CONFIG_START(starfire_state::starfire) +void starfire_state::starfire(machine_config &config) +{ fireone(config); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(starfire_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(starfire_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp index 094efe0296b..cee556043a0 100644 --- a/src/mame/drivers/suna8.cpp +++ b/src/mame/drivers/suna8.cpp @@ -1876,33 +1876,33 @@ GFXDECODE_END /* 1 x 24 MHz crystal */ -MACHINE_CONFIG_START(suna8_state::hardhead) - +void suna8_state::hardhead(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(hardhead_map) - MCFG_DEVICE_IO_MAP(hardhead_io_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", suna8_state, irq0_line_hold) /* No NMI */ + Z80(config, m_maincpu, SUNA8_MASTER_CLOCK / 4); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhead_map); + m_maincpu->set_addrmap(AS_IO, &suna8_state::hardhead_io_map); + m_maincpu->set_addrmap(AS_OPCODES, &suna8_state::decrypted_opcodes_map); + m_maincpu->set_vblank_int("screen", FUNC(suna8_state::irq0_line_hold)); /* No NMI */ - MCFG_DEVICE_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(hardhead_sound_map) - MCFG_DEVICE_IO_MAP(hardhead_sound_io_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(suna8_state, irq0_line_hold, 4*60) /* No NMI */ + Z80(config, m_audiocpu, SUNA8_MASTER_CLOCK / 8); /* verified on pcb */ + m_audiocpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhead_sound_map); + m_audiocpu->set_addrmap(AS_IO, &suna8_state::hardhead_sound_io_map); + m_audiocpu->set_periodic_int(FUNC(suna8_state::irq0_line_hold), attotime::from_hz(4*60)); /* No NMI */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.10) /* verified on pcb */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna8_state, screen_update_suna8) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suna8) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.10); /* verified on pcb */ + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0+16, 256-16-1); + m_screen->set_screen_update(FUNC(suna8_state::screen_update_suna8)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_suna8); + PALETTE(config, m_palette, 256); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) @@ -1912,19 +1912,18 @@ MACHINE_CONFIG_START(suna8_state::hardhead) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + YM3812(config, "ymsnd", SUNA8_MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "speaker", 1.0); /* clock verified on pcb */ - ay8910_device &aysnd(AY8910(config, "aysnd", SUNA8_MASTER_CLOCK / 16)); /* verified on pcb */ + ay8910_device &aysnd(AY8910(config, "aysnd", SUNA8_MASTER_CLOCK / 16)); /* clock verified on pcb */ aysnd.port_a_write_callback().set(FUNC(suna8_state::suna8_play_samples_w)); aysnd.port_b_write_callback().set(FUNC(suna8_state::suna8_samples_number_w)); aysnd.add_route(ALL_OUTPUTS, "speaker", 0.3); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(suna8_state::sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.5); +} /*************************************************************************** @@ -1934,34 +1933,33 @@ MACHINE_CONFIG_END /* 1 x 24 MHz crystal */ /* 2203 + 8910 */ -MACHINE_CONFIG_START(suna8_state::rranger) - +void suna8_state::rranger(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(rranger_map) - MCFG_DEVICE_IO_MAP(rranger_io_map) -// MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", suna8_state, irq0_line_hold) /* IRQ & NMI ! */ + Z80(config, m_maincpu, SUNA8_MASTER_CLOCK / 4); /* ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::rranger_map); + m_maincpu->set_addrmap(AS_IO, &suna8_state::rranger_io_map); + m_maincpu->set_vblank_int("screen", FUNC(suna8_state::irq0_line_hold)); /* IRQ & NMI ! */ - MCFG_DEVICE_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(rranger_sound_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(suna8_state, irq0_line_hold, 4*60) /* NMI = retn */ + Z80(config, m_audiocpu, SUNA8_MASTER_CLOCK / 8); /* clock verified on pcb */ + m_audiocpu->set_addrmap(AS_PROGRAM, &suna8_state::rranger_sound_map); + m_audiocpu->set_periodic_int(FUNC(suna8_state::irq0_line_hold), attotime::from_hz(4*60)); /* NMI = retn */ WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.1) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna8_state, screen_update_suna8) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suna8) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.1); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0+16, 256-16-1); + m_screen->set_screen_update(FUNC(suna8_state::screen_update_suna8)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_suna8); + PALETTE(config, m_palette, 256); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text) @@ -1978,11 +1976,11 @@ MACHINE_CONFIG_START(suna8_state::rranger) YM2203(config, "ym2", SUNA8_MASTER_CLOCK / 16).add_route(ALL_OUTPUTS, "speaker", 0.9); /* verified on pcb */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(suna8_state::sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.5); +} /*************************************************************************** @@ -2001,35 +1999,35 @@ MACHINE_RESET_MEMBER(suna8_state,brickzn) m_bank1d->set_entry(0); } -MACHINE_CONFIG_START(suna8_state::brickzn11) - +void suna8_state::brickzn11(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* SUNA PROTECTION BLOCK */ - MCFG_DEVICE_PROGRAM_MAP(brickzn11_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", suna8_state, irq0_line_hold) // nmi breaks ramtest but is needed! + Z80(config, m_maincpu, SUNA8_MASTER_CLOCK / 4); /* SUNA PROTECTION BLOCK */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::brickzn11_map); + m_maincpu->set_vblank_int("screen", FUNC(suna8_state::irq0_line_hold)); // nmi breaks ramtest but is needed! - MCFG_DEVICE_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* Z0840006PSC - 6MHz (measured) */ - MCFG_DEVICE_PROGRAM_MAP(brickzn_sound_map) + Z80(config, m_audiocpu, SUNA8_MASTER_CLOCK / 4); /* Z0840006PSC - 6MHz (measured) */ + m_audiocpu->set_addrmap(AS_PROGRAM, &suna8_state::brickzn_sound_map); - MCFG_DEVICE_ADD("pcm", Z80, SUNA8_MASTER_CLOCK / 4) /* Z0840006PSC - 6MHz (measured) */ - MCFG_DEVICE_PROGRAM_MAP(brickzn_pcm_map) - MCFG_DEVICE_IO_MAP(brickzn_pcm_io_map) + z80_device &pcm(Z80(config, "pcm", SUNA8_MASTER_CLOCK / 4)); /* Z0840006PSC - 6MHz (measured) */ + pcm.set_addrmap(AS_PROGRAM, &suna8_state::brickzn_pcm_map); + pcm.set_addrmap(AS_IO, &suna8_state::brickzn_pcm_io_map); MCFG_MACHINE_RESET_OVERRIDE(suna8_state, brickzn ) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) // we're using PORT_VBLANK - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna8_state, screen_update_suna8) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suna8) - MCFG_PALETTE_ADD("palette", 256 * 2) // 2 x Palette RAM - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0+16, 256-16-1); + m_screen->set_screen_update(FUNC(suna8_state::screen_update_suna8)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_suna8); + PALETTE(config, m_palette, 256 * 2); // 2 x Palette RAM + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_brickzn) @@ -2039,30 +2037,35 @@ MACHINE_CONFIG_START(suna8_state::brickzn11) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured) - MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + ym3812_device &ymsnd(YM3812(config, "ymsnd", SUNA8_MASTER_CLOCK / 8)); // 3MHz (measured) + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(ALL_OUTPUTS, "speaker", 1.0); AY8910(config, "aysnd", SUNA8_MASTER_CLOCK / 16).add_route(ALL_OUTPUTS, "speaker", 0.33); // 1.5MHz (measured) - MCFG_DEVICE_ADD("ldac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC - MCFG_DEVICE_ADD("ldac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC - MCFG_DEVICE_ADD("rdac2", DAC_4BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.17) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "ldac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "rdac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(suna8_state::brickzn) + DAC_4BIT_R2R(config, "ldac", 0).add_route(ALL_OUTPUTS, "speaker", 0.17); // unknown DAC + DAC_4BIT_R2R(config, "rdac", 0).add_route(ALL_OUTPUTS, "speaker", 0.17); // unknown DAC + DAC_4BIT_R2R(config, "ldac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.17); // unknown DAC + DAC_4BIT_R2R(config, "rdac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.17); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "ldac2", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "ldac2", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "rdac2", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "rdac2", -1.0, DAC_VREF_NEG_INPUT); +} + +void suna8_state::brickzn(machine_config &config) +{ brickzn11(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(brickzn_map) - MCFG_DEVICE_IO_MAP(brickzn_io_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::brickzn_map); + m_maincpu->set_addrmap(AS_IO, &suna8_state::brickzn_io_map); + m_maincpu->set_addrmap(AS_OPCODES, &suna8_state::decrypted_opcodes_map); +} /*************************************************************************** @@ -2087,62 +2090,59 @@ MACHINE_RESET_MEMBER(suna8_state,hardhea2) hardhea2_rambank_0_w(space,0,0); } -MACHINE_CONFIG_START(suna8_state::hardhea2) +void suna8_state::hardhea2(machine_config &config) +{ brickzn(config); - MCFG_DEVICE_REMOVE("maincpu") - - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* SUNA T568009 */ - MCFG_DEVICE_PROGRAM_MAP(hardhea2_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1) + Z80(config.replace(), m_maincpu, SUNA8_MASTER_CLOCK / 4); /* SUNA T568009 */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhea2_map); + m_maincpu->set_addrmap(AS_OPCODES, &suna8_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(suna8_state::hardhea2_interrupt), "screen", 0, 1); MCFG_MACHINE_RESET_OVERRIDE(suna8_state,hardhea2) - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(256) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) -MACHINE_CONFIG_END + m_palette->set_entries(256); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); +} -MACHINE_CONFIG_START(suna8_state::hardhea2b) +void suna8_state::hardhea2b(machine_config &config) +{ hardhea2(config); - MCFG_DEVICE_REMOVE("maincpu") - - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) //bootleg clock not verified (?) - MCFG_DEVICE_PROGRAM_MAP(hardhea2_map) -MACHINE_CONFIG_END + Z80(config.replace(), m_maincpu, SUNA8_MASTER_CLOCK / 4); //bootleg clock not verified (?) + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhea2_map); +} /*************************************************************************** Star Fighter ***************************************************************************/ -MACHINE_CONFIG_START(suna8_state::starfigh) - +void suna8_state::starfigh(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(starfigh_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1) + Z80(config, m_maincpu, SUNA8_MASTER_CLOCK / 4); /* ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::starfigh_map); + m_maincpu->set_addrmap(AS_OPCODES, &suna8_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(suna8_state::hardhea2_interrupt), "screen", 0, 1); /* The sound section is identical to that of hardhead */ - MCFG_DEVICE_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(hardhead_sound_map) - MCFG_DEVICE_IO_MAP(hardhead_sound_io_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(suna8_state, irq0_line_hold, 4*60) /* No NMI */ + Z80(config, m_audiocpu, SUNA8_MASTER_CLOCK / 4); /* ? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhead_sound_map); + m_audiocpu->set_addrmap(AS_IO, &suna8_state::hardhead_sound_io_map); + m_audiocpu->set_periodic_int(FUNC(suna8_state::irq0_line_hold), attotime::from_hz(4*60)); /* No NMI */ /* 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(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna8_state, screen_update_suna8) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suna8) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + 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(256, 256); + m_screen->set_visarea(0, 256-1, 0+16, 256-16-1); + m_screen->set_screen_update(FUNC(suna8_state::screen_update_suna8)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_suna8); + PALETTE(config, m_palette, 256); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_starfigh) @@ -2152,51 +2152,50 @@ MACHINE_CONFIG_START(suna8_state::starfigh) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + YM3812(config, "ymsnd", SUNA8_MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "speaker", 1.0); ay8910_device &aysnd(AY8910(config, "aysnd", SUNA8_MASTER_CLOCK / 16)); aysnd.port_a_write_callback().set(FUNC(suna8_state::suna8_play_samples_w)); aysnd.port_b_write_callback().set(FUNC(suna8_state::suna8_samples_number_w)); aysnd.add_route(ALL_OUTPUTS, "speaker", 0.5); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(suna8_state::sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.5); +} /*************************************************************************** Spark Man ***************************************************************************/ -MACHINE_CONFIG_START(suna8_state::sparkman) - +void suna8_state::sparkman(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(sparkman_map) - MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1) + Z80(config, m_maincpu, SUNA8_MASTER_CLOCK / 4); /* ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &suna8_state::sparkman_map); + m_maincpu->set_addrmap(AS_OPCODES, &suna8_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(suna8_state::hardhea2_interrupt), "screen", 0, 1); - MCFG_DEVICE_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(hardhead_sound_map) - MCFG_DEVICE_IO_MAP(hardhead_sound_io_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(suna8_state, irq0_line_hold, 4*60) /* No NMI */ + Z80(config, m_audiocpu, SUNA8_MASTER_CLOCK / 4); /* ? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &suna8_state::hardhead_sound_map); + m_audiocpu->set_addrmap(AS_IO, &suna8_state::hardhead_sound_io_map); + m_audiocpu->set_periodic_int(FUNC(suna8_state::irq0_line_hold), attotime::from_hz(4*60)); /* No NMI */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna8_state, screen_update_suna8) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suna8_x2) // 2 sprite "chips" - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0+16, 256-16-1); + m_screen->set_screen_update(FUNC(suna8_state::screen_update_suna8)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_suna8_x2); // 2 sprite "chips" + PALETTE(config, m_palette, 512); + m_palette->set_format(PALETTE_FORMAT_RRRRGGGGBBBBxxxx); + m_palette->set_endianness(ENDIANNESS_BIG); MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_sparkman) @@ -2206,19 +2205,18 @@ MACHINE_CONFIG_START(suna8_state::sparkman) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + YM3812(config, "ymsnd", SUNA8_MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "speaker", 1.0); ay8910_device &aysnd(AY8910(config, "aysnd", SUNA8_MASTER_CLOCK / 16)); aysnd.port_a_write_callback().set(FUNC(suna8_state::suna8_play_samples_w)); // two sample roms aysnd.port_b_write_callback().set(FUNC(suna8_state::suna8_samples_number_w)); aysnd.add_route(ALL_OUTPUTS, "speaker", 0.3); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(suna8_state, sh_start) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(suna8_state::sh_start)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.5); +} /*************************************************************************** diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp index 53436a64941..3ea65b8d3f4 100644 --- a/src/mame/drivers/super80.cpp +++ b/src/mame/drivers/super80.cpp @@ -705,7 +705,8 @@ static const char *const relay_sample_names[] = }; -MACHINE_CONFIG_START(super80_state::super80) +void super80_state::super80(machine_config &config) +{ /* basic machine hardware */ Z80(config, m_maincpu, MASTER_CLOCK/6); /* 2 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &super80_state::super80_map); @@ -719,81 +720,81 @@ MACHINE_CONFIG_START(super80_state::super80) m_pio->out_pa_callback().set(FUNC(super80_state::pio_port_a_w)); m_pio->in_pb_callback().set(FUNC(super80_state::pio_port_b_r)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(48.8) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(48.8); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + m_screen->set_screen_update(FUNC(super80_state::screen_update_super80)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 32) - MCFG_PALETTE_INIT_OWNER(super80_state,super80m) + PALETTE(config, m_palette, 32).set_init(FUNC(super80_state::palette_init_super80m)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_super80) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_super80); config.set_default_layout(layout_super80); MCFG_VIDEO_START_OVERRIDE(super80_state,super80) /* sound hardware */ SPEAKER(config, "mono").front_center(); - WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); - SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(relay_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(relay_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); /* printer */ - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit7)) + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->busy_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit7)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + m_centronics->set_output_latch(cent_data_out); - MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0) + INPUT_BUFFER(config, "cent_status_in", 0); /* quickload */ - MCFG_QUICKLOAD_ADD("quickload", super80_state, super80, "bin", 3) + quickload_image_device &quickload(QUICKLOAD(config, "quickload", 0)); + quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(super80_state, super80), this), "bin", 3); /* cassette */ - MCFG_CASSETTE_ADD( "cassette" ) - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_CASSETTE_INTERFACE("super80_cass") + CASSETTE(config, m_cassette); + m_cassette->set_default_state((cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)); + m_cassette->set_interface("super80_cass"); - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", super80_state, timer_p, attotime::from_hz(40000)) // cass read - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_k", super80_state, timer_k, attotime::from_hz(300)) // keyb scan - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_h", super80_state, timer_h, attotime::from_hz(100)) // half-speed + TIMER(config, "timer_p").configure_periodic(FUNC(super80_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "timer_k").configure_periodic(FUNC(super80_state::timer_k), attotime::from_hz(300)); // keyb scan + TIMER(config, "timer_h").configure_periodic(FUNC(super80_state::timer_h), attotime::from_hz(100)); // half-speed // software list SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("DEF"); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(super80_state::super80d) +void super80_state::super80d(machine_config &config) +{ super80(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_super80d) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80d) -MACHINE_CONFIG_END + m_gfxdecode->set_info(gfx_super80d); + m_screen->set_screen_update(FUNC(super80_state::screen_update_super80d)); +} -MACHINE_CONFIG_START(super80_state::super80e) +void super80_state::super80e(machine_config &config) +{ super80(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(super80e_io) - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_super80e) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80e) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(super80_state::super80m) + m_maincpu->set_addrmap(AS_IO, &super80_state::super80e_io); + m_gfxdecode->set_info(gfx_super80e); + m_screen->set_screen_update(FUNC(super80_state::screen_update_super80e)); +} + +void super80_state::super80m(machine_config &config) +{ super80(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(super80m_map) + m_maincpu->set_addrmap(AS_PROGRAM, &super80_state::super80m_map); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_super80m) + m_gfxdecode->set_info(gfx_super80m); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80m) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, super80_state, screen_vblank_super80m)) -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(super80_state::screen_update_super80m)); + m_screen->screen_vblank().set(FUNC(super80_state::screen_vblank_super80m)); +} -MACHINE_CONFIG_START(super80_state::super80v) +void super80_state::super80v(machine_config &config) +{ /* basic machine hardware */ Z80(config, m_maincpu, MASTER_CLOCK/6); /* 2 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &super80_state::super80v_map); @@ -807,15 +808,14 @@ MACHINE_CONFIG_START(super80_state::super80v) m_pio->out_pa_callback().set(FUNC(super80_state::pio_port_a_w)); m_pio->in_pb_callback().set(FUNC(super80_state::pio_port_b_r)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(SUPER80V_SCREEN_WIDTH, SUPER80V_SCREEN_HEIGHT) - MCFG_SCREEN_VISIBLE_AREA(0, SUPER80V_SCREEN_WIDTH-1, 0, SUPER80V_SCREEN_HEIGHT-1) - MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80v) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, super80_state, screen_vblank_super80m)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(50); + m_screen->set_size(SUPER80V_SCREEN_WIDTH, SUPER80V_SCREEN_HEIGHT); + m_screen->set_visarea(0, SUPER80V_SCREEN_WIDTH-1, 0, SUPER80V_SCREEN_HEIGHT-1); + m_screen->set_screen_update(FUNC(super80_state::screen_update_super80v)); + m_screen->screen_vblank().set(FUNC(super80_state::screen_vblank_super80m)); - MCFG_PALETTE_ADD("palette", 32) - MCFG_PALETTE_INIT_OWNER(super80_state,super80m) + PALETTE(config, m_palette, 32).set_init(FUNC(super80_state::palette_init_super80m)); MC6845(config, m_crtc, MASTER_CLOCK / SUPER80V_DOTS); m_crtc->set_screen("screen"); @@ -823,45 +823,47 @@ MACHINE_CONFIG_START(super80_state::super80v) m_crtc->set_char_width(SUPER80V_DOTS); m_crtc->set_update_row_callback(FUNC(super80_state::crtc_update_row), this); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_super80v) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_super80v); config.set_default_layout(layout_super80); /* sound hardware */ SPEAKER(config, "mono").front_center(); - WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); - SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(relay_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(relay_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); /* printer */ - MCFG_DEVICE_ADD("centronics", CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit7)) + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->busy_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit7)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + m_centronics->set_output_latch(cent_data_out); - MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0) + INPUT_BUFFER(config, "cent_status_in", 0); /* quickload */ - MCFG_QUICKLOAD_ADD("quickload", super80_state, super80, "bin", 3) + quickload_image_device &quickload(QUICKLOAD(config, "quickload", 0)); + quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(super80_state, super80), this), "bin", 3); /* cassette */ - MCFG_CASSETTE_ADD( "cassette" ) - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_CASSETTE_INTERFACE("super80_cass") + CASSETTE(config, m_cassette); + m_cassette->set_default_state((cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)); + m_cassette->set_interface("super80_cass"); - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", super80_state, timer_p, attotime::from_hz(40000)) // cass read - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_k", super80_state, timer_k, attotime::from_hz(300)) // keyb scan + TIMER(config, "timer_p").configure_periodic(FUNC(super80_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "timer_k").configure_periodic(FUNC(super80_state::timer_k), attotime::from_hz(300)); // keyb scan // software list SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("V"); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(super80_state::super80r) +void super80_state::super80r(machine_config &config) +{ super80v(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(super80r_io) + m_maincpu->set_addrmap(AS_IO, &super80_state::super80r_io); Z80DMA(config, m_dma, MASTER_CLOCK/6); m_dma->out_busreq_callback().set(FUNC(super80_state::busreq_w)); @@ -874,11 +876,9 @@ MACHINE_CONFIG_START(super80_state::super80r) WD2793(config, m_fdc, 2_MHz_XTAL); m_fdc->drq_wr_callback().set(m_dma, FUNC(z80dma_device::rdy_w)); - MCFG_FLOPPY_DRIVE_ADD("fdc:0", super80_floppies, "525dd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_SOUND(true) - MCFG_FLOPPY_DRIVE_ADD("fdc:1", super80_floppies, "525dd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_SOUND(true) -MACHINE_CONFIG_END + FLOPPY_CONNECTOR(config, "fdc:0", super80_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "fdc:1", super80_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true); +} /**************************** ROMS *****************************************************************/ diff --git a/src/mame/drivers/tankbatt.cpp b/src/mame/drivers/tankbatt.cpp index eeb4e9d83c1..868efbe000e 100644 --- a/src/mame/drivers/tankbatt.cpp +++ b/src/mame/drivers/tankbatt.cpp @@ -269,12 +269,12 @@ static const char *const tankbatt_sample_names[] = }; -MACHINE_CONFIG_START(tankbatt_state::tankbatt) - +void tankbatt_state::tankbatt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 1000000) /* 1 MHz ???? */ - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tankbatt_state, interrupt) + M6502(config, m_maincpu, 1000000); /* 1 MHz ???? */ + m_maincpu->set_addrmap(AS_PROGRAM, &tankbatt_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(tankbatt_state::interrupt)); cd4099_device &mainlatch(CD4099(config, "mainlatch")); // latches at 4H and 5H (are the empty 4J and 5J locations for LS259 substitution?) mainlatch.q_out_cb<0>().set_nop(); //coin counter mirror? @@ -292,27 +292,27 @@ MACHINE_CONFIG_START(tankbatt_state::tankbatt) outlatch.q_out_cb<3>().set(FUNC(tankbatt_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_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(tankbatt_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tankbatt) - MCFG_PALETTE_ADD("palette", 256*2) - MCFG_PALETTE_INDIRECT_ENTRIES(256) - MCFG_PALETTE_INIT_OWNER(tankbatt_state, tankbatt) + 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(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tankbatt_state::screen_update)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tankbatt); + PALETTE(config, m_palette, 256*2); + m_palette->set_indirect_entries(256); + m_palette->set_init(FUNC(tankbatt_state::palette_init_tankbatt)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(tankbatt_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(tankbatt_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.25); +} diff --git a/src/mame/drivers/tattack.cpp b/src/mame/drivers/tattack.cpp index 90d922a2561..30cccbb4b30 100644 --- a/src/mame/drivers/tattack.cpp +++ b/src/mame/drivers/tattack.cpp @@ -405,38 +405,37 @@ static const char *const tattack_sample_names[] = nullptr }; -MACHINE_CONFIG_START(tattack_state::tattack) - +void tattack_state::tattack(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, 8000000 / 2) /* 4 MHz ? */ - MCFG_DEVICE_PROGRAM_MAP(tattack_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tattack_state, irq0_line_hold) + Z80(config, m_maincpu, 8000000 / 2); /* 4 MHz ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &tattack_state::tattack_map); + m_maincpu->set_vblank_int("screen", FUNC(tattack_state::irq0_line_hold)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(24, 256-32-1, 13, 256-11-1) - MCFG_SCREEN_UPDATE_DRIVER(tattack_state, screen_update_tattack) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tattack) - MCFG_PALETTE_ADD("palette", 16) - MCFG_PALETTE_INIT_OWNER(tattack_state, tattack) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(32*8, 32*8); + screen.set_visarea(24, 256-32-1, 13, 256-11-1); + screen.set_screen_update(FUNC(tattack_state::screen_update_tattack)); + screen.set_palette("palette"); + + GFXDECODE(config, m_gfxdecode, "palette", gfx_tattack); + PALETTE(config, "palette", 16).set_init(FUNC(tattack_state::palette_init_tattack)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(4) - MCFG_SAMPLES_NAMES(tattack_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6) + SAMPLES(config, m_samples); + m_samples->set_channels(4); + m_samples->set_samples_names(tattack_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.6); /* Discrete ???? */ // MCFG_DEVICE_ADD("discrete", DISCRETE) // MCFG_DISCRETE_INTF(tattack) // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/thief.cpp b/src/mame/drivers/thief.cpp index b1551c30e56..0353bbf278b 100644 --- a/src/mame/drivers/thief.cpp +++ b/src/mame/drivers/thief.cpp @@ -393,11 +393,12 @@ static const char *const natodef_sample_names[] = }; -MACHINE_CONFIG_START(thief_state::thief) - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(8'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(thief_main_map) - MCFG_DEVICE_IO_MAP(io_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(thief_state, iack) +void thief_state::thief(machine_config &config) +{ + Z80(config, m_maincpu, XTAL(8'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &thief_state::thief_main_map); + m_maincpu->set_addrmap(AS_IO, &thief_state::io_map); + m_maincpu->set_irq_acknowledge_callback(FUNC(thief_state::iack)); i8255_device &ppi(I8255A(config, "ppi")); ppi.out_pa_callback().set(FUNC(thief_state::thief_input_select_w)); @@ -405,16 +406,16 @@ MACHINE_CONFIG_START(thief_state::thief) ppi.out_pc_callback().set(FUNC(thief_state::tape_control_w)); // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(XTAL(20'000'000)/4, 320, 0, 256, 272, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(thief_state, screen_update_thief) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(XTAL(20'000'000)/4, 320, 0, 256, 272, 0, 256); + m_screen->set_screen_update(FUNC(thief_state::screen_update_thief)); + m_screen->set_palette(m_palette); TMS9927(config, m_tms, XTAL(20'000'000)/4/8); m_tms->set_char_width(8); m_tms->vsyn_callback().set_inputline("maincpu", 0, ASSERT_LINE); - MCFG_PALETTE_ADD("palette", 16) + PALETTE(config, m_palette, 16); // sound hardware SPEAKER(config, "mono").front_center(); @@ -423,29 +424,27 @@ MACHINE_CONFIG_START(thief_state::thief) AY8910(config, "ay2", XTAL(8'000'000)/2/4).add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(thief_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_names(thief_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(thief_state::sharkatt) +void thief_state::sharkatt(machine_config &config) +{ thief(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sharkatt_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &thief_state::sharkatt_main_map); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 24*8-1) + m_screen->set_visarea(0*8, 32*8-1, 0*8, 24*8-1); - MCFG_DEVICE_MODIFY("samples") - MCFG_SAMPLES_NAMES(sharkatt_sample_names) -MACHINE_CONFIG_END + m_samples->set_samples_names(sharkatt_sample_names); +} -MACHINE_CONFIG_START(thief_state::natodef) +void thief_state::natodef(machine_config &config) +{ thief(config); - MCFG_DEVICE_MODIFY("samples") - MCFG_SAMPLES_NAMES(natodef_sample_names) -MACHINE_CONFIG_END + m_samples->set_samples_names(natodef_sample_names); +} /**********************************************************/ diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index 00b69ab716b..4b2ed379859 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -1914,13 +1914,12 @@ MACHINE_RESET_MEMBER(tmnt_state,common) m_irq5_mask = 0; } - -MACHINE_CONFIG_START(tmnt_state::cuebrick) - +void tmnt_state::cuebrick(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 8000000) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(cuebrick_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + M68000(config, m_maincpu, 8000000); /* 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::cuebrick_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::tmnt_interrupt)); MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -1928,20 +1927,20 @@ MACHINE_CONFIG_START(tmnt_state::cuebrick) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_mia) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 1024) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_MEMBITS(8) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_mia)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 1024); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->set_membits(8); + m_palette->enable_shadows(); + m_palette->enable_hilights(); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -1964,18 +1963,17 @@ MACHINE_CONFIG_START(tmnt_state::cuebrick) ymsnd.irq_handler().set_inputline(m_maincpu, M68K_IRQ_6); ymsnd.add_route(0, "mono", 1.0); ymsnd.add_route(1, "mono", 1.0); -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::mia) +} +void tmnt_state::mia(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/3) - MCFG_DEVICE_PROGRAM_MAP(mia_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + M68000(config, m_maincpu, XTAL(24'000'000)/3); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::mia_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::tmnt_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(mia_audio_map) + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::mia_audio_map); MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -1983,19 +1981,19 @@ MACHINE_CONFIG_START(tmnt_state::mia) WATCHDOG_TIMER(config, "watchdog"); /* 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(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_mia) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 1024) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_MEMBITS(8) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_mia)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 1024); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->set_membits(8); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,mia) @@ -2016,12 +2014,11 @@ MACHINE_CONFIG_START(tmnt_state::mia) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "mono", 1.0).add_route(1, "mono", 1.0); - MCFG_DEVICE_ADD("k007232", K007232, XTAL(3'579'545)) - MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, tmnt_state, volume_callback)) - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) -MACHINE_CONFIG_END - + K007232(config, m_k007232, XTAL(3'579'545)); + m_k007232->port_write().set(FUNC(tmnt_state::volume_callback)); + m_k007232->add_route(0, "mono", 0.20); + m_k007232->add_route(1, "mono", 0.20); +} MACHINE_RESET_MEMBER(tmnt_state,tmnt) { @@ -2030,15 +2027,15 @@ MACHINE_RESET_MEMBER(tmnt_state,tmnt) m_upd7759->reset_w(1); } -MACHINE_CONFIG_START(tmnt_state::tmnt) - +void tmnt_state::tmnt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/3) - MCFG_DEVICE_PROGRAM_MAP(tmnt_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + M68000(config, m_maincpu, XTAL(24'000'000)/3); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::tmnt_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::tmnt_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(tmnt_audio_map) + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::tmnt_audio_map); MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,tmnt) @@ -2046,20 +2043,20 @@ MACHINE_CONFIG_START(tmnt_state::tmnt) WATCHDOG_TIMER(config, "watchdog"); /* 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(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(12*8, (64-12)*8-1, 2*8, 30*8-1 ); // verified against real hardware - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_tmnt) - MCFG_SCREEN_PALETTE("palette") + screen.set_screen_update(FUNC(tmnt_state::screen_update_tmnt)); + screen.set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 1024) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_MEMBITS(8) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + PALETTE(config, m_palette, 1024); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->set_membits(8); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,tmnt) @@ -2080,31 +2077,29 @@ MACHINE_CONFIG_START(tmnt_state::tmnt) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "mono", 1.0).add_route(1, "mono", 1.0); - MCFG_DEVICE_ADD("k007232", K007232, XTAL(3'579'545)) - MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, tmnt_state, volume_callback)) - MCFG_SOUND_ROUTE(0, "mono", 0.33) - MCFG_SOUND_ROUTE(1, "mono", 0.33) - - MCFG_DEVICE_ADD("upd", UPD7759, XTAL(640'000)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) + K007232(config, m_k007232, XTAL(3'579'545)); + m_k007232->port_write().set(FUNC(tmnt_state::volume_callback)); + m_k007232->add_route(0, "mono", 0.33); + m_k007232->add_route(1, "mono", 0.33); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) /* 1 channel for the title music */ - MCFG_SAMPLES_START_CB(tmnt_state, tmnt_decode_sample) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + UPD7759(config, "upd", XTAL(640'000)).add_route(ALL_OUTPUTS, "mono", 0.60); + SAMPLES(config, m_samples); + m_samples->set_channels(1); /* 1 channel for the title music */ + m_samples->set_samples_start_callback(FUNC(tmnt_state::tmnt_decode_sample)); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(tmnt_state::punkshot) - +void tmnt_state::punkshot(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(punkshot_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + M68000(config, m_maincpu, XTAL(24'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::punkshot_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::punkshot_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(punkshot_audio_map) - /* NMIs are generated by the 053260 */ + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::punkshot_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2112,19 +2107,19 @@ MACHINE_CONFIG_START(tmnt_state::punkshot) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_punkshot) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_punkshot)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); @@ -2142,20 +2137,19 @@ MACHINE_CONFIG_START(tmnt_state::punkshot) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "mono", 1.0).add_route(1, "mono", 1.0); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::lgtnfght) + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(ALL_OUTPUTS, "mono", 0.70); +} +void tmnt_state::lgtnfght(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(lgtnfght_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + M68000(config, m_maincpu, XTAL(24'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::lgtnfght_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::lgtnfght_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(lgtnfght_audio_map) + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::lgtnfght_audio_map); MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2163,19 +2157,19 @@ MACHINE_CONFIG_START(tmnt_state::lgtnfght) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(12*8, (64-12)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_lgtnfght)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,lgtnfght) @@ -2195,22 +2189,21 @@ MACHINE_CONFIG_START(tmnt_state::lgtnfght) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.70) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.70) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::blswhstl) + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "lspeaker", 0.70); + m_k053260->add_route(1, "rspeaker", 0.70); +} +void tmnt_state::blswhstl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_DEVICE_PROGRAM_MAP(blswhstl_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + M68000(config, m_maincpu, XTAL(32'000'000)/2); /* Confirmed */ + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::blswhstl_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::punkshot_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) - /* NMIs are generated by the 053260 */ + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2220,22 +2213,22 @@ MACHINE_CONFIG_START(tmnt_state::blswhstl) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, tmnt_state, screen_vblank_blswhstl)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() - - MCFG_VIDEO_START_OVERRIDE(tmnt_state, blswhstl ) + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(12*8, (64-12)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_lgtnfght)); + screen.screen_vblank().set(FUNC(tmnt_state::screen_vblank_blswhstl)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); + + MCFG_VIDEO_START_OVERRIDE(tmnt_state, blswhstl) K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); @@ -2255,10 +2248,10 @@ MACHINE_CONFIG_START(tmnt_state::blswhstl) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 0.70).add_route(1, "rspeaker", 0.70); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "rspeaker", 0.50) /* fixed inverted stereo channels */ - MCFG_SOUND_ROUTE(1, "lspeaker", 0.50) -MACHINE_CONFIG_END + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "rspeaker", 0.50); /* fixed inverted stereo channels */ + m_k053260->add_route(1, "lspeaker", 0.50); +} @@ -2278,16 +2271,16 @@ static GFXDECODE_START( gfx_glfgreat ) GFXDECODE_ENTRY( "zoom", 0, zoomlayout, 0x400, 16 ) GFXDECODE_END -MACHINE_CONFIG_START(tmnt_state::glfgreat) - +void tmnt_state::glfgreat(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_DEVICE_PROGRAM_MAP(glfgreat_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + M68000(config, m_maincpu, XTAL(32'000'000)/2); /* Confirmed */ + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::glfgreat_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::lgtnfght_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(glfgreat_audio_map) - /* NMIs are generated by the 053260 */ + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::glfgreat_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2295,21 +2288,21 @@ MACHINE_CONFIG_START(tmnt_state::glfgreat) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_glfgreat) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_glfgreat) - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_glfgreat)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_glfgreat); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,glfgreat) @@ -2331,11 +2324,10 @@ MACHINE_CONFIG_START(tmnt_state::glfgreat) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "lspeaker", 1.0); + m_k053260->add_route(1, "rspeaker", 1.0); +} MACHINE_START_MEMBER(tmnt_state,prmrsocr) { @@ -2344,16 +2336,16 @@ MACHINE_START_MEMBER(tmnt_state,prmrsocr) membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); } -MACHINE_CONFIG_START(tmnt_state::prmrsocr) - +void tmnt_state::prmrsocr(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_DEVICE_PROGRAM_MAP(prmrsocr_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + M68000(config, m_maincpu, XTAL(32'000'000)/2); /* Confirmed */ + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::prmrsocr_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::lgtnfght_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(prmrsocr_audio_map) - /* NMIs are generated by the 054539 */ + Z80(config, m_audiocpu, 8000000); /* ? */ + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::prmrsocr_audio_map); + /* NMIs are generated by the 054539 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,prmrsocr) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2363,21 +2355,21 @@ MACHINE_CONFIG_START(tmnt_state::prmrsocr) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_glfgreat) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_glfgreat) - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_glfgreat)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_glfgreat); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,prmrsocr) @@ -2402,27 +2394,25 @@ MACHINE_CONFIG_START(tmnt_state::prmrsocr) GENERIC_LATCH_8(config, "soundlatch2"); GENERIC_LATCH_8(config, "soundlatch3"); - MCFG_DEVICE_ADD("k054539", K054539, XTAL(18'432'000)) - MCFG_K054539_TIMER_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::tmnt2) + K054539(config, m_k054539, XTAL(18'432'000)); + m_k054539->timer_handler().set_inputline("audiocpu", INPUT_LINE_NMI); + m_k054539->add_route(0, "lspeaker", 1.0); + m_k054539->add_route(1, "rspeaker", 1.0); +} +void tmnt_state::tmnt2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(tmnt2_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - - MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM */ - /* access. Access speed of ROM/RAM used on the machine is 150ns, */ - /* without the wait, they cannot run on 8MHz. */ - /* We are not emulating the wait state, so the ROM test ends at */ - /* 02 instead of 00. */ - MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) - /* NMIs are generated by the 053260 */ + M68000(config, m_maincpu, XTAL(32'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::tmnt2_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::punkshot_interrupt)); + + Z80(config, m_audiocpu, 8000000); + /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM access. */ + /* Access speed of ROM/RAM used on the machine is 150ns, without the wait, they cannot run on 8MHz. */ + /* We are not emulating the wait state, so the ROM test ends at 02 instead of 00. */ + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2432,19 +2422,19 @@ MACHINE_CONFIG_START(tmnt_state::tmnt2) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_tmnt2) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(13*8, (64-13)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_tmnt2)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,lgtnfght) @@ -2464,22 +2454,21 @@ MACHINE_CONFIG_START(tmnt_state::tmnt2) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.75) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.75) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::ssriders) + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "lspeaker", 0.75); + m_k053260->add_route(1, "rspeaker", 0.75); +} +void tmnt_state::ssriders(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(ssriders_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + M68000(config, m_maincpu, XTAL(32'000'000)/2); + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::punkshot_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) - MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) - /* NMIs are generated by the 053260 */ + Z80(config, m_audiocpu, 8000000); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2489,19 +2478,19 @@ MACHINE_CONFIG_START(tmnt_state::ssriders) WATCHDOG_TIMER(config, "watchdog"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_tmnt2) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_tmnt2)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); MCFG_VIDEO_START_OVERRIDE(tmnt_state,lgtnfght) @@ -2521,18 +2510,17 @@ MACHINE_CONFIG_START(tmnt_state::ssriders) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.70) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.70) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(tmnt_state::sunsetbl) + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "lspeaker", 0.70); + m_k053260->add_route(1, "rspeaker", 0.70); +} +void tmnt_state::sunsetbl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(sunsetbl_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, irq4_line_hold) + M68000(config, m_maincpu, 16000000); + m_maincpu->set_addrmap(AS_PROGRAM, tmnt_state::sunsetbl_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::irq4_line_hold)); MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2540,19 +2528,19 @@ MACHINE_CONFIG_START(tmnt_state::sunsetbl) EEPROM_ER5911_8BIT(config, "eeprom"); /* 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(2500) /* not accurate */) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_tmnt2) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + 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(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_tmnt2)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); @@ -2568,21 +2556,21 @@ MACHINE_CONFIG_START(tmnt_state::sunsetbl) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, 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 - -MACHINE_CONFIG_START(tmnt_state::thndrx2) + okim6295_device &oki(OKIM6295(config, "oki", 1056000, 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); +} +void tmnt_state::thndrx2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 12000000) /* 12 MHz */ - MCFG_DEVICE_PROGRAM_MAP(thndrx2_main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + M68000(config, m_maincpu, 12000000); /* 12 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::thndrx2_main_map); + m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::punkshot_interrupt)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_DEVICE_PROGRAM_MAP(thndrx2_audio_map) - /* NMIs are generated by the 053260 */ + Z80(config, m_audiocpu, XTAL(3'579'545)); + m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::thndrx2_audio_map); + /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2590,18 +2578,18 @@ MACHINE_CONFIG_START(tmnt_state::thndrx2) EEPROM_ER5911_8BIT(config, "eeprom"); /* 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(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) - MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_thndrx2) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 2048) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(64*8, 32*8); + screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(tmnt_state::screen_update_thndrx2)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 2048); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); @@ -2622,10 +2610,10 @@ MACHINE_CONFIG_START(tmnt_state::thndrx2) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - MCFG_K053260_ADD("k053260", XTAL(3'579'545)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.75) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.75) -MACHINE_CONFIG_END + K053260(config, m_k053260, XTAL(3'579'545)); + m_k053260->add_route(0, "lspeaker", 0.75); + m_k053260->add_route(1, "rspeaker", 0.75); +} diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp index c68036d6914..ef83d7674d1 100644 --- a/src/mame/drivers/tnzs.cpp +++ b/src/mame/drivers/tnzs.cpp @@ -1529,42 +1529,43 @@ static GFXDECODE_START( gfx_insectx ) GFXDECODE_ENTRY( "gfx1", 0, insectx_charlayout, 0, 32 ) GFXDECODE_END -MACHINE_CONFIG_START(tnzs_base_state::tnzs_base) +void tnzs_base_state::tnzs_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80,XTAL(12'000'000)/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz, verified on insectx, kageki, tnzsb */ - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tnzs_base_state, irq0_line_hold) + Z80(config, m_maincpu, XTAL(12'000'000)/2); /* 6.0 MHz ??? - Main board Crystal is 12MHz, verified on insectx, kageki, tnzsb */ + m_maincpu->set_addrmap(AS_PROGRAM, &tnzs_base_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(tnzs_base_state::irq0_line_hold)); - MCFG_DEVICE_ADD("sub", Z80,XTAL(12'000'000)/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz, verified on insectx, kageki, tnzsb */ - MCFG_DEVICE_PROGRAM_MAP(base_sub_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tnzs_base_state, irq0_line_hold) + Z80(config, m_subcpu, XTAL(12'000'000)/2); /* 6.0 MHz ??? - Main board Crystal is 12MHz, verified on insectx, kageki, tnzsb */ + m_subcpu->set_addrmap(AS_PROGRAM, &tnzs_base_state::base_sub_map); + m_subcpu->set_vblank_int("screen", FUNC(tnzs_base_state::irq0_line_hold)); tnzs_mainbank(config); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); /* video hardware */ SETA001_SPRITE(config, m_seta001, 0); m_seta001->set_gfxdecode_tag("gfxdecode"); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(tnzs_base_state, screen_update_tnzs) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, tnzs_base_state, screen_vblank_tnzs)) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + m_screen->set_screen_update(FUNC(tnzs_base_state::screen_update_tnzs)); + m_screen->screen_vblank().set(FUNC(tnzs_base_state::screen_vblank_tnzs)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tnzs) - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tnzs); + PALETTE(config, m_palette, 512).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); /* sound hardware */ SPEAKER(config, "speaker").front_center(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tnzs_mcu_state::tnzs) +void tnzs_mcu_state::tnzs(machine_config &config) +{ tnzs_base(config); I8742(config, m_mcu, 12000000/2); /* 400KHz ??? - Main board Crystal is 12MHz */ m_mcu->p1_in_cb().set(FUNC(tnzs_mcu_state::mcu_port1_r)); @@ -1573,35 +1574,31 @@ MACHINE_CONFIG_START(tnzs_mcu_state::tnzs) m_mcu->t0_in_cb().set_ioport("COIN1"); m_mcu->t1_in_cb().set_ioport("COIN2"); - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(tnzs_sub_map) + m_subcpu->set_addrmap(AS_PROGRAM, &tnzs_mcu_state::tnzs_sub_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(59.15) /* it should be the same as the newer pcb vsync */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) + m_screen->set_refresh_hz(59.15); /* it should be the same as the newer pcb vsync */ + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ /* sound hardware */ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); ymsnd.port_a_read_callback().set_ioport("DSWA"); ymsnd.port_b_read_callback().set_ioport("DSWB"); ymsnd.add_route(ALL_OUTPUTS, "speaker", 0.3); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(extrmatn_state::extrmatn) +void extrmatn_state::extrmatn(machine_config &config) +{ tnzs(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(prompal_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &extrmatn_state::prompal_main_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_INIT_OWNER(extrmatn_state, prompalette) -MACHINE_CONFIG_END + m_palette->set_init(FUNC(extrmatn_state::palette_init_prompalette)); +} void extrmatn_state::plumppop(machine_config &config) { @@ -1611,41 +1608,37 @@ void extrmatn_state::plumppop(machine_config &config) m_upd4701->set_porty_tag("AN2"); } -MACHINE_CONFIG_START(arknoid2_state::arknoid2) +void arknoid2_state::arknoid2(machine_config &config) +{ plumppop(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", arknoid2_state, mcu_interrupt) + m_maincpu->set_vblank_int("screen", FUNC(arknoid2_state::mcu_interrupt)); + m_subcpu->set_addrmap(AS_PROGRAM, &arknoid2_state::arknoid2_sub_map); - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(arknoid2_sub_map) - - MCFG_DEVICE_MODIFY("mcu") - MCFG_DEVICE_DISABLE() -MACHINE_CONFIG_END + subdevice<cpu_device>("mcu")->set_disable(); +} -MACHINE_CONFIG_START(insectx_state::insectx) +void insectx_state::insectx(machine_config &config) +{ tnzs_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(insectx_sub_map) + m_subcpu->set_addrmap(AS_PROGRAM, &insectx_state::insectx_sub_map); /* video hardware */ - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_insectx) + m_gfxdecode->set_info(gfx_insectx); /* sound hardware */ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); /* verified on pcb */ ymsnd.port_a_read_callback().set_ioport("DSWA"); ymsnd.port_b_read_callback().set_ioport("DSWB"); ymsnd.add_route(ALL_OUTPUTS, "speaker", 0.3); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(kageki_state::kageki) +void kageki_state::kageki(machine_config &config) +{ tnzs_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(kageki_sub_map) + m_subcpu->set_addrmap(AS_PROGRAM, &kageki_state::kageki_sub_map); /* sound hardware */ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); /* verified on pcb */ @@ -1656,28 +1649,25 @@ MACHINE_CONFIG_START(kageki_state::kageki) ymsnd.add_route(2, "speaker", 0.15); ymsnd.add_route(3, "speaker", 0.35); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_START_CB(kageki_state, init_samples) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_start_callback(FUNC(kageki_state::init_samples)); + m_samples->add_route(ALL_OUTPUTS, "speaker", 1.0); +} -MACHINE_CONFIG_START(tnzsb_state::tnzsb) +void tnzsb_state::tnzsb(machine_config &config) +{ tnzs_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(tnzsb_main_map) - - MCFG_DEVICE_MODIFY("sub") /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(tnzsb_sub_map) + m_maincpu->set_addrmap(AS_PROGRAM, &tnzsb_state::tnzsb_main_map); + m_subcpu->set_addrmap(AS_PROGRAM, &tnzsb_state::tnzsb_sub_map); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(12'000'000)/2) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(tnzsb_cpu2_map) - MCFG_DEVICE_IO_MAP(tnzsb_io_map) + Z80(config, m_audiocpu, XTAL(12'000'000)/2); /* verified on pcb */ + m_audiocpu->set_addrmap(AS_PROGRAM, &tnzsb_state::tnzsb_cpu2_map); + m_audiocpu->set_addrmap(AS_IO, &tnzsb_state::tnzsb_io_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(59.15) /* verified on pcb */ + m_screen->set_refresh_hz(59.15); /* verified on pcb */ /* sound hardware */ GENERIC_LATCH_8(config, m_soundlatch); @@ -1688,52 +1678,47 @@ MACHINE_CONFIG_START(tnzsb_state::tnzsb) ymsnd.add_route(1, "speaker", 1.0); ymsnd.add_route(2, "speaker", 1.0); ymsnd.add_route(3, "speaker", 2.0); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(kabukiz_state::kabukiz) +void kabukiz_state::kabukiz(machine_config &config) +{ tnzsb(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(kabukiz_sub_map) - - MCFG_DEVICE_MODIFY("audiocpu") - MCFG_DEVICE_PROGRAM_MAP(kabukiz_cpu2_map) + m_subcpu->set_addrmap(AS_PROGRAM, &kabukiz_state::kabukiz_sub_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &kabukiz_state::kabukiz_cpu2_map); /* sound hardware */ ym2203_device &ymsnd(*subdevice<ym2203_device>("ymsnd")); ymsnd.port_a_write_callback().set(FUNC(kabukiz_state::sound_bank_w)); ymsnd.port_b_write_callback().set("dac", FUNC(dac_byte_interface::data_w)); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 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, "speaker", 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); +} -MACHINE_CONFIG_START(jpopnics_state::jpopnics) +void jpopnics_state::jpopnics(machine_config &config) +{ tnzs_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(jpopnics_main_map) - - MCFG_DEVICE_MODIFY("sub") - MCFG_DEVICE_PROGRAM_MAP(jpopnics_sub_map) + m_maincpu->set_addrmap(AS_PROGRAM, &jpopnics_state::jpopnics_main_map); + m_subcpu->set_addrmap(AS_PROGRAM, &jpopnics_state::jpopnics_sub_map); UPD4701A(config, m_upd4701); m_upd4701->set_portx_tag("AN1"); m_upd4701->set_porty_tag("AN2"); /* video hardware */ - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(1024) - MCFG_PALETTE_FORMAT(GGGGBBBBRRRRxxxx) /* wrong, the other 4 bits seem to be used as well */ - MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG) + m_palette->set_entries(1024); + m_palette->set_format(PALETTE_FORMAT_GGGGBBBBRRRRxxxx); /* wrong, the other 4 bits seem to be used as well */ + m_palette->set_endianness(ENDIANNESS_BIG); /* sound hardware */ YM2151(config, "ymsnd", XTAL(12'000'000)/4).add_route(ALL_OUTPUTS, "speaker", 0.3); /* Not verified - Main board Crystal is 12MHz */ -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/triplhnt.cpp b/src/mame/drivers/triplhnt.cpp index 988b4d24fb4..495a4083bdf 100644 --- a/src/mame/drivers/triplhnt.cpp +++ b/src/mame/drivers/triplhnt.cpp @@ -271,12 +271,12 @@ PALETTE_INIT_MEMBER(triplhnt_state, triplhnt) } -MACHINE_CONFIG_START(triplhnt_state::triplhnt) - -/* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6800, 800000) - MCFG_DEVICE_PROGRAM_MAP(triplhnt_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", triplhnt_state, irq0_line_hold) +void triplhnt_state::triplhnt(machine_config &config) +{ + /* basic machine hardware */ + M6800(config, m_maincpu, 800000); + m_maincpu->set_addrmap(AS_PROGRAM, &triplhnt_state::triplhnt_map); + m_maincpu->set_vblank_int("screen", FUNC(triplhnt_state::irq0_line_hold)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // battery-backed 74C89 at J5 @@ -295,28 +295,27 @@ MACHINE_CONFIG_START(triplhnt_state::triplhnt) WATCHDOG_TIMER(config, m_watchdog); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 262) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(triplhnt_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_size(256, 262); + screen.set_visarea(0, 255, 0, 239); + screen.set_screen_update(FUNC(triplhnt_state::screen_update)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_triplhnt) - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(triplhnt_state, triplhnt) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_triplhnt); + PALETTE(config, m_palette, 8).set_init(FUNC(triplhnt_state::palette_init_triplhnt)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) /* 2 channels */ - MCFG_SAMPLES_NAMES(triplhnt_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) + SAMPLES(config, m_samples); + m_samples->set_channels(2); /* 2 channels */ + m_samples->set_samples_names(triplhnt_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.20); - MCFG_DEVICE_ADD("discrete", DISCRETE, triplhnt_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, triplhnt_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.90); +} ROM_START( triplhnt ) diff --git a/src/mame/drivers/vsnes.cpp b/src/mame/drivers/vsnes.cpp index d616886b95c..8185f2aa921 100644 --- a/src/mame/drivers/vsnes.cpp +++ b/src/mame/drivers/vsnes.cpp @@ -1701,160 +1701,155 @@ static INPUT_PORTS_START( supxevs ) PORT_DIPSETTING( 0xc0, "RP2C04-0004" ) INPUT_PORTS_END -MACHINE_CONFIG_START(vsnes_state::vsnes) - +void vsnes_state::vsnes(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(vsnes_cpu1_map) - /* some carts also trigger IRQs */ + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &vsnes_state::vsnes_cpu1_map); + /* some carts also trigger IRQs */ MCFG_MACHINE_RESET_OVERRIDE(vsnes_state,vsnes) MCFG_MACHINE_START_OVERRIDE(vsnes_state,vsnes) /* video hardware */ - MCFG_SCREEN_ADD("screen1", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu1", ppu2c0x_device, screen_update) + screen_device &screen1(SCREEN(config, "screen1", SCREEN_TYPE_RASTER)); + screen1.set_refresh_hz(60); + screen1.set_size(32*8, 262); + screen1.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen1.set_screen_update("ppu1", FUNC(ppu2c0x_device::screen_update)); - MCFG_PPU2C04_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C04(config, m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vsnes_state::jajamaru) +void vsnes_state::jajamaru(machine_config &config) +{ vsnes(config); - MCFG_DEVICE_REMOVE( "ppu1" ) - MCFG_PPU2C05_01_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) -MACHINE_CONFIG_END + PPU_2C05_01(config.replace(), m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); +} -MACHINE_CONFIG_START(vsnes_state::mightybj) +void vsnes_state::mightybj(machine_config &config) +{ vsnes(config); - MCFG_DEVICE_REMOVE( "ppu1" ) - MCFG_PPU2C05_02_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) -MACHINE_CONFIG_END + PPU_2C05_02(config.replace(), m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); +} -MACHINE_CONFIG_START(vsnes_state::vsgshoe) +void vsnes_state::vsgshoe(machine_config &config) +{ vsnes(config); - MCFG_DEVICE_REMOVE( "ppu1" ) - MCFG_PPU2C05_03_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) -MACHINE_CONFIG_END + PPU_2C05_03(config.replace(), m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); +} -MACHINE_CONFIG_START(vsnes_state::topgun) +void vsnes_state::topgun(machine_config &config) +{ vsnes(config); - MCFG_DEVICE_REMOVE( "ppu1" ) - MCFG_PPU2C05_04_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(vsnes_state::vsdual) + PPU_2C05_04(config.replace(), m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); +} +void vsnes_state::vsdual(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(vsnes_cpu1_map) + N2A03(config, m_maincpu, NTSC_APU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &vsnes_state::vsnes_cpu1_map); - MCFG_DEVICE_ADD("sub", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(vsnes_cpu2_map) + N2A03(config, m_subcpu, NTSC_APU_CLOCK); + m_subcpu->set_addrmap(AS_PROGRAM, &vsnes_state::vsnes_cpu2_map); MCFG_MACHINE_RESET_OVERRIDE(vsnes_state,vsdual) MCFG_MACHINE_START_OVERRIDE(vsnes_state,vsdual) config.set_default_layout(layout_dualhsxs); - MCFG_SCREEN_ADD("screen1", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu1", ppu2c0x_device, screen_update) + screen_device &screen1(SCREEN(config, "screen1", SCREEN_TYPE_RASTER)); + screen1.set_refresh_hz(60); + screen1.set_size(32*8, 262); + screen1.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen1.set_screen_update("ppu1", FUNC(ppu2c0x_device::screen_update)); - MCFG_SCREEN_ADD("screen2", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu2", ppu2c0x_device, screen_update) + screen_device &screen2(SCREEN(config, "screen2", SCREEN_TYPE_RASTER)); + screen2.set_refresh_hz(60); + screen2.set_size(32*8, 262); + screen2.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen2.set_screen_update("ppu2", FUNC(ppu2c0x_device::screen_update)); - MCFG_PPU2C04_ADD("ppu1") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + PPU_2C04(config, m_ppu1); + m_ppu1->set_screen("screen1"); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - MCFG_PPU2C04_ADD("ppu2") - MCFG_PPU2C0X_SET_SCREEN("screen2") - MCFG_PPU2C0X_CPU("sub") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("sub", INPUT_LINE_NMI)) + PPU_2C04(config, m_ppu2); + m_ppu2->set_screen("screen2"); + m_ppu2->set_cpu_tag(m_subcpu); + m_ppu2->int_callback().set_inputline(m_subcpu, INPUT_LINE_NMI); /* sound hardware */ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vsnes_state::vsdual_pi) +void vsnes_state::vsdual_pi(machine_config &config) +{ vsdual(config); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); // need high level of interleave to keep screens in sync in Balloon Fight. // however vsmahjng doesn't like perfect interleave? you end up needing to reset it to boot? maybe something in a bad default state? watchdog? // as the board would always be running in 'perfect interleave' the fact the Mahjong game doesn't work like this needs investigating. -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(vsnes_state::vsnes_bootleg) +} +void vsnes_state::vsnes_bootleg(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502,XTAL(16'000'000)/4) // 4mhz? seems too high but flickers badly otherwise, issue elsewhere? - MCFG_DEVICE_PROGRAM_MAP(vsnes_cpu1_bootleg_map) - /* some carts also trigger IRQs */ + M6502(config, m_maincpu, XTAL(16'000'000)/4); // 4mhz? seems too high but flickers badly otherwise, issue elsewhere? + m_maincpu->set_addrmap(AS_PROGRAM, &vsnes_state::vsnes_cpu1_bootleg_map); + /* some carts also trigger IRQs */ MCFG_MACHINE_RESET_OVERRIDE(vsnes_state,vsnes) MCFG_MACHINE_START_OVERRIDE(vsnes_state,vsnes) - MCFG_DEVICE_ADD("sub", Z80,XTAL(16'000'000)/4) /* ? MHz */ // Z8400APS-Z80CPU - MCFG_DEVICE_PROGRAM_MAP(vsnes_bootleg_z80_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen1", vsnes_state, irq0_line_hold) -// MCFG_DEVICE_PERIODIC_INT_DRIVER(vsnes_state, nmi_line_pulse) + Z80(config, m_subcpu, XTAL(16'000'000)/4); /* ? MHz */ // Z8400APS-Z80CPU + m_subcpu->set_addrmap(AS_PROGRAM, &vsnes_state::vsnes_bootleg_z80_map); + m_subcpu->set_vblank_int("screen1", FUNC(vsnes_state::irq0_line_hold)); +// m_subcpu->set_periodic_int(FUNC(vsnes_state::nmi_line_pulse)); /* video hardware */ - MCFG_SCREEN_ADD("screen1", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 262) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DEVICE("ppu1", ppu2c0x_device, screen_update) - - MCFG_PPU2C04_ADD("ppu1") - MCFG_PPU2C0X_CPU("maincpu") - MCFG_PPU2C0X_SET_SCREEN("screen1") - MCFG_PPU2C0X_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) - MCFG_PPU2C0X_IGNORE_SPRITE_WRITE_LIMIT // bootleg seems to need this - code to set the sprite address is replaced with complete copy loops?? + screen_device &screen1(SCREEN(config, "screen1", SCREEN_TYPE_RASTER)); + screen1.set_refresh_hz(60); + screen1.set_size(32*8, 262); + screen1.set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + screen1.set_screen_update("ppu1", FUNC(ppu2c0x_device::screen_update)); + + PPU_2C04(config, m_ppu1); + m_ppu1->set_cpu_tag(m_maincpu); + m_ppu1->set_screen("screen1"); + m_ppu1->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + m_ppu1->use_sprite_write_limitation_disable(); // bootleg seems to need this - code to set the sprite address is replaced with complete copy loops?? /* sound hardware */ SPEAKER(config, "mono").front_center(); // PCB has 2, code accesses 3? which 2 really exist? - MCFG_DEVICE_ADD("sn1", SN76489, XTAL(16'000'000)/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn2", SN76489, XTAL(16'000'000)/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn3", SN76489, XTAL(16'000'000)/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SN76489(config, "sn1", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.50); + SN76489(config, "sn2", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.50); + SN76489(config, "sn3", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.50); +} /******************************************************************************/ diff --git a/src/mame/includes/atarist.h b/src/mame/includes/atarist.h index 0d60c5e787c..0add260a05b 100644 --- a/src/mame/includes/atarist.h +++ b/src/mame/includes/atarist.h @@ -95,6 +95,7 @@ public: m_cart(*this, "cartslot"), m_ram(*this, RAM_TAG), m_rs232(*this, RS232_TAG), + m_ymsnd(*this, YM2149_TAG), m_p31(*this, "P31"), m_p32(*this, "P32"), m_p33(*this, "P33"), @@ -137,6 +138,7 @@ public: required_device<generic_slot_device> m_cart; required_device<ram_device> m_ram; required_device<rs232_port_device> m_rs232; + required_device<ym2149_device> m_ymsnd; required_ioport m_p31; required_ioport m_p32; required_ioport m_p33; @@ -331,6 +333,7 @@ public: required_device<screen_device> m_screen; DECLARE_WRITE_LINE_MEMBER( write_monochrome ); + void common(machine_config &config); void st(machine_config &config); void ikbd_map(address_map &map); void st_map(address_map &map); diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h index 92e522ef416..180f7b3aa4f 100644 --- a/src/mame/includes/circus.h +++ b/src/mame/includes/circus.h @@ -35,7 +35,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<samples_device> m_samples; - required_device<discrete_device> m_discrete; + required_device<discrete_sound_device> m_discrete; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h index 285003099d1..5aca6952b19 100644 --- a/src/mame/includes/gridlee.h +++ b/src/mame/includes/gridlee.h @@ -39,7 +39,8 @@ public: m_maincpu(*this, "maincpu"), m_latch(*this, "latch"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_samples(*this, "samples") { } void gridlee(machine_config &config); @@ -72,6 +73,7 @@ private: required_device<ls259_device> m_latch; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + required_device<samples_device> m_samples; uint8_t m_last_analog_input[2]; uint8_t m_last_analog_output[2]; diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h index d0e88b52d56..06dcf8f4366 100644 --- a/src/mame/includes/nes.h +++ b/src/mame/includes/nes.h @@ -14,11 +14,12 @@ #pragma once -#include "video/ppu2c0x.h" #include "bus/nes/disksys.h" #include "bus/nes/nes_slot.h" #include "bus/nes/nes_carts.h" #include "bus/nes_ctrl/ctrl.h" +#include "video/ppu2c0x.h" +#include "screen.h" /*************************************************************************** CONSTANTS @@ -73,6 +74,7 @@ public: nes_state(const machine_config &mconfig, device_type type, const char *tag) : nes_base_state(mconfig, type, tag), m_ppu(*this, "ppu"), + m_screen(*this, "screen"), m_exp(*this, "exp"), m_cartslot(*this, "nes_slot"), m_disk(*this, "disk") @@ -125,6 +127,7 @@ private: required_device<ppu2c0x_device> m_ppu; + required_device<screen_device> m_screen; optional_device<nes_control_port_device> m_exp; optional_device<nes_cart_slot_device> m_cartslot; optional_device<nes_disksys_device> m_disk; diff --git a/src/mame/includes/ninjakd2.h b/src/mame/includes/ninjakd2.h index 9d481375383..5df65126962 100644 --- a/src/mame/includes/ninjakd2.h +++ b/src/mame/includes/ninjakd2.h @@ -23,12 +23,12 @@ public: m_palette(*this, "palette"), m_bg_videoram(*this, "bg_videoram"), m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), m_soundcpu(*this, "soundcpu"), m_pcm(*this, "pcm"), m_pcm_region(*this, "pcm"), m_fg_videoram(*this, "fg_videoram"), m_spriteram(*this, "spriteram"), - m_screen(*this, "screen"), m_decrypted_opcodes(*this, "decrypted_opcodes"), m_mainbank(*this, "mainbank") { } @@ -52,6 +52,8 @@ protected: required_device<palette_device> m_palette; optional_shared_ptr<uint8_t> m_bg_videoram; required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<cpu_device> m_soundcpu; uint8_t m_vram_bank_mask; int m_robokid_sprites; @@ -84,12 +86,10 @@ protected: void ninjakd2_core(machine_config &config); private: - required_device<cpu_device> m_soundcpu; optional_device<samples_device> m_pcm; optional_memory_region m_pcm_region; required_shared_ptr<uint8_t> m_fg_videoram; required_shared_ptr<uint8_t> m_spriteram; - required_device<screen_device> m_screen; optional_shared_ptr<uint8_t> m_decrypted_opcodes; required_memory_bank m_mainbank; diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h index 1e52864da60..15c35e03917 100644 --- a/src/mame/includes/segag80v.h +++ b/src/mame/includes/segag80v.h @@ -27,7 +27,8 @@ public: m_usb(*this, "usbsnd"), m_aysnd(*this, "aysnd"), m_vector(*this, "vector"), - m_screen(*this, "screen"){ } + m_screen(*this, "screen") + { } void g80v_base(machine_config &config); void tacscan(machine_config &config); diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index ef67d729eb2..6e72e9f532b 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -7,13 +7,13 @@ #include "bus/centronics/ctronics.h" #include "cpu/z80/z80.h" -#include "machine/z80daisy.h" #include "imagedev/cassette.h" #include "imagedev/floppy.h" #include "imagedev/snapquik.h" #include "machine/buffer.h" #include "machine/timer.h" #include "machine/wd_fdc.h" +#include "machine/z80daisy.h" #include "machine/z80dma.h" #include "machine/z80pio.h" #include "sound/samples.h" @@ -21,7 +21,7 @@ #include "sound/wave.h" #include "video/mc6845.h" #include "emupal.h" - +#include "screen.h" /* Bits in m_portf0 variable: d5 cassette LED @@ -35,6 +35,8 @@ public: super80_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_palette(*this, "palette") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") , m_maincpu(*this, "maincpu") , m_p_ram(*this, "maincpu") , m_p_chargen(*this, "chargen") @@ -132,6 +134,8 @@ private: void mc6845_cursor_configure(); void super80_cassette_motor(bool data); required_device<palette_device> m_palette; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; required_device<z80_device> m_maincpu; required_region_ptr<u8> m_p_ram; optional_region_ptr<u8> m_p_chargen; diff --git a/src/mame/includes/thief.h b/src/mame/includes/thief.h index fdce1653579..aa114c875e3 100644 --- a/src/mame/includes/thief.h +++ b/src/mame/includes/thief.h @@ -3,6 +3,7 @@ #include "sound/samples.h" #include "video/tms9927.h" #include "emupal.h" +#include "screen.h" struct coprocessor_t { std::unique_ptr<uint8_t[]> context_ram; @@ -19,6 +20,7 @@ public: m_maincpu(*this, "maincpu"), m_samples(*this, "samples"), m_tms(*this, "tms"), + m_screen(*this, "screen"), m_palette(*this, "palette") { } void natodef(machine_config &config); @@ -60,6 +62,7 @@ private: required_device<cpu_device> m_maincpu; required_device<samples_device> m_samples; required_device<tms9927_device> m_tms; + required_device<screen_device> m_screen; required_device<palette_device> m_palette; void io_map(address_map &map); diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 6c02e4e0814..ac24d47cfea 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -6,15 +6,15 @@ #pragma once -#include "sound/dac.h" -#include "sound/samples.h" -#include "video/seta001.h" #include "cpu/mcs48/mcs48.h" #include "machine/bankdev.h" #include "machine/gen_latch.h" #include "machine/upd4701.h" +#include "sound/dac.h" +#include "sound/samples.h" +#include "video/seta001.h" #include "emupal.h" - +#include "screen.h" class tnzs_base_state : public driver_device { @@ -25,6 +25,8 @@ public: , m_subcpu(*this, "sub") , m_seta001(*this, "spritegen") , m_palette(*this, "palette") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") , m_mainbank(*this, "mainbank") , m_subbank(*this, "subbank") { } @@ -52,6 +54,8 @@ protected: optional_device<cpu_device> m_subcpu; optional_device<seta001_device> m_seta001; required_device<palette_device> m_palette; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; optional_device<address_map_bank_device> m_mainbank; /* FIXME: optional because of reuse from cchance.cpp */ optional_memory_bank m_subbank; /* FIXME: optional because of reuse from cchance.cpp */ diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h index b666bd3ee25..9a378779121 100644 --- a/src/mame/includes/triplhnt.h +++ b/src/mame/includes/triplhnt.h @@ -80,7 +80,7 @@ private: required_device<cpu_device> m_maincpu; required_device<f9334_device> m_latch; required_device<watchdog_timer_device> m_watchdog; - required_device<discrete_device> m_discrete; + required_device<discrete_sound_device> m_discrete; required_device<samples_device> m_samples; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h index a363a6d0a3c..11aa50e8945 100644 --- a/src/mame/includes/vicdual.h +++ b/src/mame/includes/vicdual.h @@ -88,7 +88,7 @@ protected: optional_device<i8039_device> m_audiocpu; optional_device<ay8910_device> m_psg; optional_device<samples_device> m_samples; - optional_device<discrete_device> m_discrete; + optional_device<discrete_sound_device> m_discrete; required_device<timer_device> m_coinstate_timer; optional_device<timer_device> m_nsub_coinage_timer; required_device<screen_device> m_screen; diff --git a/src/mame/machine/genpin.cpp b/src/mame/machine/genpin.cpp index 4702ab1227e..877cb1a5d90 100644 --- a/src/mame/machine/genpin.cpp +++ b/src/mame/machine/genpin.cpp @@ -10,11 +10,11 @@ This is for common pinball machine coding. #include "genpin.h" #include "speaker.h" - -MACHINE_CONFIG_START(genpin_class::genpin_audio) +void genpin_class::genpin_audio(machine_config &config) +{ SPEAKER(config, "mechvol").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(genpin_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mechvol", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(genpin_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mechvol", 1.0); +}
\ No newline at end of file diff --git a/src/mame/machine/mm1kb.cpp b/src/mame/machine/mm1kb.cpp index 98e4108dbec..1b3f660d358 100644 --- a/src/mame/machine/mm1kb.cpp +++ b/src/mame/machine/mm1kb.cpp @@ -57,13 +57,14 @@ bool mm1_keyboard_device::first_time = true; // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(mm1_keyboard_device::device_add_mconfig) +void mm1_keyboard_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("keyboard_and_chassis_sounds", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(mm1_kb_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.7) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_names(mm1_kb_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.7); +} //------------------------------------------------- |