trunk/src/mess/drivers/p2000t.c
| r30752 | r30753 | |
| 100 | 100 | */ |
| 101 | 101 | |
| 102 | 102 | static INPUT_PORTS_START (p2000t) |
| 103 | | PORT_START("KEY0") |
| 103 | PORT_START("KEY.0") |
| 104 | 104 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 105 | 105 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 106 | 106 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| r30752 | r30753 | |
| 110 | 110 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 111 | 111 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 112 | 112 | |
| 113 | | PORT_START("KEY1") |
| 113 | PORT_START("KEY.1") |
| 114 | 114 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') |
| 115 | 115 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 116 | 116 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| r30752 | r30753 | |
| 120 | 120 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 121 | 121 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 122 | 122 | |
| 123 | | PORT_START("KEY2") |
| 123 | PORT_START("KEY.2") |
| 124 | 124 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad ,") PORT_CODE(KEYCODE_ENTER_PAD) |
| 125 | 125 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 126 | 126 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_DEL_PAD) |
| r30752 | r30753 | |
| 130 | 130 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 131 | 131 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 132 | 132 | |
| 133 | | PORT_START("KEY3") |
| 133 | PORT_START("KEY.3") |
| 134 | 134 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| 135 | 135 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 136 | 136 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('<') PORT_CHAR('>') |
| r30752 | r30753 | |
| 140 | 140 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 141 | 141 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 142 | 142 | |
| 143 | | PORT_START("KEY4") |
| 143 | PORT_START("KEY.4") |
| 144 | 144 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Code") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 145 | 145 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 146 | 146 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| r30752 | r30753 | |
| 150 | 150 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 151 | 151 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 152 | 152 | |
| 153 | | PORT_START("KEY5") |
| 153 | PORT_START("KEY.5") |
| 154 | 154 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Clrln") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 155 | 155 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 156 | 156 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) |
| r30752 | r30753 | |
| 160 | 160 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 161 | 161 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(0xFF0D) |
| 162 | 162 | |
| 163 | | PORT_START("KEY6") |
| 163 | PORT_START("KEY.6") |
| 164 | 164 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) |
| 165 | 165 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 166 | 166 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) |
| r30752 | r30753 | |
| 170 | 170 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 171 | 171 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@ \xE2\x86\x91") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 172 | 172 | |
| 173 | | PORT_START("KEY7") |
| 173 | PORT_START("KEY.7") |
| 174 | 174 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) |
| 175 | 175 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 176 | 176 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) |
| r30752 | r30753 | |
| 180 | 180 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 181 | 181 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 182 | 182 | |
| 183 | | PORT_START("KEY8") |
| 183 | PORT_START("KEY.8") |
| 184 | 184 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) |
| 185 | 185 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 186 | 186 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) |
| r30752 | r30753 | |
| 190 | 190 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 191 | 191 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') |
| 192 | 192 | |
| 193 | | PORT_START("KEY9") |
| 193 | PORT_START("KEY.9") |
| 194 | 194 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 195 | 195 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N/C") |
| 196 | 196 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N/C") |
trunk/src/mess/machine/p2000t.c
| r30752 | r30753 | |
| 41 | 41 | */ |
| 42 | 42 | READ8_MEMBER( p2000t_state::p2000t_port_000f_r ) |
| 43 | 43 | { |
| 44 | | static const char *const keynames[] = { |
| 45 | | "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", |
| 46 | | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" |
| 47 | | }; |
| 48 | | |
| 49 | 44 | if (m_port_101f & P2000M_101F_KEYINT) |
| 50 | 45 | { |
| 51 | 46 | return ( |
| 52 | | ioport("KEY0")->read() & ioport("KEY1")->read() & |
| 53 | | ioport("KEY2")->read() & ioport("KEY3")->read() & |
| 54 | | ioport("KEY4")->read() & ioport("KEY5")->read() & |
| 55 | | ioport("KEY6")->read() & ioport("KEY7")->read() & |
| 56 | | ioport("KEY8")->read() & ioport("KEY9")->read()); |
| 47 | m_keyboard[0]->read() & m_keyboard[1]->read() & |
| 48 | m_keyboard[2]->read() & m_keyboard[3]->read() & |
| 49 | m_keyboard[4]->read() & m_keyboard[5]->read() & |
| 50 | m_keyboard[6]->read() & m_keyboard[7]->read() & |
| 51 | m_keyboard[8]->read() & m_keyboard[9]->read()); |
| 57 | 52 | } |
| 58 | 53 | else |
| 59 | 54 | if (offset < 10) |
| 60 | 55 | { |
| 61 | | return (ioport(keynames[offset])->read()); |
| 56 | return m_keyboard[offset]->read(); |
| 62 | 57 | } |
| 63 | 58 | else |
| 64 | 59 | return 0xff; |
trunk/src/mess/includes/p2000t.h
| r30752 | r30753 | |
| 20 | 20 | : driver_device(mconfig, type, tag), |
| 21 | 21 | m_maincpu(*this, "maincpu"), |
| 22 | 22 | m_speaker(*this, "speaker"), |
| 23 | m_gfxdecode(*this, "gfxdecode"), |
| 24 | m_palette(*this, "palette"), |
| 23 | 25 | m_videoram(*this, "videoram"), |
| 24 | | m_gfxdecode(*this, "gfxdecode"), |
| 25 | | m_palette(*this, "palette") |
| 26 | | { } |
| 26 | m_keyboard(*this, "KEY") { } |
| 27 | 27 | |
| 28 | 28 | required_device<cpu_device> m_maincpu; |
| 29 | 29 | required_device<speaker_sound_device> m_speaker; |
| 30 | optional_device<gfxdecode_device> m_gfxdecode; |
| 31 | optional_device<palette_device> m_palette; |
| 32 | required_shared_ptr<UINT8> m_videoram; |
| 33 | required_ioport_array<10> m_keyboard; |
| 30 | 34 | DECLARE_READ8_MEMBER(p2000t_port_000f_r); |
| 31 | 35 | DECLARE_READ8_MEMBER(p2000t_port_202f_r); |
| 32 | 36 | DECLARE_WRITE8_MEMBER(p2000t_port_101f_w); |
| r30752 | r30753 | |
| 37 | 41 | DECLARE_WRITE8_MEMBER(p2000t_port_8c90_w); |
| 38 | 42 | DECLARE_WRITE8_MEMBER(p2000t_port_9494_w); |
| 39 | 43 | DECLARE_READ8_MEMBER(videoram_r); |
| 40 | | required_shared_ptr<UINT8> m_videoram; |
| 41 | 44 | UINT8 m_port_101f; |
| 42 | 45 | UINT8 m_port_202f; |
| 43 | 46 | UINT8 m_port_303f; |
| r30752 | r30753 | |
| 47 | 50 | DECLARE_PALETTE_INIT(p2000m); |
| 48 | 51 | UINT32 screen_update_p2000m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 49 | 52 | INTERRUPT_GEN_MEMBER(p2000_interrupt); |
| 50 | | optional_device<gfxdecode_device> m_gfxdecode; |
| 51 | | optional_device<palette_device> m_palette; |
| 52 | 53 | }; |
| 53 | 54 | |
| 54 | 55 | #endif /* P2000T_H_ */ |