diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-12-16 09:08:16 +0100 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-12-16 09:08:39 +0100 |
commit | 56bb41208ad0de815d82f3bd1a2f546e126b9535 (patch) | |
tree | 871ded7c939f4857e48684d4623219a4165a2cb9 | |
parent | c62979a7118226cc6d7ddb497e70c880e51f074b (diff) |
-cpu/adsp2100, amis2000, apexc, arm, arm7, avr8, ccpu, esrip, hcd62121: Removed MCFG macros. [Ryan Holtz]
-audio/dcs, rax: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-drivers/aa310, apexc, aristmk5, cfx9850, cinemat, craft, ertictac, esripsys, gaelco3d, harddriv,
hh_amis2k, nds, polgar, rambo, replicator, risc2500, sbc6510, uzebox: Removed MACHINE_CONFIG macros. [Ryan Holtz]
33 files changed, 846 insertions, 947 deletions
diff --git a/src/devices/bus/snes_ctrl/ctrl.h b/src/devices/bus/snes_ctrl/ctrl.h index ee139752f28..686db2f29e2 100644 --- a/src/devices/bus/snes_ctrl/ctrl.h +++ b/src/devices/bus/snes_ctrl/ctrl.h @@ -49,7 +49,16 @@ class snes_control_port_device : public device_t, public device_slot_interface { public: // construction/destruction - snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + snes_control_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : snes_control_port_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~snes_control_port_device(); template <typename Object> void set_onscreen_callback(Object &&cb) { m_onscreen_cb = std::forward<Object>(cb); } diff --git a/src/devices/cpu/adsp2100/adsp2100.h b/src/devices/cpu/adsp2100/adsp2100.h index 337de47771d..29e61f277a7 100644 --- a/src/devices/cpu/adsp2100/adsp2100.h +++ b/src/devices/cpu/adsp2100/adsp2100.h @@ -174,24 +174,6 @@ enum ADSP2100_SR1_SEC }; - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_ADSP21XX_SPORT_RX_CB(_devcb) \ - downcast<adsp21xx_device &>(*device).set_sport_rx_callback(DEVCB_##_devcb); - -#define MCFG_ADSP21XX_SPORT_TX_CB(_devcb) \ - downcast<adsp21xx_device &>(*device).set_sport_tx_callback(DEVCB_##_devcb); - -#define MCFG_ADSP21XX_TIMER_FIRED_CB(_devcb) \ - downcast<adsp21xx_device &>(*device).set_timer_fired_callback(DEVCB_##_devcb); - -#define MCFG_ADSP21XX_DMOVLAY_CB(_devcb) \ - downcast<adsp21xx_device &>(*device).set_dmovlay_callback(DEVCB_##_devcb); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -204,10 +186,10 @@ public: virtual ~adsp21xx_device(); // inline configuration helpers - template <class Object> devcb_base &set_sport_rx_callback(Object &&cb) { return m_sport_rx_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_sport_tx_callback(Object &&cb) { return m_sport_tx_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_timer_fired_callback(Object &&cb) { return m_timer_fired_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_dmovlay_callback(Object &&cb) { return m_dmovlay_cb.set_callback(std::forward<Object>(cb)); } + auto sport_rx() { return m_sport_rx_cb.bind(); } + auto sport_tx() { return m_sport_tx_cb.bind(); } + auto timer_fired() { return m_timer_fired_cb.bind(); } + auto dmovlay() { return m_dmovlay_cb.bind(); } // public interfaces void load_boot_data(uint8_t *srcdata, uint32_t *dstdata); diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h index 2e15b6572ff..2739461b44b 100644 --- a/src/devices/cpu/amis2000/amis2000.h +++ b/src/devices/cpu/amis2000/amis2000.h @@ -11,45 +11,25 @@ #pragma once +class amis2000_base_device : public cpu_device +{ +public: + // generic input pins (4 bits each) + auto read_k() { return m_read_k.bind(); } + auto read_i() { return m_read_i.bind(); } -// generic input pins (4 bits each) -#define MCFG_AMI_S2000_READ_K_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_read_k_callback(DEVCB_##_devcb); - -#define MCFG_AMI_S2000_READ_I_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_read_i_callback(DEVCB_##_devcb); - -// 8-bit external databus coupled as input/output pins -#define MCFG_AMI_S2000_READ_D_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_read_d_callback(DEVCB_##_devcb); - -#define MCFG_AMI_S2000_WRITE_D_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_write_d_callback(DEVCB_##_devcb); - -// 13-bit external address bus coupled as output pins -#define MCFG_AMI_S2000_WRITE_A_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_write_a_callback(DEVCB_##_devcb); - -// F_out pin (only for S2152) -#define MCFG_AMI_S2152_FOUT_CB(_devcb) \ - downcast<amis2000_base_device &>(*device).set_write_f_callback(DEVCB_##_devcb); + // 8-bit external databus coupled as input/output pins + auto read_d() { return m_read_d.bind(); } + auto write_d() { return m_write_d.bind(); } -// S2000 has a hardcoded 7seg table, that (unlike S2200) is officially -// uncustomizable, but wildfire proves to be an exception to that rule. -#define MCFG_AMI_S2000_7SEG_DECODER(_ptr) \ - downcast<amis2000_base_device &>(*device).set_7seg_table(_ptr); + // 13-bit external address bus coupled as output pins + auto write_a() { return m_write_a.bind(); } + // F_out pin (only for S2152) + auto write_f() { return m_write_f.bind(); } -class amis2000_base_device : public cpu_device -{ -public: - // configuration helpers - template <class Object> devcb_base &set_read_k_callback(Object &&cb) { return m_read_k.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_i_callback(Object &&cb) { return m_read_i.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_a_callback(Object &&cb) { return m_write_a.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_f_callback(Object &&cb) { return m_write_f.set_callback(std::forward<Object>(cb)); } + // S2000 has a hardcoded 7seg table, that (unlike S2200) is officially + // uncustomizable, but wildfire proves to be an exception to that rule. void set_7seg_table(const u8 *ptr) { m_7seg_table = ptr; } void data_64x4(address_map &map); diff --git a/src/devices/cpu/apexc/apexc.h b/src/devices/cpu/apexc/apexc.h index 4da1108a518..ba2d2171456 100644 --- a/src/devices/cpu/apexc/apexc.h +++ b/src/devices/cpu/apexc/apexc.h @@ -29,8 +29,8 @@ public: apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - template<class Object> devcb_base &set_tape_read_cb(Object &&object) { return m_tape_read_cb.set_callback(std::forward<Object>(object)); } - template<class Object> devcb_base &set_tape_punch_cb(Object &&object) { return m_tape_punch_cb.set_callback(std::forward<Object>(object)); } + auto tape_read() { return m_tape_read_cb.bind(); } + auto tape_punch() { return m_tape_punch_cb.bind(); } protected: // device-level overrides diff --git a/src/devices/cpu/arm/arm.h b/src/devices/cpu/arm/arm.h index 2751be58ab0..d710e6ed517 100644 --- a/src/devices/cpu/arm/arm.h +++ b/src/devices/cpu/arm/arm.h @@ -16,10 +16,6 @@ * PUBLIC FUNCTIONS ***************************************************************************************************/ -#define MCFG_ARM_COPRO(_type) \ - downcast<arm_cpu_device &>(*device).set_copro_type(arm_cpu_device::copro_type::_type); - - class arm_cpu_device : public cpu_device { public: diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h index d59eb7ed732..663a7564d5c 100644 --- a/src/devices/cpu/arm7/arm7.h +++ b/src/devices/cpu/arm7/arm7.h @@ -33,10 +33,6 @@ #define ARM7_MAX_FASTRAM 4 #define ARM7_MAX_HOTSPOTS 16 -#define MCFG_ARM_HIGH_VECTORS() \ - downcast<arm7_cpu_device &>(*device).set_high_vectors(); - - /*************************************************************************** COMPILER-SPECIFIC OPTIONS ***************************************************************************/ diff --git a/src/devices/cpu/avr8/avr8.h b/src/devices/cpu/avr8/avr8.h index de2b4b4cac0..36b20738979 100644 --- a/src/devices/cpu/avr8/avr8.h +++ b/src/devices/cpu/avr8/avr8.h @@ -44,30 +44,6 @@ //************************************************************************** -// FUSE BITS CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_CPU_AVR8_LFUSE(byte) \ - ((avr8_device*) device)->set_low_fuses(byte); - -#define MCFG_CPU_AVR8_HFUSE(byte) \ - ((avr8_device*) device)->set_high_fuses(byte); - -#define MCFG_CPU_AVR8_EFUSE(byte) \ - ((avr8_device*) device)->set_extended_fuses(byte); - -#define MCFG_CPU_AVR8_LOCK(byte) \ - ((avr8_device*) device)->set_lock_bits(byte); - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_CPU_AVR8_EEPROM(_tag) \ - downcast<avr8_device &>(*device).set_eeprom_tag(_tag); - - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/cpu/ccpu/ccpu.h b/src/devices/cpu/ccpu/ccpu.h index fea9eccbd4e..c42687aaa0c 100644 --- a/src/devices/cpu/ccpu/ccpu.h +++ b/src/devices/cpu/ccpu/ccpu.h @@ -20,15 +20,6 @@ REGISTER ENUMERATION ***************************************************************************/ - - -#define MCFG_CCPU_EXTERNAL_FUNC(_devcb) \ - downcast<ccpu_cpu_device &>(*device).set_external_func(DEVCB_##_devcb); - -#define MCFG_CCPU_VECTOR_FUNC(d) \ - downcast<ccpu_cpu_device &>(*device).set_vector_func(d); - - class ccpu_cpu_device : public cpu_device { public: @@ -54,8 +45,19 @@ public: ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - template <class Object> devcb_base &set_external_func(Object &&cb) { return m_external_input.set_callback(std::forward<Object>(cb)); } + auto external_func() { return m_external_input.bind(); } + template <typename Object> void set_vector_func(Object &&cb) { m_vector_callback = std::forward<Object>(cb); } + void set_vector_func(vector_delegate callback) { m_vector_callback = callback; } + template <class FunctionClass> void set_vector_func(const char *devname, + void (FunctionClass::*callback)(int16_t, int16_t, int16_t, int16_t, uint8_t), const char *name) + { + set_vector_func(vector_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); + } + template <class FunctionClass> void set_vector_func(void (FunctionClass::*callback)(int16_t, int16_t, int16_t, int16_t, uint8_t), const char *name) + { + set_vector_func(vector_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); + } DECLARE_READ8_MEMBER( read_jmi ); void wdt_timer_trigger(); diff --git a/src/devices/cpu/dsp32/dsp32.h b/src/devices/cpu/dsp32/dsp32.h index 59289064f90..17d5ca81ee0 100644 --- a/src/devices/cpu/dsp32/dsp32.h +++ b/src/devices/cpu/dsp32/dsp32.h @@ -42,7 +42,7 @@ public: dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template <class Object> devcb_base &set_output_pins_callback(Object &&cb) { return m_output_pins_changed.set_callback(std::forward<Object>(cb)); } - + auto out_cb() { return m_output_pins_changed.bind(); } // public interfaces void pio_w(int reg, int data); diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h index b9df5365da3..2508b11976a 100644 --- a/src/devices/cpu/esrip/esrip.h +++ b/src/devices/cpu/esrip/esrip.h @@ -14,33 +14,12 @@ #pragma once -/*************************************************************************** - INTERFACE CONFIGURATION MACROS -***************************************************************************/ -#define ESRIP_DRAW(name) int name(int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank) - -#define MCFG_ESRIP_FDT_R_CALLBACK(_read) \ - downcast<esrip_device &>(*device).set_fdt_r_callback(DEVCB_##_read); - -#define MCFG_ESRIP_FDT_W_CALLBACK(_write) \ - downcast<esrip_device &>(*device).set_fdt_w_callback(DEVCB_##_write); - -#define MCFG_ESRIP_STATUS_IN_CALLBACK(_read) \ - downcast<esrip_device &>(*device).set_status_in_callback(DEVCB_##_read); - -#define MCFG_ESRIP_DRAW_CALLBACK_OWNER(_class, _method) \ - downcast<esrip_device &>(*device).set_draw_callback(esrip_device::draw_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_ESRIP_LBRM_PROM(_tag) \ - downcast<esrip_device &>(*device).lbrm_prom(_tag); - -#define MCFG_ESRIP_SCREEN(screen_tag) \ - downcast<esrip_device &>(*device).set_screen_tag(screen_tag); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** +#define ESRIP_DRAW(name) int name(int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank) + // device type definition DECLARE_DEVICE_TYPE(ESRIP, esrip_device) @@ -56,12 +35,24 @@ public: esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } - template <class Object> devcb_base &set_fdt_r_callback(Object &&cb) { return m_fdt_r.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_fdt_w_callback(Object &&cb) { return m_fdt_w.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_status_in_callback(Object &&cb) { return m_status_in.set_callback(std::forward<Object>(cb)); } - template <typename Object> void set_draw_callback(Object &&cb) { m_draw = std::forward<Object>(cb); } - void lbrm_prom(const char *name) { m_lbrm_prom = name; } + void set_lbrm_prom_region(const char *name) { m_lbrm_prom = name; } + template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); } + void set_draw_callback(draw_delegate callback) { m_draw = callback; } + template <class FunctionClass> void set_draw_callback(const char *devname, int (FunctionClass::*callback)(int, int, int, int, int, int, int, int), + const char *name) + { + set_draw_callback(draw_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); + } + template <class FunctionClass> void set_draw_callback(int (FunctionClass::*callback)(int, int, int, int, int, int, int, int), const char *name) + { + set_draw_callback(draw_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); + } + + // devcb3 accessors + auto fdt_r() { return m_fdt_r.bind(); } + auto fdt_w() { return m_fdt_w.bind(); } + auto status_in() { return m_status_in.bind(); } + // public interfaces uint8_t get_rip_status(); diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h index 7e85bc2af96..27399de7494 100644 --- a/src/devices/cpu/hcd62121/hcd62121.h +++ b/src/devices/cpu/hcd62121/hcd62121.h @@ -5,27 +5,18 @@ #pragma once - -#define MCFG_HCD62121_KOL_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_kol_callback(DEVCB_##_devcb); -#define MCFG_HCD62121_KOH_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_koh_callback(DEVCB_##_devcb); -#define MCFG_HCD62121_PORT_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_port_callback(DEVCB_##_devcb); -#define MCFG_HCD62121_OPT_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_opt_callback(DEVCB_##_devcb); -#define MCFG_HCD62121_KI_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_ki_callback(DEVCB_##_devcb); -#define MCFG_HCD62121_IN0_CB(_devcb) downcast<hcd62121_cpu_device &>(*device).set_in0_callback(DEVCB_##_devcb); - - class hcd62121_cpu_device : public cpu_device { public: // construction/destruction hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_kol_callback(Object &&cb) { return m_kol_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_koh_callback(Object &&cb) { return m_koh_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_port_callback(Object &&cb) { return m_port_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_opt_callback(Object &&cb) { return m_opt_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_ki_callback(Object &&cb) { return m_ki_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_in0_callback(Object &&cb) { return m_in0_cb.set_callback(std::forward<Object>(cb)); } + auto kol_cb() { return m_kol_cb.bind(); } + auto koh_cb() { return m_koh_cb.bind(); } + auto port_cb() { return m_port_cb.bind(); } + auto opt_cb() { return m_opt_cb.bind(); } + auto ki_cb() { return m_ki_cb.bind(); } + auto in0_cb() { return m_in0_cb.bind(); } protected: enum diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h index 9efa11d7eb0..592b0a669da 100644 --- a/src/devices/machine/microtch.h +++ b/src/devices/machine/microtch.h @@ -14,6 +14,7 @@ class microtouch_device : public: microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template <class Object> devcb_base &set_stx_callback(Object &&cb) { return m_out_stx_func.set_callback(std::forward<Object>(cb)); } + auto stx() { return m_out_stx_func.bind(); } virtual ioport_constructor device_input_ports() const override; DECLARE_WRITE_LINE_MEMBER(rx) { device_serial_interface::rx_w(state); } diff --git a/src/mame/audio/dcs.cpp b/src/mame/audio/dcs.cpp index 1f0cd1640ff..e8c135dd4f6 100644 --- a/src/mame/audio/dcs.cpp +++ b/src/mame/audio/dcs.cpp @@ -2495,21 +2495,21 @@ int dcs_audio_device::preprocess_write(uint16_t data) /* Basic DCS system with ADSP-2105 and 2k of SRAM (T-unit, V-unit, Killer Instinct) */ -MACHINE_CONFIG_START(dcs_audio_device::add_mconfig_dcs ) - MCFG_DEVICE_ADD("dcs", ADSP2105, XTAL(10'000'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, dcs_audio_device, timer_enable_callback)) /* callback for timer fired */ - MCFG_DEVICE_PROGRAM_MAP(dcs_2k_program_map) - MCFG_DEVICE_DATA_MAP(dcs_2k_data_map) +void dcs_audio_device::add_mconfig_dcs(machine_config &config) +{ + adsp2105_device &dcs(ADSP2105(config, "dcs", XTAL(10'000'000))); + dcs.sport_tx().set(FUNC(dcs_audio_device::sound_tx_callback)); /* callback for serial transmit */ + dcs.timer_fired().set(FUNC(dcs_audio_device::timer_enable_callback)); /* callback for timer fired */ + dcs.set_addrmap(AS_PROGRAM, &dcs_audio_device::dcs_2k_program_map); + dcs.set_addrmap(AS_DATA, &dcs_audio_device::dcs_2k_data_map); - MCFG_TIMER_DEVICE_ADD("dcs_reg_timer", DEVICE_SELF, dcs_audio_device, dcs_irq) - MCFG_TIMER_DEVICE_ADD("dcs_int_timer", DEVICE_SELF, dcs_audio_device, internal_timer_callback) + TIMER(config, "dcs_reg_timer").configure_generic(FUNC(dcs_audio_device::dcs_irq)); + TIMER(config, "dcs_int_timer").configure_generic(FUNC(dcs_audio_device::internal_timer_callback)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("dac", DMADAC) // AD-1851 16bit mono - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DMADAC(config, "dac").add_route(ALL_OUTPUTS, "mono", 1.0); // AD-1851 16bit mono +} DEFINE_DEVICE_TYPE(DCS_AUDIO_2K, dcs_audio_2k_device, "dcs_audio_2k", "DCS Audio 2K") @@ -2522,10 +2522,10 @@ dcs_audio_2k_device::dcs_audio_2k_device(const machine_config &mconfig, const ch { } -MACHINE_CONFIG_START(dcs_audio_2k_device::device_add_mconfig) - +void dcs_audio_2k_device::device_add_mconfig(machine_config &config) +{ dcs_audio_device::add_mconfig_dcs(config); -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(DCS_AUDIO_2K_UART, dcs_audio_2k_uart_device, "dcs_audio_2k_uart", "DCS Audio 2K UART") @@ -2539,13 +2539,11 @@ dcs_audio_2k_uart_device::dcs_audio_2k_uart_device(const machine_config &mconfig } /* Basic DCS system with ADSP-2105 and 2k of SRAM, using a UART for communications (X-unit) */ -MACHINE_CONFIG_START(dcs_audio_2k_uart_device::device_add_mconfig) - +void dcs_audio_2k_uart_device::device_add_mconfig(machine_config &config) +{ dcs_audio_device::add_mconfig_dcs(config); - - MCFG_DEVICE_MODIFY("dcs") - MCFG_DEVICE_DATA_MAP(dcs_2k_uart_data_map) -MACHINE_CONFIG_END + subdevice<adsp21xx_device>("dcs")->set_addrmap(AS_DATA, &dcs_audio_2k_uart_device::dcs_2k_uart_data_map); +} DEFINE_DEVICE_TYPE(DCS_AUDIO_8K, dcs_audio_8k_device, "dcs_audio_8k", "DCS Audio 8K") @@ -2559,14 +2557,12 @@ dcs_audio_8k_device::dcs_audio_8k_device(const machine_config &mconfig, const ch } /* Basic DCS system with ADSP-2105 and 8k of SRAM (Wolf-unit) */ -MACHINE_CONFIG_START(dcs_audio_8k_device::device_add_mconfig) - +void dcs_audio_8k_device::device_add_mconfig(machine_config &config) +{ dcs_audio_device::add_mconfig_dcs(config); - - MCFG_DEVICE_MODIFY("dcs") - MCFG_DEVICE_PROGRAM_MAP(dcs_8k_program_map) - MCFG_DEVICE_DATA_MAP(dcs_8k_data_map) -MACHINE_CONFIG_END + subdevice<adsp21xx_device>("dcs")->set_addrmap(AS_PROGRAM, &dcs_audio_8k_device::dcs_8k_program_map); + subdevice<adsp21xx_device>("dcs")->set_addrmap(AS_DATA, &dcs_audio_8k_device::dcs_8k_data_map); +} DEFINE_DEVICE_TYPE(DCS_AUDIO_WPC, dcs_audio_wpc_device, "dcs_audio_wpc", "DCS Audio WPC") @@ -2579,14 +2575,12 @@ dcs_audio_wpc_device::dcs_audio_wpc_device(const machine_config &mconfig, const { } -MACHINE_CONFIG_START(dcs_audio_wpc_device::device_add_mconfig) - +void dcs_audio_wpc_device::device_add_mconfig(machine_config &config) +{ dcs_audio_device::add_mconfig_dcs(config); - - MCFG_DEVICE_MODIFY("dcs") - MCFG_DEVICE_PROGRAM_MAP(dcs_wpc_program_map) - MCFG_DEVICE_DATA_MAP(dcs_wpc_data_map) -MACHINE_CONFIG_END + subdevice<adsp21xx_device>("dcs")->set_addrmap(AS_PROGRAM, &dcs_audio_wpc_device::dcs_wpc_program_map); + subdevice<adsp21xx_device>("dcs")->set_addrmap(AS_DATA, &dcs_audio_wpc_device::dcs_wpc_data_map); +} //------------------------------------------------- @@ -2598,27 +2592,25 @@ dcs2_audio_device::dcs2_audio_device(const machine_config &mconfig, device_type { } -MACHINE_CONFIG_START(dcs2_audio_device::add_mconfig_dcs2 ) - MCFG_DEVICE_ADD("dcs2", ADSP2115, XTAL(16'000'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, dcs_audio_device, timer_enable_callback)) /* callback for timer fired */ - MCFG_DEVICE_PROGRAM_MAP(dcs2_2115_program_map) - MCFG_DEVICE_DATA_MAP(dcs2_2115_data_map) +void dcs2_audio_device::add_mconfig_dcs2(machine_config &config) +{ + adsp2115_device &dcs2(ADSP2115(config, "dcs2", XTAL(16'000'000))); + dcs2.sport_tx().set(FUNC(dcs_audio_device::sound_tx_callback)); /* callback for serial transmit */ + dcs2.timer_fired().set(FUNC(dcs_audio_device::timer_enable_callback)); /* callback for timer fired */ + dcs2.set_addrmap(AS_PROGRAM, &dcs2_audio_device::dcs2_2115_program_map); + dcs2.set_addrmap(AS_DATA, &dcs2_audio_device::dcs2_2115_data_map); - MCFG_TIMER_DEVICE_ADD("dcs_reg_timer", DEVICE_SELF, dcs_audio_device, dcs_irq) - MCFG_TIMER_DEVICE_ADD("dcs_sport0_timer", DEVICE_SELF, dcs_audio_device, sport0_irq) - MCFG_TIMER_DEVICE_ADD("dcs_int_timer", DEVICE_SELF, dcs_audio_device, internal_timer_callback) - MCFG_TIMER_DEVICE_ADD("dcs_hle_timer", DEVICE_SELF, dcs_audio_device, transfer_watchdog_callback) + TIMER(config, "dcs_reg_timer").configure_generic(FUNC(dcs_audio_device::dcs_irq)); + TIMER(config, "dcs_sport0_timer").configure_generic(FUNC(dcs_audio_device::sport0_irq)); + TIMER(config, "dcs_int_timer").configure_generic(FUNC(dcs_audio_device::internal_timer_callback)); + TIMER(config, "dcs_hle_timer").configure_generic(FUNC(dcs_audio_device::transfer_watchdog_callback)); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("dac1", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("dac2", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) -MACHINE_CONFIG_END + DMADAC(config, "dac1").add_route(ALL_OUTPUTS, "rspeaker", 1.0); + DMADAC(config, "dac2").add_route(ALL_OUTPUTS, "lspeaker", 1.0); +} DEFINE_DEVICE_TYPE(DCS2_AUDIO_2115, dcs2_audio_2115_device, "dcs2_audio_2115", "DCS2 Audio 2115") @@ -2631,11 +2623,10 @@ dcs2_audio_2115_device::dcs2_audio_2115_device(const machine_config &mconfig, co { } -MACHINE_CONFIG_START(dcs2_audio_2115_device::device_add_mconfig) - +void dcs2_audio_2115_device::device_add_mconfig(machine_config &config) +{ dcs2_audio_device::add_mconfig_dcs2(config); - -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(DCS2_AUDIO_2104, dcs2_audio_2104_device, "dcs2_audio_2104", "DCS2 Audio 2104") @@ -2649,16 +2640,16 @@ dcs2_audio_2104_device::dcs2_audio_2104_device(const machine_config &mconfig, co { } -MACHINE_CONFIG_START(dcs2_audio_2104_device::device_add_mconfig) - +void dcs2_audio_2104_device::device_add_mconfig(machine_config &config) +{ dcs2_audio_device::add_mconfig_dcs2(config); - MCFG_DEVICE_REPLACE("dcs2", ADSP2104, XTAL(16'000'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, dcs_audio_device,timer_enable_callback)) /* callback for timer fired */ - MCFG_DEVICE_PROGRAM_MAP(dcs2_2104_program_map) - MCFG_DEVICE_DATA_MAP(dcs2_2104_data_map) -MACHINE_CONFIG_END + adsp2104_device &dcs2(ADSP2104(config.replace(), "dcs2", XTAL(16'000'000))); + dcs2.sport_tx().set(FUNC(dcs_audio_device::sound_tx_callback)); /* callback for serial transmit */ + dcs2.timer_fired().set(FUNC(dcs_audio_device::timer_enable_callback)); /* callback for timer fired */ + dcs2.set_addrmap(AS_PROGRAM, &dcs2_audio_2104_device::dcs2_2104_program_map); + dcs2.set_addrmap(AS_DATA, &dcs2_audio_2104_device::dcs2_2104_data_map); +} DEFINE_DEVICE_TYPE(DCS2_AUDIO_DSIO, dcs2_audio_dsio_device, "dcs2_audio_dsio", "DCS2 Audio DSIO") @@ -2671,30 +2662,28 @@ dcs2_audio_dsio_device::dcs2_audio_dsio_device(const machine_config &mconfig, co { } -MACHINE_CONFIG_START(dcs2_audio_dsio_device::device_add_mconfig) - MCFG_DEVICE_ADD("dsio", ADSP2181, XTAL(32'000'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, dcs_audio_device, timer_enable_callback)) /* callback for timer fired */ - MCFG_ADSP21XX_DMOVLAY_CB(WRITE32(*this, dcs_audio_device, dmovlay_callback)) // callback for adsp 2181 dmovlay instruction - MCFG_DEVICE_PROGRAM_MAP(dsio_program_map) - MCFG_DEVICE_DATA_MAP(dsio_data_map) - MCFG_DEVICE_IO_MAP(dsio_io_map) +void dcs2_audio_dsio_device::device_add_mconfig(machine_config &config) +{ + adsp2181_device &dsio(ADSP2181(config, "dsio", XTAL(32'000'000))); + dsio.sport_tx().set(FUNC(dcs_audio_device::sound_tx_callback)); /* callback for serial transmit */ + dsio.timer_fired().set(FUNC(dcs_audio_device::timer_enable_callback)); /* callback for timer fired */ + dsio.dmovlay().set(FUNC(dcs_audio_device::dmovlay_callback)); /* callback for adsp 2181 dmovlay instruction */ + dsio.set_addrmap(AS_PROGRAM, &dcs2_audio_dsio_device::dsio_program_map); + dsio.set_addrmap(AS_DATA, &dcs2_audio_dsio_device::dsio_data_map); + dsio.set_addrmap(AS_IO, &dcs2_audio_dsio_device::dsio_io_map); ADDRESS_MAP_BANK(config, "data_map_bank").set_map(&dcs2_audio_dsio_device::dsio_rambank_map).set_options(ENDIANNESS_LITTLE, 16, 14, 0x2000); - MCFG_TIMER_DEVICE_ADD("dcs_reg_timer", DEVICE_SELF, dcs_audio_device, dcs_irq) - MCFG_TIMER_DEVICE_ADD("dcs_int_timer", DEVICE_SELF, dcs_audio_device, internal_timer_callback) - MCFG_TIMER_DEVICE_ADD("dcs_sport0_timer", DEVICE_SELF, dcs_audio_device, sport0_irq) // roadburn needs this to pass harware test + TIMER(config, "dcs_reg_timer").configure_generic(FUNC(dcs_audio_device::dcs_irq)); + TIMER(config, "dcs_int_timer").configure_generic(FUNC(dcs_audio_device::internal_timer_callback)); + TIMER(config, "dcs_sport0_timer").configure_generic(FUNC(dcs_audio_device::sport0_irq)); // roadburn needs this to pass harware test SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("dac1", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("dac2", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) -MACHINE_CONFIG_END + DMADAC(config, "dac1").add_route(ALL_OUTPUTS, "rspeaker", 1.0); + DMADAC(config, "dac2").add_route(ALL_OUTPUTS, "lspeaker", 1.0); +} //------------------------------------------------- @@ -2705,54 +2694,46 @@ dcs2_audio_denver_device::dcs2_audio_denver_device(const machine_config &mconfig { } -MACHINE_CONFIG_START(dcs2_audio_denver_device::device_add_mconfig) - MCFG_DEVICE_ADD("denver", ADSP2181, XTAL(33'333'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, dcs_audio_device, sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, dcs_audio_device, timer_enable_callback)) /* callback for timer fired */ - MCFG_ADSP21XX_DMOVLAY_CB(WRITE32(*this, dcs_audio_device, dmovlay_callback)) // callback for adsp 2181 dmovlay instruction - MCFG_DEVICE_PROGRAM_MAP(denver_program_map) - MCFG_DEVICE_DATA_MAP(denver_data_map) - MCFG_DEVICE_IO_MAP(denver_io_map) +void dcs2_audio_denver_device::device_add_mconfig(machine_config &config) +{ + adsp2181_device &denver(ADSP2181(config, "denver", XTAL(33'333'000))); + denver.sport_tx().set(FUNC(dcs_audio_device::sound_tx_callback)); /* callback for serial transmit */ + denver.timer_fired().set(FUNC(dcs_audio_device::timer_enable_callback)); /* callback for timer fired */ + denver.dmovlay().set(FUNC(dcs_audio_device::dmovlay_callback)); /* callback for adsp 2181 dmovlay instruction */ + denver.set_addrmap(AS_PROGRAM, &dcs2_audio_denver_device::denver_program_map); + denver.set_addrmap(AS_DATA, &dcs2_audio_denver_device::denver_data_map); + denver.set_addrmap(AS_IO, &dcs2_audio_denver_device::denver_io_map); ADDRESS_MAP_BANK(config, "data_map_bank").set_map(&dcs2_audio_denver_device::denver_rambank_map).set_options(ENDIANNESS_LITTLE, 16, 14, 0x2000); - MCFG_TIMER_DEVICE_ADD("dcs_reg_timer", DEVICE_SELF, dcs_audio_device, dcs_irq) - MCFG_TIMER_DEVICE_ADD("dcs_int_timer", DEVICE_SELF, dcs_audio_device, internal_timer_callback) - MCFG_TIMER_DEVICE_ADD("dcs_sport0_timer", DEVICE_SELF, dcs_audio_device, sport0_irq) // Atlantis driver waits for sport0 rx interrupts - -MACHINE_CONFIG_END + TIMER(config, "dcs_reg_timer").configure_generic(FUNC(dcs_audio_device::dcs_irq)); + TIMER(config, "dcs_int_timer").configure_generic(FUNC(dcs_audio_device::internal_timer_callback)); + TIMER(config, "dcs_sport0_timer").configure_generic(FUNC(dcs_audio_device::sport0_irq)); // Atlantis driver waits for sport0 rx interrupts +} dcs2_audio_denver_5ch_device::dcs2_audio_denver_5ch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs2_audio_denver_device(mconfig, DCS2_AUDIO_DENVER_5CH, tag, owner, clock) { } -MACHINE_CONFIG_START(dcs2_audio_denver_5ch_device::device_add_mconfig) +void dcs2_audio_denver_5ch_device::device_add_mconfig(machine_config &config) +{ dcs2_audio_denver_device::device_add_mconfig(config); + SPEAKER(config, "flspeaker").front_left(); SPEAKER(config, "frspeaker").front_right(); SPEAKER(config, "rlspeaker").rear_left(); SPEAKER(config, "rrspeaker").rear_right(); SPEAKER(config, "subwoofer").subwoofer(); - MCFG_DEVICE_ADD("dac1", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "flspeaker", 1.0) - - MCFG_DEVICE_ADD("dac2", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frspeaker", 1.0) - - MCFG_DEVICE_ADD("dac3", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rlspeaker", 1.0) - - MCFG_DEVICE_ADD("dac4", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rrspeaker", 1.0) - - MCFG_DEVICE_ADD("dac5", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "subwoofer", 1.0) - - MCFG_DEVICE_ADD("dac6", DMADAC) + DMADAC(config, "dac1").add_route(ALL_OUTPUTS, "flspeaker", 1.0); + DMADAC(config, "dac2").add_route(ALL_OUTPUTS, "frspeaker", 1.0); + DMADAC(config, "dac3").add_route(ALL_OUTPUTS, "rlspeaker", 1.0); + DMADAC(config, "dac4").add_route(ALL_OUTPUTS, "rrspeaker", 1.0); + DMADAC(config, "dac5").add_route(ALL_OUTPUTS, "subwoofer", 1.0); + DMADAC(config, "dac6"); // Does not produce sound -MACHINE_CONFIG_END +} DEFINE_DEVICE_TYPE(DCS2_AUDIO_DENVER_5CH, dcs2_audio_denver_5ch_device, "dcs2_audio_denver_5ch", "DCS2 Audio Denver 5 Channel") @@ -2761,16 +2742,15 @@ dcs2_audio_denver_2ch_device::dcs2_audio_denver_2ch_device(const machine_config { } -MACHINE_CONFIG_START(dcs2_audio_denver_2ch_device::device_add_mconfig) +void dcs2_audio_denver_2ch_device::device_add_mconfig(machine_config &config) +{ dcs2_audio_denver_device::device_add_mconfig(config); + SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("dac1", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("dac2", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) -MACHINE_CONFIG_END + DMADAC(config, "dac1").add_route(ALL_OUTPUTS, "rspeaker", 1.0); + DMADAC(config, "dac2").add_route(ALL_OUTPUTS, "lspeaker", 1.0); +} DEFINE_DEVICE_TYPE(DCS2_AUDIO_DENVER_2CH, dcs2_audio_denver_2ch_device, "dcs2_audio_denver_2ch", "DCS2 Audio Denver 2 Channel") diff --git a/src/mame/audio/rax.cpp b/src/mame/audio/rax.cpp index c20f19befc1..d294628464d 100644 --- a/src/mame/audio/rax.cpp +++ b/src/mame/audio/rax.cpp @@ -490,16 +490,17 @@ acclaim_rax_device::acclaim_rax_device(const machine_config &mconfig, const char // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(acclaim_rax_device::device_add_mconfig) - MCFG_DEVICE_ADD("adsp", ADSP2181, XTAL(16'670'000)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, acclaim_rax_device, adsp_sound_tx_callback)) /* callback for serial transmit */ - MCFG_ADSP21XX_DMOVLAY_CB(WRITE32(*this, acclaim_rax_device, dmovlay_callback)) // callback for adsp 2181 dmovlay instruction - MCFG_DEVICE_PROGRAM_MAP(adsp_program_map) - MCFG_DEVICE_DATA_MAP(adsp_data_map) - MCFG_DEVICE_IO_MAP(adsp_io_map) +void acclaim_rax_device::device_add_mconfig(machine_config &config) +{ + ADSP2181(config, m_cpu, XTAL(16'670'000)); + m_cpu->sport_tx().set(FUNC(acclaim_rax_device::adsp_sound_tx_callback)); /* callback for serial transmit */ + m_cpu->dmovlay().set(FUNC(acclaim_rax_device::dmovlay_callback)); /* callback for adsp 2181 dmovlay instruction */ + m_cpu->set_addrmap(AS_PROGRAM, &acclaim_rax_device::adsp_program_map); + m_cpu->set_addrmap(AS_DATA, &acclaim_rax_device::adsp_data_map); + m_cpu->set_addrmap(AS_IO, &acclaim_rax_device::adsp_io_map); - MCFG_TIMER_DEVICE_ADD("adsp_reg_timer0", DEVICE_SELF, acclaim_rax_device, adsp_irq0) - MCFG_TIMER_DEVICE_ADD("adsp_dma_timer", DEVICE_SELF, acclaim_rax_device, dma_timer_callback) + TIMER(config, "adsp_reg_timer0").configure_generic(FUNC(acclaim_rax_device::adsp_irq0)); + TIMER(config, "adsp_dma_timer").configure_generic(FUNC(acclaim_rax_device::dma_timer_callback)); GENERIC_LATCH_16(config, m_data_in); GENERIC_LATCH_16(config, m_data_out); @@ -507,10 +508,7 @@ MACHINE_CONFIG_START(acclaim_rax_device::device_add_mconfig) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("dacl", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - - MCFG_DEVICE_ADD("dacr", DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END + DMADAC(config, "dacl").add_route(ALL_OUTPUTS, "lspeaker", 1.0); + DMADAC(config, "dacr").add_route(ALL_OUTPUTS, "rspeaker", 1.0); +} diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp index 408e258ed4d..8e4fbd03109 100644 --- a/src/mame/drivers/aa310.cpp +++ b/src/mame/drivers/aa310.cpp @@ -405,11 +405,12 @@ WRITE_LINE_MEMBER( archimedes_state::a310_kart_rx_w ) archimedes_clear_irq_b(ARCHIMEDES_IRQB_KBD_XMIT_EMPTY); } -MACHINE_CONFIG_START(aa310_state::aa310) +void aa310_state::aa310(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", ARM, 24_MHz_XTAL / 3) /* ARM2 8 MHz */ - MCFG_DEVICE_PROGRAM_MAP(aa310_mem) - MCFG_ARM_COPRO(VL86C020) + ARM(config, m_maincpu, 24_MHz_XTAL / 3); /* ARM2 8 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &aa310_state::aa310_mem); + m_maincpu->set_copro_type(arm_cpu_device::copro_type::VL86C020); AAKART(config, m_kart, 8000000/256); m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w)); @@ -418,11 +419,11 @@ MACHINE_CONFIG_START(aa310_state::aa310) I2CMEM(config, "i2cmem", 0).set_data_size(0x100); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(16_MHz_XTAL, 1024, 0, 735, 624/2, 0, 292) // RiscOS 3 default screen settings - MCFG_SCREEN_UPDATE_DRIVER(archimedes_state, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(16_MHz_XTAL, 1024, 0, 735, 624/2, 0, 292); // RiscOS 3 default screen settings + m_screen->set_screen_update(FUNC(archimedes_state::screen_update)); - MCFG_PALETTE_ADD("palette", 32768) + PALETTE(config, m_palette, 32768); RAM(config, m_ram).set_default_size("1M"); @@ -430,34 +431,31 @@ MACHINE_CONFIG_START(aa310_state::aa310) fdc.set_disable_motor_control(true); fdc.intrq_wr_callback().set(FUNC(aa310_state::aa310_wd177x_intrq_w)); fdc.drq_wr_callback().set(FUNC(aa310_state::aa310_wd177x_drq_w)); - MCFG_FLOPPY_DRIVE_ADD("fdc:0", aa310_floppies, "35dd", aa310_state::floppy_formats) - MCFG_FLOPPY_DRIVE_SOUND(true) - MCFG_FLOPPY_DRIVE_ADD("fdc:1", aa310_floppies, nullptr, aa310_state::floppy_formats) // rarely had 2nd FDD installed, space was used for HDD - MCFG_FLOPPY_DRIVE_SOUND(true) + FLOPPY_CONNECTOR(config, "fdc:0", aa310_floppies, "35dd", aa310_state::floppy_formats).enable_sound(true); + + // rarely had 2nd FDD installed, space was used for HDD + FLOPPY_CONNECTOR(config, "fdc:1", aa310_floppies, nullptr, aa310_state::floppy_formats).enable_sound(true); - MCFG_SOFTWARE_LIST_ADD("flop_list", "archimedes") + SOFTWARE_LIST(config, "flop_list").set_original("archimedes"); SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac0", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac5", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac6", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac7", -1.0, DAC_VREF_NEG_INPUT) + for (int i = 0; i < 8; i++) + { + DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.1); // unknown DAC + } + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT); /* Expansion slots - 2-card backplane */ -MACHINE_CONFIG_END +} void aa310_state::aa305(machine_config &config) { @@ -509,57 +507,56 @@ void aa310_state::aa4401(machine_config &config) /* Expansion slots - 4-card backplane */ } -MACHINE_CONFIG_START(aa310_state::aa540) +void aa310_state::aa540(machine_config &config) +{ aa310(config); - MCFG_DEVICE_MODIFY("maincpu") // ARM3 - MCFG_DEVICE_CLOCK(52_MHz_XTAL / 2) + m_maincpu->set_clock(52_MHz_XTAL / 2); // ARM3 m_ram->set_default_size("4M").set_extra_options("8M,12M,16M"); /* 100MB HDD */ /* Expansion slots - 4-card backplane */ -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(aa310_state::aa5000) +void aa310_state::aa5000(machine_config &config) +{ aa310(config); - MCFG_DEVICE_MODIFY("maincpu") // ARM3 - MCFG_DEVICE_CLOCK(50_MHz_XTAL / 2) + m_maincpu->set_clock(50_MHz_XTAL / 2); // ARM3 m_ram->set_default_size("2M").set_extra_options("4M"); /* 80MB HDD */ /* Expansion slots - 4-card backplane */ -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(aa310_state::aa4) +void aa310_state::aa4(machine_config &config) +{ aa5000(config); - MCFG_DEVICE_MODIFY("maincpu") // ARM3 - MCFG_DEVICE_CLOCK(24_MHz_XTAL) + m_maincpu->set_clock(24_MHz_XTAL); // ARM3 /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_TYPE(LCD) + m_screen->set_type(SCREEN_TYPE_LCD); /* 765 FDC */ /* 60MB HDD */ -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(aa310_state::aa5000a) +void aa310_state::aa5000a(machine_config &config) +{ aa5000(config); - MCFG_DEVICE_MODIFY("maincpu") // ARM3 - MCFG_DEVICE_CLOCK(33000000) -MACHINE_CONFIG_END + m_maincpu->set_clock(33000000); // ARM3 +} -MACHINE_CONFIG_START(aa310_state::aa3010) +void aa310_state::aa3010(machine_config &config) +{ aa310(config); - MCFG_DEVICE_MODIFY("maincpu") // ARM250 - MCFG_DEVICE_CLOCK(72_MHz_XTAL / 6) + m_maincpu->set_clock(72_MHz_XTAL / 6); // ARM250 m_ram->set_default_size("1M").set_extra_options("2M"); -MACHINE_CONFIG_END +} void aa310_state::aa3020(machine_config &config) { diff --git a/src/mame/drivers/apexc.cpp b/src/mame/drivers/apexc.cpp index fd984fcfb12..55a00b4acae 100644 --- a/src/mame/drivers/apexc.cpp +++ b/src/mame/drivers/apexc.cpp @@ -357,14 +357,14 @@ void apexc_state::mem(address_map &map) map(0x1000, 0x7fff).noprw(); } -MACHINE_CONFIG_START(apexc_state::apexc) - +void apexc_state::apexc(machine_config &config) +{ /* basic machine hardware */ /* APEXC CPU @ 2.0 kHz (memory word clock frequency) */ - device = &APEXC(config, m_maincpu, 2000); + APEXC(config, m_maincpu, 2000); m_maincpu->set_addrmap(AS_PROGRAM, &apexc_state::mem); - MCFG_APEXC_TAPE_READ_CB(READ8(m_tape_reader, apexc_tape_reader_image_device, read)) - MCFG_APEXC_TAPE_PUNCH_CB(WRITE8(*this, apexc_state, tape_write)) + m_maincpu->tape_read().set(m_tape_reader, FUNC(apexc_tape_reader_image_device::read)); + m_maincpu->tape_punch().set(FUNC(apexc_state::tape_write)); /* video hardware does not exist, but we display a control panel and the typewriter output */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -377,13 +377,12 @@ MACHINE_CONFIG_START(apexc_state::apexc) GFXDECODE(config, m_gfxdecode, m_palette, gfx_apexc); - device = &PALETTE(config, m_palette, ARRAY_LENGTH(palette_table)); - MCFG_PALETTE_INIT_OWNER(apexc_state, apexc) + PALETTE(config, m_palette, ARRAY_LENGTH(palette_table)).set_init(FUNC(apexc_state::palette_init_apexc)); APEXC_CYLINDER(config, m_cylinder); APEXC_TAPE_PUNCHER(config, m_tape_puncher); APEXC_TAPE_READER(config, m_tape_reader); -MACHINE_CONFIG_END +} ROM_START(apexc) /*CPU memory space*/ diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp index 213dbc4e19f..c62210dbdb9 100644 --- a/src/mame/drivers/aristmk5.cpp +++ b/src/mame/drivers/aristmk5.cpp @@ -2034,29 +2034,29 @@ void aristmk5_state::machine_reset() memset(m_spi_data, 0, sizeof(m_spi_data)); } - -MACHINE_CONFIG_START(aristmk5_state::aristmk5) - MCFG_DEVICE_ADD("maincpu", ARM, MASTER_CLOCK/6) // 12000000 - MCFG_DEVICE_PROGRAM_MAP(aristmk5_drame_map) +void aristmk5_state::aristmk5(machine_config &config) +{ + ARM(config, m_maincpu, MASTER_CLOCK/6); // 12000000 + m_maincpu->set_addrmap(AS_PROGRAM, &aristmk5_state::aristmk5_drame_map); WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(2)); /* 1.6 - 2 seconds */ /* TODO: this isn't supposed to access a keyboard ... */ - MCFG_DEVICE_ADD("kart", AAKART, 12000000/128) // TODO: frequency + AAKART(config, m_kart, 12000000/128); // TODO: frequency - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(640, 400) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1) - MCFG_SCREEN_UPDATE_DRIVER(archimedes_state, screen_update) + 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(640, 400); + m_screen->set_visarea(0, 640-1, 0, 400-1); + m_screen->set_screen_update(FUNC(archimedes_state::screen_update)); - MCFG_PALETTE_ADD("palette", 0x200) + PALETTE(config, m_palette, 0x200); - EEPROM_93C56_16BIT(config, "eeprom0"); - EEPROM_93C56_16BIT(config, "eeprom1"); + EEPROM_93C56_16BIT(config, m_eeprom[0]); + EEPROM_93C56_16BIT(config, m_eeprom[1]); - NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); + NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE); // TL16C452FN U71 ns16450_device &uart0a(NS16450(config, "uart_0a", MASTER_CLOCK / 9)); @@ -2082,55 +2082,53 @@ MACHINE_CONFIG_START(aristmk5_state::aristmk5) NS16450(config, "uart_3b", MASTER_CLOCK / 9); // MCFG_INS8250_OUT_INT_CB(WRITELINE(*this, FUNC(input_merger_device::in_w<7>)); - MCFG_INPUT_MERGER_ANY_HIGH("uart_irq") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, aristmk5_state, uart_irq_callback)) + INPUT_MERGER_ANY_HIGH(config, "uart_irq").output_handler().set(FUNC(aristmk5_state::uart_irq_callback)); - MCFG_DEVICE_ADD("rtc", DS1302, 32.768_kHz_XTAL) + DS1302(config, m_rtc, 32.768_kHz_XTAL); - MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) + HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.1) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac0", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac5", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac6", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac7", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(aristmk5_state::aristmk5_touch) + for (int i = 0; i < 8; i++) + { + DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.1); // unknown DAC + } + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT); +} + + +void aristmk5_state::aristmk5_touch(machine_config &config) +{ aristmk5(config); - subdevice<ns16450_device>("uart_0a") - ->out_tx_callback().set("microtouch", FUNC(microtouch_device::rx)); + subdevice<ns16450_device>("uart_0a")->out_tx_callback().set("microtouch", FUNC(microtouch_device::rx)); - MCFG_MICROTOUCH_ADD("microtouch", 2400, WRITELINE("uart_0a", ins8250_uart_device, rx_w)) -MACHINE_CONFIG_END + microtouch_device µtouch(MICROTOUCH(config, "microtouch", 2400)); + microtouch.stx().set("uart_0a", FUNC(ins8250_uart_device::rx_w)); +} -MACHINE_CONFIG_START(aristmk5_state::aristmk5_usa) +void aristmk5_state::aristmk5_usa(machine_config &config) +{ aristmk5(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(aristmk5_usa_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &aristmk5_state::aristmk5_usa_map); +} -MACHINE_CONFIG_START(aristmk5_state::aristmk5_usa_touch) +void aristmk5_state::aristmk5_usa_touch(machine_config &config) +{ aristmk5_usa(config); - subdevice<ns16450_device>("uart_0a") - ->out_tx_callback().set("microtouch", FUNC(microtouch_device::rx)); + subdevice<ns16450_device>("uart_0a")->out_tx_callback().set("microtouch", FUNC(microtouch_device::rx)); - MCFG_MICROTOUCH_ADD("microtouch", 2400, WRITELINE("uart_0a", ins8250_uart_device, rx_w)) -MACHINE_CONFIG_END + microtouch_device µtouch(MICROTOUCH(config, "microtouch", 2400)); + microtouch.stx().set("uart_0a", FUNC(ins8250_uart_device::rx_w)); +} #define ARISTOCRAT_MK5_BIOS \ ROM_REGION( 0x400000, "set_4.04.09", ROMREGION_ERASEFF ) /* setchip v4.04.09 4meg */ \ diff --git a/src/mame/drivers/cfx9850.cpp b/src/mame/drivers/cfx9850.cpp index 6aeff5cb610..c345ed544b4 100644 --- a/src/mame/drivers/cfx9850.cpp +++ b/src/mame/drivers/cfx9850.cpp @@ -53,13 +53,13 @@ public: required_shared_ptr<u8> m_video_ram; required_shared_ptr<u8> m_display_ram; DECLARE_PALETTE_INIT(cfx9850); - u32 screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cfx9850(machine_config &config); - void cfx9850(address_map &map); + void cfx9850_mem(address_map &map); protected: required_ioport_array<12> m_ko_port; - required_device<cpu_device> m_maincpu; + required_device<hcd62121_cpu_device> m_maincpu; private: u16 m_ko; // KO lines KO1 - KO14 @@ -68,7 +68,7 @@ private: }; -void cfx9850_state::cfx9850(address_map &map) +void cfx9850_state::cfx9850_mem(address_map &map) { map(0x000000, 0x007fff).rom(); map(0x080000, 0x0807ff).ram().share("video_ram"); @@ -254,7 +254,7 @@ PALETTE_INIT_MEMBER(cfx9850_state, cfx9850) } -u32 cfx9850_state::screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 cfx9850_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { u16 offset = 0; @@ -282,27 +282,27 @@ u32 cfx9850_state::screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bi } -MACHINE_CONFIG_START(cfx9850_state::cfx9850) - MCFG_DEVICE_ADD("maincpu", HCD62121, 4300000) /* X1 - 4.3 MHz */ - MCFG_DEVICE_PROGRAM_MAP(cfx9850) - MCFG_HCD62121_KOL_CB(WRITE8(*this, cfx9850_state, kol_w)) - MCFG_HCD62121_KOH_CB(WRITE8(*this, cfx9850_state, koh_w)) - MCFG_HCD62121_PORT_CB(WRITE8(*this, cfx9850_state, port_w)) - MCFG_HCD62121_OPT_CB(WRITE8(*this, cfx9850_state, opt_w)) - MCFG_HCD62121_KI_CB(READ8(*this, cfx9850_state, ki_r)) - MCFG_HCD62121_IN0_CB(READ8(*this, cfx9850_state, in0_r)) - - MCFG_SCREEN_ADD("screen", LCD) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(128, 64) - MCFG_SCREEN_VISIBLE_AREA(0, 127, 0, 63) - MCFG_SCREEN_UPDATE_DRIVER(cfx9850_state, screen_update_cfx9850) - MCFG_SCREEN_PALETTE("palette") +void cfx9850_state::cfx9850(machine_config &config) +{ + HCD62121(config, m_maincpu, 4300000); /* X1 - 4.3 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &cfx9850_state::cfx9850_mem); + m_maincpu->kol_cb().set(FUNC(cfx9850_state::kol_w)); + m_maincpu->koh_cb().set(FUNC(cfx9850_state::koh_w)); + m_maincpu->port_cb().set(FUNC(cfx9850_state::port_w)); + m_maincpu->opt_cb().set(FUNC(cfx9850_state::opt_w)); + m_maincpu->ki_cb().set(FUNC(cfx9850_state::ki_r)); + m_maincpu->in0_cb().set(FUNC(cfx9850_state::in0_r)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(60); + screen.set_size(128, 64); + screen.set_visarea(0, 127, 0, 63); + screen.set_screen_update(FUNC(cfx9850_state::screen_update)); + screen.set_palette("palette"); // TODO: Verify amount of colors and palette. Colors can be changed by changing the contrast. - MCFG_PALETTE_ADD("palette", 4) - MCFG_PALETTE_INIT_OWNER(cfx9850_state, cfx9850) -MACHINE_CONFIG_END + PALETTE(config, "palette", 4).set_init(FUNC(cfx9850_state::palette_init_cfx9850)); +} ROM_START(cfx9850) diff --git a/src/mame/drivers/cinemat.cpp b/src/mame/drivers/cinemat.cpp index 03abb668a6e..d1ee10f7890 100644 --- a/src/mame/drivers/cinemat.cpp +++ b/src/mame/drivers/cinemat.cpp @@ -1010,66 +1010,60 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(cinemat_state::cinemat_nojmi_4k) - +void cinemat_state::cinemat_nojmi_4k(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", CCPU, MASTER_CLOCK/4) - MCFG_CCPU_VECTOR_FUNC(ccpu_cpu_device::vector_delegate(FUNC(cinemat_state::cinemat_vector_callback), this)) - MCFG_CCPU_EXTERNAL_FUNC(READ8(*this, cinemat_state,joystick_read)) - MCFG_DEVICE_PROGRAM_MAP(program_map_4k) - MCFG_DEVICE_DATA_MAP(data_map) - MCFG_DEVICE_IO_MAP(io_map) + CCPU(config, m_maincpu, MASTER_CLOCK/4); + m_maincpu->set_vector_func(FUNC(cinemat_state::cinemat_vector_callback)); + m_maincpu->external_func().set(FUNC(cinemat_state::joystick_read)); + m_maincpu->set_addrmap(AS_PROGRAM, &cinemat_state::program_map_4k); + m_maincpu->set_addrmap(AS_DATA, &cinemat_state::data_map); + m_maincpu->set_addrmap(AS_IO, &cinemat_state::io_map); LS259(config, m_outlatch); // 7J on CCG-1 m_outlatch->q_out_cb<5>().set(FUNC(cinemat_state::coin_reset_w)); m_outlatch->q_out_cb<6>().set(FUNC(cinemat_state::vector_control_w)); /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_REFRESH_RATE(MASTER_CLOCK/4/16/16/16/16/2) - MCFG_SCREEN_SIZE(1024, 768) - MCFG_SCREEN_VISIBLE_AREA(0, 1023, 0, 767) - MCFG_SCREEN_UPDATE_DRIVER(cinemat_state, screen_update_cinemat) -MACHINE_CONFIG_END - + VECTOR(config, "vector", 0); + SCREEN(config, m_screen, SCREEN_TYPE_VECTOR); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_refresh_hz(MASTER_CLOCK/4/16/16/16/16/2); + m_screen->set_size(1024, 768); + m_screen->set_visarea(0, 1023, 0, 767); + m_screen->set_screen_update(FUNC(cinemat_state::screen_update_cinemat)); +} -MACHINE_CONFIG_START(cinemat_state::cinemat_jmi_4k) +void cinemat_state::cinemat_jmi_4k(machine_config &config) +{ cinemat_nojmi_4k(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_CCPU_VECTOR_FUNC(ccpu_cpu_device::vector_delegate(FUNC(cinemat_state::cinemat_vector_callback), this)) - MCFG_CCPU_EXTERNAL_FUNC(READ8("maincpu",ccpu_cpu_device,read_jmi)) -MACHINE_CONFIG_END - + m_maincpu->set_vector_func(FUNC(cinemat_state::cinemat_vector_callback)); + m_maincpu->external_func().set("maincpu", FUNC(ccpu_cpu_device::read_jmi)); +} -MACHINE_CONFIG_START(cinemat_state::cinemat_nojmi_8k) +void cinemat_state::cinemat_nojmi_8k(machine_config &config) +{ cinemat_nojmi_4k(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(program_map_8k) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &cinemat_state::program_map_8k); +} -MACHINE_CONFIG_START(cinemat_state::cinemat_jmi_8k) +void cinemat_state::cinemat_jmi_8k(machine_config &config) +{ cinemat_jmi_4k(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(program_map_8k) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &cinemat_state::program_map_8k); +} -MACHINE_CONFIG_START(cinemat_state::cinemat_jmi_16k) +void cinemat_state::cinemat_jmi_16k(machine_config &config) +{ cinemat_jmi_4k(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(program_map_16k) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &cinemat_state::program_map_16k); +} -MACHINE_CONFIG_START(cinemat_state::cinemat_jmi_32k) +void cinemat_state::cinemat_jmi_32k(machine_config &config) +{ cinemat_jmi_4k(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(program_map_32k) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &cinemat_state::program_map_32k); +} @@ -1079,117 +1073,112 @@ MACHINE_CONFIG_END * *************************************/ -MACHINE_CONFIG_START(cinemat_state::spacewar) +void cinemat_state::spacewar(machine_config &config) +{ cinemat_nojmi_4k(config); spacewar_sound(config); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(cinemat_state, screen_update_spacewar) -MACHINE_CONFIG_END - + m_screen->set_screen_update(FUNC(cinemat_state::screen_update_spacewar)); +} -MACHINE_CONFIG_START(cinemat_state::barrier) +void cinemat_state::barrier(machine_config &config) +{ cinemat_jmi_4k(config); barrier_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::speedfrk) +void cinemat_state::speedfrk(machine_config &config) +{ cinemat_nojmi_8k(config); speedfrk_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::starhawk) +void cinemat_state::starhawk(machine_config &config) +{ cinemat_jmi_4k(config); starhawk_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_16level_state::sundance) +void cinemat_16level_state::sundance(machine_config &config) +{ cinemat_jmi_8k(config); sundance_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::tailg) +void cinemat_state::tailg(machine_config &config) +{ cinemat_nojmi_8k(config); tailg_sound(config); m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::mux_select_w)); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::warrior) +void cinemat_state::warrior(machine_config &config) +{ cinemat_jmi_8k(config); warrior_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::armora) +void cinemat_state::armora(machine_config &config) +{ cinemat_jmi_16k(config); armora_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::ripoff) +void cinemat_state::ripoff(machine_config &config) +{ cinemat_jmi_8k(config); ripoff_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::starcas) +void cinemat_state::starcas(machine_config &config) +{ cinemat_jmi_8k(config); starcas_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_64level_state::solarq) +void cinemat_64level_state::solarq(machine_config &config) +{ cinemat_jmi_16k(config); solarq_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_color_state::boxingb) +void cinemat_color_state::boxingb(machine_config &config) +{ cinemat_jmi_32k(config); boxingb_sound(config); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 1024, 0, 788) + m_screen->set_visarea(0, 1024, 0, 788); m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::mux_select_w)); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_state::wotw) +void cinemat_state::wotw(machine_config &config) +{ cinemat_jmi_16k(config); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 1120, 0, 767) + m_screen->set_visarea(0, 1120, 0, 767); wotw_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(cinemat_color_state::wotwc) +void cinemat_color_state::wotwc(machine_config &config) +{ cinemat_jmi_16k(config); wotw_sound(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(demon_state::demon) +void demon_state::demon(machine_config &config) +{ cinemat_jmi_16k(config); demon_sound(config); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 1024, 0, 805) -MACHINE_CONFIG_END - + m_screen->set_visarea(0, 1024, 0, 805); +} -MACHINE_CONFIG_START(qb3_state::qb3) +void qb3_state::qb3(machine_config &config) +{ cinemat_jmi_32k(config); qb3_sound(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_DATA_MAP(data_map_qb3) - MCFG_DEVICE_IO_MAP(io_map_qb3) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 1120, 0, 780) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &qb3_state::data_map_qb3); + m_maincpu->set_addrmap(AS_IO, &qb3_state::io_map_qb3); + m_screen->set_visarea(0, 1120, 0, 780); +} diff --git a/src/mame/drivers/craft.cpp b/src/mame/drivers/craft.cpp index e7568a514a0..dfc01eeb26c 100644 --- a/src/mame/drivers/craft.cpp +++ b/src/mame/drivers/craft.cpp @@ -245,30 +245,32 @@ void craft_state::machine_reset() m_last_cycles = 0; } -MACHINE_CONFIG_START(craft_state::craft) - +void craft_state::craft(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", ATMEGA88, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(craft_prg_map) - MCFG_DEVICE_DATA_MAP(craft_data_map) - MCFG_DEVICE_IO_MAP(craft_io_map) - MCFG_CPU_AVR8_EEPROM("eeprom") + ATMEGA88(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &craft_state::craft_prg_map); + m_maincpu->set_addrmap(AS_DATA, &craft_state::craft_data_map); + m_maincpu->set_addrmap(AS_IO, &craft_state::craft_io_map); + m_maincpu->set_eeprom_tag("eeprom"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.99) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1429)) /* accurate */ - MCFG_SCREEN_SIZE(635, 525) - MCFG_SCREEN_VISIBLE_AREA(47, 526, 36, 515) - MCFG_SCREEN_UPDATE_DRIVER(craft_state, screen_update_craft) - MCFG_PALETTE_ADD("palette", 0x1000) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(59.99); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(1429)); /* accurate */ + screen.set_size(635, 525); + screen.set_visarea(47, 526, 36, 515); + screen.set_screen_update(FUNC(craft_state::screen_update_craft)); + PALETTE(config, "palette", 0x1000); /* sound hardware */ SPEAKER(config, "avr8").front_center(); - MCFG_DEVICE_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(0, "avr8", 0.25) // pd1/pd2/pd4/pd5/pd6/pd7 + 2k(x7) + 1k(x5) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END + DAC_6BIT_R2R(config, "dac", 0).add_route(0, "avr8", 0.25); // pd1/pd2/pd4/pd5/pd6/pd7 + 2k(x7) + 1k(x5) + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} ROM_START( craft ) ROM_REGION( 0x2000, "maincpu", 0 ) /* Main program store */ diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp index 902a606b914..d6f8db79a67 100644 --- a/src/mame/drivers/ertictac.cpp +++ b/src/mame/drivers/ertictac.cpp @@ -223,41 +223,38 @@ INTERRUPT_GEN_MEMBER(ertictac_state::ertictac_podule_irq) #define NVRAM_SIZE 256 #define NVRAM_PAGE_SIZE 0 /* max size of one write request */ -MACHINE_CONFIG_START(ertictac_state::ertictac) - - MCFG_DEVICE_ADD("maincpu", ARM, XTAL(24'000'000)/3) /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */ - MCFG_DEVICE_PROGRAM_MAP(ertictac_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(ertictac_state, ertictac_podule_irq, 60) // FIXME: timing of this +void ertictac_state::ertictac(machine_config &config) +{ + ARM(config, m_maincpu, XTAL(24'000'000)/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */ + m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map); + m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this I2CMEM(config, "i2cmem", 0).set_page_size(NVRAM_PAGE_SIZE).set_data_size(NVRAM_SIZE); // AAKART(config, m_kart, XTAL(24'000'000)/3); // TODO: frequency - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(XTAL(16'000'000),1024,0,735,624/2,0,292) // RiscOS 3 default screen settings - MCFG_SCREEN_UPDATE_DRIVER(archimedes_state, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(XTAL(16'000'000), 1024,0,735, 624/2,0,292); // RiscOS 3 default screen settings + m_screen->set_screen_update(FUNC(archimedes_state::screen_update)); - MCFG_PALETTE_ADD("palette", 0x200) + PALETTE(config, m_palette, 0x200); SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac0", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac1", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac2", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac3", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac4", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac5", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac6", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("dac7", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.05) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac0", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac0", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac1", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac3", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac3", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac4", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac4", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac5", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac5", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac6", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac6", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_ROUTE(0, "dac7", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac7", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END + for (int i = 0; i < 8; i++) + { + DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.05); // unknown DAC + } + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT); + vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT); +} ROM_START( ertictac ) ROM_REGION(0x800000, "maincpu", 0 ) diff --git a/src/mame/drivers/esripsys.cpp b/src/mame/drivers/esripsys.cpp index 5adab44b8f0..7d6b0b55da9 100644 --- a/src/mame/drivers/esripsys.cpp +++ b/src/mame/drivers/esripsys.cpp @@ -664,52 +664,56 @@ void esripsys_state::init_esripsys() save_item(NAME(m_fbsel)); } -MACHINE_CONFIG_START(esripsys_state::esripsys) - MCFG_DEVICE_ADD("game_cpu", MC6809E, XTAL(8'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(game_cpu_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", esripsys_state, esripsys_vblank_irq) - MCFG_QUANTUM_PERFECT_CPU("game_cpu") - - MCFG_DEVICE_ADD("frame_cpu", MC6809E, XTAL(8'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(frame_cpu_map) - - MCFG_DEVICE_ADD("video_cpu", ESRIP, XTAL(40'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(video_cpu_map) - MCFG_ESRIP_FDT_R_CALLBACK(READ16(*this, esripsys_state, fdt_rip_r)) - MCFG_ESRIP_FDT_W_CALLBACK(WRITE16(*this, esripsys_state, fdt_rip_w)) - MCFG_ESRIP_STATUS_IN_CALLBACK(READ8(*this, esripsys_state, rip_status_in)) - MCFG_ESRIP_DRAW_CALLBACK_OWNER(esripsys_state, esripsys_draw) - MCFG_ESRIP_LBRM_PROM("proms") - MCFG_ESRIP_SCREEN("screen") - - MCFG_DEVICE_ADD("sound_cpu", MC6809E, XTAL(8'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(sound_cpu_map) +void esripsys_state::esripsys(machine_config &config) +{ + MC6809E(config, m_gamecpu, XTAL(8'000'000) / 4); + m_gamecpu->set_addrmap(AS_PROGRAM, &esripsys_state::game_cpu_map); + m_gamecpu->set_vblank_int("screen", FUNC(esripsys_state::esripsys_vblank_irq)); + + config.m_perfect_cpu_quantum = subtag("game_cpu"); + + MC6809E(config, m_framecpu, XTAL(8'000'000) / 4); + m_framecpu->set_addrmap(AS_PROGRAM, &esripsys_state::frame_cpu_map); + + ESRIP(config, m_videocpu, XTAL(40'000'000) / 4); + m_videocpu->set_addrmap(AS_PROGRAM, &esripsys_state::video_cpu_map); + m_videocpu->fdt_r().set(FUNC(esripsys_state::fdt_rip_r)); + m_videocpu->fdt_w().set(FUNC(esripsys_state::fdt_rip_w)); + m_videocpu->status_in().set(FUNC(esripsys_state::rip_status_in)); + m_videocpu->set_draw_callback(FUNC(esripsys_state::esripsys_draw)); + m_videocpu->set_lbrm_prom_region("proms"); + m_videocpu->set_screen_tag(m_screen); + + MC6809E(config, m_soundcpu, XTAL(8'000'000) / 4); + m_soundcpu->set_addrmap(AS_PROGRAM, &esripsys_state::sound_cpu_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* Video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(ESRIPSYS_PIXEL_CLOCK, ESRIPSYS_HTOTAL, ESRIPSYS_HBLANK_END, ESRIPSYS_HBLANK_START, ESRIPSYS_VTOTAL, ESRIPSYS_VBLANK_END, ESRIPSYS_VBLANK_START) - MCFG_SCREEN_UPDATE_DRIVER(esripsys_state, screen_update_esripsys) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(ESRIPSYS_PIXEL_CLOCK, ESRIPSYS_HTOTAL, ESRIPSYS_HBLANK_END, ESRIPSYS_HBLANK_START, + ESRIPSYS_VTOTAL, ESRIPSYS_VBLANK_END, ESRIPSYS_VBLANK_START); + m_screen->set_screen_update(FUNC(esripsys_state::screen_update_esripsys)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); /* Sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", MC3410, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC - MCFG_DEVICE_ADD("dacvol", MC3408, 0) // unknown DAC - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dacvol", 1.0, DAC_VREF_POS_INPUT) + MC3410(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // unknown DAC + mc3408_device &dacvol(MC3408(config, "dacvol", 0)); // unknown DAC + dacvol.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + dacvol.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dacvol", 1.0, DAC_VREF_POS_INPUT); - MCFG_DEVICE_ADD("tms5220nl", TMS5220, 640000) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + TMS5220(config, m_tms, 640000).add_route(ALL_OUTPUTS, "speaker", 1.0); /* 6840 PTM */ ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(8'000'000) / 4)); ptm.set_external_clocks(0, 0, 0); ptm.irq_callback().set(FUNC(esripsys_state::ptm_irq)); -MACHINE_CONFIG_END +} /************************************* diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index b64f2b9f351..8e3c3b41aa5 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -921,28 +921,28 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) - +void gaelco3d_state::gaelco3d(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD(m_maincpu, M68000, 15000000) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gaelco3d_state, vblank_gen) + M68000(config, m_maincpu, 15000000); + m_maincpu->set_addrmap(AS_PROGRAM, &gaelco3d_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(gaelco3d_state::vblank_gen)); TMS32031(config, m_tms, 60000000); m_tms->set_addrmap(AS_PROGRAM, &gaelco3d_state::tms_map); m_tms->set_mcbl_mode(true); m_tms->iack().set(FUNC(gaelco3d_state::tms_iack_w)); - MCFG_DEVICE_ADD(m_adsp, ADSP2115, 16000000) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, gaelco3d_state, adsp_tx_callback)) - MCFG_DEVICE_PROGRAM_MAP(adsp_program_map) - MCFG_DEVICE_DATA_MAP(adsp_data_map) + ADSP2115(config, m_adsp, 16000000); + m_adsp->sport_tx().set(FUNC(gaelco3d_state::adsp_tx_callback)); + m_adsp->set_addrmap(AS_PROGRAM, &gaelco3d_state::adsp_program_map); + m_adsp->set_addrmap(AS_DATA, &gaelco3d_state::adsp_data_map); EEPROM_93C66_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); - MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq) + TIMER(config, "adsp_timer").configure_generic(FUNC(gaelco3d_state::adsp_autobuffer_irq)); GAELCO_SERIAL(config, m_serial, 0); m_serial->irq_handler().set(FUNC(gaelco3d_state::ser_irq)); @@ -969,46 +969,39 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_adsp, ADSP2115_IRQ2); /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(576, 432) - MCFG_SCREEN_VISIBLE_AREA(0, 575, 0, 431) - MCFG_SCREEN_UPDATE_DRIVER(gaelco3d_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(2500)); /* not accurate */ + m_screen->set_size(576, 432); + m_screen->set_visarea(0, 575, 0, 431); + m_screen->set_screen_update(FUNC(gaelco3d_state::screen_update)); + m_screen->set_palette("palette"); - MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette") + PALETTE(config, "palette", 32768).set_init("palette", FUNC(palette_device::palette_init_RRRRRGGGGGBBBBB)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(m_dmadac[0], DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: front mono */ - - MCFG_DEVICE_ADD(m_dmadac[1], DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: left rear */ - - MCFG_DEVICE_ADD(m_dmadac[2], DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: right rear */ - - MCFG_DEVICE_ADD(m_dmadac[3], DMADAC) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: seat speaker */ -MACHINE_CONFIG_END + DMADAC(config, m_dmadac[0]).add_route(ALL_OUTPUTS, "mono", 1.0); /* speedup: front mono */ + DMADAC(config, m_dmadac[1]).add_route(ALL_OUTPUTS, "mono", 1.0); /* speedup: left rear */ + DMADAC(config, m_dmadac[2]).add_route(ALL_OUTPUTS, "mono", 1.0); /* speedup: right rear */ + DMADAC(config, m_dmadac[3]).add_route(ALL_OUTPUTS, "mono", 1.0); /* speedup: seat speaker */ +} -MACHINE_CONFIG_START(gaelco3d_state::gaelco3d2) +void gaelco3d_state::gaelco3d2(machine_config &config) +{ gaelco3d(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu", M68EC020, 25000000) - MCFG_DEVICE_PROGRAM_MAP(main020_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gaelco3d_state, vblank_gen) + M68EC020(config.replace(), m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &gaelco3d_state::main020_map); + m_maincpu->set_vblank_int("screen", FUNC(gaelco3d_state::vblank_gen)); - MCFG_DEVICE_MODIFY("tms") - MCFG_DEVICE_CLOCK(50000000) + m_tms->set_clock(50000000); MCFG_MACHINE_RESET_OVERRIDE(gaelco3d_state,gaelco3d2) -MACHINE_CONFIG_END +} void gaelco3d_state::footbpow(machine_config &config) { diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp index 56be52b9f79..4fc6487170a 100644 --- a/src/mame/drivers/harddriv.cpp +++ b/src/mame/drivers/harddriv.cpp @@ -1454,12 +1454,12 @@ WRITE_LINE_MEMBER(harddriv_state::video_int_write_line) /* Driver board without MSP (used by Race Drivin' cockpit) */ -MACHINE_CONFIG_START(harddriv_state::driver_nomsp) - +void harddriv_state::driver_nomsp(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68010, HARDDRIV_MASTER_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(driver_68k_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(harddriv_state, hd68k_irq_gen, HARDDRIV_MASTER_CLOCK/16/16/16/16/2) + M68010(config, m_maincpu, HARDDRIV_MASTER_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &harddriv_state::driver_68k_map); + m_maincpu->set_periodic_int(FUNC(harddriv_state::hd68k_irq_gen), attotime::from_hz(HARDDRIV_MASTER_CLOCK/16/16/16/16/2)); SLAPSTIC(config, m_slapstic_device, 117, true); @@ -1486,34 +1486,34 @@ MACHINE_CONFIG_START(harddriv_state::driver_nomsp) m_gsp->set_shiftreg_out_callback(FUNC(harddriv_state::hdgsp_read_from_shiftreg)); m_gsp->set_screen("screen"); - MCFG_QUANTUM_TIME(attotime::from_hz(30000)) + config.m_minimum_quantum = attotime::from_hz(30000); - MCFG_DEVICE_ADD("200e", M48T02, 0) + M48T02(config, m_200e, 0); - EEPROM_2816(config, "210e"); // MK48Z02 + EEPROM_2816(config, m_210e); // MK48Z02 - MCFG_DEVICE_ADD("duartn68681", MC68681, XTAL(3'686'400)) - MCFG_MC68681_IRQ_CALLBACK(WRITELINE(*this, harddriv_state, harddriv_duart_irq_handler)) - MCFG_MC68681_A_TX_CALLBACK(WRITELINE ("rs232", rs232_port_device, write_txd)) + MC68681(config, m_duartn68681, XTAL(3'686'400)); + m_duartn68681->irq_cb().set(FUNC(harddriv_state::harddriv_duart_irq_handler)); + m_duartn68681->a_tx_cb().set("rs232", FUNC(rs232_port_device::write_txd)); rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); rs232.rxd_handler().set("duartn68681", FUNC(mc68681_device::rx_a_w)); /* video hardware */ - MCFG_PALETTE_ADD("palette", 1024) - - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(HARDDRIV_GSP_CLOCK/12*4, 160*4, 0, 127*4, 417, 0, 384) - MCFG_SCREEN_UPDATE_DEVICE("gsp", tms34010_device, tms340x0_ind16) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, harddriv_state, video_int_write_line)) -MACHINE_CONFIG_END + PALETTE(config, m_palette, 1024); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(HARDDRIV_GSP_CLOCK/12*4, 160*4, 0, 127*4, 417, 0, 384); + m_screen->set_screen_update("gsp", FUNC(tms34010_device::tms340x0_ind16)); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(harddriv_state::video_int_write_line)); +} /* Driver board with MSP (used by Hard Drivin' cockpit) */ -MACHINE_CONFIG_START(harddriv_state::driver_msp) - +void harddriv_state::driver_msp(machine_config &config) +{ driver_nomsp(config); /* basic machine hardware */ @@ -1526,17 +1526,16 @@ MACHINE_CONFIG_START(harddriv_state::driver_msp) m_msp->set_screen("screen"); config.device_remove("slapstic"); -MACHINE_CONFIG_END +} /* Multisync board without MSP (used by STUN Runner, Steel Talons, Race Drivin' compact) */ -MACHINE_CONFIG_START(harddriv_state::multisync_nomsp) - +void harddriv_state::multisync_nomsp(machine_config &config) +{ driver_nomsp(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multisync_68k_map) + m_maincpu->set_addrmap(AS_PROGRAM, &harddriv_state::multisync_68k_map); m_gsp->set_addrmap(AS_PROGRAM, &harddriv_state::multisync_gsp_map); m_gsp->set_pixel_clock(6000000); @@ -1544,9 +1543,8 @@ MACHINE_CONFIG_START(harddriv_state::multisync_nomsp) m_gsp->set_scanline_ind16_callback(FUNC(harddriv_state::scanline_multisync)); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_RAW_PARAMS(HARDDRIV_GSP_CLOCK/8*2, 323*2, 0, 256*2, 308, 0, 288) -MACHINE_CONFIG_END + m_screen->set_raw(HARDDRIV_GSP_CLOCK/8*2, 323*2, 0, 256*2, 308, 0, 288); +} /* Multisync board with MSP (used by Hard Drivin' compact) */ @@ -1568,18 +1566,16 @@ void harddriv_state::multisync_msp(machine_config &config) /* Multisync II board (used by Hard Drivin's Airborne) */ -MACHINE_CONFIG_START(harddriv_state::multisync2) - +void harddriv_state::multisync2(machine_config &config) +{ multisync_nomsp(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multisync2_68k_map) - + m_maincpu->set_addrmap(AS_PROGRAM, &harddriv_state::multisync2_68k_map); m_gsp->set_addrmap(AS_PROGRAM, &harddriv_state::multisync2_gsp_map); config.device_remove("slapstic"); -MACHINE_CONFIG_END +} @@ -1590,49 +1586,53 @@ MACHINE_CONFIG_END *************************************/ /* ADSP/ADSP II boards (used by Hard/Race Drivin', STUN Runner) */ -MACHINE_CONFIG_START(harddriv_state::adsp) - +void harddriv_state::adsp(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("adsp", ADSP2100, XTAL(32'000'000)/4) - MCFG_DEVICE_PROGRAM_MAP(adsp_program_map) - MCFG_DEVICE_DATA_MAP(adsp_data_map) -MACHINE_CONFIG_END + ADSP2100(config, m_adsp, XTAL(32'000'000)/4); + m_adsp->set_addrmap(AS_PROGRAM, &harddriv_state::adsp_program_map); + m_adsp->set_addrmap(AS_DATA, &harddriv_state::adsp_data_map); +} /* DS III/IV board (used by Steel Talons, Street Drivin' and Hard Drivin's Airborne) */ -MACHINE_CONFIG_START(harddriv_state::ds3) - +void harddriv_state::ds3(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("adsp", ADSP2101, XTAL(12'000'000)) - MCFG_DEVICE_PROGRAM_MAP(ds3_program_map) - MCFG_DEVICE_DATA_MAP(ds3_data_map) - MCFG_QUANTUM_TIME(attotime::from_hz(60000)) - - MCFG_DEVICE_ADD("ds3sdsp", ADSP2105, XTAL(10'000'000)) - MCFG_ADSP21XX_SPORT_RX_CB(READ32(*this, harddriv_state, hdds3sdsp_serial_rx_callback)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, harddriv_state, hdds3sdsp_serial_tx_callback)) - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, harddriv_state, hdds3sdsp_timer_enable_callback)) - MCFG_DEVICE_PROGRAM_MAP(ds3sdsp_program_map) - MCFG_DEVICE_DATA_MAP(ds3sdsp_data_map) - MCFG_TIMER_DRIVER_ADD("ds3sdsp_timer", harddriv_state, ds3sdsp_internal_timer_callback) - - MCFG_DEVICE_ADD("ds3xdsp", ADSP2105, XTAL(10'000'000)) - MCFG_ADSP21XX_SPORT_RX_CB(READ32(*this, harddriv_state, hdds3xdsp_serial_rx_callback)) - MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, harddriv_state, hdds3xdsp_serial_tx_callback)) - MCFG_ADSP21XX_TIMER_FIRED_CB(WRITELINE(*this, harddriv_state, hdds3xdsp_timer_enable_callback)) - MCFG_DEVICE_PROGRAM_MAP(ds3xdsp_program_map) - MCFG_DEVICE_DATA_MAP(ds3xdsp_data_map) - MCFG_TIMER_DRIVER_ADD("ds3xdsp_timer", harddriv_state, ds3xdsp_internal_timer_callback) + ADSP2101(config, m_adsp, XTAL(12'000'000)); + m_adsp->set_addrmap(AS_PROGRAM, &harddriv_state::ds3_program_map); + m_adsp->set_addrmap(AS_PROGRAM, &harddriv_state::ds3_data_map); + + config.m_minimum_quantum = attotime::from_hz(60000); + + ADSP2105(config, m_ds3sdsp, XTAL(10'000'000)); + m_ds3sdsp->sport_rx().set(FUNC(harddriv_state::hdds3sdsp_serial_rx_callback)); + m_ds3sdsp->sport_tx().set(FUNC(harddriv_state::hdds3sdsp_serial_tx_callback)); + m_ds3sdsp->timer_fired().set(FUNC(harddriv_state::hdds3sdsp_timer_enable_callback)); + m_ds3sdsp->set_addrmap(AS_PROGRAM, &harddriv_state::ds3sdsp_program_map); + m_ds3sdsp->set_addrmap(AS_DATA, &harddriv_state::ds3sdsp_data_map); + TIMER(config, "ds3sdsp_timer").configure_generic(FUNC(harddriv_state::ds3sdsp_internal_timer_callback)); + + ADSP2105(config, m_ds3xdsp, XTAL(10'000'000)); + m_ds3xdsp->sport_rx().set(FUNC(harddriv_state::hdds3xdsp_serial_rx_callback)); + m_ds3xdsp->sport_tx().set(FUNC(harddriv_state::hdds3xdsp_serial_tx_callback)); + m_ds3xdsp->timer_fired().set(FUNC(harddriv_state::hdds3xdsp_timer_enable_callback)); + m_ds3xdsp->set_addrmap(AS_PROGRAM, &harddriv_state::ds3xdsp_program_map); + m_ds3xdsp->set_addrmap(AS_DATA, &harddriv_state::ds3xdsp_data_map); + TIMER(config, "ds3xdsp_timer").configure_generic(FUNC(harddriv_state::ds3xdsp_internal_timer_callback)); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // 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) -MACHINE_CONFIG_END + DAC_16BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 1.0); // unknown DAC + DAC_16BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 1.0); // 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); +} @@ -1643,32 +1643,32 @@ MACHINE_CONFIG_END *************************************/ /* DSK board (used by Race Drivin') */ -MACHINE_CONFIG_START(harddriv_state::dsk) - +void harddriv_state::dsk(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("dsp32", DSP32C, XTAL(40'000'000)) - MCFG_DSP32C_OUTPUT_CALLBACK(WRITE32(*this, harddriv_state,hddsk_update_pif)) - MCFG_DEVICE_PROGRAM_MAP(dsk_dsp32_map) + DSP32C(config, m_dsp32, XTAL(40'000'000)); + m_dsp32->out_cb().set(FUNC(harddriv_state::hddsk_update_pif)); + m_dsp32->set_addrmap(AS_PROGRAM, &harddriv_state::dsk_dsp32_map); - EEPROM_2816(config, "dsk_10c"); // MK48Z02 - EEPROM_2816(config, "dsk_30c"); // MK48Z02 + EEPROM_2816(config, m_dsk_10c); // MK48Z02 + EEPROM_2816(config, m_dsk_30c); // MK48Z02 /* ASIC65 */ ASIC65(config, m_asic65, 0, ASIC65_STANDARD); -MACHINE_CONFIG_END +} /* DSK II board (used by Hard Drivin's Airborne) */ -MACHINE_CONFIG_START(harddriv_state::dsk2) - +void harddriv_state::dsk2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("dsp32", DSP32C, XTAL(40'000'000)) - MCFG_DSP32C_OUTPUT_CALLBACK(WRITE32(*this, harddriv_state,hddsk_update_pif)) - MCFG_DEVICE_PROGRAM_MAP(dsk2_dsp32_map) + DSP32C(config, m_dsp32, XTAL(40'000'000)); + m_dsp32->out_cb().set(FUNC(harddriv_state::hddsk_update_pif)); + m_dsp32->set_addrmap(AS_PROGRAM, &harddriv_state::dsk2_dsp32_map); /* ASIC65 */ ASIC65(config, m_asic65, 0, ASIC65_STANDARD); -MACHINE_CONFIG_END +} WRITE_LINE_MEMBER(harddriv_state::sound_int_write_line) @@ -1685,12 +1685,13 @@ harddriv_board_device_state::harddriv_board_device_state(const machine_config &m { } -MACHINE_CONFIG_START(harddriv_board_device_state::device_add_mconfig) +void harddriv_board_device_state::device_add_mconfig(machine_config &config) +{ driver_msp(config); /* basic machine hardware */ /* original driver board with MSP */ adsp(config); /* ADSP board */ - MCFG_DEVICE_ADD("harddriv_sound", HARDDRIV_SOUND_BOARD, 0) /* driver sound board */ -MACHINE_CONFIG_END + HARDDRIV_SOUND_BOARD(config, m_harddriv_sound, 0); /* driver sound board */ +} void harddriv_board_device_state::device_start() { @@ -1713,13 +1714,14 @@ harddrivc_board_device_state::harddrivc_board_device_state(const machine_config { } -MACHINE_CONFIG_START(harddrivc_board_device_state::device_add_mconfig) +void harddrivc_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_msp(config); /* basic machine hardware */ /* multisync board with MSP */ adsp(config); /* ADSP board */ - MCFG_DEVICE_ADD("harddriv_sound", HARDDRIV_SOUND_BOARD, 0) /* driver sound board */ -MACHINE_CONFIG_END + HARDDRIV_SOUND_BOARD(config, m_harddriv_sound, 0); /* driver sound board */ +} /* Race Drivin */ @@ -1754,14 +1756,15 @@ racedrivb1_board_device_state::racedrivb1_board_device_state(const machine_confi { } -MACHINE_CONFIG_START(racedriv_board_device_state::device_add_mconfig) +void racedriv_board_device_state::device_add_mconfig(machine_config &config) +{ driver_nomsp(config); /* basic machine hardware */ /* original driver board without MSP */ adsp(config); /* ADSP board */ dsk(config); /* DSK board */ - MCFG_DEVICE_ADD("harddriv_sound", HARDDRIV_SOUND_BOARD, 0) /* driver sound board */ -MACHINE_CONFIG_END + HARDDRIV_SOUND_BOARD(config, m_harddriv_sound, 0); /* driver sound board */ +} /* Race Drivin Compact */ @@ -1809,18 +1812,18 @@ racedrivc_panorama_side_board_device_state::racedrivc_panorama_side_board_device { } -MACHINE_CONFIG_START(racedrivc_board_device_state::device_add_mconfig) - +void racedrivc_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_nomsp(config); /* basic machine hardware */ /* multisync board without MSP */ adsp(config); /* ADSP board */ dsk(config); /* DSK board */ - MCFG_DEVICE_ADD("harddriv_sound", HARDDRIV_SOUND_BOARD, 0) /* driver sound board */ -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(racedrivc_panorama_side_board_device_state::device_add_mconfig) + HARDDRIV_SOUND_BOARD(config, m_harddriv_sound, 0); /* driver sound board */ +} +void racedrivc_panorama_side_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_nomsp(config); // 8-bit analog inputs read but not used? @@ -1837,7 +1840,7 @@ MACHINE_CONFIG_START(racedrivc_panorama_side_board_device_state::device_add_mcon adsp(config); /* ADSP board */ // dsk(config); /* DSK board */ // MCFG_DEVICE_ADD("sound_board", HARDDRIV_SOUND_BOARD, 0) /* driver sound board */ -MACHINE_CONFIG_END +} /* Stun Runner */ @@ -1854,8 +1857,8 @@ stunrun_board_device_state::stunrun_board_device_state(const machine_config &mco { } -MACHINE_CONFIG_START(stunrun_board_device_state::device_add_mconfig) - +void stunrun_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_nomsp(config); /* basic machine hardware */ /* multisync board without MSP */ @@ -1864,8 +1867,7 @@ MACHINE_CONFIG_START(stunrun_board_device_state::device_add_mconfig) config.device_remove("slapstic"); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_RAW_PARAMS(5000000*2, 317*2, 0, 256*2, 262, 0, 228) + m_screen->set_raw(5000000*2, 317*2, 0, 256*2, 262, 0, 228); /* sund hardware */ SPEAKER(config, "mono").front_center(); @@ -1874,7 +1876,7 @@ MACHINE_CONFIG_START(stunrun_board_device_state::device_add_mconfig) m_jsa->main_int_cb().set(FUNC(harddriv_state::sound_int_write_line)); m_jsa->test_read_cb().set_ioport("IN0").bit(5); m_jsa->add_route(ALL_OUTPUTS, "mono", 1.0); -MACHINE_CONFIG_END +} /* Steel Talons */ @@ -1920,7 +1922,8 @@ steeltalp_board_device_state::steeltalp_board_device_state(const machine_config { } -MACHINE_CONFIG_START(steeltal_board_device_state::device_add_mconfig) +void steeltal_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_msp(config); /* basic machine hardware */ /* multisync board with MSP */ @@ -1942,7 +1945,7 @@ MACHINE_CONFIG_START(steeltal_board_device_state::device_add_mconfig) m_jsa->main_int_cb().set(FUNC(harddriv_state::sound_int_write_line)); m_jsa->test_read_cb().set_ioport("IN0").bit(5); m_jsa->add_route(ALL_OUTPUTS, "mono", 1.0); -MACHINE_CONFIG_END +} /* Street Drivin' */ @@ -1959,17 +1962,16 @@ strtdriv_board_device_state::strtdriv_board_device_state(const machine_config &m { } -MACHINE_CONFIG_START(strtdriv_board_device_state::device_add_mconfig) - +void strtdriv_board_device_state::device_add_mconfig(machine_config &config) +{ multisync_nomsp(config); /* basic machine hardware */ /* multisync board */ ds3(config); /* DS III board */ - MCFG_DEVICE_MODIFY("ds3xdsp") /* DS III auxiliary sound DSP has no code */ - MCFG_DEVICE_DISABLE() + m_ds3xdsp->set_disable(); /* DS III auxiliary sound DSP has no code */ dsk(config); /* DSK board */ -MACHINE_CONFIG_END +} /* Hard Drivin' Airbourne */ @@ -2003,67 +2005,80 @@ hdrivairp_board_device_state::hdrivairp_board_device_state(const machine_config { } -MACHINE_CONFIG_START(hdrivair_board_device_state::device_add_mconfig) - +void hdrivair_board_device_state::device_add_mconfig(machine_config &config) +{ multisync2(config); /* basic machine hardware */ /* multisync II board */ ds3(config); /* DS IV board */ dsk2(config); /* DSK II board */ -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(harddriv_new_state::harddriv_machine) - MCFG_DEVICE_ADD("mainpcb", HARDDRIV_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::harddriv_machine(machine_config &config) +{ + HARDDRIV_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::harddrivc_machine) - MCFG_DEVICE_ADD("mainpcb", HARDDRIVC_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::harddrivc_machine(machine_config &config) +{ + HARDDRIVC_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::racedriv_machine) - MCFG_DEVICE_ADD("mainpcb", RACEDRIV_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::racedriv_machine(machine_config &config) +{ + RACEDRIV_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::racedrivb1_machine) - MCFG_DEVICE_ADD("mainpcb", RACEDRIVB1_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::racedrivb1_machine(machine_config &config) +{ + RACEDRIVB1_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::racedrivc_machine) - MCFG_DEVICE_ADD("mainpcb", RACEDRIVC_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::racedrivc_machine(machine_config &config) +{ + RACEDRIVC_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::racedrivc1_machine) - MCFG_DEVICE_ADD("mainpcb", RACEDRIVC1_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::racedrivc1_machine(machine_config &config) +{ + RACEDRIVC1_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::stunrun_machine) - MCFG_DEVICE_ADD("mainpcb", STUNRUN_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::stunrun_machine(machine_config &config) +{ + STUNRUN_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::strtdriv_machine) - MCFG_DEVICE_ADD("mainpcb", STRTDRIV_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::strtdriv_machine(machine_config &config) +{ + STRTDRIV_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::hdrivair_machine) - MCFG_DEVICE_ADD("mainpcb", HDRIVAIR_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::hdrivair_machine(machine_config &config) +{ + HDRIVAIR_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::hdrivairp_machine) - MCFG_DEVICE_ADD("mainpcb", HDRIVAIRP_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::hdrivairp_machine(machine_config &config) +{ + HDRIVAIRP_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::steeltal_machine) - MCFG_DEVICE_ADD("mainpcb", STEELTAL_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::steeltal_machine(machine_config &config) +{ + STEELTAL_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::steeltal1_machine) - MCFG_DEVICE_ADD("mainpcb", STEELTAL1_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::steeltal1_machine(machine_config &config) +{ + STEELTAL1_BOARD(config, "mainpcb", 0); +} -MACHINE_CONFIG_START(harddriv_new_state::steeltalp_machine) - MCFG_DEVICE_ADD("mainpcb", STEELTALP_BOARD, 0) -MACHINE_CONFIG_END +void harddriv_new_state::steeltalp_machine(machine_config &config) +{ + STEELTALP_BOARD(config, "mainpcb", 0); +} WRITE_LINE_MEMBER(harddriv_new_state::tx_a) { @@ -2072,21 +2087,21 @@ WRITE_LINE_MEMBER(harddriv_new_state::tx_a) m_rightpcb->get_duart()->rx_a_w(state); } -MACHINE_CONFIG_START(harddriv_new_state::racedriv_panorama_machine) - MCFG_DEVICE_ADD("mainpcb", RACEDRIV_BOARD, 0) - MCFG_DEVICE_ADD("leftpcb", RACEDRIVC_PANORAMA_SIDE_BOARD, 0) - MCFG_DEVICE_ADD("rightpcb", RACEDRIVC_PANORAMA_SIDE_BOARD, 0) +void harddriv_new_state::racedriv_panorama_machine(machine_config &config) +{ + RACEDRIV_BOARD(config, "mainpcb", 0); + RACEDRIVC_PANORAMA_SIDE_BOARD(config, "leftpcb", 0); + RACEDRIVC_PANORAMA_SIDE_BOARD(config, "rightpcb", 0); // MCFG_QUANTUM_TIME(attotime::from_hz(100000)) - MCFG_DEVICE_MODIFY("mainpcb:duartn68681") - MCFG_MC68681_A_TX_CALLBACK(WRITELINE(*this, harddriv_new_state, tx_a)) + subdevice<mc68681_device>("mainpcb:duartn68681")->a_tx_cb().set(FUNC(harddriv_new_state::tx_a)); // boots with 'PROGRAM OK' when using standard Hard Drivin' board type (needs 137412-115 slapstic) subdevice<atari_slapstic_device>("mainpcb:slapstic")->set_chipnum(115); - MCFG_TIMER_DRIVER_ADD_PERIODIC("hack_timer", harddriv_new_state, hack_timer, attotime::from_hz(60)) + TIMER(config, "hack_timer").configure_periodic(FUNC(harddriv_new_state::hack_timer), attotime::from_hz(60)); // MCFG_QUANTUM_TIME(attotime::from_hz(60000)) -MACHINE_CONFIG_END +} // this is an ugly hack, otherwise MAME's core can't seem to handle partial updates if you have multiple screens with different update frequencies. // by forcing them to stay in sync using this ugly method everything works much better. diff --git a/src/mame/drivers/hh_amis2k.cpp b/src/mame/drivers/hh_amis2k.cpp index b176883557b..f0d4b354c68 100644 --- a/src/mame/drivers/hh_amis2k.cpp +++ b/src/mame/drivers/hh_amis2k.cpp @@ -66,7 +66,7 @@ private: void write_a12(int state); void sound_update(); - required_device<cpu_device> m_maincpu; + required_device<amis2152_cpu_device> m_maincpu; required_device<speaker_sound_device> m_speaker; required_device<timer_device> m_a12_decay_timer; @@ -312,18 +312,18 @@ static const u8 wildfire_7seg_table[0x10] = }; -MACHINE_CONFIG_START(wildfire_state::wildfire) - +void wildfire_state::wildfire(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", AMI_S2152, MASTER_CLOCK) - MCFG_AMI_S2000_7SEG_DECODER(wildfire_7seg_table) - MCFG_AMI_S2000_READ_I_CB(IOPORT("IN1")) - MCFG_AMI_S2000_WRITE_D_CB(WRITE8(*this, wildfire_state, write_d)) - MCFG_AMI_S2000_WRITE_A_CB(WRITE16(*this, wildfire_state, write_a)) - MCFG_AMI_S2152_FOUT_CB(WRITELINE(*this, wildfire_state, write_f)) + AMI_S2152(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_7seg_table(wildfire_7seg_table); + m_maincpu->read_i().set_ioport("IN1"); + m_maincpu->write_d().set(FUNC(wildfire_state::write_d)); + m_maincpu->write_a().set(FUNC(wildfire_state::write_a)); + m_maincpu->write_f().set(FUNC(wildfire_state::write_f)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", wildfire_state, display_decay_tick, attotime::from_msec(1)) - MCFG_TIMER_DRIVER_ADD("a12_decay", wildfire_state, reset_q2) + TIMER(config, "display_decay").configure_periodic(FUNC(wildfire_state::display_decay_tick), attotime::from_msec(1)); + TIMER(config, "a12_decay").configure_generic(FUNC(wildfire_state::reset_q2)); config.set_default_layout(layout_wildfire); @@ -331,9 +331,8 @@ MACHINE_CONFIG_START(wildfire_state::wildfire) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); +} diff --git a/src/mame/drivers/nds.cpp b/src/mame/drivers/nds.cpp index cbae0e705eb..b2ebec9aa73 100644 --- a/src/mame/drivers/nds.cpp +++ b/src/mame/drivers/nds.cpp @@ -970,18 +970,19 @@ TIMER_CALLBACK_MEMBER(nds_state::timer_expire) } } -MACHINE_CONFIG_START(nds_state::nds) - MCFG_DEVICE_ADD("arm7", ARM7, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(nds_arm7_map) +void nds_state::nds(machine_config &config) +{ + ARM7(config, m_arm7, MASTER_CLOCK); + m_arm7->set_addrmap(AS_PROGRAM, &nds_state::nds_arm7_map); - MCFG_DEVICE_ADD("arm9", ARM946ES, MASTER_CLOCK*2) - MCFG_ARM_HIGH_VECTORS() - MCFG_DEVICE_PROGRAM_MAP(nds_arm9_map) + ARM946ES(config, m_arm9, MASTER_CLOCK*2); + m_arm9->set_high_vectors(); + m_arm9->set_addrmap(AS_PROGRAM, &nds_state::nds_arm9_map); // WRAM ADDRESS_MAP_BANK(config, "nds7wram").set_map(&nds_state::nds7_wram_map).set_options(ENDIANNESS_LITTLE, 32, 32, 0x8000); ADDRESS_MAP_BANK(config, "nds9wram").set_map(&nds_state::nds9_wram_map).set_options(ENDIANNESS_LITTLE, 32, 32, 0x8000); -MACHINE_CONFIG_END +} /* Help identifying the region and revisions of the set would be greatly appreciated! */ ROM_START( nds ) diff --git a/src/mame/drivers/polgar.cpp b/src/mame/drivers/polgar.cpp index b83c9cf6a0a..865529b567b 100644 --- a/src/mame/drivers/polgar.cpp +++ b/src/mame/drivers/polgar.cpp @@ -357,10 +357,11 @@ void mephisto_academy_state::machine_reset() m_enable_nmi = true; } -MACHINE_CONFIG_START(mephisto_polgar_state::polgar) - MCFG_DEVICE_ADD("maincpu", M65C02, XTAL(4'915'200)) - MCFG_DEVICE_PROGRAM_MAP(polgar_mem) - MCFG_DEVICE_PERIODIC_INT_DRIVER(mephisto_polgar_state, nmi_line_pulse, XTAL(4'915'200) / (1 << 13)) +void mephisto_polgar_state::polgar(machine_config &config) +{ + m65c02_device &maincpu(M65C02(config, "maincpu", XTAL(4'915'200))); + maincpu.set_addrmap(AS_PROGRAM, &mephisto_polgar_state::polgar_mem); + maincpu.set_periodic_int(FUNC(mephisto_polgar_state::nmi_line_pulse), attotime::from_hz(XTAL(4'915'200) / (1 << 13))); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -375,24 +376,25 @@ MACHINE_CONFIG_START(mephisto_polgar_state::polgar) MEPHISTO_SENSORS_BOARD(config, "board", 0); MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mephisto_lcd); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mephisto_polgar_state::polgar10) +void mephisto_polgar_state::polgar10(machine_config &config) +{ polgar(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_CLOCK( XTAL(10'000'000) ) -MACHINE_CONFIG_END + subdevice<m65c02_device>("maincpu")->set_clock(XTAL(10'000'000)); +} -MACHINE_CONFIG_START(mephisto_risc_state::mrisc) - MCFG_DEVICE_ADD("maincpu", M65C02, XTAL(10'000'000) / 4) // G65SC02 - MCFG_DEVICE_PROGRAM_MAP(mrisc_mem) - MCFG_DEVICE_PERIODIC_INT_DRIVER(mephisto_risc_state, irq0_line_hold, XTAL(10'000'000) / (1 << 14)) +void mephisto_risc_state::mrisc(machine_config &config) +{ + m65c02_device &maincpu(M65C02(config, "maincpu", XTAL(10'000'000) / 4)); // G65SC02 + maincpu.set_addrmap(AS_PROGRAM, &mephisto_risc_state::mrisc_mem); + maincpu.set_periodic_int(FUNC(mephisto_risc_state::irq0_line_hold), attotime::from_hz(XTAL(10'000'000) / (1 << 14))); - MCFG_DEVICE_ADD("subcpu", ARM, XTAL(14'000'000)) // VY86C010 - MCFG_DEVICE_PROGRAM_MAP(mrisc_arm_mem) - MCFG_ARM_COPRO(VL86C020) + ARM(config, m_subcpu, XTAL(14'000'000)); // VY86C010 + m_subcpu->set_addrmap(AS_PROGRAM, &mephisto_risc_state::mrisc_arm_mem); + m_subcpu->set_copro_type(arm_cpu_device::copro_type::VL86C020); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -410,29 +412,29 @@ MACHINE_CONFIG_START(mephisto_risc_state::mrisc) MEPHISTO_SENSORS_BOARD(config, "board", 0); MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mephisto_lcd); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mephisto_milano_state::milano) +void mephisto_milano_state::milano(machine_config &config) +{ polgar(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(milano_mem) + subdevice<m65c02_device>("maincpu")->set_addrmap(AS_PROGRAM, &mephisto_milano_state::milano_mem); MEPHISTO_BUTTONS_BOARD(config.replace(), m_board, 0); m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_milano); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mephisto_academy_state::academy) +void mephisto_academy_state::academy(machine_config &config) +{ polgar(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(academy_mem) + subdevice<m65c02_device>("maincpu")->set_addrmap(AS_PROGRAM, &mephisto_academy_state::academy_mem); hc259_device &outlatch(HC259(config.replace(), "outlatch")); outlatch.q_out_cb<1>().set(FUNC(mephisto_academy_state::academy_nmi_w)); outlatch.q_out_cb<2>().set("display:beeper", FUNC(beep_device::set_state)).invert(); config.set_default_layout(layout_mephisto_academy); -MACHINE_CONFIG_END +} ROM_START(polgar) diff --git a/src/mame/drivers/rambo.cpp b/src/mame/drivers/rambo.cpp index 2a166be56ff..57cd6c227c0 100644 --- a/src/mame/drivers/rambo.cpp +++ b/src/mame/drivers/rambo.cpp @@ -148,18 +148,18 @@ void rambo_state::machine_reset() m_port_l = 0; } -MACHINE_CONFIG_START(rambo_state::rambo) - - MCFG_DEVICE_ADD("maincpu", ATMEGA2560, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(rambo_prg_map) - MCFG_DEVICE_DATA_MAP(rambo_data_map) - MCFG_DEVICE_IO_MAP(rambo_io_map) +void rambo_state::rambo(machine_config &config) +{ + ATMEGA2560(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &rambo_state::rambo_prg_map); + m_maincpu->set_addrmap(AS_DATA, &rambo_state::rambo_data_map); + m_maincpu->set_addrmap(AS_IO, &rambo_state::rambo_io_map); - MCFG_CPU_AVR8_EEPROM("eeprom") - MCFG_CPU_AVR8_LFUSE(0xFF) - MCFG_CPU_AVR8_HFUSE(0xDA) - MCFG_CPU_AVR8_EFUSE(0xF4) - MCFG_CPU_AVR8_LOCK(0x0F) + m_maincpu->set_eeprom_tag("eeprom"); + m_maincpu->set_low_fuses(0xff); + m_maincpu->set_high_fuses(0xda); + m_maincpu->set_extended_fuses(0xf4); + m_maincpu->set_lock_bits(0x0f); /*TODO: Add an ATMEGA32U2 for USB-Serial communications */ /*TODO: Emulate the AD5206 digipot */ @@ -167,7 +167,7 @@ MACHINE_CONFIG_START(rambo_state::rambo) for controlling the X, Y, Z, E1 (and optionally E2) motors */ /*TODO: Simulate the heating elements */ /*TODO: Implement the thermistor measurements */ -MACHINE_CONFIG_END +} ROM_START( metamaq2 ) ROM_REGION( 0x20000, "maincpu", 0 ) diff --git a/src/mame/drivers/replicator.cpp b/src/mame/drivers/replicator.cpp index a4afebb03df..b62733c6a07 100644 --- a/src/mame/drivers/replicator.cpp +++ b/src/mame/drivers/replicator.cpp @@ -589,7 +589,7 @@ void replicator_state::machine_reset() PALETTE_INIT_MEMBER(replicator_state, replicator) { -//These colors were picked with the color picker in Inkscape, based on a photo of the LCD used in the Replicator 1 3d printer: + // These colors were picked with the color picker in Inkscape, based on a photo of the LCD used in the Replicator 1 3d printer: palette.set_pen_color(0, rgb_t(0xCA, 0xE7, 0xEB)); palette.set_pen_color(1, rgb_t(0x78, 0xAB, 0xA8)); } @@ -609,44 +609,43 @@ static GFXDECODE_START( gfx_replicator ) GFXDECODE_ENTRY( "hd44780:cgrom", 0x0000, hd44780_charlayout, 0, 1 ) GFXDECODE_END -MACHINE_CONFIG_START(replicator_state::replicator) - - MCFG_DEVICE_ADD("maincpu", ATMEGA1280, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(replicator_prg_map) - MCFG_DEVICE_DATA_MAP(replicator_data_map) - MCFG_DEVICE_IO_MAP(replicator_io_map) +void replicator_state::replicator(machine_config &config) +{ + ATMEGA1280(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &replicator_state::replicator_prg_map); + m_maincpu->set_addrmap(AS_DATA, &replicator_state::replicator_data_map); + m_maincpu->set_addrmap(AS_IO, &replicator_state::replicator_io_map); - MCFG_CPU_AVR8_EEPROM("eeprom") - MCFG_CPU_AVR8_LFUSE(0xFF) - MCFG_CPU_AVR8_HFUSE(0xDA) - MCFG_CPU_AVR8_EFUSE(0xF4) - MCFG_CPU_AVR8_LOCK(0x0F) + m_maincpu->set_eeprom_tag("eeprom"); + m_maincpu->set_low_fuses(0xff); + m_maincpu->set_high_fuses(0xda); + m_maincpu->set_extended_fuses(0xf4); + m_maincpu->set_lock_bits(0x0f); /*TODO: Add an ATMEGA8U2 for USB-Serial communications */ /* video hardware */ - MCFG_SCREEN_ADD("screen", LCD) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update) - MCFG_SCREEN_SIZE(120, 18*2) //4x20 chars - MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18*2-1) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); + screen.set_size(120, 18*2); //4x20 chars + screen.set_visarea(0, 120-1, 0, 18*2-1); + screen.set_palette("palette"); - MCFG_PALETTE_ADD("palette", 2) - MCFG_PALETTE_INIT_OWNER(replicator_state, replicator) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_replicator) + PALETTE(config, "palette", 2).set_init(FUNC(replicator_state::palette_init_replicator)); + GFXDECODE(config, "gfxdecode", "palette", gfx_replicator); - MCFG_HD44780_ADD("hd44780") - MCFG_HD44780_LCD_SIZE(4, 20) + HD44780(config, "hd44780", 0).set_lcd_size(4, 20); /* sound hardware */ /* A piezo is connected to the PORT G bit 5 (OC0B pin driven by Timer/Counter #4) */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(0, "speaker", 0.5) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) -MACHINE_CONFIG_END + DAC_1BIT(config, m_dac, 0).add_route(0, "speaker", 0.5); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); +} ROM_START( replica1 ) ROM_REGION( 0x20000, "maincpu", 0 ) diff --git a/src/mame/drivers/risc2500.cpp b/src/mame/drivers/risc2500.cpp index b46bd228262..d7d928e90df 100644 --- a/src/mame/drivers/risc2500.cpp +++ b/src/mame/drivers/risc2500.cpp @@ -58,7 +58,7 @@ protected: void risc2500_mem(address_map &map); private: - required_device<cpu_device> m_maincpu; + required_device<arm_cpu_device> m_maincpu; required_device<ram_device> m_ram; required_device<nvram_device> m_nvram; required_device<dac_byte_interface> m_dac; @@ -314,24 +314,24 @@ void risc2500_state::risc2500_mem(address_map &map) map(0x02000000, 0x0203ffff).rom().region("maincpu", 0); } - -MACHINE_CONFIG_START(risc2500_state::risc2500) - MCFG_DEVICE_ADD(m_maincpu, ARM, XTAL(28'322'000) / 2) // VY86C010 - MCFG_DEVICE_PROGRAM_MAP(risc2500_mem) - MCFG_ARM_COPRO(VL86C020) - MCFG_DEVICE_PERIODIC_INT_DRIVER(risc2500_state, irq1_line_hold, 250) - - MCFG_SCREEN_ADD("screen", LCD) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_SIZE(12*6+1, 7) - MCFG_SCREEN_VISIBLE_AREA(0, 12*6, 0, 7-1) - MCFG_SCREEN_UPDATE_DRIVER(risc2500_state, screen_update) - MCFG_SCREEN_PALETTE("palette") +void risc2500_state::risc2500(machine_config &config) +{ + ARM(config, m_maincpu, XTAL(28'322'000) / 2); // VY86C010 + m_maincpu->set_addrmap(AS_PROGRAM, &risc2500_state::risc2500_mem); + m_maincpu->set_copro_type(arm_cpu_device::copro_type::VL86C020); + m_maincpu->set_periodic_int(FUNC(risc2500_state::irq1_line_hold), attotime::from_hz(250)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(12*6+1, 7); + screen.set_visarea(0, 12*6, 0, 7-1); + screen.set_screen_update(FUNC(risc2500_state::screen_update)); + screen.set_palette("palette"); config.set_default_layout(layout_risc2500); - MCFG_PALETTE_ADD_MONOCHROME("palette") + PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); RAM(config, m_ram).set_default_size("2M").set_extra_options("128K, 256K, 512K, 1M, 2M"); @@ -339,10 +339,12 @@ MACHINE_CONFIG_START(risc2500_state::risc2500) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD(m_dac, DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END + DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} /* ROM definitions */ diff --git a/src/mame/drivers/sbc6510.cpp b/src/mame/drivers/sbc6510.cpp index 8b2aac2908a..5f4285b1d0a 100644 --- a/src/mame/drivers/sbc6510.cpp +++ b/src/mame/drivers/sbc6510.cpp @@ -276,20 +276,21 @@ static GFXDECODE_START( gfx_sbc6510 ) GFXDECODE_END -MACHINE_CONFIG_START(sbc6510_state::sbc6510) +void sbc6510_state::sbc6510(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",M6510, XTAL(1'000'000)) - MCFG_DEVICE_PROGRAM_MAP(sbc6510_mem) + M6510(config, m_maincpu, XTAL(1'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &sbc6510_state::sbc6510_mem); - MCFG_DEVICE_ADD("videocpu",ATMEGA88, XTAL(16'000'000)) + ATMEGA88(config, m_videocpu, XTAL(16'000'000)); // MCFG_DEVICE_DISABLE() // trips SLEEP opcode, needs to be emulated - MCFG_DEVICE_PROGRAM_MAP(sbc6510_video_mem) - MCFG_DEVICE_DATA_MAP(sbc6510_video_data) - MCFG_DEVICE_IO_MAP(sbc6510_video_io) - MCFG_CPU_AVR8_EEPROM("eeprom") + m_videocpu->set_addrmap(AS_PROGRAM, &sbc6510_state::sbc6510_video_mem); + m_videocpu->set_addrmap(AS_DATA, &sbc6510_state::sbc6510_video_data); + m_videocpu->set_addrmap(AS_IO, &sbc6510_state::sbc6510_video_io); + m_videocpu->set_eeprom_tag("eeprom"); - MCFG_PALETTE_ADD_MONOCHROME("palette") // for F4 displayer only - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sbc6510) + PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); // for F4 displayer only + GFXDECODE(config, "gfxdecode", "palette", gfx_sbc6510); /* video hardware */ GENERIC_TERMINAL(config, m_terminal, 0); @@ -302,12 +303,12 @@ MACHINE_CONFIG_START(sbc6510_state::sbc6510) ay8910.port_b_read_callback().set(FUNC(sbc6510_state::psg_b_r)); ay8910.add_route(ALL_OUTPUTS, "mono", 1.00); - MCFG_DEVICE_ADD("cia6526", MOS6526, XTAL(1'000'000)) - MCFG_MOS6526_TOD(50) - MCFG_MOS6526_IRQ_CALLBACK(INPUTLINE("maincpu", M6510_IRQ_LINE)) - MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(*this, sbc6510_state, key_w)) - MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(*this, sbc6510_state, key_r)) -MACHINE_CONFIG_END + mos6526_device &cia(MOS6526(config, "cia6526", XTAL(1'000'000))); + cia.set_tod_clock(50); + cia.irq_wr_callback().set_inputline("maincpu", M6510_IRQ_LINE); + cia.pa_wr_callback().set(FUNC(sbc6510_state::key_w)); + cia.pb_rd_callback().set(FUNC(sbc6510_state::key_r)); +} /* ROM definition */ ROM_START( sbc6510 ) diff --git a/src/mame/drivers/uzebox.cpp b/src/mame/drivers/uzebox.cpp index 6401d3046ba..be6dd2152c2 100644 --- a/src/mame/drivers/uzebox.cpp +++ b/src/mame/drivers/uzebox.cpp @@ -284,38 +284,36 @@ DEVICE_IMAGE_LOAD_MEMBER(uzebox_state, uzebox_cart) * Machine definition * \****************************************************/ -MACHINE_CONFIG_START(uzebox_state::uzebox) - +void uzebox_state::uzebox(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", ATMEGA644, MASTER_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(uzebox_prg_map) - MCFG_DEVICE_DATA_MAP(uzebox_data_map) - MCFG_DEVICE_IO_MAP(uzebox_io_map) - MCFG_CPU_AVR8_EEPROM("eeprom") + ATMEGA644(config, m_maincpu, MASTER_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &uzebox_state::uzebox_prg_map); + m_maincpu->set_addrmap(AS_DATA, &uzebox_state::uzebox_data_map); + m_maincpu->set_addrmap(AS_IO, &uzebox_state::uzebox_io_map); + m_maincpu->set_eeprom_tag("eeprom"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(59.99) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1395)) - MCFG_SCREEN_SIZE(870, 525) - MCFG_SCREEN_VISIBLE_AREA(150, 870-1, 40, 488-1) - MCFG_SCREEN_UPDATE_DRIVER(uzebox_state, screen_update_uzebox) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.99); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1395)); + m_screen->set_size(870, 525); + m_screen->set_visarea(150, 870-1, 40, 488-1); + m_screen->set_screen_update(FUNC(uzebox_state::screen_update_uzebox)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(0, "mono", 1.00) + SPEAKER_SOUND(config, m_speaker).add_route(0, "mono", 1.00); - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "uzebox") - MCFG_GENERIC_EXTENSIONS("bin,uze") - MCFG_GENERIC_MANDATORY - MCFG_GENERIC_LOAD(uzebox_state, uzebox_cart) + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "uzebox", "bin,uze"); + m_cart->set_must_be_loaded(true); + m_cart->set_device_load(device_image_load_delegate(&uzebox_state::device_image_load_uzebox_cart, this)); - MCFG_SNES_CONTROL_PORT_ADD("ctrl1", snes_control_port_devices, "joypad") - MCFG_SNES_CONTROL_PORT_ADD("ctrl2", snes_control_port_devices, "joypad") + SNES_CONTROL_PORT(config, m_ctrl1, snes_control_port_devices, "joypad"); + SNES_CONTROL_PORT(config, m_ctrl2, snes_control_port_devices, "joypad"); - MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "eprom_list").set_original("uzebox"); +} ROM_START( uzebox ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) /* Main program store */ diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h index 3cf49d4a768..96d7d173684 100644 --- a/src/mame/includes/archimds.h +++ b/src/mame/includes/archimds.h @@ -9,11 +9,12 @@ #ifndef MAME_INCLUDES_ARCHIMEDES_H #define MAME_INCLUDES_ARCHIMEDES_H +#include "cpu/arm/arm.h" +#include "imagedev/floppy.h" #include "machine/aakart.h" -#include "sound/dac.h" #include "machine/i2cmem.h" #include "machine/wd_fdc.h" -#include "imagedev/floppy.h" +#include "sound/dac.h" #include "emupal.h" #include "screen.h" @@ -100,7 +101,7 @@ public: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; protected: - required_device<cpu_device> m_maincpu; + required_device<arm_cpu_device> m_maincpu; optional_device<i2cmem_device> m_i2cmem; optional_device<wd1772_device> m_fdc; optional_device<floppy_connector> m_floppy0; @@ -109,7 +110,7 @@ protected: required_memory_region m_region_vram; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - required_device_array<dac_word_interface, 8> m_dac; + required_device_array<dac_16bit_r2r_twos_complement_device, 8> m_dac; private: |