diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2019-01-21 22:09:05 +0100 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2019-01-21 22:09:05 +0100 |
commit | 869cf9337c53b779564431c5dcbde7974d7546fc (patch) | |
tree | 3b76aaf112e02432721287497015e007a74ad091 | |
parent | b8dfc7ea2318bc3a67a0b6b0d4eb565a8aaa15bd (diff) |
imagedev\printer: removed MCFG macro (nw)
-rw-r--r-- | src/devices/bus/centronics/printer.cpp | 9 | ||||
-rw-r--r-- | src/devices/bus/rs232/printer.cpp | 9 | ||||
-rw-r--r-- | src/devices/imagedev/printer.h | 4 | ||||
-rw-r--r-- | src/devices/machine/pla.h | 21 | ||||
-rw-r--r-- | src/mame/drivers/dragon.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/hec2hrp.cpp | 12 | ||||
-rw-r--r-- | src/mame/drivers/interact.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/mc10.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/vg5k.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/x07.cpp | 2 | ||||
-rw-r--r-- | src/mame/includes/hec2hrp.h | 8 |
11 files changed, 29 insertions, 48 deletions
diff --git a/src/devices/bus/centronics/printer.cpp b/src/devices/bus/centronics/printer.cpp index 129e53426f4..484e718d074 100644 --- a/src/devices/bus/centronics/printer.cpp +++ b/src/devices/bus/centronics/printer.cpp @@ -32,10 +32,11 @@ centronics_printer_device::centronics_printer_device(const machine_config &mconf //------------------------------------------------- -MACHINE_CONFIG_START(centronics_printer_device::device_add_mconfig) - MCFG_DEVICE_ADD("printer", PRINTER, 0) - MCFG_PRINTER_ONLINE_CB(WRITELINE(*this, centronics_printer_device, printer_online)) -MACHINE_CONFIG_END +void centronics_printer_device::device_add_mconfig(machine_config &config) +{ + PRINTER(config, m_printer, 0); + m_printer->online_callback().set(FUNC(centronics_printer_device::printer_online)); +} /*------------------------------------------------- printer_online - callback that diff --git a/src/devices/bus/rs232/printer.cpp b/src/devices/bus/rs232/printer.cpp index b8b1ec87d34..fb87c9ead79 100644 --- a/src/devices/bus/rs232/printer.cpp +++ b/src/devices/bus/rs232/printer.cpp @@ -16,10 +16,11 @@ serial_printer_device::serial_printer_device(const machine_config &mconfig, cons { } -MACHINE_CONFIG_START(serial_printer_device::device_add_mconfig) - MCFG_DEVICE_ADD("printer", PRINTER, 0) - MCFG_PRINTER_ONLINE_CB(WRITELINE(*this, serial_printer_device, printer_online)) -MACHINE_CONFIG_END +void serial_printer_device::device_add_mconfig(machine_config &config) +{ + PRINTER(config, m_printer, 0); + m_printer->online_callback().set(FUNC(serial_printer_device::printer_online)); +} static INPUT_PORTS_START(serial_printer) MCFG_RS232_BAUD("RS232_RXBAUD", RS232_BAUD_9600, "RX Baud", serial_printer_device, update_serial) diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h index 099d19cab9e..359faca8951 100644 --- a/src/devices/imagedev/printer.h +++ b/src/devices/imagedev/printer.h @@ -13,8 +13,6 @@ #pragma once -#define MCFG_PRINTER_ONLINE_CB(_devcb) \ - downcast<printer_image_device &>(*device).set_online_callback(DEVCB_##_devcb); /*************************************************************************** TYPE DEFINITIONS @@ -29,7 +27,7 @@ public: // construction/destruction printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_online_callback(Object &&cb) { return m_online_cb.set_callback(std::forward<Object>(cb)); } + auto online_callback() { return m_online_cb.bind(); } // image-level overrides virtual image_init_result call_load() override; diff --git a/src/devices/machine/pla.h b/src/devices/machine/pla.h index 7e4672b7860..b614a968b36 100644 --- a/src/devices/machine/pla.h +++ b/src/devices/machine/pla.h @@ -11,24 +11,6 @@ #pragma once -///************************************************************************* -// INTERFACE CONFIGURATION MACROS -///************************************************************************* - -#define MCFG_PLA_ADD(tag, inputs, outputs, terms) \ - MCFG_DEVICE_ADD((tag), PLA, 0) \ - downcast<pla_device &>(*device).set_num_inputs((inputs)); \ - downcast<pla_device &>(*device).set_num_outputs((outputs)); \ - downcast<pla_device &>(*device).set_num_terms((terms)); - -#define MCFG_PLA_INPUTMASK(mask) \ - downcast<pla_device &>(*device).set_inputmask((mask)); - -#define MCFG_PLA_FILEFORMAT(format) \ - downcast<pla_device &>(*device).set_format((pla_device::FMT::format)); - - -// macros for known (and used) devices // 82S100, 82S101, PLS100, PLS101 // 16x48x8 PLA, 28-pin: @@ -48,8 +30,7 @@ F4 13 | | 16 F2 GND 14 |_____________| 15 F3 */ -#define MCFG_PLS100_ADD(tag) \ - MCFG_DEVICE_ADD((tag), PLS100) + ///************************************************************************* // TYPE DEFINITIONS diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp index 71a8649f8b7..1a1c04141bf 100644 --- a/src/mame/drivers/dragon.cpp +++ b/src/mame/drivers/dragon.cpp @@ -221,7 +221,7 @@ MACHINE_CONFIG_START(dragon_state::dragon_base) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) MCFG_CASSETTE_INTERFACE("dragon_cass") - MCFG_DEVICE_ADD(PRINTER_TAG, PRINTER, 0) + PRINTER(config, m_printer, 0); // video hardware SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER); diff --git a/src/mame/drivers/hec2hrp.cpp b/src/mame/drivers/hec2hrp.cpp index bfa41800e1f..b1c7b4056d6 100644 --- a/src/mame/drivers/hec2hrp.cpp +++ b/src/mame/drivers/hec2hrp.cpp @@ -419,7 +419,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2hr) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END MACHINE_CONFIG_START(hec2hrp_state::hec2hrp) @@ -447,7 +447,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2hrp) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END static void hector_floppies(device_slot_interface &device) @@ -489,7 +489,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2mx40) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END @@ -527,7 +527,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2hrx) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END MACHINE_CONFIG_START(hec2hrp_state::hec2mdhrx) @@ -560,7 +560,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2mdhrx) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END @@ -598,7 +598,7 @@ MACHINE_CONFIG_START(hec2hrp_state::hec2mx80) MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END ROM_START( hec2hr ) diff --git a/src/mame/drivers/interact.cpp b/src/mame/drivers/interact.cpp index 9a199c37d5d..08516b1fc52 100644 --- a/src/mame/drivers/interact.cpp +++ b/src/mame/drivers/interact.cpp @@ -160,7 +160,7 @@ MACHINE_CONFIG_START(interact_state::interact) MCFG_SOFTWARE_LIST_ADD("cass_list","interact") /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END @@ -195,7 +195,7 @@ MACHINE_CONFIG_START(interact_state::hector1) MCFG_CASSETTE_INTERFACE("interact_cass") /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); MACHINE_CONFIG_END diff --git a/src/mame/drivers/mc10.cpp b/src/mame/drivers/mc10.cpp index a889e16281a..4484438b2f9 100644 --- a/src/mame/drivers/mc10.cpp +++ b/src/mame/drivers/mc10.cpp @@ -531,7 +531,7 @@ MACHINE_CONFIG_START(mc10_state::mc10) MCFG_CASSETTE_INTERFACE("mc10_cass") /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); /* internal ram */ RAM(config, m_ram).set_default_size("20K").set_extra_options("4K"); @@ -573,7 +573,7 @@ MACHINE_CONFIG_START(mc10_state::alice32) MCFG_CASSETTE_INTERFACE("mc10_cass") /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); /* internal ram */ RAM(config, m_ram).set_default_size("24K").set_extra_options("8K"); diff --git a/src/mame/drivers/vg5k.cpp b/src/mame/drivers/vg5k.cpp index c8932324251..69d02ca6ff7 100644 --- a/src/mame/drivers/vg5k.cpp +++ b/src/mame/drivers/vg5k.cpp @@ -406,7 +406,7 @@ MACHINE_CONFIG_START(vg5k_state::vg5k) MCFG_CASSETTE_INTERFACE("vg5k_cass") /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); /* internal ram */ RAM(config, RAM_TAG).set_default_size("16K").set_extra_options("32K,48K"); diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index 62df0f9eeeb..65034b74d1b 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -1504,7 +1504,7 @@ MACHINE_CONFIG_START(x07_state::x07) WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* printer */ - MCFG_DEVICE_ADD("printer", PRINTER, 0) + PRINTER(config, m_printer, 0); TIMER(config, "blink_timer").configure_periodic(FUNC(x07_state::blink_timer), attotime::from_msec(300)); diff --git a/src/mame/includes/hec2hrp.h b/src/mame/includes/hec2hrp.h index b96590ef949..ed1611f1d34 100644 --- a/src/mame/includes/hec2hrp.h +++ b/src/mame/includes/hec2hrp.h @@ -83,6 +83,7 @@ class hec2hrp_state : public driver_device public: hec2hrp_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_printer(*this, "printer"), m_maincpu(*this, "maincpu"), m_disc2cpu(*this, "disc2cpu"), m_cassette(*this, "cassette"), @@ -95,8 +96,7 @@ public: m_minidisc_fdc(*this, "wd179x"), m_floppy0(*this, "wd179x:0"), m_upd_fdc(*this, "upd765"), - m_upd_connector(*this, "upd765:%u", 0U), - m_printer(*this, "printer") + m_upd_connector(*this, "upd765:%u", 0U) {} void hec2mx80(machine_config &config); @@ -123,6 +123,8 @@ protected: DECLARE_WRITE8_MEMBER(color_a_w); DECLARE_WRITE8_MEMBER(color_b_w); + optional_device<printer_image_device> m_printer; + private: DECLARE_WRITE8_MEMBER(minidisc_control_w); @@ -162,8 +164,6 @@ private: optional_device<upd765a_device> m_upd_fdc; optional_device_array<floppy_connector, 2> m_upd_connector; - optional_device<printer_image_device> m_printer; - uint8_t m_hector_flag_hr; uint8_t m_hector_flag_80c; uint8_t m_hector_color[4]; |