diff options
author | wilbertpol <wilbertpol@users.noreply.github.com> | 2018-05-20 19:27:20 +0200 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2018-05-20 13:27:20 -0400 |
commit | 2beba4ce73fad917c7159a39939bace54f76494b (patch) | |
tree | e9d33c059bc5045f13d0c1748f0a044650370b8d /src/mame/includes/tmc1800.h | |
parent | acf93837ac21b2b0bb003d1649b893200c269812 (diff) |
Replace set_led_value and set_lamp_value with output_finders. [Wilbe… (#3592)
* Replace set_led_value and set_lamp_value with output_finders. [Wilbert Pol]
* segaufo: keep the 2 bit lamp outputs
Diffstat (limited to 'src/mame/includes/tmc1800.h')
-rw-r--r-- | src/mame/includes/tmc1800.h | 117 |
1 files changed, 63 insertions, 54 deletions
diff --git a/src/mame/includes/tmc1800.h b/src/mame/includes/tmc1800.h index eb46a663523..7fabc43512c 100644 --- a/src/mame/includes/tmc1800.h +++ b/src/mame/includes/tmc1800.h @@ -26,24 +26,24 @@ class tmc1800_base_state : public driver_device { public: tmc1800_base_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, CDP1802_TAG), - m_cassette(*this, "cassette"), - m_rom(*this, CDP1802_TAG), - m_run(*this, "RUN"), - m_ram(*this, RAM_TAG), - m_beeper(*this, "beeper") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, CDP1802_TAG) + , m_cassette(*this, "cassette") + , m_rom(*this, CDP1802_TAG) + , m_run(*this, "RUN") + , m_ram(*this, RAM_TAG) + , m_beeper(*this, "beeper") { } + DECLARE_QUICKLOAD_LOAD_MEMBER( tmc1800 ); +protected: required_device<cpu_device> m_maincpu; required_device<cassette_image_device> m_cassette; required_memory_region m_rom; required_ioport m_run; required_device<ram_device> m_ram; optional_device<beep_device> m_beeper; - - DECLARE_QUICKLOAD_LOAD_MEMBER( tmc1800 ); }; class tmc1800_state : public tmc1800_base_state @@ -55,15 +55,10 @@ public: }; tmc1800_state(const machine_config &mconfig, device_type type, const char *tag) - : tmc1800_base_state(mconfig, type, tag), - m_vdc(*this, CDP1861_TAG) + : tmc1800_base_state(mconfig, type, tag) + , m_vdc(*this, CDP1861_TAG) { } - required_device<cdp1861_device> m_vdc; - - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_READ8_MEMBER( dispon_r ); DECLARE_WRITE8_MEMBER( dispoff_w ); @@ -72,16 +67,21 @@ public: DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_WRITE_LINE_MEMBER( q_w ); - /* keyboard state */ - int m_keylatch; /* key latch */ void init_tmc1800(); void tmc1800(machine_config &config); void tmc1800_video(machine_config &config); void tmc1800_io_map(address_map &map); void tmc1800_map(address_map &map); + protected: + virtual void machine_start() override; + virtual void machine_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + required_device<cdp1861_device> m_vdc; + /* keyboard state */ + int m_keylatch; /* key latch */ }; class osc1000b_state : public tmc1800_base_state @@ -92,9 +92,6 @@ public: { } - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER( keylatch_w ); @@ -103,31 +100,30 @@ public: DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_WRITE_LINE_MEMBER( q_w ); - /* keyboard state */ - int m_keylatch; void osc1000b(machine_config &config); void osc1000b_video(machine_config &config); void osc1000b_io_map(address_map &map); void osc1000b_map(address_map &map); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + /* keyboard state */ + int m_keylatch; }; class tmc2000_state : public tmc1800_base_state { public: tmc2000_state(const machine_config &mconfig, device_type type, const char *tag) - : tmc1800_base_state(mconfig, type, tag), - m_cti(*this, CDP1864_TAG), - m_colorram(*this, "color_ram"), - m_key_row(*this, {"Y0", "Y1", "Y2", "Y3", "Y4", "Y5", "Y6", "Y7"}) + : tmc1800_base_state(mconfig, type, tag) + , m_cti(*this, CDP1864_TAG) + , m_colorram(*this, "color_ram") + , m_key_row(*this, {"Y0", "Y1", "Y2", "Y3", "Y4", "Y5", "Y6", "Y7"}) + , m_led(*this, "led%u", 0U) { } - required_device<cdp1864_device> m_cti; - optional_shared_ptr<uint8_t> m_colorram; - required_ioport_array<8> m_key_row; - - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_WRITE8_MEMBER( bankswitch_w ); DECLARE_READ_LINE_MEMBER( clear_r ); @@ -142,6 +138,20 @@ public: void bankswitch(); + void tmc2000(machine_config &config); + void tmc2000_video(machine_config &config); + void tmc2000_io_map(address_map &map); + void tmc2000_map(address_map &map); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device<cdp1864_device> m_cti; + optional_shared_ptr<uint8_t> m_colorram; + required_ioport_array<8> m_key_row; + output_finder<2> m_led; + // memory int m_rac; int m_roc; @@ -151,32 +161,20 @@ public: /* keyboard state */ int m_keylatch; - void tmc2000(machine_config &config); - void tmc2000_video(machine_config &config); - void tmc2000_io_map(address_map &map); - void tmc2000_map(address_map &map); }; class nano_state : public tmc1800_base_state { public: nano_state(const machine_config &mconfig, device_type type, const char *tag) - : tmc1800_base_state(mconfig, type, tag), - m_cti(*this, CDP1864_TAG), - m_ny0(*this, "NY0"), - m_ny1(*this, "NY1"), - m_monitor(*this, "MONITOR") + : tmc1800_base_state(mconfig, type, tag) + , m_cti(*this, CDP1864_TAG) + , m_ny0(*this, "NY0") + , m_ny1(*this, "NY1") + , m_monitor(*this, "MONITOR") + , m_led(*this, "led%u", 0U) { } - required_device<cdp1864_device> m_cti; - required_ioport m_ny0; - required_ioport m_ny1; - required_ioport m_monitor; - - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void machine_start() override; - virtual void machine_reset() override; - enum { TIMER_ID_EF4 @@ -191,12 +189,23 @@ public: DECLARE_INPUT_CHANGED_MEMBER( run_pressed ); DECLARE_INPUT_CHANGED_MEMBER( monitor_pressed ); - /* keyboard state */ - int m_keylatch; /* key latch */ void nano(machine_config &config); void nano_video(machine_config &config); void nano_io_map(address_map &map); void nano_map(address_map &map); + +protected: + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device<cdp1864_device> m_cti; + required_ioport m_ny0; + required_ioport m_ny1; + required_ioport m_monitor; + output_finder<2> m_led; + /* keyboard state */ + int m_keylatch; /* key latch */ }; #endif |