diff --git a/src/devices/machine/hd64610.h b/src/devices/machine/hd64610.h index 38ffd560f4d..0c3008c26da 100644 --- a/src/devices/machine/hd64610.h +++ b/src/devices/machine/hd64610.h @@ -28,25 +28,6 @@ #include "dirtc.h" - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_HD64610_OUT_IRQ_CB(_devcb) \ - downcast(*device).set_out_irq_callback(DEVCB_##_devcb); - -#define MCFG_HD64610_OUT_1HZ_CB(_devcb) \ - downcast(*device).set_out_1hz_callback(DEVCB_##_devcb); - - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> hd64610_device - class hd64610_device : public device_t, public device_rtc_interface, public device_nvram_interface @@ -55,8 +36,8 @@ public: // construction/destruction hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward(cb)); } - template devcb_base &set_out_1hz_callback(Object &&cb) { return m_out_1hz_cb.set_callback(std::forward(cb)); } + auto irq() { return m_out_irq_cb.bind(); } + auto clkout() { return m_out_1hz_cb.bind(); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -78,26 +59,23 @@ protected: virtual void nvram_write(emu_file &file) override; private: - inline void set_irq_line(); - inline uint8_t read_counter(int counter); - inline void write_counter(int counter, uint8_t value); - inline void check_alarm(); + void set_irq_line(); + uint8_t read_counter(int counter); + void write_counter(int counter, uint8_t value); + void check_alarm(); static const device_timer_id TIMER_UPDATE_COUNTER = 0; devcb_write_line m_out_irq_cb; devcb_write_line m_out_1hz_cb; - uint8_t m_regs[0x10]; // Internal registers - int m_hline_state; // H-Start/Stop line - int m_irq_out; // alarm output + uint8_t m_regs[0x10]; // Internal registers + int m_hline_state; // H-Start/Stop line + int m_irq_out; // alarm output - // timers emu_timer *m_counter_timer; }; - -// device type definition DECLARE_DEVICE_TYPE(HD64610, hd64610_device) #endif // MAME_MACHINE_HD64610_H diff --git a/src/devices/machine/hp_taco.h b/src/devices/machine/hp_taco.h index 42682aa76a4..bb20bd464d3 100644 --- a/src/devices/machine/hp_taco.h +++ b/src/devices/machine/hp_taco.h @@ -15,15 +15,6 @@ #include "formats/hti_tape.h" -#define MCFG_TACO_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - -#define MCFG_TACO_FLG_HANDLER(_devcb) \ - downcast(*device).set_flg_handler(DEVCB_##_devcb); - -#define MCFG_TACO_STS_HANDLER(_devcb) \ - downcast(*device).set_sts_handler(DEVCB_##_devcb); - class hp_taco_device : public device_t , public device_image_interface { @@ -32,9 +23,9 @@ public: hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } - template devcb_base &set_flg_handler(Object &&cb) { return m_flg_handler.set_callback(std::forward(cb)); } - template devcb_base &set_sts_handler(Object &&cb) { return m_sts_handler.set_callback(std::forward(cb)); } + auto irq() { return m_irq_handler.bind(); } + auto flg() { return m_flg_handler.bind(); } + auto sts() { return m_sts_handler.bind(); } // Register read/write DECLARE_WRITE16_MEMBER(reg_w); diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp index 11f1e305c25..f6e2e3fbf68 100644 --- a/src/mame/drivers/hp9845.cpp +++ b/src/mame/drivers/hp9845.cpp @@ -3763,14 +3763,14 @@ MACHINE_CONFIG_START(hp9845_base_state::hp9845_base) MCFG_TIMER_DRIVER_ADD("beep_timer" , hp9845_base_state , beeper_off); // Tape controller - MCFG_DEVICE_ADD("t15" , HP_TACO , 4000000) - MCFG_TACO_IRQ_HANDLER(WRITELINE(*this, hp9845_base_state , t15_irq_w)) - MCFG_TACO_FLG_HANDLER(WRITELINE(*this, hp9845_base_state , t15_flg_w)) - MCFG_TACO_STS_HANDLER(WRITELINE(*this, hp9845_base_state , t15_sts_w)) - MCFG_DEVICE_ADD("t14" , HP_TACO , 4000000) - MCFG_TACO_IRQ_HANDLER(WRITELINE(*this, hp9845_base_state , t14_irq_w)) - MCFG_TACO_FLG_HANDLER(WRITELINE(*this, hp9845_base_state , t14_flg_w)) - MCFG_TACO_STS_HANDLER(WRITELINE(*this, hp9845_base_state , t14_sts_w)) + hp_taco_device &t15(HP_TACO(config , "t15" , 4000000)); + t15.irq().set(FUNC(hp9845_base_state::t15_irq_w)); + t15.flg().set(FUNC(hp9845_base_state::t15_flg_w)); + t15.sts().set(FUNC(hp9845_base_state::t15_sts_w)); + hp_taco_device &t14(HP_TACO(config , "t14" , 4000000)); + t14.irq().set(FUNC(hp9845_base_state::t14_irq_w)); + t14.flg().set(FUNC(hp9845_base_state::t14_flg_w)); + t14.sts().set(FUNC(hp9845_base_state::t14_sts_w)); // In real machine there were 8 slots for LPU ROMs and 8 slots for PPU ROMs in // right-hand side and left-hand side drawers, respectively. diff --git a/src/mame/drivers/pda600.cpp b/src/mame/drivers/pda600.cpp index dc3cde6f2e9..f8097204e70 100644 --- a/src/mame/drivers/pda600.cpp +++ b/src/mame/drivers/pda600.cpp @@ -204,29 +204,30 @@ static GFXDECODE_START( gfx_pda600 ) GFXDECODE_END -MACHINE_CONFIG_START(pda600_state::pda600) +void pda600_state::pda600(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",Z180, XTAL(14'318'181)) - MCFG_DEVICE_PROGRAM_MAP(pda600_mem) - MCFG_DEVICE_IO_MAP(pda600_io) + Z180(config, m_maincpu, XTAL(14'318'181)); + m_maincpu->set_addrmap(AS_PROGRAM, &pda600_state::pda600_mem); + m_maincpu->set_addrmap(AS_IO, &pda600_state::pda600_io); /* video hardware */ - MCFG_SCREEN_ADD("screen", LCD) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_SIZE(240, 320) - MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 320-1) - MCFG_SCREEN_UPDATE_DRIVER( pda600_state, screen_update ) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(240, 320); + screen.set_visarea(0, 240-1, 0, 320-1); + screen.set_screen_update(FUNC(pda600_state::screen_update)); + screen.set_palette("palette"); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pda600) - MCFG_PALETTE_ADD_MONOCHROME("palette") + GFXDECODE(config, "gfxdecode", "palette", gfx_pda600); + PALETTE(config, "palette", 2).set_init("palette", FUNC(palette_device::palette_init_monochrome)); // NVRAM needs to be filled with random data to fail the checksum and be initialized correctly NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); - MCFG_DEVICE_ADD("rtc", HD64610, XTAL(32'768)) -MACHINE_CONFIG_END + HD64610(config, "rtc", XTAL(32'768)); +} /* ROM definition */ ROM_START( pda600 )