summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/binbug.cpp
diff options
context:
space:
mode:
authorGravatarGravatar Robbbert <Robbbert@users.noreply.github.com>2017-02-14 15:53:07 +1100
committerGravatarGravatar Robbbert <Robbbert@users.noreply.github.com>2017-02-14 15:53:07 +1100
commit2654773c5f7cdcd5ae44d35c391a9972cad11121 (patch) (github)
tree4365ff504aa913475825a967c8f0e594b9d85542 /src/mame/drivers/binbug.cpp
parentff1c7e85fa20a2d21de80a3c22cdbbb8c1777c6a (diff)
downloadmame-2654773c5f7cdcd5ae44d35c391a9972cad11121.tar.bz2
mame-2654773c5f7cdcd5ae44d35c391a9972cad11121.zip
(nw) Finished converting m_p_chargen to required region, and associated cleanups.
Diffstat (limited to 'src/mame/drivers/binbug.cpp')
-rw-r--r--src/mame/drivers/binbug.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/mame/drivers/binbug.cpp b/src/mame/drivers/binbug.cpp
index 27dfc0405a0..63da0224639 100644
--- a/src/mame/drivers/binbug.cpp
+++ b/src/mame/drivers/binbug.cpp
@@ -61,28 +61,31 @@ class binbug_state : public driver_device
{
public:
binbug_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_rs232(*this, "keyboard"),
- m_cass(*this, "cassette"),
- m_p_videoram(*this, "videoram"),
- m_p_attribram(*this, "attribram"),
- m_maincpu(*this, "maincpu")
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_cass(*this, "cassette")
+ , m_p_videoram(*this, "videoram")
+ , m_p_attribram(*this, "attribram")
+ , m_p_chargen(*this, "chargen")
+ , m_rs232(*this, "keyboard")
{
}
DECLARE_WRITE8_MEMBER(binbug_ctrl_w);
DECLARE_READ8_MEMBER(binbug_serial_r);
DECLARE_WRITE_LINE_MEMBER(binbug_serial_w);
- const uint8_t *m_p_chargen;
- uint8_t m_framecnt;
- virtual void video_start() override;
+ DECLARE_QUICKLOAD_LOAD_MEMBER( binbug );
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- optional_device<rs232_port_device> m_rs232;
+ // needed by dg680 class
+ required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cass;
+
+private:
+ uint8_t m_framecnt;
required_shared_ptr<uint8_t> m_p_videoram;
required_shared_ptr<uint8_t> m_p_attribram;
- required_device<cpu_device> m_maincpu;
- DECLARE_QUICKLOAD_LOAD_MEMBER( binbug );
+ required_region_ptr<u8> m_p_chargen;
+ optional_device<rs232_port_device> m_rs232;
};
WRITE8_MEMBER( binbug_state::binbug_ctrl_w )
@@ -117,11 +120,6 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( binbug )
INPUT_PORTS_END
-void binbug_state::video_start()
-{
- m_p_chargen = memregion("chargen")->base();
-}
-
uint32_t binbug_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// attributes bit 0 = flash, bit 1 = lores. Also bit 7 of the character = reverse-video (text only).
@@ -408,11 +406,10 @@ class dg680_state : public binbug_state
{
public:
dg680_state(const machine_config &mconfig, device_type type, const char *tag)
- : binbug_state(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_ctc(*this, "z80ctc"),
- m_pio(*this, "z80pio")
- { }
+ : binbug_state(mconfig, type, tag)
+ , m_ctc(*this, "z80ctc")
+ , m_pio(*this, "z80pio")
+ { }
DECLARE_READ8_MEMBER(porta_r);
DECLARE_READ8_MEMBER(portb_r);
@@ -422,11 +419,12 @@ public:
DECLARE_WRITE8_MEMBER(kbd_put);
TIMER_DEVICE_CALLBACK_MEMBER(time_tick);
TIMER_DEVICE_CALLBACK_MEMBER(uart_tick);
+
+private:
uint8_t m_pio_b;
uint8_t m_term_data;
uint8_t m_protection[0x100];
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
required_device<z80ctc_device> m_ctc;
required_device<z80pio_device> m_pio;
};