trunk/src/mess/drivers/d6800.c
| r20562 | r20563 | |
| 51 | 51 | { |
| 52 | 52 | public: |
| 53 | 53 | 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 | { } |
| 60 | 70 | |
| 61 | 71 | DECLARE_READ8_MEMBER( d6800_cassette_r ); |
| 62 | 72 | DECLARE_WRITE8_MEMBER( d6800_cassette_w ); |
| r20562 | r20563 | |
| 66 | 76 | DECLARE_READ_LINE_MEMBER( d6800_keydown_r ); |
| 67 | 77 | DECLARE_READ_LINE_MEMBER( d6800_rtc_pulse ); |
| 68 | 78 | 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); |
| 81 | protected: |
| 71 | 82 | required_device<cpu_device> m_maincpu; |
| 72 | 83 | required_device<cassette_image_device> m_cass; |
| 73 | 84 | required_device<pia6821_device> m_pia; |
| 74 | 85 | required_device<dac_device> m_dac; |
| 75 | 86 | 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; |
| 76 | 96 | private: |
| 97 | UINT8 m_rtc; |
| 98 | bool m_screen_on; |
| 77 | 99 | UINT8 m_kbd_s; |
| 78 | 100 | UINT8 m_portb; |
| 79 | 101 | virtual void machine_start(); |
| 80 | 102 | virtual void machine_reset(); |
| 81 | | public: |
| 82 | | UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 83 | | TIMER_DEVICE_CALLBACK_MEMBER(d6800_p); |
| 84 | 103 | }; |
| 85 | 104 | |
| 86 | 105 | |
| r20562 | r20563 | |
| 198 | 217 | |
| 199 | 218 | READ_LINE_MEMBER( d6800_state::d6800_keydown_r ) |
| 200 | 219 | { |
| 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(); |
| 205 | 221 | |
| 206 | 222 | m_kbd_s = (data == 15) ? 0 : 1; |
| 207 | 223 | |
| r20562 | r20563 | |
| 210 | 226 | |
| 211 | 227 | READ_LINE_MEMBER( d6800_state::d6800_fn_key_r ) |
| 212 | 228 | { |
| 213 | | return ioport("SHIFT")->read(); |
| 229 | return m_io_shift->read(); |
| 214 | 230 | } |
| 215 | 231 | |
| 216 | 232 | WRITE_LINE_MEMBER( d6800_state::d6800_screen_w ) |
| r20562 | r20563 | |
| 254 | 270 | m_kbd_s++; |
| 255 | 271 | |
| 256 | 272 | 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(); |
| 258 | 274 | else |
| 259 | 275 | 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(); |
| 261 | 277 | else |
| 262 | 278 | return 0xff; |
| 263 | 279 | } |