diff --git a/src/mame/drivers/apexc.cpp b/src/mame/drivers/apexc.cpp index 95943110748..d66722167e5 100644 --- a/src/mame/drivers/apexc.cpp +++ b/src/mame/drivers/apexc.cpp @@ -366,13 +366,13 @@ MACHINE_CONFIG_START(apexc_state::apexc) MCFG_APEXC_TAPE_PUNCH_CB(WRITE8(*this, apexc_state, tape_write)) /* video hardware does not exist, but we display a control panel and the typewriter output */ - device = &SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ m_screen->set_size(256, 192); m_screen->set_visarea(0, 256-1, 0, 192-1); m_screen->set_palette(m_palette); - MCFG_SCREEN_UPDATE_DRIVER(apexc_state, screen_update_apexc) + m_screen->set_screen_update(FUNC(apexc_state::screen_update_apexc)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_apexc); diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp index ef70a6f3f7a..0d207317bdf 100644 --- a/src/mame/drivers/boogwing.cpp +++ b/src/mame/drivers/boogwing.cpp @@ -401,7 +401,7 @@ MACHINE_CONFIG_START(boogwing_state::boogwing) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO104_ADD("ioprot") + MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp index cd8101cac17..1384308e5f1 100644 --- a/src/mame/drivers/cninja.cpp +++ b/src/mame/drivers/cninja.cpp @@ -856,7 +856,7 @@ MACHINE_CONFIG_START(cninja_state::cninja) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO104_ADD("ioprot") + MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) @@ -946,7 +946,7 @@ MACHINE_CONFIG_START(cninja_state::stoneage) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO104_ADD("ioprot") + MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp index 3b45298b954..9677b7328a6 100644 --- a/src/mame/drivers/cntsteer.cpp +++ b/src/mame/drivers/cntsteer.cpp @@ -44,8 +44,8 @@ class cntsteer_state : public driver_device { public: - cntsteer_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + cntsteer_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), @@ -55,7 +55,8 @@ public: m_subcpu(*this, "subcpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") { } + m_soundlatch(*this, "soundlatch") + { } /* memory pointers */ required_shared_ptr m_spriteram; @@ -959,7 +960,7 @@ MACHINE_CONFIG_START(cntsteer_state::cntsteer) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_GENERIC_LATCH_8_ADD("soundlatch") + GENERIC_LATCH_8(config, m_soundlatch); MCFG_DEVICE_ADD("ay1", AY8910, 1500000) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("dac", dac_byte_interface, data_w)) diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index c1121bb4b47..e07d0b9303a 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -86,8 +86,8 @@ Notes: class dblewing_state : public driver_device { public: - dblewing_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + dblewing_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_pf1_rowscroll(*this, "pf1_rowscroll"), m_pf2_rowscroll(*this, "pf2_rowscroll"), m_spriteram(*this, "spriteram"), diff --git a/src/mame/drivers/prof80.cpp b/src/mame/drivers/prof80.cpp index 5e805dc524e..2ed8d80a146 100644 --- a/src/mame/drivers/prof80.cpp +++ b/src/mame/drivers/prof80.cpp @@ -454,7 +454,7 @@ MACHINE_CONFIG_START(prof80_state::prof80) MCFG_DEVICE_IO_MAP(prof80_io) // MMU - MCFG_PROF80_MMU_ADD(MMU_TAG, prof80_mmu) + MCFG_PROF80_MMU_ADD(m_mmu, prof80_mmu) // RTC MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, NOOP) @@ -467,7 +467,7 @@ MACHINE_CONFIG_START(prof80_state::prof80) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":3", prof80_floppies, nullptr, floppy_image_device::default_floppy_formats) // DEMUX latches - MCFG_DEVICE_ADD(FLR_A_TAG, LS259, 0) + MCFG_DEVICE_ADD(m_flra, LS259, 0) MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, data_in_w)) // TDI MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(UPD1990A_TAG, upd1990a_device, c0_w)) // C0 MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, c1_w)) // C1 @@ -477,15 +477,15 @@ MACHINE_CONFIG_START(prof80_state::prof80) MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, prof80_state, inuse_w)) // IN USE MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, prof80_state, motor_w)) // _MOTOR MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, prof80_state, select_w)) // SELECT - MCFG_DEVICE_ADD(FLR_B_TAG, LS259, 0) + MCFG_DEVICE_ADD(m_flrb, LS259, 0) MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, prof80_state, resf_w)) // RESF MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, prof80_state, mini_w)) // MINI - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(RS232_A_TAG, rs232_port_device, write_rts)) // _RTS - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(RS232_A_TAG, rs232_port_device, write_txd)) // TX + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_rs232a, rs232_port_device, write_rts)) // _RTS + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(m_rs232a, rs232_port_device, write_txd)) // TX MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, prof80_state, mstop_w)) // _MSTOP - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(RS232_B_TAG, rs232_port_device, write_txd)) // TXP + MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(m_rs232b, rs232_port_device, write_txd)) // TXP MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(UPD1990A_TAG, upd1990a_device, stb_w)) // TSTB - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(MMU_TAG, prof80_mmu_device, mme_w)) // MME + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_mmu, prof80_mmu_device, mme_w)) // MME // ECB bus MCFG_ECBBUS_ADD() @@ -496,8 +496,8 @@ MACHINE_CONFIG_START(prof80_state::prof80) MCFG_ECBBUS_SLOT_ADD(5, "ecb_5", ecbbus_cards, nullptr) // V24 - MCFG_DEVICE_ADD(RS232_A_TAG, RS232_PORT, default_rs232_devices, nullptr) - MCFG_DEVICE_ADD(RS232_B_TAG, RS232_PORT, default_rs232_devices, nullptr) + MCFG_DEVICE_ADD(m_rs232a, RS232_PORT, default_rs232_devices, nullptr) + MCFG_DEVICE_ADD(m_rs232b, RS232_PORT, default_rs232_devices, nullptr) // internal ram MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h index 1c78b79f80d..da7d5d0f8b4 100644 --- a/src/mame/includes/dec8.h +++ b/src/mame/includes/dec8.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Bryan McPhail +#ifndef MAME_INCLUDES_DEC8_H +#define MAME_INCLUDES_DEC8_H + +#pragma once + #include "machine/gen_latch.h" #include "machine/input_merger.h" #include "sound/msm5205.h" @@ -18,8 +23,8 @@ public: TIMER_DEC8_M6502 }; - dec8_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + dec8_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub"), m_audiocpu(*this, "audiocpu"), @@ -37,7 +42,8 @@ public: m_bg_data(*this, "bg_data"), m_mainbank(*this, "mainbank"), m_soundbank(*this, "soundbank"), - m_coin_port(*this, "I8751") { } + m_coin_port(*this, "I8751") + { } /* devices */ required_device m_maincpu; @@ -215,3 +221,5 @@ private: /* ports */ optional_ioport m_coin_port; }; + +#endif // MAME_INCLUDES_DEC8_H diff --git a/src/mame/includes/prof80.h b/src/mame/includes/prof80.h index c3d776d9f45..b345a646994 100644 --- a/src/mame/includes/prof80.h +++ b/src/mame/includes/prof80.h @@ -1,10 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Curt Coder -#pragma once - #ifndef MAME_INCLUDES_PROF80_H #define MAME_INCLUDES_PROF80_H +#pragma once + #include "bus/ecbbus/ecbbus.h" #include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" @@ -17,13 +17,8 @@ #include "machine/upd765.h" #define Z80_TAG "z1" -#define MMU_TAG "mmu" #define UPD765_TAG "z38" #define UPD1990A_TAG "z43" -#define RS232_A_TAG "rs232a" -#define RS232_B_TAG "rs232b" -#define FLR_A_TAG "z44" -#define FLR_B_TAG "z45" // ------------------------------------------------------------------------ @@ -37,22 +32,22 @@ class prof80_state : public driver_device { public: prof80_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, Z80_TAG), - m_mmu(*this, MMU_TAG), - m_rtc(*this, UPD1990A_TAG), - m_fdc(*this, UPD765_TAG), - m_ram(*this, RAM_TAG), - m_floppy0(*this, UPD765_TAG":0"), - m_floppy1(*this, UPD765_TAG":1"), - m_ecb(*this, ECBBUS_TAG), - m_rs232a(*this, RS232_A_TAG), - m_rs232b(*this, RS232_B_TAG), - m_flra(*this, FLR_A_TAG), - m_flrb(*this, FLR_B_TAG), - m_rom(*this, Z80_TAG), - m_j4(*this, "J4"), - m_j5(*this, "J5") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, Z80_TAG) + , m_mmu(*this, "mmu") + , m_rtc(*this, UPD1990A_TAG) + , m_fdc(*this, UPD765_TAG) + , m_ram(*this, RAM_TAG) + , m_floppy0(*this, UPD765_TAG":0") + , m_floppy1(*this, UPD765_TAG":1") + , m_ecb(*this, ECBBUS_TAG) + , m_rs232a(*this, "rs232a") + , m_rs232b(*this, "rs232b") + , m_flra(*this, "z44") + , m_flrb(*this, "z45") + , m_rom(*this, Z80_TAG) + , m_j4(*this, "J4") + , m_j5(*this, "J5") { } required_device m_maincpu; diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp index c306996a1c5..4aa055f76e9 100644 --- a/src/mame/machine/deco146.cpp +++ b/src/mame/machine/deco146.cpp @@ -1439,7 +1439,7 @@ deco146_device::deco146_device(const machine_config &mconfig, const char *tag, d { m_bankswitch_swap_read_address = 0x78; m_magic_read_address_xor = 0x44a; - m_magic_read_address_xor_enabled = 0; + m_magic_read_address_xor_enabled = false; m_xor_port = 0x2c; m_mask_port = 0x36; m_soundlatch_port = 0x64; diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index ebd75b86ac3..991f59f3d46 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -28,10 +28,10 @@ downcast(*device).set_interface_scramble(0,1,2,3,4,5,6,7,8,9); #define MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE \ - downcast(*device).set_interface_scramble(4,5,3,6,2,7,1,8,0,9 ); + downcast(*device).set_interface_scramble_interleave(); #define MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR \ - downcast(*device).set_use_magic_read_address_xor(1); + downcast(*device).set_use_magic_read_address_xor(true); @@ -98,7 +98,8 @@ public: m_external_addrswap[1] = a1; m_external_addrswap[0] = a0; } - void set_use_magic_read_address_xor(int use_xor) { m_magic_read_address_xor_enabled = use_xor; } + void set_interface_scramble_interleave() { set_interface_scramble(4, 5, 3, 6, 2, 7, 1, 8, 0, 9); } + void set_use_magic_read_address_xor(bool use_xor) { m_magic_read_address_xor_enabled = use_xor; } template devcb_base &set_soundlatch_irq_callback(Object &&cb) { return m_soundlatch_irq_cb.set_callback(std::forward(cb)); } @@ -110,7 +111,7 @@ public: uint8_t m_bankswitch_swap_read_address; uint16_t m_magic_read_address_xor; - int m_magic_read_address_xor_enabled; + bool m_magic_read_address_xor_enabled; uint8_t m_xor_port; uint8_t m_mask_port; uint8_t m_soundlatch_port;