From 2e5e818fb943875c83a74010cfdf4417934b58bb Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Tue, 18 Dec 2018 16:15:29 +0100 Subject: -bus/a7800/a78_slot, bus/astrocde/exp, slot, pc_joy/pc_joy, vcs/vcs_slot, : Removed MCFG macros. [Ryan Holtz] -bus/a7800/hiscore, xboard, isa/gblaster, sb16, sblaster, ssi2001, stereo_fx, bus/msx_cart/moonsound: Removed MACHINE_CONFIG macros. [Ryan Holtz] -sound/astrocde, es5506, qs1000, saa1099, t6721a, tc8830f, tiaintf, tms3615, upd7752, ymf278b, ymz280b: Removed MCFG macros. [Ryan Holtz] -video/ef9369: Removed MCFG macros. [Ryan Holtz] -drivers/a2600, a7800, astrocde, astrohome, bingor, bishi, eolith, esqasr, esqmr, fuukifg3, ghosteo, guab, jpmsys5, limenko, lordgun, macrossp, mastboy, mpu4vid, psikyo, psikyo4, psikyosh, samcoupe, ssv, timeplt, vamphalf, vegaeo, xorworld: Removed MCFG macros. [Ryan Holtz] -drivers/cave: Removed MCFG macros and moved common config into common functions. [Ryan Holtz] -drivers/tourtabl: Removed MCFG macros and corrected CPU type. [Ryan Holtz] --- src/devices/bus/a7800/a78_slot.h | 24 +- src/devices/bus/a7800/hiscore.cpp | 7 +- src/devices/bus/a7800/xboard.cpp | 22 +- src/devices/bus/astrocde/exp.h | 16 +- src/devices/bus/astrocde/slot.h | 25 +- src/devices/bus/isa/gblaster.cpp | 17 +- src/devices/bus/isa/sb16.cpp | 21 +- src/devices/bus/isa/sblaster.cpp | 113 +++--- src/devices/bus/isa/sblaster.h | 4 +- src/devices/bus/isa/ssi2001.cpp | 11 +- src/devices/bus/isa/stereo_fx.cpp | 26 +- src/devices/bus/midi/midi.h | 11 + src/devices/bus/msx_cart/moonsound.cpp | 23 +- src/devices/bus/pc_joy/pc_joy.cpp | 4 + src/devices/bus/pc_joy/pc_joy.h | 8 +- src/devices/bus/vcs/vcs_slot.h | 25 +- src/devices/sound/astrocde.h | 51 +-- src/devices/sound/es5506.h | 40 -- src/devices/sound/qs1000.h | 42 +- src/devices/sound/saa1099.h | 11 - src/devices/sound/t6721a.h | 25 -- src/devices/sound/tc8830f.h | 11 - src/devices/sound/tiaintf.h | 10 - src/devices/sound/tms3615.h | 10 - src/devices/sound/upd7752.h | 7 - src/devices/sound/ymf278b.h | 4 - src/devices/sound/ymz280b.h | 4 - src/devices/video/ef9369.h | 25 +- src/mame/audio/taito_en.cpp | 56 +-- src/mame/drivers/a2600.cpp | 51 +-- src/mame/drivers/a7800.cpp | 65 ++-- src/mame/drivers/amstr_pc.cpp | 2 +- src/mame/drivers/asst128.cpp | 2 +- src/mame/drivers/astrocde.cpp | 301 +++++++-------- src/mame/drivers/astrohome.cpp | 64 ++-- src/mame/drivers/bingor.cpp | 80 ++-- src/mame/drivers/bishi.cpp | 44 +-- src/mame/drivers/blitz68k.cpp | 6 +- src/mame/drivers/cave.cpp | 675 +++++++++++++-------------------- src/mame/drivers/eolith.cpp | 63 +-- src/mame/drivers/esqasr.cpp | 104 ++--- src/mame/drivers/esqmr.cpp | 43 ++- src/mame/drivers/firebeat.cpp | 117 +++--- src/mame/drivers/fuukifg3.cpp | 54 ++- src/mame/drivers/ghosteo.cpp | 56 +-- src/mame/drivers/guab.cpp | 48 ++- src/mame/drivers/ibmpcjr.cpp | 2 +- src/mame/drivers/jpmsys5.cpp | 31 +- src/mame/drivers/limenko.cpp | 94 ++--- src/mame/drivers/lordgun.cpp | 104 ++--- src/mame/drivers/macrossp.cpp | 65 ++-- src/mame/drivers/mastboy.cpp | 50 ++- src/mame/drivers/mpu4vid.cpp | 70 ++-- src/mame/drivers/psikyo.cpp | 194 +++++----- src/mame/drivers/psikyo4.cpp | 84 ++-- src/mame/drivers/psikyosh.cpp | 64 ++-- src/mame/drivers/samcoupe.cpp | 66 ++-- src/mame/drivers/ssv.cpp | 335 ++++++++-------- src/mame/drivers/tandy1t.cpp | 2 +- src/mame/drivers/timeplt.cpp | 70 ++-- src/mame/drivers/tourtabl.cpp | 30 +- src/mame/drivers/vamphalf.cpp | 294 +++++++------- src/mame/drivers/vegaeo.cpp | 52 +-- src/mame/drivers/xorworld.cpp | 47 ++- src/mame/includes/a2600.h | 2 +- src/mame/includes/astrocde.h | 2 + src/mame/includes/cave.h | 3 + src/mame/includes/eolith.h | 12 +- 68 files changed, 1834 insertions(+), 2267 deletions(-) diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index b49fedf7b82..4b091161bf1 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -12,6 +12,7 @@ TYPE DEFINITIONS ***************************************************************************/ +#define A78SLOT_ROM_REGION_TAG ":cart:rom" /* PCB */ enum @@ -89,7 +90,16 @@ class a78_cart_slot_device : public device_t, { public: // construction/destruction - a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template + a78_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : a78_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~a78_cart_slot_device(); // device-level overrides @@ -139,16 +149,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(A78_CART_SLOT, a78_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define A78SLOT_ROM_REGION_TAG ":cart:rom" - -#define MCFG_A78_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, A78_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - - #endif // MAME_BUS_A7800_A78_SLOT_H diff --git a/src/devices/bus/a7800/hiscore.cpp b/src/devices/bus/a7800/hiscore.cpp index 5f27c9cfe7a..62630842e5c 100644 --- a/src/devices/bus/a7800/hiscore.cpp +++ b/src/devices/bus/a7800/hiscore.cpp @@ -27,9 +27,10 @@ a78_hiscore_device::a78_hiscore_device(const machine_config &mconfig, const char } -MACHINE_CONFIG_START(a78_hiscore_device::device_add_mconfig) - MCFG_A78_CARTRIDGE_ADD("hsc_slot", a7800_cart, nullptr) -MACHINE_CONFIG_END +void a78_hiscore_device::device_add_mconfig(machine_config &config) +{ + A78_CART_SLOT(config, "hsc_slot", a7800_cart, nullptr); +} /*------------------------------------------------- diff --git a/src/devices/bus/a7800/xboard.cpp b/src/devices/bus/a7800/xboard.cpp index 6a772f3210c..d2e610f666e 100644 --- a/src/devices/bus/a7800/xboard.cpp +++ b/src/devices/bus/a7800/xboard.cpp @@ -106,25 +106,27 @@ void a78_xm_device::device_reset() } -MACHINE_CONFIG_START(a78_xboard_device::device_add_mconfig) - MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, nullptr) +void a78_xboard_device::device_add_mconfig(machine_config &config) +{ + A78_CART_SLOT(config, m_xbslot, a7800_cart, nullptr); SPEAKER(config, "xb_speaker").front_center(); - MCFG_DEVICE_ADD("xb_pokey", POKEY, XTAL(14'318'181)/8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00) -MACHINE_CONFIG_END + POKEY(config, m_pokey, XTAL(14'318'181)/8); + m_pokey->add_route(ALL_OUTPUTS, "xb_speaker", 1.00); +} -MACHINE_CONFIG_START(a78_xm_device::device_add_mconfig) - MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, nullptr) +void a78_xm_device::device_add_mconfig(machine_config &config) +{ + A78_CART_SLOT(config, m_xbslot, a7800_cart, nullptr); SPEAKER(config, "xb_speaker").front_center(); - MCFG_DEVICE_ADD("xb_pokey", POKEY, XTAL(14'318'181)/8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00) + POKEY(config, m_pokey, XTAL(14'318'181)/8); + m_pokey->add_route(ALL_OUTPUTS, "xb_speaker", 1.00); YM2151(config, m_ym, XTAL(14'318'181)/4).add_route(ALL_OUTPUTS, "xb_speaker", 1.00); -MACHINE_CONFIG_END +} /*------------------------------------------------- diff --git a/src/devices/bus/astrocde/exp.h b/src/devices/bus/astrocde/exp.h index 9be60975ed7..e6c97862224 100644 --- a/src/devices/bus/astrocde/exp.h +++ b/src/devices/bus/astrocde/exp.h @@ -26,6 +26,15 @@ class astrocade_exp_device : public device_t, public device_slot_interface { public: // construction/destruction + template + astrocade_exp_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : astrocade_exp_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~astrocade_exp_device(); @@ -43,14 +52,7 @@ protected: device_astrocade_card_interface* m_card; }; - - // device type definition DECLARE_DEVICE_TYPE(ASTROCADE_EXP_SLOT, astrocade_exp_device) - -#define MCFG_ASTROCADE_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, ASTROCADE_EXP_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - #endif // MAME_BUS_ASTROCADE_EXP_H diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h index dc7a2c84ca9..88c34fa0d8e 100644 --- a/src/devices/bus/astrocde/slot.h +++ b/src/devices/bus/astrocde/slot.h @@ -12,6 +12,7 @@ TYPE DEFINITIONS ***************************************************************************/ +#define ASTROCADESLOT_ROM_REGION_TAG ":cart:rom" /* PCB */ enum @@ -54,7 +55,16 @@ class astrocade_cart_slot_device : public device_t, { public: // construction/destruction - astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template + astrocade_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : astrocade_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~astrocade_cart_slot_device(); // image-level overrides @@ -87,20 +97,7 @@ protected: device_astrocade_cart_interface* m_cart; }; - - // device type definition DECLARE_DEVICE_TYPE(ASTROCADE_CART_SLOT, astrocade_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define ASTROCADESLOT_ROM_REGION_TAG ":cart:rom" - -#define MCFG_ASTROCADE_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, ASTROCADE_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - #endif // MAME_BUS_ASTROCADE_SLOT_H diff --git a/src/devices/bus/isa/gblaster.cpp b/src/devices/bus/isa/gblaster.cpp index e812827e4e6..cc838eabdc8 100644 --- a/src/devices/bus/isa/gblaster.cpp +++ b/src/devices/bus/isa/gblaster.cpp @@ -68,16 +68,17 @@ DEFINE_DEVICE_TYPE(ISA8_GAME_BLASTER, isa8_gblaster_device, "isa_gblaster", "Gam // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(isa8_gblaster_device::device_add_mconfig) +void isa8_gblaster_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_SAA1099_ADD("saa1099.1", 7159090) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) - MCFG_SAA1099_ADD("saa1099.2", 7159090) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) -MACHINE_CONFIG_END + SAA1099(config, m_saa1099_1, 7159090); + m_saa1099_1->add_route(ALL_OUTPUTS, "lspeaker", 0.50); + m_saa1099_1->add_route(ALL_OUTPUTS, "rspeaker", 0.50); + SAA1099(config, m_saa1099_2, 7159090); + m_saa1099_2->add_route(ALL_OUTPUTS, "lspeaker", 0.50); + m_saa1099_2->add_route(ALL_OUTPUTS, "rspeaker", 0.50); +} //************************************************************************** // LIVE DEVICE diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp index de675136a6e..be8cce9c644 100644 --- a/src/devices/bus/isa/sb16.cpp +++ b/src/devices/bus/isa/sb16.cpp @@ -409,7 +409,8 @@ const tiny_rom_entry *sb16_lle_device::device_rom_region() const return ROM_NAME( sb16 ); } -MACHINE_CONFIG_START(sb16_lle_device::device_add_mconfig) +void sb16_lle_device::device_add_mconfig(machine_config &config) +{ I80C52(config, m_cpu, XTAL(24'000'000)); m_cpu->set_addrmap(AS_IO, &sb16_lle_device::sb16_io); m_cpu->port_in_cb<1>().set(FUNC(sb16_lle_device::p1_r)); @@ -419,17 +420,17 @@ MACHINE_CONFIG_START(sb16_lle_device::device_add_mconfig) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymf262", YMF262, XTAL(14'318'181)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.00) - MCFG_SOUND_ROUTE(2, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(3, "rspeaker", 1.00) + ymf262_device &ymf262(YMF262(config, "ymf262", XTAL(14'318'181))); + ymf262.add_route(0, "lspeaker", 1.00); + ymf262.add_route(1, "rspeaker", 1.00); + ymf262.add_route(2, "lspeaker", 1.00); + ymf262.add_route(3, "rspeaker", 1.00); - MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC + DAC_16BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5); // unknown DAC + DAC_16BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // unknown DAC - MCFG_PC_JOY_ADD("pc_joy") -MACHINE_CONFIG_END + PC_JOY(config, m_joy); +} READ8_MEMBER( sb16_lle_device::host_data_r ) { diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index 4202bb896f4..74f1e0f8dd4 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -1141,74 +1141,63 @@ DEFINE_DEVICE_TYPE(ISA16_SOUND_BLASTER_16, isa16_sblaster16_device, "isa_sblaste // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(isa8_sblaster1_0_device::device_add_mconfig) - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ym3812", YM3812, ym3812_StdClock) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 3.00) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 3.00) - MCFG_SAA1099_ADD("saa1099.1", 7159090) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) - MCFG_SAA1099_ADD("saa1099.2", 7159090) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) - - MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "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_PC_JOY_ADD("pc_joy") - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(DEVICE_SELF, sb_device, midi_rx_w)) - - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(isa8_sblaster1_5_device::device_add_mconfig) +void sb_device::common(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ym3812", YM3812, ym3812_StdClock) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) - /* no CM/S support (empty sockets) */ - MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "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) + DAC_16BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5); // unknown DAC + DAC_16BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "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); - MCFG_PC_JOY_ADD("pc_joy") - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(DEVICE_SELF, sb_device, midi_rx_w)) + PC_JOY(config, m_joy); - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") -MACHINE_CONFIG_END + MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(FUNC(sb_device::midi_rx_w)); + MIDI_PORT(config, "mdout", midiout_slot, "midiout"); +} -MACHINE_CONFIG_START(isa16_sblaster16_device::device_add_mconfig) - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymf262", YMF262, ymf262_StdClock) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.00) - MCFG_SOUND_ROUTE(2, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(3, "rspeaker", 1.00) - - MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "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_PC_JOY_ADD("pc_joy") - MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") - MCFG_MIDI_RX_HANDLER(WRITELINE(DEVICE_SELF, sb_device, midi_rx_w)) - - MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") -MACHINE_CONFIG_END +void isa8_sblaster1_0_device::device_add_mconfig(machine_config &config) +{ + common(config); + + YM3812(config, m_ym3812, ym3812_StdClock); + m_ym3812->add_route(ALL_OUTPUTS, "lspeaker", 3.0); + m_ym3812->add_route(ALL_OUTPUTS, "rspeaker", 3.0); + + SAA1099(config, m_saa1099_1, 7159090); + m_saa1099_1->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_saa1099_1->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + + SAA1099(config, m_saa1099_2, 7159090); + m_saa1099_2->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_saa1099_2->add_route(ALL_OUTPUTS, "rspeaker", 0.5); +} + +void isa8_sblaster1_5_device::device_add_mconfig(machine_config &config) +{ + common(config); + + YM3812(config, m_ym3812, ym3812_StdClock); + m_ym3812->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_ym3812->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + /* no CM/S support (empty sockets) */ +} + +void isa16_sblaster16_device::device_add_mconfig(machine_config &config) +{ + common(config); + + ymf262_device &ymf262(YMF262(config, "ymf262", ymf262_StdClock)); + ymf262.add_route(0, "lspeaker", 1.0); + ymf262.add_route(1, "rspeaker", 1.0); + ymf262.add_route(2, "lspeaker", 1.0); + ymf262.add_route(3, "rspeaker", 1.0); +} //************************************************************************** // LIVE DEVICE diff --git a/src/devices/bus/isa/sblaster.h b/src/devices/bus/isa/sblaster.h index d54dda024b1..1517ef64308 100644 --- a/src/devices/bus/isa/sblaster.h +++ b/src/devices/bus/isa/sblaster.h @@ -40,6 +40,8 @@ public: DECLARE_WRITE_LINE_MEMBER( midi_rx_w ) { device_serial_interface::rx_w((uint8_t)state); } protected: + void common(machine_config &config); + struct sb8_dsp_state { uint8_t reset_latch; @@ -160,7 +162,7 @@ protected: virtual void irq_w(int state, int source) override; virtual uint8_t dack_r(int line) override { return sb_device::dack_r(line); } virtual void dack_w(int line, uint8_t data) override { sb_device::dack_w(line, data); } -private: + required_device m_ym3812; }; diff --git a/src/devices/bus/isa/ssi2001.cpp b/src/devices/bus/isa/ssi2001.cpp index 612457ff1fb..55adf04b0a2 100644 --- a/src/devices/bus/isa/ssi2001.cpp +++ b/src/devices/bus/isa/ssi2001.cpp @@ -10,12 +10,13 @@ DEFINE_DEVICE_TYPE(ISA8_SSI2001, ssi2001_device, "ssi2001", "Innovation SSI-2001 Audio Adapter") -MACHINE_CONFIG_START(ssi2001_device::device_add_mconfig) +void ssi2001_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("sid6581", MOS6581, XTAL(14'318'181)/16) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_PC_JOY_ADD("pc_joy") -MACHINE_CONFIG_END + MOS6581(config, m_sid, XTAL(14'318'181)/16); + m_sid->add_route(ALL_OUTPUTS, "mono", 1.00); + PC_JOY(config, m_joy); +} ssi2001_device::ssi2001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_SSI2001, tag, owner, clock), diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp index a8959fbe109..c38d3aace80 100644 --- a/src/devices/bus/isa/stereo_fx.cpp +++ b/src/devices/bus/isa/stereo_fx.cpp @@ -114,7 +114,8 @@ const tiny_rom_entry *stereo_fx_device::device_rom_region() const return ROM_NAME( stereo_fx ); } -MACHINE_CONFIG_START(stereo_fx_device::device_add_mconfig) +void stereo_fx_device::device_add_mconfig(machine_config &config) +{ I80C31(config, m_cpu, XTAL(30'000'000)); m_cpu->set_addrmap(AS_PROGRAM, &stereo_fx_device::stereo_fx_rom); m_cpu->set_addrmap(AS_IO, &stereo_fx_device::stereo_fx_io); @@ -125,19 +126,22 @@ MACHINE_CONFIG_START(stereo_fx_device::device_add_mconfig) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ym3812", YM3812, XTAL(3'579'545)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00) + ym3812_device &ym3812(YM3812(config, "ym3812", XTAL(3'579'545))); + ym3812.add_route(ALL_OUTPUTS, "lspeaker", 1.00); + ym3812.add_route(ALL_OUTPUTS, "rspeaker", 1.00); /* no CM/S support (empty sockets) */ - MCFG_DEVICE_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "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) + DAC_8BIT_R2R(config, "ldac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5); // unknown DAC + DAC_8BIT_R2R(config, "rdac", 0).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "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); - MCFG_PC_JOY_ADD("pc_joy") -MACHINE_CONFIG_END + PC_JOY(config, m_joy); +} READ8_MEMBER( stereo_fx_device::dsp_data_r ) { diff --git a/src/devices/bus/midi/midi.h b/src/devices/bus/midi/midi.h index 757feefeabc..e85a69b9b35 100644 --- a/src/devices/bus/midi/midi.h +++ b/src/devices/bus/midi/midi.h @@ -21,6 +21,15 @@ class midi_port_device : public device_t, friend class device_midi_port_interface; public: + template + midi_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : midi_port_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~midi_port_device(); @@ -36,6 +45,8 @@ protected: virtual void device_start() override; virtual void device_config_complete() override; + void common(machine_config &config); + int m_rxd; devcb_write_line m_rxd_handler; diff --git a/src/devices/bus/msx_cart/moonsound.cpp b/src/devices/bus/msx_cart/moonsound.cpp index 8289a086a18..d8b1fda9a5e 100644 --- a/src/devices/bus/msx_cart/moonsound.cpp +++ b/src/devices/bus/msx_cart/moonsound.cpp @@ -36,20 +36,21 @@ void msx_cart_moonsound_device::ymf278b_map(address_map &map) } -MACHINE_CONFIG_START(msx_cart_moonsound_device::device_add_mconfig) +void msx_cart_moonsound_device::device_add_mconfig(machine_config &config) +{ // The moonsound cartridge has a separate stereo output. SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymf278b", YMF278B, YMF278B_STD_CLOCK) - MCFG_DEVICE_ADDRESS_MAP(0, ymf278b_map) - MCFG_YMF278B_IRQ_HANDLER(WRITELINE(*this, msx_cart_moonsound_device, irq_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) - MCFG_SOUND_ROUTE(2, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(3, "rspeaker", 0.40) - MCFG_SOUND_ROUTE(4, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(5, "rspeaker", 0.40) -MACHINE_CONFIG_END + YMF278B(config, m_ymf278b, YMF278B_STD_CLOCK); + m_ymf278b->set_addrmap(0, &msx_cart_moonsound_device::ymf278b_map); + m_ymf278b->irq_handler().set(FUNC(msx_cart_moonsound_device::irq_w)); + m_ymf278b->add_route(0, "lspeaker", 0.50); + m_ymf278b->add_route(1, "rspeaker", 0.50); + m_ymf278b->add_route(2, "lspeaker", 0.40); + m_ymf278b->add_route(3, "rspeaker", 0.40); + m_ymf278b->add_route(4, "lspeaker", 0.40); + m_ymf278b->add_route(5, "rspeaker", 0.40); +} ROM_START( msx_cart_moonsound ) diff --git a/src/devices/bus/pc_joy/pc_joy.cpp b/src/devices/bus/pc_joy/pc_joy.cpp index b790af3ee4c..3e59be3a86c 100644 --- a/src/devices/bus/pc_joy/pc_joy.cpp +++ b/src/devices/bus/pc_joy/pc_joy.cpp @@ -19,6 +19,10 @@ pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, dev device_slot_interface(mconfig, *this), m_dev(nullptr) { + option_reset(); + pc_joysticks(*this); + set_default_option("basic_joy"); + set_fixed(false); } READ8_MEMBER ( pc_joy_device::joy_port_r ) diff --git a/src/devices/bus/pc_joy/pc_joy.h b/src/devices/bus/pc_joy/pc_joy.h index eb7d489b9b0..66729b76fc4 100644 --- a/src/devices/bus/pc_joy/pc_joy.h +++ b/src/devices/bus/pc_joy/pc_joy.h @@ -14,10 +14,6 @@ #pragma once -#define MCFG_PC_JOY_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, PC_JOY, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(pc_joysticks, "basic_joy", false) - void pc_joysticks(device_slot_interface &device); class device_pc_joy_interface : public device_slot_card_interface @@ -39,7 +35,7 @@ protected: class pc_joy_device : public device_t, public device_slot_interface { public: - pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); DECLARE_READ8_MEMBER(joy_port_r); DECLARE_WRITE8_MEMBER(joy_port_w); @@ -59,7 +55,7 @@ class pc_basic_joy_device : public device_t, public device_pc_joy_interface { public: - pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ioport_constructor device_input_ports() const override; virtual uint8_t x1(int delta) override { return (m_x1->read() > delta); } diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h index f9c7751658a..6e2cf9ce793 100644 --- a/src/devices/bus/vcs/vcs_slot.h +++ b/src/devices/bus/vcs/vcs_slot.h @@ -12,6 +12,7 @@ TYPE DEFINITIONS ***************************************************************************/ +#define A26SLOT_ROM_REGION_TAG ":cart:rom" /* PCB */ enum @@ -88,7 +89,16 @@ class vcs_cart_slot_device : public device_t, { public: // construction/destruction - vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template + vcs_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : vcs_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~vcs_cart_slot_device(); // image-level overrides @@ -145,17 +155,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(VCS_CART_SLOT, vcs_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define A26SLOT_ROM_REGION_TAG ":cart:rom" - - -#define MCFG_VCS_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, VCS_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - - #endif // MAME_BUS_VCS_VCS_SLOT_H diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h index d5665b40f58..7eaae126f4f 100644 --- a/src/devices/sound/astrocde.h +++ b/src/devices/sound/astrocde.h @@ -35,51 +35,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_ASTROCADE_IO_SI_READ_CB(_devcb) \ - downcast(*device).set_si_callback(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO0_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<0>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO1_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<1>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO2_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<2>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO3_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<3>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO4_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<4>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO5_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<5>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO6_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<6>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_SO7_STROBE_CB(_devcb) \ - downcast(*device).set_so_callback<7>(DEVCB_##_devcb); - -#define MCFG_ASTROCADE_IO_POT0(_tag) \ - downcast(*device).set_pot_tag<0>(_tag); - -#define MCFG_ASTROCADE_IO_POT1(_tag) \ - downcast(*device).set_pot_tag<1>(_tag); - -#define MCFG_ASTROCADE_IO_POT2(_tag) \ - downcast(*device).set_pot_tag<2>(_tag); - -#define MCFG_ASTROCADE_IO_POT3(_tag) \ - downcast(*device).set_pot_tag<3>(_tag); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -92,9 +47,9 @@ public: astrocade_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration access - template devcb_base &set_si_callback(Object &&cb) { return m_si_callback.set_callback(std::forward(cb)); } - template devcb_base &set_so_callback(Object &&cb) { return m_so_callback[N].set_callback(std::forward(cb)); } - template void set_pot_tag(const char *tag) { m_pots[N].set_tag(tag); } + auto si_cb() { return m_si_callback.bind(); } + template auto so_cb() { return m_so_callback[Bit].bind(); } + template void set_pot_tag(const char *tag) { m_pots[Pot].set_tag(tag); } protected: // device-level overrides diff --git a/src/devices/sound/es5506.h b/src/devices/sound/es5506.h index 0d4e6128576..38a006ea967 100644 --- a/src/devices/sound/es5506.h +++ b/src/devices/sound/es5506.h @@ -14,44 +14,6 @@ #define ES5506_MAKE_WAVS 0 -#define MCFG_ES5506_REGION0(_region) \ - downcast(*device).set_region0(_region); - -#define MCFG_ES5506_REGION1(_region) \ - downcast(*device).set_region1(_region); - -#define MCFG_ES5506_REGION2(_region) \ - downcast(*device).set_region2(_region); - -#define MCFG_ES5506_REGION3(_region) \ - downcast(*device).set_region3(_region); - -#define MCFG_ES5506_CHANNELS(_chan) \ - downcast(*device).set_channels(_chan); - -#define MCFG_ES5506_IRQ_CB(_devcb) \ - downcast(*device).set_irq_callback(DEVCB_##_devcb); - -#define MCFG_ES5506_READ_PORT_CB(_devcb) \ - downcast(*device).set_read_port_callback(DEVCB_##_devcb); - - -#define MCFG_ES5505_REGION0(_region) \ - downcast(*device).set_region0(_region); - -#define MCFG_ES5505_REGION1(_region) \ - downcast(*device).set_region1(_region); - -#define MCFG_ES5505_CHANNELS(_chan) \ - downcast(*device).set_channels(_chan); - -#define MCFG_ES5505_IRQ_CB(_devcb) \ - downcast(*device).set_irq_callback(DEVCB_##_devcb); - -#define MCFG_ES5505_READ_PORT_CB(_devcb) \ - downcast(*device).set_read_port_callback(DEVCB_##_devcb); - - class es550x_device : public device_t, public device_sound_interface { public: @@ -60,8 +22,6 @@ public: void set_region2(const char *region2) { m_region2 = region2; } void set_region3(const char *region3) { m_region3 = region3; } void set_channels(int channels) { m_channels = channels; } - template devcb_base &set_irq_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward(cb)); } - template devcb_base &set_read_port_callback(Object &&cb) { return m_read_port_cb.set_callback(std::forward(cb)); } auto irq_cb() { return m_irq_cb.bind(); } auto read_port_cb() { return m_read_port_cb.bind(); } diff --git a/src/devices/sound/qs1000.h b/src/devices/sound/qs1000.h index b5f1c4b6b12..237ef21b8e5 100644 --- a/src/devices/sound/qs1000.h +++ b/src/devices/sound/qs1000.h @@ -16,34 +16,6 @@ #include "cpu/mcs51/mcs51.h" #include "sound/okiadpcm.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_QS1000_EXTERNAL_ROM(_bool) \ - downcast(*device).set_external_rom(_bool); - -#define MCFG_QS1000_IN_P1_CB(_devcb) \ - downcast(*device).set_in_p1_callback(DEVCB_##_devcb); - -#define MCFG_QS1000_IN_P2_CB(_devcb) \ - downcast(*device).set_in_p2_callback(DEVCB_##_devcb); - -#define MCFG_QS1000_IN_P3_CB(_devcb) \ - downcast(*device).set_in_p3_callback(DEVCB_##_devcb); - -#define MCFG_QS1000_OUT_P1_CB(_devcb) \ - downcast(*device).set_out_p1_callback(DEVCB_##_devcb); - -#define MCFG_QS1000_OUT_P2_CB(_devcb) \ - downcast(*device).set_out_p2_callback(DEVCB_##_devcb); - -#define MCFG_QS1000_OUT_P3_CB(_devcb) \ - downcast(*device).set_out_p3_callback(DEVCB_##_devcb); - -/*#define MCFG_QS1000_SERIAL_W_CB(_devcb) \ - downcast(*device).set_serial_w_callback(DEVCB_##_devcb);*/ - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -59,13 +31,13 @@ public: qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_external_rom(bool external_rom) { m_external_rom = external_rom; } - template devcb_base &set_in_p1_callback(Object &&cb) { return m_in_p1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_in_p2_callback(Object &&cb) { return m_in_p2_cb.set_callback(std::forward(cb)); } - template devcb_base &set_in_p3_callback(Object &&cb) { return m_in_p3_cb.set_callback(std::forward(cb)); } - template devcb_base &set_out_p1_callback(Object &&cb) { return m_out_p1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_out_p2_callback(Object &&cb) { return m_out_p2_cb.set_callback(std::forward(cb)); } - template devcb_base &set_out_p3_callback(Object &&cb) { return m_out_p3_cb.set_callback(std::forward(cb)); } - //template devcb_base &set_serial_w_callback(Object &&cb) { return m_serial_w_cb.set_callback(std::forward(cb)); } + auto p1_in() { return m_in_p1_cb.bind(); } + auto p2_in() { return m_in_p2_cb.bind(); } + auto p3_in() { return m_in_p3_cb.bind(); } + auto p1_out() { return m_out_p1_cb.bind(); } + auto p2_out() { return m_out_p2_cb.bind(); } + auto p3_out() { return m_out_p3_cb.bind(); } + //auto serial_w() { return m_serial_w_cb.bind(); } // external void serial_in(uint8_t data); diff --git a/src/devices/sound/saa1099.h b/src/devices/sound/saa1099.h index 30df65988df..49e2007319f 100644 --- a/src/devices/sound/saa1099.h +++ b/src/devices/sound/saa1099.h @@ -9,21 +9,10 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_SAA1099_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, SAA1099, _clock) -#define MCFG_SAA1099_REPLACE(_tag, _clock) \ - MCFG_DEVICE_REPLACE(_tag, SAA1099, _clock) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** - // ======================> saa1099_device class saa1099_device : public device_t, diff --git a/src/devices/sound/t6721a.h b/src/devices/sound/t6721a.h index 4fd78923dd0..0342cbaad84 100644 --- a/src/devices/sound/t6721a.h +++ b/src/devices/sound/t6721a.h @@ -35,27 +35,6 @@ #pragma once - - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_T6721A_EOS_HANDLER(_eos) \ - downcast(device)->set_eos_callback(DEVCB_##_eos); - -#define MCFG_T6721A_PHI2_HANDLER(_phi2) \ - downcast(device)->set_phi2_callback(DEVCB_##_phi2); - -#define MCFG_T6721A_DTRD_HANDLER(_dtrd) \ - downcast(device)->set_dtrd_callback(DEVCB_##_dtrd); - -#define MCFG_T6721A_APD_HANDLER(_apd) \ - downcast(device)->set_apd_callback(DEVCB_##_apd); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -69,10 +48,6 @@ public: t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - template devcb_base &set_eos_callback(Object &&eos) { return m_write_eos.set_callback(std::forward(eos)); } - template devcb_base &set_phi2_callback(Object &&phi2) { return m_write_phi2.set_callback(std::forward(phi2)); } - template devcb_base &set_dtrd_callback(Object &&dtrd) { return m_write_dtrd.set_callback(std::forward(dtrd)); } - template devcb_base &set_apd_callback(Object &&apd) { return m_write_apd.set_callback(std::forward(apd)); } auto eos_handler() { return m_write_eos.bind(); } auto phi2_handler() { return m_write_phi2.bind(); } auto dtrd_handler() { return m_write_dtrd.bind(); } diff --git a/src/devices/sound/tc8830f.h b/src/devices/sound/tc8830f.h index 43784fd8f1f..f108eb72f69 100644 --- a/src/devices/sound/tc8830f.h +++ b/src/devices/sound/tc8830f.h @@ -12,17 +12,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TC8830F_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, TC8830F, _clock) - -#define MCFG_TC8830F_REPLACE(_tag, _clock) \ - MCFG_DEVICE_REPLACE(_tag, TC8830F, _clock) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/sound/tiaintf.h b/src/devices/sound/tiaintf.h index 8117c6f4672..36c5126ba04 100644 --- a/src/devices/sound/tiaintf.h +++ b/src/devices/sound/tiaintf.h @@ -5,16 +5,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_SOUND_TIA_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, TIA, _clock) -#define MCFG_SOUND_TIA_REPLACE(_tag, _clock) \ - MCFG_DEVICE_REPLACE(_tag, TIA, _clock) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/sound/tms3615.h b/src/devices/sound/tms3615.h index d96725c9c11..b3325ebc354 100644 --- a/src/devices/sound/tms3615.h +++ b/src/devices/sound/tms3615.h @@ -6,16 +6,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TMS3615_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, TMS3615, _clock) -#define MCFG_TMS3615_REPLACE(_tag, _clock) \ - MCFG_DEVICE_REPLACE(_tag, TMS3615, _clock) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/sound/upd7752.h b/src/devices/sound/upd7752.h index fe73763146b..4ec24ddfd72 100644 --- a/src/devices/sound/upd7752.h +++ b/src/devices/sound/upd7752.h @@ -6,13 +6,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_UPD7752_ADD(_tag,_freq) \ - MCFG_DEVICE_ADD(_tag, UPD7752, _freq) - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h index fbdde4e345e..6db01f9b096 100644 --- a/src/devices/sound/ymf278b.h +++ b/src/devices/sound/ymf278b.h @@ -8,16 +8,12 @@ #define YMF278B_STD_CLOCK (33868800) /* standard clock for OPL4 */ -#define MCFG_YMF278B_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - class ymf278b_device : public device_t, public device_sound_interface, public device_rom_interface { public: ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } auto irq_handler() { return m_irq_handler.bind(); } DECLARE_READ8_MEMBER( read ); diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h index df52c60206b..62c80b23ec9 100644 --- a/src/devices/sound/ymz280b.h +++ b/src/devices/sound/ymz280b.h @@ -15,16 +15,12 @@ #define YMZ280B_MAKE_WAVS 0 -#define MCFG_YMZ280B_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - class ymz280b_device : public device_t, public device_sound_interface, public device_rom_interface { public: ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } auto irq_handler() { return m_irq_handler.bind(); } DECLARE_READ8_MEMBER( read ); diff --git a/src/devices/video/ef9369.h b/src/devices/video/ef9369.h index 5a74e0179e0..ecea48d6122 100644 --- a/src/devices/video/ef9369.h +++ b/src/devices/video/ef9369.h @@ -29,19 +29,6 @@ #pragma once - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_EF9369_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, EF9369, 0) \ - -#define MCFG_EF9369_COLOR_UPDATE_CB(_class, _method) \ - downcast(*device).set_color_update_callback(ef9369_device::color_update_delegate(&_class::_method, #_class "::" #_method, this)); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -56,10 +43,20 @@ public: typedef device_delegate color_update_delegate; // construction/destruction - ef9369_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ef9369_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // configuration template void set_color_update_callback(Object &&cb) { m_color_update_cb = std::forward(cb); } + void set_color_update_callback(color_update_delegate callback) { m_color_update_cb = callback; } + template void set_color_update_callback(const char *devname, + void (FunctionClass::*callback)(int, bool, uint8_t, uint8_t, uint8_t), const char *name) + { + set_color_update_callback(color_update_delegate(callback, name, devname, static_cast(nullptr))); + } + template void set_color_update_callback(void (FunctionClass::*callback)(int, bool, uint8_t, uint8_t, uint8_t), const char *name) + { + set_color_update_callback(color_update_delegate(callback, name, nullptr, static_cast(nullptr))); + } DECLARE_READ8_MEMBER(data_r); DECLARE_WRITE8_MEMBER(data_w); diff --git a/src/mame/audio/taito_en.cpp b/src/mame/audio/taito_en.cpp index 05c8c5e9e09..ad037c092c1 100644 --- a/src/mame/audio/taito_en.cpp +++ b/src/mame/audio/taito_en.cpp @@ -196,43 +196,43 @@ WRITE8_MEMBER(taito_en_device::duart_output) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(taito_en_device::device_add_mconfig) - +void taito_en_device::device_add_mconfig(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("audiocpu", M68000, XTAL(30'476'100) / 2) - MCFG_DEVICE_PROGRAM_MAP(en_sound_map) + M68000(config, m_audiocpu, XTAL(30'476'100) / 2); + m_audiocpu->set_addrmap(AS_PROGRAM, &taito_en_device::en_sound_map); - MCFG_DEVICE_ADD("esp", ES5510, XTAL(10'000'000)) // from Gun Buster schematics - MCFG_DEVICE_DISABLE() + ES5510(config, m_esp, XTAL(10'000'000)); // from Gun Buster schematics + m_esp->set_disable(); - MCFG_DEVICE_ADD("duart68681", MC68681, XTAL(16'000'000) / 4) - MCFG_MC68681_SET_EXTERNAL_CLOCKS(XTAL(16'000'000)/2/8, XTAL(16'000'000)/2/16, XTAL(16'000'000)/2/16, XTAL(16'000'000)/2/8) - MCFG_MC68681_IRQ_CALLBACK(WRITELINE(*this, taito_en_device, duart_irq_handler)) - MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, taito_en_device, duart_output)) + MC68681(config, m_duart68681, XTAL(16'000'000) / 4); + m_duart68681->set_clocks(XTAL(16'000'000)/2/8, XTAL(16'000'000)/2/16, XTAL(16'000'000)/2/16, XTAL(16'000'000)/2/8); + m_duart68681->irq_cb().set(FUNC(taito_en_device::duart_irq_handler)); + m_duart68681->outport_cb().set(FUNC(taito_en_device::duart_output)); MB87078(config, m_mb87078); m_mb87078->gain_changed().set(FUNC(taito_en_device::mb87078_gain_changed)); - MCFG_DEVICE_ADD("dpram", MB8421, 0) // host accesses this from the other side + MB8421(config, "dpram", 0); // host accesses this from the other side /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("pump", ESQ_5505_5510_PUMP, XTAL(30'476'100) / (2 * 16 * 32)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("ensoniq", ES5505, XTAL(30'476'100) / 2) - MCFG_ES5505_REGION0("ensoniq.0") - MCFG_ES5505_REGION1("ensoniq.0") - MCFG_ES5505_CHANNELS(4) - MCFG_SOUND_ROUTE(0, "pump", 1.0, 0) - MCFG_SOUND_ROUTE(1, "pump", 1.0, 1) - MCFG_SOUND_ROUTE(2, "pump", 1.0, 2) - MCFG_SOUND_ROUTE(3, "pump", 1.0, 3) - MCFG_SOUND_ROUTE(4, "pump", 1.0, 4) - MCFG_SOUND_ROUTE(5, "pump", 1.0, 5) - MCFG_SOUND_ROUTE(6, "pump", 1.0, 6) - MCFG_SOUND_ROUTE(7, "pump", 1.0, 7) -MACHINE_CONFIG_END + ESQ_5505_5510_PUMP(config, m_pump, XTAL(30'476'100) / (2 * 16 * 32)); + m_pump->add_route(0, "lspeaker", 1.0); + m_pump->add_route(1, "rspeaker", 1.0); + + ES5505(config, m_ensoniq, XTAL(30'476'100) / 2); + m_ensoniq->set_region0("ensoniq.0"); + m_ensoniq->set_region1("ensoniq.0"); + m_ensoniq->set_channels(4); + m_ensoniq->add_route(0, "pump", 1.0, 0); + m_ensoniq->add_route(1, "pump", 1.0, 1); + m_ensoniq->add_route(2, "pump", 1.0, 2); + m_ensoniq->add_route(3, "pump", 1.0, 3); + m_ensoniq->add_route(4, "pump", 1.0, 4); + m_ensoniq->add_route(5, "pump", 1.0, 5); + m_ensoniq->add_route(6, "pump", 1.0, 6); + m_ensoniq->add_route(7, "pump", 1.0, 7); +} diff --git a/src/mame/drivers/a2600.cpp b/src/mame/drivers/a2600.cpp index f39261c5a50..f61101aa8a5 100644 --- a/src/mame/drivers/a2600.cpp +++ b/src/mame/drivers/a2600.cpp @@ -496,15 +496,17 @@ static void a2600_cart(device_slot_interface &device) device.option_add_internal("a26_harmony", A26_ROM_HARMONY); } -MACHINE_CONFIG_START(a2600_state::a2600_cartslot) - MCFG_VCS_CARTRIDGE_ADD("cartslot", a2600_cart, nullptr) +void a2600_state::a2600_cartslot(machine_config &config) +{ + VCS_CART_SLOT(config, "cartslot", a2600_cart, nullptr); /* software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","a2600") - MCFG_SOFTWARE_LIST_ADD("cass_list","a2600_cass") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("a2600"); + SOFTWARE_LIST(config, "cass_list").set_original("a2600_cass"); +} -MACHINE_CONFIG_START(a2600_state::a2600) +void a2600_state::a2600(machine_config &config) +{ /* basic machine hardware */ M6507(config, m_maincpu, MASTER_CLOCK_NTSC / 3); m_maincpu->disable_cache(); @@ -523,17 +525,16 @@ MACHINE_CONFIG_START(a2600_state::a2600) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK_NTSC/114) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) + TIA(config, "tia", MASTER_CLOCK_NTSC/114).add_route(ALL_OUTPUTS, "mono", 0.90); /* devices */ #if USE_NEW_RIOT - MCFG_DEVICE_ADD("riot", MOS6532n, MASTER_CLOCK_NTSC / 3) - MCFG_MOS6530n_IN_PA_CB(READ8(*this, a2600_state, switch_A_r)) - MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, a2600_state, switch_A_w)) - MCFG_MOS6530n_IN_PB_CB(READ8(*this, a2600_state, riot_input_port_8_r)) - MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w)) - MCFG_MOS6530n_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback)) + MOS6532_NEW(config, m_riot, MASTER_CLOCK_NTSC / 3); + m_riot->pa_rd_callback().set(FUNC(a2600_state::switch_A_r)); + m_riot->pa_wr_callback().set(FUNC(a2600_state::switch_A_w)); + m_riot->pb_rd_callback().set(FUNC(a2600_state::riot_input_port_8_r)); + m_riot->pb_wr_callback().set(FUNC(a2600_state::switch_B_w)); + m_riot->irq_wr_callback().set(FUNC(a2600_state::irq_callback)); #else RIOT6532(config, m_riot, MASTER_CLOCK_NTSC / 3); m_riot->in_pa_callback().set(FUNC(a2600_state::switch_A_r)); @@ -548,10 +549,11 @@ MACHINE_CONFIG_START(a2600_state::a2600) a2600_cartslot(config); subdevice("cart_list")->set_filter("NTSC"); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(a2600_state::a2600p) +void a2600_state::a2600p(machine_config &config) +{ /* basic machine hardware */ M6507(config, m_maincpu, MASTER_CLOCK_PAL / 3); m_maincpu->set_addrmap(AS_PROGRAM, &a2600_state::a2600_mem); @@ -570,17 +572,16 @@ MACHINE_CONFIG_START(a2600_state::a2600p) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK_PAL/114) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) + TIA(config, "tia", MASTER_CLOCK_PAL/114).add_route(ALL_OUTPUTS, "mono", 0.90); /* devices */ #if USE_NEW_RIOT - MCFG_DEVICE_ADD("riot", MOS6532n, MASTER_CLOCK_PAL / 3) - MCFG_MOS6530n_IN_PA_CB(READ8(*this, a2600_state, switch_A_r)) - MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, a2600_state, switch_A_w)) - MCFG_MOS6530n_IN_PB_CB(READ8(*this, a2600_state, riot_input_port_8_r)) - MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a2600_state, switch_B_w)) - MCFG_MOS6530n_IRQ_CB(WRITELINE(*this, a2600_state, irq_callback)) + MOS6532_NEW(config, m_riot, MASTER_CLOCK_PAL / 3); + m_riot->pa_rd_callback().set(FUNC(a2600_state::switch_A_r)); + m_riot->pa_wr_callback().set(FUNC(a2600_state::switch_A_w)); + m_riot->pb_rd_callback().set(FUNC(a2600_state::riot_input_port_8_r)); + m_riot->pb_wr_callback().set(FUNC(a2600_state::switch_B_w)); + m_riot->irq_wr_callback().set(FUNC(a2600_state::irq_callback)); #else RIOT6532(config, m_riot, MASTER_CLOCK_PAL / 3); m_riot->in_pa_callback().set(FUNC(a2600_state::switch_A_r)); @@ -595,7 +596,7 @@ MACHINE_CONFIG_START(a2600_state::a2600p) a2600_cartslot(config); subdevice("cart_list")->set_filter("PAL"); -MACHINE_CONFIG_END +} ROM_START( a2600 ) diff --git a/src/mame/drivers/a7800.cpp b/src/mame/drivers/a7800.cpp index fb27462e638..46894076830 100644 --- a/src/mame/drivers/a7800.cpp +++ b/src/mame/drivers/a7800.cpp @@ -1375,20 +1375,20 @@ void a7800_state::machine_reset() m_bios_enabled = 0; } -MACHINE_CONFIG_START(a7800_state::a7800_ntsc) +void a7800_state::a7800_ntsc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, A7800_NTSC_Y1/8) /* 1.79 MHz (switches to 1.19 MHz on TIA or RIOT access) */ - MCFG_DEVICE_PROGRAM_MAP(a7800_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a7800_state, interrupt, "screen", 0, 1) + M6502(config, m_maincpu, A7800_NTSC_Y1/8); /* 1.79 MHz (switches to 1.19 MHz on TIA or RIOT access) */ + m_maincpu->set_addrmap(AS_PROGRAM, &a7800_state::a7800_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a7800_state::interrupt), "screen", 0, 1); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS( 7159090, 454, 0, 320, 263, 27, 27 + 192 + 32 ) - MCFG_SCREEN_UPDATE_DEVICE("maria", atari_maria_device, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(7159090, 454, 0, 320, 263, 27, 27 + 192 + 32); + m_screen->set_screen_update("maria", FUNC(atari_maria_device::screen_update)); + m_screen->set_palette("palette"); - MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(a7800_palette)) - MCFG_PALETTE_INIT_OWNER(a7800_state, a7800) + PALETTE(config, "palette", ARRAY_LENGTH(a7800_palette)).set_init(FUNC(a7800_state::palette_init_a7800)); ATARI_MARIA(config, m_maria, 0); m_maria->set_dmacpu_tag(m_maincpu); @@ -1396,49 +1396,38 @@ MACHINE_CONFIG_START(a7800_state::a7800_ntsc) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_TIA_ADD("tia", 31400) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + TIA(config, "tia", 31400).add_route(ALL_OUTPUTS, "mono", 1.00); /* devices */ - MCFG_DEVICE_ADD("riot", MOS6532_NEW, A7800_NTSC_Y1/8) - MCFG_MOS6530n_IN_PA_CB(READ8(*this, a7800_state, riot_joystick_r)) - MCFG_MOS6530n_IN_PB_CB(READ8(*this, a7800_state, riot_console_button_r)) - MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a7800_state, riot_button_pullup_w)) + mos6532_new_device &riot(MOS6532_NEW(config, "riot", A7800_NTSC_Y1/8)); + riot.pa_rd_callback().set(FUNC(a7800_state::riot_joystick_r)); + riot.pb_rd_callback().set(FUNC(a7800_state::riot_console_button_r)); + riot.pb_wr_callback().set(FUNC(a7800_state::riot_button_pullup_w)); - MCFG_A78_CARTRIDGE_ADD("cartslot", a7800_cart, nullptr) + A78_CART_SLOT(config, "cartslot", a7800_cart, nullptr); /* software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","a7800") - MCFG_SOFTWARE_LIST_FILTER("cart_list","NTSC") -MACHINE_CONFIG_END - + SOFTWARE_LIST(config, "cart_list").set_original("a7800"); + subdevice("cart_list")->set_filter("NTSC"); +} -MACHINE_CONFIG_START(a7800_pal_state::a7800_pal) +void a7800_pal_state::a7800_pal(machine_config &config) +{ a7800_ntsc(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK(CLK_PAL) -// MCFG_TIMER_ADD_SCANLINE("scantimer", a7800_interrupt, "screen", 0, 1) + m_maincpu->set_clock(CLK_PAL); - MCFG_SCREEN_MODIFY( "screen" ) - MCFG_SCREEN_RAW_PARAMS( 7093788, 454, 0, 320, 313, 35, 35 + 228 + 32 ) + m_screen->set_raw(7093788, 454, 0, 320, 313, 35, 35 + 228 + 32); - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_INIT_OWNER(a7800_pal_state, a7800p) + subdevice("palette")->set_init(FUNC(a7800_pal_state::palette_init_a7800p)); /* devices */ - MCFG_DEVICE_REMOVE("riot") - MCFG_DEVICE_ADD("riot", MOS6532_NEW, CLK_PAL) - MCFG_MOS6530n_IN_PA_CB(READ8(*this, a7800_pal_state, riot_joystick_r)) - MCFG_MOS6530n_IN_PB_CB(READ8(*this, a7800_pal_state, riot_console_button_r)) - MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, a7800_pal_state, riot_button_pullup_w)) + subdevice("riot")->set_clock(CLK_PAL); /* software lists */ - MCFG_DEVICE_REMOVE("cart_list") - MCFG_SOFTWARE_LIST_ADD("cart_list","a7800") - MCFG_SOFTWARE_LIST_FILTER("cart_list","PAL") -MACHINE_CONFIG_END + subdevice("cart_list")->set_filter("PAL"); +} /*************************************************************************** diff --git a/src/mame/drivers/amstr_pc.cpp b/src/mame/drivers/amstr_pc.cpp index a5acfca485d..80129472ce9 100644 --- a/src/mame/drivers/amstr_pc.cpp +++ b/src/mame/drivers/amstr_pc.cpp @@ -532,7 +532,7 @@ MACHINE_CONFIG_START(amstrad_pc_state::pc200) PC_LPT(config, m_lpt2); m_lpt2->irq_handler().set("mb:pic8259", FUNC(pic8259_device::ir5_w)); - MCFG_PC_JOY_ADD("pc_joy") + PC_JOY(config, "pc_joy"); MCFG_PC_KEYB_ADD("pc_keyboard", WRITELINE("mb:pic8259", pic8259_device, ir1_w)) diff --git a/src/mame/drivers/asst128.cpp b/src/mame/drivers/asst128.cpp index 7901c900037..f857d084ae0 100644 --- a/src/mame/drivers/asst128.cpp +++ b/src/mame/drivers/asst128.cpp @@ -126,7 +126,7 @@ MACHINE_CONFIG_START(asst128_state::asst128) MCFG_FLOPPY_DRIVE_ADD("fdc:0", asst128_floppies, "525ssqd", asst128_state::asst128_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", asst128_floppies, "525ssqd", asst128_state::asst128_formats) - MCFG_PC_JOY_ADD("pc_joy") + PC_JOY(config, "pc_joy"); RAM(config, RAM_TAG).set_default_size("512K").set_extra_options("64K, 128K, 256K"); MACHINE_CONFIG_END diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp index aae7f09dbe9..21f8df3503e 100644 --- a/src/mame/drivers/astrocde.cpp +++ b/src/mame/drivers/astrocde.cpp @@ -1176,26 +1176,24 @@ static const z80_daisy_config tenpin_daisy_chain[] = * *************************************/ -MACHINE_CONFIG_START(astrocde_state::astrocade_base) - +void astrocde_state::astrocade_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, ASTROCADE_CLOCK/4) + Z80(config, m_maincpu, ASTROCADE_CLOCK/4); /* each game has its own map */ /* video hardware */ - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_INIT_OWNER(astrocde_state, astrocde) - - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240) - MCFG_SCREEN_DEFAULT_POSITION(1.1, 0.0, 1.18, -0.018) /* clip out borders */ - MCFG_SCREEN_UPDATE_DRIVER(astrocde_state, screen_update_astrocde) - MCFG_SCREEN_PALETTE("palette") - -MACHINE_CONFIG_END + PALETTE(config, m_palette, 512).set_init(FUNC(astrocde_state::palette_init_astrocde)); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240); + m_screen->set_default_position(1.1, 0.0, 1.18, -0.018); /* clip out borders */ + m_screen->set_screen_update(FUNC(astrocde_state::screen_update_astrocde)); + m_screen->set_palette(m_palette); +} -MACHINE_CONFIG_START(astrocde_state::astrocade_16color_base) +void astrocde_state::astrocade_16color_base(machine_config &config) +{ astrocade_base(config); /* basic machine hardware */ @@ -1204,44 +1202,41 @@ MACHINE_CONFIG_START(astrocde_state::astrocade_16color_base) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* video hardware */ - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(4096) + m_palette->set_entries(4096); + m_palette->set_init(FUNC(astrocde_state::palette_init_profpac)); - MCFG_PALETTE_INIT_OWNER(astrocde_state,profpac) MCFG_VIDEO_START_OVERRIDE(astrocde_state,profpac) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(astrocde_state, screen_update_profpac) -MACHINE_CONFIG_END - + m_screen->set_screen_update(FUNC(astrocde_state::screen_update_profpac)); +} -MACHINE_CONFIG_START(astrocde_state::astrocade_mono_sound) +void astrocde_state::astrocade_mono_sound(machine_config &config) +{ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - + ASTROCADE_IO(config, m_astrocade_sound1, ASTROCADE_CLOCK/4); + m_astrocade_sound1->si_cb().set(FUNC(astrocde_state::input_mux_r)); + m_astrocade_sound1->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(astrocde_state::astrocade_stereo_sound) +void astrocde_state::astrocade_stereo_sound(machine_config &config) +{ /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) - MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + ASTROCADE_IO(config, m_astrocade_sound1, ASTROCADE_CLOCK/4); + m_astrocade_sound1->si_cb().set(FUNC(astrocde_state::input_mux_r)); + m_astrocade_sound1->so_cb<0>().set("watchdog", FUNC(watchdog_timer_device::reset_w)); + m_astrocade_sound1->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - MCFG_DEVICE_ADD("astrocade2", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + ASTROCADE_IO(config, "astrocade2", ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "rspeaker", 1.0); WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // MC14024B on CPU board at U18, CLK = VERTDR, Q7 used for RESET -MACHINE_CONFIG_END +} @@ -1251,13 +1246,13 @@ MACHINE_CONFIG_END * *************************************/ -MACHINE_CONFIG_START(seawolf2_state::seawolf2) +void seawolf2_state::seawolf2(machine_config &config) +{ astrocade_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(seawolf2_map) - MCFG_DEVICE_IO_MAP(port_map_discrete) + m_maincpu->set_addrmap(AS_PROGRAM, &seawolf2_state::seawolf2_map); + m_maincpu->set_addrmap(AS_IO, &seawolf2_state::port_map_discrete); output_latch_device &lamplatch1(OUTPUT_LATCH(config, "lamplatch1")); // 74174 on game board at N2 lamplatch1.bit_handler<0>().set_output("lamp6"); // right player torpedo 4 available @@ -1281,66 +1276,62 @@ MACHINE_CONFIG_START(seawolf2_state::seawolf2) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(10) /* 5*2 channels */ - MCFG_SAMPLES_NAMES(seawolf_sample_names) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(1, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(2, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(3, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(4, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(5, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(6, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(7, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(8, "rspeaker", 0.25) - MCFG_SOUND_ROUTE(9, "rspeaker", 0.25) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(ebases_state::ebases) + SAMPLES(config, m_samples); + m_samples->set_channels(10); /* 5*2 channels */ + m_samples->set_samples_names(seawolf_sample_names); + m_samples->add_route(0, "lspeaker", 0.25); + m_samples->add_route(1, "lspeaker", 0.25); + m_samples->add_route(2, "lspeaker", 0.25); + m_samples->add_route(3, "lspeaker", 0.25); + m_samples->add_route(4, "lspeaker", 0.25); + m_samples->add_route(5, "rspeaker", 0.25); + m_samples->add_route(6, "rspeaker", 0.25); + m_samples->add_route(7, "rspeaker", 0.25); + m_samples->add_route(8, "rspeaker", 0.25); + m_samples->add_route(9, "rspeaker", 0.25); +} + +void ebases_state::ebases(machine_config &config) +{ astrocade_base(config); astrocade_mono_sound(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ebases_map) - MCFG_DEVICE_IO_MAP(port_map_ebases) + m_maincpu->set_addrmap(AS_PROGRAM, &ebases_state::ebases_map); + m_maincpu->set_addrmap(AS_IO, &ebases_state::port_map_ebases); - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO1_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) + m_astrocade_sound1->so_cb<1>().set("watchdog", FUNC(watchdog_timer_device::reset_w)); WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // MC14024 on CPU board at U18, CLK = VERTDR, Q7 used for RESET -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(astrocde_state::spacezap) +void astrocde_state::spacezap(machine_config &config) +{ astrocade_base(config); astrocade_mono_sound(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(spacezap_map) - MCFG_DEVICE_IO_MAP(port_map_mono_pattern) + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_state::spacezap_map); + m_maincpu->set_addrmap(AS_IO, &astrocde_state::port_map_mono_pattern); - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) - MCFG_ASTROCADE_IO_SO3_STROBE_CB(WRITE8("outlatch", output_latch_device, bus_w)) + m_astrocade_sound1->so_cb<0>().set("watchdog", FUNC(watchdog_timer_device::reset_w)); + m_astrocade_sound1->so_cb<3>().set("outlatch", FUNC(output_latch_device::bus_w)); - MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // MC14174B on game board at U16 - MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + output_latch_device &outlatch(OUTPUT_LATCH(config, "outlatch", 0)); // MC14174B on game board at U16 + outlatch.bit_handler<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.bit_handler<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // MC14024 on CPU board at U18, CLK = VERTDR, Q7 used for RESET -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(astrocde_state::wow) +void astrocde_state::wow(machine_config &config) +{ astrocade_base(config); astrocade_stereo_sound(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(wow_map) - MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_state::wow_map); + m_maincpu->set_addrmap(AS_IO, &astrocde_state::port_map_stereo_pattern); cd4099_device &outlatch(CD4099(config, "outlatch")); outlatch.q_out_cb<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); @@ -1352,29 +1343,26 @@ MACHINE_CONFIG_START(astrocde_state::wow) outlatch.q_out_cb<7>().set(FUNC(astrocde_state::coin_counter_w<2>)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_DEFAULT_POSITION(1.0, 0.0, 1.0, 0.0) /* adjusted to match screenshots */ -// MCFG_SCREEN_DEFAULT_POSITION(1.066, -0.004, 1.048, -0.026) /* adjusted to match flyer */ + m_screen->set_default_position(1.0, 0.0, 1.0, 0.0); /* adjusted to match screenshots */ +// m_screen->set_default_position(1.066, -0.004, 1.048, -0.026); /* adjusted to match flyer */ /* sound hardware */ SPEAKER(config, "center").front_center(); - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) - MCFG_ASTROCADE_IO_SO7_STROBE_CB(WRITE8(*this, astrocde_state, votrax_speech_w)) - - MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "center", 0.85) -MACHINE_CONFIG_END + m_astrocade_sound1->so_cb<5>().set("outlatch", FUNC(cd4099_device::write_nibble_d0)); + m_astrocade_sound1->so_cb<7>().set(FUNC(astrocde_state::votrax_speech_w)); + VOTRAX_SC01(config, m_votrax, 720000); + m_votrax->add_route(ALL_OUTPUTS, "center", 0.85); +} -MACHINE_CONFIG_START(astrocde_state::gorf) +void astrocde_state::gorf(machine_config &config) +{ astrocade_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(wow_map) - MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_state::wow_map); + m_maincpu->set_addrmap(AS_IO, &astrocde_state::port_map_stereo_pattern); cd4099_device &outlatch(CD4099(config, "outlatch")); // MC14099B on game board at U6 outlatch.q_out_cb<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); @@ -1399,37 +1387,34 @@ MACHINE_CONFIG_START(astrocde_state::gorf) WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // MC14024 on CPU board at U18, CLK = VERTDR, Q7 used for RESET /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_DEFAULT_POSITION(1.0, 0.0, 1.0, 0.0) /* adjusted to match flyer */ + m_screen->set_default_position(1.0, 0.0, 1.0, 0.0); /* adjusted to match flyer */ /* sound hardware */ SPEAKER(config, "upper", 0.0, 0.0, 1.0); SPEAKER(config, "lower", 0.0, -0.5, 1.0); - MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) - MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) - MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) - MCFG_ASTROCADE_IO_SO6_STROBE_CB(WRITE8("lamplatch", cd4099_device, write_nibble_d0)) - MCFG_ASTROCADE_IO_SO7_STROBE_CB(WRITE8(*this, astrocde_state, votrax_speech_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 1.0) - - MCFG_DEVICE_ADD("astrocade2", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lower", 1.0) + ASTROCADE_IO(config, m_astrocade_sound1, ASTROCADE_CLOCK/4); + m_astrocade_sound1->si_cb().set(FUNC(astrocde_state::input_mux_r)); + m_astrocade_sound1->so_cb<0>().set("watchdog", FUNC(watchdog_timer_device::reset_w)); + m_astrocade_sound1->so_cb<5>().set("outlatch", FUNC(cd4099_device::write_nibble_d0)); + m_astrocade_sound1->so_cb<6>().set("lamplatch", FUNC(cd4099_device::write_nibble_d0)); + m_astrocade_sound1->so_cb<7>().set(FUNC(astrocde_state::votrax_speech_w)); + m_astrocade_sound1->add_route(ALL_OUTPUTS, "upper", 1.0); - MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 0.85) -MACHINE_CONFIG_END + ASTROCADE_IO(config, "astrocade2", ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "lower", 1.0); + VOTRAX_SC01(config, m_votrax, 720000); + m_votrax->add_route(ALL_OUTPUTS, "upper", 0.85); +} -MACHINE_CONFIG_START(astrocde_state::robby) +void astrocde_state::robby(machine_config &config) +{ astrocade_base(config); astrocade_stereo_sound(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(robby_map) - MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_state::robby_map); + m_maincpu->set_addrmap(AS_IO, &astrocde_state::port_map_stereo_pattern); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // HM6116LP-4 + battery @@ -1440,73 +1425,67 @@ MACHINE_CONFIG_START(astrocde_state::robby) outlatch.q_out_cb<6>().set_output("led0"); outlatch.q_out_cb<7>().set_output("led1"); - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) -MACHINE_CONFIG_END - + m_astrocade_sound1->so_cb<5>().set("outlatch", FUNC(cd4099_device::write_nibble_d0)); +} -MACHINE_CONFIG_START(astrocde_state::profpac) +void astrocde_state::profpac(machine_config &config) +{ astrocade_16color_base(config); astrocade_stereo_sound(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(profpac_map) - MCFG_DEVICE_IO_MAP(port_map_16col_pattern) + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_state::profpac_map); + m_maincpu->set_addrmap(AS_IO, &astrocde_state::port_map_16col_pattern); m_bank4000->set_map(&astrocde_state::profpac_bank4000_map); m_bank4000->set_addr_width(20); - MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // 74LS174 on game board at U6 - MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) - MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("led0")) - MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("led1")) - - MCFG_DEVICE_ADD("lamplatch", OUTPUT_LATCH, 0) // 74LS174 on game board at U7 - MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp0")) // left lamp A - MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp1")) // left lamp B - MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp2")) // left lamp C - MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp3")) // right lamp A - MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp4")) // right lamp B - MCFG_OUTPUT_LATCH_BIT6_HANDLER(OUTPUT("lamp5")) // right lamp C - - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO4_STROBE_CB(WRITE8("outlatch", output_latch_device, bus_w)) - MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("lamplatch", output_latch_device, bus_w)) -MACHINE_CONFIG_END - + output_latch_device &outlatch(OUTPUT_LATCH(config, "outlatch", 0)); // 74LS174 on game board at U6 + outlatch.bit_handler<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.bit_handler<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); + outlatch.bit_handler<2>().set_output("led0"); + outlatch.bit_handler<3>().set_output("led1"); + + output_latch_device &lamplatch(OUTPUT_LATCH(config, "lamplatch", 0)); // 74LS174 on game board at U7 + lamplatch.bit_handler<0>().set_output("lamp0"); // left lamp A + lamplatch.bit_handler<1>().set_output("lamp1"); // left lamp B + lamplatch.bit_handler<2>().set_output("lamp2"); // left lamp C + lamplatch.bit_handler<4>().set_output("lamp3"); // right lamp A + lamplatch.bit_handler<5>().set_output("lamp4"); // right lamp B + lamplatch.bit_handler<6>().set_output("lamp5"); // right lamp C + + m_astrocade_sound1->so_cb<4>().set("outlatch", FUNC(output_latch_device::bus_w)); + m_astrocade_sound1->so_cb<5>().set("lamplatch", FUNC(output_latch_device::bus_w)); +} -MACHINE_CONFIG_START(demndrgn_state::demndrgn) +void demndrgn_state::demndrgn(machine_config &config) +{ astrocade_16color_base(config); astrocade_mono_sound(config); // used only for I/O /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(demndrgn_map) - MCFG_DEVICE_IO_MAP(port_map_16col_pattern_demndrgn) - - MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) - MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) - MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("led0")) - MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("led1")) - MCFG_OUTPUT_LATCH_BIT4_HANDLER(WRITELINE(*this, demndrgn_state, input_select_w)) - - MCFG_DEVICE_MODIFY("astrocade1") - MCFG_ASTROCADE_IO_SO4_STROBE_CB(WRITE8("outlatch", output_latch_device, bus_w)) - MCFG_ASTROCADE_IO_POT0("FIREX") - MCFG_ASTROCADE_IO_POT1("FIREY") -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &demndrgn_state::demndrgn_map); + m_maincpu->set_addrmap(AS_IO, &demndrgn_state::port_map_16col_pattern_demndrgn); + + output_latch_device &outlatch(OUTPUT_LATCH(config, "outlatch", 0)); + outlatch.bit_handler<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.bit_handler<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); + outlatch.bit_handler<2>().set_output("led0"); + outlatch.bit_handler<3>().set_output("led1"); + outlatch.bit_handler<4>().set(FUNC(demndrgn_state::input_select_w)); + + m_astrocade_sound1->so_cb<4>().set("outlatch", FUNC(output_latch_device::bus_w)); + m_astrocade_sound1->set_pot_tag<0>("FIREX"); + m_astrocade_sound1->set_pot_tag<1>("FIREY"); +} -MACHINE_CONFIG_START(tenpindx_state::tenpindx) +void tenpindx_state::tenpindx(machine_config &config) +{ astrocade_16color_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(profpac_map) - MCFG_DEVICE_IO_MAP(port_map_16col_pattern_tenpindx) + m_maincpu->set_addrmap(AS_PROGRAM, &tenpindx_state::profpac_map); + m_maincpu->set_addrmap(AS_IO, &tenpindx_state::port_map_16col_pattern_tenpindx); Z80(config, m_subcpu, ASTROCADE_CLOCK/4); /* real clock unknown */ m_subcpu->set_daisy_config(tenpin_daisy_chain); @@ -1525,7 +1504,7 @@ MACHINE_CONFIG_START(tenpindx_state::tenpindx) ay8912_device &aysnd(AY8912(config, "aysnd", ASTROCADE_CLOCK/4)); /* real clock unknown */ aysnd.port_a_read_callback().set_ioport("DIPSW"); aysnd.add_route(ALL_OUTPUTS, "mono", 0.33); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/astrohome.cpp b/src/mame/drivers/astrohome.cpp index 5710f8b964b..8284bd1312f 100644 --- a/src/mame/drivers/astrohome.cpp +++ b/src/mame/drivers/astrohome.cpp @@ -22,10 +22,10 @@ #include "speaker.h" -class astrocde_mess_state : public astrocde_state +class astrocde_home_state : public astrocde_state { public: - astrocde_mess_state(const machine_config &mconfig, device_type type, const char *tag) + astrocde_home_state(const machine_config &mconfig, device_type type, const char *tag) : astrocde_state(mconfig, type, tag) , m_cart(*this, "cartslot") , m_exp(*this, "exp") @@ -59,16 +59,16 @@ private: * *********************************************************************************/ -void astrocde_mess_state::astrocade_mem(address_map &map) +void astrocde_home_state::astrocade_mem(address_map &map) { - map(0x0000, 0x0fff).rom().w(FUNC(astrocde_mess_state::astrocade_funcgen_w)); + map(0x0000, 0x0fff).rom().w(FUNC(astrocde_home_state::astrocade_funcgen_w)); map(0x1000, 0x3fff).rom(); /* Star Fortress writes in here?? */ map(0x4000, 0x4fff).ram().share("videoram"); /* ASG */ //AM_RANGE(0x5000, 0xffff) AM_DEVREADWRITE("exp", astrocade_exp_device, read, write) } -void astrocde_mess_state::astrocade_io(address_map &map) +void astrocde_home_state::astrocade_io(address_map &map) { map(0x00, 0x0f).select(0xff00).rw(FUNC(astrocde_state::video_register_r), FUNC(astrocde_state::video_register_w)); map(0x10, 0x1f).select(0xff00).r("astrocade1", FUNC(astrocade_io_device::read)); @@ -99,7 +99,7 @@ void astrocde_mess_state::astrocade_io(address_map &map) * *************************************/ -READ8_MEMBER(astrocde_mess_state::inputs_r) +READ8_MEMBER(astrocde_home_state::inputs_r) { if (BIT(offset, 2)) return m_keypad[offset & 3]->read(); @@ -214,42 +214,42 @@ static void astrocade_exp(device_slot_interface &device) } -MACHINE_CONFIG_START(astrocde_mess_state::astrocde) +void astrocde_home_state::astrocde(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, ASTROCADE_CLOCK/4) /* 1.789 MHz */ - MCFG_DEVICE_PROGRAM_MAP(astrocade_mem) - MCFG_DEVICE_IO_MAP(astrocade_io) + Z80(config, m_maincpu, ASTROCADE_CLOCK/4); /* 1.789 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_home_state::astrocade_mem); + m_maincpu->set_addrmap(AS_IO, &astrocde_home_state::astrocade_io); - MCFG_MACHINE_START_OVERRIDE(astrocde_mess_state, astrocde) + MCFG_MACHINE_START_OVERRIDE(astrocde_home_state, astrocde) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240) - MCFG_SCREEN_UPDATE_DRIVER(astrocde_state, screen_update_astrocde) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240); + m_screen->set_screen_update(FUNC(astrocde_state::screen_update_astrocde)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_INIT_OWNER(astrocde_state, astrocde) + PALETTE(config, m_palette, 512).set_init(FUNC(astrocde_state::palette_init_astrocde)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) - MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_mess_state, inputs_r)) - MCFG_ASTROCADE_IO_POT0("P1_KNOB") - MCFG_ASTROCADE_IO_POT1("P2_KNOB") - MCFG_ASTROCADE_IO_POT2("P3_KNOB") - MCFG_ASTROCADE_IO_POT3("P4_KNOB") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ASTROCADE_IO(config, m_astrocade_sound1, ASTROCADE_CLOCK/4); + m_astrocade_sound1->si_cb().set(FUNC(astrocde_home_state::inputs_r)); + m_astrocade_sound1->set_pot_tag<0>("P1_KNOB"); + m_astrocade_sound1->set_pot_tag<1>("P2_KNOB"); + m_astrocade_sound1->set_pot_tag<2>("P3_KNOB"); + m_astrocade_sound1->set_pot_tag<3>("P4_KNOB"); + m_astrocade_sound1->add_route(ALL_OUTPUTS, "mono", 1.0); /* expansion port */ - MCFG_ASTROCADE_EXPANSION_SLOT_ADD("exp", astrocade_exp, nullptr) + ASTROCADE_EXP_SLOT(config, m_exp, astrocade_exp, nullptr); /* cartridge */ - MCFG_ASTROCADE_CARTRIDGE_ADD("cartslot", astrocade_cart, nullptr) + ASTROCADE_CART_SLOT(config, m_cart, astrocade_cart, nullptr); /* Software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","astrocde") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("astrocde"); +} /************************************* @@ -284,7 +284,7 @@ void astrocde_state::init_astrocde() m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS; } -MACHINE_START_MEMBER(astrocde_mess_state, astrocde) +MACHINE_START_MEMBER(astrocde_home_state, astrocde) { if (m_cart->exists()) m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x3fff, read8_delegate(FUNC(astrocade_cart_slot_device::read_rom),(astrocade_cart_slot_device*)m_cart)); @@ -302,6 +302,6 @@ MACHINE_START_MEMBER(astrocde_mess_state, astrocde) *************************************/ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -CONS( 1978, astrocde, 0, 0, astrocde, astrocde, astrocde_mess_state, init_astrocde, "Bally Manufacturing", "Bally Professional Arcade", MACHINE_SUPPORTS_SAVE ) -CONS( 1977, astrocdl, astrocde, 0, astrocde, astrocde, astrocde_mess_state, init_astrocde, "Bally Manufacturing", "Bally Home Library Computer", MACHINE_SUPPORTS_SAVE ) -CONS( 1977, astrocdw, astrocde, 0, astrocde, astrocde, astrocde_mess_state, init_astrocde, "Bally Manufacturing", "Bally Computer System", MACHINE_SUPPORTS_SAVE ) +CONS( 1978, astrocde, 0, 0, astrocde, astrocde, astrocde_home_state, init_astrocde, "Bally Manufacturing", "Bally Professional Arcade", MACHINE_SUPPORTS_SAVE ) +CONS( 1977, astrocdl, astrocde, 0, astrocde, astrocde, astrocde_home_state, init_astrocde, "Bally Manufacturing", "Bally Home Library Computer", MACHINE_SUPPORTS_SAVE ) +CONS( 1977, astrocdw, astrocde, 0, astrocde, astrocde, astrocde_home_state, init_astrocde, "Bally Manufacturing", "Bally Computer System", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/bingor.cpp b/src/mame/drivers/bingor.cpp index e8af5057551..d8b6b5e6e7b 100644 --- a/src/mame/drivers/bingor.cpp +++ b/src/mame/drivers/bingor.cpp @@ -691,39 +691,37 @@ static GFXDECODE_START( gfx_bingor ) GFXDECODE_END -MACHINE_CONFIG_START(bingor_state::bingor) - MCFG_DEVICE_ADD("maincpu", I80186, XTAL(16'000'000)) - MCFG_DEVICE_PROGRAM_MAP(bingor_map) - MCFG_DEVICE_IO_MAP(bingor_io) - MCFG_DEVICE_PERIODIC_INT_DRIVER(bingor_state, nmi_line_pulse, 30) +void bingor_state::bingor(machine_config &config) +{ + I80186(config, m_maincpu, XTAL(16'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &bingor_state::bingor_map); + m_maincpu->set_addrmap(AS_IO, &bingor_state::bingor_io); + m_maincpu->set_periodic_int(FUNC(bingor_state::nmi_line_pulse), attotime::from_hz(30)); // Other interrupts generated by internal timers - MCFG_DEVICE_ADD("pic", PIC16C57, 12000000) //?? Mhz + PIC16C57(config, "pic", 12000000); //?? Mhz - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bingor) + GFXDECODE(config, "gfxdecode", m_palette, gfx_bingor); // NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 400-1, 0, 300-1) - MCFG_SCREEN_UPDATE_DRIVER(bingor_state, screen_update_bingor) + 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(400, 300); + screen.set_visarea(0, 400-1, 0, 300-1); + screen.set_screen_update(FUNC(bingor_state::screen_update_bingor)); - MCFG_PALETTE_ADD("palette", 0x100) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBIIII) + PALETTE(config, m_palette, 0x100).set_format(PALETTE_FORMAT_RRRRGGGGBBBBIIII); SPEAKER(config, "mono").front_center(); - MCFG_SAA1099_ADD("saa", 6000000 ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAA1099(config, "saa", 6000000).add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(bingor_state::bingor2) +void bingor_state::bingor2(machine_config &config) +{ bingor(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(bingor2_map) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &bingor_state::bingor2_map); +} void bingor_state::vip2000_map(address_map &map) { @@ -780,36 +778,36 @@ void bingor_state::slave_io(address_map &map) map(0xc000, 0xcfff).ram(); } -MACHINE_CONFIG_START(bingor_state::vip2000) - MCFG_DEVICE_ADD("maincpu", I80186, XTAL(10'000'000)) - MCFG_DEVICE_PROGRAM_MAP(vip2000_map) - MCFG_DEVICE_IO_MAP(vip2000_io) - MCFG_DEVICE_PERIODIC_INT_DRIVER(bingor_state, nmi_line_pulse, 30) +void bingor_state::vip2000(machine_config &config) +{ + I80186(config, m_maincpu, XTAL(10'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &bingor_state::vip2000_map); + m_maincpu->set_addrmap(AS_IO, &bingor_state::vip2000_io); + m_maincpu->set_periodic_int(FUNC(bingor_state::nmi_line_pulse), attotime::from_hz(30)); // Other interrupts generated by internal timers ATMEL_49F4096(config, "flash"); - MCFG_DEVICE_ADD("slavecpu", I80C31, XTAL(11'059'200)) - MCFG_DEVICE_PROGRAM_MAP(slave_map) - MCFG_DEVICE_IO_MAP(slave_io) + I80C31(config, m_slavecpu, XTAL(11'059'200)); + m_slavecpu->set_addrmap(AS_PROGRAM, &bingor_state::slave_map); + m_slavecpu->set_addrmap(AS_IO, &bingor_state::slave_io); - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) + MSM6242(config, "rtc", XTAL(32'768)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 400-1, 0, 300-1) - MCFG_SCREEN_UPDATE_DRIVER(bingor_state, screen_update_bingor) + 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(400, 300); + screen.set_visarea(0, 400-1, 0, 300-1); + screen.set_screen_update(FUNC(bingor_state::screen_update_bingor)); - MCFG_PALETTE_ADD("palette", 0x100) - MCFG_PALETTE_FORMAT(RRRRGGGGBBBBIIII) + PALETTE(config, m_palette, 0x100).set_format(PALETTE_FORMAT_RRRRGGGGBBBBIIII); SPEAKER(config, "mono").front_center(); ymz284_device &ymz(YMZ284(config, "ymz", 1250000)); // probably clocked by square wave output of 80186 timer 0 ymz.add_route(ALL_OUTPUTS, "mono", 0.50); -MACHINE_CONFIG_END +} // I doubt we need to load the eeproms diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp index 76ec087042e..e64a90d1878 100644 --- a/src/mame/drivers/bishi.cpp +++ b/src/mame/drivers/bishi.cpp @@ -445,26 +445,26 @@ void bishi_state::machine_reset() m_cur_control2 = 0; } -MACHINE_CONFIG_START(bishi_state::bishi) - +void bishi_state::bishi(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, CPU_CLOCK) /* 12MHz (24MHz OSC / 2 ) */ - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bishi_state, bishi_scanline, "screen", 0, 1) + M68000(config, m_maincpu, CPU_CLOCK); /* 12MHz (24MHz OSC / 2 ) */ + m_maincpu->set_addrmap(AS_PROGRAM, &bishi_state::main_map); + TIMER(config, "scantimer").configure_scanline(FUNC(bishi_state::bishi_scanline), "screen", 0, 1); /* 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(1200)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(29, 29+288-1, 16, 16+224-1) - MCFG_SCREEN_UPDATE_DRIVER(bishi_state, screen_update_bishi) - - MCFG_PALETTE_ADD("palette", 4096) - MCFG_PALETTE_FORMAT(XBGR) - MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_PALETTE_ENABLE_HILIGHTS() + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1200)); + m_screen->set_size(64*8, 32*8); + m_screen->set_visarea(29, 29+288-1, 16, 16+224-1); + m_screen->set_screen_update(FUNC(bishi_state::screen_update_bishi)); + + PALETTE(config, m_palette, 4096); + m_palette->set_format(PALETTE_FORMAT_XBGR); + m_palette->enable_shadows(); + m_palette->enable_hilights(); K056832(config, m_k056832, 0); m_k056832->set_tile_callback(FUNC(bishi_state::tile_callback), this); @@ -480,11 +480,11 @@ MACHINE_CONFIG_START(bishi_state::bishi) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymz", YMZ280B, SOUND_CLOCK) /* 16.9344MHz */ - MCFG_YMZ280B_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_1)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + ymz280b_device &ymz(YMZ280B(config, "ymz", SOUND_CLOCK)); /* 16.9344MHz */ + ymz.irq_handler().set_inputline("maincpu", M68K_IRQ_1); + ymz.add_route(0, "lspeaker", 1.0); + ymz.add_route(1, "rspeaker", 1.0); +} void bishi_state::dobouchn(machine_config &config) { diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp index 9a330ed5756..80290b35841 100644 --- a/src/mame/drivers/blitz68k.cpp +++ b/src/mame/drivers/blitz68k.cpp @@ -1964,7 +1964,6 @@ MACHINE_CONFIG_START(blitz68k_state::hermit) MCFG_VIDEO_START_OVERRIDE(blitz68k_state,blitz68k) MACHINE_CONFIG_END - MACHINE_CONFIG_START(blitz68k_state::maxidbl) MCFG_DEVICE_ADD(m_maincpu, M68000, XTAL(11'059'200)) MCFG_DEVICE_PROGRAM_MAP(maxidbl_map) @@ -1996,9 +1995,8 @@ MACHINE_CONFIG_START(blitz68k_state::maxidbl) ramdac_config(config); SPEAKER(config, "mono").front_center(); - MCFG_SAA1099_ADD("saa", XTAL(8'000'000)/2) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAA1099(config, "saa", XTAL(8'000'000)/2).add_route(ALL_OUTPUTS, "mono", 1.0); +} /************************************************************************************************************* diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp index 855ae2f1248..7d564233867 100644 --- a/src/mame/drivers/cave.cpp +++ b/src/mame/drivers/cave.cpp @@ -2010,278 +2010,215 @@ void cave_state::machine_reset() m_agallet_vblank_irq = 0; } +void cave_state::add_base_config(machine_config &config) +{ + M68000(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_vblank_int("screen", FUNC(cave_state::interrupt)); + + TIMER(config, m_int_timer).configure_generic(FUNC(cave_state::vblank_start)); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(15625/271.5); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(320, 240); + m_screen->set_visarea(0, 320-1, 0, 240-1); + m_screen->set_screen_update(FUNC(cave_state::screen_update)); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(FUNC(cave_state::palette_init_cave)); +} + +void cave_state::add_ymz(machine_config &config) +{ + SPEAKER(config, "mono").front_center(); + + ymz280b_device &ymz(YMZ280B(config, "ymz", 16.9344_MHz_XTAL)); + ymz.irq_handler().set(FUNC(cave_state::sound_irq_gen)); + ymz.add_route(ALL_OUTPUTS, "mono", 1.0); +} + /*************************************************************************** Dangun Feveron ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::dfeveron) +void cave_state::dfeveron(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(dfeveron_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::dfeveron_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_dfeveron); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_dfeveron)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_2_layers) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** Dodonpachi ***************************************************************************/ - -MACHINE_CONFIG_START(cave_state::ddonpach) +void cave_state::ddonpach(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(ddonpach_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::ddonpach_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_ddonpach); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** Donpachi ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::donpachi) +void cave_state::donpachi(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(donpachi_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::donpachi_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_donpachi); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_dfeveron)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("oki1", OKIM6295, 4.224_MHz_XTAL/4, okim6295_device::PIN7_HIGH) // pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.60) + OKIM6295(config, m_oki[0], 4.224_MHz_XTAL/4, okim6295_device::PIN7_HIGH); // pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.60); - MCFG_DEVICE_ADD("oki2", OKIM6295, 4.224_MHz_XTAL/2, okim6295_device::PIN7_HIGH) // pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + OKIM6295(config, m_oki[1], 4.224_MHz_XTAL/2, okim6295_device::PIN7_HIGH); // pin 7 not verified + m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); nmk112.set_page_mask(1 << 0); // chip #0 (music) is not paged -MACHINE_CONFIG_END +} /*************************************************************************** Esprade ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::esprade) +void cave_state::esprade(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(esprade_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::esprade_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** Gaia Crusaders ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::gaia) +void cave_state::gaia(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(gaia_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::gaia_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_visarea(0, 320-1, 0, 224-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** Guwange ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::guwange) +void cave_state::guwange(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(guwange_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::guwange_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** Hotdog Storm ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::hotdogst) +void cave_state::hotdogst(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL/2) - MCFG_DEVICE_PROGRAM_MAP(hotdogst_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_clock(32_MHz_XTAL/2); + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::hotdogst_map); - MCFG_DEVICE_ADD("audiocpu", Z80, 32_MHz_XTAL/8) - MCFG_DEVICE_PROGRAM_MAP(hotdogst_sound_map) - MCFG_DEVICE_IO_MAP(hotdogst_sound_portmap) + Z80(config, m_audiocpu, 32_MHz_XTAL/8); + m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::hotdogst_sound_map); + m_audiocpu->set_addrmap(AS_IO, &cave_state::hotdogst_sound_portmap); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(384, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(384, 240); + m_screen->set_visarea(0, 384-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_hotdogst); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_dfeveron)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2291,97 +2228,80 @@ MACHINE_CONFIG_START(cave_state::hotdogst) GENERIC_LATCH_16(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - MCFG_DEVICE_ADD("ymsnd", YM2203, 32_MHz_XTAL/8) - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) - MCFG_SOUND_ROUTE(2, "mono", 0.20) - MCFG_SOUND_ROUTE(3, "mono", 0.80) + ym2203_device &ymsnd(YM2203(config, "ymsnd", 32_MHz_XTAL/8)); + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(0, "mono", 0.20); + ymsnd.add_route(1, "mono", 0.20); + ymsnd.add_route(2, "mono", 0.20); + ymsnd.add_route(3, "mono", 0.80); - MCFG_DEVICE_ADD("oki1", OKIM6295, 32_MHz_XTAL/16, okim6295_device::PIN7_HIGH) // pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, oki_map) -MACHINE_CONFIG_END + OKIM6295(config, m_oki[0], 32_MHz_XTAL/16, okim6295_device::PIN7_HIGH); // pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); + m_oki[0]->set_addrmap(0, &cave_state::oki_map); +} /*************************************************************************** Koro Koro Quest ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::korokoro) +void cave_state::korokoro(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(korokoro_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::korokoro_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1-2, 0, 240-1-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_visarea(0, 320-1-2, 0, 240-1-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_korokoro); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_korokoro), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_korokoro)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} -MACHINE_CONFIG_START(cave_state::crusherm) +void cave_state::crusherm(machine_config &config) +{ korokoro(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(crusherm_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::crusherm_map); +} /*************************************************************************** Mazinger Z ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::mazinger) +void cave_state::mazinger(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(mazinger_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::mazinger_map); - MCFG_DEVICE_ADD("audiocpu", Z80, 4_MHz_XTAL) // Bidirectional communication - MCFG_DEVICE_PROGRAM_MAP(mazinger_sound_map) - MCFG_DEVICE_IO_MAP(mazinger_sound_portmap) + Z80(config, m_audiocpu, 4_MHz_XTAL); // Bidirectional communication + m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::mazinger_sound_map); + m_audiocpu->set_addrmap(AS_IO, &cave_state::mazinger_sound_portmap); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(384, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(384, 240); + m_screen->set_visarea(0, 384-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_mazinger); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_mazinger), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_mazinger)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_2_layers) @@ -2391,52 +2311,47 @@ MACHINE_CONFIG_START(cave_state::mazinger) GENERIC_LATCH_16(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - MCFG_DEVICE_ADD("ymsnd", YM2203, 4_MHz_XTAL) - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) - MCFG_SOUND_ROUTE(2, "mono", 0.20) - MCFG_SOUND_ROUTE(3, "mono", 0.60) + ym2203_device &ymsnd(YM2203(config, "ymsnd", 4_MHz_XTAL)); + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(0, "mono", 0.20); + ymsnd.add_route(1, "mono", 0.20); + ymsnd.add_route(2, "mono", 0.20); + ymsnd.add_route(3, "mono", 0.60); - MCFG_DEVICE_ADD("oki1", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0) - MCFG_DEVICE_ADDRESS_MAP(0, oki_map) -MACHINE_CONFIG_END + OKIM6295(config, m_oki[0], 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 2.0); + m_oki[0]->set_addrmap(0, &cave_state::oki_map); +} /*************************************************************************** Metamoqester ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::metmqstr) +void cave_state::metmqstr(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL / 2) - MCFG_DEVICE_PROGRAM_MAP(metmqstr_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_clock(32_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::metmqstr_map); - MCFG_DEVICE_ADD("audiocpu", Z80, 32_MHz_XTAL / 4) - MCFG_DEVICE_PROGRAM_MAP(metmqstr_sound_map) - MCFG_DEVICE_IO_MAP(metmqstr_sound_portmap) + Z80(config, m_audiocpu, 32_MHz_XTAL / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::metmqstr_sound_map); + m_audiocpu->set_addrmap(AS_IO, &cave_state::metmqstr_sound_portmap); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 240) - MCFG_SCREEN_VISIBLE_AREA(0x7d, 0x7d + 0x180-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(0x200, 240); + m_screen->set_visarea(0x7d, 0x7d + 0x180-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_donpachi); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_dfeveron)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2450,69 +2365,62 @@ MACHINE_CONFIG_START(cave_state::metmqstr) ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(ALL_OUTPUTS, "mono", 0.6); - MCFG_DEVICE_ADD("oki1", OKIM6295, 32_MHz_XTAL / 16 , okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - MCFG_DEVICE_ADDRESS_MAP(0, oki_map) + OKIM6295(config, m_oki[0], 32_MHz_XTAL / 16, okim6295_device::PIN7_HIGH); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); + m_oki[0]->set_addrmap(0, &cave_state::oki_map); - MCFG_DEVICE_ADD("oki2", OKIM6295, 32_MHz_XTAL / 16 , okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - MCFG_DEVICE_ADDRESS_MAP(0, oki2_map) -MACHINE_CONFIG_END + OKIM6295(config, m_oki[1], 32_MHz_XTAL / 16, okim6295_device::PIN7_HIGH); + m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.5); + m_oki[1]->set_addrmap(0, &cave_state::oki2_map); +} /*************************************************************************** Pac-Slot ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::pacslot) +void cave_state::pacslot(machine_config &config) +{ + add_base_config(config); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) - MCFG_DEVICE_PROGRAM_MAP(pacslot_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_clock(28_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::pacslot_map); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 240) - MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(0x200, 240); + m_screen->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki1", OKIM6295, 28_MHz_XTAL / 28, 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) + OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); // oki2 chip is present but its rom socket is unpopulated - MCFG_DEVICE_ADD("oki2", OKIM6295, 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, m_oki[1], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(cave_state::paceight) +void cave_state::paceight(machine_config &config) +{ pacslot(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(paceight_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::paceight_map); +} + /*************************************************************************** Poka Poka Satan ***************************************************************************/ @@ -2522,48 +2430,41 @@ TIMER_DEVICE_CALLBACK_MEMBER( cave_state::timer_lev2_cb ) m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); // ppsatan: read touch screens } -MACHINE_CONFIG_START(cave_state::ppsatan) +void cave_state::ppsatan(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(ppsatan_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt_ppsatan) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::ppsatan_map); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(1)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_lev2", cave_state, timer_lev2_cb, attotime::from_hz(60)) + TIMER(config, "timer_lev2").configure_periodic(FUNC(cave_state::timer_lev2_cb), attotime::from_hz(60)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) // Top - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_top) - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - - MCFG_SCREEN_ADD("screen_left", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_left) - MCFG_TIMER_DRIVER_ADD("int_timer_left", cave_state, vblank_start_left) - - MCFG_SCREEN_ADD("screen_right", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_right) - MCFG_TIMER_DRIVER_ADD("int_timer_right", cave_state, vblank_start_right) + m_screen->set_visarea(0, 320-1, 0, 224-1); + + screen_device &screen_left(SCREEN(config, "screen_left", SCREEN_TYPE_RASTER)); + screen_left.set_refresh_hz(15625/271.5); + screen_left.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen_left.set_size(320, 240); + screen_left.set_visarea(0, 320-1, 0, 224-1); + screen_left.set_screen_update(FUNC(cave_state::screen_update_ppsatan_left)); + TIMER(config, "int_timer_left").configure_generic(FUNC(cave_state::vblank_start_left)); + + screen_device &screen_right(SCREEN(config, "screen_right", SCREEN_TYPE_RASTER)); + screen_right.set_refresh_hz(15625/271.5); + screen_right.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen_right.set_size(320, 240); + screen_right.set_visarea(0, 320-1, 0, 224-1); + screen_right.set_screen_update(FUNC(cave_state::screen_update_ppsatan_right)); + TIMER(config, "int_timer_right").configure_generic(FUNC(cave_state::vblank_start_right)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ppsatan); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_ppsatan), this)); + m_palette->set_init(FUNC(cave_state::palette_init_ppsatan)); config.set_default_layout(layout_ppsatan); @@ -2573,10 +2474,10 @@ MACHINE_CONFIG_START(cave_state::ppsatan) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki1", OKIM6295, 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 2.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 2.0) -MACHINE_CONFIG_END + OKIM6295(config, m_oki[0], 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 2.0); + m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 2.0); +} /*************************************************************************** @@ -2585,33 +2486,27 @@ MACHINE_CONFIG_END /* X1 = 12 MHz, X2 = 28 MHz, X3 = 16 MHz. OKI: / 165 mode A ; / 132 mode B */ -MACHINE_CONFIG_START(cave_state::pwrinst2) +void cave_state::pwrinst2(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(pwrinst2_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::pwrinst2_map); - MCFG_DEVICE_ADD("audiocpu", Z80, 16_MHz_XTAL / 2) /* 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(pwrinst2_sound_map) - MCFG_DEVICE_IO_MAP(pwrinst2_sound_portmap) + Z80(config, m_audiocpu, 16_MHz_XTAL / 2); /* 8 MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::pwrinst2_sound_map); + m_audiocpu->set_addrmap(AS_IO, &cave_state::pwrinst2_sound_portmap); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 240) - MCFG_SCREEN_VISIBLE_AREA(0x70, 0x70 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(0x200, 240); + m_screen->set_visarea(0x70, 0x70 + 0x140-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_pwrinst2); - PALETTE(config, m_palette, 0x8000+0x2800); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_pwrinst2), this)); + m_palette->set_entries(0x8000+0x2800); + m_palette->set_init(FUNC(cave_state::palette_init_pwrinst2)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_4_layers) @@ -2621,23 +2516,23 @@ MACHINE_CONFIG_START(cave_state::pwrinst2) GENERIC_LATCH_16(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - MCFG_DEVICE_ADD("ymsnd", YM2203, 16_MHz_XTAL / 4) - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.40) - MCFG_SOUND_ROUTE(1, "mono", 0.40) - MCFG_SOUND_ROUTE(2, "mono", 0.40) - MCFG_SOUND_ROUTE(3, "mono", 0.80) + ym2203_device &ym2203(YM2203(config, "ymsnd", 16_MHz_XTAL / 4)); + ym2203.irq_handler().set_inputline("audiocpu", 0); + ym2203.add_route(0, "mono", 0.40); + ym2203.add_route(1, "mono", 0.40); + ym2203.add_route(2, "mono", 0.40); + ym2203.add_route(3, "mono", 0.80); - MCFG_DEVICE_ADD("oki1", OKIM6295, 3_MHz_XTAL, okim6295_device::PIN7_LOW) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + OKIM6295(config, m_oki[0], 3_MHz_XTAL, okim6295_device::PIN7_LOW); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.80); - MCFG_DEVICE_ADD("oki2", OKIM6295, 3_MHz_XTAL, okim6295_device::PIN7_LOW) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + OKIM6295(config, m_oki[1], 3_MHz_XTAL, okim6295_device::PIN7_LOW); + m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.00); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); -MACHINE_CONFIG_END +} /*************************************************************************** @@ -2655,39 +2550,33 @@ MACHINE_RESET_MEMBER(cave_state,sailormn) m_startup->adjust(attotime::from_usec(1000), 0, attotime::zero); } -MACHINE_CONFIG_START(cave_state::sailormn) +void cave_state::sailormn(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(sailormn_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::sailormn_map); // could be a wachdog, but if it is then our watchdog address is incorrect as there are periods where the game doesn't write it. - MCFG_TIMER_DRIVER_ADD(m_startup, cave_state, sailormn_startup) + TIMER(config, m_startup).configure_generic(FUNC(cave_state::sailormn_startup)); - MCFG_DEVICE_ADD("audiocpu", Z80, 8_MHz_XTAL) // Bidirectional Communication - MCFG_DEVICE_PROGRAM_MAP(sailormn_sound_map) - MCFG_DEVICE_IO_MAP(sailormn_sound_portmap) + Z80(config, m_audiocpu, 8_MHz_XTAL); // Bidirectional Communication + m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::sailormn_sound_map); + m_audiocpu->set_addrmap(AS_IO, &cave_state::sailormn_sound_portmap); -// MCFG_QUANTUM_TIME(attotime::from_hz(600)) +// config.m_minimum_quantum = attotime::from_hz(600); MCFG_MACHINE_RESET_OVERRIDE(cave_state,sailormn) EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320+1, 240) - MCFG_SCREEN_VISIBLE_AREA(0+1, 320+1-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(320+1, 240); + m_screen->set_visarea(0+1, 320+1-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sailormn); - PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_sailormn), this)); // 4 bit sprites, 6 bit tiles + /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(FUNC(cave_state::palette_init_sailormn)); // 4 bit sprites, 6 bit tiles MCFG_VIDEO_START_OVERRIDE(cave_state,sailormn_3_layers) /* Layer 2 has 1 banked ROM */ @@ -2701,153 +2590,121 @@ MACHINE_CONFIG_START(cave_state::sailormn) ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("oki1", OKIM6295, 2112000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, oki_map) + OKIM6295(config, m_oki[0], 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); + m_oki[0]->set_addrmap(0, &cave_state::oki_map); - MCFG_DEVICE_ADD("oki2", OKIM6295, 2112000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, oki2_map) + OKIM6295(config, m_oki[1], 2112000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0); + m_oki[1]->set_addrmap(0, &cave_state::oki2_map); -MACHINE_CONFIG_END +} /*************************************************************************** Tekken Card World ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::tekkencw) +void cave_state::tekkencw(machine_config &config) +{ + add_base_config(config); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) - MCFG_DEVICE_PROGRAM_MAP(tekkencw_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_clock(28_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tekkencw_map); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 240) - MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(0x200, 240); + m_screen->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki1", OKIM6295, 28_MHz_XTAL / 28, 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) + OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); // oki2 chip spot and rom socket are both unpopulated -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(cave_state::tekkenbs) +void cave_state::tekkenbs(machine_config &config) +{ tekkencw(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(tekkenbs_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tekkenbs_map); +} /*************************************************************************** Tobikose! Jumpman ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::tjumpman) +void cave_state::tjumpman(machine_config &config) +{ + add_base_config(config); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) - MCFG_DEVICE_PROGRAM_MAP(tjumpman_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_clock(28_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::tjumpman_map); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 240) - MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + m_screen->set_size(0x200, 240); + m_screen->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1); GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("oki1", OKIM6295, 28_MHz_XTAL / 28, 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) + OKIM6295(config, m_oki[0], 28_MHz_XTAL / 28, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); // oki2 chip spot and rom socket are both unpopulated -MACHINE_CONFIG_END +} /*************************************************************************** Uo Poko ***************************************************************************/ -MACHINE_CONFIG_START(cave_state::uopoko) +void cave_state::uopoko(machine_config &config) +{ + add_base_config(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(uopoko_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) + m_maincpu->set_addrmap(AS_PROGRAM, &cave_state::uopoko_map); EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(15625/271.5) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - PALETTE(config, m_palette, 0x8000); - m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("ymz", YMZ280B, 16.9344_MHz_XTAL) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, cave_state, sound_irq_gen)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + add_ymz(config); +} /*************************************************************************** diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp index 4ce6fcd539e..98a936e4a41 100644 --- a/src/mame/drivers/eolith.cpp +++ b/src/mame/drivers/eolith.cpp @@ -537,10 +537,11 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(eolith_state::eolith45) - MCFG_DEVICE_ADD("maincpu", E132N, 45000000) /* 45 MHz */ - MCFG_DEVICE_PROGRAM_MAP(eolith_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith_state, eolith_speedup, "screen", 0, 1) +void eolith_state::eolith45(machine_config &config) +{ + E132N(config, m_maincpu, 45000000); /* 45 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &eolith_state::eolith_map); + TIMER(config, "scantimer").configure_scanline(FUNC(eolith_state::eolith_speedup), "screen", 0, 1); /* Sound CPU */ I8032(config, m_soundcpu, XTAL(12'000'000)); @@ -560,15 +561,15 @@ MACHINE_CONFIG_START(eolith_state::eolith45) // MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(512, 262) - MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(eolith_state, screen_update_eolith) - 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(2500)); + m_screen->set_size(512, 262); + m_screen->set_visarea(0, 319, 0, 239); + m_screen->set_screen_update(FUNC(eolith_state::screen_update_eolith)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette") + PALETTE(config, m_palette, 32768).set_init("palette", FUNC(palette_device::palette_init_RRRRRGGGGGBBBBB)); MCFG_VIDEO_START_OVERRIDE(eolith_state,eolith) @@ -578,31 +579,31 @@ MACHINE_CONFIG_START(eolith_state::eolith45) GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_soundcpu, MCS51_INT0_LINE); - MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000)) - MCFG_QS1000_EXTERNAL_ROM(true) - MCFG_QS1000_IN_P1_CB(READ8(*this, eolith_state, qs1000_p1_r)) - MCFG_QS1000_OUT_P1_CB(WRITE8(*this, eolith_state, qs1000_p1_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + qs1000_device &qs1000(QS1000(config, "qs1000", XTAL(24'000'000))); + qs1000.set_external_rom(true); + qs1000.p1_in().set(FUNC(eolith_state::qs1000_p1_r)); + qs1000.p1_out().set(FUNC(eolith_state::qs1000_p1_w)); + qs1000.add_route(0, "lspeaker", 1.0); + qs1000.add_route(1, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(eolith_state::eolith50) +void eolith_state::eolith50(machine_config &config) +{ eolith45(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK(50000000) /* 50 MHz */ -MACHINE_CONFIG_END + m_maincpu->set_clock(50000000); /* 50 MHz */ +} -MACHINE_CONFIG_START(eolith_state::ironfort) +void eolith_state::ironfort(machine_config &config) +{ eolith45(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK(44900000) /* Normally 45MHz??? but PCB actually had a 44.9MHz OSC, so it's value is used */ -MACHINE_CONFIG_END + m_maincpu->set_clock(44900000); /* Normally 45MHz??? but PCB actually had a 44.9MHz OSC, so it's value is used */ +} -MACHINE_CONFIG_START(eolith_state::hidctch3) +void eolith_state::hidctch3(machine_config &config) +{ eolith50(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hidctch3_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &eolith_state::hidctch3_map); +} /************************************* diff --git a/src/mame/drivers/esqasr.cpp b/src/mame/drivers/esqasr.cpp index f044bf34edb..139aeab4dea 100644 --- a/src/mame/drivers/esqasr.cpp +++ b/src/mame/drivers/esqasr.cpp @@ -116,73 +116,75 @@ READ16_MEMBER(esqasr_state::esq5506_read_adc) return 0; } -MACHINE_CONFIG_START(esqasr_state::asr) - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)) // actually MC68302 - MCFG_DEVICE_PROGRAM_MAP(asr_map) +void esqasr_state::asr(machine_config &config) +{ + M68000(config, m_maincpu, XTAL(16'000'000)); // actually MC68302 + m_maincpu->set_addrmap(AS_PROGRAM, &esqasr_state::asr_map); - MCFG_DEVICE_ADD("esp", ES5510, XTAL(10'000'000)) - MCFG_DEVICE_DISABLE() + ES5510(config, m_esp, XTAL(10'000'000)); + m_esp->set_disable(); ESQ2X40_SQ1(config, m_sq1vfd, 60); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("pump", ESQ_5505_5510_PUMP, XTAL(16'000'000) / (16 * 32)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("ensoniq", ES5506, XTAL(16'000'000)) - MCFG_ES5506_REGION0("waverom") /* Bank 0 */ - MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ - MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ - MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(4) /* channels, Not verified from real hardware */ - MCFG_ES5506_IRQ_CB(WRITELINE(*this, esqasr_state, esq5506_otto_irq)) /* irq */ - MCFG_ES5506_READ_PORT_CB(READ16(*this, esqasr_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "pump", 1.0, 0) - MCFG_SOUND_ROUTE(1, "pump", 1.0, 1) - MCFG_SOUND_ROUTE(2, "pump", 1.0, 2) - MCFG_SOUND_ROUTE(3, "pump", 1.0, 3) - MCFG_SOUND_ROUTE(4, "pump", 1.0, 4) - MCFG_SOUND_ROUTE(5, "pump", 1.0, 5) - MCFG_SOUND_ROUTE(6, "pump", 1.0, 6) - MCFG_SOUND_ROUTE(7, "pump", 1.0, 7) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(esqasr_state::asrx) + ESQ_5505_5510_PUMP(config, m_pump, XTAL(16'000'000) / (16 * 32)); + m_pump->add_route(0, "lspeaker", 1.0); + m_pump->add_route(1, "rspeaker", 1.0); + + es5506_device &ensoniq(ES5506(config, "ensoniq", XTAL(16'000'000))); + ensoniq.set_region0("waverom"); /* Bank 0 */ + ensoniq.set_region1("waverom2"); /* Bank 1 */ + ensoniq.set_region2("waverom3"); /* Bank 0 */ + ensoniq.set_region3("waverom4"); /* Bank 1 */ + ensoniq.set_channels(4); /* channels, Not verified from real hardware */ + ensoniq.irq_cb().set(FUNC(esqasr_state::esq5506_otto_irq)); /* irq */ + ensoniq.read_port_cb().set(FUNC(esqasr_state::esq5506_read_adc)); + ensoniq.add_route(0, "pump", 1.0, 0); + ensoniq.add_route(1, "pump", 1.0, 1); + ensoniq.add_route(2, "pump", 1.0, 2); + ensoniq.add_route(3, "pump", 1.0, 3); + ensoniq.add_route(4, "pump", 1.0, 4); + ensoniq.add_route(5, "pump", 1.0, 5); + ensoniq.add_route(6, "pump", 1.0, 6); + ensoniq.add_route(7, "pump", 1.0, 7); +} + +void esqasr_state::asrx(machine_config &config) +{ M68340(config, m_maincpu, XTAL(16'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &esqasr_state::asrx_map); - MCFG_DEVICE_ADD("esp", ES5510, XTAL(10'000'000)) // Actually ES5511 - MCFG_DEVICE_DISABLE() + ES5510(config, m_esp, XTAL(10'000'000)); // Actually ES5511 + m_esp->set_disable(); ESQ2X40_SQ1(config, m_sq1vfd, 60); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("pump", ESQ_5505_5510_PUMP, XTAL(16'000'000) / (16 * 32)) // Actually ES5511 - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("ensoniq", ES5506, XTAL(16'000'000)) - MCFG_ES5506_REGION0("waverom") /* Bank 0 */ - MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ - MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ - MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_ES5506_IRQ_CB(WRITELINE(*this, esqasr_state, esq5506_otto_irq)) /* irq */ - MCFG_ES5506_READ_PORT_CB(READ16(*this, esqasr_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "pump", 1.0, 0) - MCFG_SOUND_ROUTE(1, "pump", 1.0, 1) - MCFG_SOUND_ROUTE(2, "pump", 1.0, 2) - MCFG_SOUND_ROUTE(3, "pump", 1.0, 3) - MCFG_SOUND_ROUTE(4, "pump", 1.0, 4) - MCFG_SOUND_ROUTE(5, "pump", 1.0, 5) - MCFG_SOUND_ROUTE(6, "pump", 1.0, 6) - MCFG_SOUND_ROUTE(7, "pump", 1.0, 7) -MACHINE_CONFIG_END + ESQ_5505_5510_PUMP(config, m_pump, XTAL(16'000'000) / (16 * 32)); // Actually ES5511 + m_pump->add_route(0, "lspeaker", 1.0); + m_pump->add_route(1, "rspeaker", 1.0); + + es5506_device &ensoniq(ES5506(config, "ensoniq", XTAL(16'000'000))); + ensoniq.set_region0("waverom"); /* Bank 0 */ + ensoniq.set_region1("waverom2"); /* Bank 1 */ + ensoniq.set_region2("waverom3"); /* Bank 0 */ + ensoniq.set_region3("waverom4"); /* Bank 1 */ + ensoniq.set_channels(4); /* channels, Not verified from real hardware */ + ensoniq.irq_cb().set(FUNC(esqasr_state::esq5506_otto_irq)); /* irq */ + ensoniq.read_port_cb().set(FUNC(esqasr_state::esq5506_read_adc)); + ensoniq.add_route(0, "pump", 1.0, 0); + ensoniq.add_route(1, "pump", 1.0, 1); + ensoniq.add_route(2, "pump", 1.0, 2); + ensoniq.add_route(3, "pump", 1.0, 3); + ensoniq.add_route(4, "pump", 1.0, 4); + ensoniq.add_route(5, "pump", 1.0, 5); + ensoniq.add_route(6, "pump", 1.0, 6); + ensoniq.add_route(7, "pump", 1.0, 7); +} static INPUT_PORTS_START( asr ) INPUT_PORTS_END diff --git a/src/mame/drivers/esqmr.cpp b/src/mame/drivers/esqmr.cpp index ceb21083905..efcba5def47 100644 --- a/src/mame/drivers/esqmr.cpp +++ b/src/mame/drivers/esqmr.cpp @@ -253,7 +253,8 @@ READ16_MEMBER(esqmr_state::esq5506_read_adc) return 0; } -MACHINE_CONFIG_START(esqmr_state::mr) +void esqmr_state::mr(machine_config &config) +{ M68340(config, m_maincpu, XTAL(16'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &esqmr_state::mr_map); @@ -261,25 +262,27 @@ MACHINE_CONFIG_START(esqmr_state::mr) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ensoniq", ES5506, XTAL(16'000'000)) - MCFG_ES5506_REGION0("waverom") /* Bank 0 */ - MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ - MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ - MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_ES5506_IRQ_CB(WRITELINE(*this, esqmr_state, esq5506_otto_irq)) /* irq */ - MCFG_ES5506_READ_PORT_CB(READ16(*this, esqmr_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) - MCFG_DEVICE_ADD("ensoniq2", ES5506, XTAL(16'000'000)) - MCFG_ES5506_REGION0("waverom") /* Bank 0 */ - MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ - MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ - MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) -MACHINE_CONFIG_END + + es5506_device &ensoniq(ES5506(config, "ensoniq", XTAL(16'000'000))); + ensoniq.set_region0("waverom"); /* Bank 0 */ + ensoniq.set_region1("waverom2"); /* Bank 1 */ + ensoniq.set_region2("waverom3"); /* Bank 0 */ + ensoniq.set_region3("waverom4"); /* Bank 1 */ + ensoniq.set_channels(1); + ensoniq.irq_cb().set(FUNC(esqmr_state::esq5506_otto_irq)); /* irq */ + ensoniq.read_port_cb().set(FUNC(esqmr_state::esq5506_read_adc)); + ensoniq.add_route(0, "lspeaker", 0.5); + ensoniq.add_route(1, "rspeaker", 0.5); + + es5506_device &ensoniq2(ES5506(config, "ensoniq2", XTAL(16'000'000))); + ensoniq2.set_region0("waverom"); /* Bank 0 */ + ensoniq2.set_region1("waverom2"); /* Bank 1 */ + ensoniq2.set_region2("waverom3"); /* Bank 0 */ + ensoniq2.set_region3("waverom4"); /* Bank 1 */ + ensoniq2.set_channels(1); + ensoniq2.add_route(0, "lspeaker", 0.5); + ensoniq2.add_route(1, "rspeaker", 0.5); +} static INPUT_PORTS_START( mr ) INPUT_PORTS_END diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp index b5d76a95180..2b73831a706 100644 --- a/src/mame/drivers/firebeat.cpp +++ b/src/mame/drivers/firebeat.cpp @@ -1165,9 +1165,9 @@ WRITE_LINE_MEMBER( firebeat_state::ata_interrupt ) void firebeat_state::cdrom_config(device_t *device) { + device->subdevice("cdda")->add_route(0, "^^lspeaker", 1.0); + device->subdevice("cdda")->add_route(1, "^^rspeaker", 1.0); device = device->subdevice("cdda"); - MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0) } static void firebeat_ata_devices(device_slot_interface &device) @@ -1178,9 +1178,9 @@ static void firebeat_ata_devices(device_slot_interface &device) MACHINE_CONFIG_START(firebeat_state::firebeat) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", PPC403GCX, XTAL(64'000'000)) - MCFG_DEVICE_PROGRAM_MAP(firebeat_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", firebeat_state, firebeat_interrupt) + PPC403GCX(config, m_maincpu, XTAL(64'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &firebeat_state::firebeat_map); + m_maincpu->set_vblank_int("screen", FUNC(firebeat_state::firebeat_interrupt)); MCFG_MACHINE_START_OVERRIDE(firebeat_state,firebeat) MCFG_MACHINE_RESET_OVERRIDE(firebeat_state,firebeat) @@ -1193,23 +1193,21 @@ MACHINE_CONFIG_START(firebeat_state::firebeat) ATA_INTERFACE(config, m_ata).options(firebeat_ata_devices, "cdrom", "cdrom", true); m_ata->irq_handler().set(FUNC(firebeat_state::ata_interrupt)); - - MCFG_DEVICE_MODIFY("ata:1") - MCFG_SLOT_OPTION_MACHINE_CONFIG( "cdrom", cdrom_config ) + m_ata->slot(1).set_option_machine_config("cdrom", cdrom_config); /* video hardware */ - MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette") + PALETTE(config, "palette", 32768).set_init("palette", FUNC(palette_device::palette_init_RRRRRGGGGGBBBBB)); K057714(config, m_gcu[0], 0); m_gcu[0]->irq_callback().set(FUNC(firebeat_state::gcu0_interrupt)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(640, 480) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE_DRIVER(firebeat_state, screen_update_firebeat_0) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(640, 480); + screen.set_visarea(0, 639, 0, 479); + screen.set_screen_update(FUNC(firebeat_state::screen_update_firebeat_0)); + screen.set_palette("palette"); MCFG_VIDEO_START_OVERRIDE(firebeat_state,firebeat) @@ -1217,11 +1215,11 @@ MACHINE_CONFIG_START(firebeat_state::firebeat) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymz", YMZ280B, 16934400) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, firebeat_state, sound_irq_callback)) - MCFG_DEVICE_ADDRESS_MAP(0, ymz280b_map) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + ymz280b_device &ymz(YMZ280B(config, "ymz", 16934400)); + ymz.irq_handler().set(FUNC(firebeat_state::sound_irq_callback)); + ymz.set_addrmap(0, &firebeat_state::ymz280b_map); + ymz.add_route(0, "lspeaker", 1.0); + ymz.add_route(1, "rspeaker", 1.0); PC16552D(config, "duart_com", 0); // pgmd to 9600baud NS16550(config, "duart_com:chan0", XTAL(19'660'800)); @@ -1231,14 +1229,14 @@ MACHINE_CONFIG_START(firebeat_state::firebeat) midi_chan0.out_int_callback().set(FUNC(firebeat_state::midi_uart_ch0_irq_callback)); ns16550_device &midi_chan1(NS16550(config, "duart_midi:chan1", XTAL(24'000'000))); midi_chan1.out_int_callback().set(FUNC(firebeat_state::midi_uart_ch1_irq_callback)); -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(firebeat_state::firebeat2) +} +void firebeat_state::firebeat2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", PPC403GCX, XTAL(64'000'000)) - MCFG_DEVICE_PROGRAM_MAP(firebeat2_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("lscreen", firebeat_state, firebeat_interrupt) + PPC403GCX(config, m_maincpu, XTAL(64'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &firebeat_state::firebeat2_map); + m_maincpu->set_vblank_int("lscreen", FUNC(firebeat_state::firebeat_interrupt)); MCFG_MACHINE_START_OVERRIDE(firebeat_state,firebeat) MCFG_MACHINE_RESET_OVERRIDE(firebeat_state,firebeat) @@ -1251,12 +1249,10 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2) ATA_INTERFACE(config, m_ata).options(firebeat_ata_devices, "cdrom", "cdrom", true); m_ata->irq_handler().set(FUNC(firebeat_state::ata_interrupt)); - - MCFG_DEVICE_MODIFY("ata:1") - MCFG_SLOT_OPTION_MACHINE_CONFIG( "cdrom", cdrom_config ) + m_ata->slot(1).set_option_machine_config("cdrom", cdrom_config); /* video hardware */ - MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette") + PALETTE(config, "palette", 32768).set_init("palette", FUNC(palette_device::palette_init_RRRRRGGGGGBBBBB)); K057714(config, m_gcu[0], 0); m_gcu[0]->irq_callback().set(FUNC(firebeat_state::gcu0_interrupt)); @@ -1264,21 +1260,21 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2) K057714(config, m_gcu[1], 0); m_gcu[1]->irq_callback().set(FUNC(firebeat_state::gcu1_interrupt)); - MCFG_SCREEN_ADD("lscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(640, 480) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE_DRIVER(firebeat_state, screen_update_firebeat_0) - MCFG_SCREEN_PALETTE("palette") - - MCFG_SCREEN_ADD("rscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(640, 480) - MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE_DRIVER(firebeat_state, screen_update_firebeat_1) - MCFG_SCREEN_PALETTE("palette") + screen_device &lscreen(SCREEN(config, "lscreen", SCREEN_TYPE_RASTER)); + lscreen.set_refresh_hz(60); + lscreen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + lscreen.set_size(640, 480); + lscreen.set_visarea(0, 639, 0, 479); + lscreen.set_screen_update(FUNC(firebeat_state::screen_update_firebeat_0)); + lscreen.set_palette("palette"); + + screen_device &rscreen(SCREEN(config, "rscreen", SCREEN_TYPE_RASTER)); + rscreen.set_refresh_hz(60); + rscreen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + rscreen.set_size(640, 480); + rscreen.set_visarea(0, 639, 0, 479); + rscreen.set_screen_update(FUNC(firebeat_state::screen_update_firebeat_1)); + rscreen.set_palette("palette"); MCFG_VIDEO_START_OVERRIDE(firebeat_state,firebeat) @@ -1286,11 +1282,11 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymz", YMZ280B, 16934400) - MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(*this, firebeat_state, sound_irq_callback)) - MCFG_DEVICE_ADDRESS_MAP(0, ymz280b_map) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + ymz280b_device &ymz(YMZ280B(config, "ymz", 16934400)); + ymz.irq_handler().set(FUNC(firebeat_state::sound_irq_callback)); + ymz.set_addrmap(0, &firebeat_state::ymz280b_map); + ymz.add_route(0, "lspeaker", 1.0); + ymz.add_route(1, "rspeaker", 1.0); PC16552D(config, "duart_com", 0); NS16550(config, "duart_com:chan0", XTAL(19'660'800)); @@ -1303,24 +1299,25 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2) MIDI_KBD(config, m_kbd[0], 31250).tx_callback().set(midi_chan0, FUNC(ins8250_uart_device::rx_w)); MIDI_KBD(config, m_kbd[1], 31250).tx_callback().set(midi_chan1, FUNC(ins8250_uart_device::rx_w)); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(firebeat_state::firebeat_spu) +void firebeat_state::firebeat_spu(machine_config &config) +{ firebeat(config); /* basic machine hardware */ - MCFG_DEVICE_ADD("audiocpu", M68000, 16000000) - MCFG_DEVICE_PROGRAM_MAP(spu_map) + M68000(config, m_audiocpu, 16000000); + m_audiocpu->set_addrmap(AS_PROGRAM, &firebeat_state::spu_map); - MCFG_TIMER_DRIVER_ADD_PERIODIC("sputimer", firebeat_state, spu_timer_callback, attotime::from_hz(1000)); + TIMER(config, "sputimer").configure_periodic(FUNC(firebeat_state::spu_timer_callback), attotime::from_hz(1000)); - MCFG_DEVICE_ADD("rf5c400", RF5C400, XTAL(16'934'400)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + rf5c400_device &rf5c400(RF5C400(config, "rf5c400", XTAL(16'934'400))); + rf5c400.add_route(0, "lspeaker", 1.0); + rf5c400.add_route(1, "rspeaker", 1.0); ATA_INTERFACE(config, m_spuata).options(firebeat_ata_devices, "cdrom", nullptr, true); m_spuata->irq_handler().set(FUNC(firebeat_state::spu_ata_interrupt)); -MACHINE_CONFIG_END +} /*****************************************************************************/ /* Security dongle is a Dallas DS1411 RS232 Adapter with a DS1991 Multikey iButton */ diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp index 8f0a6ee5e85..3100b376249 100644 --- a/src/mame/drivers/fuukifg3.cpp +++ b/src/mame/drivers/fuukifg3.cpp @@ -529,29 +529,27 @@ void fuuki32_state::machine_reset() m_raster_interrupt_timer->adjust(m_screen->time_until_pos(0, visarea.max_x + 1)); } - -MACHINE_CONFIG_START(fuuki32_state::fuuki32) - +void fuuki32_state::fuuki32(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, CPU_CLOCK) /* 20MHz verified */ - MCFG_DEVICE_PROGRAM_MAP(fuuki32_map) + M68EC020(config, m_maincpu, CPU_CLOCK); /* 20MHz verified */ + m_maincpu->set_addrmap(AS_PROGRAM, &fuuki32_state::fuuki32_map); - MCFG_DEVICE_ADD("soundcpu", Z80, SOUND_CPU_CLOCK) /* 6MHz verified */ - MCFG_DEVICE_PROGRAM_MAP(fuuki32_sound_map) - MCFG_DEVICE_IO_MAP(fuuki32_sound_io_map) + z80_device &soundcpu(Z80(config, "soundcpu", SOUND_CPU_CLOCK)); /* 6MHz verified */ + soundcpu.set_addrmap(AS_PROGRAM, &fuuki32_state::fuuki32_sound_map); + soundcpu.set_addrmap(AS_IO, &fuuki32_state::fuuki32_sound_io_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(64 * 8, 32 * 8) - MCFG_SCREEN_VISIBLE_AREA(0, 40 * 8 - 1, 0, 30 * 8 - 1) - MCFG_SCREEN_UPDATE_DRIVER(fuuki32_state, screen_update) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fuuki32_state, screen_vblank)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fuuki32) - MCFG_PALETTE_ADD("palette", 0x4000 / 2) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(64 * 8, 32 * 8); + m_screen->set_visarea(0, 40 * 8 - 1, 0, 30 * 8 - 1); + m_screen->set_screen_update(FUNC(fuuki32_state::screen_update)); + m_screen->screen_vblank().set(FUNC(fuuki32_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_fuuki32); + PALETTE(config, m_palette, 0x4000 / 2).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); FUUKI_VIDEO(config, m_fuukivid, 0); m_fuukivid->set_gfxdecode_tag(m_gfxdecode); @@ -560,15 +558,15 @@ MACHINE_CONFIG_START(fuuki32_state::fuuki32) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymf", YMF278B, YMF278B_STD_CLOCK) // 33.8688MHz - MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) - MCFG_SOUND_ROUTE(2, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(3, "rspeaker", 0.40) - MCFG_SOUND_ROUTE(4, "lspeaker", 0.40) - MCFG_SOUND_ROUTE(5, "rspeaker", 0.40) -MACHINE_CONFIG_END + ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK)); // 33.8688MHz + ymf.irq_handler().set_inputline("soundcpu", 0); + ymf.add_route(0, "lspeaker", 0.50); + ymf.add_route(1, "rspeaker", 0.50); + ymf.add_route(2, "lspeaker", 0.40); + ymf.add_route(3, "rspeaker", 0.40); + ymf.add_route(4, "lspeaker", 0.40); + ymf.add_route(5, "rspeaker", 0.40); +} /*************************************************************************** diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp index 38455847fb3..8cdc8e2745c 100644 --- a/src/mame/drivers/ghosteo.cpp +++ b/src/mame/drivers/ghosteo.cpp @@ -601,19 +601,19 @@ void ghosteo_state::machine_reset() m_maincpu->space(AS_PROGRAM).install_read_handler(0x4d000010, 0x4d000013,read32_delegate(FUNC(ghosteo_state::bballoon_speedup_r), this)); } -MACHINE_CONFIG_START(ghosteo_state::ghosteo) - +void ghosteo_state::ghosteo(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", ARM9, 200000000) + ARM9(config, m_maincpu, 200000000); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(455, 262) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-1) - MCFG_SCREEN_UPDATE_DEVICE("s3c2410", s3c2410_device, screen_update) + 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(455, 262); + screen.set_visarea(0, 320-1, 0, 256-1); + screen.set_screen_update("s3c2410", FUNC(s3c2410_device::screen_update)); - MCFG_PALETTE_ADD("palette", 256) + PALETTE(config, "palette", 256); S3C2410(config, m_s3c2410, 12000000); m_s3c2410->set_palette_tag("palette"); @@ -643,29 +643,29 @@ MACHINE_CONFIG_START(ghosteo_state::ghosteo) m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq)); m_soundlatch->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000)) - MCFG_QS1000_EXTERNAL_ROM(true) - MCFG_QS1000_IN_P1_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_QS1000_OUT_P1_CB(WRITE8(*this, ghosteo_state, qs1000_p1_w)) - MCFG_QS1000_OUT_P2_CB(WRITE8(*this, ghosteo_state, qs1000_p2_w)) - MCFG_QS1000_OUT_P3_CB(WRITE8(*this, ghosteo_state, qs1000_p3_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(ghosteo_state::bballoon) + qs1000_device &qs1000(QS1000(config, "qs1000", XTAL(24'000'000))); + qs1000.set_external_rom(true); + qs1000.p1_in().set("soundlatch", FUNC(generic_latch_8_device::read)); + qs1000.p1_out().set(FUNC(ghosteo_state::qs1000_p1_w)); + qs1000.p2_out().set(FUNC(ghosteo_state::qs1000_p2_w)); + qs1000.p3_out().set(FUNC(ghosteo_state::qs1000_p3_w)); + qs1000.add_route(0, "lspeaker", 1.0); + qs1000.add_route(1, "rspeaker", 1.0); +} + +void ghosteo_state::bballoon(machine_config &config) +{ ghosteo(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(bballoon_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::bballoon_map); I2CMEM(config, "i2cmem", 0).set_data_size(256); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ghosteo_state::touryuu) +void ghosteo_state::touryuu(machine_config &config) +{ ghosteo(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(touryuu_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::touryuu_map); I2CMEM(config, "i2cmem", 0).set_data_size(1024); -MACHINE_CONFIG_END +} /* diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp index 04473a0f4ee..43a99a5577f 100644 --- a/src/mame/drivers/guab.cpp +++ b/src/mame/drivers/guab.cpp @@ -473,36 +473,36 @@ static void guab_floppies(device_slot_interface &device) // MACHINE DEFINTIONS //************************************************************************** -MACHINE_CONFIG_START(guab_state::guab) +void guab_state::guab(machine_config &config) +{ /* TODO: Verify clock */ - MCFG_DEVICE_ADD("maincpu", M68000, 8000000) - MCFG_DEVICE_PROGRAM_MAP(guab_map) + M68000(config, m_maincpu, 8000000); + m_maincpu->set_addrmap(AS_PROGRAM, &guab_state::guab_map); /* TODO: Use real video timings */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(guab_state, screen_update_guab) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0, 64*8-1, 0, 32*8-1); + screen.set_screen_update(FUNC(guab_state::screen_update_guab)); + screen.set_palette(m_palette); - MCFG_PALETTE_ADD("palette", ef9369_device::NUMCOLORS) + PALETTE(config, m_palette, ef9369_device::NUMCOLORS); - MCFG_EF9369_ADD("ef9369") - MCFG_EF9369_COLOR_UPDATE_CB(guab_state, ef9369_color_update) + EF9369(config, "ef9369").set_color_update_callback(FUNC(guab_state::ef9369_color_update)); - MCFG_DEVICE_ADD("tms34061", TMS34061, 0) - MCFG_TMS34061_ROWSHIFT(8) /* VRAM address is (row << rowshift) | col */ - MCFG_TMS34061_VRAM_SIZE(0x40000) - MCFG_TMS34061_INTERRUPT_CB(INPUTLINE("maincpu", 5)) - MCFG_VIDEO_SET_SCREEN("screen") + TMS34061(config, m_tms34061, 0); + m_tms34061->set_rowshift(8); /* VRAM address is (row << rowshift) | col */ + m_tms34061->set_vram_size(0x40000); + m_tms34061->int_callback().set_inputline("maincpu", 5); + m_tms34061->set_screen("screen"); SPEAKER(config, "mono").front_center(); /* TODO: Verify clock */ - MCFG_DEVICE_ADD("snsnd", SN76489, 2000000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + SN76489(config, m_sn, 2000000); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.50); ptm6840_device &ptm(PTM6840(config, "6840ptm", 1000000)); ptm.set_external_clocks(0, 0, 0); @@ -549,14 +549,12 @@ MACHINE_CONFIG_START(guab_state::guab) // floppy WD1773(config, m_fdc, 8000000); m_fdc->drq_wr_callback().set_inputline(m_maincpu, 6); + FLOPPY_CONNECTOR(config, "fdc:0", guab_floppies, "dd", guab_state::floppy_formats).set_fixed(true); - MCFG_FLOPPY_DRIVE_ADD("fdc:0", guab_floppies, "dd", guab_state::floppy_formats) - MCFG_SLOT_FIXED(true) - - MCFG_SOFTWARE_LIST_ADD("floppy_list", "guab") + SOFTWARE_LIST(config, "floppy_list").set_original("guab"); config.set_default_layout(layout_guab); -MACHINE_CONFIG_END +} //************************************************************************** diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp index c1b64410518..a21042d8a76 100644 --- a/src/mame/drivers/ibmpcjr.cpp +++ b/src/mame/drivers/ibmpcjr.cpp @@ -654,7 +654,7 @@ MACHINE_CONFIG_START(pcjr_state::ibmpcjr) pc_lpt_device &lpt0(PC_LPT(config, "lpt_0")); lpt0.irq_handler().set(m_pic8259, FUNC(pic8259_device::ir7_w)); - MCFG_PC_JOY_ADD("pc_joy") + PC_JOY(config, "pc_joy"); /* cassette */ MCFG_CASSETTE_ADD( "cassette") diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp index fdf1fa3c03c..ffc85d91c77 100644 --- a/src/mame/drivers/jpmsys5.cpp +++ b/src/mame/drivers/jpmsys5.cpp @@ -804,7 +804,8 @@ void jpmsys5_state::machine_reset() *************************************/ // later (incompatible with earlier revision) motherboards used a YM2413 -MACHINE_CONFIG_START(jpmsys5_state::jpmsys5_ym) +void jpmsys5_state::jpmsys5_ym(machine_config &config) +{ M68000(config, m_maincpu, 8_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &jpmsys5_state::m68000_awp_map); @@ -835,12 +836,12 @@ MACHINE_CONFIG_START(jpmsys5_state::jpmsys5_ym) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("upd7759", UPD7759) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + UPD7759(config, m_upd7759); + m_upd7759->add_route(ALL_OUTPUTS, "mono", 0.30); /* Earlier revisions use an SAA1099 */ - MCFG_DEVICE_ADD("ym2413", YM2413, 4000000 ) /* Unconfirmed */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + ym2413_device &ym2413(YM2413(config, "ym2413", 4000000)); /* Unconfirmed */ + ym2413.add_route(ALL_OUTPUTS, "mono", 1.00); pia6821_device &pia(PIA6821(config, "6821pia", 0)); pia.readpa_handler().set(FUNC(jpmsys5_state::u29_porta_r)); @@ -857,12 +858,12 @@ MACHINE_CONFIG_START(jpmsys5_state::jpmsys5_ym) ptm.irq_callback().set(FUNC(jpmsys5_state::ptm_irq)); config.set_default_layout(layout_jpmsys5); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) -MACHINE_CONFIG_END + METERS(config, m_meters, 0).set_number_meters(8); +} // the first rev PCB used an SAA1099 -MACHINE_CONFIG_START(jpmsys5_state::jpmsys5) +void jpmsys5_state::jpmsys5(machine_config &config) +{ M68000(config, m_maincpu, 8_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &jpmsys5_state::m68000_awp_map_saa); @@ -893,11 +894,10 @@ MACHINE_CONFIG_START(jpmsys5_state::jpmsys5) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("upd7759", UPD7759) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + UPD7759(config, m_upd7759); + m_upd7759->add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_SAA1099_ADD("saa", 4000000 /* guess */) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + SAA1099(config, "saa", 4000000 /* guess */).add_route(ALL_OUTPUTS, "mono", 1.0); pia6821_device &pia(PIA6821(config, "6821pia", 0)); pia.readpa_handler().set(FUNC(jpmsys5_state::u29_porta_r)); @@ -914,9 +914,8 @@ MACHINE_CONFIG_START(jpmsys5_state::jpmsys5) ptm.irq_callback().set(FUNC(jpmsys5_state::ptm_irq)); config.set_default_layout(layout_jpmsys5); - MCFG_DEVICE_ADD("meters", METERS, 0) - MCFG_METERS_NUMBER(8) -MACHINE_CONFIG_END + METERS(config, m_meters, 0).set_number_meters(8); +} /************************************* * diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp index 9ec24d9ff16..446ab848b66 100644 --- a/src/mame/drivers/limenko.cpp +++ b/src/mame/drivers/limenko.cpp @@ -704,27 +704,27 @@ GFXDECODE_END MACHINE DRIVERS *****************************************************************************************************/ - -MACHINE_CONFIG_START(limenko_state::limenko) - MCFG_DEVICE_ADD("maincpu", E132XN, 20000000*4) /* 4x internal multiplier */ - MCFG_DEVICE_PROGRAM_MAP(limenko_map) - MCFG_DEVICE_IO_MAP(limenko_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", limenko_state, irq0_line_hold) +void limenko_state::limenko(machine_config &config) +{ + E132XN(config, m_maincpu, 20000000*4); /* 4x internal multiplier */ + m_maincpu->set_addrmap(AS_PROGRAM, &limenko_state::limenko_map); + m_maincpu->set_addrmap(AS_IO, &limenko_state::limenko_io_map); + m_maincpu->set_vblank_int("screen", FUNC(limenko_state::irq0_line_hold)); EEPROM_93C46_16BIT(config, "eeprom"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(384, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 383, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(limenko_state, screen_update_limenko) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_limenko) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) + 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(384, 240); + screen.set_visarea(0, 383, 0, 239); + screen.set_screen_update(FUNC(limenko_state::screen_update_limenko)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_limenko); + PALETTE(config, m_palette, 0x1000); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -734,21 +734,22 @@ MACHINE_CONFIG_START(limenko_state::limenko) m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq)); m_soundlatch->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000)) - MCFG_QS1000_EXTERNAL_ROM(true) - MCFG_QS1000_IN_P1_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_QS1000_OUT_P1_CB(WRITE8(*this, limenko_state, qs1000_p1_w)) - MCFG_QS1000_OUT_P2_CB(WRITE8(*this, limenko_state, qs1000_p2_w)) - MCFG_QS1000_OUT_P3_CB(WRITE8(*this, limenko_state, qs1000_p3_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(limenko_state::spotty) - MCFG_DEVICE_ADD("maincpu", GMS30C2232, 20000000) /* 20 MHz, no internal multiplier */ - MCFG_DEVICE_PROGRAM_MAP(spotty_map) - MCFG_DEVICE_IO_MAP(spotty_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", limenko_state, irq0_line_hold) + qs1000_device &qs1000(QS1000(config, "qs1000", XTAL(24'000'000))); + qs1000.set_external_rom(true); + qs1000.p1_in().set("soundlatch", FUNC(generic_latch_8_device::read)); + qs1000.p1_out().set(FUNC(limenko_state::qs1000_p1_w)); + qs1000.p2_out().set(FUNC(limenko_state::qs1000_p2_w)); + qs1000.p3_out().set(FUNC(limenko_state::qs1000_p3_w)); + qs1000.add_route(0, "lspeaker", 1.0); + qs1000.add_route(1, "rspeaker", 1.0); +} + +void limenko_state::spotty(machine_config &config) +{ + GMS30C2232(config, m_maincpu, 20000000); /* 20 MHz, no internal multiplier */ + m_maincpu->set_addrmap(AS_PROGRAM, &limenko_state::spotty_map); + m_maincpu->set_addrmap(AS_IO, &limenko_state::spotty_io_map); + m_maincpu->set_vblank_int("screen", FUNC(limenko_state::irq0_line_hold)); at89c4051_device &audiocpu(AT89C4051(config, "audiocpu", 4000000)); /* 4 MHz */ audiocpu.port_in_cb<1>().set(FUNC(limenko_state::spotty_sound_r)); @@ -759,27 +760,26 @@ MACHINE_CONFIG_START(limenko_state::spotty) EEPROM_93C46_16BIT(config, "eeprom"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(384, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 383, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(limenko_state, screen_update_limenko) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_limenko) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - + 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(384, 240); + screen.set_visarea(0, 383, 0, 239); + screen.set_screen_update(FUNC(limenko_state::screen_update_limenko)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_limenko); + PALETTE(config, m_palette, 0x1000); + m_palette->set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR); /* sound hardware */ SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - MCFG_DEVICE_ADD("oki", OKIM6295, 4000000 / 4 , okim6295_device::PIN7_HIGH) //? - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, m_oki, 4000000 / 4 , okim6295_device::PIN7_HIGH); //? + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} /***************************************************************************************************** diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index da2837287ea..e075d78f36a 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -629,14 +629,15 @@ void lordgun_state::machine_start() save_item(NAME(m_whitescreen)); } -MACHINE_CONFIG_START(lordgun_state::lordgun) - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(20'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(lordgun_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lordgun_state, irq4_line_hold) +void lordgun_state::lordgun(machine_config &config) +{ + M68000(config, m_maincpu, XTAL(20'000'000) / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &lordgun_state::lordgun_map); + m_maincpu->set_vblank_int("screen", FUNC(lordgun_state::irq4_line_hold)); - MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(20'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(soundmem_map) - MCFG_DEVICE_IO_MAP(lordgun_soundio_map) + Z80(config, m_soundcpu, XTAL(20'000'000) / 4); + m_soundcpu->set_addrmap(AS_PROGRAM, &lordgun_state::soundmem_map); + m_soundcpu->set_addrmap(AS_IO, &lordgun_state::lordgun_soundio_map); i8255_device &ppi0(I8255A(config, "ppi8255_0")); ppi0.in_pa_callback().set_ioport("DIP"); @@ -653,20 +654,20 @@ MACHINE_CONFIG_START(lordgun_state::lordgun) ppi1.in_pc_callback().set_ioport("COIN"); ppi1.out_pc_callback().set(FUNC(lordgun_state::fake_w)); - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 0x100) - MCFG_SCREEN_VISIBLE_AREA(0,0x1c0-1, 0,0xe0-1) - MCFG_SCREEN_UPDATE_DRIVER(lordgun_state, screen_update) - 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(0x200, 0x100); + m_screen->set_visarea(0,0x1c0-1, 0,0xe0-1); + m_screen->set_screen_update(FUNC(lordgun_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_lordgun) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_lordgun); - MCFG_PALETTE_ADD("palette", 0x800 * 8) // 0x800 real colors, repeated per priority level - MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) + // 0x800 real colors, repeated per priority level + PALETTE(config, m_palette, 0x800 * 8).set_format(PALETTE_FORMAT_xxxxBBBBGGGGRRRR); // sound hardware SPEAKER(config, "mono").front_center(); @@ -674,23 +675,23 @@ MACHINE_CONFIG_START(lordgun_state::lordgun) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymsnd", YM3812, XTAL(3'579'545)) - MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH) // ? 5MHz can't be right! - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(3'579'545))); + ymsnd.irq_handler().set_inputline("soundcpu", 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); + OKIM6295(config, m_oki, XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH); // ? 5MHz can't be right! + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(lordgun_state::aliencha) - MCFG_DEVICE_ADD("maincpu", M68000, XTAL(20'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(aliencha_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lordgun_state, irq4_line_hold) +void lordgun_state::aliencha(machine_config &config) +{ + M68000(config, m_maincpu, XTAL(20'000'000) / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &lordgun_state::aliencha_map); + m_maincpu->set_vblank_int("screen", FUNC(lordgun_state::irq4_line_hold)); - MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(20'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(soundmem_map) - MCFG_DEVICE_IO_MAP(aliencha_soundio_map) + Z80(config, m_soundcpu, XTAL(20'000'000) / 4); + m_soundcpu->set_addrmap(AS_PROGRAM, &lordgun_state::soundmem_map); + m_soundcpu->set_addrmap(AS_IO, &lordgun_state::aliencha_soundio_map); i8255_device &ppi0(I8255A(config, "ppi8255_0")); ppi0.in_pa_callback().set(FUNC(lordgun_state::aliencha_dip_r)); @@ -707,20 +708,20 @@ MACHINE_CONFIG_START(lordgun_state::aliencha) ppi1.in_pc_callback().set_ioport("COIN"); ppi1.out_pc_callback().set(FUNC(lordgun_state::fake_w)); - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(0x200, 0x100) - MCFG_SCREEN_VISIBLE_AREA(0,0x1c0-1, 0,0xe0-1) - MCFG_SCREEN_UPDATE_DRIVER(lordgun_state, screen_update) - 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(0x200, 0x100); + m_screen->set_visarea(0,0x1c0-1, 0,0xe0-1); + m_screen->set_screen_update(FUNC(lordgun_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_lordgun) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_lordgun); - MCFG_PALETTE_ADD("palette", 0x800 * 8) // 0x800 real colors, repeated per priority level - MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) + // 0x800 real colors, repeated per priority level + PALETTE(config, m_palette, 0x800 * 8).set_format(PALETTE_FORMAT_xxxxBBBBGGGGRRRR); // sound hardware SPEAKER(config, "mono").front_center(); @@ -728,17 +729,16 @@ MACHINE_CONFIG_START(lordgun_state::aliencha) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - MCFG_DEVICE_ADD("ymf", YMF278B, XTAL(33'868'800)) // ? 33.8688MHz matches video (decrease for faster music tempo) - MCFG_DEVICE_ADDRESS_MAP(0, ymf278_map) - MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + ymf278b_device &ymf(YMF278B(config, "ymf", XTAL(33'868'800))); // ? 33.8688MHz matches video (decrease for faster music tempo) + ymf.set_addrmap(0, &lordgun_state::ymf278_map); + ymf.irq_handler().set_inputline("soundcpu", 0); + ymf.add_route(ALL_OUTPUTS, "mono", 0.5); - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH) // ? 5MHz can't be right - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + OKIM6295(config, m_oki, XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH); // ? 5MHz can't be right + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("oki2", OKIM6295, XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH) // ? 5MHz can't be right - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, "oki2", XTAL(20'000'000) / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // ? 5MHz can't be right +} /*************************************************************************** diff --git a/src/mame/drivers/macrossp.cpp b/src/mame/drivers/macrossp.cpp index 14c5f7251e3..22a37781df7 100644 --- a/src/mame/drivers/macrossp.cpp +++ b/src/mame/drivers/macrossp.cpp @@ -541,30 +541,28 @@ void macrossp_state::machine_reset() m_snd_toggle = 0; } -MACHINE_CONFIG_START(macrossp_state::macrossp) - +void macrossp_state::macrossp(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, 50000000/2) /* 25 MHz */ - MCFG_DEVICE_PROGRAM_MAP(macrossp_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", macrossp_state, irq3_line_hold) // there are others ... - - MCFG_DEVICE_ADD("audiocpu", M68000, 32000000/2) /* 16 MHz */ - MCFG_DEVICE_PROGRAM_MAP(macrossp_sound_map) + M68EC020(config, m_maincpu, 50000000/2); /* 25 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, ¯ossp_state::macrossp_map); + m_maincpu->set_vblank_int("screen", FUNC(macrossp_state::irq3_line_hold)); // there are others ... + M68000(config, m_audiocpu, 32000000/2); /* 16 MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, ¯ossp_state::macrossp_sound_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(32*16, 16*16) - MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 0*16, 15*16-1) - MCFG_SCREEN_UPDATE_DRIVER(macrossp_state, screen_update_macrossp) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, macrossp_state, screen_vblank_macrossp)) + 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*16, 16*16); + m_screen->set_visarea(0*16, 24*16-1, 0*16, 15*16-1); + m_screen->set_screen_update(FUNC(macrossp_state::screen_update_macrossp)); + m_screen->screen_vblank().set(FUNC(macrossp_state::screen_vblank_macrossp)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_macrossp) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_macrossp); - MCFG_PALETTE_ADD("palette", 4096) - MCFG_PALETTE_FORMAT(RGBX) + PALETTE(config, m_palette, 4096).set_format(PALETTE_FORMAT_RGBX); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -572,23 +570,22 @@ MACHINE_CONFIG_START(macrossp_state::macrossp) GENERIC_LATCH_16(config, m_soundlatch); - MCFG_DEVICE_ADD("ensoniq", ES5506, 16000000) - MCFG_ES5506_REGION0("ensoniq.0") - MCFG_ES5506_REGION1("ensoniq.1") - MCFG_ES5506_REGION2("ensoniq.2") - MCFG_ES5506_REGION3("ensoniq.3") - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_ES5506_IRQ_CB(WRITELINE(*this, macrossp_state, irqhandler)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.1) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.1) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(macrossp_state::quizmoon) - macrossp(config); + es5506_device &ensoniq(ES5506(config, "ensoniq", 16000000)); + ensoniq.set_region0("ensoniq.0"); + ensoniq.set_region1("ensoniq.1"); + ensoniq.set_region2("ensoniq.2"); + ensoniq.set_region3("ensoniq.3"); + ensoniq.set_channels(1); + ensoniq.irq_cb().set(FUNC(macrossp_state::irqhandler)); + ensoniq.add_route(0, "lspeaker", 0.1); + ensoniq.add_route(1, "rspeaker", 0.1); +} - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 24*16-1, 0*8, 14*16-1) -MACHINE_CONFIG_END +void macrossp_state::quizmoon(machine_config &config) +{ + macrossp(config); + m_screen->set_visarea(0, 24*16-1, 0*8, 14*16-1); +} diff --git a/src/mame/drivers/mastboy.cpp b/src/mame/drivers/mastboy.cpp index 816492a6d9f..d110cc2bd75 100644 --- a/src/mame/drivers/mastboy.cpp +++ b/src/mame/drivers/mastboy.cpp @@ -806,14 +806,13 @@ void mastboy_state::machine_reset() std::fill(&m_vram[0], &m_vram[m_vram.bytes()], 0); } +void mastboy_state::mastboy(machine_config &config) +{ + Z180(config, m_maincpu, 12000000/2); /* HD647180X0CP6-1M1R */ + m_maincpu->set_addrmap(AS_PROGRAM, &mastboy_state::mastboy_map); + m_maincpu->set_addrmap(AS_IO, &mastboy_state::mastboy_io_map); - -MACHINE_CONFIG_START(mastboy_state::mastboy) - MCFG_DEVICE_ADD("maincpu", Z180, 12000000/2) /* HD647180X0CP6-1M1R */ - MCFG_DEVICE_PROGRAM_MAP(mastboy_map) - MCFG_DEVICE_IO_MAP(mastboy_io_map) - - EEPROM_2816(config, "earom"); + EEPROM_2816(config, m_earom); LS259(config, m_outlatch); // IC17 m_outlatch->q_out_cb<0>().set(FUNC(mastboy_state::irq0_ack_w)); @@ -825,28 +824,27 @@ MACHINE_CONFIG_START(mastboy_state::mastboy) ADDRESS_MAP_BANK(config, "bank_c000").set_map(&mastboy_state::bank_c000_map).set_options(ENDIANNESS_LITTLE, 8, 22, 0x4000); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(6000000.0f / 384.0f / 282.0f) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(mastboy_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, mastboy_state, vblank_irq)) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mastboy) - MCFG_PALETTE_ADD("palette", 0x100) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(6000000.0f / 384.0f / 282.0f); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(256, 256); + screen.set_visarea(0, 256-1, 16, 256-16-1); + screen.set_screen_update(FUNC(mastboy_state::screen_update)); + screen.set_palette(m_palette); + screen.screen_vblank().set(FUNC(mastboy_state::vblank_irq)); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_mastboy); + PALETTE(config, m_palette, 0x100); // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_SAA1099_ADD("saa", 6000000 ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(*this, mastboy_state, adpcm_int)) /* interrupt function */ - MCFG_MSM5205_PRESCALER_SELECTOR(SEX_4B) /* 4KHz 4-bit */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + SAA1099(config, "saa", 6000000).add_route(ALL_OUTPUTS, "mono", 0.50); + + MSM5205(config, m_msm, 384000); + m_msm->vck_legacy_callback().set(FUNC(mastboy_state::adpcm_int)); /* interrupt function */ + m_msm->set_prescaler_selector(msm5205_device::SEX_4B); /* 4KHz 4-bit */ + m_msm->add_route(ALL_OUTPUTS, "mono", 0.50); +} /* Romsets */ diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp index 4c0e041edeb..6c7db86d86f 100644 --- a/src/mame/drivers/mpu4vid.cpp +++ b/src/mame/drivers/mpu4vid.cpp @@ -1277,9 +1277,10 @@ void mpu4_state::mpu4_6809_map(address_map &map) -MACHINE_CONFIG_START(mpu4vid_state::mpu4_vid) - MCFG_DEVICE_ADD("maincpu", MC6809, MPU4_MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(mpu4_6809_map) +void mpu4vid_state::mpu4_vid(machine_config &config) +{ + MC6809(config, m_maincpu, MPU4_MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::mpu4_6809_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* confirm */ @@ -1291,7 +1292,7 @@ MACHINE_CONFIG_START(mpu4vid_state::mpu4_vid) // note this directly affects the scanline counters used below, and thus the timing of everything screen.set_screen_update("scn2674_vid", FUNC(scn2674_device::screen_update)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfxdecode_device::empty) + GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty); SCN2674(config, m_scn2674, VIDEO_MASTER_CLOCK / 8); m_scn2674->intr_callback().set_inputline("video", M68K_IRQ_3); @@ -1299,20 +1300,18 @@ MACHINE_CONFIG_START(mpu4vid_state::mpu4_vid) m_scn2674->set_display_callback(FUNC(mpu4vid_state::display_pixels)); m_scn2674->set_addrmap(0, &mpu4vid_state::mpu4_vram); + M68000(config, m_videocpu, VIDEO_MASTER_CLOCK); + m_videocpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::mpu4_68k_map); - MCFG_DEVICE_ADD("video", M68000, VIDEO_MASTER_CLOCK ) - MCFG_DEVICE_PROGRAM_MAP(mpu4_68k_map) - -// MCFG_QUANTUM_TIME(attotime::from_hz(960)) +// config.m_minimum_quantum = attotime::from_hz(960); MCFG_MACHINE_START_OVERRIDE(mpu4vid_state,mpu4_vid) MCFG_MACHINE_RESET_OVERRIDE(mpu4vid_state,mpu4_vid) MCFG_VIDEO_START_OVERRIDE (mpu4vid_state,mpu4_vid) - MCFG_PALETTE_ADD("palette", ef9369_device::NUMCOLORS) + PALETTE(config, m_palette, ef9369_device::NUMCOLORS); - MCFG_EF9369_ADD("ef9369") - MCFG_EF9369_COLOR_UPDATE_CB(mpu4vid_state, ef9369_color_update) + EF9369(config, "ef9369").set_color_update_callback(FUNC(mpu4vid_state::ef9369_color_update)); PTM6840(config, m_ptm, VIDEO_MASTER_CLOCK / 10); /* 68k E clock */ m_ptm->set_external_clocks(0, 0, 0); @@ -1324,9 +1323,9 @@ MACHINE_CONFIG_START(mpu4vid_state::mpu4_vid) /* Present on all video cards */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_SAA1099_ADD("saa", 8000000) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) + saa1099_device &saa(SAA1099(config, "saa", 8000000)); + saa.add_route(0, "lspeaker", 0.5); + saa.add_route(1, "rspeaker", 0.5); ACIA6850(config, m_acia_0, 0); m_acia_0->txd_handler().set("acia6850_1", FUNC(acia6850_device::write_rxd)); @@ -1337,44 +1336,45 @@ MACHINE_CONFIG_START(mpu4vid_state::mpu4_vid) m_acia_1->txd_handler().set("acia6850_0", FUNC(acia6850_device::write_rxd)); m_acia_1->rts_handler().set("acia6850_0", FUNC(acia6850_device::write_dcd)); m_acia_1->irq_handler().set(FUNC(mpu4vid_state::m68k_acia_irq)); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mpu4vid_state::crmaze) +void mpu4vid_state::crmaze(machine_config &config) +{ mpu4_vid(config); m_pia5->readpa_handler().set(FUNC(mpu4vid_state::pia_ic5_porta_track_r)); m_pia5->writepa_handler().set_nop(); m_pia5->writepb_handler().set_nop(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mpu4vid_state::mating) +void mpu4vid_state::mating(machine_config &config) +{ crmaze(config); - MCFG_DEVICE_MODIFY("video") - MCFG_DEVICE_PROGRAM_MAP(mpu4oki_68k_map) + m_videocpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::mpu4oki_68k_map); mpu4_common2(config); - MCFG_DEVICE_ADD("msm6376", OKIM6376, 128000) //? - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) -MACHINE_CONFIG_END + okim6376_device &msm6376(OKIM6376(config, "msm6376", 128000)); //? + msm6376.add_route(0, "lspeaker", 0.5); + msm6376.add_route(1, "rspeaker", 0.5); +} -MACHINE_CONFIG_START(mpu4vid_state::bwbvid) +void mpu4vid_state::bwbvid(machine_config &config) +{ mpu4_vid(config); - MCFG_DEVICE_MODIFY("video") - MCFG_DEVICE_PROGRAM_MAP(bwbvid_68k_map) -MACHINE_CONFIG_END + m_videocpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::bwbvid_68k_map); +} -MACHINE_CONFIG_START(mpu4vid_state::bwbvid5) +void mpu4vid_state::bwbvid5(machine_config &config) +{ bwbvid(config); - MCFG_DEVICE_MODIFY("video") - MCFG_DEVICE_PROGRAM_MAP(bwbvid5_68k_map) + m_videocpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::bwbvid5_68k_map); mpu4_common2(config); - MCFG_DEVICE_ADD("msm6376", OKIM6376, 128000) //? - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) -MACHINE_CONFIG_END + okim6376_device &msm6376(OKIM6376(config, "msm6376", 128000)); //? + msm6376.add_route(0, "lspeaker", 0.5); + msm6376.add_route(1, "rspeaker", 0.5); +} /* Characteriser (CHR) diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp index 935ca51809d..9f9f49b00f4 100644 --- a/src/mame/drivers/psikyo.cpp +++ b/src/mame/drivers/psikyo.cpp @@ -1023,44 +1023,43 @@ void psikyo_state::machine_reset() ***************************************************************************/ -MACHINE_CONFIG_START(psikyo_state::sngkace) - +void psikyo_state::sngkace(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, XTAL(32'000'000)/2) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(sngkace_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", psikyo_state, irq1_line_hold) + M68EC020(config, m_maincpu, XTAL(32'000'000)/2); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo_state::sngkace_map); + m_maincpu->set_vblank_int("screen", FUNC(psikyo_state::irq1_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(32'000'000)/8) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(sngkace_sound_map) - MCFG_DEVICE_IO_MAP(sngkace_sound_io_map) + Z80(config, m_audiocpu, XTAL(32'000'000)/8); /* verified on pcb */ + m_audiocpu->set_addrmap(AS_PROGRAM, &psikyo_state::sngkace_sound_map); + m_audiocpu->set_addrmap(AS_IO, &psikyo_state::sngkace_sound_io_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.3) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) // we're using PORT_VBLANK - MCFG_SCREEN_SIZE(320, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo_state, screen_update_psikyo) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, psikyo_state, screen_vblank_psikyo)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_psikyo) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.3); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK + m_screen->set_size(320, 256); + m_screen->set_visarea(0, 320-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(psikyo_state::screen_update_psikyo)); + m_screen->screen_vblank().set(FUNC(psikyo_state::screen_vblank_psikyo)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_psikyo); + PALETTE(config, m_palette, 0x1000).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); MCFG_VIDEO_START_OVERRIDE(psikyo_state,sngkace) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2610, XTAL(32'000'000)/4) /* verified on pcb */ - MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(32'000'000)/4)); /* verified on pcb */ + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); m_soundlatch->set_separate_acknowledge(true); -MACHINE_CONFIG_END +} @@ -1069,81 +1068,79 @@ MACHINE_CONFIG_END ***************************************************************************/ -MACHINE_CONFIG_START(psikyo_state::gunbird) - +void psikyo_state::gunbird(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, 16000000) - MCFG_DEVICE_PROGRAM_MAP(gunbird_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", psikyo_state, irq1_line_hold) + M68EC020(config, m_maincpu, 16000000); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo_state::gunbird_map); + m_maincpu->set_vblank_int("screen", FUNC(psikyo_state::irq1_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) /* ! LZ8420M (Z80 core) ! */ - MCFG_DEVICE_PROGRAM_MAP(gunbird_sound_map) - MCFG_DEVICE_IO_MAP(gunbird_sound_io_map) + Z80(config, m_audiocpu, 4000000); /* ! LZ8420M (Z80 core) ! */ + m_audiocpu->set_addrmap(AS_PROGRAM, &psikyo_state::gunbird_sound_map); + m_audiocpu->set_addrmap(AS_IO, &psikyo_state::gunbird_sound_io_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.3) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) // we're using PORT_VBLANK - MCFG_SCREEN_SIZE(320, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo_state, screen_update_psikyo) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, psikyo_state, screen_vblank_psikyo)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_psikyo) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.3); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK + m_screen->set_size(320, 256); + m_screen->set_visarea(0, 320-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(psikyo_state::screen_update_psikyo)); + m_screen->screen_vblank().set(FUNC(psikyo_state::screen_vblank_psikyo)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_psikyo); + PALETTE(config, m_palette, 0x1000).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); MCFG_VIDEO_START_OVERRIDE(psikyo_state,psikyo) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2610, 8000000) - MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000)); + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); m_soundlatch->set_separate_acknowledge(true); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(psikyo_state::s1945jn) +void psikyo_state::s1945jn(machine_config &config) +{ gunbird(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(s1945jn_map) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(psikyo_state::s1945bl) /* Bootleg hardware based on the unprotected Japanese Strikers 1945 set */ + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo_state::s1945jn_map); +} +void psikyo_state::s1945bl(machine_config &config) /* Bootleg hardware based on the unprotected Japanese Strikers 1945 set */ +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, 16000000) - MCFG_DEVICE_PROGRAM_MAP(psikyo_bootleg_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", psikyo_state, irq1_line_hold) + M68EC020(config, m_maincpu, 16000000); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo_state::psikyo_bootleg_map); + m_maincpu->set_vblank_int("screen", FUNC(psikyo_state::irq1_line_hold)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.3) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) // we're using PORT_VBLANK - MCFG_SCREEN_SIZE(320, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo_state, screen_update_psikyo_bootleg) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, psikyo_state, screen_vblank_psikyo)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_psikyo) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.3); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK + m_screen->set_size(320, 256); + m_screen->set_visarea(0, 320-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(psikyo_state::screen_update_psikyo_bootleg)); + m_screen->screen_vblank().set(FUNC(psikyo_state::screen_vblank_psikyo)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_psikyo); + PALETTE(config, m_palette, 0x1000).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); MCFG_VIDEO_START_OVERRIDE(psikyo_state,psikyo) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(16'000'000)/16, okim6295_device::PIN7_LOW) // ?? clock - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADDRESS_MAP(0, s1945bl_oki_map) -MACHINE_CONFIG_END + OKIM6295(config, m_oki, XTAL(16'000'000)/16, okim6295_device::PIN7_LOW); // ?? clock + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); + m_oki->set_addrmap(0, &psikyo_state::s1945bl_oki_map); +} @@ -1151,48 +1148,45 @@ MACHINE_CONFIG_END Strikers 1945 / Tengai ***************************************************************************/ - -MACHINE_CONFIG_START(psikyo_state::s1945) - +void psikyo_state::s1945(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68EC020, 16000000) - MCFG_DEVICE_PROGRAM_MAP(s1945_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", psikyo_state, irq1_line_hold) + M68EC020(config, m_maincpu, 16000000); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo_state::s1945_map); + m_maincpu->set_vblank_int("screen", FUNC(psikyo_state::irq1_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, 4000000) /* ! LZ8420M (Z80 core) ! */ - MCFG_DEVICE_PROGRAM_MAP(gunbird_sound_map) - MCFG_DEVICE_IO_MAP(s1945_sound_io_map) + Z80(config, m_audiocpu, 4000000); /* ! LZ8420M (Z80 core) ! */ + m_audiocpu->set_addrmap(AS_PROGRAM, &psikyo_state::gunbird_sound_map); + m_audiocpu->set_addrmap(AS_IO, &psikyo_state::s1945_sound_io_map); - MCFG_DEVICE_ADD("mcu", PIC16C57, 4000000) /* 4 MHz? */ - MCFG_DEVICE_DISABLE() /* Internal ROM aren't dumped */ + PIC16C57(config, "mcu", 4000000).set_disable(); /* 4 MHz? */ /* Internal ROM is't dumped */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.90) /* verified on pcb */ - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) // we're using PORT_VBLANK - MCFG_SCREEN_SIZE(320, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo_state, screen_update_psikyo) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, psikyo_state, screen_vblank_psikyo)) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_psikyo) - MCFG_PALETTE_ADD("palette", 0x1000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.90); /* verified on pcb */ + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK + m_screen->set_size(320, 256); + m_screen->set_visarea(0, 320-1, 0, 256-32-1); + m_screen->set_screen_update(FUNC(psikyo_state::screen_update_psikyo)); + m_screen->screen_vblank().set(FUNC(psikyo_state::screen_vblank_psikyo)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_psikyo); + PALETTE(config, m_palette, 0x1000).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); MCFG_VIDEO_START_OVERRIDE(psikyo_state,psikyo) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymf", YMF278B, YMF278B_STD_CLOCK) - MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK)); + ymf.irq_handler().set_inputline("audiocpu", 0); + ymf.add_route(ALL_OUTPUTS, "mono", 1.0); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); m_soundlatch->set_separate_acknowledge(true); -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/psikyo4.cpp b/src/mame/drivers/psikyo4.cpp index 0701e399a8b..95b83cbbd28 100644 --- a/src/mame/drivers/psikyo4.cpp +++ b/src/mame/drivers/psikyo4.cpp @@ -598,64 +598,60 @@ void psikyo4_state::machine_reset() m_oldbrt[1] = -1; } -MACHINE_CONFIG_START(psikyo4_state::ps4big) - +void psikyo4_state::ps4big(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", SH2, 57272700/2) - MCFG_DEVICE_PROGRAM_MAP(ps4_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("lscreen", psikyo4_state, interrupt) + SH2(config, m_maincpu, 57272700/2); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyo4_state::ps4_map); + m_maincpu->set_vblank_int("lscreen", FUNC(psikyo4_state::interrupt)); - EEPROM_93C56_8BIT(config, "eeprom").default_value(0); + EEPROM_93C56_8BIT(config, m_eeprom).default_value(0); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "lpalette", gfx_ps4) - MCFG_PALETTE_ADD("lpalette", (0x2000/4) + 1) /* palette + clear colour */ - MCFG_PALETTE_ADD("rpalette", (0x2000/4) + 1) + GFXDECODE(config, m_gfxdecode, m_palette[0], gfx_ps4); + PALETTE(config, m_palette[0], (0x2000/4) + 1); /* palette + clear colour */ + PALETTE(config, m_palette[1], (0x2000/4) + 1); config.set_default_layout(layout_dualhsxs); - MCFG_SCREEN_ADD("lscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(40*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo4_state, screen_update<0>) - MCFG_SCREEN_PALETTE("lpalette") - - MCFG_SCREEN_ADD("rscreen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(40*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyo4_state, screen_update<1>) - MCFG_SCREEN_PALETTE("rpalette") + SCREEN(config, m_lscreen, SCREEN_TYPE_RASTER); + m_lscreen->set_refresh_hz(60); + m_lscreen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_lscreen->set_size(40*8, 32*8); + m_lscreen->set_visarea(0*8, 40*8-1, 0*8, 28*8-1); + m_lscreen->set_screen_update(FUNC(psikyo4_state::screen_update<0>)); + m_lscreen->set_palette(m_palette[0]); + + SCREEN(config, m_rscreen, SCREEN_TYPE_RASTER); + m_rscreen->set_refresh_hz(60); + m_rscreen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_rscreen->set_size(40*8, 32*8); + m_rscreen->set_visarea(0*8, 40*8-1, 0*8, 28*8-1); + m_rscreen->set_screen_update(FUNC(psikyo4_state::screen_update<1>)); + m_rscreen->set_palette(m_palette[1]); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymf", YMF278B, 57272700/2) - MCFG_DEVICE_ADDRESS_MAP(0, ps4_ymf_map) - MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("maincpu", 12)) - MCFG_SOUND_ROUTE(0, "rspeaker", 1.0) // Output for each screen - MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(2, "rspeaker", 1.0) - MCFG_SOUND_ROUTE(3, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(4, "rspeaker", 1.0) - MCFG_SOUND_ROUTE(5, "lspeaker", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(psikyo4_state::ps4small) - ps4big(config); - - /* basic machine hardware */ + ymf278b_device &ymf(YMF278B(config, "ymf", 57272700/2)); + ymf.set_addrmap(0, &psikyo4_state::ps4_ymf_map); + ymf.irq_handler().set_inputline("maincpu", 12); + ymf.add_route(0, "rspeaker", 1.0); // Output for each screen + ymf.add_route(1, "lspeaker", 1.0); + ymf.add_route(2, "rspeaker", 1.0); + ymf.add_route(3, "lspeaker", 1.0); + ymf.add_route(4, "rspeaker", 1.0); + ymf.add_route(5, "lspeaker", 1.0); +} - MCFG_SCREEN_MODIFY("lscreen") - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) +void psikyo4_state::ps4small(machine_config &config) +{ + ps4big(config); - MCFG_SCREEN_MODIFY("rscreen") - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) -MACHINE_CONFIG_END + m_lscreen->set_visarea(0*8, 40*8-1, 0*8, 30*8-1); + m_rscreen->set_visarea(0*8, 40*8-1, 0*8, 30*8-1); +} diff --git a/src/mame/drivers/psikyosh.cpp b/src/mame/drivers/psikyosh.cpp index bb26dbe5b5c..123edf11b55 100644 --- a/src/mame/drivers/psikyosh.cpp +++ b/src/mame/drivers/psikyosh.cpp @@ -777,62 +777,54 @@ void psikyosh_state::machine_start() } -MACHINE_CONFIG_START(psikyosh_state::psikyo3v1) - +void psikyosh_state::psikyo3v1(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", SH2, MASTER_CLOCK/2) - MCFG_DEVICE_PROGRAM_MAP(ps3v1_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", psikyosh_state, psikyosh_interrupt) + SH2(config, m_maincpu, MASTER_CLOCK/2); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyosh_state::ps3v1_map); + m_maincpu->set_vblank_int("screen", FUNC(psikyosh_state::psikyosh_interrupt)); WATCHDOG_TIMER(config, "watchdog"); - EEPROM_93C56_8BIT(config, "eeprom").default_value(0); + EEPROM_93C56_8BIT(config, m_eeprom).default_value(0); /* video hardware */ - MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM32) /* If using alpha */ + BUFFERED_SPRITERAM32(config, m_spriteram); /* If using alpha */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(psikyosh_state, screen_update_psikyosh) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram32_device, vblank_copy_rising)) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_psikyosh) - MCFG_PALETTE_ADD("palette", 0x5000/4) - MCFG_PALETTE_FORMAT(RGBX) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(64*8, 32*8); + m_screen->set_visarea(0, 40*8-1, 0, 28*8-1); + m_screen->set_screen_update(FUNC(psikyosh_state::screen_update_psikyosh)); + m_screen->screen_vblank().set("spriteram", FUNC(buffered_spriteram32_device::vblank_copy_rising)); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_psikyosh); + PALETTE(config, m_palette, 0x5000/4).set_format(PALETTE_FORMAT_RGBX); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymf", YMF278B, MASTER_CLOCK/2) - MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("maincpu", 12)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + ymf278b_device &ymf(YMF278B(config, "ymf", MASTER_CLOCK/2)); + ymf.irq_handler().set_inputline("maincpu", 12); + ymf.add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(psikyosh_state::psikyo5) +void psikyosh_state::psikyo5(machine_config &config) +{ psikyo3v1(config); + m_maincpu->set_addrmap(AS_PROGRAM, &psikyosh_state::ps5_map); +} - /* basic machine hardware */ - - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ps5_map) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(psikyosh_state::psikyo5_240) +void psikyosh_state::psikyo5_240(machine_config &config) +{ psikyo3v1(config); - /* basic machine hardware */ - - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ps5_map) + m_maincpu->set_addrmap(AS_PROGRAM, &psikyosh_state::ps5_map); /* Measured Hsync 16.165 KHz, Vsync 61.68 Hz */ /* Ideally this would be driven off the video register. However, it doesn't changeat runtime and MAME will pick a better screen resolution if it knows upfront */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/8, 443, 0, 40*8, 262, 0, 30*8) -MACHINE_CONFIG_END + m_screen->set_raw(MASTER_CLOCK/8, 443, 0, 40*8, 262, 0, 30*8); +} /* PS3 */ diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp index ada3169c91a..2f13fdd8745 100644 --- a/src/mame/drivers/samcoupe.cpp +++ b/src/mame/drivers/samcoupe.cpp @@ -504,59 +504,57 @@ static void samcoupe_floppies(device_slot_interface &device) device.option_add("35dd", FLOPPY_35_DD); } - -MACHINE_CONFIG_START(samcoupe_state::samcoupe) +void samcoupe_state::samcoupe(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, SAMCOUPE_XTAL_X1 / 4) /* 6 MHz */ - MCFG_DEVICE_PROGRAM_MAP(samcoupe_mem) - MCFG_DEVICE_IO_MAP(samcoupe_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", samcoupe_state, samcoupe_frame_interrupt) - + Z80(config, m_maincpu, SAMCOUPE_XTAL_X1 / 4); /* 6 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &samcoupe_state::samcoupe_mem); + m_maincpu->set_addrmap(AS_IO, &samcoupe_state::samcoupe_io); + m_maincpu->set_vblank_int("screen", FUNC(samcoupe_state::samcoupe_frame_interrupt)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(SAMCOUPE_XTAL_X1/2, SAM_TOTAL_WIDTH, 0, SAM_BORDER_LEFT + SAM_SCREEN_WIDTH + SAM_BORDER_RIGHT, SAM_TOTAL_HEIGHT, 0, SAM_BORDER_TOP + SAM_SCREEN_HEIGHT + SAM_BORDER_BOTTOM) - MCFG_SCREEN_UPDATE_DRIVER(samcoupe_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(SAMCOUPE_XTAL_X1/2, SAM_TOTAL_WIDTH, 0, SAM_BORDER_LEFT + SAM_SCREEN_WIDTH + SAM_BORDER_RIGHT, + SAM_TOTAL_HEIGHT, 0, SAM_BORDER_TOP + SAM_SCREEN_HEIGHT + SAM_BORDER_BOTTOM); + m_screen->set_screen_update(FUNC(samcoupe_state::screen_update)); + m_screen->set_palette("palette"); - MCFG_PALETTE_ADD("palette", 128) - MCFG_PALETTE_INIT_OWNER(samcoupe_state, samcoupe) + PALETTE(config, "palette", 128).set_init(FUNC(samcoupe_state::palette_init_samcoupe)); /* devices */ - MCFG_DEVICE_ADD(m_lpt1, CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, samcoupe_state, write_lpt1_busy)) + CENTRONICS(config, m_lpt1, centronics_devices, "printer"); + m_lpt1->busy_handler().set(FUNC(samcoupe_state::write_lpt1_busy)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("lpt1_data_out", "lpt1") + output_latch_device &lpt1_data_out(OUTPUT_LATCH(config, "lpt1_data_out")); + m_lpt1->set_output_latch(lpt1_data_out); - MCFG_DEVICE_ADD(m_lpt2, CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, samcoupe_state, write_lpt2_busy)) + CENTRONICS(config, m_lpt2, centronics_devices, "printer"); + m_lpt2->busy_handler().set(FUNC(samcoupe_state::write_lpt2_busy)); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("lpt2_data_out", "lpt2") + output_latch_device &lpt2_data_out(OUTPUT_LATCH(config, "lpt2_data_out")); + m_lpt2->set_output_latch(lpt2_data_out); - MCFG_DEVICE_ADD("sambus_clock", MSM6242, 32.768_kHz_XTAL) - MCFG_CASSETTE_ADD("cassette") - MCFG_CASSETTE_FORMATS(tzx_cassette_formats) - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) - MCFG_CASSETTE_INTERFACE("samcoupe_cass") + MSM6242(config, m_rtc, 32.768_kHz_XTAL); - MCFG_SOFTWARE_LIST_ADD("cass_list","samcoupe_cass") + CASSETTE(config, m_cassette); + m_cassette->set_formats(tzx_cassette_formats); + m_cassette->set_default_state((cassette_state)(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED)); + m_cassette->set_interface("samcoupe_cass"); + SOFTWARE_LIST(config, "cass_list").set_original("samcoupe_cass"); WD1772(config, m_fdc, SAMCOUPE_XTAL_X1/3); - MCFG_FLOPPY_DRIVE_ADD("wd1772:0", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("wd1772:1", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats) - MCFG_SOFTWARE_LIST_ADD("flop_list","samcoupe_flop") + FLOPPY_CONNECTOR(config, "wd1772:0", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats); + FLOPPY_CONNECTOR(config, "wd1772:1", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats); + SOFTWARE_LIST(config, "flop_list").set_original("samcoupe_flop"); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SAA1099_ADD("saa1099", SAMCOUPE_XTAL_X1/3) /* 8 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); + SAA1099(config, "saa1099", SAMCOUPE_XTAL_X1/3).add_route(ALL_OUTPUTS, "mono", 0.50); /* 8 MHz */ /* internal ram */ RAM(config, RAM_TAG).set_default_size("512K").set_extra_options("256K,1280K,1536K,2304K,2560K,3328K,3584K,4352K,4608K"); -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp index 3da8c96d999..d507509c783 100644 --- a/src/mame/drivers/ssv.cpp +++ b/src/mame/drivers/ssv.cpp @@ -2516,68 +2516,64 @@ void ssv_state::init_jsk() { init(0); save_item(NAME(m_latches)); } #define SSV_VBEND 0 #define SSV_VBSTART 0xf0 -MACHINE_CONFIG_START(ssv_state::ssv) - +void ssv_state::ssv(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", V60, SSV_MASTER_CLOCK) /* Based on STA-0001 & STA-0001B System boards */ - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(ssv_state,irq_callback) + V60(config, m_maincpu, SSV_MASTER_CLOCK); /* Based on STA-0001 & STA-0001B System boards */ + m_maincpu->set_irq_acknowledge_callback(FUNC(ssv_state::irq_callback)); - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ssv_state, interrupt, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(ssv_state::interrupt), "screen", 0, 1); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(SSV_PIXEL_CLOCK,SSV_HTOTAL,SSV_HBEND,SSV_HBSTART,SSV_VTOTAL,SSV_VBEND,SSV_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(SSV_PIXEL_CLOCK,SSV_HTOTAL,SSV_HBEND,SSV_HBSTART,SSV_VTOTAL,SSV_VBEND,SSV_VBSTART); + m_screen->set_screen_update(FUNC(ssv_state::screen_update)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ssv) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_FORMAT(XRGB) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ssv); + PALETTE(config, m_palette, 0x8000).set_format(PALETTE_FORMAT_XRGB); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ensoniq", ES5506, SSV_MASTER_CLOCK) - MCFG_ES5506_REGION0("ensoniq.0") - MCFG_ES5506_REGION1("ensoniq.1") - MCFG_ES5506_REGION2("ensoniq.2") - MCFG_ES5506_REGION3("ensoniq.3") - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_SOUND_ROUTE(0, "lspeaker", 0.1) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.1) -MACHINE_CONFIG_END - + ES5506(config, m_ensoniq, SSV_MASTER_CLOCK); + m_ensoniq->set_region0("ensoniq.0"); + m_ensoniq->set_region1("ensoniq.1"); + m_ensoniq->set_region2("ensoniq.2"); + m_ensoniq->set_region3("ensoniq.3"); + m_ensoniq->set_channels(1); + m_ensoniq->add_route(0, "lspeaker", 0.1); + m_ensoniq->add_route(1, "rspeaker", 0.1); +} -MACHINE_CONFIG_START(ssv_state::drifto94) +void ssv_state::drifto94(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(drifto94_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::drifto94_map); - MCFG_DEVICE_ADD("dsp", UPD96050, 10000000) /* TODO: correct? */ - MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map) - MCFG_DEVICE_DATA_MAP(dsp_data_map) + UPD96050(config, m_dsp, 10000000); /* TODO: correct? */ + m_dsp->set_addrmap(AS_PROGRAM, &ssv_state::dsp_prg_map); + m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcd-0x25)*2-1, 0, (0x101-0x13)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xcd-0x25)*2-1, 0, (0x101-0x13)-1); +} -MACHINE_CONFIG_START(ssv_state::gdfs) +void ssv_state::gdfs(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(gdfs_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::gdfs_map); - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); ADC0809(config, m_adc, 1000000); // unknown clock m_adc->in_callback<0>().set_ioport("GUNX1"); @@ -2587,214 +2583,190 @@ MACHINE_CONFIG_START(ssv_state::gdfs) m_adc->eoc_callback().set(FUNC(ssv_state::gdfs_adc_int_w)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd5-0x2c)*2-1, 0, (0x102-0x12)-1) - MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update_gdfs) + m_screen->set_visarea(0, (0xd5-0x2c)*2-1, 0, (0x102-0x12)-1); + m_screen->set_screen_update(FUNC(ssv_state::screen_update_gdfs)); ST0020_SPRITES(config, m_gdfs_st0020, 0); m_gdfs_st0020->set_palette(m_palette); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_gdfs) - MCFG_VIDEO_START_OVERRIDE(ssv_state,gdfs) -MACHINE_CONFIG_END + m_gfxdecode->set_info(gfx_gdfs); + MCFG_VIDEO_START_OVERRIDE(ssv_state,gdfs) +} -MACHINE_CONFIG_START(ssv_state::hypreact) +void ssv_state::hypreact(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hypreact_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::hypreact_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::hypreac2) +void ssv_state::hypreac2(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hypreac2_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::hypreac2_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xcb-0x22)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::janjans1) +void ssv_state::janjans1(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(janjans1_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::janjans1_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x23)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xcb-0x23)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::keithlcy) +void ssv_state::keithlcy(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(keithlcy_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::keithlcy_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcd-0x25)*2-1, 0, (0x101 - 0x13)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xcd-0x25)*2-1, 0, (0x101 - 0x13)-1); +} -MACHINE_CONFIG_START(ssv_state::meosism) +void ssv_state::meosism(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(meosism_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::meosism_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd5-0x2c)*2-1, 0, (0xfe - 0x12)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd5-0x2c)*2-1, 0, (0xfe - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::mslider) +void ssv_state::mslider(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(mslider_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::mslider_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd6-0x26)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd6-0x26)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::ryorioh) +void ssv_state::ryorioh(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ryorioh_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::ryorioh_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb-0x23)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xcb-0x23)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::vasara) +void ssv_state::vasara(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ryorioh_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::ryorioh_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcc-0x24)*2-1, 0,(0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xcc-0x24)*2-1, 0,(0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::srmp4) +void ssv_state::srmp4(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(srmp4_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::srmp4_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::srmp7) +void ssv_state::srmp7(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(srmp7_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::srmp7_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0xfd - 0x0e)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd4-0x2c)*2-1, 0, (0xfd - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::stmblade) +void ssv_state::stmblade(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(drifto94_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::drifto94_map); - MCFG_DEVICE_ADD("dsp", UPD96050, 10000000) - MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map) - MCFG_DEVICE_DATA_MAP(dsp_data_map) + UPD96050(config, m_dsp, 10000000); + m_dsp->set_addrmap(AS_PROGRAM, &ssv_state::dsp_prg_map); + m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map); /* don't need this, game just does a simple check at boot then the DSP stalls into a tight loop. */ // MCFG_QUANTUM_PERFECT_CPU("maincpu") NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd6-0x26)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + /* video hardware */ + m_screen->set_visarea(0, (0xd6-0x26)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::survarts) +void ssv_state::survarts(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(survarts_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::survarts_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::dynagear) +void ssv_state::dynagear(machine_config &config) +{ survarts(config); - /* basic machine hardware */ /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::eaglshot) +void ssv_state::eaglshot(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(eaglshot_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::eaglshot_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -2805,114 +2777,105 @@ MACHINE_CONFIG_START(ssv_state::eaglshot) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xca - 0x2a)*2-1, 0, (0xf6 - 0x16)-1) - MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update_eaglshot) + m_screen->set_visarea(0, (0xca - 0x2a)*2-1, 0, (0xf6 - 0x16)-1); + m_screen->set_screen_update(FUNC(ssv_state::screen_update_eaglshot)); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_eaglshot) - MCFG_VIDEO_START_OVERRIDE(ssv_state,eaglshot) -MACHINE_CONFIG_END + m_gfxdecode->set_info(gfx_eaglshot); + MCFG_VIDEO_START_OVERRIDE(ssv_state,eaglshot) +} -MACHINE_CONFIG_START(ssv_state::sxyreact) +void ssv_state::sxyreact(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sxyreact_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::sxyreac2) +void ssv_state::sxyreac2(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sxyreact_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x23)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xcb - 0x23)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::cairblad) +void ssv_state::cairblad(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sxyreact_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1); +} -MACHINE_CONFIG_START(ssv_state::twineag2) +void ssv_state::twineag2(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(twineag2_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::twineag2_map); - MCFG_DEVICE_ADD("dsp", UPD96050, 10000000) - MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map) - MCFG_DEVICE_DATA_MAP(dsp_data_map) + UPD96050(config, m_dsp, 10000000); + m_dsp->set_addrmap(AS_PROGRAM, &ssv_state::dsp_prg_map); + m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::ultrax) +void ssv_state::ultrax(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ultrax_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::ultrax_map); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xd4 - 0x2c)*2-1, 0, (0x102 - 0x12)-1); +} -MACHINE_CONFIG_START(ssv_state::jsk) +void ssv_state::jsk(machine_config &config) +{ ssv(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(jsk_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::jsk_map); - MCFG_DEVICE_ADD("sub", V810,25000000) - MCFG_DEVICE_PROGRAM_MAP(jsk_v810_mem) + V810(config, "sub", 25000000).set_addrmap(AS_PROGRAM, &ssv_state::jsk_v810_mem); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, (0xca - 0x22)*2-1, 0, (0xfe - 0x0e)-1) -MACHINE_CONFIG_END + m_screen->set_visarea(0, (0xca - 0x22)*2-1, 0, (0xfe - 0x0e)-1); +} /*************************************************************************** diff --git a/src/mame/drivers/tandy1t.cpp b/src/mame/drivers/tandy1t.cpp index 250991c33c0..eb07e4b6e65 100644 --- a/src/mame/drivers/tandy1t.cpp +++ b/src/mame/drivers/tandy1t.cpp @@ -679,7 +679,7 @@ MACHINE_CONFIG_START(tandy1000_state::tandy1000_common) MCFG_DEVICE_ADD("isa_lpt", ISA8_SLOT, 0, "mb:isa", pc_isa8_cards, "lpt", true) MCFG_DEVICE_ADD("isa_com", ISA8_SLOT, 0, "mb:isa", pc_isa8_cards, "com", true) - MCFG_PC_JOY_ADD("pc_joy") + PC_JOY(config, "pc_joy"); /* internal ram */ RAM(config, m_ram).set_default_size("640K"); diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp index 5e0ba808cd3..d84c7a909cc 100644 --- a/src/mame/drivers/timeplt.cpp +++ b/src/mame/drivers/timeplt.cpp @@ -425,11 +425,11 @@ void timeplt_state::machine_reset() { } -MACHINE_CONFIG_START(timeplt_state::timeplt) - +void timeplt_state::timeplt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/3/2) /* not confirmed, but common for Konami games of the era */ - MCFG_DEVICE_PROGRAM_MAP(timeplt_main_map) + Z80(config, m_maincpu, MASTER_CLOCK/3/2); /* not confirmed, but common for Konami games of the era */ + m_maincpu->set_addrmap(AS_PROGRAM, &timeplt_state::timeplt_main_map); LS259(config, m_mainlatch); // B3 m_mainlatch->q_out_cb<0>().set(FUNC(timeplt_state::nmi_enable_w)); @@ -444,34 +444,31 @@ MACHINE_CONFIG_START(timeplt_state::timeplt) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE) - MCFG_SCREEN_REFRESH_RATE(60) - 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(timeplt_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, timeplt_state, vblank_irq)) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_timeplt) - MCFG_PALETTE_ADD("palette", 32*4+64*4) - MCFG_PALETTE_INIT_OWNER(timeplt_state, timeplt) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE); + m_screen->set_refresh_hz(60); + 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(timeplt_state::screen_update)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(timeplt_state::vblank_irq)); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_timeplt); + PALETTE(config, m_palette, 32*4+64*4); + m_palette->set_init(FUNC(timeplt_state::palette_init_timeplt)); /* sound hardware */ + TIMEPLT_AUDIO(config, "timeplt_audio"); +} - MCFG_DEVICE_ADD("timeplt_audio", TIMEPLT_AUDIO) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(timeplt_state::psurge) +void timeplt_state::psurge(machine_config &config) +{ timeplt(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(psurge_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &timeplt_state::psurge_main_map); - MCFG_DEVICE_MODIFY("screen") - MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + m_screen->screen_vblank().set_inputline("maincpu", INPUT_LINE_NMI); m_mainlatch->q_out_cb<0>().set_nop(); m_mainlatch->q_out_cb<4>().set_nop(); @@ -479,31 +476,32 @@ MACHINE_CONFIG_START(timeplt_state::psurge) m_mainlatch->q_out_cb<6>().set_nop(); MCFG_VIDEO_START_OVERRIDE(timeplt_state,psurge) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(timeplt_state::bikkuric) +void timeplt_state::bikkuric(machine_config &config) +{ timeplt(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_chkun) + m_gfxdecode->set_info(gfx_chkun); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(chkun_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &timeplt_state::chkun_main_map); MCFG_VIDEO_START_OVERRIDE(timeplt_state,chkun) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(timeplt_state::chkun) +void timeplt_state::chkun(machine_config &config) +{ bikkuric(config); - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_chkun) + m_gfxdecode->set_info(gfx_chkun); /* sound hardware */ subdevice("timeplt_audio:ay2")->port_a_write_callback().set(FUNC(timeplt_state::chkun_sound_w)); - MCFG_TC8830F_ADD("tc8830f", XTAL(512'000)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "timeplt_audio:mono", 0.10) -MACHINE_CONFIG_END + TC8830F(config, m_tc8830f, XTAL(512'000)); + m_tc8830f->add_route(ALL_OUTPUTS, "timeplt_audio:mono", 0.10); +} diff --git a/src/mame/drivers/tourtabl.cpp b/src/mame/drivers/tourtabl.cpp index d49e499cfca..34917009195 100644 --- a/src/mame/drivers/tourtabl.cpp +++ b/src/mame/drivers/tourtabl.cpp @@ -10,7 +10,7 @@ #include "emu.h" #include "machine/6532riot.h" -#include "cpu/m6502/m6502.h" +#include "cpu/m6502/m6507.h" #include "machine/watchdog.h" #include "sound/tiaintf.h" #include "video/tia.h" @@ -76,7 +76,6 @@ void tourtabl_state::main_map(address_map &map) map(0x0400, 0x047f).ram(); map(0x0500, 0x051f).rw("riot2", FUNC(riot6532_device::read), FUNC(riot6532_device::write)); map(0x0800, 0x1fff).rom(); - map(0xe800, 0xffff).rom(); } @@ -155,10 +154,11 @@ static INPUT_PORTS_START( tourtabl ) INPUT_PORTS_END -MACHINE_CONFIG_START(tourtabl_state::tourtabl) +void tourtabl_state::tourtabl(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK / 3) /* actually M6507 */ - MCFG_DEVICE_PROGRAM_MAP(main_map) + M6507(config, m_maincpu, MASTER_CLOCK / 3); + m_maincpu->set_addrmap(AS_PROGRAM, &tourtabl_state::main_map); riot6532_device &riot1(RIOT6532(config, "riot1", MASTER_CLOCK / 3)); riot1.in_pa_callback().set_ioport("RIOT0_SWA"); @@ -177,38 +177,30 @@ MACHINE_CONFIG_START(tourtabl_state::tourtabl) tia.read_input_port_callback().set(FUNC(tourtabl_state::tourtabl_read_input_port)); tia.databus_contents_callback().set(FUNC(tourtabl_state::tourtabl_get_databus_contents)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK, 228, 34, 34 + 160, 262, 46, 46 + 200 ) - MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update) - MCFG_SCREEN_PALETTE("tia_video:palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(MASTER_CLOCK, 228, 34, 34 + 160, 262, 46, 46 + 200); + screen.set_screen_update("tia_video", FUNC(tia_video_device::screen_update)); + screen.set_palette("tia_video:palette"); /* sound hardware */ SPEAKER(config, "mono").front_center(); - - MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK/114) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + TIA(config, "tia", MASTER_CLOCK/114).add_route(ALL_OUTPUTS, "mono", 1.0); +} ROM_START( tourtabl ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "030751.ab2", 0x0800, 0x0800, CRC(4479a6f7) SHA1(bf3fd859614533a592f831e3539ea0a9d1964c82) ) - ROM_RELOAD( 0xE800, 0x0800 ) ROM_LOAD( "030752.ab3", 0x1000, 0x0800, CRC(c92c49dc) SHA1(cafcf13e1b1087b477a667d1e785f5e2be187b0d) ) - ROM_RELOAD( 0xF000, 0x0800 ) ROM_LOAD( "030753.ab4", 0x1800, 0x0800, CRC(3978b269) SHA1(4fa05c655bb74711eb99428f36df838ec70da699) ) - ROM_RELOAD( 0xF800, 0x0800 ) ROM_END ROM_START( tourtab2 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "030929.ab2", 0x0800, 0x0800, CRC(fcdfafa2) SHA1(f35ab83366a334a110fbba0cef09f4db950dbb68) ) - ROM_RELOAD( 0xE800, 0x0800 ) ROM_LOAD( "030752.ab3", 0x1000, 0x0800, CRC(c92c49dc) SHA1(cafcf13e1b1087b477a667d1e785f5e2be187b0d) ) - ROM_RELOAD( 0xF000, 0x0800 ) ROM_LOAD( "030753.ab4", 0x1800, 0x0800, CRC(3978b269) SHA1(4fa05c655bb74711eb99428f36df838ec70da699) ) - ROM_RELOAD( 0xF800, 0x0800 ) ROM_END diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp index d7e3fe22704..1123561e7e5 100644 --- a/src/mame/drivers/vamphalf.cpp +++ b/src/mame/drivers/vamphalf.cpp @@ -677,7 +677,7 @@ void vamphalf_state::aoh_io(address_map &map) { map(0x0480, 0x0483).w(FUNC(vamphalf_state::eeprom32_w)); map(0x0622, 0x0622).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0662, 0x0662).rw("oki_1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x0662, 0x0662).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x0640, 0x0647).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x0000ff00); map(0x0680, 0x0683).w(FUNC(vamphalf_state::aoh_oki_bank_w)); } @@ -1104,61 +1104,63 @@ static GFXDECODE_START( gfx_vamphalf ) GFXDECODE_ENTRY( "gfx", 0, sprites_layout, 0, 0x80 ) GFXDECODE_END - -MACHINE_CONFIG_START(vamphalf_state::common) - MCFG_DEVICE_ADD("maincpu", E116T, 50000000) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) +void vamphalf_state::common(machine_config &config) +{ + E116T(config, m_maincpu, 50000000); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_state::common_map); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); // various games require fast timing to save settings, probably because our Hyperstone core timings are incorrect - EEPROM_93C46_16BIT(config, "eeprom") - .erase_time(attotime::from_usec(1)) - .write_time(attotime::from_usec(1)); + EEPROM_93C46_16BIT(config, m_eeprom); + m_eeprom->erase_time(attotime::from_usec(1)); + m_eeprom->write_time(attotime::from_usec(1)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(512, 256) - MCFG_SCREEN_VISIBLE_AREA(31, 350, 16, 251) - MCFG_SCREEN_UPDATE_DRIVER(vamphalf_state, screen_update_common) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_vamphalf) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(vamphalf_state::sound_ym_oki) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(59); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 256); + screen.set_visarea(31, 350, 16, 251); + screen.set_screen_update(FUNC(vamphalf_state::screen_update_common)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_vamphalf); +} + +void vamphalf_state::sound_ym_oki(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); YM2151(config, "ymsnd", XTAL(28'000'000)/8).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); /* 3.5MHz */ - MCFG_DEVICE_ADD("oki1", OKIM6295, XTAL(28'000'000)/16 , okim6295_device::PIN7_HIGH) /* 1.75MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + okim6295_device &oki1(OKIM6295(config, "oki1", XTAL(28'000'000)/16 , okim6295_device::PIN7_HIGH)); /* 1.75MHz */ + oki1.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + oki1.add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(vamphalf_state::sound_ym_banked_oki) +void vamphalf_state::sound_ym_banked_oki(machine_config &config) +{ sound_ym_oki(config); + subdevice("oki1")->set_addrmap(0, &vamphalf_state::banked_oki_map); +} - MCFG_DEVICE_MODIFY("oki1") - MCFG_DEVICE_ADDRESS_MAP(0, banked_oki_map) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(vamphalf_state::sound_suplup) +void vamphalf_state::sound_suplup(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); YM2151(config, "ymsnd", XTAL(14'318'181)/4).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); /* 3.579545 MHz */ - MCFG_DEVICE_ADD("oki1", OKIM6295, XTAL(14'318'181)/8, okim6295_device::PIN7_HIGH) /* 1.7897725 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + okim6295_device &oki1(OKIM6295(config, "oki1", XTAL(14'318'181)/8, okim6295_device::PIN7_HIGH)); /* 1.75MHz */ + oki1.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + oki1.add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(vamphalf_state::sound_qs1000) +void vamphalf_state::sound_qs1000(machine_config &config) +{ /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -1167,149 +1169,152 @@ MACHINE_CONFIG_START(vamphalf_state::sound_qs1000) m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq)); m_soundlatch->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000)) - MCFG_QS1000_EXTERNAL_ROM(true) - MCFG_QS1000_IN_P1_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_QS1000_OUT_P3_CB(WRITE8(*this, vamphalf_state, qs1000_p3_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + qs1000_device &qs1000(QS1000(config, "qs1000", XTAL(24'000'000))); + qs1000.set_external_rom(true); + qs1000.p1_in().set("soundlatch", FUNC(generic_latch_8_device::read)); + qs1000.p3_out().set(FUNC(vamphalf_state::qs1000_p3_w)); + qs1000.add_route(0, "lspeaker", 1.0); + qs1000.add_route(1, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(vamphalf_state::vamphalf) +void vamphalf_state::vamphalf(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(vamphalf_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::vamphalf_io); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_qdsp_state::misncrft) +void vamphalf_qdsp_state::misncrft(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", GMS30C2116, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_map) - MCFG_DEVICE_IO_MAP(misncrft_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + GMS30C2116(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_qdsp_state::common_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_qdsp_state::misncrft_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_qs1000(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::coolmini) +void vamphalf_state::coolmini(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(coolmini_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::coolmini_io); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::mrkicker) +void vamphalf_state::mrkicker(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(mrkicker_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::mrkicker_io); sound_ym_banked_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::suplup) +void vamphalf_state::suplup(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(suplup_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::suplup_io); sound_suplup(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::jmpbreak) +void vamphalf_state::jmpbreak(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(jmpbreak_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::jmpbreak_io); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::newxpang) +void vamphalf_state::newxpang(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(mrdig_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::mrdig_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::worldadv) +void vamphalf_state::worldadv(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(worldadv_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::worldadv_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_state::mrdig) +void vamphalf_state::mrdig(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", GMS30C2116, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_map) - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(mrdig_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + GMS30C2116(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_state::common_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::mrdig_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_ym_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_qdsp_state::wyvernwg) +void vamphalf_qdsp_state::wyvernwg(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", E132T, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_32bit_map) - MCFG_DEVICE_IO_MAP(wyvernwg_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + E132T(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_qdsp_state::common_32bit_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_qdsp_state::wyvernwg_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_qs1000(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_nvram_state::finalgdr) +void vamphalf_nvram_state::finalgdr(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", E132T, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_32bit_map) - MCFG_DEVICE_IO_MAP(finalgdr_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + E132T(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_nvram_state::common_32bit_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_nvram_state::finalgdr_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); sound_ym_banked_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_nvram_state::mrkickera) +void vamphalf_nvram_state::mrkickera(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", E132T, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(common_32bit_map) - MCFG_DEVICE_IO_MAP(mrkickera_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + E132T(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_nvram_state::common_32bit_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_nvram_state::mrkickera_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); sound_ym_banked_oki(config); -MACHINE_CONFIG_END - - +} -MACHINE_CONFIG_START(vamphalf_state::aoh) - MCFG_DEVICE_ADD("maincpu", E132XN, XTAL(20'000'000)*4) /* 4x internal multiplier */ - MCFG_DEVICE_PROGRAM_MAP(aoh_map) - MCFG_DEVICE_IO_MAP(aoh_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) +void vamphalf_state::aoh(machine_config &config) +{ + E132XN(config, m_maincpu, XTAL(20'000'000)*4); /* 4x internal multiplier */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_state::aoh_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::aoh_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.185) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(512, 512) - MCFG_SCREEN_VISIBLE_AREA(64, 511-64, 16, 255-16) - MCFG_SCREEN_UPDATE_DRIVER(vamphalf_state, screen_update_aoh) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_vamphalf) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(59.185); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 512); + screen.set_visarea(64, 511-64, 16, 255-16); + screen.set_screen_update(FUNC(vamphalf_state::screen_update_aoh)); + screen.set_palette(m_palette); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_vamphalf); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1317,33 +1322,34 @@ MACHINE_CONFIG_START(vamphalf_state::aoh) YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); - MCFG_DEVICE_ADD("oki_1", OKIM6295, XTAL(32'000'000)/8, okim6295_device::PIN7_HIGH) /* 4MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + okim6295_device &oki1(OKIM6295(config, "oki1", XTAL(32'000'000)/8, okim6295_device::PIN7_HIGH)); /* 4MHz */ + oki1.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + oki1.add_route(ALL_OUTPUTS, "rspeaker", 1.0); - MCFG_DEVICE_ADD("oki2", OKIM6295, XTAL(32'000'000)/32, okim6295_device::PIN7_HIGH) /* 1MHz */ - MCFG_DEVICE_ADDRESS_MAP(0, banked_oki_map) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + okim6295_device &oki2(OKIM6295(config, "oki2", XTAL(32'000'000)/32, okim6295_device::PIN7_HIGH)); /* 1MHz */ + oki2.set_addrmap(0, &vamphalf_state::banked_oki_map); + oki2.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + oki2.add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} -MACHINE_CONFIG_START(vamphalf_state::boonggab) +void vamphalf_state::boonggab(machine_config &config) +{ common(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(boonggab_io) + m_maincpu->set_addrmap(AS_IO, &vamphalf_state::boonggab_io); sound_ym_banked_oki(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(vamphalf_qdsp_state::yorijori) +void vamphalf_qdsp_state::yorijori(machine_config &config) +{ common(config); - MCFG_DEVICE_REPLACE("maincpu", E132T, XTAL(50'000'000)) /* 50 MHz */ - MCFG_DEVICE_PROGRAM_MAP(yorijori_32bit_map) - MCFG_DEVICE_IO_MAP(yorijori_io) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold) + E132T(config.replace(), m_maincpu, XTAL(50'000'000)); /* 50 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &vamphalf_qdsp_state::yorijori_32bit_map); + m_maincpu->set_addrmap(AS_IO, &vamphalf_qdsp_state::yorijori_io); + m_maincpu->set_vblank_int("screen", FUNC(vamphalf_state::irq1_line_hold)); sound_qs1000(config); -MACHINE_CONFIG_END +} /* @@ -2774,7 +2780,7 @@ ROM_START( aoh ) ROM_LOAD32_WORD( "g08", 0x3000002, 0x800000, CRC(1fd08aa0) SHA1(376a91220cd6e63418b04d590b232bb1079a40c7) ) ROM_LOAD32_WORD( "g12", 0x3000000, 0x800000, CRC(e437b35f) SHA1(411d2926d619fba057476864f0e580f608830522) ) - ROM_REGION( 0x40000, "oki_1", 0 ) /* Oki Samples */ + ROM_REGION( 0x40000, "oki1", 0 ) /* Oki Samples */ ROM_LOAD( "rom3", 0x00000, 0x40000, CRC(db8cb455) SHA1(6723b4018208d554bd1bf1e0640b72d2f4f47302) ) /* $00000-$20000 stays the same in all sound banks, */ diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp index b735b6c1d2b..e835a3c5604 100644 --- a/src/mame/drivers/vegaeo.cpp +++ b/src/mame/drivers/vegaeo.cpp @@ -172,26 +172,26 @@ uint32_t vegaeo_state::screen_update_vega(screen_device &screen, bitmap_ind16 &b return 0; } +void vegaeo_state::vega(machine_config &config) +{ + GMS30C2132(config, m_maincpu, XTAL(55'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &vegaeo_state::vega_map); + TIMER(config, "scantimer").configure_scanline(FUNC(vegaeo_state::eolith_speedup), "screen", 0, 1); -MACHINE_CONFIG_START(vegaeo_state::vega) - MCFG_DEVICE_ADD("maincpu", GMS30C2132, XTAL(55'000'000)) - MCFG_DEVICE_PROGRAM_MAP(vega_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", vegaeo_state, eolith_speedup, "screen", 0, 1) - - MCFG_DEVICE_ADD("at28c16", AT28C16, 0) + AT28C16(config, "at28c16", 0); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(512, 262) - MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(vegaeo_state, screen_update_vega) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_PALETTE_MEMBITS(16) + 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(512, 262); + m_screen->set_visarea(0, 319, 0, 239); + m_screen->set_screen_update(FUNC(vegaeo_state::screen_update_vega)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette, 256); + m_palette->set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); + m_palette->set_membits(16); MCFG_VIDEO_START_OVERRIDE(vegaeo_state,vega) @@ -203,15 +203,15 @@ MACHINE_CONFIG_START(vegaeo_state::vega) m_soundlatch->data_pending_callback().set("qs1000", FUNC(qs1000_device::set_irq)); m_soundlatch->set_separate_acknowledge(true); - MCFG_DEVICE_ADD("qs1000", QS1000, XTAL(24'000'000)) - MCFG_QS1000_EXTERNAL_ROM(true) - MCFG_QS1000_IN_P1_CB(READ8("soundlatch", generic_latch_8_device, read)) - MCFG_QS1000_OUT_P1_CB(WRITE8(*this, vegaeo_state, qs1000_p1_w)) - MCFG_QS1000_OUT_P2_CB(WRITE8(*this, vegaeo_state, qs1000_p2_w)) - MCFG_QS1000_OUT_P3_CB(WRITE8(*this, vegaeo_state, qs1000_p3_w)) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + QS1000(config, m_qs1000, XTAL(24'000'000)); + m_qs1000->set_external_rom(true); + m_qs1000->p1_in().set("soundlatch", FUNC(generic_latch_8_device::read)); + m_qs1000->p1_out().set(FUNC(vegaeo_state::qs1000_p1_w)); + m_qs1000->p2_out().set(FUNC(vegaeo_state::qs1000_p2_w)); + m_qs1000->p3_out().set(FUNC(vegaeo_state::qs1000_p3_w)); + m_qs1000->add_route(0, "lspeaker", 1.0); + m_qs1000->add_route(1, "rspeaker", 1.0); +} /* Crazy Wars diff --git a/src/mame/drivers/xorworld.cpp b/src/mame/drivers/xorworld.cpp index c707d30200f..3e1eaf3552a 100644 --- a/src/mame/drivers/xorworld.cpp +++ b/src/mame/drivers/xorworld.cpp @@ -152,19 +152,20 @@ static GFXDECODE_START( gfx_xorworld ) GFXDECODE_END -MACHINE_CONFIG_START(xorworld_state::xorworld) +void xorworld_state::xorworld(machine_config &config) +{ // basic machine hardware - MCFG_DEVICE_ADD("maincpu", M68000, 10000000) // 10 MHz - MCFG_DEVICE_PROGRAM_MAP(xorworld_map) - //MCFG_DEVICE_VBLANK_INT_DRIVER("screen", xorworld_state, irq6_line_assert) // irq 4 or 6 - //MCFG_DEVICE_PERIODIC_INT_DRIVER(xorworld_state, irq2_line_assert, 3*60) //timed irq, unknown timing + M68000(config, m_maincpu, 10000000); // 10 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &xorworld_state::xorworld_map); + //m_maincpu->set_vblank_int("screen", FUNC(xorworld_state::irq6_line_assert)); // irq 4 or 6 + //m_maincpu->set_periodic_int(FUNC(xorworld_state::irq2_line_assert), attotime::from_hz(3*60)); //timed irq, unknown timing // Simple fix - but this sounds good!! -Valley Bell - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", xorworld_state, irq2_line_assert) // irq 4 or 6 - MCFG_DEVICE_PERIODIC_INT_DRIVER(xorworld_state, irq6_line_assert, 3*60) //timed irq, unknown timing + m_maincpu->set_vblank_int("screen", FUNC(xorworld_state::irq2_line_assert)); // irq 4 or 6 + m_maincpu->set_periodic_int(FUNC(xorworld_state::irq6_line_assert), attotime::from_hz(3*60)); //timed irq, unknown timing - MCFG_QUANTUM_TIME(attotime::from_hz(60)) + config.m_minimum_quantum = attotime::from_hz(60); - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); ls259_device &mainlatch(LS259(config, "mainlatch")); mainlatch.q_out_cb<4>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); // CS (active low) @@ -172,24 +173,22 @@ MACHINE_CONFIG_START(xorworld_state::xorworld) mainlatch.q_out_cb<6>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); // EEPROM data (DIN) // video hardware - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(xorworld_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_xorworld) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(xorworld_state, xorworld) - + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(32*8, 32*8); + screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(xorworld_state::screen_update)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_xorworld); + PALETTE(config, m_palette, 256); + m_palette->set_init(FUNC(xorworld_state::palette_init_xorworld)); // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_SAA1099_ADD("saa", 8000000 /* guess */) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAA1099(config, "saa", 8000000 /* guess */).add_route(ALL_OUTPUTS, "mono", 1.0); +} ROM_START( xorworld ) diff --git a/src/mame/includes/a2600.h b/src/mame/includes/a2600.h index 3aa017a3c92..ebdb7c477a2 100644 --- a/src/mame/includes/a2600.h +++ b/src/mame/includes/a2600.h @@ -69,7 +69,7 @@ protected: required_device m_tia; required_device m_maincpu; #if USE_NEW_RIOT - required_device m_riot; + required_device m_riot; #else required_device m_riot; #endif diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h index 7daa25411eb..04ee50cdfb5 100644 --- a/src/mame/includes/astrocde.h +++ b/src/mame/includes/astrocde.h @@ -44,6 +44,7 @@ public: m_videoram(*this, "videoram"), m_protected_ram(*this, "protected_ram"), m_screen(*this, "screen"), + m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), m_bank4000(*this, "bank4000"), m_bank8000(*this, "bank8000"), @@ -57,6 +58,7 @@ public: optional_shared_ptr m_videoram; optional_shared_ptr m_protected_ram; required_device m_screen; + required_device m_palette; optional_device m_soundlatch; optional_device m_bank4000; optional_memory_bank m_bank8000; diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h index 6883dbaaf98..5981b6d23a7 100644 --- a/src/mame/includes/cave.h +++ b/src/mame/includes/cave.h @@ -100,6 +100,9 @@ private: void (cave_state::*m_get_sprite_info)(int chip); void (cave_state::*m_sprite_draw)(int chip, int priority); + void add_base_config(machine_config &config); + void add_ymz(machine_config &config); + u16 irq_cause_r(offs_t offset); u8 soundflags_r(); DECLARE_READ16_MEMBER(soundflags_ack_r); diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h index 1b22c197376..82e8a035386 100644 --- a/src/mame/includes/eolith.h +++ b/src/mame/includes/eolith.h @@ -12,12 +12,12 @@ class eolith_state : public driver_device public: eolith_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) - , m_qs1000(*this, "qs1000") - , m_eepromoutport(*this, "EEPROMOUT") , m_maincpu(*this, "maincpu") - , m_soundcpu(*this, "soundcpu") , m_screen(*this, "screen") , m_palette(*this, "palette") + , m_qs1000(*this, "qs1000") + , m_eepromoutport(*this, "EEPROMOUT") + , m_soundcpu(*this, "soundcpu") , m_in0(*this, "IN0") , m_penxport(*this, "PEN_X_P%u", 1) , m_penyport(*this, "PEN_Y_P%u", 1) @@ -46,6 +46,9 @@ public: protected: + required_device m_maincpu; + required_device m_screen; + required_device m_palette; optional_device m_qs1000; optional_ioport m_eepromoutport; TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup); @@ -78,10 +81,7 @@ private: void patch_mcu_protection(uint32_t address); - required_device m_maincpu; optional_device m_soundcpu; - required_device m_screen; - required_device m_palette; optional_ioport m_in0; // klondkp doesn't have it optional_ioport_array<2> m_penxport; -- cgit v1.2.3