trunk/src/mess/machine/abc77.c
| r20434 | r20435 | |
| 448 | 448 | : device_t(mconfig, ABC77, "Luxor ABC 77", tag, owner, clock), |
| 449 | 449 | m_maincpu(*this, I8035_TAG), |
| 450 | 450 | m_discrete(*this, DISCRETE_TAG), |
| 451 | m_x0(*this, "X0"), |
| 452 | m_x1(*this, "X1"), |
| 453 | m_x2(*this, "X2"), |
| 454 | m_x3(*this, "X3"), |
| 455 | m_x4(*this, "X4"), |
| 456 | m_x5(*this, "X5"), |
| 457 | m_x6(*this, "X6"), |
| 458 | m_x7(*this, "X7"), |
| 459 | m_x8(*this, "X8"), |
| 460 | m_x9(*this, "X9"), |
| 461 | m_x10(*this, "X10"), |
| 462 | m_x11(*this, "X11"), |
| 451 | 463 | m_txd(1), |
| 452 | 464 | m_keydown(1), |
| 453 | 465 | m_clock(0), |
| r20434 | r20435 | |
| 459 | 471 | : device_t(mconfig, type, name, tag, owner, clock), |
| 460 | 472 | m_maincpu(*this, I8035_TAG), |
| 461 | 473 | m_discrete(*this, DISCRETE_TAG), |
| 474 | m_x0(*this, "X0"), |
| 475 | m_x1(*this, "X1"), |
| 476 | m_x2(*this, "X2"), |
| 477 | m_x3(*this, "X3"), |
| 478 | m_x4(*this, "X4"), |
| 479 | m_x5(*this, "X5"), |
| 480 | m_x6(*this, "X6"), |
| 481 | m_x7(*this, "X7"), |
| 482 | m_x8(*this, "X8"), |
| 483 | m_x9(*this, "X9"), |
| 484 | m_x10(*this, "X10"), |
| 485 | m_x11(*this, "X11"), |
| 462 | 486 | m_txd(1), |
| 463 | 487 | m_keydown(1), |
| 464 | 488 | m_clock(0), |
| r20434 | r20435 | |
| 545 | 569 | |
| 546 | 570 | */ |
| 547 | 571 | |
| 548 | | static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", "X10", "X11" }; |
| 549 | 572 | UINT8 data = 0xff; |
| 550 | 573 | |
| 551 | | if (m_stb && m_keylatch < 12) |
| 574 | if (m_stb) |
| 552 | 575 | { |
| 553 | | data = ioport(keynames[m_keylatch])->read(); |
| 576 | switch (m_keylatch) |
| 577 | { |
| 578 | case 0: data = m_x0->read(); break; |
| 579 | case 1: data = m_x1->read(); break; |
| 580 | case 2: data = m_x2->read(); break; |
| 581 | case 3: data = m_x3->read(); break; |
| 582 | case 4: data = m_x4->read(); break; |
| 583 | case 5: data = m_x5->read(); break; |
| 584 | case 6: data = m_x6->read(); break; |
| 585 | case 7: data = m_x7->read(); break; |
| 586 | case 8: data = m_x8->read(); break; |
| 587 | case 9: data = m_x9->read(); break; |
| 588 | case 10: data = m_x10->read(); break; |
| 589 | case 11: data = m_x11->read(); break; |
| 590 | } |
| 554 | 591 | } |
| 555 | 592 | |
| 556 | 593 | return data; |
trunk/src/mess/machine/adam_kb.c
| r20434 | r20435 | |
| 227 | 227 | : device_t(mconfig, ADAM_KB, "Adam keyboard", tag, owner, clock), |
| 228 | 228 | device_adamnet_card_interface(mconfig, *this), |
| 229 | 229 | m_maincpu(*this, M6801_TAG), |
| 230 | m_y0(*this, "Y0"), |
| 231 | m_y1(*this, "Y1"), |
| 232 | m_y2(*this, "Y2"), |
| 233 | m_y3(*this, "Y3"), |
| 234 | m_y4(*this, "Y4"), |
| 235 | m_y5(*this, "Y5"), |
| 236 | m_y6(*this, "Y6"), |
| 237 | m_y7(*this, "Y7"), |
| 238 | m_y8(*this, "Y8"), |
| 239 | m_y9(*this, "Y9"), |
| 240 | m_y10(*this, "Y10"), |
| 241 | m_y11(*this, "Y11"), |
| 242 | m_y12(*this, "Y12"), |
| 230 | 243 | m_key_y(0x1ff) |
| 231 | 244 | { |
| 232 | 245 | } |
| r20434 | r20435 | |
| 276 | 289 | |
| 277 | 290 | UINT8 data = 0xff; |
| 278 | 291 | |
| 279 | | if (!BIT(m_key_y, 0)) data &= ioport("Y0")->read(); |
| 280 | | if (!BIT(m_key_y, 1)) data &= ioport("Y1")->read(); |
| 281 | | if (!BIT(m_key_y, 2)) data &= ioport("Y2")->read(); |
| 282 | | if (!BIT(m_key_y, 3)) data &= ioport("Y3")->read(); |
| 283 | | if (!BIT(m_key_y, 4)) data &= ioport("Y4")->read(); |
| 284 | | if (!BIT(m_key_y, 5)) data &= ioport("Y5")->read(); |
| 285 | | if (!BIT(m_key_y, 6)) data &= ioport("Y6")->read(); |
| 286 | | if (!BIT(m_key_y, 7)) data &= ioport("Y7")->read(); |
| 287 | | if (!BIT(m_key_y, 8)) data &= ioport("Y8")->read(); |
| 288 | | if (!BIT(m_key_y, 9)) data &= ioport("Y9")->read(); |
| 289 | | if (!BIT(m_key_y, 10)) data &= ioport("Y10")->read(); |
| 290 | | if (!BIT(m_key_y, 11)) data &= ioport("Y11")->read(); |
| 291 | | if (!BIT(m_key_y, 12)) data &= ioport("Y12")->read(); |
| 292 | if (!BIT(m_key_y, 0)) data &= m_y0->read(); |
| 293 | if (!BIT(m_key_y, 1)) data &= m_y1->read(); |
| 294 | if (!BIT(m_key_y, 2)) data &= m_y2->read(); |
| 295 | if (!BIT(m_key_y, 3)) data &= m_y3->read(); |
| 296 | if (!BIT(m_key_y, 4)) data &= m_y4->read(); |
| 297 | if (!BIT(m_key_y, 5)) data &= m_y5->read(); |
| 298 | if (!BIT(m_key_y, 6)) data &= m_y6->read(); |
| 299 | if (!BIT(m_key_y, 7)) data &= m_y7->read(); |
| 300 | if (!BIT(m_key_y, 8)) data &= m_y8->read(); |
| 301 | if (!BIT(m_key_y, 9)) data &= m_y9->read(); |
| 302 | if (!BIT(m_key_y, 10)) data &= m_y10->read(); |
| 303 | if (!BIT(m_key_y, 11)) data &= m_y11->read(); |
| 304 | if (!BIT(m_key_y, 12)) data &= m_y12->read(); |
| 292 | 305 | |
| 293 | 306 | return data; |
| 294 | 307 | } |
trunk/src/mess/machine/v1050kb.c
| r20434 | r20435 | |
| 110 | 110 | //------------------------------------------------- |
| 111 | 111 | |
| 112 | 112 | INPUT_PORTS_START( v1050_keyboard ) |
| 113 | | PORT_START("X0") |
| 113 | PORT_START("Y0") |
| 114 | 114 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 115 | 115 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 116 | 116 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| r20434 | r20435 | |
| 120 | 120 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(TAB)) |
| 121 | 121 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("No Scrl") |
| 122 | 122 | |
| 123 | | PORT_START("X1") |
| 123 | PORT_START("Y1") |
| 124 | 124 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad Enter DelCh") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) |
| 125 | 125 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6 Pg Dn") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) |
| 126 | 126 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3 \xE2\x86\x92") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) |
| r20434 | r20435 | |
| 130 | 130 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad , DelWd") |
| 131 | 131 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad . Wd\xE2\x86\x92") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) |
| 132 | 132 | |
| 133 | | PORT_START("X2") |
| 133 | PORT_START("Y2") |
| 134 | 134 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F14 OnSer") |
| 135 | 135 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F16 Print") |
| 136 | 136 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F12 Copy") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| r20434 | r20435 | |
| 140 | 140 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F17 Block") |
| 141 | 141 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F13 Hide") |
| 142 | 142 | |
| 143 | | PORT_START("X3") |
| 143 | PORT_START("Y3") |
| 144 | 144 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Line Feed") |
| 145 | 145 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('|') PORT_CHAR('\\') |
| 146 | 146 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Retn") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| r20434 | r20435 | |
| 150 | 150 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 151 | 151 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0 Wd\xE2\x86\x90") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) |
| 152 | 152 | |
| 153 | | PORT_START("X4") |
| 153 | PORT_START("Y4") |
| 154 | 154 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 155 | 155 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5 \xE2\x86\x91") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) |
| 156 | 156 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1 \xE2\x86\x90") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) |
| r20434 | r20435 | |
| 160 | 160 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4 PgUp") PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) |
| 161 | 161 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2 \xE2\x86\x93") PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) |
| 162 | 162 | |
| 163 | | PORT_START("X5") |
| 163 | PORT_START("Y5") |
| 164 | 164 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 165 | 165 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 166 | 166 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| r20434 | r20435 | |
| 170 | 170 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 171 | 171 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 172 | 172 | |
| 173 | | PORT_START("X6") |
| 173 | PORT_START("Y6") |
| 174 | 174 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 175 | 175 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 176 | 176 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| r20434 | r20435 | |
| 180 | 180 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 181 | 181 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 182 | 182 | |
| 183 | | PORT_START("X7") |
| 183 | PORT_START("Y7") |
| 184 | 184 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F8 Insert") PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 185 | 185 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 186 | 186 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F6 InsCr") PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| r20434 | r20435 | |
| 190 | 190 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F4 Again") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 191 | 191 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F7 Refs") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 192 | 192 | |
| 193 | | PORT_START("X8") |
| 193 | PORT_START("Y8") |
| 194 | 194 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 195 | 195 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 196 | 196 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| r20434 | r20435 | |
| 200 | 200 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 201 | 201 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 202 | 202 | |
| 203 | | PORT_START("X9") |
| 203 | PORT_START("Y9") |
| 204 | 204 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 205 | 205 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 206 | 206 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| r20434 | r20435 | |
| 210 | 210 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 211 | 211 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 212 | 212 | |
| 213 | | PORT_START("XA") |
| 213 | PORT_START("YA") |
| 214 | 214 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('~') PORT_CHAR('\'') |
| 215 | 215 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('0') PORT_CHAR(')') |
| 216 | 216 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('9') PORT_CHAR('(') |
| r20434 | r20435 | |
| 220 | 220 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 221 | 221 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 222 | 222 | |
| 223 | | PORT_START("XB") |
| 223 | PORT_START("YB") |
| 224 | 224 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 225 | 225 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 226 | 226 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') |
| r20434 | r20435 | |
| 307 | 307 | : device_t(mconfig, V1050_KEYBOARD, "Visual 1050 Keyboard", tag, owner, clock), |
| 308 | 308 | m_maincpu(*this, I8049_TAG), |
| 309 | 309 | m_discrete(*this, DISCRETE_TAG), |
| 310 | m_y0(*this, "Y0"), |
| 311 | m_y1(*this, "Y1"), |
| 312 | m_y2(*this, "Y2"), |
| 313 | m_y3(*this, "Y3"), |
| 314 | m_y4(*this, "Y4"), |
| 315 | m_y5(*this, "Y5"), |
| 316 | m_y6(*this, "Y6"), |
| 317 | m_y7(*this, "Y7"), |
| 318 | m_y8(*this, "Y8"), |
| 319 | m_y9(*this, "Y9"), |
| 320 | m_ya(*this, "YA"), |
| 321 | m_yb(*this, "YB"), |
| 310 | 322 | m_y(0), |
| 311 | 323 | m_so(1) |
| 312 | 324 | { |
| r20434 | r20435 | |
| 364 | 376 | |
| 365 | 377 | switch (m_y) |
| 366 | 378 | { |
| 367 | | case 0: data &= ioport("X0")->read(); break; |
| 368 | | case 1: data &= ioport("X1")->read(); break; |
| 369 | | case 2: data &= ioport("X2")->read(); break; |
| 370 | | case 3: data &= ioport("X3")->read(); break; |
| 371 | | case 4: data &= ioport("X4")->read(); break; |
| 372 | | case 5: data &= ioport("X5")->read(); break; |
| 373 | | case 6: data &= ioport("X6")->read(); break; |
| 374 | | case 7: data &= ioport("X7")->read(); break; |
| 375 | | case 8: data &= ioport("X8")->read(); break; |
| 376 | | case 9: data &= ioport("X9")->read(); break; |
| 377 | | case 0xa: data &= ioport("XA")->read(); break; |
| 378 | | case 0xb: data &= ioport("XB")->read(); break; |
| 379 | case 0: data &= m_y0->read(); break; |
| 380 | case 1: data &= m_y1->read(); break; |
| 381 | case 2: data &= m_y2->read(); break; |
| 382 | case 3: data &= m_y3->read(); break; |
| 383 | case 4: data &= m_y4->read(); break; |
| 384 | case 5: data &= m_y5->read(); break; |
| 385 | case 6: data &= m_y6->read(); break; |
| 386 | case 7: data &= m_y7->read(); break; |
| 387 | case 8: data &= m_y8->read(); break; |
| 388 | case 9: data &= m_y9->read(); break; |
| 389 | case 0xa: data &= m_ya->read(); break; |
| 390 | case 0xb: data &= m_yb->read(); break; |
| 379 | 391 | } |
| 380 | 392 | |
| 381 | 393 | return data; |
trunk/src/mess/machine/tandy2kb.c
| r20434 | r20435 | |
| 234 | 234 | tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 235 | 235 | : device_t(mconfig, TANDY2K_KEYBOARD, "Tandy 2000 Keyboard", tag, owner, clock), |
| 236 | 236 | m_maincpu(*this, I8048_TAG), |
| 237 | m_y0(*this, "Y0"), |
| 238 | m_y1(*this, "Y1"), |
| 239 | m_y2(*this, "Y2"), |
| 240 | m_y3(*this, "Y3"), |
| 241 | m_y4(*this, "Y4"), |
| 242 | m_y5(*this, "Y5"), |
| 243 | m_y6(*this, "Y6"), |
| 244 | m_y7(*this, "Y7"), |
| 245 | m_y8(*this, "Y8"), |
| 246 | m_y9(*this, "Y9"), |
| 247 | m_y10(*this, "Y10"), |
| 248 | m_y11(*this, "Y11"), |
| 237 | 249 | m_keylatch(0xffff), |
| 238 | 250 | m_clock(0), |
| 239 | 251 | m_data(0) |
| r20434 | r20435 | |
| 331 | 343 | |
| 332 | 344 | UINT8 data = 0xff; |
| 333 | 345 | |
| 334 | | if (!BIT(m_keylatch, 0)) data &= ioport("Y0")->read(); |
| 335 | | if (!BIT(m_keylatch, 1)) data &= ioport("Y1")->read(); |
| 336 | | if (!BIT(m_keylatch, 2)) data &= ioport("Y2")->read(); |
| 337 | | if (!BIT(m_keylatch, 3)) data &= ioport("Y3")->read(); |
| 338 | | if (!BIT(m_keylatch, 4)) data &= ioport("Y4")->read(); |
| 339 | | if (!BIT(m_keylatch, 5)) data &= ioport("Y5")->read(); |
| 340 | | if (!BIT(m_keylatch, 6)) data &= ioport("Y6")->read(); |
| 341 | | if (!BIT(m_keylatch, 7)) data &= ioport("Y7")->read(); |
| 342 | | if (!BIT(m_keylatch, 8)) data &= ioport("Y8")->read(); |
| 343 | | if (!BIT(m_keylatch, 9)) data &= ioport("Y9")->read(); |
| 344 | | if (!BIT(m_keylatch, 10)) data &= ioport("Y10")->read(); |
| 345 | | if (!BIT(m_keylatch, 11)) data &= ioport("Y11")->read(); |
| 346 | if (!BIT(m_keylatch, 0)) data &= m_y0->read(); |
| 347 | if (!BIT(m_keylatch, 1)) data &= m_y1->read(); |
| 348 | if (!BIT(m_keylatch, 2)) data &= m_y2->read(); |
| 349 | if (!BIT(m_keylatch, 3)) data &= m_y3->read(); |
| 350 | if (!BIT(m_keylatch, 4)) data &= m_y4->read(); |
| 351 | if (!BIT(m_keylatch, 5)) data &= m_y5->read(); |
| 352 | if (!BIT(m_keylatch, 6)) data &= m_y6->read(); |
| 353 | if (!BIT(m_keylatch, 7)) data &= m_y7->read(); |
| 354 | if (!BIT(m_keylatch, 8)) data &= m_y8->read(); |
| 355 | if (!BIT(m_keylatch, 9)) data &= m_y9->read(); |
| 356 | if (!BIT(m_keylatch, 10)) data &= m_y10->read(); |
| 357 | if (!BIT(m_keylatch, 11)) data &= m_y11->read(); |
| 346 | 358 | |
| 347 | 359 | return ~data; |
| 348 | 360 | } |
trunk/src/mess/machine/victor9kb.c
| r20434 | r20435 | |
| 238 | 238 | victor9k_keyboard_device::victor9k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 239 | 239 | : device_t(mconfig, VICTOR9K_KEYBOARD, "Victor 9000 Keyboard", tag, owner, clock), |
| 240 | 240 | m_maincpu(*this, I8021_TAG), |
| 241 | m_y0(*this, "Y0"), |
| 242 | m_y1(*this, "Y1"), |
| 243 | m_y2(*this, "Y2"), |
| 244 | m_y3(*this, "Y3"), |
| 245 | m_y4(*this, "Y4"), |
| 246 | m_y5(*this, "Y5"), |
| 247 | m_y6(*this, "Y6"), |
| 248 | m_y7(*this, "Y7"), |
| 249 | m_y8(*this, "Y8"), |
| 250 | m_y9(*this, "Y9"), |
| 251 | m_ya(*this, "YA"), |
| 252 | m_yb(*this, "YB"), |
| 253 | m_yc(*this, "YC"), |
| 241 | 254 | m_y(0), |
| 242 | 255 | m_kbrdy(1), |
| 243 | 256 | m_kbdata(1), |
| r20434 | r20435 | |
| 312 | 325 | |
| 313 | 326 | switch (m_y) |
| 314 | 327 | { |
| 315 | | case 0: data &= ioport("Y0")->read(); break; |
| 316 | | case 1: data &= ioport("Y1")->read(); break; |
| 317 | | case 2: data &= ioport("Y2")->read(); break; |
| 318 | | case 3: data &= ioport("Y3")->read(); break; |
| 319 | | case 4: data &= ioport("Y4")->read(); break; |
| 320 | | case 5: data &= ioport("Y5")->read(); break; |
| 321 | | case 6: data &= ioport("Y6")->read(); break; |
| 322 | | case 7: data &= ioport("Y7")->read(); break; |
| 323 | | case 8: data &= ioport("Y8")->read(); break; |
| 324 | | case 9: data &= ioport("Y9")->read(); break; |
| 325 | | case 0xa: data &= ioport("YA")->read(); break; |
| 326 | | case 0xb: data &= ioport("YB")->read(); break; |
| 327 | | case 0xc: data &= ioport("YC")->read(); break; |
| 328 | case 0: data &= m_y0->read(); break; |
| 329 | case 1: data &= m_y1->read(); break; |
| 330 | case 2: data &= m_y2->read(); break; |
| 331 | case 3: data &= m_y3->read(); break; |
| 332 | case 4: data &= m_y4->read(); break; |
| 333 | case 5: data &= m_y5->read(); break; |
| 334 | case 6: data &= m_y6->read(); break; |
| 335 | case 7: data &= m_y7->read(); break; |
| 336 | case 8: data &= m_y8->read(); break; |
| 337 | case 9: data &= m_y9->read(); break; |
| 338 | case 0xa: data &= m_ya->read(); break; |
| 339 | case 0xb: data &= m_yb->read(); break; |
| 340 | case 0xc: data &= m_yc->read(); break; |
| 328 | 341 | } |
| 329 | 342 | |
| 330 | 343 | return data; |
trunk/src/mess/machine/trs80m2kb.c
| r20434 | r20435 | |
| 93 | 93 | //------------------------------------------------- |
| 94 | 94 | |
| 95 | 95 | INPUT_PORTS_START( trs80m2_keyboard ) |
| 96 | | /* |
| 97 | | PORT_START("X0") |
| 96 | PORT_START("Y0") |
| 98 | 97 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 99 | 98 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 100 | 99 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| r20434 | r20435 | |
| 104 | 103 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 105 | 104 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 106 | 105 | |
| 107 | | PORT_START("X1") |
| 106 | PORT_START("Y1") |
| 108 | 107 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 109 | 108 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 110 | 109 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| r20434 | r20435 | |
| 114 | 113 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 115 | 114 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 116 | 115 | |
| 117 | | PORT_START("X2") |
| 116 | PORT_START("Y2") |
| 118 | 117 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REPEAT") |
| 119 | 118 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right SHIFT") PORT_CODE(KEYCODE_RSHIFT) |
| 120 | 119 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| r20434 | r20435 | |
| 124 | 123 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 125 | 124 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 126 | 125 | |
| 127 | | PORT_START("X3") |
| 126 | PORT_START("Y3") |
| 128 | 127 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("cannot read label") |
| 129 | 128 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 130 | 129 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| r20434 | r20435 | |
| 134 | 133 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) |
| 135 | 134 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 136 | 135 | |
| 137 | | PORT_START("X4") |
| 136 | PORT_START("Y4") |
| 138 | 137 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 139 | 138 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 140 | 139 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| r20434 | r20435 | |
| 144 | 143 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) |
| 145 | 144 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 146 | 145 | |
| 147 | | PORT_START("X5") |
| 146 | PORT_START("Y5") |
| 148 | 147 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOLD") |
| 149 | 148 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 150 | 149 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| r20434 | r20435 | |
| 154 | 153 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) |
| 155 | 154 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 156 | 155 | |
| 157 | | PORT_START("X6") |
| 156 | PORT_START("Y6") |
| 158 | 157 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 159 | 158 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 160 | 159 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| r20434 | r20435 | |
| 164 | 163 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) |
| 165 | 164 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) |
| 166 | 165 | |
| 167 | | PORT_START("X7") |
| 166 | PORT_START("Y7") |
| 168 | 167 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 169 | 168 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') |
| 170 | 169 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| r20434 | r20435 | |
| 174 | 173 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) |
| 175 | 174 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) |
| 176 | 175 | |
| 177 | | PORT_START("X8") |
| 176 | PORT_START("Y8") |
| 178 | 177 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 179 | 178 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 180 | 179 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| r20434 | r20435 | |
| 184 | 183 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) |
| 185 | 184 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) |
| 186 | 185 | |
| 187 | | PORT_START("X9") |
| 186 | PORT_START("Y9") |
| 188 | 187 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 189 | 188 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 190 | 189 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| r20434 | r20435 | |
| 194 | 193 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 195 | 194 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 196 | 195 | |
| 197 | | PORT_START("XA") |
| 196 | PORT_START("YA") |
| 198 | 197 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 199 | 198 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 200 | 199 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| r20434 | r20435 | |
| 204 | 203 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 205 | 204 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 206 | 205 | |
| 207 | | PORT_START("XB") |
| 206 | PORT_START("YB") |
| 208 | 207 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 209 | 208 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 210 | 209 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| r20434 | r20435 | |
| 213 | 212 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 214 | 213 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') |
| 215 | 214 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 216 | | */ |
| 217 | 215 | INPUT_PORTS_END |
| 218 | 216 | |
| 219 | 217 | |
| r20434 | r20435 | |
| 239 | 237 | trs80m2_keyboard_device::trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 240 | 238 | : device_t(mconfig, TRS80M2_KEYBOARD, "TRS-80 Model II Keyboard", tag, owner, clock), |
| 241 | 239 | m_maincpu(*this, I8021_TAG), |
| 240 | m_y0(*this, "Y0"), |
| 241 | m_y1(*this, "Y1"), |
| 242 | m_y2(*this, "Y2"), |
| 243 | m_y3(*this, "Y3"), |
| 244 | m_y4(*this, "Y4"), |
| 245 | m_y5(*this, "Y5"), |
| 246 | m_y6(*this, "Y6"), |
| 247 | m_y7(*this, "Y7"), |
| 248 | m_y8(*this, "Y8"), |
| 249 | m_y9(*this, "Y9"), |
| 250 | m_ya(*this, "YA"), |
| 251 | m_yb(*this, "YB"), |
| 242 | 252 | m_busy(1), |
| 243 | 253 | m_data(1), |
| 244 | 254 | m_clk(0) |
| r20434 | r20435 | |
| 311 | 321 | |
| 312 | 322 | switch (m_y) |
| 313 | 323 | { |
| 314 | | case 0: data &= ioport("X0")->read(); break; |
| 315 | | case 1: data &= ioport("X1")->read(); break; |
| 316 | | case 2: data &= ioport("X2")->read(); break; |
| 317 | | case 3: data &= ioport("X3")->read(); break; |
| 318 | | case 4: data &= ioport("X4")->read(); break; |
| 319 | | case 5: data &= ioport("X5")->read(); break; |
| 320 | | case 6: data &= ioport("X6")->read(); break; |
| 321 | | case 7: data &= ioport("X7")->read(); break; |
| 322 | | case 8: data &= ioport("X8")->read(); break; |
| 323 | | case 9: data &= ioport("X9")->read(); break; |
| 324 | | case 0xa: data &= ioport("XA")->read(); break; |
| 325 | | case 0xb: data &= ioport("XB")->read(); break; |
| 324 | case 0: data &= m_y0->read(); break; |
| 325 | case 1: data &= m_y1->read(); break; |
| 326 | case 2: data &= m_y2->read(); break; |
| 327 | case 3: data &= m_y3->read(); break; |
| 328 | case 4: data &= m_y4->read(); break; |
| 329 | case 5: data &= m_y5->read(); break; |
| 330 | case 6: data &= m_y6->read(); break; |
| 331 | case 7: data &= m_y7->read(); break; |
| 332 | case 8: data &= m_y8->read(); break; |
| 333 | case 9: data &= m_y9->read(); break; |
| 334 | case 0xa: data &= m_ya->read(); break; |
| 335 | case 0xb: data &= m_yb->read(); break; |
| 326 | 336 | } |
| 327 | 337 | |
| 328 | 338 | return data; |
trunk/src/mess/includes/sage2.h
| r20434 | r20435 | |
| 34 | 34 | m_usart1(*this, I8251_1_TAG), |
| 35 | 35 | m_fdc(*this, UPD765_TAG), |
| 36 | 36 | m_ram(*this, RAM_TAG), |
| 37 | | m_floppy0(*this, UPD765_TAG ":0:525dd"), |
| 38 | | m_floppy1(*this, UPD765_TAG ":1:525dd"), |
| 37 | m_floppy0(*this, UPD765_TAG ":0"), |
| 38 | m_floppy1(*this, UPD765_TAG ":1"), |
| 39 | m_floppy(NULL), |
| 39 | 40 | m_centronics(*this, CENTRONICS_TAG), |
| 40 | 41 | m_ieee488(*this, IEEE488_TAG), |
| 41 | 42 | m_terminal(*this, TERMINAL_TAG), |
| 42 | 43 | m_reset(1), |
| 43 | 44 | m_fdc_int(0), |
| 44 | | m_fdie(0), |
| 45 | | m_sl0(1), |
| 46 | | m_sl1(1) |
| 45 | m_fdie(0) |
| 47 | 46 | { } |
| 48 | 47 | |
| 49 | 48 | required_device<cpu_device> m_maincpu; |
| r20434 | r20435 | |
| 52 | 51 | required_device<i8251_device> m_usart1; |
| 53 | 52 | required_device<upd765a_device> m_fdc; |
| 54 | 53 | required_device<ram_device> m_ram; |
| 55 | | required_device<floppy_image_device> m_floppy0; |
| 56 | | required_device<floppy_image_device> m_floppy1; |
| 54 | required_device<floppy_connector> m_floppy0; |
| 55 | required_device<floppy_connector> m_floppy1; |
| 56 | floppy_image_device *m_floppy; |
| 57 | 57 | required_device<centronics_device> m_centronics; |
| 58 | 58 | required_device<ieee488_device> m_ieee488; |
| 59 | 59 | required_device<generic_terminal_device> m_terminal; |
| r20434 | r20435 | |
| 63 | 63 | |
| 64 | 64 | void update_fdc_int(); |
| 65 | 65 | |
| 66 | | DECLARE_READ8_MEMBER( mmu_r ); |
| 67 | | DECLARE_WRITE8_MEMBER( mmu_w ); |
| 66 | DECLARE_READ8_MEMBER( read ); |
| 67 | DECLARE_WRITE8_MEMBER( write ); |
| 68 | 68 | DECLARE_WRITE_LINE_MEMBER( br1_w ); |
| 69 | 69 | DECLARE_WRITE_LINE_MEMBER( br2_w ); |
| 70 | 70 | DECLARE_WRITE8_MEMBER( ppi0_pc_w ); |
| r20434 | r20435 | |
| 78 | 78 | |
| 79 | 79 | void fdc_irq(bool state); |
| 80 | 80 | |
| 81 | const UINT8 *m_rom; |
| 81 | 82 | int m_reset; |
| 82 | 83 | |
| 83 | 84 | // floppy state |
| 84 | 85 | int m_fdc_int; |
| 85 | 86 | int m_fdie; |
| 86 | | int m_sl0; |
| 87 | | int m_sl1; |
| 88 | 87 | DECLARE_DRIVER_INIT(sage2); |
| 89 | 88 | }; |
trunk/src/mess/drivers/mikromik.c
| r20434 | r20435 | |
| 263 | 263 | |
| 264 | 264 | void mm1_state::scan_keyboard() |
| 265 | 265 | { |
| 266 | | static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" }; |
| 266 | UINT8 data = 0xff; |
| 267 | 267 | |
| 268 | | UINT8 data = ioport(keynames[m_drive])->read(); |
| 269 | | UINT8 special = ioport("SPECIAL")->read(); |
| 268 | switch (m_drive) |
| 269 | { |
| 270 | case 0: data = m_y0->read(); break; |
| 271 | case 1: data = m_y1->read(); break; |
| 272 | case 2: data = m_y2->read(); break; |
| 273 | case 3: data = m_y3->read(); break; |
| 274 | case 4: data = m_y4->read(); break; |
| 275 | case 5: data = m_y5->read(); break; |
| 276 | case 6: data = m_y6->read(); break; |
| 277 | case 7: data = m_y7->read(); break; |
| 278 | case 8: data = m_y8->read(); break; |
| 279 | case 9: data = m_y9->read(); break; |
| 280 | } |
| 281 | |
| 282 | UINT8 special = m_special->read(); |
| 270 | 283 | int ctrl = BIT(special, 0); |
| 271 | 284 | int shift = BIT(special, 2) & BIT(special, 1); |
| 272 | 285 | UINT8 keydata = 0xff; |
| r20434 | r20435 | |
| 344 | 357 | //------------------------------------------------- |
| 345 | 358 | |
| 346 | 359 | static INPUT_PORTS_START( mm1 ) |
| 347 | | PORT_START("ROW0") |
| 360 | PORT_START("Y0") |
| 348 | 361 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 349 | 362 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 350 | 363 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| r20434 | r20435 | |
| 354 | 367 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 355 | 368 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 356 | 369 | |
| 357 | | PORT_START("ROW1") |
| 370 | PORT_START("Y1") |
| 358 | 371 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 359 | 372 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 360 | 373 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| r20434 | r20435 | |
| 364 | 377 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 365 | 378 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 366 | 379 | |
| 367 | | PORT_START("ROW2") |
| 380 | PORT_START("Y2") |
| 368 | 381 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 369 | 382 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 370 | 383 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| r20434 | r20435 | |
| 374 | 387 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 375 | 388 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 376 | 389 | |
| 377 | | PORT_START("ROW3") |
| 390 | PORT_START("Y3") |
| 378 | 391 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('/') |
| 379 | 392 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 380 | 393 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| r20434 | r20435 | |
| 384 | 397 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 385 | 398 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 386 | 399 | |
| 387 | | PORT_START("ROW4") |
| 400 | PORT_START("Y4") |
| 388 | 401 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 389 | 402 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 390 | 403 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| r20434 | r20435 | |
| 394 | 407 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 395 | 408 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 396 | 409 | |
| 397 | | PORT_START("ROW5") |
| 410 | PORT_START("Y5") |
| 398 | 411 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('+') PORT_CHAR('?') |
| 399 | 412 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xC2\xB4 '") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(0x00B4) PORT_CHAR('`') |
| 400 | 413 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x96") |
| r20434 | r20435 | |
| 404 | 417 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('-') PORT_CHAR('_') |
| 405 | 418 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(a_RING " " A_RING) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0x00E5) PORT_CHAR(0x00C5) |
| 406 | 419 | |
| 407 | | PORT_START("ROW6") |
| 420 | PORT_START("Y6") |
| 408 | 421 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('<') PORT_CHAR('>') |
| 409 | 422 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) |
| 410 | 423 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| r20434 | r20435 | |
| 414 | 427 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LF") |
| 415 | 428 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('@') PORT_CHAR('*') |
| 416 | 429 | |
| 417 | | PORT_START("ROW7") |
| 430 | PORT_START("Y7") |
| 418 | 431 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) |
| 419 | 432 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) |
| 420 | 433 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| r20434 | r20435 | |
| 424 | 437 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) |
| 425 | 438 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) |
| 426 | 439 | |
| 427 | | PORT_START("ROW8") |
| 440 | PORT_START("Y8") |
| 428 | 441 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) |
| 429 | 442 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) |
| 430 | 443 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| r20434 | r20435 | |
| 434 | 447 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) |
| 435 | 448 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) |
| 436 | 449 | |
| 437 | | PORT_START("ROW9") |
| 450 | PORT_START("Y9") |
| 438 | 451 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 439 | 452 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=') |
| 440 | 453 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) |
trunk/src/mess/drivers/cbm2.c
| r20434 | r20435 | |
| 1376 | 1376 | { |
| 1377 | 1377 | UINT8 data = 0xff; |
| 1378 | 1378 | |
| 1379 | | if (!BIT(m_tpi2_pa, 0)) data &= ioport("PA0")->read(); |
| 1380 | | if (!BIT(m_tpi2_pa, 1)) data &= ioport("PA1")->read(); |
| 1381 | | if (!BIT(m_tpi2_pa, 2)) data &= ioport("PA2")->read(); |
| 1382 | | if (!BIT(m_tpi2_pa, 3)) data &= ioport("PA3")->read(); |
| 1383 | | if (!BIT(m_tpi2_pa, 4)) data &= ioport("PA4")->read(); |
| 1384 | | if (!BIT(m_tpi2_pa, 5)) data &= ioport("PA5")->read(); |
| 1385 | | if (!BIT(m_tpi2_pa, 6)) data &= ioport("PA6")->read(); |
| 1386 | | if (!BIT(m_tpi2_pa, 7)) data &= ioport("PA7")->read(); |
| 1387 | | if (!BIT(m_tpi2_pb, 0)) data &= ioport("PB0")->read() & ioport("LOCK")->read(); |
| 1388 | | if (!BIT(m_tpi2_pb, 1)) data &= ioport("PB1")->read(); |
| 1389 | | if (!BIT(m_tpi2_pb, 2)) data &= ioport("PB2")->read(); |
| 1390 | | if (!BIT(m_tpi2_pb, 3)) data &= ioport("PB3")->read(); |
| 1391 | | if (!BIT(m_tpi2_pb, 4)) data &= ioport("PB4")->read(); |
| 1392 | | if (!BIT(m_tpi2_pb, 5)) data &= ioport("PB5")->read(); |
| 1393 | | if (!BIT(m_tpi2_pb, 6)) data &= ioport("PB6")->read(); |
| 1394 | | if (!BIT(m_tpi2_pb, 7)) data &= ioport("PB7")->read(); |
| 1379 | if (!BIT(m_tpi2_pa, 0)) data &= m_pa0->read(); |
| 1380 | if (!BIT(m_tpi2_pa, 1)) data &= m_pa1->read(); |
| 1381 | if (!BIT(m_tpi2_pa, 2)) data &= m_pa2->read(); |
| 1382 | if (!BIT(m_tpi2_pa, 3)) data &= m_pa3->read(); |
| 1383 | if (!BIT(m_tpi2_pa, 4)) data &= m_pa4->read(); |
| 1384 | if (!BIT(m_tpi2_pa, 5)) data &= m_pa5->read(); |
| 1385 | if (!BIT(m_tpi2_pa, 6)) data &= m_pa6->read(); |
| 1386 | if (!BIT(m_tpi2_pa, 7)) data &= m_pa7->read(); |
| 1387 | if (!BIT(m_tpi2_pb, 0)) data &= m_pb0->read() & m_lock->read(); |
| 1388 | if (!BIT(m_tpi2_pb, 1)) data &= m_pb1->read(); |
| 1389 | if (!BIT(m_tpi2_pb, 2)) data &= m_pb2->read(); |
| 1390 | if (!BIT(m_tpi2_pb, 3)) data &= m_pb3->read(); |
| 1391 | if (!BIT(m_tpi2_pb, 4)) data &= m_pb4->read(); |
| 1392 | if (!BIT(m_tpi2_pb, 5)) data &= m_pb5->read(); |
| 1393 | if (!BIT(m_tpi2_pb, 6)) data &= m_pb6->read(); |
| 1394 | if (!BIT(m_tpi2_pb, 7)) data &= m_pb7->read(); |
| 1395 | 1395 | |
| 1396 | 1396 | return data; |
| 1397 | 1397 | } |
trunk/src/mess/drivers/sage2.c
| r20434 | r20435 | |
| 38 | 38 | //************************************************************************** |
| 39 | 39 | |
| 40 | 40 | //------------------------------------------------- |
| 41 | | // mmu_r - |
| 41 | // read - |
| 42 | 42 | //------------------------------------------------- |
| 43 | 43 | |
| 44 | | READ8_MEMBER( sage2_state::mmu_r ) |
| 44 | READ8_MEMBER( sage2_state::read ) |
| 45 | 45 | { |
| 46 | 46 | UINT8 data = 0xff; |
| 47 | 47 | |
| 48 | 48 | if (m_reset || (offset >= 0xfe0000)) |
| 49 | 49 | { |
| 50 | | data = memregion(M68000_TAG)->base()[offset & 0x1fff]; |
| 50 | data = m_rom[offset & 0x1fff]; |
| 51 | 51 | } |
| 52 | 52 | else if (offset < 0x080000) |
| 53 | 53 | { |
| r20434 | r20435 | |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | //------------------------------------------------- |
| 62 | | // mmu_w - |
| 62 | // write - |
| 63 | 63 | //------------------------------------------------- |
| 64 | 64 | |
| 65 | | WRITE8_MEMBER( sage2_state::mmu_w ) |
| 65 | WRITE8_MEMBER( sage2_state::write ) |
| 66 | 66 | { |
| 67 | 67 | if (offset < 0x080000) |
| 68 | 68 | { |
| r20434 | r20435 | |
| 82 | 82 | |
| 83 | 83 | static ADDRESS_MAP_START( sage2_mem, AS_PROGRAM, 16, sage2_state ) |
| 84 | 84 | ADDRESS_MAP_UNMAP_HIGH |
| 85 | | AM_RANGE(0x000000, 0xfeffff) AM_READWRITE8(mmu_r, mmu_w, 0xffff) |
| 85 | AM_RANGE(0x000000, 0xfeffff) AM_READWRITE8(read, write, 0xffff) |
| 86 | 86 | AM_RANGE(0xffc000, 0xffc007) AM_DEVREADWRITE8_LEGACY(I8253_1_TAG, pit8253_r, pit8253_w, 0x00ff) |
| 87 | | // AM_RANGE(0xffc010, 0xffc01f) AM_DEVREADWRITE8(TMS9914_TAG, tms9914_device, read, write, 0x00ff) |
| 87 | AM_RANGE(0xffc010, 0xffc01f) AM_NOP //AM_DEVREADWRITE8(TMS9914_TAG, tms9914_device, read, write, 0x00ff) |
| 88 | 88 | AM_RANGE(0xffc020, 0xffc027) AM_DEVREADWRITE8(I8255A_0_TAG, i8255_device, read, write, 0x00ff) // i8255, DIPs + Floppy ctrl port |
| 89 | 89 | AM_RANGE(0xffc030, 0xffc031) AM_DEVREADWRITE8(I8251_1_TAG, i8251_device, data_r, data_w, 0x00ff) |
| 90 | 90 | AM_RANGE(0xffc032, 0xffc033) AM_DEVREADWRITE8(I8251_1_TAG, i8251_device, status_r, control_w, 0x00ff) |
| r20434 | r20435 | |
| 246 | 246 | update_fdc_int(); |
| 247 | 247 | |
| 248 | 248 | // drive select |
| 249 | | m_sl0 = BIT(data, 3); |
| 250 | | m_sl1 = BIT(data, 4); |
| 249 | m_floppy = NULL; |
| 251 | 250 | |
| 252 | | if(m_sl0) |
| 253 | | m_fdc->set_floppy(m_floppy0); |
| 254 | | else if(m_sl1) |
| 255 | | m_fdc->set_floppy(m_floppy1); |
| 256 | | else |
| 257 | | m_fdc->set_floppy(NULL); |
| 251 | if (BIT(data, 3)) m_floppy = m_floppy0->get_device(); |
| 252 | if (BIT(data, 4)) m_floppy = m_floppy1->get_device(); |
| 258 | 253 | |
| 254 | m_fdc->set_floppy(m_floppy); |
| 255 | |
| 259 | 256 | // floppy motor |
| 260 | | m_floppy0->mon_w(BIT(data, 5)); |
| 261 | | m_floppy1->mon_w(BIT(data, 5)); |
| 262 | | |
| 257 | if (m_floppy) m_floppy->mon_w(BIT(data, 5)); |
| 258 | |
| 263 | 259 | // FDC reset |
| 264 | | if(BIT(data, 7)) |
| 265 | | m_fdc->reset(); |
| 260 | if(BIT(data, 7)) m_fdc->reset(); |
| 266 | 261 | } |
| 267 | 262 | |
| 268 | 263 | static I8255A_INTERFACE( ppi0_intf ) |
| r20434 | r20435 | |
| 303 | 298 | data = m_fdc->get_irq(); |
| 304 | 299 | |
| 305 | 300 | // floppy write protected |
| 306 | | if (!m_sl0) data |= m_floppy0->wpt_r() << 1; |
| 307 | | if (!m_sl1) data |= m_floppy1->wpt_r() << 1; |
| 301 | data = (m_floppy ? m_floppy->wpt_r() : 1) << 1; |
| 308 | 302 | |
| 309 | 303 | // RS-232 ring indicator |
| 310 | 304 | |
| r20434 | r20435 | |
| 477 | 471 | //------------------------------------------------- |
| 478 | 472 | |
| 479 | 473 | static SLOT_INTERFACE_START( sage2_floppies ) |
| 480 | | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 474 | SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Mitsubishi M4859 |
| 481 | 475 | SLOT_INTERFACE_END |
| 482 | 476 | |
| 483 | 477 | void sage2_state::update_fdc_int() |
| 484 | 478 | { |
| 485 | | m_maincpu->set_input_line(M68K_IRQ_6, m_fdie & m_fdc_int); |
| 479 | m_maincpu->set_input_line(M68K_IRQ_6, m_fdie && m_fdc_int); |
| 486 | 480 | } |
| 487 | 481 | |
| 488 | 482 | void sage2_state::fdc_irq(bool state) |
| r20434 | r20435 | |
| 491 | 485 | update_fdc_int(); |
| 492 | 486 | } |
| 493 | 487 | |
| 494 | | void sage2_state::machine_start() |
| 495 | | { |
| 496 | | m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(sage2_state::fdc_irq), this)); |
| 497 | | } |
| 498 | 488 | |
| 499 | 489 | //------------------------------------------------- |
| 500 | 490 | // centronics_interface centronics_intf |
| r20434 | r20435 | |
| 554 | 544 | //************************************************************************** |
| 555 | 545 | |
| 556 | 546 | //------------------------------------------------- |
| 547 | // MACHINE_START( sage2 ) |
| 548 | //------------------------------------------------- |
| 549 | |
| 550 | void sage2_state::machine_start() |
| 551 | { |
| 552 | // find memory regions |
| 553 | m_rom = memregion(M68000_TAG)->base(); |
| 554 | |
| 555 | // setup floppy callbacks |
| 556 | m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(sage2_state::fdc_irq), this)); |
| 557 | } |
| 558 | |
| 559 | |
| 560 | //------------------------------------------------- |
| 557 | 561 | // MACHINE_RESET( sage2 ) |
| 558 | 562 | //------------------------------------------------- |
| 559 | 563 | |
| r20434 | r20435 | |
| 590 | 594 | MCFG_I8251_ADD(I8251_1_TAG, usart1_intf) |
| 591 | 595 | MCFG_UPD765A_ADD(UPD765_TAG, false, false) |
| 592 | 596 | MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf) |
| 593 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sage2_floppies, "525dd", 0, floppy_image_device::default_floppy_formats) |
| 594 | | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", sage2_floppies, "525dd", 0, floppy_image_device::default_floppy_formats) |
| 597 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sage2_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) |
| 598 | MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", sage2_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) |
| 595 | 599 | MCFG_IEEE488_BUS_ADD(ieee488_intf) |
| 596 | 600 | |
| 597 | 601 | // internal ram |
trunk/src/mess/drivers/atom.c
| r20434 | r20435 | |
| 218 | 218 | -------------------------------------------------*/ |
| 219 | 219 | |
| 220 | 220 | static INPUT_PORTS_START( atom ) |
| 221 | | PORT_START("KEY0") |
| 221 | PORT_START("Y0") |
| 222 | 222 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 223 | 223 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 224 | 224 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| r20434 | r20435 | |
| 228 | 228 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 229 | 229 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 230 | 230 | |
| 231 | | PORT_START("KEY1") |
| 231 | PORT_START("Y1") |
| 232 | 232 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 233 | 233 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 234 | 234 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| r20434 | r20435 | |
| 238 | 238 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 239 | 239 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 240 | 240 | |
| 241 | | PORT_START("KEY2") |
| 241 | PORT_START("Y2") |
| 242 | 242 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x87\x95") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 243 | 243 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 244 | 244 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') |
| r20434 | r20435 | |
| 248 | 248 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 249 | 249 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 250 | 250 | |
| 251 | | PORT_START("KEY3") |
| 251 | PORT_START("Y3") |
| 252 | 252 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x87\x94") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 253 | 253 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 254 | 254 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(':') PORT_CHAR('*') |
| r20434 | r20435 | |
| 258 | 258 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 259 | 259 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 260 | 260 | |
| 261 | | PORT_START("KEY4") |
| 261 | PORT_START("Y4") |
| 262 | 262 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE |
| 263 | 263 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DELETE") PORT_CODE(KEYCODE_DEL) PORT_CHAR(8) |
| 264 | 264 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| r20434 | r20435 | |
| 268 | 268 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 269 | 269 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 270 | 270 | |
| 271 | | PORT_START("KEY5") |
| 271 | PORT_START("Y5") |
| 272 | 272 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR('^') |
| 273 | 273 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("COPY") PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(TAB)) |
| 274 | 274 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| r20434 | r20435 | |
| 278 | 278 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 279 | 279 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 280 | 280 | |
| 281 | | PORT_START("KEY6") |
| 281 | PORT_START("Y6") |
| 282 | 282 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') |
| 283 | 283 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 284 | 284 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| r20434 | r20435 | |
| 288 | 288 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 289 | 289 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 290 | 290 | |
| 291 | | PORT_START("KEY7") |
| 291 | PORT_START("Y7") |
| 292 | 292 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('\\') |
| 293 | 293 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 294 | 294 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| r20434 | r20435 | |
| 298 | 298 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 299 | 299 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 300 | 300 | |
| 301 | | PORT_START("KEY8") |
| 301 | PORT_START("Y8") |
| 302 | 302 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('[') |
| 303 | 303 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 304 | 304 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| r20434 | r20435 | |
| 308 | 308 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 309 | 309 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 310 | 310 | |
| 311 | | PORT_START("KEY9") |
| 311 | PORT_START("Y9") |
| 312 | 312 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(32) |
| 313 | 313 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 314 | 314 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| r20434 | r20435 | |
| 318 | 318 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 319 | 319 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 320 | 320 | |
| 321 | | PORT_START("KEY10") |
| 321 | PORT_START("Y10") |
| 322 | 322 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 323 | 323 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 324 | 324 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r20434 | r20435 | |
| 394 | 394 | |
| 395 | 395 | switch (m_keylatch) |
| 396 | 396 | { |
| 397 | | case 0: data &= ioport("KEY0")->read(); break; |
| 398 | | case 1: data &= ioport("KEY1")->read(); break; |
| 399 | | case 2: data &= ioport("KEY2")->read(); break; |
| 400 | | case 3: data &= ioport("KEY3")->read(); break; |
| 401 | | case 4: data &= ioport("KEY4")->read(); break; |
| 402 | | case 5: data &= ioport("KEY5")->read(); break; |
| 403 | | case 6: data &= ioport("KEY6")->read(); break; |
| 404 | | case 7: data &= ioport("KEY7")->read(); break; |
| 405 | | case 8: data &= ioport("KEY8")->read(); break; |
| 406 | | case 9: data &= ioport("KEY9")->read(); break; |
| 397 | case 0: data &= m_y0->read(); break; |
| 398 | case 1: data &= m_y1->read(); break; |
| 399 | case 2: data &= m_y2->read(); break; |
| 400 | case 3: data &= m_y3->read(); break; |
| 401 | case 4: data &= m_y4->read(); break; |
| 402 | case 5: data &= m_y5->read(); break; |
| 403 | case 6: data &= m_y6->read(); break; |
| 404 | case 7: data &= m_y7->read(); break; |
| 405 | case 8: data &= m_y8->read(); break; |
| 406 | case 9: data &= m_y9->read(); break; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | | data &= ioport("KEY10")->read(); |
| 409 | data &= m_y10->read(); |
| 410 | 410 | |
| 411 | 411 | return data; |
| 412 | 412 | } |
| r20434 | r20435 | |
| 437 | 437 | data |= (m_cassette->input() > 0.0) << 5; |
| 438 | 438 | |
| 439 | 439 | /* keyboard RPT */ |
| 440 | | data |= BIT(ioport("RPT")->read(), 0) << 6; |
| 440 | data |= BIT(m_rpt->read(), 0) << 6; |
| 441 | 441 | |
| 442 | 442 | /* MC6847 FS */ |
| 443 | 443 | data |= (m_vdg->fs_r() ? 1 : 0) << 7; |