trunk/src/mess/machine/irisha.c
| r20818 | r20819 | |
| 26 | 26 | |
| 27 | 27 | void irisha_state::machine_start() |
| 28 | 28 | { |
| 29 | static const char *const keynames[] = { |
| 30 | "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", |
| 31 | "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" |
| 32 | }; |
| 33 | |
| 34 | for ( int i = 0; i < 10; i++ ) |
| 35 | { |
| 36 | m_io_ports[i] = ioport( keynames[i] ); |
| 37 | } |
| 38 | |
| 29 | 39 | machine().scheduler().timer_pulse(attotime::from_msec(30), timer_expired_delegate(FUNC(irisha_state::irisha_key),this)); |
| 30 | 40 | } |
| 31 | 41 | |
| r20818 | r20819 | |
| 41 | 51 | speaker_level_w(m_speaker, level); |
| 42 | 52 | } |
| 43 | 53 | |
| 44 | | static const char *const keynames[] = { |
| 45 | | "LINE0", "LINE1", "LINE2", "LINE3", |
| 46 | | "LINE4", "LINE5", "LINE6", "LINE7", |
| 47 | | "LINE8", "LINE9" |
| 48 | | }; |
| 49 | 54 | |
| 50 | 55 | READ8_MEMBER(irisha_state::irisha_8255_portb_r) |
| 51 | 56 | { |
| r20818 | r20819 | |
| 67 | 72 | { |
| 68 | 73 | UINT8 keycode; |
| 69 | 74 | if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) { |
| 70 | | keycode = ioport(keynames[m_keyboard_cnt-1])->read() ^ 0xff; |
| 75 | keycode = m_io_ports[m_keyboard_cnt-1]->read() ^ 0xff; |
| 71 | 76 | } else { |
| 72 | 77 | keycode = 0xff; |
| 73 | 78 | } |
| r20818 | r20819 | |
| 119 | 124 | |
| 120 | 125 | WRITE_LINE_MEMBER(irisha_state::irisha_pic_set_int_line) |
| 121 | 126 | { |
| 122 | | machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE); |
| 127 | m_maincpu->set_input_line(0, state ? HOLD_LINE : CLEAR_LINE); |
| 123 | 128 | } |
| 124 | 129 | |
| 125 | 130 | const struct pic8259_interface irisha_pic8259_config = |
trunk/src/mess/includes/irisha.h
| r20818 | r20819 | |
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | irisha_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | | : driver_device(mconfig, type, tag), |
| 23 | | m_pit(*this, "pit8253"), |
| 24 | | m_speaker(*this, SPEAKER_TAG) |
| 22 | : driver_device(mconfig, type, tag) |
| 23 | , m_maincpu(*this, "maincpu") |
| 24 | , m_pit(*this, "pit8253") |
| 25 | , m_speaker(*this, SPEAKER_TAG) |
| 25 | 26 | { } |
| 26 | 27 | |
| 28 | required_device<cpu_device> m_maincpu; |
| 27 | 29 | required_device<pit8253_device> m_pit; |
| 28 | 30 | required_device<speaker_sound_device> m_speaker; |
| 29 | 31 | |
| r20818 | r20819 | |
| 49 | 51 | UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 50 | 52 | TIMER_CALLBACK_MEMBER(irisha_key); |
| 51 | 53 | DECLARE_WRITE_LINE_MEMBER(irisha_pic_set_int_line); |
| 54 | |
| 55 | ioport_port *m_io_ports[10]; |
| 52 | 56 | }; |
| 53 | 57 | |
| 54 | 58 | |