Previous 199869 Revisions Next

r20563 Monday 28th January, 2013 at 00:18:49 UTC by Robbbert
(MESS) d6800 tags (nw)
[src/mess/drivers]d6800.c

trunk/src/mess/drivers/d6800.c
r20562r20563
5151{
5252public:
5353   d6800_state(const machine_config &mconfig, device_type type, const char *tag)
54      : driver_device(mconfig, type, tag),
55         m_maincpu(*this, "maincpu"),
56         m_cass(*this, CASSETTE_TAG),
57         m_pia(*this, "pia"),
58         m_dac(*this, "dac"),
59         m_videoram(*this, "videoram") { }
54      : driver_device(mconfig, type, tag)
55      , m_maincpu(*this, "maincpu")
56      , m_cass(*this, CASSETTE_TAG)
57      , m_pia(*this, "pia")
58      , m_dac(*this, "dac")
59      , m_videoram(*this, "videoram")
60      , m_io_x0(*this, "X0")
61      , m_io_x1(*this, "X1")
62      , m_io_x2(*this, "X2")
63      , m_io_x3(*this, "X3")
64      , m_io_y0(*this, "Y0")
65      , m_io_y1(*this, "Y1")
66      , m_io_y2(*this, "Y2")
67      , m_io_y3(*this, "Y3")
68      , m_io_shift(*this, "SHIFT")
69   { }
6070
6171   DECLARE_READ8_MEMBER( d6800_cassette_r );
6272   DECLARE_WRITE8_MEMBER( d6800_cassette_w );
r20562r20563
6676   DECLARE_READ_LINE_MEMBER( d6800_keydown_r );
6777   DECLARE_READ_LINE_MEMBER( d6800_rtc_pulse );
6878   DECLARE_WRITE_LINE_MEMBER( d6800_screen_w );
69   UINT8 m_rtc;
70   bool m_screen_on;
79   UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
80   TIMER_DEVICE_CALLBACK_MEMBER(d6800_p);
81protected:
7182   required_device<cpu_device> m_maincpu;
7283   required_device<cassette_image_device> m_cass;
7384   required_device<pia6821_device> m_pia;
7485   required_device<dac_device> m_dac;
7586   required_shared_ptr<UINT8> m_videoram;
87   required_ioport m_io_x0;
88   required_ioport m_io_x1;
89   required_ioport m_io_x2;
90   required_ioport m_io_x3;
91   required_ioport m_io_y0;
92   required_ioport m_io_y1;
93   required_ioport m_io_y2;
94   required_ioport m_io_y3;
95   required_ioport m_io_shift;
7696private:
97   UINT8 m_rtc;
98   bool m_screen_on;
7799   UINT8 m_kbd_s;
78100   UINT8 m_portb;
79101   virtual void machine_start();
80102   virtual void machine_reset();
81public:
82   UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
83   TIMER_DEVICE_CALLBACK_MEMBER(d6800_p);
84103};
85104
86105
r20562r20563
198217
199218READ_LINE_MEMBER( d6800_state::d6800_keydown_r )
200219{
201   UINT8 data = ioport("X0")->read()
202            & ioport("X1")->read()
203            & ioport("X2")->read()
204            & ioport("X3")->read();
220   UINT8 data = m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read();
205221
206222   m_kbd_s = (data == 15) ? 0 : 1;
207223
r20562r20563
210226
211227READ_LINE_MEMBER( d6800_state::d6800_fn_key_r )
212228{
213   return ioport("SHIFT")->read();
229   return m_io_shift->read();
214230}
215231
216232WRITE_LINE_MEMBER( d6800_state::d6800_screen_w )
r20562r20563
254270   m_kbd_s++;
255271
256272   if (m_kbd_s == 3)
257      return 0x0f & ioport("X0")->read() & ioport("X1")->read() & ioport("X2")->read() & ioport("X3")->read();
273      return 0x0f & m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read();
258274   else
259275   if (m_kbd_s == 6)
260      return 0xf0 & ioport("Y0")->read() & ioport("Y1")->read() & ioport("Y2")->read() & ioport("Y3")->read();
276      return 0xf0 & m_io_y0->read() & m_io_y1->read() & m_io_y2->read() & m_io_y3->read();
261277   else
262278      return 0xff;
263279}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team