From 1e059434c3a5cdccb00b0fdaff73dcfbc1a5fc9c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 12 Jun 2017 18:28:13 +0200 Subject: device_add_mconfig up to devices/bus/o* (nw) --- src/devices/bus/macpds/pds_tpdfpd.cpp | 22 ++++------ src/devices/bus/macpds/pds_tpdfpd.h | 13 +++--- src/devices/bus/megadrive/eeprom.cpp | 65 +++++++---------------------- src/devices/bus/megadrive/eeprom.h | 26 +++++++----- src/devices/bus/megadrive/ggenie.cpp | 19 +++------ src/devices/bus/megadrive/ggenie.h | 10 ++--- src/devices/bus/megadrive/jcart.cpp | 21 ++++------ src/devices/bus/megadrive/jcart.h | 17 ++++---- src/devices/bus/megadrive/sk.cpp | 19 +++------ src/devices/bus/megadrive/sk.h | 11 ++--- src/devices/bus/megadrive/svp.cpp | 15 ++----- src/devices/bus/megadrive/svp.h | 10 ++--- src/devices/bus/midi/midiinport.cpp | 9 +--- src/devices/bus/midi/midiinport.h | 6 +-- src/devices/bus/midi/midioutport.cpp | 9 +--- src/devices/bus/midi/midioutport.h | 2 +- src/devices/bus/msx_cart/bm_012.cpp | 8 +--- src/devices/bus/msx_cart/bm_012.h | 10 ++--- src/devices/bus/msx_cart/disk.cpp | 33 ++------------- src/devices/bus/msx_cart/disk.h | 23 +++++----- src/devices/bus/msx_cart/fmpac.cpp | 8 +--- src/devices/bus/msx_cart/fmpac.h | 6 +-- src/devices/bus/msx_cart/konami.cpp | 32 ++------------ src/devices/bus/msx_cart/konami.h | 18 ++++---- src/devices/bus/msx_cart/majutsushi.cpp | 8 +--- src/devices/bus/msx_cart/majutsushi.h | 4 +- src/devices/bus/msx_cart/moonsound.cpp | 10 +---- src/devices/bus/msx_cart/moonsound.h | 9 ++-- src/devices/bus/msx_cart/msx_audio.cpp | 24 ++--------- src/devices/bus/msx_cart/msx_audio.h | 38 ++++++++--------- src/devices/bus/msx_cart/yamaha.cpp | 10 +---- src/devices/bus/msx_cart/yamaha.h | 13 +++--- src/devices/bus/msx_slot/fs4600.cpp | 8 +--- src/devices/bus/msx_slot/fs4600.h | 4 +- src/devices/bus/msx_slot/panasonic08.cpp | 8 +--- src/devices/bus/msx_slot/panasonic08.h | 4 +- src/devices/bus/msx_slot/sony08.cpp | 8 +--- src/devices/bus/msx_slot/sony08.h | 4 +- src/devices/bus/nasbus/avc.cpp | 10 +---- src/devices/bus/nasbus/avc.h | 6 +-- src/devices/bus/nasbus/floppy.cpp | 10 +---- src/devices/bus/nasbus/floppy.h | 6 +-- src/devices/bus/neogeo/boot_cthd.cpp | 14 +------ src/devices/bus/neogeo/boot_cthd.h | 7 ++-- src/devices/bus/neogeo/boot_kof10th.cpp | 7 +--- src/devices/bus/neogeo/boot_kof10th.h | 4 +- src/devices/bus/neogeo/boot_kof2k2.cpp | 23 ++++------ src/devices/bus/neogeo/boot_kof2k2.h | 12 ++++-- src/devices/bus/neogeo/boot_kof2k3.cpp | 27 ++++++------ src/devices/bus/neogeo/boot_kof2k3.h | 15 ++++--- src/devices/bus/neogeo/boot_misc.cpp | 22 ++-------- src/devices/bus/neogeo/boot_misc.h | 12 +++--- src/devices/bus/neogeo/boot_svc.cpp | 14 +------ src/devices/bus/neogeo/boot_svc.h | 10 +++-- src/devices/bus/neogeo/cmc.cpp | 7 +--- src/devices/bus/neogeo/cmc.h | 4 +- src/devices/bus/neogeo/fatfury2.cpp | 7 +--- src/devices/bus/neogeo/fatfury2.h | 4 +- src/devices/bus/neogeo/kof2k2.cpp | 7 +--- src/devices/bus/neogeo/kof2k2.h | 3 +- src/devices/bus/neogeo/kof98.cpp | 7 +--- src/devices/bus/neogeo/kof98.h | 4 +- src/devices/bus/neogeo/mslugx.cpp | 7 +--- src/devices/bus/neogeo/mslugx.h | 4 +- src/devices/bus/neogeo/pcm2.cpp | 7 +--- src/devices/bus/neogeo/pcm2.h | 4 +- src/devices/bus/neogeo/pvc.cpp | 9 +--- src/devices/bus/neogeo/pvc.h | 4 +- src/devices/bus/neogeo/sma.cpp | 7 +--- src/devices/bus/neogeo/sma.h | 4 +- src/devices/bus/nes/aladdin.cpp | 7 +--- src/devices/bus/nes/aladdin.h | 3 +- src/devices/bus/nes/bandai.cpp | 15 +------ src/devices/bus/nes/bandai.h | 6 ++- src/devices/bus/nes/datach.cpp | 14 +------ src/devices/bus/nes/datach.h | 12 +++--- src/devices/bus/nes/disksys.cpp | 14 ++----- src/devices/bus/nes/disksys.h | 6 +-- src/devices/bus/nes/ggenie.cpp | 16 ++----- src/devices/bus/nes/ggenie.h | 7 ++-- src/devices/bus/nes/jaleco.cpp | 56 ++++--------------------- src/devices/bus/nes/jaleco.h | 23 ++++++---- src/devices/bus/nes/karastudio.cpp | 7 +--- src/devices/bus/nes/karastudio.h | 7 ++-- src/devices/bus/nes/konami.cpp | 29 ++++--------- src/devices/bus/nes/konami.h | 6 ++- src/devices/bus/nes/pt554.cpp | 14 ++----- src/devices/bus/nes/pt554.h | 6 ++- src/devices/bus/nes/sunsoft.cpp | 20 +++------ src/devices/bus/nes/sunsoft.h | 5 ++- src/devices/bus/nes/sunsoft_dcs.cpp | 17 +++----- src/devices/bus/nes/sunsoft_dcs.h | 3 +- src/devices/bus/nes_ctrl/bcbattle.cpp | 7 +--- src/devices/bus/nes_ctrl/bcbattle.h | 4 +- src/devices/bus/nes_ctrl/fckeybrd.cpp | 17 +++----- src/devices/bus/nes_ctrl/fckeybrd.h | 6 +-- src/devices/bus/nes_ctrl/hori.cpp | 25 ++++------- src/devices/bus/nes_ctrl/hori.h | 10 ++--- src/devices/bus/nes_ctrl/joypad.cpp | 17 +++----- src/devices/bus/nes_ctrl/joypad.h | 4 +- src/devices/bus/nes_ctrl/miracle.cpp | 7 +--- src/devices/bus/nes_ctrl/miracle.h | 7 ++-- src/devices/bus/newbrain/eim.cpp | 16 +------ src/devices/bus/newbrain/eim.h | 27 ++++++------ src/devices/bus/newbrain/fdc.cpp | 15 +------ src/devices/bus/newbrain/fdc.h | 11 ++--- src/devices/bus/nubus/nubus_48gc.cpp | 26 +++++------- src/devices/bus/nubus/nubus_48gc.h | 14 +++---- src/devices/bus/nubus/nubus_asntmc3b.cpp | 20 ++++----- src/devices/bus/nubus/nubus_asntmc3b.h | 17 ++++---- src/devices/bus/nubus/nubus_cb264.cpp | 21 ++++------ src/devices/bus/nubus/nubus_cb264.h | 14 +++---- src/devices/bus/nubus/nubus_image.cpp | 14 ++----- src/devices/bus/nubus/nubus_image.h | 8 ++-- src/devices/bus/nubus/nubus_m2hires.cpp | 21 ++++------ src/devices/bus/nubus/nubus_m2hires.h | 13 +++--- src/devices/bus/nubus/nubus_m2video.cpp | 21 ++++------ src/devices/bus/nubus/nubus_m2video.h | 13 +++--- src/devices/bus/nubus/nubus_radiustpd.cpp | 21 ++++------ src/devices/bus/nubus/nubus_radiustpd.h | 13 +++--- src/devices/bus/nubus/nubus_spec8.cpp | 21 ++++------ src/devices/bus/nubus/nubus_spec8.h | 16 +++---- src/devices/bus/nubus/nubus_specpdq.cpp | 26 +++++------- src/devices/bus/nubus/nubus_specpdq.h | 16 +++---- src/devices/bus/nubus/nubus_vikbw.cpp | 21 ++++------ src/devices/bus/nubus/nubus_vikbw.h | 13 +++--- src/devices/bus/nubus/nubus_wsportrait.cpp | 21 ++++------ src/devices/bus/nubus/nubus_wsportrait.h | 13 +++--- src/devices/bus/nubus/pds30_30hr.cpp | 21 ++++------ src/devices/bus/nubus/pds30_30hr.h | 13 +++--- src/devices/bus/nubus/pds30_cb264.cpp | 21 ++++------ src/devices/bus/nubus/pds30_cb264.h | 13 +++--- src/devices/bus/nubus/pds30_mc30.cpp | 21 ++++------ src/devices/bus/nubus/pds30_mc30.h | 13 +++--- src/devices/bus/nubus/pds30_procolor816.cpp | 21 ++++------ src/devices/bus/nubus/pds30_procolor816.h | 13 +++--- src/devices/bus/nubus/pds30_sigmalview.cpp | 21 ++++------ src/devices/bus/nubus/pds30_sigmalview.h | 13 +++--- src/devices/bus/odyssey2/chess.cpp | 22 +++------- src/devices/bus/odyssey2/chess.h | 3 +- src/devices/bus/odyssey2/voice.cpp | 16 ++----- src/devices/bus/odyssey2/voice.h | 9 ++-- src/devices/bus/oricext/jasmin.cpp | 23 ++++------ src/devices/bus/oricext/jasmin.h | 5 ++- src/devices/bus/oricext/microdisc.cpp | 29 ++++++------- src/devices/bus/oricext/microdisc.h | 14 ++++--- 146 files changed, 730 insertions(+), 1262 deletions(-) diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp index 03c96cab1bf..a6d39106c8b 100644 --- a/src/devices/bus/macpds/pds_tpdfpd.cpp +++ b/src/devices/bus/macpds/pds_tpdfpd.cpp @@ -41,14 +41,6 @@ #define VRAM_SIZE (256*1024) // PCB has a jumper for 1MByte; may require different EPROMs -MACHINE_CONFIG_START( sedisplay ) - MCFG_SCREEN_ADD( SEDISPLAY_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, macpds_sedisplay_device, screen_update) - MCFG_SCREEN_SIZE(1280, 960) - MCFG_SCREEN_REFRESH_RATE(70) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 870-1) -MACHINE_CONFIG_END - ROM_START( sedisplay ) ROM_REGION(0x10000, SEDISPLAY_ROM_REGION, ROMREGION_16BIT|ROMREGION_BE) ROM_LOAD16_BYTE( "tfd_fpd-asic_u6_297-0205-a_v4_1", 0x0000, 0x8000, CRC(fd363f45) SHA1(3c4c596654647ee6ce1880de329aa675d298dc26) ) @@ -63,14 +55,16 @@ DEFINE_DEVICE_TYPE(PDS_SEDISPLAY, macpds_sedisplay_device, "pds_sefp", "Radius S //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor macpds_sedisplay_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sedisplay ); -} +MACHINE_CONFIG_MEMBER( macpds_sedisplay_device::device_add_mconfig ) + MCFG_SCREEN_ADD( SEDISPLAY_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, macpds_sedisplay_device, screen_update) + MCFG_SCREEN_SIZE(1280, 960) + MCFG_SCREEN_REFRESH_RATE(70) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 870-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/macpds/pds_tpdfpd.h b/src/devices/bus/macpds/pds_tpdfpd.h index b0111bcef8e..6f1b3c0ab12 100644 --- a/src/devices/bus/macpds/pds_tpdfpd.h +++ b/src/devices/bus/macpds/pds_tpdfpd.h @@ -22,12 +22,6 @@ public: // construction/destruction macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: macpds_sedisplay_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ16_MEMBER(sedisplay_r); DECLARE_WRITE16_MEMBER(sedisplay_w); DECLARE_READ16_MEMBER(ramdac_r); DECLARE_WRITE16_MEMBER(ramdac_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::unique_ptr m_vram; uint32_t m_vbl_disable; uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; diff --git a/src/devices/bus/megadrive/eeprom.cpp b/src/devices/bus/megadrive/eeprom.cpp index 6cde19adf25..9fca00e8436 100644 --- a/src/devices/bus/megadrive/eeprom.cpp +++ b/src/devices/bus/megadrive/eeprom.cpp @@ -104,71 +104,36 @@ md_eeprom_blara_device::md_eeprom_blara_device(const machine_config &mconfig, co //------------------------------------------------- -// SERIAL I2C DEVICE +// device_add_mconfig - add device configuration //------------------------------------------------- - -// MD_STD_EEPROM & MD_EEPROM_NHLPA -MACHINE_CONFIG_START( md_i2c_24c01 ) +MACHINE_CONFIG_MEMBER( md_std_eeprom_device::device_add_mconfig ) MCFG_24C01_ADD("i2cmem") MACHINE_CONFIG_END -// MD_EEPROM_NBAJAM & MD_EEPROM_NBAJAMTE -MACHINE_CONFIG_START( md_i2c_24c02 ) +MACHINE_CONFIG_MEMBER( md_eeprom_nbajam_device::device_add_mconfig ) MCFG_24C02_ADD("i2cmem") MACHINE_CONFIG_END -// MD_EEPROM_NFLQB -MACHINE_CONFIG_START( md_i2c_24c16 ) - MCFG_24C16_ADD("i2cmem") +MACHINE_CONFIG_MEMBER( md_eeprom_nbajamte_device::device_add_mconfig ) + MCFG_24C02_ADD("i2cmem") MACHINE_CONFIG_END -// MD_EEPROM_CSLAM & MD_EEPROM_BLARA -MACHINE_CONFIG_START( md_i2c_24c64 ) +MACHINE_CONFIG_MEMBER( md_eeprom_cslam_device::device_add_mconfig ) MCFG_24C64_ADD("i2cmem") MACHINE_CONFIG_END +MACHINE_CONFIG_MEMBER( md_eeprom_nflqb_device::device_add_mconfig ) + MCFG_24C16_ADD("i2cmem") +MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor md_std_eeprom_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c01 ); -} - -machine_config_constructor md_eeprom_nbajam_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c02 ); -} - -machine_config_constructor md_eeprom_nbajamte_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c02 ); -} - -machine_config_constructor md_eeprom_cslam_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c64 ); -} - -machine_config_constructor md_eeprom_nflqb_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c16 ); -} - -machine_config_constructor md_eeprom_nhlpa_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c01 ); -} - -machine_config_constructor md_eeprom_blara_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c64 ); -} +MACHINE_CONFIG_MEMBER( md_eeprom_nhlpa_device::device_add_mconfig ) + MCFG_24C01_ADD("i2cmem") +MACHINE_CONFIG_END +MACHINE_CONFIG_MEMBER( md_eeprom_blara_device::device_add_mconfig ) + MCFG_24C64_ADD("i2cmem") +MACHINE_CONFIG_END void md_std_eeprom_device::device_start() { diff --git a/src/devices/bus/megadrive/eeprom.h b/src/devices/bus/megadrive/eeprom.h index aaa4f196fe2..de60b413c27 100644 --- a/src/devices/bus/megadrive/eeprom.h +++ b/src/devices/bus/megadrive/eeprom.h @@ -22,18 +22,18 @@ public: // construction/destruction md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: + md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; virtual DECLARE_WRITE16_MEMBER(write) override; -protected: - md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - required_device m_i2cmem; uint8_t m_i2c_mem, m_i2c_clk; }; @@ -46,8 +46,9 @@ public: // construction/destruction md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -62,8 +63,9 @@ public: // construction/destruction md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -78,8 +80,9 @@ public: // construction/destruction md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -94,8 +97,9 @@ public: // construction/destruction md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -110,8 +114,9 @@ public: // construction/destruction md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -126,8 +131,9 @@ public: // construction/destruction md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; diff --git a/src/devices/bus/megadrive/ggenie.cpp b/src/devices/bus/megadrive/ggenie.cpp index c5ca400b6a5..d9caacd6eea 100644 --- a/src/devices/bus/megadrive/ggenie.cpp +++ b/src/devices/bus/megadrive/ggenie.cpp @@ -157,9 +157,6 @@ WRITE16_MEMBER(md_rom_ggenie_device::write) } } -//------------------------------------------------- -// MACHINE_CONFIG_START( ggenie_slot ) -//------------------------------------------------- static SLOT_INTERFACE_START(ggenie_sub_cart) SLOT_INTERFACE_INTERNAL("rom", MD_STD_ROM) @@ -169,18 +166,12 @@ static SLOT_INTERFACE_START(ggenie_sub_cart) SLOT_INTERFACE_INTERNAL("rom_fram", MD_ROM_FRAM) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( ggenie_slot ) - MCFG_MD_CARTRIDGE_ADD("subslot", ggenie_sub_cart, nullptr) - MCFG_MD_CARTRIDGE_NOT_MANDATORY -MACHINE_CONFIG_END - //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor md_rom_ggenie_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( ggenie_slot ); -} +MACHINE_CONFIG_MEMBER( md_rom_ggenie_device::device_add_mconfig ) + MCFG_MD_CARTRIDGE_ADD("subslot", ggenie_sub_cart, nullptr) + MCFG_MD_CARTRIDGE_NOT_MANDATORY +MACHINE_CONFIG_END diff --git a/src/devices/bus/megadrive/ggenie.h b/src/devices/bus/megadrive/ggenie.h index 49cf1784f64..38e282ac747 100644 --- a/src/devices/bus/megadrive/ggenie.h +++ b/src/devices/bus/megadrive/ggenie.h @@ -17,17 +17,17 @@ public: // construction/destruction md_rom_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: + virtual void device_start() override; + virtual void device_reset() override; + // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; virtual DECLARE_WRITE16_MEMBER(write) override; -protected: - virtual void device_start() override; - virtual void device_reset() override; - private: required_device m_exp; uint16_t m_gg_regs[0x20]; diff --git a/src/devices/bus/megadrive/jcart.cpp b/src/devices/bus/megadrive/jcart.cpp index d607aea5c05..9cad21dc022 100644 --- a/src/devices/bus/megadrive/jcart.cpp +++ b/src/devices/bus/megadrive/jcart.cpp @@ -77,9 +77,7 @@ md_seprom_mm96_device::md_seprom_mm96_device(const machine_config &mconfig, cons //------------------------------------------------- // MD_SEPROM_CODEMAST -MACHINE_CONFIG_START( md_i2c_24c08 ) - MCFG_24C08_ADD("i2cmem") -MACHINE_CONFIG_END + // MD_SEPROM_MM96 MACHINE_CONFIG_START( md_i2c_24c16a ) @@ -88,19 +86,16 @@ MACHINE_CONFIG_END //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor md_seprom_codemast_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c08 ); -} +MACHINE_CONFIG_MEMBER( md_seprom_codemast_device::device_add_mconfig ) + MCFG_24C08_ADD("i2cmem") +MACHINE_CONFIG_END -machine_config_constructor md_seprom_mm96_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_i2c_24c16a ); -} +MACHINE_CONFIG_MEMBER( md_seprom_mm96_device::device_add_mconfig ) + MCFG_24C16A_ADD("i2cmem") +MACHINE_CONFIG_END static INPUT_PORTS_START( jcart_ipt ) diff --git a/src/devices/bus/megadrive/jcart.h b/src/devices/bus/megadrive/jcart.h index 1962930d23a..510a91a5d37 100644 --- a/src/devices/bus/megadrive/jcart.h +++ b/src/devices/bus/megadrive/jcart.h @@ -48,19 +48,19 @@ public: // construction/destruction md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - - // reading and writing - virtual DECLARE_READ16_MEMBER(read) override; - virtual DECLARE_WRITE16_MEMBER(write) override; - protected: md_seprom_codemast_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + + // reading and writing + virtual DECLARE_READ16_MEMBER(read) override; + virtual DECLARE_WRITE16_MEMBER(write) override; + required_device m_i2cmem; private: @@ -76,8 +76,9 @@ public: // construction/destruction md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; }; diff --git a/src/devices/bus/megadrive/sk.cpp b/src/devices/bus/megadrive/sk.cpp index 822e076c6b4..ddaf4fdcf83 100644 --- a/src/devices/bus/megadrive/sk.cpp +++ b/src/devices/bus/megadrive/sk.cpp @@ -63,9 +63,6 @@ WRITE16_MEMBER(md_rom_sk_device::write) // should there be anything here? } -//------------------------------------------------- -// MACHINE_CONFIG_START( sk_slot ) -//------------------------------------------------- static SLOT_INTERFACE_START(sk_sub_cart) SLOT_INTERFACE_INTERNAL("rom", MD_STD_ROM) @@ -76,18 +73,12 @@ static SLOT_INTERFACE_START(sk_sub_cart) // add all types?? SLOT_INTERFACE_END -static MACHINE_CONFIG_START( sk_slot ) - MCFG_MD_CARTRIDGE_ADD("subslot", sk_sub_cart, nullptr) - MCFG_MD_CARTRIDGE_NOT_MANDATORY -MACHINE_CONFIG_END - //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor md_rom_sk_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sk_slot ); -} +MACHINE_CONFIG_MEMBER( md_rom_sk_device::device_add_mconfig ) + MCFG_MD_CARTRIDGE_ADD("subslot", sk_sub_cart, nullptr) + MCFG_MD_CARTRIDGE_NOT_MANDATORY +MACHINE_CONFIG_END diff --git a/src/devices/bus/megadrive/sk.h b/src/devices/bus/megadrive/sk.h index 091fd9325c9..2e115f7674c 100644 --- a/src/devices/bus/megadrive/sk.h +++ b/src/devices/bus/megadrive/sk.h @@ -17,17 +17,18 @@ public: // construction/destruction md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: + md_rom_sk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override; + // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; // reading and writing virtual DECLARE_READ16_MEMBER(read) override; virtual DECLARE_WRITE16_MEMBER(write) override; -protected: - md_rom_sk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - virtual void device_start() override; - private: required_device m_exp; }; diff --git a/src/devices/bus/megadrive/svp.cpp b/src/devices/bus/megadrive/svp.cpp index 52293d585b4..af18bc02c0d 100644 --- a/src/devices/bus/megadrive/svp.cpp +++ b/src/devices/bus/megadrive/svp.cpp @@ -340,26 +340,17 @@ ADDRESS_MAP_START( md_svp_ext_map, AS_IO, 16, md_rom_svp_device ) AM_RANGE(7*2, 7*2+1) AM_READWRITE(read_al, write_al) ADDRESS_MAP_END + //------------------------------------------------- -// MACHINE_DRIVER( md_svp ) +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( md_svp ) +MACHINE_CONFIG_MEMBER( md_rom_svp_device::device_add_mconfig ) MCFG_CPU_ADD("svp", SSP1601, MASTER_CLOCK_NTSC / 7 * 3) /* ~23 MHz (guessed) */ MCFG_CPU_PROGRAM_MAP(md_svp_ssp_map) MCFG_CPU_IO_MAP(md_svp_ext_map) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor md_rom_svp_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( md_svp ); -} - ioport_constructor md_rom_svp_device::device_input_ports() const { return INPUT_PORTS_NAME( md_svp ); diff --git a/src/devices/bus/megadrive/svp.h b/src/devices/bus/megadrive/svp.h index 328864d91e6..c39ea5d85eb 100644 --- a/src/devices/bus/megadrive/svp.h +++ b/src/devices/bus/megadrive/svp.h @@ -19,11 +19,6 @@ public: // construction/destruction md_rom_svp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual ioport_constructor device_input_ports() const override; - virtual void set_bank_to_rom(const char *banktag, uint32_t offset) override; - // reading and writing virtual DECLARE_READ16_MEMBER(read) override; virtual DECLARE_WRITE16_MEMBER(write) override; @@ -55,6 +50,11 @@ protected: virtual void device_start() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual void set_bank_to_rom(const char *banktag, uint32_t offset) override; + required_device m_svp; required_ioport m_test_ipt; diff --git a/src/devices/bus/midi/midiinport.cpp b/src/devices/bus/midi/midiinport.cpp index 3131a4aba33..748a84f6404 100644 --- a/src/devices/bus/midi/midiinport.cpp +++ b/src/devices/bus/midi/midiinport.cpp @@ -2,7 +2,7 @@ // copyright-holders:R. Belmont /********************************************************************* - midiinport.c + midiinport.cpp MIDI In serial port - glues the image device to the pluggable serial port @@ -20,12 +20,7 @@ midiin_port_device::midiin_port_device(const machine_config &mconfig, const char { } -static MACHINE_CONFIG_START(midiin_port_config) +MACHINE_CONFIG_MEMBER(midiin_port_device::device_add_mconfig) MCFG_DEVICE_ADD("midiinimg", MIDIIN, 0) MCFG_MIDIIN_INPUT_CB(WRITELINE(midiin_port_device, read)) MACHINE_CONFIG_END - -machine_config_constructor midiin_port_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(midiin_port_config); -} diff --git a/src/devices/bus/midi/midiinport.h b/src/devices/bus/midi/midiinport.h index daf3a5cfdb9..526af88bb2a 100644 --- a/src/devices/bus/midi/midiinport.h +++ b/src/devices/bus/midi/midiinport.h @@ -22,14 +22,14 @@ class midiin_port_device : public device_t, public: midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_WRITE_LINE_MEMBER( read ) { output_rxd(state); } - protected: - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override { m_owner = dynamic_cast(owner()); } virtual void device_reset() override { } private: + DECLARE_WRITE_LINE_MEMBER( read ) { output_rxd(state); } + required_device m_midiin; }; diff --git a/src/devices/bus/midi/midioutport.cpp b/src/devices/bus/midi/midioutport.cpp index 0f808317c4d..be7df7c0683 100644 --- a/src/devices/bus/midi/midioutport.cpp +++ b/src/devices/bus/midi/midioutport.cpp @@ -2,7 +2,7 @@ // copyright-holders:R. Belmont /********************************************************************* - midioutport.c + midioutport.cpp MIDI Out serial port - glues the image device to the pluggable serial port @@ -20,11 +20,6 @@ midiout_port_device::midiout_port_device(const machine_config &mconfig, const ch { } -static MACHINE_CONFIG_START(midiout_port_config) +MACHINE_CONFIG_MEMBER(midiout_port_device::device_add_mconfig) MCFG_MIDIOUT_ADD("midioutimg") MACHINE_CONFIG_END - -machine_config_constructor midiout_port_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(midiout_port_config); -} diff --git a/src/devices/bus/midi/midioutport.h b/src/devices/bus/midi/midioutport.h index bd594c48732..2cc33ae922f 100644 --- a/src/devices/bus/midi/midioutport.h +++ b/src/devices/bus/midi/midioutport.h @@ -21,13 +21,13 @@ class midiout_port_device : public device_t, { public: midiout_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { if (started()) m_midiout->tx(state); } protected: virtual void device_start() override { } virtual void device_reset() override { } + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_midiout; diff --git a/src/devices/bus/msx_cart/bm_012.cpp b/src/devices/bus/msx_cart/bm_012.cpp index d87b6749030..2d8f9d21cb6 100644 --- a/src/devices/bus/msx_cart/bm_012.cpp +++ b/src/devices/bus/msx_cart/bm_012.cpp @@ -38,7 +38,7 @@ static ADDRESS_MAP_START( bm_012_memory_map, AS_PROGRAM, 8, msx_cart_bm_012_devi ADDRESS_MAP_END -static MACHINE_CONFIG_START( msx_cart_bm_012 ) +MACHINE_CONFIG_MEMBER( msx_cart_bm_012_device::device_add_mconfig ) // 12MHz XTAL @ X1 // Toshiba TMPZ84C015AF-6 (@U5) components: // - Z80 @@ -77,12 +77,6 @@ static MACHINE_CONFIG_START( msx_cart_bm_012 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_bm_012_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_cart_bm_012 ); -} - - ROM_START( msx_cart_bm_012 ) ROM_REGION(0x8000, "tmpz84c015af", 0) // The rom chip at U4 is a 27256, but it contains the same 8KB duplicated 4 times diff --git a/src/devices/bus/msx_cart/bm_012.h b/src/devices/bus/msx_cart/bm_012.h index 3b8ed797622..5abae1909b4 100644 --- a/src/devices/bus/msx_cart/bm_012.h +++ b/src/devices/bus/msx_cart/bm_012.h @@ -18,16 +18,16 @@ class msx_cart_bm_012_device : public device_t, public msx_cart_interface public: msx_cart_bm_012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: + virtual void device_start() override; + // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; +private: DECLARE_WRITE_LINE_MEMBER(midi_in); -protected: - virtual void device_start() override; - -private: required_device m_tmpz84c015af; required_device m_bm012_pio; required_device m_mdthru; diff --git a/src/devices/bus/msx_cart/disk.cpp b/src/devices/bus/msx_cart/disk.cpp index 86f1ba80a0d..e5b285fd58a 100644 --- a/src/devices/bus/msx_cart/disk.cpp +++ b/src/devices/bus/msx_cart/disk.cpp @@ -194,7 +194,7 @@ void msx_cart_disk_device::initialize_cartridge() } -static MACHINE_CONFIG_START( vy0010 ) +MACHINE_CONFIG_MEMBER( msx_cart_vy0010_device::device_add_mconfig ) // From VY-0010 schematic: // HLT pulled high // SSO/-ENMF + -DDEN + ENP + -5/8 - pulled low @@ -213,14 +213,7 @@ static MACHINE_CONFIG_START( vy0010 ) MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("msx1_flop_list","msx1_flop") MACHINE_CONFIG_END - -machine_config_constructor msx_cart_vy0010_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( vy0010 ); -} - - -static MACHINE_CONFIG_START( fsfd1 ) +MACHINE_CONFIG_MEMBER( msx_cart_fsfd1_device::device_add_mconfig ) MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4) // Double sided 3.5" floppy drive @@ -235,13 +228,7 @@ static MACHINE_CONFIG_START( fsfd1 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_fsfd1_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fsfd1 ); -} - - -static MACHINE_CONFIG_START( fsfd1a ) +MACHINE_CONFIG_MEMBER( msx_cart_fsfd1a_device::device_add_mconfig ) MCFG_TC8566AF_ADD("fdc") // Double sided 3.5" floppy drive @@ -256,13 +243,7 @@ static MACHINE_CONFIG_START( fsfd1a ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_fsfd1a_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fsfd1a ); -} - - -static MACHINE_CONFIG_START( fscf351 ) +MACHINE_CONFIG_MEMBER( msx_cart_fscf351_device::device_add_mconfig ) MCFG_MB8877_ADD("fdc", XTAL_4MHz / 4) MCFG_WD_FDC_FORCE_READY @@ -278,12 +259,6 @@ static MACHINE_CONFIG_START( fscf351 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_fscf351_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fscf351 ); -} - - void msx_cart_disk_type1_device::device_start() { save_item(NAME(m_side_control)); diff --git a/src/devices/bus/msx_cart/disk.h b/src/devices/bus/msx_cart/disk.h index 4d8a4d79146..59f25372e08 100644 --- a/src/devices/bus/msx_cart/disk.h +++ b/src/devices/bus/msx_cart/disk.h @@ -23,14 +23,14 @@ class msx_cart_disk_device : public device_t, public msx_cart_interface public: virtual void initialize_cartridge() override; - DECLARE_FLOPPY_FORMATS(floppy_formats); - protected: msx_cart_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); required_device m_floppy0; optional_device m_floppy1; floppy_image_device *m_floppy; + + DECLARE_FLOPPY_FORMATS(floppy_formats); }; @@ -92,7 +92,8 @@ class msx_cart_vy0010_device : public msx_cart_disk_type1_device public: msx_cart_vy0010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; }; @@ -101,7 +102,8 @@ class msx_cart_fsfd1_device : public msx_cart_disk_type1_device public: msx_cart_fsfd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; }; @@ -110,7 +112,8 @@ class msx_cart_fscf351_device : public msx_cart_disk_type2_device public: msx_cart_fscf351_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; }; @@ -128,15 +131,15 @@ class msx_cart_fsfd1a_device : public msx_cart_disk_tc8566_device public: msx_cart_fsfd1a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: + virtual void device_start() override; + virtual void device_reset() override; + // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual DECLARE_READ8_MEMBER(read_cart) override; virtual DECLARE_WRITE8_MEMBER(write_cart) override; - -protected: - virtual void device_start() override; - virtual void device_reset() override; }; diff --git a/src/devices/bus/msx_cart/fmpac.cpp b/src/devices/bus/msx_cart/fmpac.cpp index a064cfd521a..3a63c0a8763 100644 --- a/src/devices/bus/msx_cart/fmpac.cpp +++ b/src/devices/bus/msx_cart/fmpac.cpp @@ -29,7 +29,7 @@ msx_cart_fmpac_device::msx_cart_fmpac_device(const machine_config &mconfig, cons } -static MACHINE_CONFIG_START( fmpac ) +MACHINE_CONFIG_MEMBER( msx_cart_fmpac_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym2413", YM2413, XTAL_10_738635MHz/3) @@ -37,12 +37,6 @@ static MACHINE_CONFIG_START( fmpac ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_fmpac_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fmpac ); -} - - void msx_cart_fmpac_device::device_start() { save_item(NAME(m_selected_bank)); diff --git a/src/devices/bus/msx_cart/fmpac.h b/src/devices/bus/msx_cart/fmpac.h index c28264ce2cd..7100fe4a07c 100644 --- a/src/devices/bus/msx_cart/fmpac.h +++ b/src/devices/bus/msx_cart/fmpac.h @@ -17,9 +17,6 @@ class msx_cart_fmpac_device : public device_t, public msx_cart_interface public: msx_cart_fmpac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -31,6 +28,9 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); private: diff --git a/src/devices/bus/msx_cart/konami.cpp b/src/devices/bus/msx_cart/konami.cpp index b029cd05330..a6606333767 100644 --- a/src/devices/bus/msx_cart/konami.cpp +++ b/src/devices/bus/msx_cart/konami.cpp @@ -141,7 +141,7 @@ msx_cart_konami_scc_device::msx_cart_konami_scc_device(const machine_config &mco } -static MACHINE_CONFIG_START( konami_scc ) +MACHINE_CONFIG_MEMBER( msx_cart_konami_scc_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("k051649", K051649, XTAL_10_738635MHz/3/2) @@ -149,12 +149,6 @@ static MACHINE_CONFIG_START( konami_scc ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_konami_scc_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( konami_scc ); -} - - void msx_cart_konami_scc_device::device_start() { save_item(NAME(m_selected_bank)); @@ -478,7 +472,7 @@ msx_cart_synthesizer_device::msx_cart_synthesizer_device(const machine_config &m } -static MACHINE_CONFIG_START( synthesizer ) +MACHINE_CONFIG_MEMBER( msx_cart_synthesizer_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC @@ -487,12 +481,6 @@ static MACHINE_CONFIG_START( synthesizer ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_synthesizer_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( synthesizer ); -} - - void msx_cart_synthesizer_device::device_start() { } @@ -557,7 +545,7 @@ msx_cart_konami_sound_device::msx_cart_konami_sound_device(const machine_config } -static MACHINE_CONFIG_START( konami_sound ) +MACHINE_CONFIG_MEMBER( msx_cart_konami_sound_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("k052539", K051649, XTAL_10_738635MHz/3/2) @@ -565,12 +553,6 @@ static MACHINE_CONFIG_START( konami_sound ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_konami_sound_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( konami_sound ); -} - - void msx_cart_konami_sound_device::device_start() { save_item(NAME(m_selected_bank)); @@ -889,7 +871,7 @@ static ADDRESS_MAP_START( vlm_map, AS_0, 8, msx_cart_keyboard_master_device ) ADDRESS_MAP_END -static MACHINE_CONFIG_START( msx_cart_keyboard_master ) +MACHINE_CONFIG_MEMBER( msx_cart_keyboard_master_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("vlm5030", VLM5030, XTAL_3_579545MHz) @@ -898,12 +880,6 @@ static MACHINE_CONFIG_START( msx_cart_keyboard_master ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_keyboard_master_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_cart_keyboard_master ); -} - - void msx_cart_keyboard_master_device::device_start() { // Install IO read/write handlers diff --git a/src/devices/bus/msx_cart/konami.h b/src/devices/bus/msx_cart/konami.h index a086e6467a2..fff0811e0be 100644 --- a/src/devices/bus/msx_cart/konami.h +++ b/src/devices/bus/msx_cart/konami.h @@ -47,8 +47,6 @@ class msx_cart_konami_scc_device : public device_t, public msx_cart_interface public: msx_cart_konami_scc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -59,6 +57,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); private: @@ -101,8 +101,6 @@ class msx_cart_synthesizer_device : public device_t, public msx_cart_interface public: msx_cart_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -112,6 +110,8 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + private: uint8_t *m_bank_base; required_device m_dac; @@ -121,8 +121,6 @@ private: class msx_cart_konami_sound_device : public device_t, public msx_cart_interface { public: - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -135,6 +133,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); uint8_t *m_ram_bank[16]; @@ -178,9 +178,6 @@ class msx_cart_keyboard_master_device : public device_t, public msx_cart_interfa public: msx_cart_keyboard_master_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -190,8 +187,11 @@ public: DECLARE_READ8_MEMBER(io_00_r); protected: + // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_vlm5030; }; diff --git a/src/devices/bus/msx_cart/majutsushi.cpp b/src/devices/bus/msx_cart/majutsushi.cpp index cd37bc16772..f7f3f301828 100644 --- a/src/devices/bus/msx_cart/majutsushi.cpp +++ b/src/devices/bus/msx_cart/majutsushi.cpp @@ -26,7 +26,7 @@ msx_cart_majutsushi_device::msx_cart_majutsushi_device(const machine_config &mco } -static MACHINE_CONFIG_START( majutsushi ) +MACHINE_CONFIG_MEMBER( msx_cart_majutsushi_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) // unknown DAC @@ -35,12 +35,6 @@ static MACHINE_CONFIG_START( majutsushi ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_majutsushi_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( majutsushi ); -} - - void msx_cart_majutsushi_device::device_start() { save_item(NAME(m_selected_bank)); diff --git a/src/devices/bus/msx_cart/majutsushi.h b/src/devices/bus/msx_cart/majutsushi.h index db45c111383..596fac47050 100644 --- a/src/devices/bus/msx_cart/majutsushi.h +++ b/src/devices/bus/msx_cart/majutsushi.h @@ -17,8 +17,6 @@ class msx_cart_majutsushi_device : public device_t, public msx_cart_interface public: msx_cart_majutsushi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -29,6 +27,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); private: diff --git a/src/devices/bus/msx_cart/moonsound.cpp b/src/devices/bus/msx_cart/moonsound.cpp index 74de9df00a0..ddcd072e281 100644 --- a/src/devices/bus/msx_cart/moonsound.cpp +++ b/src/devices/bus/msx_cart/moonsound.cpp @@ -35,12 +35,12 @@ static ADDRESS_MAP_START( ymf278b_map, AS_0, 8, msx_cart_moonsound_device ) ADDRESS_MAP_END -static MACHINE_CONFIG_START( moonsound ) +MACHINE_CONFIG_MEMBER( msx_cart_moonsound_device::device_add_mconfig ) // The moonsound cartridge has a separate stereo output. MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_SOUND_ADD("ymf278b", YMF278B, YMF278B_STD_CLOCK) MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278b_map) - MCFG_YMF278B_IRQ_HANDLER(WRITELINE(msx_cart_moonsound_device,irq_w)) + MCFG_YMF278B_IRQ_HANDLER(WRITELINE(msx_cart_moonsound_device, irq_w)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) MCFG_SOUND_ROUTE(2, "lspeaker", 0.40) @@ -50,12 +50,6 @@ static MACHINE_CONFIG_START( moonsound ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_moonsound_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( moonsound ); -} - - ROM_START( msx_cart_moonsound ) ROM_REGION(0x400000, "ymf278b", 0) ROM_LOAD("yrw801.rom", 0x0, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca)) diff --git a/src/devices/bus/msx_cart/moonsound.h b/src/devices/bus/msx_cart/moonsound.h index 1fee19bc133..41f5ceb61ab 100644 --- a/src/devices/bus/msx_cart/moonsound.h +++ b/src/devices/bus/msx_cart/moonsound.h @@ -17,22 +17,23 @@ class msx_cart_moonsound_device : public device_t, public msx_cart_interface public: msx_cart_moonsound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - DECLARE_WRITE8_MEMBER(write_ymf278b_fm); DECLARE_READ8_MEMBER(read_ymf278b_fm); DECLARE_WRITE8_MEMBER(write_ymf278b_pcm); DECLARE_READ8_MEMBER(read_ymf278b_pcm); DECLARE_READ8_MEMBER(read_c0); - DECLARE_WRITE_LINE_MEMBER(irq_w); protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + private: + DECLARE_WRITE_LINE_MEMBER(irq_w); + required_device m_ymf278b; }; diff --git a/src/devices/bus/msx_cart/msx_audio.cpp b/src/devices/bus/msx_cart/msx_audio.cpp index ed91ed28732..75c0ccd7598 100644 --- a/src/devices/bus/msx_cart/msx_audio.cpp +++ b/src/devices/bus/msx_cart/msx_audio.cpp @@ -80,7 +80,7 @@ msx_cart_msx_audio_hxmu900_device::msx_cart_msx_audio_hxmu900_device(const machi } -static MACHINE_CONFIG_START( msx_audio_hxmu900 ) +MACHINE_CONFIG_MEMBER( msx_cart_msx_audio_hxmu900_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) // Not verified @@ -92,12 +92,6 @@ static MACHINE_CONFIG_START( msx_audio_hxmu900 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_msx_audio_hxmu900_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_audio_hxmu900 ); -} - - void msx_cart_msx_audio_hxmu900_device::device_start() { // Install IO read/write handlers @@ -151,7 +145,7 @@ msx_cart_msx_audio_nms1205_device::msx_cart_msx_audio_nms1205_device(const machi } -static MACHINE_CONFIG_START( msx_audio_nms1205 ) +MACHINE_CONFIG_MEMBER( msx_cart_msx_audio_nms1205_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. // At the same time the sound is also output on two output on the nms1205 cartridge itself MCFG_SPEAKER_STANDARD_MONO("mono") @@ -176,12 +170,6 @@ static MACHINE_CONFIG_START( msx_audio_nms1205 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_msx_audio_nms1205_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_audio_nms1205 ); -} - - ROM_START( msx_nms1205 ) ROM_REGION(0x8000, "y8950", ROMREGION_ERASE00) ROM_END @@ -260,7 +248,7 @@ msx_cart_msx_audio_fsca1_device::msx_cart_msx_audio_fsca1_device(const machine_c } -static MACHINE_CONFIG_START( msx_audio_fsca1 ) +MACHINE_CONFIG_MEMBER( msx_cart_msx_audio_fsca1_device::device_add_mconfig ) // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) @@ -274,12 +262,6 @@ static MACHINE_CONFIG_START( msx_audio_fsca1 ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_msx_audio_fsca1_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_audio_fsca1 ); -} - - static INPUT_PORTS_START( msx_audio_fsca1 ) PORT_START("CONFIG") PORT_CONFNAME( 0x04, 0x04, "FS-CA1 Firmware switch") diff --git a/src/devices/bus/msx_cart/msx_audio.h b/src/devices/bus/msx_cart/msx_audio.h index 034fb38566d..d9fc89baa8c 100644 --- a/src/devices/bus/msx_cart/msx_audio.h +++ b/src/devices/bus/msx_cart/msx_audio.h @@ -21,10 +21,6 @@ class msx_cart_msx_audio_hxmu900_device : public device_t, public msx_cart_inter public: msx_cart_msx_audio_hxmu900_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -32,6 +28,10 @@ public: protected: virtual void device_start() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + private: required_device m_y8950; }; @@ -42,21 +42,21 @@ class msx_cart_msx_audio_nms1205_device : public device_t, public msx_cart_inter public: msx_cart_msx_audio_nms1205_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; - DECLARE_WRITE_LINE_MEMBER(midi_in); - DECLARE_WRITE_LINE_MEMBER(irq_write); - protected: virtual void device_start() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + private: + DECLARE_WRITE_LINE_MEMBER(midi_in); + DECLARE_WRITE_LINE_MEMBER(irq_write); + required_device m_y8950; required_device m_acia6850; required_device m_mdout; @@ -69,26 +69,26 @@ class msx_cart_msx_audio_fsca1_device : public device_t, public msx_cart_interfa public: msx_cart_msx_audio_fsca1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual ioport_constructor device_input_ports() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual void initialize_cartridge() override; virtual DECLARE_READ8_MEMBER(read_cart) override; virtual DECLARE_WRITE8_MEMBER(write_cart) override; - DECLARE_WRITE8_MEMBER(y8950_io_w); - DECLARE_READ8_MEMBER(y8950_io_r); - protected: virtual void device_start() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; + virtual const tiny_rom_entry *device_rom_region() const override; + DECLARE_WRITE8_MEMBER(write_y8950); DECLARE_READ8_MEMBER(read_y8950); private: + DECLARE_WRITE8_MEMBER(y8950_io_w); + DECLARE_READ8_MEMBER(y8950_io_r); + required_device m_y8950; required_ioport m_io_config; required_memory_region m_region_y8950; diff --git a/src/devices/bus/msx_cart/yamaha.cpp b/src/devices/bus/msx_cart/yamaha.cpp index 9b708a0a1d7..664d51ab3d2 100644 --- a/src/devices/bus/msx_cart/yamaha.cpp +++ b/src/devices/bus/msx_cart/yamaha.cpp @@ -46,7 +46,7 @@ msx_cart_sfg05_device::msx_cart_sfg05_device(const machine_config &mconfig, cons } -static MACHINE_CONFIG_START( msx_sfg ) +MACHINE_CONFIG_MEMBER( msx_cart_sfg_device::device_add_mconfig ) // YM2151 (OPM) // YM3012 (DAC) // YM2148 (MKS) @@ -61,7 +61,7 @@ static MACHINE_CONFIG_START( msx_sfg ) MCFG_YM2148_TXD_HANDLER(DEVWRITELINE("mdout", midi_port_device, write_txd)) MCFG_YM2148_PORT_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) MCFG_YM2148_PORT_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) - MCFG_YM2148_IRQ_HANDLER(WRITELINE(msx_cart_sfg_device,ym2148_irq_w)) + MCFG_YM2148_IRQ_HANDLER(WRITELINE(msx_cart_sfg_device, ym2148_irq_w)) MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, nullptr) @@ -72,12 +72,6 @@ static MACHINE_CONFIG_START( msx_sfg ) MACHINE_CONFIG_END -machine_config_constructor msx_cart_sfg_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( msx_sfg ); -} - - ROM_START( msx_sfg01 ) ROM_REGION(0x4000, "sfg", 0) ROM_LOAD("sfg01.rom", 0x0, 0x4000, CRC(0995fb36) SHA1(434651305f92aa770a89e40b81125fb22d91603d)) diff --git a/src/devices/bus/msx_cart/yamaha.h b/src/devices/bus/msx_cart/yamaha.h index d437aa5424e..b8f30bf057f 100644 --- a/src/devices/bus/msx_cart/yamaha.h +++ b/src/devices/bus/msx_cart/yamaha.h @@ -18,23 +18,22 @@ DECLARE_DEVICE_TYPE(MSX_CART_SFG05, msx_cart_sfg05_device) class msx_cart_sfg_device : public device_t, public msx_cart_interface { public: - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ8_MEMBER(read_cart) override; virtual DECLARE_WRITE8_MEMBER(write_cart) override; - - DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w); - DECLARE_WRITE_LINE_MEMBER(ym2148_irq_w); - protected: msx_cart_sfg_device(const machine_config &mconfig, const device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + IRQ_CALLBACK_MEMBER(irq_callback); private: + DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w); + DECLARE_WRITE_LINE_MEMBER(ym2148_irq_w); + required_memory_region m_region_sfg; required_device m_ym2151; required_device m_kbdc; diff --git a/src/devices/bus/msx_slot/fs4600.cpp b/src/devices/bus/msx_slot/fs4600.cpp index 57b6dac10e6..464bb46335c 100644 --- a/src/devices/bus/msx_slot/fs4600.cpp +++ b/src/devices/bus/msx_slot/fs4600.cpp @@ -27,17 +27,11 @@ msx_slot_fs4600_device::msx_slot_fs4600_device(const machine_config &mconfig, co } -static MACHINE_CONFIG_START( fs4600 ) +MACHINE_CONFIG_MEMBER( msx_slot_fs4600_device::device_add_mconfig ) MCFG_NVRAM_ADD_0FILL("nvram") MACHINE_CONFIG_END -machine_config_constructor msx_slot_fs4600_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fs4600 ); -} - - void msx_slot_fs4600_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_fs4600_device &dev = downcast(device); diff --git a/src/devices/bus/msx_slot/fs4600.h b/src/devices/bus/msx_slot/fs4600.h index 563e7d37535..59238d786bb 100644 --- a/src/devices/bus/msx_slot/fs4600.h +++ b/src/devices/bus/msx_slot/fs4600.h @@ -24,14 +24,14 @@ public: // static configuration helpers static void set_rom_start(device_t &device, const char *region, uint32_t offset); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; protected: virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); private: diff --git a/src/devices/bus/msx_slot/panasonic08.cpp b/src/devices/bus/msx_slot/panasonic08.cpp index 140237f6ff6..37836ed12ce 100644 --- a/src/devices/bus/msx_slot/panasonic08.cpp +++ b/src/devices/bus/msx_slot/panasonic08.cpp @@ -33,17 +33,11 @@ msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &m } -static MACHINE_CONFIG_START( panasonic08 ) +MACHINE_CONFIG_MEMBER( msx_slot_panasonic08_device::device_add_mconfig ) MCFG_NVRAM_ADD_0FILL("nvram") MACHINE_CONFIG_END -machine_config_constructor msx_slot_panasonic08_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( panasonic08 ); -} - - void msx_slot_panasonic08_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_panasonic08_device &dev = downcast(device); diff --git a/src/devices/bus/msx_slot/panasonic08.h b/src/devices/bus/msx_slot/panasonic08.h index 8318bd124f3..74e6b3f5575 100644 --- a/src/devices/bus/msx_slot/panasonic08.h +++ b/src/devices/bus/msx_slot/panasonic08.h @@ -24,14 +24,14 @@ public: // static configuration helpers static void set_rom_start(device_t &device, const char *region, uint32_t offset); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; protected: virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + private: void restore_banks(); void map_bank(int bank); diff --git a/src/devices/bus/msx_slot/sony08.cpp b/src/devices/bus/msx_slot/sony08.cpp index df01020c28c..9eae5f025f4 100644 --- a/src/devices/bus/msx_slot/sony08.cpp +++ b/src/devices/bus/msx_slot/sony08.cpp @@ -30,17 +30,11 @@ msx_slot_sony08_device::msx_slot_sony08_device(const machine_config &mconfig, co } -static MACHINE_CONFIG_START( sony08 ) +MACHINE_CONFIG_MEMBER( msx_slot_sony08_device::device_add_mconfig ) MCFG_NVRAM_ADD_0FILL("nvram") MACHINE_CONFIG_END -machine_config_constructor msx_slot_sony08_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sony08 ); -} - - void msx_slot_sony08_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_sony08_device &dev = downcast(device); diff --git a/src/devices/bus/msx_slot/sony08.h b/src/devices/bus/msx_slot/sony08.h index 4a3e5a41170..ce34b09b842 100644 --- a/src/devices/bus/msx_slot/sony08.h +++ b/src/devices/bus/msx_slot/sony08.h @@ -25,14 +25,14 @@ public: // static configuration helpers static void set_rom_start(device_t &device, const char *region, uint32_t offset); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; protected: virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + void restore_banks(); private: diff --git a/src/devices/bus/nasbus/avc.cpp b/src/devices/bus/nasbus/avc.cpp index eb1420dff3d..cd727d67258 100644 --- a/src/devices/bus/nasbus/avc.cpp +++ b/src/devices/bus/nasbus/avc.cpp @@ -19,11 +19,10 @@ DEFINE_DEVICE_TYPE(NASCOM_AVC, nascom_avc_device, "nascom_avc", "Nascom Advanced Video Card") //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( nascom_avc ) +MACHINE_CONFIG_MEMBER( nascom_avc_device::device_add_mconfig ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(16250000, 1024, 0, 768, 320, 0, 256) MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update) @@ -36,11 +35,6 @@ static MACHINE_CONFIG_START( nascom_avc ) MCFG_MC6845_UPDATE_ROW_CB(nascom_avc_device, crtc_update_row) MACHINE_CONFIG_END -machine_config_constructor nascom_avc_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( nascom_avc ); -} - //************************************************************************** // LIVE DEVICE diff --git a/src/devices/bus/nasbus/avc.h b/src/devices/bus/nasbus/avc.h index b2da174bf87..16155497c40 100644 --- a/src/devices/bus/nasbus/avc.h +++ b/src/devices/bus/nasbus/avc.h @@ -26,19 +26,19 @@ class nascom_avc_device : public device_t, public device_nasbus_card_interface public: // construction/destruction nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - MC6845_UPDATE_ROW(crtc_update_row); DECLARE_WRITE8_MEMBER(control_w); READ8_MEMBER(vram_r); WRITE8_MEMBER(vram_w); protected: - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; private: + MC6845_UPDATE_ROW(crtc_update_row); + required_device m_crtc; required_device m_palette; diff --git a/src/devices/bus/nasbus/floppy.cpp b/src/devices/bus/nasbus/floppy.cpp index e1985b54886..5bcd81b1e6e 100644 --- a/src/devices/bus/nasbus/floppy.cpp +++ b/src/devices/bus/nasbus/floppy.cpp @@ -34,11 +34,10 @@ static SLOT_INTERFACE_START( nascom_floppies ) SLOT_INTERFACE_END //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( nascom_fdc ) +MACHINE_CONFIG_MEMBER( nascom_fdc_device::device_add_mconfig ) MCFG_FD1793_ADD("fd1793", XTAL_16MHz / 4 / 4) MCFG_FLOPPY_DRIVE_ADD("fd1793:0", nascom_floppies, "55f", nascom_fdc_device::floppy_formats) @@ -47,11 +46,6 @@ static MACHINE_CONFIG_START( nascom_fdc ) MCFG_FLOPPY_DRIVE_ADD("fd1793:3", nascom_floppies, nullptr, nascom_fdc_device::floppy_formats) MACHINE_CONFIG_END -machine_config_constructor nascom_fdc_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( nascom_fdc ); -} - //************************************************************************** // LIVE DEVICE diff --git a/src/devices/bus/nasbus/floppy.h b/src/devices/bus/nasbus/floppy.h index dbe4635723f..f858b1f841b 100644 --- a/src/devices/bus/nasbus/floppy.h +++ b/src/devices/bus/nasbus/floppy.h @@ -31,10 +31,8 @@ public: DECLARE_WRITE8_MEMBER(select_w); DECLARE_READ8_MEMBER(status_r); - DECLARE_FLOPPY_FORMATS(floppy_formats); - protected: - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; virtual void device_reset_after_children() override; @@ -42,6 +40,8 @@ protected: private: TIMER_CALLBACK_MEMBER(motor_off); + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_fdc; required_device m_floppy0; required_device m_floppy1; diff --git a/src/devices/bus/neogeo/boot_cthd.cpp b/src/devices/bus/neogeo/boot_cthd.cpp index c727219c5f6..796eb14203d 100644 --- a/src/devices/bus/neogeo/boot_cthd.cpp +++ b/src/devices/bus/neogeo/boot_cthd.cpp @@ -48,15 +48,10 @@ void neogeo_cthd2k3_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( cthd_cart ) +MACHINE_CONFIG_MEMBER( neogeo_cthd2k3_cart_device::device_add_mconfig ) MCFG_CTHD_PROT_ADD("cthd_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_cthd2k3_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( cthd_cart ); -} - /************************************************* cthd2k3 @@ -127,13 +122,8 @@ void neogeo_matrimbl_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) } -static MACHINE_CONFIG_START( matrimbl_cart ) + MACHINE_CONFIG_MEMBER( neogeo_matrimbl_cart_device::device_add_mconfig ) MCFG_KOF2002_PROT_ADD("kof2k2_prot") MCFG_CMC_PROT_ADD("cmc_prot") MCFG_CTHD_PROT_ADD("cthd_prot") MACHINE_CONFIG_END - -machine_config_constructor neogeo_matrimbl_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( matrimbl_cart ); -} diff --git a/src/devices/bus/neogeo/boot_cthd.h b/src/devices/bus/neogeo/boot_cthd.h index 1846d1dd744..d99eeaea941 100644 --- a/src/devices/bus/neogeo/boot_cthd.h +++ b/src/devices/bus/neogeo/boot_cthd.h @@ -20,8 +20,6 @@ public: // construction/destruction neogeo_cthd2k3_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual uint32_t get_bank_base(uint16_t sel) override { return m_prot->get_bank_base(sel); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; @@ -34,6 +32,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; @@ -83,7 +83,8 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 2; } - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_cmc_prot; diff --git a/src/devices/bus/neogeo/boot_kof10th.cpp b/src/devices/bus/neogeo/boot_kof10th.cpp index 8d5a4c9cf69..6f31cf6717a 100644 --- a/src/devices/bus/neogeo/boot_kof10th.cpp +++ b/src/devices/bus/neogeo/boot_kof10th.cpp @@ -49,15 +49,10 @@ void neogeo_kof10th_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( kof10th_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kof10th_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_kof10th_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof10th_cart ); -} - void neogeo_kof10th_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) { diff --git a/src/devices/bus/neogeo/boot_kof10th.h b/src/devices/bus/neogeo/boot_kof10th.h index 1d246d6f4e1..9c5cf2a2e5d 100644 --- a/src/devices/bus/neogeo/boot_kof10th.h +++ b/src/devices/bus/neogeo/boot_kof10th.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_kof10th_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual uint16_t get_helper() override; virtual uint32_t get_bank_base(uint16_t sel) override; @@ -35,6 +33,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + private: uint8_t* m_fixed; uint32_t m_special_bank; diff --git a/src/devices/bus/neogeo/boot_kof2k2.cpp b/src/devices/bus/neogeo/boot_kof2k2.cpp index 58defea8890..bcc6abc1833 100644 --- a/src/devices/bus/neogeo/boot_kof2k2.cpp +++ b/src/devices/bus/neogeo/boot_kof2k2.cpp @@ -12,33 +12,24 @@ #include "boot_kof2k2.h" -static MACHINE_CONFIG_START( kof2k2bl_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kof2002b_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MCFG_KOF2002_PROT_ADD("kof2k2_prot") MACHINE_CONFIG_END -static MACHINE_CONFIG_START( kof2k2mp_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kf2k2mp_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_kof2002b_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k2bl_cart ); -} - -machine_config_constructor neogeo_kf2k2mp_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k2mp_cart ); -} - -machine_config_constructor neogeo_kf2k2mp2_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k2mp_cart ); -} +MACHINE_CONFIG_MEMBER( neogeo_kf2k2mp2_cart_device::device_add_mconfig ) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") +MACHINE_CONFIG_END /************************************************* kof2002b diff --git a/src/devices/bus/neogeo/boot_kof2k2.h b/src/devices/bus/neogeo/boot_kof2k2.h index 6faf1bdbfe3..f7b926a4a2a 100644 --- a/src/devices/bus/neogeo/boot_kof2k2.h +++ b/src/devices/bus/neogeo/boot_kof2k2.h @@ -24,7 +24,9 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; + +protected: + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_cmc_prot; @@ -46,7 +48,9 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; + +protected: + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_cmc_prot; @@ -67,7 +71,9 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; + +protected: + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_cmc_prot; diff --git a/src/devices/bus/neogeo/boot_kof2k3.cpp b/src/devices/bus/neogeo/boot_kof2k3.cpp index 73f92635731..9a3a5fb3bc4 100644 --- a/src/devices/bus/neogeo/boot_kof2k3.cpp +++ b/src/devices/bus/neogeo/boot_kof2k3.cpp @@ -12,27 +12,26 @@ #include "boot_kof2k3.h" -static MACHINE_CONFIG_START( kof2k3bl_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kf2k3bl_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_kf2k3bl_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k3bl_cart ); -} - -machine_config_constructor neogeo_kf2k3pl_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k3bl_cart ); -} +MACHINE_CONFIG_MEMBER( neogeo_kf2k3pl_cart_device::device_add_mconfig ) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") +MACHINE_CONFIG_END -machine_config_constructor neogeo_kf2k3upl_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2k3bl_cart ); -} +MACHINE_CONFIG_MEMBER( neogeo_kf2k3upl_cart_device::device_add_mconfig ) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") +MACHINE_CONFIG_END /************************************************* kf2k3bl diff --git a/src/devices/bus/neogeo/boot_kof2k3.h b/src/devices/bus/neogeo/boot_kof2k3.h index 631dc14e888..a5deb9bc378 100644 --- a/src/devices/bus/neogeo/boot_kof2k3.h +++ b/src/devices/bus/neogeo/boot_kof2k3.h @@ -21,13 +21,14 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; - virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003_w(space, offset, data, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_kof2k3bl_prot->overlay_r(space, offset, mem_mask); } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_cmc_prot; required_device m_pcm2_prot; @@ -48,12 +49,13 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; - virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003p_w(space, offset, data, mem_mask); } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_cmc_prot; required_device m_pcm2_prot; @@ -74,13 +76,14 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; - virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003_w(space, offset, data, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_kof2k3bl_prot->overlay_r(space, offset, mem_mask); } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_cmc_prot; required_device m_pcm2_prot; diff --git a/src/devices/bus/neogeo/boot_misc.cpp b/src/devices/bus/neogeo/boot_misc.cpp index aa5ba76ffa3..65e36f87789 100644 --- a/src/devices/bus/neogeo/boot_misc.cpp +++ b/src/devices/bus/neogeo/boot_misc.cpp @@ -48,16 +48,10 @@ void neogeo_bootleg_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( bootleg_cart ) +MACHINE_CONFIG_MEMBER( neogeo_bootleg_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_bootleg_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( bootleg_cart ); -} - - /************************************************* garoubl @@ -213,16 +207,11 @@ void neogeo_mslug3b6_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_cmc_prot->cmc42_gfx_decrypt(spr_region, spr_region_size, MSLUG3_GFX_KEY); } -static MACHINE_CONFIG_START( mslug3b6_cart ) +MACHINE_CONFIG_MEMBER( neogeo_mslug3b6_cart_device::device_add_mconfig ) MCFG_CMC_PROT_ADD("cmc_prot") MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_mslug3b6_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( mslug3b6_cart ); -} - /************************************************* ms5plus @@ -245,17 +234,12 @@ void neogeo_ms5plus_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_prot->sx_decrypt(fix_region, fix_region_size, 1); } -static MACHINE_CONFIG_START( ms5plus_cart ) +MACHINE_CONFIG_MEMBER( neogeo_ms5plus_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_ms5plus_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( ms5plus_cart ); -} - /************************************************* kog diff --git a/src/devices/bus/neogeo/boot_misc.h b/src/devices/bus/neogeo/boot_misc.h index 5f625eda2d3..4943f64583b 100644 --- a/src/devices/bus/neogeo/boot_misc.h +++ b/src/devices/bus/neogeo/boot_misc.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_bootleg_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual void decrypt_all(DECRYPT_ALL_PARAMS) override { } virtual int get_fixed_bank_type() override { return 0; } @@ -30,6 +28,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; @@ -152,7 +152,8 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: required_device m_cmc_prot; @@ -171,11 +172,12 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 1; } - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ16_MEMBER(protection_r) override { return m_prot->mslug5p_prot_r(space, offset, mem_mask); } virtual uint32_t get_bank_base(uint16_t sel) override { return m_prot->mslug5p_bank_base(sel); } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_cmc_prot; required_device m_pcm2_prot; diff --git a/src/devices/bus/neogeo/boot_svc.cpp b/src/devices/bus/neogeo/boot_svc.cpp index 45a55b567cc..e63f232d244 100644 --- a/src/devices/bus/neogeo/boot_svc.cpp +++ b/src/devices/bus/neogeo/boot_svc.cpp @@ -30,16 +30,11 @@ void neogeo_svcboot_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_prot->svcboot_cx_decrypt(spr_region, spr_region_size); } -static MACHINE_CONFIG_START( svcboot_cart ) +MACHINE_CONFIG_MEMBER( neogeo_svcboot_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_PVC_PROT_ADD("pvc_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_svcboot_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( svcboot_cart ); -} - /************************************************* svcplus @@ -101,12 +96,7 @@ void neogeo_svcsplus_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) } -static MACHINE_CONFIG_START( svcsplus_cart ) +MACHINE_CONFIG_MEMBER( neogeo_svcsplus_cart_device::device_add_mconfig ) MCFG_NEOBOOT_PROT_ADD("bootleg_prot") MCFG_PVC_PROT_ADD("pvc_prot") MACHINE_CONFIG_END - -machine_config_constructor neogeo_svcsplus_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( svcsplus_cart ); -} diff --git a/src/devices/bus/neogeo/boot_svc.h b/src/devices/bus/neogeo/boot_svc.h index 42c99e28d27..57c68c29afd 100644 --- a/src/devices/bus/neogeo/boot_svc.h +++ b/src/devices/bus/neogeo/boot_svc.h @@ -19,14 +19,15 @@ class neogeo_svcboot_cart_device : public neogeo_bootleg_cart_device public: neogeo_svcboot_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(space, offset, data, mem_mask); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_pvc_prot; }; @@ -72,14 +73,15 @@ class neogeo_svcsplus_cart_device : public neogeo_bootleg_cart_device public: neogeo_svcsplus_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(space, offset, data, mem_mask); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type() override { return 0; } +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_pvc_prot; }; diff --git a/src/devices/bus/neogeo/cmc.cpp b/src/devices/bus/neogeo/cmc.cpp index cc3661810fd..e3262d3527f 100644 --- a/src/devices/bus/neogeo/cmc.cpp +++ b/src/devices/bus/neogeo/cmc.cpp @@ -44,15 +44,10 @@ void neogeo_cmc_cart_device::device_reset() } -static MACHINE_CONFIG_START( cmc_cart ) +MACHINE_CONFIG_MEMBER( neogeo_cmc_cart_device::device_add_mconfig ) MCFG_CMC_PROT_ADD("cmc_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_cmc_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( cmc_cart ); -} - /************************************************* zupapa diff --git a/src/devices/bus/neogeo/cmc.h b/src/devices/bus/neogeo/cmc.h index 78d0e29326d..88b1c27cd9f 100644 --- a/src/devices/bus/neogeo/cmc.h +++ b/src/devices/bus/neogeo/cmc.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_cmc_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual void decrypt_all(DECRYPT_ALL_PARAMS) override { } virtual int get_fixed_bank_type() override { return 0; } @@ -30,6 +28,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; diff --git a/src/devices/bus/neogeo/fatfury2.cpp b/src/devices/bus/neogeo/fatfury2.cpp index 77394fc54ed..092052ec203 100644 --- a/src/devices/bus/neogeo/fatfury2.cpp +++ b/src/devices/bus/neogeo/fatfury2.cpp @@ -43,11 +43,6 @@ void neogeo_fatfury2_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( fatfury2_cart ) +MACHINE_CONFIG_MEMBER( neogeo_fatfury2_cart_device::device_add_mconfig ) MCFG_FATFURY2_PROT_ADD("fatfury2_prot") MACHINE_CONFIG_END - -machine_config_constructor neogeo_fatfury2_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fatfury2_cart ); -} diff --git a/src/devices/bus/neogeo/fatfury2.h b/src/devices/bus/neogeo/fatfury2.h index e49c6011629..804049e4ff0 100644 --- a/src/devices/bus/neogeo/fatfury2.h +++ b/src/devices/bus/neogeo/fatfury2.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_fatfury2_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual DECLARE_READ16_MEMBER(protection_r) override { return m_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_prot->protection_w(space, offset, data, mem_mask); } @@ -28,6 +26,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; diff --git a/src/devices/bus/neogeo/kof2k2.cpp b/src/devices/bus/neogeo/kof2k2.cpp index 43b421ecca6..6d93a2ebffc 100644 --- a/src/devices/bus/neogeo/kof2k2.cpp +++ b/src/devices/bus/neogeo/kof2k2.cpp @@ -50,17 +50,12 @@ void neogeo_kof2k2type_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( kof2002_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kof2k2type_cart_device::device_add_mconfig ) MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MCFG_KOF2002_PROT_ADD("kof2002_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_kof2k2type_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof2002_cart ); -} - /************************************************* kof2002 diff --git a/src/devices/bus/neogeo/kof2k2.h b/src/devices/bus/neogeo/kof2k2.h index 2d14294c3be..f5ade4c4444 100644 --- a/src/devices/bus/neogeo/kof2k2.h +++ b/src/devices/bus/neogeo/kof2k2.h @@ -18,7 +18,6 @@ class neogeo_kof2k2type_cart_device : public neogeo_rom_device public: // construction/destruction neogeo_kof2k2type_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; // reading and writing virtual void decrypt_all(DECRYPT_ALL_PARAMS) override { } @@ -31,6 +30,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_cmc_prot; required_device m_pcm2_prot; required_device m_kof2k2_prot; diff --git a/src/devices/bus/neogeo/kof98.cpp b/src/devices/bus/neogeo/kof98.cpp index 80f1ba7a271..f022ea1d748 100644 --- a/src/devices/bus/neogeo/kof98.cpp +++ b/src/devices/bus/neogeo/kof98.cpp @@ -43,15 +43,10 @@ void neogeo_kof98_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( kof98_cart ) +MACHINE_CONFIG_MEMBER( neogeo_kof98_cart_device::device_add_mconfig ) MCFG_KOF98_PROT_ADD("kof98_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_kof98_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( kof98_cart ); -} - void neogeo_kof98_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) { m_prot->decrypt_68k(cpuregion, cpuregion_size); diff --git a/src/devices/bus/neogeo/kof98.h b/src/devices/bus/neogeo/kof98.h index 00ee33326c6..9cb1ddbf59e 100644 --- a/src/devices/bus/neogeo/kof98.h +++ b/src/devices/bus/neogeo/kof98.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_kof98_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual DECLARE_READ16_MEMBER(protection_r) override { return m_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_prot->protection_w(space, offset, data, mem_mask); } @@ -30,6 +28,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; diff --git a/src/devices/bus/neogeo/mslugx.cpp b/src/devices/bus/neogeo/mslugx.cpp index f59b8b9524f..0d5c1807cb0 100644 --- a/src/devices/bus/neogeo/mslugx.cpp +++ b/src/devices/bus/neogeo/mslugx.cpp @@ -43,11 +43,6 @@ void neogeo_mslugx_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( mslugx_cart ) +MACHINE_CONFIG_MEMBER( neogeo_mslugx_cart_device::device_add_mconfig ) MCFG_MSLUGX_PROT_ADD("mslugx_prot") MACHINE_CONFIG_END - -machine_config_constructor neogeo_mslugx_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( mslugx_cart ); -} diff --git a/src/devices/bus/neogeo/mslugx.h b/src/devices/bus/neogeo/mslugx.h index 03d1aaaa21d..6882c0f7dd6 100644 --- a/src/devices/bus/neogeo/mslugx.h +++ b/src/devices/bus/neogeo/mslugx.h @@ -17,8 +17,6 @@ public: // construction/destruction neogeo_mslugx_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual DECLARE_READ16_MEMBER(protection_r) override { return m_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_prot->protection_w(space, offset, data, mem_mask); } @@ -28,6 +26,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_prot; }; diff --git a/src/devices/bus/neogeo/pcm2.cpp b/src/devices/bus/neogeo/pcm2.cpp index 9d4bd9f5699..024d477a9ec 100644 --- a/src/devices/bus/neogeo/pcm2.cpp +++ b/src/devices/bus/neogeo/pcm2.cpp @@ -49,16 +49,11 @@ void neogeo_pcm2_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( pcm2_cart ) +MACHINE_CONFIG_MEMBER( neogeo_pcm2_cart_device::device_add_mconfig ) MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_pcm2_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( pcm2_cart ); -} - /************************************************* mslug4 diff --git a/src/devices/bus/neogeo/pcm2.h b/src/devices/bus/neogeo/pcm2.h index dacb2b2de7d..a088d9b0172 100644 --- a/src/devices/bus/neogeo/pcm2.h +++ b/src/devices/bus/neogeo/pcm2.h @@ -16,8 +16,6 @@ public: // construction/destruction neogeo_pcm2_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void decrypt_all(DECRYPT_ALL_PARAMS) override { } virtual int get_fixed_bank_type() override { return 0; } @@ -28,6 +26,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_cmc_prot; required_device m_pcm2_prot; }; diff --git a/src/devices/bus/neogeo/pvc.cpp b/src/devices/bus/neogeo/pvc.cpp index 612ab19cbf5..c4a336e098f 100644 --- a/src/devices/bus/neogeo/pvc.cpp +++ b/src/devices/bus/neogeo/pvc.cpp @@ -50,19 +50,12 @@ void neogeo_pvc_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( pvc_cart ) +MACHINE_CONFIG_MEMBER( neogeo_pvc_cart_device::device_add_mconfig ) MCFG_CMC_PROT_ADD("cmc_prot") MCFG_PCM2_PROT_ADD("pcm2_prot") MCFG_PVC_PROT_ADD("pvc_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_pvc_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( pvc_cart ); -} - - - /************************************************* mslug5 diff --git a/src/devices/bus/neogeo/pvc.h b/src/devices/bus/neogeo/pvc.h index 89e95bfa59d..0b3f9c6ce75 100644 --- a/src/devices/bus/neogeo/pvc.h +++ b/src/devices/bus/neogeo/pvc.h @@ -19,8 +19,6 @@ public: // construction/destruction neogeo_pvc_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } @@ -36,6 +34,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_cmc_prot; required_device m_pcm2_prot; required_device m_pvc_prot; diff --git a/src/devices/bus/neogeo/sma.cpp b/src/devices/bus/neogeo/sma.cpp index f955367bd66..ab1e14d3711 100644 --- a/src/devices/bus/neogeo/sma.cpp +++ b/src/devices/bus/neogeo/sma.cpp @@ -54,16 +54,11 @@ void neogeo_sma_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -static MACHINE_CONFIG_START( sma_cart ) +MACHINE_CONFIG_MEMBER( neogeo_sma_cart_device::device_add_mconfig ) MCFG_SMA_PROT_ADD("sma_prot") MCFG_CMC_PROT_ADD("cmc_prot") MACHINE_CONFIG_END -machine_config_constructor neogeo_sma_cart_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sma_cart ); -} - /************************************************* kof99 diff --git a/src/devices/bus/neogeo/sma.h b/src/devices/bus/neogeo/sma.h index 8e9ee1d47a6..60b003f4c56 100644 --- a/src/devices/bus/neogeo/sma.h +++ b/src/devices/bus/neogeo/sma.h @@ -16,8 +16,6 @@ public: // construction/destruction neogeo_sma_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - // reading and writing virtual DECLARE_READ16_MEMBER(protection_r) override { return m_sma_prot->prot_9a37_r(space, offset, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_sma_prot->random_r(space, offset, mem_mask); } @@ -33,6 +31,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_sma_prot; required_device m_cmc_prot; }; diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp index d2cdb256d6d..95aaee375dd 100644 --- a/src/devices/bus/nes/aladdin.cpp +++ b/src/devices/bus/nes/aladdin.cpp @@ -324,11 +324,6 @@ static SLOT_INTERFACE_START(ade_cart) SLOT_INTERFACE_END -MACHINE_CONFIG_START( camerica_aladdin ) +MACHINE_CONFIG_MEMBER( nes_aladdin_device::device_add_mconfig ) MCFG_ALADDIN_MINICART_ADD("ade_slot", ade_cart) MACHINE_CONFIG_END - -machine_config_constructor nes_aladdin_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( camerica_aladdin ); -} diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h index 80262b637d9..de6725bb9f1 100644 --- a/src/devices/bus/nes/aladdin.h +++ b/src/devices/bus/nes/aladdin.h @@ -155,7 +155,6 @@ public: // construction/destruction nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -165,6 +164,8 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_subslot; }; diff --git a/src/devices/bus/nes/bandai.cpp b/src/devices/bus/nes/bandai.cpp index 2e7a0f7168c..a9d301668ba 100644 --- a/src/devices/bus/nes/bandai.cpp +++ b/src/devices/bus/nes/bandai.cpp @@ -393,25 +393,14 @@ READ8_MEMBER(nes_lz93d50_24c01_device::read_m) // SERIAL I2C DEVICE //------------------------------------------------- -MACHINE_CONFIG_START( bandai_i2c_24c01 ) +MACHINE_CONFIG_MEMBER( nes_lz93d50_24c01_device::device_add_mconfig ) MCFG_24C01_ADD("i2cmem") MACHINE_CONFIG_END -machine_config_constructor nes_lz93d50_24c01_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( bandai_i2c_24c01 ); -} - - -MACHINE_CONFIG_START( bandai_i2c_24c02 ) +MACHINE_CONFIG_MEMBER( nes_lz93d50_24c02_device::device_add_mconfig ) MCFG_24C02_ADD("i2cmem") MACHINE_CONFIG_END -machine_config_constructor nes_lz93d50_24c02_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( bandai_i2c_24c02 ); -} - /*------------------------------------------------- diff --git a/src/devices/bus/nes/bandai.h b/src/devices/bus/nes/bandai.h index 17a1fed1b79..e44ff99de20 100644 --- a/src/devices/bus/nes/bandai.h +++ b/src/devices/bus/nes/bandai.h @@ -90,7 +90,6 @@ public: // construction/destruction nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -102,6 +101,8 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + // TODO: fix EEPROM I/O emulation required_device m_i2cmem; uint8_t m_i2c_dir; @@ -116,8 +117,9 @@ public: // construction/destruction nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; }; diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp index 1c01ac219d5..3efd89e948f 100644 --- a/src/devices/bus/nes/datach.cpp +++ b/src/devices/bus/nes/datach.cpp @@ -202,15 +202,10 @@ uint8_t *nes_datach_rom_device::get_cart_base() } -MACHINE_CONFIG_START( subcart_i2c_24c01 ) +MACHINE_CONFIG_MEMBER( nes_datach_24c01_device::device_add_mconfig ) MCFG_24C01_ADD("i2cmem") MACHINE_CONFIG_END -machine_config_constructor nes_datach_24c01_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( subcart_i2c_24c01 ); -} - //--------------------------------- // @@ -373,17 +368,12 @@ static SLOT_INTERFACE_START(datach_cart) SLOT_INTERFACE_END -MACHINE_CONFIG_START( bandai_datach ) +MACHINE_CONFIG_MEMBER( nes_datach_device::device_add_mconfig ) MCFG_BARCODE_READER_ADD("datach") MCFG_DATACH_MINICART_ADD("datach_slot", datach_cart) MCFG_24C02_ADD("i2cmem") MACHINE_CONFIG_END -machine_config_constructor nes_datach_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( bandai_datach ); -} - //------------------------------------------------- // device_timer - handler timer events diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h index 17a3ece97e8..5d4decd64fa 100644 --- a/src/devices/bus/nes/datach.h +++ b/src/devices/bus/nes/datach.h @@ -124,8 +124,9 @@ public: // construction/destruction nes_datach_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; }; // device type definition @@ -147,10 +148,6 @@ public: // construction/destruction nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -158,6 +155,11 @@ public: virtual void pcb_reset() override; protected: + // device-level overrides + virtual void device_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void device_add_mconfig(machine_config &config) override; + uint8_t m_datach_latch; required_device m_i2cmem; required_device m_reader; diff --git a/src/devices/bus/nes/disksys.cpp b/src/devices/bus/nes/disksys.cpp index c51ba8f097e..dcc4d470aee 100644 --- a/src/devices/bus/nes/disksys.cpp +++ b/src/devices/bus/nes/disksys.cpp @@ -47,20 +47,14 @@ static const floppy_interface nes_floppy_interface = "floppy_5_25" }; -static MACHINE_CONFIG_START( nes_disksys ) - MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface) -MACHINE_CONFIG_END //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nes_disksys_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( nes_disksys ); -} - +MACHINE_CONFIG_MEMBER( nes_disksys_device::device_add_mconfig ) + MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface) +MACHINE_CONFIG_END ROM_START( disksys ) diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h index 863400ebe70..907ee06abef 100644 --- a/src/devices/bus/nes/disksys.h +++ b/src/devices/bus/nes/disksys.h @@ -17,9 +17,6 @@ public: // construction/destruction nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual DECLARE_READ8_MEMBER(read_ex) override; virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_READ8_MEMBER(read_h) override; @@ -37,6 +34,9 @@ protected: virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + required_region_ptr m_2c33_rom; private: diff --git a/src/devices/bus/nes/ggenie.cpp b/src/devices/bus/nes/ggenie.cpp index 085b96d3b08..9d15e6dcea6 100644 --- a/src/devices/bus/nes/ggenie.cpp +++ b/src/devices/bus/nes/ggenie.cpp @@ -253,22 +253,12 @@ READ8_MEMBER(nes_ggenie_device::nt_r) return m_nt_access[page][offset & 0x3ff]; } + //------------------------------------------------- -// MACHINE_CONFIG_START( sub_slot ) +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( sub_slot ) +MACHINE_CONFIG_MEMBER( nes_ggenie_device::device_add_mconfig ) MCFG_NES_CARTRIDGE_ADD("gg_slot", nes_cart, nullptr) MCFG_NES_CARTRIDGE_NOT_MANDATORY MACHINE_CONFIG_END - - -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_ggenie_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sub_slot ); -} diff --git a/src/devices/bus/nes/ggenie.h b/src/devices/bus/nes/ggenie.h index 761e53f4f51..1ca577ec7b0 100644 --- a/src/devices/bus/nes/ggenie.h +++ b/src/devices/bus/nes/ggenie.h @@ -32,15 +32,16 @@ public: void scanline_irq(int scanline, int vblank, int blanked) override { if (m_gg_bypass && m_ggslot->m_cart) m_ggslot->m_cart->scanline_irq(scanline, vblank, blanked); } void ppu_latch(offs_t offset) override { if (m_gg_bypass && m_ggslot->m_cart) m_ggslot->m_cart->ppu_latch(offset); } - virtual machine_config_constructor device_mconfig_additions() const override; - virtual void pcb_reset() override; virtual void pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) override; -private: +protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + +private: // emulate the Game Genie! required_device m_ggslot; diff --git a/src/devices/bus/nes/jaleco.cpp b/src/devices/bus/nes/jaleco.cpp index 332558aa763..fcff0be4483 100644 --- a/src/devices/bus/nes/jaleco.cpp +++ b/src/devices/bus/nes/jaleco.cpp @@ -767,11 +767,12 @@ static const char *const jf33_sample_names[] = nullptr }; + //------------------------------------------------- -// MACHINE_DRIVER +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( jf13 ) +MACHINE_CONFIG_MEMBER( nes_jf13_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -782,7 +783,7 @@ static MACHINE_CONFIG_START( jf13 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf17 ) +MACHINE_CONFIG_MEMBER( nes_jf17_adpcm_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -793,7 +794,7 @@ static MACHINE_CONFIG_START( jf17 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf19 ) +MACHINE_CONFIG_MEMBER( nes_jf19_adpcm_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -804,7 +805,7 @@ static MACHINE_CONFIG_START( jf19 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf23 ) +MACHINE_CONFIG_MEMBER( nes_jf23_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -815,7 +816,7 @@ static MACHINE_CONFIG_START( jf23 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf24 ) +MACHINE_CONFIG_MEMBER( nes_jf24_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -826,7 +827,7 @@ static MACHINE_CONFIG_START( jf24 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf29 ) +MACHINE_CONFIG_MEMBER( nes_jf29_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -837,7 +838,7 @@ static MACHINE_CONFIG_START( jf29 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( jf33 ) +MACHINE_CONFIG_MEMBER( nes_jf33_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -847,42 +848,3 @@ static MACHINE_CONFIG_START( jf33 ) MCFG_SAMPLES_NAMES(jf33_sample_names) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END - -//------------------------------------------------- -// machine_config_additions -//------------------------------------------------- - -machine_config_constructor nes_jf13_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf13 ); -} - -machine_config_constructor nes_jf17_adpcm_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf17 ); -} - -machine_config_constructor nes_jf19_adpcm_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf19 ); -} - -machine_config_constructor nes_jf23_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf23 ); -} - -machine_config_constructor nes_jf24_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf24 ); -} - -machine_config_constructor nes_jf29_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf29 ); -} - -machine_config_constructor nes_jf33_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jf33 ); -} diff --git a/src/devices/bus/nes/jaleco.h b/src/devices/bus/nes/jaleco.h index 5fe977bba04..ed8c04da7a0 100644 --- a/src/devices/bus/nes/jaleco.h +++ b/src/devices/bus/nes/jaleco.h @@ -35,7 +35,6 @@ public: // construction/destruction nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_m) override; virtual void pcb_reset() override; @@ -44,6 +43,8 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_samples; }; @@ -97,9 +98,11 @@ public: // construction/destruction nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_samples; }; @@ -133,9 +136,11 @@ public: // construction/destruction nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_samples; }; @@ -195,7 +200,8 @@ public: // construction/destruction nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); } @@ -212,7 +218,8 @@ public: // construction/destruction nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); } @@ -229,7 +236,8 @@ public: // construction/destruction nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); } @@ -246,7 +254,8 @@ public: // construction/destruction nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; private: virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); } diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp index 73493ba33bf..11165bad0b2 100644 --- a/src/devices/bus/nes/karastudio.cpp +++ b/src/devices/bus/nes/karastudio.cpp @@ -295,11 +295,6 @@ static SLOT_INTERFACE_START(karaoke_studio_cart) SLOT_INTERFACE_END -MACHINE_CONFIG_START( karaoke_studio ) +MACHINE_CONFIG_MEMBER( nes_karaokestudio_device::device_add_mconfig ) MCFG_KSTUDIO_MINICART_ADD("exp_slot", karaoke_studio_cart) MACHINE_CONFIG_END - -machine_config_constructor nes_karaokestudio_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( karaoke_studio ); -} diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h index 148c1fd1be1..bd712722fe9 100644 --- a/src/devices/bus/nes/karastudio.h +++ b/src/devices/bus/nes/karastudio.h @@ -130,9 +130,6 @@ public: // construction/destruction nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -143,6 +140,10 @@ protected: // device-level overrides virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + +private: int m_exp_active; required_device m_subslot; required_ioport m_mic_ipt; diff --git a/src/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp index 85d43ce7ac8..58445792bb3 100644 --- a/src/devices/bus/nes/konami.cpp +++ b/src/devices/bus/nes/konami.cpp @@ -633,7 +633,12 @@ WRITE8_MEMBER(nes_konami_vrc6_device::write_h) } } -static MACHINE_CONFIG_START( vrc6 ) + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +MACHINE_CONFIG_MEMBER( nes_konami_vrc6_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -644,16 +649,6 @@ static MACHINE_CONFIG_START( vrc6 ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_konami_vrc6_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( vrc6 ); -} - /*------------------------------------------------- Konami VRC7 @@ -767,7 +762,7 @@ WRITE8_MEMBER(nes_konami_vrc7_device::write_h) // FIXME: we currently emulate this as a base YM2413! -static MACHINE_CONFIG_START( vrc7 ) +MACHINE_CONFIG_MEMBER( nes_konami_vrc7_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -777,13 +772,3 @@ static MACHINE_CONFIG_START( vrc7 ) MCFG_SOUND_ADD("ym", YM2413, XTAL_21_4772MHz/12) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) MACHINE_CONFIG_END - -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_konami_vrc7_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( vrc7 ); -} diff --git a/src/devices/bus/nes/konami.h b/src/devices/bus/nes/konami.h index ce711ef2803..db269170f53 100644 --- a/src/devices/bus/nes/konami.h +++ b/src/devices/bus/nes/konami.h @@ -126,13 +126,14 @@ public: // construction/destruction nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + required_device m_vrc6snd; }; @@ -145,7 +146,6 @@ public: // construction/destruction nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; virtual void pcb_reset() override; @@ -154,6 +154,8 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_ym2413; }; diff --git a/src/devices/bus/nes/pt554.cpp b/src/devices/bus/nes/pt554.cpp index 55373d6e176..f17b6f5e93a 100644 --- a/src/devices/bus/nes/pt554.cpp +++ b/src/devices/bus/nes/pt554.cpp @@ -83,11 +83,12 @@ static const char *const pt554_sample_names[] = nullptr }; + //------------------------------------------------- -// MACHINE_DRIVER +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( pt554 ) +MACHINE_CONFIG_MEMBER( nes_bandai_pt554_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -97,12 +98,3 @@ static MACHINE_CONFIG_START( pt554 ) MCFG_SAMPLES_NAMES(pt554_sample_names) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END - -//------------------------------------------------- -// machine_config_additions -//------------------------------------------------- - -machine_config_constructor nes_bandai_pt554_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( pt554 ); -} diff --git a/src/devices/bus/nes/pt554.h b/src/devices/bus/nes/pt554.h index 95947c26ef7..f25281ea4f0 100644 --- a/src/devices/bus/nes/pt554.h +++ b/src/devices/bus/nes/pt554.h @@ -16,10 +16,12 @@ public: // construction/destruction nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_m) override; +protected: + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_samples; }; diff --git a/src/devices/bus/nes/sunsoft.cpp b/src/devices/bus/nes/sunsoft.cpp index 369784b8682..4324d2f0581 100644 --- a/src/devices/bus/nes/sunsoft.cpp +++ b/src/devices/bus/nes/sunsoft.cpp @@ -597,9 +597,6 @@ WRITE8_MEMBER(nes_sunsoft_5_device::write_h) } } -//------------------------------------------------- -// MACHINE_DRIVER( sun_5b ) -//------------------------------------------------- // From NESdev wiki: The 5B's audio is driven by the CPU clock (1.78977267 MHz), // but like the NES's APU, the YM2149F has an optional clock divider which @@ -608,7 +605,12 @@ WRITE8_MEMBER(nes_sunsoft_5_device::write_h) // YM2149F operating in this mode. To use an AY-3-8910 as a substitute, // you would need an external divider to reduce the clock speed by half. -static MACHINE_CONFIG_START( sun_5b ) + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +MACHINE_CONFIG_MEMBER( nes_sunsoft_5_device::device_add_mconfig ) // additional sound hardware MCFG_SPEAKER_STANDARD_MONO("addon") @@ -618,13 +620,3 @@ static MACHINE_CONFIG_START( sun_5b ) MCFG_SOUND_ADD("ay", YM2149, (XTAL_21_4772MHz/12)/2) // divide by 2 for the internal divider MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) MACHINE_CONFIG_END - -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_sunsoft_5_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sun_5b ); -} diff --git a/src/devices/bus/nes/sunsoft.h b/src/devices/bus/nes/sunsoft.h index 0c4728627e4..60fee845ade 100644 --- a/src/devices/bus/nes/sunsoft.h +++ b/src/devices/bus/nes/sunsoft.h @@ -138,10 +138,11 @@ public: // construction/destruction nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual DECLARE_WRITE8_MEMBER(write_h) override; +protected: + virtual void device_add_mconfig(machine_config &config) override; + private: required_device m_ym2149; }; diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp index 180efcbf974..49a12e88a60 100644 --- a/src/devices/bus/nes/sunsoft_dcs.cpp +++ b/src/devices/bus/nes/sunsoft_dcs.cpp @@ -272,28 +272,21 @@ READ8_MEMBER(nes_sunsoft_dcs_device::read_m) return m_open_bus; // open bus } -//------------------------------------------------- -// MACHINE_CONFIG_START( sub_slot ) -//------------------------------------------------- static SLOT_INTERFACE_START(ntb_cart) SLOT_INTERFACE_INTERNAL("ntbrom", NES_NTB_ROM) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( sub_slot ) - MCFG_NTB_MINICART_ADD("ntb_slot", ntb_cart) -MACHINE_CONFIG_END + //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nes_sunsoft_dcs_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sub_slot ); -} +MACHINE_CONFIG_MEMBER( nes_sunsoft_dcs_device::device_add_mconfig ) + MCFG_NTB_MINICART_ADD("ntb_slot", ntb_cart) +MACHINE_CONFIG_END //------------------------------------------------- diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h index 4b564a20f07..f14d9f9c8c1 100644 --- a/src/devices/bus/nes/sunsoft_dcs.h +++ b/src/devices/bus/nes/sunsoft_dcs.h @@ -128,7 +128,6 @@ public: // construction/destruction nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -141,6 +140,8 @@ protected: virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void device_add_mconfig(machine_config &config) override; + private: static constexpr device_timer_id TIMER_PROTECT = 0; diff --git a/src/devices/bus/nes_ctrl/bcbattle.cpp b/src/devices/bus/nes_ctrl/bcbattle.cpp index 7e86e1d08df..263017e27a3 100644 --- a/src/devices/bus/nes_ctrl/bcbattle.cpp +++ b/src/devices/bus/nes_ctrl/bcbattle.cpp @@ -20,15 +20,10 @@ DEFINE_DEVICE_TYPE(NES_BARCODE_BATTLER, nes_bcbattle_device, "nes_bcbattle", "Epoch Barcode Battler (FC)") -MACHINE_CONFIG_START( nes_battler ) +MACHINE_CONFIG_MEMBER( nes_bcbattle_device::device_add_mconfig ) MCFG_BARCODE_READER_ADD("battler") MACHINE_CONFIG_END -machine_config_constructor nes_bcbattle_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( nes_battler ); -} - //------------------------------------------------- // device_timer - handler timer events diff --git a/src/devices/bus/nes_ctrl/bcbattle.h b/src/devices/bus/nes_ctrl/bcbattle.h index f485d9c6b35..9fc75b0f9fc 100644 --- a/src/devices/bus/nes_ctrl/bcbattle.h +++ b/src/devices/bus/nes_ctrl/bcbattle.h @@ -28,8 +28,6 @@ public: // construction/destruction nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - protected: static constexpr device_timer_id TIMER_BATTLER = 1; @@ -38,6 +36,8 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void device_add_mconfig(machine_config &config) override; + virtual uint8_t read_exp(offs_t offset) override; int read_current_bit(); diff --git a/src/devices/bus/nes_ctrl/fckeybrd.cpp b/src/devices/bus/nes_ctrl/fckeybrd.cpp index d8d1fee6937..18ea47ecb66 100644 --- a/src/devices/bus/nes_ctrl/fckeybrd.cpp +++ b/src/devices/bus/nes_ctrl/fckeybrd.cpp @@ -119,24 +119,17 @@ ioport_constructor nes_fckeybrd_device::device_input_ports() const } -static MACHINE_CONFIG_START( fc_keyboard ) +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +MACHINE_CONFIG_MEMBER( nes_fckeybrd_device::device_add_mconfig ) MCFG_CASSETTE_ADD("tape") MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fc_cass") MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_fckeybrd_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( fc_keyboard ); -} - - //************************************************************************** // LIVE DEVICE //************************************************************************** diff --git a/src/devices/bus/nes_ctrl/fckeybrd.h b/src/devices/bus/nes_ctrl/fckeybrd.h index 5859a792ae6..85bf0c2f83f 100644 --- a/src/devices/bus/nes_ctrl/fckeybrd.h +++ b/src/devices/bus/nes_ctrl/fckeybrd.h @@ -28,14 +28,14 @@ public: // construction/destruction nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; - virtual machine_config_constructor device_mconfig_additions() const override; - protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual uint8_t read_exp(offs_t offset) override; virtual void write(uint8_t data) override; diff --git a/src/devices/bus/nes_ctrl/hori.cpp b/src/devices/bus/nes_ctrl/hori.cpp index 17f9340449c..14e6cb227c8 100644 --- a/src/devices/bus/nes_ctrl/hori.cpp +++ b/src/devices/bus/nes_ctrl/hori.cpp @@ -53,12 +53,17 @@ static SLOT_INTERFACE_START( hori_adapter ) SLOT_INTERFACE("joypad", NES_JOYPAD) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( horitwin ) + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +MACHINE_CONFIG_MEMBER( nes_horitwin_device::device_add_mconfig ) MCFG_FC_EXPANSION_PORT_ADD("port1", hori_adapter, "joypad") MCFG_FC_EXPANSION_PORT_ADD("port2", hori_adapter, "joypad") MACHINE_CONFIG_END -static MACHINE_CONFIG_START( hori4p ) +MACHINE_CONFIG_MEMBER( nes_hori4p_device::device_add_mconfig ) MCFG_FC_EXPANSION_PORT_ADD("port1", hori_adapter, "joypad") MCFG_FC_EXPANSION_PORT_ADD("port2", hori_adapter, "joypad") MCFG_FC_EXPANSION_PORT_ADD("port3", hori_adapter, "joypad") @@ -66,22 +71,6 @@ static MACHINE_CONFIG_START( hori4p ) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor nes_horitwin_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( horitwin ); -} - -machine_config_constructor nes_hori4p_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( hori4p ); -} - - //************************************************************************** // LIVE DEVICE //************************************************************************** diff --git a/src/devices/bus/nes_ctrl/hori.h b/src/devices/bus/nes_ctrl/hori.h index 6fb7d9c1eee..287384c6ca5 100644 --- a/src/devices/bus/nes_ctrl/hori.h +++ b/src/devices/bus/nes_ctrl/hori.h @@ -27,12 +27,12 @@ public: // construction/destruction nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - protected: // device-level overrides virtual void device_start() override { } + virtual void device_add_mconfig(machine_config &config) override; + virtual uint8_t read_exp(offs_t offset) override; virtual void write(uint8_t data) override; @@ -50,13 +50,13 @@ public: // construction/destruction nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual ioport_constructor device_input_ports() const override; - virtual machine_config_constructor device_mconfig_additions() const override; - protected: // device-level overrides virtual void device_start() override { } + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual uint8_t read_exp(offs_t offset) override; virtual void write(uint8_t data) override; diff --git a/src/devices/bus/nes_ctrl/joypad.cpp b/src/devices/bus/nes_ctrl/joypad.cpp index d69aa600b66..33743f41936 100644 --- a/src/devices/bus/nes_ctrl/joypad.cpp +++ b/src/devices/bus/nes_ctrl/joypad.cpp @@ -148,22 +148,15 @@ static SLOT_INTERFACE_START( arcstick_daisy ) SLOT_INTERFACE("arcstick", NES_ARCSTICK) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( arcstick ) - // expansion port to allow daisy chaining - MCFG_FC_EXPANSION_PORT_ADD("subexp", arcstick_daisy, nullptr) -MACHINE_CONFIG_END - //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nes_arcstick_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( arcstick ); -} - +MACHINE_CONFIG_MEMBER( nes_arcstick_device::device_add_mconfig ) + // expansion port to allow daisy chaining + MCFG_FC_EXPANSION_PORT_ADD("subexp", arcstick_daisy, nullptr) +MACHINE_CONFIG_END //************************************************************************** diff --git a/src/devices/bus/nes_ctrl/joypad.h b/src/devices/bus/nes_ctrl/joypad.h index bfee068f81d..b503f7d4ec8 100644 --- a/src/devices/bus/nes_ctrl/joypad.h +++ b/src/devices/bus/nes_ctrl/joypad.h @@ -88,10 +88,10 @@ public: // construction/destruction nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +protected: virtual ioport_constructor device_input_ports() const override; - virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; -protected: virtual uint8_t read_bit0() override { return 0; } virtual uint8_t read_exp(offs_t offset) override; virtual void write(uint8_t data) override; diff --git a/src/devices/bus/nes_ctrl/miracle.cpp b/src/devices/bus/nes_ctrl/miracle.cpp index addd8d45a5d..14ea0c2572f 100644 --- a/src/devices/bus/nes_ctrl/miracle.cpp +++ b/src/devices/bus/nes_ctrl/miracle.cpp @@ -22,18 +22,13 @@ DEFINE_DEVICE_TYPE(NES_MIRACLE, nes_miracle_device, "nes_miracle", "NES Miracle Piano Controller") -MACHINE_CONFIG_START( nes_miracle ) +MACHINE_CONFIG_MEMBER( nes_miracle_device::device_add_mconfig ) MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") MCFG_MIDI_RX_HANDLER(WRITELINE(nes_miracle_device, rx_w)) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") MACHINE_CONFIG_END -machine_config_constructor nes_miracle_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( nes_miracle ); -} - //------------------------------------------------- // device_timer - handler timer events diff --git a/src/devices/bus/nes_ctrl/miracle.h b/src/devices/bus/nes_ctrl/miracle.h index 5e8944ae828..16c15ab65db 100644 --- a/src/devices/bus/nes_ctrl/miracle.h +++ b/src/devices/bus/nes_ctrl/miracle.h @@ -29,9 +29,6 @@ public: // construction/destruction nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual machine_config_constructor device_mconfig_additions() const override; - required_device m_midiin, m_midiout; protected: @@ -43,6 +40,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void device_add_mconfig(machine_config &config) override; + +private: // serial overrides virtual void rcv_complete() override; // Rx completed receiving byte virtual void tra_complete() override; // Tx completed sending byte diff --git a/src/devices/bus/newbrain/eim.cpp b/src/devices/bus/newbrain/eim.cpp index d7a982547fe..651fedc5407 100644 --- a/src/devices/bus/newbrain/eim.cpp +++ b/src/devices/bus/newbrain/eim.cpp @@ -64,10 +64,10 @@ const tiny_rom_entry *newbrain_eim_device::device_rom_region() const //------------------------------------------------- -// MACHINE_CONFIG_START( newbrain_eim ) +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( newbrain_eim ) +MACHINE_CONFIG_MEMBER( newbrain_eim_device::device_add_mconfig ) // devices MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, XTAL_16MHz/8) MCFG_Z80CTC_ZC0_CB(DEVWRITELINE(MC6850_TAG, acia6850_device, write_rxc)) @@ -100,18 +100,6 @@ static MACHINE_CONFIG_START( newbrain_eim ) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor newbrain_eim_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( newbrain_eim ); -} - - - //************************************************************************** // LIVE DEVICE //************************************************************************** diff --git a/src/devices/bus/newbrain/eim.h b/src/devices/bus/newbrain/eim.h index a2406303d9c..be300fc8dfd 100644 --- a/src/devices/bus/newbrain/eim.h +++ b/src/devices/bus/newbrain/eim.h @@ -32,29 +32,20 @@ public: // construction/destruction newbrain_eim_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual const tiny_rom_entry *device_rom_region() const override; - virtual machine_config_constructor device_mconfig_additions() const override; - DECLARE_READ8_MEMBER( anout_r ); DECLARE_WRITE8_MEMBER( anout_w ); DECLARE_READ8_MEMBER( anin_r ); DECLARE_WRITE8_MEMBER( anio_w ); - DECLARE_WRITE_LINE_MEMBER( acia_interrupt ); - DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); - DECLARE_WRITE_LINE_MEMBER( adc_eoc_w ); - - ADC0808_ANALOG_READ_CB(adc_vref_pos_r); - ADC0808_ANALOG_READ_CB(adc_vref_neg_r); - ADC0808_ANALOG_READ_CB(adc_input_r); - - TIMER_DEVICE_CALLBACK_MEMBER(ctc_c2_tick); protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + // device_newbrain_expansion_slot_interface overrides virtual uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; virtual void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; @@ -62,6 +53,16 @@ protected: virtual void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; private: + DECLARE_WRITE_LINE_MEMBER( acia_interrupt ); + DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); + DECLARE_WRITE_LINE_MEMBER( adc_eoc_w ); + + ADC0808_ANALOG_READ_CB(adc_vref_pos_r); + ADC0808_ANALOG_READ_CB(adc_vref_neg_r); + ADC0808_ANALOG_READ_CB(adc_input_r); + + TIMER_DEVICE_CALLBACK_MEMBER(ctc_c2_tick); + required_device m_ctc; required_device m_acia; required_device m_exp; diff --git a/src/devices/bus/newbrain/fdc.cpp b/src/devices/bus/newbrain/fdc.cpp index 592c17c8168..1d52b2842de 100644 --- a/src/devices/bus/newbrain/fdc.cpp +++ b/src/devices/bus/newbrain/fdc.cpp @@ -98,10 +98,10 @@ SLOT_INTERFACE_END //------------------------------------------------- -// MACHINE_CONFIG_START( newbrain_fdc ) +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( newbrain_fdc ) +MACHINE_CONFIG_MEMBER( newbrain_fdc_device::device_add_mconfig ) MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_4MHz) MCFG_CPU_PROGRAM_MAP(newbrain_fdc_mem) MCFG_CPU_IO_MAP(newbrain_fdc_io) @@ -118,17 +118,6 @@ static MACHINE_CONFIG_START( newbrain_fdc ) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor newbrain_fdc_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( newbrain_fdc ); -} - - //************************************************************************** // LIVE DEVICE //************************************************************************** diff --git a/src/devices/bus/newbrain/fdc.h b/src/devices/bus/newbrain/fdc.h index c429d8ea447..885ce5b9365 100644 --- a/src/devices/bus/newbrain/fdc.h +++ b/src/devices/bus/newbrain/fdc.h @@ -29,11 +29,6 @@ public: // construction/destruction newbrain_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual const tiny_rom_entry *device_rom_region() const override; - virtual machine_config_constructor device_mconfig_additions() const override; - - DECLARE_WRITE_LINE_MEMBER( fdc_int_w ); DECLARE_WRITE8_MEMBER( fdc_auxiliary_w ); DECLARE_READ8_MEMBER( fdc_control_r ); DECLARE_WRITE8_MEMBER( io_dec_w ); @@ -43,6 +38,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_add_mconfig(machine_config &config) override; + // device_newbrain_expansion_slot_interface overrides virtual uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; virtual void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; @@ -50,6 +49,8 @@ protected: virtual void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; private: + DECLARE_WRITE_LINE_MEMBER( fdc_int_w ); + required_device m_maincpu; required_device m_fdc; required_device m_floppy0; diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp index de535bae048..e454b8cbcec 100644 --- a/src/devices/bus/nubus/nubus_48gc.cpp +++ b/src/devices/bus/nubus/nubus_48gc.cpp @@ -17,16 +17,6 @@ #define GC48_SCREEN_NAME "48gc_screen" #define GC48_ROM_REGION "48gc_rom" -MACHINE_CONFIG_START( macvideo_48gc ) - MCFG_SCREEN_ADD( GC48_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, jmfb_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) -// MCFG_SCREEN_SIZE(1152, 870) -// MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 870-1) -// MCFG_SCREEN_REFRESH_RATE(75) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) -MACHINE_CONFIG_END - ROM_START( gc48 ) ROM_REGION(0x8000, GC48_ROM_REGION, 0) ROM_LOAD( "3410801.bin", 0x0000, 0x8000, CRC(e283da91) SHA1(4ae21d6d7bbaa6fc7aa301bee2b791ed33b1dcf9) ) @@ -46,14 +36,18 @@ DEFINE_DEVICE_TYPE(NUBUS_824GC, nubus_824gc_device, "nb_824gc", "Apple 8*24 vide //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor jmfb_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( macvideo_48gc ); -} +MACHINE_CONFIG_MEMBER( jmfb_device::device_add_mconfig ) + MCFG_SCREEN_ADD( GC48_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, jmfb_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) +// MCFG_SCREEN_SIZE(1152, 870) +// MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 870-1) +// MCFG_SCREEN_REFRESH_RATE(75) +// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260)) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_48gc.h b/src/devices/bus/nubus/nubus_48gc.h index 604b4d351d8..0dbebbf4dcb 100644 --- a/src/devices/bus/nubus/nubus_48gc.h +++ b/src/devices/bus/nubus/nubus_48gc.h @@ -18,13 +18,6 @@ class jmfb_device : public device_video_interface, public device_nubus_card_interface { -public: - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: // construction/destruction jmfb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is824); @@ -34,9 +27,16 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(mac_48gc_r); DECLARE_WRITE32_MEMBER(mac_48gc_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + screen_device *m_screen; emu_timer *m_timer; diff --git a/src/devices/bus/nubus/nubus_asntmc3b.cpp b/src/devices/bus/nubus/nubus_asntmc3b.cpp index d28c260d179..9dd4668ad09 100644 --- a/src/devices/bus/nubus/nubus_asntmc3b.cpp +++ b/src/devices/bus/nubus/nubus_asntmc3b.cpp @@ -19,13 +19,6 @@ #define MAC8390_839X "dp83902" -MACHINE_CONFIG_START( asntm3b ) - MCFG_DEVICE_ADD(MAC8390_839X, DP8390D, 0) - MCFG_DP8390D_IRQ_CB(WRITELINE(nubus_mac8390_device, dp_irq_w)) - MCFG_DP8390D_MEM_READ_CB(READ8(nubus_mac8390_device, dp_mem_read)) - MCFG_DP8390D_MEM_WRITE_CB(WRITE8(nubus_mac8390_device, dp_mem_write)) -MACHINE_CONFIG_END - ROM_START( asntm3nb ) ROM_REGION(0x4000, MAC8390_ROM_REGION, 0) ROM_LOAD( "asante_mc3b.bin", 0x000000, 0x004000, CRC(4f86d451) SHA1(d0a41df667e6b51fbc63f9251d593f4fc49104ba) ) @@ -45,14 +38,15 @@ DEFINE_DEVICE_TYPE(NUBUS_APPLEENET, nubus_appleenet_device, "nb_aenet", "Apple N //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_mac8390_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( asntm3b ); -} +MACHINE_CONFIG_MEMBER( nubus_mac8390_device::device_add_mconfig ) + MCFG_DEVICE_ADD(MAC8390_839X, DP8390D, 0) + MCFG_DP8390D_IRQ_CB(WRITELINE(nubus_mac8390_device, dp_irq_w)) + MCFG_DP8390D_MEM_READ_CB(READ8(nubus_mac8390_device, dp_mem_read)) + MCFG_DP8390D_MEM_WRITE_CB(WRITE8(nubus_mac8390_device, dp_mem_write)) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_asntmc3b.h b/src/devices/bus/nubus/nubus_asntmc3b.h index 55fe2a5e1a0..7b1ee196a13 100644 --- a/src/devices/bus/nubus/nubus_asntmc3b.h +++ b/src/devices/bus/nubus/nubus_asntmc3b.h @@ -18,15 +18,6 @@ class nubus_mac8390_device : public device_t, public device_nubus_card_interface { -public: - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - void dp_irq_w(int state); - DECLARE_READ8_MEMBER(dp_mem_read); - DECLARE_WRITE8_MEMBER(dp_mem_write); - protected: // construction/destruction nubus_mac8390_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -35,6 +26,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + DECLARE_READ8_MEMBER(asntm3b_ram_r); DECLARE_WRITE8_MEMBER(asntm3b_ram_w); DECLARE_READ32_MEMBER(en_r); @@ -43,6 +38,10 @@ protected: required_device m_dp83902; private: + void dp_irq_w(int state); + DECLARE_READ8_MEMBER(dp_mem_read); + DECLARE_WRITE8_MEMBER(dp_mem_write); + uint8_t m_ram[0x20000]; uint8_t m_prom[16]; }; diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp index f5893e8574b..bbc4fae7773 100644 --- a/src/devices/bus/nubus/nubus_cb264.cpp +++ b/src/devices/bus/nubus/nubus_cb264.cpp @@ -22,13 +22,6 @@ #define VRAM_SIZE (0x200000) // 2 megs, maxed out -MACHINE_CONFIG_START( cb264 ) - MCFG_SCREEN_ADD( CB264_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( cb264 ) ROM_REGION(0x4000, CB264_ROM_REGION, 0) @@ -44,14 +37,16 @@ DEFINE_DEVICE_TYPE(NUBUS_CB264, nubus_cb264_device, "nb_c264", "RasterOps ColorB //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_cb264_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( cb264 ); -} +MACHINE_CONFIG_MEMBER( nubus_cb264_device::device_add_mconfig ) + MCFG_SCREEN_ADD( CB264_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_cb264.h b/src/devices/bus/nubus/nubus_cb264.h index 82c0181a27f..07719f8ccae 100644 --- a/src/devices/bus/nubus/nubus_cb264.h +++ b/src/devices/bus/nubus/nubus_cb264.h @@ -21,12 +21,6 @@ public: // construction/destruction nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_cb264_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -34,12 +28,18 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + DECLARE_READ32_MEMBER(cb264_r); DECLARE_WRITE32_MEMBER(cb264_w); DECLARE_READ32_MEMBER(cb264_ramdac_r); DECLARE_WRITE32_MEMBER(cb264_ramdac_w); -public: +private: + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle; uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp index fd3fe41ae0f..88df6f108fd 100644 --- a/src/devices/bus/nubus/nubus_image.cpp +++ b/src/devices/bus/nubus/nubus_image.cpp @@ -114,10 +114,6 @@ void nubus_image_device::messimg_disk_image_device::device_reset() { } -MACHINE_CONFIG_START( image ) - MCFG_DEVICE_ADD(IMAGE_DISK0_TAG, MESSIMG_DISK, 0) -MACHINE_CONFIG_END - ROM_START( image ) ROM_REGION(0x2000, IMAGE_ROM_REGION, 0) ROM_LOAD( "nb_fake.bin", 0x000000, 0x002000, CRC(9264bac5) SHA1(540c2ce3c90382b2da6e1e21182cdf8fc3f0c930) ) @@ -131,14 +127,12 @@ DEFINE_DEVICE_TYPE(NUBUS_IMAGE, nubus_image_device, "nb_image", "NuBus Disk Imag //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_image_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( image ); -} +MACHINE_CONFIG_MEMBER( nubus_image_device::device_add_mconfig ) + MCFG_DEVICE_ADD(IMAGE_DISK0_TAG, MESSIMG_DISK, 0) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_image.h b/src/devices/bus/nubus/nubus_image.h index b12da43dc36..b2185f14d0f 100644 --- a/src/devices/bus/nubus/nubus_image.h +++ b/src/devices/bus/nubus/nubus_image.h @@ -24,10 +24,6 @@ public: // construction/destruction nubus_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - protected: enum { @@ -56,6 +52,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + DECLARE_READ32_MEMBER(image_status_r); DECLARE_WRITE32_MEMBER(image_status_w); DECLARE_READ32_MEMBER(image_r); diff --git a/src/devices/bus/nubus/nubus_m2hires.cpp b/src/devices/bus/nubus/nubus_m2hires.cpp index f9b1ed4deab..cfa9f84e13a 100644 --- a/src/devices/bus/nubus/nubus_m2hires.cpp +++ b/src/devices/bus/nubus/nubus_m2hires.cpp @@ -19,13 +19,6 @@ #define VRAM_SIZE (0x80000) // 512k max -MACHINE_CONFIG_START( m2hires ) - MCFG_SCREEN_ADD( M2HIRES_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2hires_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( m2hires ) ROM_REGION(0x2000, M2HIRES_ROM_REGION, 0) @@ -40,14 +33,16 @@ DEFINE_DEVICE_TYPE(NUBUS_M2HIRES, nubus_m2hires_device, "nb_m2hr", "Macintosh II //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_m2hires_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( m2hires ); -} +MACHINE_CONFIG_MEMBER( nubus_m2hires_device::device_add_mconfig ) + MCFG_SCREEN_ADD( M2HIRES_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2hires_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_m2hires.h b/src/devices/bus/nubus/nubus_m2hires.h index 1e8f7c92290..79bd30141c8 100644 --- a/src/devices/bus/nubus/nubus_m2hires.h +++ b/src/devices/bus/nubus/nubus_m2hires.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_m2hires_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(m2hires_r); DECLARE_WRITE32_MEMBER(m2hires_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/nubus_m2video.cpp b/src/devices/bus/nubus/nubus_m2video.cpp index 66d74347459..22f958c53fa 100644 --- a/src/devices/bus/nubus/nubus_m2video.cpp +++ b/src/devices/bus/nubus/nubus_m2video.cpp @@ -21,13 +21,6 @@ #define VRAM_SIZE (0x80000) // 512k max -MACHINE_CONFIG_START( m2video ) - MCFG_SCREEN_ADD(M2VIDEO_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2video_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( m2video ) ROM_REGION(0x1000, M2VIDEO_ROM_REGION, 0) @@ -42,14 +35,16 @@ DEFINE_DEVICE_TYPE(NUBUS_M2VIDEO, nubus_m2video_device, "nb_m2vc", "Macintosh II //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_m2video_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( m2video ); -} +MACHINE_CONFIG_MEMBER( nubus_m2video_device::device_add_mconfig ) + MCFG_SCREEN_ADD(M2VIDEO_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_m2video_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_m2video.h b/src/devices/bus/nubus/nubus_m2video.h index 10d2e9067c9..30344b3d2d0 100644 --- a/src/devices/bus/nubus/nubus_m2video.h +++ b/src/devices/bus/nubus/nubus_m2video.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_m2video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(m2video_r); DECLARE_WRITE32_MEMBER(m2video_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/nubus_radiustpd.cpp b/src/devices/bus/nubus/nubus_radiustpd.cpp index c0e8c69025e..3f8b27dde34 100644 --- a/src/devices/bus/nubus/nubus_radiustpd.cpp +++ b/src/devices/bus/nubus/nubus_radiustpd.cpp @@ -20,13 +20,6 @@ #define VRAM_SIZE (0x40000) // 256k. 1152x880 1 bit per pixel fits nicely. -MACHINE_CONFIG_START( radiustpd ) - MCFG_SCREEN_ADD( RADIUSTPD_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_radiustpd_device, screen_update) - MCFG_SCREEN_SIZE(1280, 960) - MCFG_SCREEN_REFRESH_RATE(70) - MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 880-1) -MACHINE_CONFIG_END ROM_START( radiustpd ) ROM_REGION(0x8000, RADIUSTPD_ROM_REGION, 0) @@ -41,14 +34,16 @@ DEFINE_DEVICE_TYPE(NUBUS_RADIUSTPD, nubus_radiustpd_device, "nb_rtpd", "Radius T //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_radiustpd_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( radiustpd ); -} +MACHINE_CONFIG_MEMBER( nubus_radiustpd_device::device_add_mconfig ) + MCFG_SCREEN_ADD( RADIUSTPD_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_radiustpd_device, screen_update) + MCFG_SCREEN_SIZE(1280, 960) + MCFG_SCREEN_REFRESH_RATE(70) + MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 880-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_radiustpd.h b/src/devices/bus/nubus/nubus_radiustpd.h index 7566c281ea9..d5a3606be20 100644 --- a/src/devices/bus/nubus/nubus_radiustpd.h +++ b/src/devices/bus/nubus/nubus_radiustpd.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_radiustpd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(radiustpd_r); DECLARE_WRITE32_MEMBER(radiustpd_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/nubus_spec8.cpp b/src/devices/bus/nubus/nubus_spec8.cpp index edbc738741b..a8289667de6 100644 --- a/src/devices/bus/nubus/nubus_spec8.cpp +++ b/src/devices/bus/nubus/nubus_spec8.cpp @@ -22,13 +22,6 @@ #define VRAM_SIZE (0xc0000) // 768k of VRAM for 1024x768 @ 8 bit -MACHINE_CONFIG_START( spec8s3 ) - MCFG_SCREEN_ADD( SPEC8S3_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_spec8s3_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) -MACHINE_CONFIG_END ROM_START( spec8s3 ) ROM_REGION(0x8000, SPEC8S3_ROM_REGION, 0) @@ -44,14 +37,16 @@ DEFINE_DEVICE_TYPE(NUBUS_SPEC8S3, nubus_spec8s3_device, "nb_sp8s3", "SuperMac Sp //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_spec8s3_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( spec8s3 ); -} +MACHINE_CONFIG_MEMBER( nubus_spec8s3_device::device_add_mconfig ) + MCFG_SCREEN_ADD( SPEC8S3_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_spec8s3_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_spec8.h b/src/devices/bus/nubus/nubus_spec8.h index 95f707d7df3..07a1639c1fc 100644 --- a/src/devices/bus/nubus/nubus_spec8.h +++ b/src/devices/bus/nubus/nubus_spec8.h @@ -22,13 +22,6 @@ public: // construction/destruction nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_spec8s3_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +29,19 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: DECLARE_READ32_MEMBER(spec8s3_r); DECLARE_WRITE32_MEMBER(spec8s3_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable; @@ -48,7 +49,6 @@ protected: emu_timer *m_timer; const std::string m_assembled_tag; -private: //uint32_t m_7xxxxx_regs[0x100000/4]; //int m_width, m_height, m_patofsx, m_patofsy; //uint32_t m_vram_addr, m_vram_src; diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index 92185ceea38..a16712e53e4 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -35,16 +35,6 @@ #define VRAM_SIZE (0x400000) -MACHINE_CONFIG_START( specpdq ) - MCFG_SCREEN_ADD( SPECPDQ_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_specpdq_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1280,1024) - MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 844-1) - - MCFG_PALETTE_ADD("palette", 256) -MACHINE_CONFIG_END - ROM_START( specpdq ) ROM_REGION(0x10000, SPECPDQ_ROM_REGION, 0) ROM_LOAD( "specpdq.bin", 0x000000, 0x010000, CRC(82a35f78) SHA1(9511c2df47140f4279196d3b8836b53429879dd9) ) @@ -58,14 +48,18 @@ DEFINE_DEVICE_TYPE(NUBUS_SPECPDQ, nubus_specpdq_device, "nb_spdq", "SuperMac Spe //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_specpdq_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( specpdq ); -} +MACHINE_CONFIG_MEMBER( nubus_specpdq_device::device_add_mconfig ) + MCFG_SCREEN_ADD( SPECPDQ_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_specpdq_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1280,1024) + MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 844-1) + + MCFG_PALETTE_ADD("palette", 256) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_specpdq.h b/src/devices/bus/nubus/nubus_specpdq.h index 153badb8f55..88cde4d4a3c 100644 --- a/src/devices/bus/nubus/nubus_specpdq.h +++ b/src/devices/bus/nubus/nubus_specpdq.h @@ -22,13 +22,6 @@ public: // construction/destruction nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_specpdq_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +29,19 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: DECLARE_READ32_MEMBER(specpdq_r); DECLARE_WRITE32_MEMBER(specpdq_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable; @@ -48,7 +49,6 @@ protected: emu_timer *m_timer; const std::string m_assembled_tag; -private: uint32_t m_7xxxxx_regs[0x100000/4]; int m_width, m_height, m_patofsx, m_patofsy; uint32_t m_vram_addr, m_vram_src; diff --git a/src/devices/bus/nubus/nubus_vikbw.cpp b/src/devices/bus/nubus/nubus_vikbw.cpp index 495a05ca70e..fd9f38157ed 100644 --- a/src/devices/bus/nubus/nubus_vikbw.cpp +++ b/src/devices/bus/nubus/nubus_vikbw.cpp @@ -19,13 +19,6 @@ #define VRAM_SIZE (0x18000) // 1024x768 @ 1bpp is 98,304 bytes (0x18000) -MACHINE_CONFIG_START( vikbw ) - MCFG_SCREEN_ADD( VIKBW_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_vikbw_device, screen_update) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) - MCFG_SCREEN_REFRESH_RATE(70) -MACHINE_CONFIG_END ROM_START( vikbw ) ROM_REGION(0x2000, VIKBW_ROM_REGION, 0) @@ -40,14 +33,16 @@ DEFINE_DEVICE_TYPE(NUBUS_VIKBW, nubus_vikbw_device, "nb_vikbw", "Moniterm Viking //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_vikbw_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( vikbw ); -} +MACHINE_CONFIG_MEMBER( nubus_vikbw_device::device_add_mconfig ) + MCFG_SCREEN_ADD( VIKBW_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_vikbw_device, screen_update) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) + MCFG_SCREEN_REFRESH_RATE(70) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_vikbw.h b/src/devices/bus/nubus/nubus_vikbw.h index fdafbeda6b5..94ce5f1df17 100644 --- a/src/devices/bus/nubus/nubus_vikbw.h +++ b/src/devices/bus/nubus/nubus_vikbw.h @@ -21,12 +21,6 @@ public: // construction/destruction nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_vikbw_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -34,11 +28,18 @@ protected: virtual void device_start() override; virtual void device_reset() override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(viking_ack_r); DECLARE_WRITE32_MEMBER(viking_ack_w); DECLARE_READ32_MEMBER(viking_enable_r); DECLARE_WRITE32_MEMBER(viking_disable_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t m_vbl_disable, m_palette[2]; }; diff --git a/src/devices/bus/nubus/nubus_wsportrait.cpp b/src/devices/bus/nubus/nubus_wsportrait.cpp index 9a703691f7a..fd343c9337a 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.cpp +++ b/src/devices/bus/nubus/nubus_wsportrait.cpp @@ -22,13 +22,6 @@ #define VRAM_SIZE (0x80000) // 512k max -MACHINE_CONFIG_START( wsportrait ) - MCFG_SCREEN_ADD( WSPORTRAIT_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_wsportrait_device, screen_update) - MCFG_SCREEN_SIZE(1024,960) - MCFG_SCREEN_REFRESH_RATE(75.0) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 870-1) -MACHINE_CONFIG_END ROM_START( wsportrait ) ROM_REGION(0x1000, WSPORTRAIT_ROM_REGION, 0) @@ -43,14 +36,16 @@ DEFINE_DEVICE_TYPE(NUBUS_WSPORTRAIT, nubus_wsportrait_device, "nb_wspt", "Macint //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_wsportrait_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( wsportrait ); -} +MACHINE_CONFIG_MEMBER( nubus_wsportrait_device::device_add_mconfig ) + MCFG_SCREEN_ADD( WSPORTRAIT_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_wsportrait_device, screen_update) + MCFG_SCREEN_SIZE(1024,960) + MCFG_SCREEN_REFRESH_RATE(75.0) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 870-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/nubus_wsportrait.h b/src/devices/bus/nubus/nubus_wsportrait.h index 86d79ab5d1d..abbdb95b69a 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.h +++ b/src/devices/bus/nubus/nubus_wsportrait.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_wsportrait_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(wsportrait_r); DECLARE_WRITE32_MEMBER(wsportrait_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/pds30_30hr.cpp b/src/devices/bus/nubus/pds30_30hr.cpp index d359e162138..1ac279f0f35 100644 --- a/src/devices/bus/nubus/pds30_30hr.cpp +++ b/src/devices/bus/nubus/pds30_30hr.cpp @@ -22,13 +22,6 @@ #define VRAM_SIZE (0x100000) // 1 MB VRAM - max mode is 1024x768 @ 8bpp -MACHINE_CONFIG_START( xceed30hr ) - MCFG_SCREEN_ADD( XCEED30HR_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceed30hr_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( xceed30hr ) ROM_REGION(0x8000, XCEED30HR_ROM_REGION, 0) @@ -43,14 +36,16 @@ DEFINE_DEVICE_TYPE(PDS030_XCEED30HR, nubus_xceed30hr_device, "pd3_30hr", "Micron //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_xceed30hr_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( xceed30hr ); -} +MACHINE_CONFIG_MEMBER( nubus_xceed30hr_device::device_add_mconfig ) + MCFG_SCREEN_ADD( XCEED30HR_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceed30hr_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_30hr.h b/src/devices/bus/nubus/pds30_30hr.h index 17800579cfc..7d80ad9a1ec 100644 --- a/src/devices/bus/nubus/pds30_30hr.h +++ b/src/devices/bus/nubus/pds30_30hr.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(xceed30hr_r); DECLARE_WRITE32_MEMBER(xceed30hr_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp index db977646fa0..ad035ba034c 100644 --- a/src/devices/bus/nubus/pds30_cb264.cpp +++ b/src/devices/bus/nubus/pds30_cb264.cpp @@ -15,13 +15,6 @@ #define VRAM_SIZE (0x200000) -MACHINE_CONFIG_START( cb264se30 ) - MCFG_SCREEN_ADD( CB264SE30_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264se30_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( cb264se30 ) ROM_REGION(0x8000, CB264SE30_ROM_REGION, 0) @@ -36,14 +29,16 @@ DEFINE_DEVICE_TYPE(PDS030_CB264SE30, nubus_cb264se30_device, "pd3_c264", "Raster //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_cb264se30_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( cb264se30 ); -} +MACHINE_CONFIG_MEMBER( nubus_cb264se30_device::device_add_mconfig ) + MCFG_SCREEN_ADD( CB264SE30_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264se30_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_cb264.h b/src/devices/bus/nubus/pds30_cb264.h index cf760ccb7fb..a87f3738a0b 100644 --- a/src/devices/bus/nubus/pds30_cb264.h +++ b/src/devices/bus/nubus/pds30_cb264.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_cb264se30_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(cb264se30_r); DECLARE_WRITE32_MEMBER(cb264se30_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp index 1a41be1c8be..0b3ca502b84 100644 --- a/src/devices/bus/nubus/pds30_mc30.cpp +++ b/src/devices/bus/nubus/pds30_mc30.cpp @@ -18,13 +18,6 @@ #define VRAM_SIZE (0x200000) // 16 42C4256 256Kx4 VRAMs on the board = 2MB -MACHINE_CONFIG_START( xceedmc30 ) - MCFG_SCREEN_ADD( XCEEDMC30_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceedmc30_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( xceedmc30 ) ROM_REGION(0x8000, XCEEDMC30_ROM_REGION, 0) @@ -39,14 +32,16 @@ DEFINE_DEVICE_TYPE(PDS030_XCEEDMC30, nubus_xceedmc30_device, "pd3_mclr", "Micron //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_xceedmc30_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( xceedmc30 ); -} +MACHINE_CONFIG_MEMBER( nubus_xceedmc30_device::device_add_mconfig ) + MCFG_SCREEN_ADD( XCEEDMC30_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceedmc30_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_mc30.h b/src/devices/bus/nubus/pds30_mc30.h index ddf27ce50bc..9f120889235 100644 --- a/src/devices/bus/nubus/pds30_mc30.h +++ b/src/devices/bus/nubus/pds30_mc30.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_xceedmc30_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(xceedmc30_r); DECLARE_WRITE32_MEMBER(xceedmc30_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp index bf019702c1c..366eb8eb1b3 100644 --- a/src/devices/bus/nubus/pds30_procolor816.cpp +++ b/src/devices/bus/nubus/pds30_procolor816.cpp @@ -21,13 +21,6 @@ #define VRAM_SIZE (0x200000) // 2 megs? -MACHINE_CONFIG_START( procolor816 ) - MCFG_SCREEN_ADD( PROCOLOR816_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_procolor816_device, screen_update) - MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) - MCFG_SCREEN_SIZE(1024,768) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) -MACHINE_CONFIG_END ROM_START( procolor816 ) ROM_REGION(0x8000, PROCOLOR816_ROM_REGION, 0) @@ -42,14 +35,16 @@ DEFINE_DEVICE_TYPE(PDS030_PROCOLOR816, nubus_procolor816_device, "pd3_pc16", "La //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_procolor816_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( procolor816 ); -} +MACHINE_CONFIG_MEMBER( nubus_procolor816_device::device_add_mconfig ) + MCFG_SCREEN_ADD( PROCOLOR816_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_procolor816_device, screen_update) + MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480) + MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_procolor816.h b/src/devices/bus/nubus/pds30_procolor816.h index e7145127ef8..69c0c59e40a 100644 --- a/src/devices/bus/nubus/pds30_procolor816.h +++ b/src/devices/bus/nubus/pds30_procolor816.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_procolor816_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(procolor816_r); DECLARE_WRITE32_MEMBER(procolor816_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_mode, m_vbl_disable, m_toggle; diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp index e16edb958e7..e2dd87b0267 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.cpp +++ b/src/devices/bus/nubus/pds30_sigmalview.cpp @@ -15,13 +15,6 @@ #define VRAM_SIZE (0x80000) // 512K? -MACHINE_CONFIG_START( lview ) - MCFG_SCREEN_ADD( LVIEW_SCREEN_NAME, RASTER) - MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_lview_device, screen_update) - MCFG_SCREEN_SIZE(832,600) - MCFG_SCREEN_REFRESH_RATE(70) - MCFG_SCREEN_VISIBLE_AREA(0, 832-1, 0, 600-1) -MACHINE_CONFIG_END ROM_START( lview ) ROM_REGION(0x4000, LVIEW_ROM_REGION, 0) @@ -36,14 +29,16 @@ DEFINE_DEVICE_TYPE(PDS030_LVIEW, nubus_lview_device, "pd3_lviw", "Sigma Designs //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor nubus_lview_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( lview ); -} +MACHINE_CONFIG_MEMBER( nubus_lview_device::device_add_mconfig ) + MCFG_SCREEN_ADD( LVIEW_SCREEN_NAME, RASTER) + MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_lview_device, screen_update) + MCFG_SCREEN_SIZE(832,600) + MCFG_SCREEN_REFRESH_RATE(70) + MCFG_SCREEN_VISIBLE_AREA(0, 832-1, 0, 600-1) +MACHINE_CONFIG_END //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/nubus/pds30_sigmalview.h b/src/devices/bus/nubus/pds30_sigmalview.h index 9dd6bf522da..26fe4f02348 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.h +++ b/src/devices/bus/nubus/pds30_sigmalview.h @@ -22,12 +22,6 @@ public: // construction/destruction nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - protected: nubus_lview_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -36,11 +30,18 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: DECLARE_READ32_MEMBER(lview_r); DECLARE_WRITE32_MEMBER(lview_w); DECLARE_READ32_MEMBER(vram_r); DECLARE_WRITE32_MEMBER(vram_w); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + std::vector m_vram; uint32_t *m_vram32; uint32_t m_vbl_disable, m_toggle; diff --git a/src/devices/bus/odyssey2/chess.cpp b/src/devices/bus/odyssey2/chess.cpp index 927208a1d71..b58abad2d31 100644 --- a/src/devices/bus/odyssey2/chess.cpp +++ b/src/devices/bus/odyssey2/chess.cpp @@ -29,10 +29,6 @@ o2_chess_device::o2_chess_device(const machine_config &mconfig, const char *tag, } -//------------------------------------------------- -// MACHINE_CONFIG_START( o2chess ) -//------------------------------------------------- - static ADDRESS_MAP_START(chess_mem, AS_PROGRAM, 8, o2_chess_device) AM_RANGE(0x0000, 0x07ff) AM_READ(read_rom04) ADDRESS_MAP_END @@ -42,19 +38,13 @@ static ADDRESS_MAP_START(chess_io, AS_IO, 8, o2_chess_device) ADDRESS_MAP_GLOBAL_MASK(0xff) ADDRESS_MAP_END -static MACHINE_CONFIG_START( o2chess ) - MCFG_CPU_ADD("subcpu", NSC800, XTAL_4MHz) - MCFG_CPU_PROGRAM_MAP(chess_mem) - MCFG_CPU_IO_MAP(chess_io) -MACHINE_CONFIG_END - //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor o2_chess_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( o2chess ); -} +MACHINE_CONFIG_MEMBER( o2_chess_device::device_add_mconfig ) + MCFG_CPU_ADD("subcpu", NSC800, XTAL_4MHz) + MCFG_CPU_PROGRAM_MAP(chess_mem) + MCFG_CPU_IO_MAP(chess_io) +MACHINE_CONFIG_END diff --git a/src/devices/bus/odyssey2/chess.h b/src/devices/bus/odyssey2/chess.h index 9e5275b4214..0ea9262384d 100644 --- a/src/devices/bus/odyssey2/chess.h +++ b/src/devices/bus/odyssey2/chess.h @@ -18,7 +18,8 @@ public: // construction/destruction o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; +protected: + virtual void device_add_mconfig(machine_config &config) override; // virtual const rom_entry *device_rom_region() const; private: diff --git a/src/devices/bus/odyssey2/voice.cpp b/src/devices/bus/odyssey2/voice.cpp index 5723f986d4c..79e82a20fe5 100644 --- a/src/devices/bus/odyssey2/voice.cpp +++ b/src/devices/bus/odyssey2/voice.cpp @@ -38,11 +38,12 @@ void o2_voice_device::device_start() save_item(NAME(m_lrq_state)); } + //------------------------------------------------- -// MACHINE_CONFIG_START( sub_slot ) +// device_add_mconfig - add device configuration //------------------------------------------------- -static MACHINE_CONFIG_START( o2voice ) +MACHINE_CONFIG_MEMBER( o2_voice_device::device_add_mconfig ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("sp0256_speech", SP0256, 3120000) @@ -54,17 +55,6 @@ static MACHINE_CONFIG_START( o2voice ) MACHINE_CONFIG_END -//------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor o2_voice_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( o2voice ); -} - - ROM_START( o2voice ) ROM_REGION( 0x10000, "sp0256_speech", 0 ) // SP0256B-019 Speech chip w/2KiB mask rom diff --git a/src/devices/bus/odyssey2/voice.h b/src/devices/bus/odyssey2/voice.h index 42550739843..a8c55fb5fe5 100644 --- a/src/devices/bus/odyssey2/voice.h +++ b/src/devices/bus/odyssey2/voice.h @@ -18,16 +18,12 @@ public: // construction/destruction o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual machine_config_constructor device_mconfig_additions() const override; - virtual const tiny_rom_entry *device_rom_region() const override; - // reading and writing virtual DECLARE_READ8_MEMBER(read_rom04) override { if (m_subslot->exists()) return m_subslot->read_rom04(space, offset); else return 0xff; } virtual DECLARE_READ8_MEMBER(read_rom0c) override { if (m_subslot->exists()) return m_subslot->read_rom0c(space, offset); else return 0xff; } virtual void write_bank(int bank) override { if (m_subslot->exists()) m_subslot->write_bank(bank); } - DECLARE_WRITE_LINE_MEMBER(lrq_callback); virtual DECLARE_WRITE8_MEMBER(io_write) override; virtual DECLARE_READ_LINE_MEMBER(t0_read) override { return m_speech->lrq_r() ? 0 : 1; } @@ -36,7 +32,12 @@ protected: virtual void device_start() override; virtual void device_reset() override { } + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + private: + DECLARE_WRITE_LINE_MEMBER(lrq_callback); + required_device m_speech; required_device m_subslot; diff --git a/src/devices/bus/oricext/jasmin.cpp b/src/devices/bus/oricext/jasmin.cpp index f9a98ae31e7..23b79cf4290 100644 --- a/src/devices/bus/oricext/jasmin.cpp +++ b/src/devices/bus/oricext/jasmin.cpp @@ -19,16 +19,6 @@ static SLOT_INTERFACE_START( jasmin_floppies ) SLOT_INTERFACE( "3dsdd", FLOPPY_3_DSDD ) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( jasmin ) - MCFG_WD1770_ADD("fdc", XTAL_8MHz) - MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(oricext_device, irq_w)) - - MCFG_FLOPPY_DRIVE_ADD("fdc:0", jasmin_floppies, "3dsdd", jasmin_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:1", jasmin_floppies, nullptr, jasmin_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:2", jasmin_floppies, nullptr, jasmin_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:3", jasmin_floppies, nullptr, jasmin_device::floppy_formats) -MACHINE_CONFIG_END - INPUT_PORTS_START( jasmin ) PORT_START("JASMIN") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Boot") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHANGED_MEMBER(DEVICE_SELF, jasmin_device, boot_pressed, nullptr) @@ -80,10 +70,15 @@ const tiny_rom_entry *jasmin_device::device_rom_region() const return ROM_NAME( jasmin ); } -machine_config_constructor jasmin_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( jasmin ); -} +MACHINE_CONFIG_MEMBER( jasmin_device::device_add_mconfig ) + MCFG_WD1770_ADD("fdc", XTAL_8MHz) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(oricext_device, irq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", jasmin_floppies, "3dsdd", jasmin_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", jasmin_floppies, nullptr, jasmin_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", jasmin_floppies, nullptr, jasmin_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", jasmin_floppies, nullptr, jasmin_device::floppy_formats) +MACHINE_CONFIG_END ioport_constructor jasmin_device::device_input_ports() const { diff --git a/src/devices/bus/oricext/jasmin.h b/src/devices/bus/oricext/jasmin.h index dc1dd9456ed..40a81d7e7e2 100644 --- a/src/devices/bus/oricext/jasmin.h +++ b/src/devices/bus/oricext/jasmin.h @@ -17,7 +17,6 @@ public: jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~jasmin_device(); - DECLARE_FLOPPY_FORMATS(floppy_formats); DECLARE_ADDRESS_MAP(map, 8); DECLARE_INPUT_CHANGED_MEMBER(boot_pressed); DECLARE_WRITE8_MEMBER(side_sel_w); @@ -30,11 +29,13 @@ protected: virtual void device_start() override; virtual void device_reset() override; const tiny_rom_entry *device_rom_region() const override; - machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; void remap(); + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device fdc; bool side_sel, fdc_reset, ram_access, rom_access, select[4]; diff --git a/src/devices/bus/oricext/microdisc.cpp b/src/devices/bus/oricext/microdisc.cpp index f2a22b815a8..e42172521b9 100644 --- a/src/devices/bus/oricext/microdisc.cpp +++ b/src/devices/bus/oricext/microdisc.cpp @@ -19,19 +19,6 @@ static SLOT_INTERFACE_START( microdisc_floppies ) SLOT_INTERFACE( "3dsdd", FLOPPY_3_DSDD ) SLOT_INTERFACE_END -static MACHINE_CONFIG_START( microdisc ) - MCFG_FD1793_ADD("fdc", XTAL_8MHz/8) - MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(microdisc_device, fdc_irq_w)) - MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(microdisc_device, fdc_drq_w)) - MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(microdisc_device, fdc_hld_w)) - MCFG_WD_FDC_FORCE_READY - - MCFG_FLOPPY_DRIVE_ADD("fdc:0", microdisc_floppies, "3dsdd", microdisc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:1", microdisc_floppies, nullptr, microdisc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:2", microdisc_floppies, nullptr, microdisc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:3", microdisc_floppies, nullptr, microdisc_device::floppy_formats) -MACHINE_CONFIG_END - DEVICE_ADDRESS_MAP_START(map, 8, microdisc_device) AM_RANGE(0x310, 0x313) AM_DEVREADWRITE("fdc", fd1793_device, read, write) AM_RANGE(0x314, 0x314) AM_READWRITE(port_314_r, port_314_w) @@ -79,10 +66,18 @@ const tiny_rom_entry *microdisc_device::device_rom_region() const return ROM_NAME( microdisc ); } -machine_config_constructor microdisc_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( microdisc ); -} +MACHINE_CONFIG_MEMBER( microdisc_device::device_add_mconfig ) + MCFG_FD1793_ADD("fdc", XTAL_8MHz/8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(microdisc_device, fdc_irq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(microdisc_device, fdc_drq_w)) + MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(microdisc_device, fdc_hld_w)) + MCFG_WD_FDC_FORCE_READY + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", microdisc_floppies, "3dsdd", microdisc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", microdisc_floppies, nullptr, microdisc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", microdisc_floppies, nullptr, microdisc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", microdisc_floppies, nullptr, microdisc_device::floppy_formats) +MACHINE_CONFIG_END void microdisc_device::remap() { diff --git a/src/devices/bus/oricext/microdisc.h b/src/devices/bus/oricext/microdisc.h index 18980a7f167..aa4ca9a50ba 100644 --- a/src/devices/bus/oricext/microdisc.h +++ b/src/devices/bus/oricext/microdisc.h @@ -15,16 +15,11 @@ public: microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~microdisc_device(); - DECLARE_FLOPPY_FORMATS(floppy_formats); DECLARE_ADDRESS_MAP(map, 8); DECLARE_WRITE8_MEMBER(port_314_w); DECLARE_READ8_MEMBER(port_314_r); DECLARE_READ8_MEMBER(port_318_r); - DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); - DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); - DECLARE_WRITE_LINE_MEMBER(fdc_hld_w); - protected: enum { P_IRQEN = 0x01, @@ -46,9 +41,16 @@ protected: virtual void device_start() override; virtual void device_reset() override; const tiny_rom_entry *device_rom_region() const override; - machine_config_constructor device_mconfig_additions() const override; + virtual void device_add_mconfig(machine_config &config) override; void remap(); + +private: + DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); + DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); + DECLARE_WRITE_LINE_MEMBER(fdc_hld_w); + + DECLARE_FLOPPY_FORMATS(floppy_formats); }; #endif // MAME_BUS_ORICEXT_MICRODISC_H -- cgit v1.2.3