src/mess/drivers/ti99_8.c
| r15509 | r15510 | |
| 212 | 212 | #include "machine/ti99/mapper8.h" |
| 213 | 213 | #include "machine/ti99/grom.h" |
| 214 | 214 | #include "machine/ti99/gromport.h" |
| 215 | | #include "machine/ti99/mecmouse.h" |
| 215 | #include "machine/ti99/joyport.h" |
| 216 | 216 | |
| 217 | 217 | #define VERBOSE 0 |
| 218 | 218 | #define LOG logerror |
| r15509 | r15510 | |
| 257 | 257 | tms9901_device *m_tms9901; |
| 258 | 258 | gromport_device *m_gromport; |
| 259 | 259 | peribox_device *m_peribox; |
| 260 | | mecmouse_device *m_mecmouse; |
| 261 | 260 | ti998_mapper_device *m_mapper; |
| 261 | joyport_device* m_joyport; |
| 262 | 262 | |
| 263 | int m_firstjoy; // First joystick. 14 for TI-99/8 |
| 264 | |
| 263 | 265 | int m_ready_line, m_ready_line1; |
| 264 | 266 | |
| 265 | 267 | private: |
| 266 | 268 | /* Keyboard support */ |
| 267 | | void set_key(int number, int data); |
| 268 | | int m_keyboard_column; |
| 269 | | int m_alphalock_line; |
| 269 | void set_keyboard_column(int number, int data); |
| 270 | int m_keyboard_column; |
| 271 | int m_alphalock_line; |
| 270 | 272 | }; |
| 271 | 273 | |
| 272 | | |
| 273 | 274 | /* |
| 274 | 275 | Memory map. We have a configurable mapper, so we need to delegate the |
| 275 | 276 | job to the mapper completely. |
| r15509 | r15510 | |
| 295 | 296 | |
| 296 | 297 | /* ti99/8 : 54-key keyboard */ |
| 297 | 298 | static INPUT_PORTS_START(ti99_8) |
| 298 | | PORT_START( "MECMOUSE" ) |
| 299 | | PORT_CONFNAME( 0x01, 0x00, "Mechatronics Mouse" ) |
| 300 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 301 | | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 302 | 299 | |
| 303 | | /* 3 ports for mouse */ |
| 304 | | PORT_START("MOUSEX") /* Mouse - X AXIS */ |
| 305 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 306 | | |
| 307 | | PORT_START("MOUSEY") /* Mouse - Y AXIS */ |
| 308 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 309 | | |
| 310 | | PORT_START("MOUSE0") /* Mouse - buttons */ |
| 311 | | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_PLAYER(1) |
| 312 | | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_PLAYER(1) |
| 313 | | |
| 314 | 300 | /* 16 ports for keyboard and joystick */ |
| 315 | | PORT_START("KEY0") /* col 0 */ |
| 301 | PORT_START("COL0") /* col 0 */ |
| 316 | 302 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ALPHA LOCK") PORT_CODE(KEYCODE_CAPSLOCK) |
| 317 | 303 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) |
| 318 | 304 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 319 | 305 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LSHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 320 | 306 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 321 | 307 | |
| 322 | | PORT_START("KEY1") /* col 1 */ |
| 308 | PORT_START("COL1") /* col 1 */ |
| 323 | 309 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 ! DEL") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 324 | 310 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("q Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 325 | 311 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a A") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 326 | 312 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("z Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 327 | 313 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 328 | 314 | |
| 329 | | PORT_START("KEY2") /* col 2 */ |
| 315 | PORT_START("COL2") /* col 2 */ |
| 330 | 316 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 @ INS") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 331 | 317 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("w W") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 332 | 318 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("s S (LEFT)") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 333 | 319 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("x X (DOWN)") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 334 | 320 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 335 | 321 | |
| 336 | | PORT_START("KEY3") /* col 3 */ |
| 322 | PORT_START("COL3") /* col 3 */ |
| 337 | 323 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 338 | 324 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("e E (UP)") PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 339 | 325 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("d D (RIGHT)") PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 340 | 326 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("c C") PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 341 | 327 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 342 | 328 | |
| 343 | | PORT_START("KEY4") /* col 4 */ |
| 329 | PORT_START("COL4") /* col 4 */ |
| 344 | 330 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ CLEAR") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 345 | 331 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("r R") PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 346 | 332 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("f F") PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 347 | 333 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("v V") PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 348 | 334 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 349 | 335 | |
| 350 | | PORT_START("KEY5") /* col 5 */ |
| 336 | PORT_START("COL5") /* col 5 */ |
| 351 | 337 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % BEGIN") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 352 | 338 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("t T") PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 353 | 339 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("g G") PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 354 | 340 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("b B") PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 355 | 341 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 356 | 342 | |
| 357 | | PORT_START("KEY6") /* col 6 */ |
| 343 | PORT_START("COL6") /* col 6 */ |
| 358 | 344 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^ PROC'D") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 359 | 345 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 360 | 346 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 361 | 347 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 362 | 348 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 363 | 349 | |
| 364 | | PORT_START("KEY7") /* col 7 */ |
| 350 | PORT_START("COL7") /* col 7 */ |
| 365 | 351 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 & AID") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 366 | 352 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 367 | 353 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 368 | 354 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 369 | 355 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 370 | 356 | |
| 371 | | PORT_START("KEY8") /* col 8 */ |
| 357 | PORT_START("COL8") /* col 8 */ |
| 372 | 358 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 * REDO") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 373 | 359 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 374 | 360 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 375 | 361 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 376 | 362 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 377 | 363 | |
| 378 | | PORT_START("KEY9") /* col 9 */ |
| 364 | PORT_START("COL9") /* col 9 */ |
| 379 | 365 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ( BACK") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 380 | 366 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 381 | 367 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 382 | 368 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 383 | 369 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 384 | 370 | |
| 385 | | PORT_START("KEY10") /* col 10 */ |
| 371 | PORT_START("COL10") /* col 10 */ |
| 386 | 372 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 387 | 373 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 388 | 374 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 389 | 375 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 390 | 376 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 391 | 377 | |
| 392 | | PORT_START("KEY11") /* col 11 */ |
| 378 | PORT_START("COL11") /* col 11 */ |
| 393 | 379 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= + QUIT") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 394 | 380 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 395 | 381 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') |
| 396 | 382 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT) |
| 397 | 383 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 398 | 384 | |
| 399 | | PORT_START("KEY12") /* col 12 */ |
| 385 | PORT_START("COL12") /* col 12 */ |
| 400 | 386 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 401 | 387 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 402 | 388 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 403 | 389 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(SPACE)") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 404 | 390 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 405 | 391 | |
| 406 | | PORT_START("KEY13") /* col 13 */ |
| 392 | PORT_START("COL13") /* col 13 */ |
| 407 | 393 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') |
| 408 | 394 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('`') PORT_CHAR('~') |
| 409 | 395 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED) |
| 410 | 396 | |
| 411 | | PORT_START("KEY14") /* col 14: "wired handset 1" (= joystick 1) */ |
| 412 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(1DOWN)", CODE_NONE, OSD_JOY_DOWN, 0*/) PORT_PLAYER(1) |
| 413 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(1RIGHT)", CODE_NONE, OSD_JOY_RIGHT, 0*/) PORT_PLAYER(1) |
| 414 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(1LEFT)", CODE_NONE, OSD_JOY_LEFT, 0*/) PORT_PLAYER(1) |
| 415 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(1UP)", CODE_NONE, OSD_JOY_UP*/) PORT_PLAYER(1) |
| 416 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(1FIRE)", CODE_NONE, OSD_JOY_FIRE, 0*/) PORT_PLAYER(1) |
| 417 | | |
| 418 | | PORT_START("KEY15") /* col 15: "wired handset 2" (= joystick 2) */ |
| 419 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(2UP)", CODE_NONE, OSD_JOY2_UP, 0*/) PORT_PLAYER(2) |
| 420 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(2DOWN)", CODE_NONE, OSD_JOY2_DOWN, 0*/) PORT_PLAYER(2) |
| 421 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(2RIGHT)", CODE_NONE, OSD_JOY2_RIGHT, 0*/) PORT_PLAYER(2) |
| 422 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(2LEFT)", CODE_NONE, OSD_JOY2_LEFT, 0*/) PORT_PLAYER(2) |
| 423 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(2FIRE)", CODE_NONE, OSD_JOY2_FIRE, 0*/) PORT_PLAYER(2) |
| 424 | 397 | INPUT_PORTS_END |
| 425 | 398 | |
| 426 | 399 | /***************************************************************************** |
| r15509 | r15510 | |
| 535 | 508 | keyboard column selection.) |
| 536 | 509 | ***************************************************************************/ |
| 537 | 510 | |
| 538 | | static const char *const keynames8[] = { |
| 539 | | "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", |
| 540 | | "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" |
| 511 | static const char *const column[] = { |
| 512 | "COL0", "COL1", "COL2", "COL3", "COL4", "COL5", "COL6", "COL7", |
| 513 | "COL8", "COL9", "COL10", "COL11", "COL12", "COL13" |
| 541 | 514 | }; |
| 542 | 515 | |
| 543 | 516 | READ8_MEMBER( ti99_8::read_by_9901 ) |
| 544 | 517 | { |
| 545 | 518 | int answer=0; |
| 546 | | |
| 519 | UINT8 joyst; |
| 547 | 520 | switch (offset & 0x03) |
| 548 | 521 | { |
| 549 | 522 | case TMS9901_CB_INT7: |
| r15509 | r15510 | |
| 554 | 527 | // bits 3-4: unused? |
| 555 | 528 | // bit 5: ??? |
| 556 | 529 | // bit 6-7: keyboard status bits 0 through 1 |
| 557 | | if (m_mecmouse != NULL && (m_keyboard_column == 15)) |
| 530 | |
| 531 | // |K|K|-|-|-|I2|I1|C| |
| 532 | if (m_keyboard_column >= m_firstjoy) |
| 558 | 533 | { |
| 559 | | answer = m_mecmouse->get_values8(0); |
| 534 | // TI-99/8's wiring differs from the TI-99/4A |
| 535 | joyst = m_joyport->read_port(); |
| 536 | answer = (joyst & 0x01) | ((joyst & 0x10)>>3); |
| 560 | 537 | } |
| 561 | 538 | else |
| 562 | 539 | { |
| 563 | | answer = (ioport(keynames8[m_keyboard_column])->read() << 6) & 0xC0; |
| 540 | answer = ioport(column[m_keyboard_column])->read(); |
| 564 | 541 | } |
| 542 | answer = (answer << 6) & 0xc0; |
| 543 | |
| 565 | 544 | break; |
| 566 | 545 | |
| 567 | 546 | case TMS9901_INT8_INT15: |
| r15509 | r15510 | |
| 569 | 548 | // |
| 570 | 549 | // bit 0-2: keyboard status bits 2 to 4 |
| 571 | 550 | // bit 3: tape input mirror |
| 572 | | // (bit 4: IR remote handset interrupt) |
| 551 | // bit 4: unused |
| 573 | 552 | // bit 5-7: weird, not emulated |
| 574 | | if (m_mecmouse != NULL && (m_keyboard_column == 15)) |
| 553 | |
| 554 | // |0|0|0|0|0|K|K|K| |
| 555 | |
| 556 | if (m_keyboard_column >= m_firstjoy) |
| 575 | 557 | { |
| 576 | | answer = m_mecmouse->get_values8(1); |
| 558 | joyst = m_joyport->read_port(); |
| 559 | answer = joyst << 1; |
| 577 | 560 | } |
| 578 | 561 | else |
| 579 | 562 | { |
| 580 | | answer = (ioport(keynames8[m_keyboard_column])->read() >> 2) & 0x07; |
| 563 | answer = ioport(column[m_keyboard_column])->read(); |
| 581 | 564 | } |
| 565 | answer = (answer >> 2) & 0x07; |
| 582 | 566 | break; |
| 583 | 567 | |
| 584 | 568 | case TMS9901_P0_P7: |
| r15509 | r15510 | |
| 601 | 585 | /* |
| 602 | 586 | WRITE key column select (P2-P4), TI-99/8 |
| 603 | 587 | */ |
| 604 | | void ti99_8::set_key(int number, int data) |
| 588 | void ti99_8::set_keyboard_column(int number, int data) |
| 605 | 589 | { |
| 606 | | if (data!=0) m_keyboard_column |= 1 << number; |
| 607 | | else m_keyboard_column &= ~(1 << number); |
| 590 | if (data != 0) m_keyboard_column |= 1 << number; |
| 591 | else m_keyboard_column &= ~(1 << number); |
| 608 | 592 | |
| 609 | | if (m_mecmouse != NULL) |
| 610 | | m_mecmouse->select(m_keyboard_column, 14, 15); |
| 593 | if (m_keyboard_column >= m_firstjoy) |
| 594 | { |
| 595 | m_joyport->write_port(m_keyboard_column - m_firstjoy + 1); |
| 596 | } |
| 611 | 597 | } |
| 612 | 598 | |
| 613 | 599 | WRITE_LINE_MEMBER( ti99_8::keyC0 ) |
| 614 | 600 | { |
| 615 | | set_key(0, state); |
| 601 | set_keyboard_column(0, state); |
| 616 | 602 | } |
| 617 | 603 | |
| 618 | 604 | WRITE_LINE_MEMBER( ti99_8::keyC1 ) |
| 619 | 605 | { |
| 620 | | set_key(1, state); |
| 606 | set_keyboard_column(1, state); |
| 621 | 607 | } |
| 622 | 608 | |
| 623 | 609 | WRITE_LINE_MEMBER( ti99_8::keyC2 ) |
| 624 | 610 | { |
| 625 | | set_key(2, state); |
| 611 | set_keyboard_column(2, state); |
| 626 | 612 | } |
| 627 | 613 | |
| 628 | 614 | WRITE_LINE_MEMBER( ti99_8::keyC3 ) |
| 629 | 615 | { |
| 630 | | set_key(3, state); |
| 616 | set_keyboard_column(3, state); |
| 631 | 617 | } |
| 632 | 618 | |
| 633 | 619 | /* |
| r15509 | r15510 | |
| 908 | 894 | DEVCB_DRIVER_LINE_MEMBER(ti99_8, console_ready), // READY |
| 909 | 895 | }; |
| 910 | 896 | |
| 897 | static JOYPORT_CONFIG( joyport8_60 ) |
| 898 | { |
| 899 | DEVCB_NULL, |
| 900 | 60 |
| 901 | }; |
| 902 | |
| 903 | static JOYPORT_CONFIG( joyport8_50 ) |
| 904 | { |
| 905 | DEVCB_NULL, |
| 906 | 50 |
| 907 | }; |
| 908 | |
| 911 | 909 | MACHINE_START( ti99_8 ) |
| 912 | 910 | { |
| 913 | 911 | ti99_8 *driver = machine.driver_data<ti99_8>(); |
| r15509 | r15510 | |
| 916 | 914 | driver->m_gromport = static_cast<gromport_device*>(machine.device(GROMPORT_TAG)); |
| 917 | 915 | driver->m_peribox = static_cast<peribox_device*>(machine.device(PERIBOX_TAG)); |
| 918 | 916 | driver->m_mapper = static_cast<ti998_mapper_device*>(machine.device(MAPPER_TAG)); |
| 917 | driver->m_joyport = static_cast<joyport_device*>(machine.device(JOYPORT_TAG)); |
| 918 | |
| 919 | 919 | driver->m_peribox->senila(CLEAR_LINE); |
| 920 | 920 | driver->m_peribox->senilb(CLEAR_LINE); |
| 921 | driver->m_firstjoy = 14; |
| 921 | 922 | } |
| 922 | 923 | |
| 923 | 924 | MACHINE_RESET( ti99_8 ) |
| 924 | 925 | { |
| 925 | 926 | ti99_8 *driver = machine.driver_data<ti99_8>(); |
| 926 | 927 | |
| 927 | | if (machine.root_device().ioport("MECMOUSE")->read()==0x01) |
| 928 | | driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG)); |
| 929 | | else |
| 930 | | driver->m_mecmouse = NULL; |
| 931 | | |
| 932 | 928 | driver->m_cpu->set_hold(CLEAR_LINE); |
| 933 | 929 | |
| 934 | 930 | // Pulling down the line on RESET configures the CPU to insert one wait |
| r15509 | r15510 | |
| 986 | 982 | /* Devices */ |
| 987 | 983 | MCFG_TISPEECH8_ADD(SPEECH_TAG, speech_config) |
| 988 | 984 | |
| 989 | | /* Optional user controller */ |
| 990 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 60 ) |
| 985 | // Joystick port |
| 986 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport8_60 ) |
| 991 | 987 | MACHINE_CONFIG_END |
| 992 | 988 | |
| 993 | 989 | |
| r15509 | r15510 | |
| 1031 | 1027 | /* Devices */ |
| 1032 | 1028 | MCFG_TISPEECH8_ADD(SPEECH_TAG, speech_config) |
| 1033 | 1029 | |
| 1034 | | /* Optional user controller */ |
| 1035 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 50 ) |
| 1030 | // Joystick port |
| 1031 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport8_50 ) |
| 1036 | 1032 | MACHINE_CONFIG_END |
| 1037 | 1033 | |
| 1038 | 1034 | /* |
src/mess/drivers/ti99_4p.c
| r15509 | r15510 | |
| 46 | 46 | #include "imagedev/cassette.h" |
| 47 | 47 | #include "machine/ti99/videowrp.h" |
| 48 | 48 | #include "machine/ti99/peribox.h" |
| 49 | #include "machine/ti99/joyport.h" |
| 49 | 50 | |
| 50 | 51 | #define TMS9901_TAG "tms9901" |
| 51 | 52 | #define SGCPU_TAG "sgcpu" |
| r15509 | r15510 | |
| 101 | 102 | ti_exp_video_device* m_video; |
| 102 | 103 | cassette_image_device* m_cassette; |
| 103 | 104 | peribox_device* m_peribox; |
| 105 | joyport_device* m_joyport; |
| 104 | 106 | |
| 105 | 107 | // Pointer to ROM0 |
| 106 | | UINT16 *m_rom0; |
| 108 | UINT16 *m_rom0; |
| 107 | 109 | |
| 108 | 110 | // Pointer to DSR ROM |
| 109 | | UINT16 *m_dsr; |
| 111 | UINT16 *m_dsr; |
| 110 | 112 | |
| 111 | 113 | // Pointer to ROM6, first bank |
| 112 | | UINT16 *m_rom6a; |
| 114 | UINT16 *m_rom6a; |
| 113 | 115 | |
| 114 | 116 | // Pointer to ROM6, second bank |
| 115 | | UINT16 *m_rom6b; |
| 117 | UINT16 *m_rom6b; |
| 116 | 118 | |
| 117 | 119 | // AMS RAM (1 Mib) |
| 118 | | UINT16 *m_ram; |
| 120 | UINT16 *m_ram; |
| 119 | 121 | |
| 120 | 122 | // Scratch pad ram (1 KiB) |
| 121 | | UINT16 *m_scratchpad; |
| 123 | UINT16 *m_scratchpad; |
| 122 | 124 | |
| 125 | // First joystick. 6 for TI-99/4A |
| 126 | int m_firstjoy; |
| 127 | |
| 123 | 128 | // READY line |
| 124 | 129 | int m_ready_line, m_ready_line_dmux; |
| 125 | 130 | |
| 126 | 131 | private: |
| 127 | 132 | DECLARE_READ16_MEMBER( datamux_read ); |
| 128 | 133 | DECLARE_WRITE16_MEMBER( datamux_write ); |
| 129 | | void set_key(int number, int data); |
| 134 | void set_keyboard_column(int number, int data); |
| 130 | 135 | |
| 131 | 136 | int m_keyboard_column; |
| 132 | | int m_alphalock_line; |
| 137 | int m_check_alphalock; |
| 133 | 138 | |
| 134 | 139 | // True if SGCPU DSR is enabled |
| 135 | 140 | bool m_internal_dsr; |
| r15509 | r15510 | |
| 180 | 185 | */ |
| 181 | 186 | |
| 182 | 187 | static INPUT_PORTS_START(ti99_4p) |
| 183 | | /* 3 ports for mouse */ |
| 184 | | PORT_START("MOUSEX") /* Mouse - X AXIS */ |
| 185 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 186 | | |
| 187 | | PORT_START("MOUSEY") /* Mouse - Y AXIS */ |
| 188 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 189 | | |
| 190 | | PORT_START("MOUSE0") /* Mouse - buttons */ |
| 191 | | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_PLAYER(1) |
| 192 | | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_PLAYER(1) |
| 193 | | |
| 194 | 188 | /* 4 ports for keyboard and joystick */ |
| 195 | | PORT_START("KEY0") /* col 0 */ |
| 196 | | PORT_BIT(0x0088, IP_ACTIVE_LOW, IPT_UNUSED) |
| 189 | PORT_START("COL0") // col 0 |
| 190 | PORT_BIT(0x88, IP_ACTIVE_LOW, IPT_UNUSED) |
| 197 | 191 | /* The original control key is located on the left, but we accept the right control key as well */ |
| 198 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 192 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 199 | 193 | /* TI99/4a has a second shift key which maps the same */ |
| 200 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 201 | | /* The original control key is located on the right, but we accept the left function key as well */ |
| 202 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_RALT) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2) |
| 203 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 204 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(SPACE)") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 205 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= + QUIT") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 206 | | /* col 1 */ |
| 207 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("x X (DOWN)") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 208 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("w W ~") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR('~') |
| 209 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("s S (LEFT)") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 210 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 @ INS") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 211 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ( BACK") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 212 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("o O '") PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR('\'') |
| 213 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("l L") PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 214 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 194 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 195 | /* The original function key is located on the right, but we accept the left alt key as well */ |
| 196 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_RALT) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2) |
| 197 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 198 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 199 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= + QUIT") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 215 | 200 | |
| 216 | | PORT_START("KEY1") /* col 2 */ |
| 217 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("c C `") PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR('`') |
| 218 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("e E (UP)") PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 219 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("d D (RIGHT)") PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 220 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 # ERASE") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 221 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 * REDO") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 222 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("i I ?") PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR('?') |
| 223 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("k K") PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 224 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 225 | | /* col 3 */ |
| 226 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("v V") PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 227 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("r R [") PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR('[') |
| 228 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("f F {") PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR('{') |
| 229 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ CLEAR") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 230 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 & AID") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 231 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("u U _") PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR('_') |
| 232 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("j J") PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 233 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("m M") PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 201 | PORT_START("COL1") // col 1 |
| 202 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 203 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR('~') |
| 204 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 205 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 206 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ( BACK") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 207 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR('\'') |
| 208 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 209 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 234 | 210 | |
| 235 | | PORT_START("KEY2") /* col 4 */ |
| 236 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("b B") PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 237 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("t T ]") PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(']') |
| 238 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("g G }") PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR('}') |
| 239 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % BEGIN") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 240 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^ PROC'D") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 241 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("y Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 242 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("h H") PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 243 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("n N") PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 244 | | /* col 5 */ |
| 245 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("z Z \\") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR('\\') |
| 246 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("q Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 247 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("a A |") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR('|') |
| 248 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 ! DEL") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 249 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 250 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("p P \"") PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR('\"') |
| 251 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 252 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ -") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('-') |
| 211 | PORT_START("COL2") // col 2 |
| 212 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR('`') |
| 213 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 214 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 215 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 # ERASE") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 216 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 * REDO") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 217 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR('?') |
| 218 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 219 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 253 | 220 | |
| 254 | | PORT_START("KEY3") /* col 6: "wired handset 1" (= joystick 1) */ |
| 255 | | PORT_BIT(0x00E0, IP_ACTIVE_LOW, IPT_UNUSED) |
| 256 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(1UP)", CODE_NONE, OSD_JOY_UP*/) PORT_PLAYER(1) |
| 257 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(1DOWN)", CODE_NONE, OSD_JOY_DOWN, 0*/) PORT_PLAYER(1) |
| 258 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(1RIGHT)", CODE_NONE, OSD_JOY_RIGHT, 0*/) PORT_PLAYER(1) |
| 259 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(1LEFT)", CODE_NONE, OSD_JOY_LEFT, 0*/) PORT_PLAYER(1) |
| 260 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(1FIRE)", CODE_NONE, OSD_JOY_FIRE, 0*/) PORT_PLAYER(1) |
| 261 | | /* col 7: "wired handset 2" (= joystick 2) */ |
| 262 | | PORT_BIT(0xE000, IP_ACTIVE_LOW, IPT_UNUSED) |
| 263 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(2UP)", CODE_NONE, OSD_JOY2_UP, 0*/) PORT_PLAYER(2) |
| 264 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(2DOWN)", CODE_NONE, OSD_JOY2_DOWN, 0*/) PORT_PLAYER(2) |
| 265 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(2RIGHT)", CODE_NONE, OSD_JOY2_RIGHT, 0*/) PORT_PLAYER(2) |
| 266 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(2LEFT)", CODE_NONE, OSD_JOY2_LEFT, 0*/) PORT_PLAYER(2) |
| 267 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(2FIRE)", CODE_NONE, OSD_JOY2_FIRE, 0*/) PORT_PLAYER(2) |
| 221 | PORT_START("COL3") // col 3 |
| 222 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 223 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR('[') |
| 224 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR('{') |
| 225 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ CLEAR") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 226 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 & AID") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 227 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR('_') |
| 228 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 229 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 268 | 230 | |
| 231 | PORT_START("COL4") // col 4 |
| 232 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 233 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(']') |
| 234 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR('}') |
| 235 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % BEGIN") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 236 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^ PROC'D") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 237 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 238 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 239 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 240 | |
| 241 | PORT_START("COL5") // col 5 |
| 242 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR('\\') |
| 243 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 244 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR('|') |
| 245 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 246 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') PORT_CHAR(UCHAR_MAMEKEY(F10)) |
| 247 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR('\"') |
| 248 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 249 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('-') |
| 250 | |
| 269 | 251 | PORT_START("ALPHA") /* one more port for Alpha line */ |
| 270 | | PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 252 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 271 | 253 | |
| 254 | |
| 272 | 255 | INPUT_PORTS_END |
| 273 | 256 | |
| 274 | 257 | /* |
| r15509 | r15510 | |
| 381 | 364 | { |
| 382 | 365 | if (m_access_mapper && ((addroff & 0xffe0)==0x4000)) |
| 383 | 366 | { |
| 384 | | COMBINE_DATA(&m_mapper[offset & 0x000f]); |
| 367 | m_mapper[offset & 0x000f] = data; |
| 385 | 368 | return; |
| 386 | 369 | } |
| 387 | 370 | } |
| r15509 | r15510 | |
| 405 | 388 | } |
| 406 | 389 | if ((addroff & 0xfc00)==0x8000) |
| 407 | 390 | { |
| 408 | | COMBINE_DATA(&m_scratchpad[(addroff & 0x03ff)>>1]); |
| 391 | m_scratchpad[(addroff & 0x03ff)>>1] = data; |
| 409 | 392 | return; |
| 410 | 393 | } |
| 411 | 394 | // Video: 8C00, 8C02 |
| r15509 | r15510 | |
| 472 | 455 | |
| 473 | 456 | // read more about the datamux in datamux.c |
| 474 | 457 | |
| 475 | | // byte-only transfer, high byte |
| 476 | | // we use the previously read low byte to complete |
| 477 | | if (mem_mask == 0xff00) |
| 478 | | data = data | m_lowbyte; |
| 479 | | |
| 480 | | // byte-only transfer, low byte |
| 481 | | // we use the previously read high byte to complete |
| 482 | | if (mem_mask == 0x00ff) |
| 483 | | data = data | (m_highbyte << 8); |
| 484 | | |
| 485 | 458 | // Write to the PEB |
| 486 | 459 | m_peribox->write(space, addroff+1, data & 0xff); |
| 487 | 460 | |
| r15509 | r15510 | |
| 571 | 544 | else // transparent mode |
| 572 | 545 | address = addroff; |
| 573 | 546 | |
| 574 | | COMBINE_DATA(&m_ram[address>>1]); |
| 547 | m_ram[address>>1] = data; |
| 575 | 548 | } |
| 576 | 549 | |
| 577 | 550 | /*************************************************************************** |
| 578 | 551 | Keyboard/tape control |
| 579 | 552 | ****************************************************************************/ |
| 580 | | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; |
| 553 | static const char *const column[] = { "COL0", "COL1", "COL2", "COL3", "COL4", "COL5" }; |
| 581 | 554 | |
| 582 | 555 | READ8_MEMBER( ti99_4p::read_by_9901 ) |
| 583 | 556 | { |
| r15509 | r15510 | |
| 587 | 560 | { |
| 588 | 561 | case TMS9901_CB_INT7: |
| 589 | 562 | // Read pins INT3*-INT7* of TI99's 9901. |
| 563 | // bit 1: INT1 status (interrupt; not set at this place) |
| 564 | // bit 2: INT2 status (interrupt; not set at this place) |
| 565 | // bit 3-7: keyboard status bits 0 to 4 |
| 590 | 566 | // |
| 591 | | // signification: |
| 592 | | // (bit 1: INT1 status) |
| 593 | | // (bit 2: INT2 status) |
| 594 | | // bit 3-7: keyboard status bits 0 to 4 |
| 595 | | answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8; |
| 596 | | if (m_alphalock_line==false) |
| 597 | | answer &= ~(ioport("ALPHA")->read() << 3); |
| 567 | // |K|K|K|K|K|I2|I1|C| |
| 568 | // |
| 569 | if (m_keyboard_column >= m_firstjoy) // joy 1 and 2 |
| 570 | { |
| 571 | answer = m_joyport->read_port(); |
| 572 | } |
| 573 | else |
| 574 | { |
| 575 | answer = ioport(column[m_keyboard_column])->read(); |
| 576 | } |
| 577 | if (m_check_alphalock) |
| 578 | { |
| 579 | answer &= ~(ioport("ALPHA")->read()); |
| 580 | } |
| 581 | answer = (answer << 3) & 0xf8; |
| 598 | 582 | break; |
| 599 | 583 | |
| 600 | 584 | case TMS9901_INT8_INT15: |
| r15509 | r15510 | |
| 602 | 586 | // bit 0-2: keyboard status bits 5 to 7 |
| 603 | 587 | // bit 3: tape input mirror |
| 604 | 588 | // bit 5-7: weird, not emulated |
| 605 | | if (m_keyboard_column == 7) answer = 0x07; |
| 606 | | else answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07; |
| 589 | |
| 590 | // |1|1|1|1|0|K|K|K| |
| 591 | if (m_keyboard_column >= m_firstjoy) answer = 0x07; |
| 592 | else answer = ((ioport(column[m_keyboard_column])->read())>>5) & 0x07; |
| 593 | answer |= 0xf0; |
| 607 | 594 | break; |
| 608 | 595 | |
| 609 | 596 | case TMS9901_P0_P7: |
| r15509 | r15510 | |
| 623 | 610 | /* |
| 624 | 611 | WRITE key column select (P2-P4) |
| 625 | 612 | */ |
| 626 | | void ti99_4p::set_key(int number, int data) |
| 613 | void ti99_4p::set_keyboard_column(int number, int data) |
| 627 | 614 | { |
| 628 | 615 | if (data!=0) m_keyboard_column |= 1 << number; |
| 629 | 616 | else m_keyboard_column &= ~(1 << number); |
| 617 | |
| 618 | if (m_keyboard_column >= m_firstjoy) |
| 619 | { |
| 620 | m_joyport->write_port(m_keyboard_column - m_firstjoy + 1); |
| 621 | } |
| 630 | 622 | } |
| 631 | 623 | |
| 632 | 624 | WRITE_LINE_MEMBER( ti99_4p::keyC0 ) |
| 633 | 625 | { |
| 634 | | set_key(0, state); |
| 626 | set_keyboard_column(0, state); |
| 635 | 627 | } |
| 636 | 628 | |
| 637 | 629 | WRITE_LINE_MEMBER( ti99_4p::keyC1 ) |
| 638 | 630 | { |
| 639 | | set_key(1, state); |
| 631 | set_keyboard_column(1, state); |
| 640 | 632 | } |
| 641 | 633 | |
| 642 | 634 | WRITE_LINE_MEMBER( ti99_4p::keyC2 ) |
| 643 | 635 | { |
| 644 | | set_key(2, state); |
| 636 | set_keyboard_column(2, state); |
| 645 | 637 | } |
| 646 | 638 | |
| 647 | 639 | /* |
| r15509 | r15510 | |
| 649 | 641 | */ |
| 650 | 642 | WRITE_LINE_MEMBER( ti99_4p::alphaW ) |
| 651 | 643 | { |
| 652 | | m_alphalock_line = state; |
| 644 | m_check_alphalock = (state==0); |
| 653 | 645 | } |
| 654 | 646 | |
| 655 | 647 | /* |
| r15509 | r15510 | |
| 825 | 817 | driver->m_video = static_cast<ti_exp_video_device*>(machine.device(VIDEO_SYSTEM_TAG)); |
| 826 | 818 | driver->m_cassette = static_cast<cassette_image_device*>(machine.device(CASSETTE_TAG)); |
| 827 | 819 | driver->m_tms9901 = static_cast<tms9901_device*>(machine.device(TMS9901_TAG)); |
| 820 | driver->m_joyport = static_cast<joyport_device*>(machine.device(JOYPORT_TAG)); |
| 828 | 821 | |
| 829 | 822 | driver->m_ram = (UINT16*)(*machine.root_device().memregion(SAMSMEM_TAG)); |
| 830 | 823 | driver->m_scratchpad = (UINT16*)(*machine.root_device().memregion(PADMEM_TAG)); |
| r15509 | r15510 | |
| 832 | 825 | driver->m_peribox->senila(CLEAR_LINE); |
| 833 | 826 | driver->m_peribox->senilb(CLEAR_LINE); |
| 834 | 827 | |
| 828 | driver->m_firstjoy = 6; |
| 829 | |
| 835 | 830 | driver->m_ready_line = driver->m_ready_line_dmux = ASSERT_LINE; |
| 836 | 831 | |
| 837 | 832 | UINT16 *rom = (UINT16*)(*machine.root_device().memregion("maincpu")); |
| r15509 | r15510 | |
| 854 | 849 | DEVCB_DRIVER_LINE_MEMBER(ti99_4p, console_ready) // READY |
| 855 | 850 | }; |
| 856 | 851 | |
| 852 | static JOYPORT_CONFIG( joyport4a_60 ) |
| 853 | { |
| 854 | DEVCB_NULL, |
| 855 | 60 |
| 856 | }; |
| 857 | |
| 857 | 858 | /* |
| 858 | 859 | Reset the machine. |
| 859 | 860 | */ |
| r15509 | r15510 | |
| 889 | 890 | MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4p, set_tms9901_INT2_from_v9938) |
| 890 | 891 | MCFG_TIMER_ADD_SCANLINE("scantimer", sgcpu_hblank_interrupt, SCREEN_TAG, 0, 1) |
| 891 | 892 | |
| 892 | | /* tms9901 */ |
| 893 | // tms9901 |
| 893 | 894 | MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_sgcpu, 3000000) |
| 894 | 895 | |
| 895 | | /* Peripheral expansion box (SGCPU composition) */ |
| 896 | // Peripheral expansion box (SGCPU composition) |
| 896 | 897 | MCFG_PERIBOX_SG_ADD( PERIBOX_TAG, peribox_conf ) |
| 897 | 898 | |
| 898 | | /* sound hardware */ |
| 899 | // sound hardware |
| 899 | 900 | MCFG_TI_SOUND_94624_ADD( TISOUND_TAG, sound_conf ) |
| 900 | 901 | |
| 901 | | /* Cassette drives */ |
| 902 | // Cassette drives |
| 902 | 903 | MCFG_SPEAKER_STANDARD_MONO("cass_out") |
| 903 | 904 | MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface ) |
| 904 | 905 | |
| 905 | 906 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) |
| 906 | 907 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) |
| 908 | |
| 909 | // Joystick port |
| 910 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport4a_60 ) |
| 911 | |
| 907 | 912 | MACHINE_CONFIG_END |
| 908 | 913 | |
| 909 | 914 | |
src/mess/drivers/ti99_4x.c
| r15509 | r15510 | |
| 26 | 26 | | ##=== Console ROM | |
| 27 | 27 | TMS9901 || +------ gromport (cartridge port) |
| 28 | 28 | (I/O) ##=== 256 byte RAM | |
| 29 | | || +------ sound |
| 30 | | ##=== 32KiB RAM |
| 31 | | unofficial mod |
| 32 | | (16 bit) |
| 29 | | || +------ sound |
| 30 | | ##=== 32KiB RAM |
| 31 | +---+--+ unofficial mod |
| 32 | | | (16 bit) |
| 33 | Cass joyport |
| 33 | 34 | |
| 34 | 35 | Michael Zapf |
| 35 | 36 | |
| r15509 | r15510 | |
| 50 | 51 | #include "machine/ti99/datamux.h" |
| 51 | 52 | #include "machine/ti99/grom.h" |
| 52 | 53 | #include "machine/ti99/gromport.h" |
| 53 | | #include "machine/ti99/mecmouse.h" |
| 54 | | #include "machine/ti99/handset.h" |
| 54 | #include "machine/ti99/joyport.h" |
| 55 | 55 | #include "machine/ti99/peribox.h" |
| 56 | 56 | |
| 57 | 57 | #define LOG logerror |
| r15509 | r15510 | |
| 86 | 86 | DECLARE_WRITE_LINE_MEMBER( clock_out ); |
| 87 | 87 | |
| 88 | 88 | // Some values to keep |
| 89 | | int m_mode; |
| 90 | 89 | tms9900_device* m_cpu; |
| 91 | 90 | tms9901_device* m_tms9901; |
| 92 | 91 | gromport_device* m_gromport; |
| 93 | 92 | peribox_device* m_peribox; |
| 94 | | mecmouse_device* m_mecmouse; |
| 95 | | ti99_handset_device* m_handset; |
| 93 | joyport_device* m_joyport; |
| 96 | 94 | ti99_datamux_device* m_datamux; |
| 97 | 95 | |
| 98 | 96 | int m_ready_line, m_ready_line_dmux; |
| 99 | 97 | |
| 98 | int m_firstjoy; // First joystick. 6 for TI-99/4A, 5 for TI-99/4 |
| 99 | |
| 100 | 100 | // Connections with the system interface TMS9901 |
| 101 | 101 | DECLARE_READ8_MEMBER(read_by_9901); |
| 102 | 102 | DECLARE_WRITE_LINE_MEMBER(keyC0); |
| r15509 | r15510 | |
| 111 | 111 | DECLARE_WRITE_LINE_MEMBER(alphaW); |
| 112 | 112 | |
| 113 | 113 | private: |
| 114 | | void set_key(int number, int data); |
| 114 | void set_keyboard_column(int number, int data); |
| 115 | 115 | int m_keyboard_column; |
| 116 | | int m_alphalock_line; |
| 116 | int m_check_alphalock; |
| 117 | 117 | int m_ready_prev; // for debugging purposes only |
| 118 | 118 | }; |
| 119 | 119 | |
| r15509 | r15510 | |
| 163 | 163 | /***************************************************************************** |
| 164 | 164 | Input ports |
| 165 | 165 | ****************************************************************************/ |
| 166 | | /* TI99/4a: 48-key keyboard, plus two optional joysticks (2 shift keys) */ |
| 167 | | static INPUT_PORTS_START(ti99_4a) |
| 168 | 166 | |
| 169 | | PORT_START( "MECMOUSE" ) |
| 170 | | PORT_CONFNAME( 0x01, 0x00, "Mechatronics Mouse" ) |
| 171 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 172 | | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 167 | static INPUT_PORTS_START(ti99_4) |
| 168 | PORT_START("COL0") // col 0 |
| 169 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 170 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q QUIT") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 171 | /* TI99/4 has a second space key which maps the same */ |
| 172 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(' ') |
| 173 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 174 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 175 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P \"") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('"') |
| 176 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L =") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('=') |
| 177 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 173 | 178 | |
| 174 | | /* 4 ports for keyboard and joystick */ |
| 175 | | PORT_START("KEY0") /* col 0 */ |
| 176 | | PORT_BIT(0x0088, IP_ACTIVE_LOW, IPT_UNUSED) |
| 177 | | /* The original control key is located on the left, but we accept the right control key as well */ |
| 178 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 179 | | /* TI99/4a has a second shift key which maps the same */ |
| 180 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 181 | | /* The original function key is located on the right, but we accept the left alt key as well */ |
| 182 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_RALT) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2) |
| 183 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 184 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 185 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= + QUIT") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 186 | | /* col 1 */ |
| 187 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 188 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR('~') |
| 189 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 190 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 191 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ( BACK") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 192 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR('\'') |
| 193 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 194 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 179 | PORT_START("COL1") // col 1 |
| 180 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 181 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W BEGIN") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 182 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A AID") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 183 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z BACK") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 184 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 185 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O +") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('+') |
| 186 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K /") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('/') |
| 187 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", .") PORT_CODE(KEYCODE_STOP) PORT_CHAR(',') PORT_CHAR('.') |
| 195 | 188 | |
| 196 | | PORT_START("KEY1") /* col 2 */ |
| 197 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR('`') |
| 198 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 199 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 200 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 # ERASE") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 201 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 * REDO") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 202 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR('?') |
| 203 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 204 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 189 | PORT_START("COL2") // col 2 |
| 190 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 191 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E UP") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 192 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S LEFT") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 193 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X DOWN") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 194 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 195 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I -") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('-') |
| 196 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J ^") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('^') |
| 197 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M ;") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR(';') |
| 205 | 198 | /* col 3 */ |
| 206 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 207 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR('[') |
| 208 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR('{') |
| 209 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ CLEAR") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 210 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 & AID") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 211 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR('_') |
| 212 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 213 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 199 | PORT_START("COL3") // col 3 |
| 200 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 201 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R REDO") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 202 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D RIGHT") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 203 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C CLEAR") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 204 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 205 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U _") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('_') |
| 206 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H <") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('<') |
| 207 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N :") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR(':') |
| 214 | 208 | |
| 215 | | PORT_START("KEY2") /* col 4 */ |
| 216 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 217 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(']') |
| 218 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR('}') |
| 219 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % BEGIN") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 220 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^ PROC'D") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 221 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 222 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 223 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 224 | | /* col 5 */ |
| 225 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR('\\') |
| 226 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 227 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR('|') |
| 228 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 229 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') PORT_CHAR(UCHAR_MAMEKEY(F10)) |
| 230 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR('\"') |
| 231 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 232 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('-') |
| 209 | PORT_START("COL4") // col 4 |
| 210 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 211 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T ERASE") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 212 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F DEL") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 213 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V PROC'D") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 214 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('\'') |
| 215 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y >") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('>') |
| 216 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G INS") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 217 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B ?") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('?') |
| 233 | 218 | |
| 234 | | PORT_START("KEY3") /* col 6: "wired handset 1" (= joystick 1) */ |
| 235 | | PORT_BIT(0x00E0, IP_ACTIVE_LOW, IPT_UNUSED) |
| 236 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(1UP)", CODE_NONE, OSD_JOY_UP*/) PORT_PLAYER(1) |
| 237 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(1DOWN)", CODE_NONE, OSD_JOY_DOWN, 0*/) PORT_PLAYER(1) |
| 238 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(1RIGHT)", CODE_NONE, OSD_JOY_RIGHT, 0*/) PORT_PLAYER(1) |
| 239 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(1LEFT)", CODE_NONE, OSD_JOY_LEFT, 0*/) PORT_PLAYER(1) |
| 240 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(1FIRE)", CODE_NONE, OSD_JOY_FIRE, 0*/) PORT_PLAYER(1) |
| 241 | | /* col 7: "wired handset 2" (= joystick 2) */ |
| 242 | | PORT_BIT(0xE000, IP_ACTIVE_LOW, IPT_UNUSED) |
| 243 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(2UP)", CODE_NONE, OSD_JOY2_UP, 0*/) PORT_PLAYER(2) |
| 244 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(2DOWN)", CODE_NONE, OSD_JOY2_DOWN, 0*/) PORT_PLAYER(2) |
| 245 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(2RIGHT)", CODE_NONE, OSD_JOY2_RIGHT, 0*/) PORT_PLAYER(2) |
| 246 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(2LEFT)", CODE_NONE, OSD_JOY2_LEFT, 0*/) PORT_PLAYER(2) |
| 247 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(2FIRE)", CODE_NONE, OSD_JOY2_FIRE, 0*/) PORT_PLAYER(2) |
| 248 | | |
| 249 | | |
| 250 | | PORT_START("ALPHA") /* one more port for Alpha line */ |
| 251 | | PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 252 | | |
| 253 | 219 | INPUT_PORTS_END |
| 254 | 220 | |
| 255 | | static INPUT_PORTS_START(ti99_4) |
| 256 | | PORT_START( "MECMOUSE" ) |
| 257 | | PORT_CONFNAME( 0x01, 0x00, "Mechatronics Mouse" ) |
| 221 | /* TI99/4a: 48-key keyboard */ |
| 222 | static INPUT_PORTS_START(ti99_4a) |
| 223 | PORT_START( "ALPHABUG" ) |
| 224 | PORT_CONFNAME( 0x01, 0x01, "Alpha Lock blocks joystick up" ) |
| 258 | 225 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 259 | 226 | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 260 | 227 | |
| 261 | | PORT_START( "HANDSET" ) |
| 262 | | PORT_CONFNAME( 0x01, 0x00, "IR Handset" ) |
| 263 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 264 | | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 228 | PORT_START("COL0") // col 0 |
| 229 | PORT_BIT(0x88, IP_ACTIVE_LOW, IPT_UNUSED) |
| 230 | /* The original control key is located on the left, but we accept the right control key as well */ |
| 231 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 232 | /* TI99/4a has a second shift key which maps the same */ |
| 233 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 234 | /* The original function key is located on the right, but we accept the left alt key as well */ |
| 235 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_RALT) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2) |
| 236 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 237 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 238 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= + QUIT") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 265 | 239 | |
| 266 | | /* 4 ports for keyboard and joystick */ |
| 267 | | PORT_START("KEY0") /* col 0 */ |
| 268 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 269 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q QUIT") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 270 | | /* TI99/4 has a second space key which maps the same */ |
| 271 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(' ') |
| 272 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 273 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 274 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P \"") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('"') |
| 275 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L =") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('=') |
| 276 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 277 | | /* col 1 */ |
| 278 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 279 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W BEGIN") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 280 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A AID") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 281 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z BACK") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 282 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 283 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O +") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('+') |
| 284 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K /") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('/') |
| 285 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", .") PORT_CODE(KEYCODE_STOP) PORT_CHAR(',') PORT_CHAR('.') |
| 240 | PORT_START("COL1") // col 1 |
| 241 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 242 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR('~') |
| 243 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 244 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 245 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ( BACK") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 246 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR('\'') |
| 247 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 248 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 286 | 249 | |
| 287 | | PORT_START("KEY1") /* col 2 */ |
| 288 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 289 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E UP") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 290 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S LEFT") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 291 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X DOWN") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 292 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 293 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I -") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('-') |
| 294 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J ^") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('^') |
| 295 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M ;") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR(';') |
| 296 | | /* col 3 */ |
| 297 | | PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 298 | | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R REDO") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 299 | | PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D RIGHT") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 300 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C CLEAR") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 301 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 302 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U _") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('_') |
| 303 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H <") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('<') |
| 304 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N :") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR(':') |
| 250 | PORT_START("COL2") // col 2 |
| 251 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR('`') |
| 252 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 253 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 254 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 # ERASE") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 255 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 * REDO") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 256 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR('?') |
| 257 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 258 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 305 | 259 | |
| 306 | | PORT_START("KEY2") /* col 4 */ |
| 307 | | PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 308 | | PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T ERASE") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 309 | | PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F DEL") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 310 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V PROC'D") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 311 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('\'') |
| 312 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y >") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('>') |
| 313 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G INS") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 314 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B ?") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('?') |
| 315 | | /* col 5: "wired handset 1" (= joystick 1) */ |
| 316 | | PORT_BIT(0xE000, IP_ACTIVE_LOW, IPT_UNUSED) |
| 317 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(1UP)", CODE_NONE, OSD_JOY_UP*/) PORT_PLAYER(1) |
| 318 | | PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(1DOWN)", CODE_NONE, OSD_JOY_DOWN, 0*/) PORT_PLAYER(1) |
| 319 | | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(1RIGHT)", CODE_NONE, OSD_JOY_RIGHT, 0*/) PORT_PLAYER(1) |
| 320 | | PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(1LEFT)", CODE_NONE, OSD_JOY_LEFT, 0*/) PORT_PLAYER(1) |
| 321 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(1FIRE)", CODE_NONE, OSD_JOY_FIRE, 0*/) PORT_PLAYER(1) |
| 260 | PORT_START("COL3") // col 3 |
| 261 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 262 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR('[') |
| 263 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR('{') |
| 264 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ CLEAR") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 265 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 & AID") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 266 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR('_') |
| 267 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 268 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 322 | 269 | |
| 323 | | PORT_START("KEY3") /* col 6: "wired handset 2" (= joystick 2) */ |
| 324 | | PORT_BIT(0x00E0, IP_ACTIVE_LOW, IPT_UNUSED) |
| 325 | | PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(2UP)", CODE_NONE, OSD_JOY2_UP, 0*/) PORT_PLAYER(2) |
| 326 | | PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN/*, "(2DOWN)", CODE_NONE, OSD_JOY2_DOWN, 0*/) PORT_PLAYER(2) |
| 327 | | PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT/*, "(2RIGHT)", CODE_NONE, OSD_JOY2_RIGHT, 0*/) PORT_PLAYER(2) |
| 328 | | PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT/*, "(2LEFT)", CODE_NONE, OSD_JOY2_LEFT, 0*/) PORT_PLAYER(2) |
| 329 | | PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(2FIRE)", CODE_NONE, OSD_JOY2_FIRE, 0*/) PORT_PLAYER(2) |
| 330 | | /* col 7: never used (selects IR remote handset instead) */ |
| 331 | | /*PORT_BITX(0xFF00, IP_ACTIVE_LOW, IPT_UNUSED, DEF_STR( Unused ), CODE_NONE, CODE_NONE)*/ |
| 270 | PORT_START("COL4") // col 4 |
| 271 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 272 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(']') |
| 273 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR('}') |
| 274 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % BEGIN") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 275 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 ^ PROC'D") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 276 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 277 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 278 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 279 | |
| 280 | PORT_START("COL5") // col 5 |
| 281 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR('\\') |
| 282 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 283 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR('|') |
| 284 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 285 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') PORT_CHAR(UCHAR_MAMEKEY(F10)) |
| 286 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR('\"') |
| 287 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 288 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('-') |
| 289 | |
| 290 | PORT_START("ALPHA") /* one more port for Alpha line */ |
| 291 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 292 | |
| 332 | 293 | INPUT_PORTS_END |
| 333 | 294 | |
| 295 | |
| 334 | 296 | /***************************************************************************** |
| 335 | 297 | Components |
| 336 | 298 | ******************************************************************************/ |
| r15509 | r15510 | |
| 426 | 388 | ***************************************************************************/ |
| 427 | 389 | |
| 428 | 390 | |
| 429 | | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; |
| 391 | static const char *const column[] = { "COL0", "COL1", "COL2", "COL3", "COL4", "COL5" }; |
| 430 | 392 | |
| 431 | 393 | READ8_MEMBER( ti99_4x::read_by_9901 ) |
| 432 | 394 | { |
| 433 | 395 | int answer=0; |
| 396 | |
| 434 | 397 | switch (offset & 0x03) |
| 435 | 398 | { |
| 436 | 399 | case TMS9901_CB_INT7: |
| r15509 | r15510 | |
| 440 | 403 | // bit 2: INT2 status (interrupt; not set at this place) |
| 441 | 404 | // bit 3-7: keyboard status bits 0 to 4 |
| 442 | 405 | // |
| 443 | | if (m_mode==TI994) |
| 406 | // |K|K|K|K|K|I2|I1|C| |
| 407 | // |
| 408 | if (m_keyboard_column >= m_firstjoy) // joy 1, 2, handset |
| 444 | 409 | { |
| 445 | | if (m_keyboard_column == 7) |
| 446 | | { |
| 447 | | if (m_handset != NULL) |
| 448 | | { |
| 449 | | answer = (m_handset->poll_bus() << 3); |
| 450 | | answer |= 0x80; |
| 451 | | } |
| 452 | | } |
| 453 | | else |
| 454 | | { |
| 455 | | if ((m_mecmouse != NULL) && (m_keyboard_column == 6)) |
| 456 | | { |
| 457 | | answer = m_mecmouse->get_values(); |
| 458 | | } |
| 459 | | else |
| 460 | | { |
| 461 | | answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8; |
| 462 | | } |
| 463 | | } |
| 410 | answer = m_joyport->read_port(); |
| 411 | // The hardware bug of the TI-99/4A: you have to release the |
| 412 | // Alphalock key when using joysticks. This is a maldesign of the |
| 413 | // board: When none of the other keyboard lines are selected the |
| 414 | // depressed Alphalock key pulls up the /INT7 line which is also |
| 415 | // used for joystick up. The joystick switch then fails to lower |
| 416 | // the line enough to make the TMS9901 sense the low level. |
| 417 | // A reported, feasible fix was to cut the line and insert a diode |
| 418 | // below the Alphalock key. |
| 419 | if ((ioport("ALPHABUG")!=0) && m_firstjoy==6) answer |= ioport("ALPHA")->read(); |
| 464 | 420 | } |
| 465 | 421 | else |
| 466 | 422 | { |
| 467 | | if ((m_mecmouse != NULL) && (m_keyboard_column == 7)) |
| 468 | | { |
| 469 | | answer = m_mecmouse->get_values(); |
| 470 | | } |
| 471 | | else |
| 472 | | { |
| 473 | | answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) << 3) & 0xF8; |
| 474 | | } |
| 475 | | |
| 476 | | if ((m_mode != TI994) && (m_alphalock_line==false)) |
| 477 | | { |
| 478 | | answer &= ~(ioport("ALPHA")->read() << 3); |
| 479 | | } |
| 423 | answer = ioport(column[m_keyboard_column])->read(); |
| 480 | 424 | } |
| 425 | if (m_check_alphalock) // never true for TI-99/4 |
| 426 | { |
| 427 | answer &= ~(ioport("ALPHA")->read()); |
| 428 | } |
| 429 | answer = (answer << 3) & 0xf8; |
| 481 | 430 | |
| 482 | 431 | break; |
| 483 | 432 | |
| 484 | 433 | case TMS9901_INT8_INT15: |
| 485 | | if (m_keyboard_column == 7) |
| 486 | | { |
| 487 | | answer = 0x07; |
| 488 | | } |
| 489 | | else |
| 490 | | { |
| 491 | | answer = ((ioport(keynames[m_keyboard_column >> 1])->read() >> ((m_keyboard_column & 1) * 8)) >> 5) & 0x07; |
| 492 | | } |
| 434 | // |1|1|1|1|0|K|K|K| |
| 435 | if (m_keyboard_column >= m_firstjoy) answer = 0x07; |
| 436 | else answer = ((ioport(column[m_keyboard_column])->read())>>5) & 0x07; |
| 437 | answer |= 0xf0; |
| 493 | 438 | break; |
| 494 | 439 | |
| 495 | 440 | case TMS9901_P0_P7: |
| 496 | | if (m_handset != NULL) |
| 497 | | { |
| 498 | | if (m_handset->get_clock()) answer |= 2; |
| 499 | | } |
| 441 | // Required for the handset (only on TI-99/4) |
| 442 | if ((m_joyport->read_port() & 0x20)!=0) answer |= 2; |
| 500 | 443 | break; |
| 501 | 444 | |
| 502 | 445 | case TMS9901_P8_P15: |
| 446 | // Preset to 1 |
| 503 | 447 | answer = 4; |
| 504 | | /* on systems without handset, the pin is pulled up to avoid spurious interrupts */ |
| 505 | | if (m_handset != NULL) |
| 506 | | { |
| 507 | | if (m_handset->get_int()) answer = 0; |
| 508 | | } |
| 509 | | /* we don't take CS2 into account, as CS2 is a write-only unit */ |
| 448 | |
| 449 | // Interrupt pin of the handset (only on TI-99/4) |
| 450 | // Negative logic (interrupt pulls line down) |
| 451 | if ((m_joyport->read_port() & 0x40)==0) answer = 0; |
| 452 | |
| 453 | // we don't take CS2 into account, as CS2 is a write-only unit |
| 510 | 454 | if ((machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0) |
| 511 | 455 | { |
| 512 | 456 | answer |= 8; |
| r15509 | r15510 | |
| 521 | 465 | */ |
| 522 | 466 | WRITE_LINE_MEMBER( ti99_4x::handset_ack ) |
| 523 | 467 | { |
| 524 | | if (m_handset != NULL) |
| 525 | | { |
| 526 | | if (VERBOSE>7) LOG("ti99_4x: Set handset ack %d\n", state); |
| 527 | | m_handset->set_acknowledge(state); |
| 528 | | } |
| 468 | // Write a value to the joyport. If there is a handset this will set its |
| 469 | // ACK line. |
| 470 | m_joyport->write_port(state==ASSERT_LINE? 0x01 : 0x00); |
| 529 | 471 | } |
| 530 | 472 | |
| 531 | 473 | /* |
| 532 | 474 | WRITE key column select (P2-P4), TI-99/4 |
| 533 | 475 | */ |
| 534 | | void ti99_4x::set_key(int number, int data) |
| 476 | void ti99_4x::set_keyboard_column(int number, int data) |
| 535 | 477 | { |
| 536 | | int index = (m_mode==TI994A)? 6 : 5; |
| 537 | | |
| 538 | 478 | if (data != 0) |
| 539 | 479 | m_keyboard_column |= 1 << number; |
| 540 | 480 | else |
| 541 | 481 | m_keyboard_column &= ~ (1 << number); |
| 542 | 482 | |
| 543 | | if (m_mecmouse != NULL) |
| 544 | | m_mecmouse->select(m_keyboard_column, index, index+1); |
| 483 | if (m_keyboard_column >= m_firstjoy) |
| 484 | { |
| 485 | m_joyport->write_port(m_keyboard_column - m_firstjoy + 1); |
| 486 | } |
| 487 | |
| 488 | // TI-99/4: joystick 1 = column 5 |
| 489 | // joystick 2 = column 6 |
| 490 | // (only for the prototype versions; the released versions had no IR |
| 491 | // handset and the board was already redesigned to use columns 6 and 7) |
| 492 | |
| 493 | // TI-99/4A: joystick 1 = column 6 |
| 494 | // joystick 2 = column 7 |
| 545 | 495 | } |
| 546 | 496 | |
| 547 | 497 | WRITE_LINE_MEMBER( ti99_4x::keyC0 ) |
| 548 | 498 | { |
| 549 | | set_key(0, state); |
| 499 | set_keyboard_column(0, state); |
| 550 | 500 | } |
| 551 | 501 | |
| 552 | 502 | WRITE_LINE_MEMBER( ti99_4x::keyC1 ) |
| 553 | 503 | { |
| 554 | | set_key(1, state); |
| 504 | set_keyboard_column(1, state); |
| 555 | 505 | } |
| 556 | 506 | |
| 557 | 507 | WRITE_LINE_MEMBER( ti99_4x::keyC2 ) |
| 558 | 508 | { |
| 559 | | set_key(2, state); |
| 509 | set_keyboard_column(2, state); |
| 560 | 510 | } |
| 561 | 511 | |
| 562 | 512 | /* |
| r15509 | r15510 | |
| 564 | 514 | */ |
| 565 | 515 | WRITE_LINE_MEMBER( ti99_4x::alphaW ) |
| 566 | 516 | { |
| 567 | | m_alphalock_line = state; |
| 517 | m_check_alphalock = (state==0); |
| 568 | 518 | } |
| 569 | 519 | |
| 570 | 520 | /* |
| r15509 | r15510 | |
| 650 | 600 | */ |
| 651 | 601 | WRITE_LINE_MEMBER( ti99_4x::set_tms9901_INT12) |
| 652 | 602 | { |
| 653 | | if (m_handset!=NULL) m_tms9901->set_single_int(12, state); |
| 603 | m_tms9901->set_single_int(12, state); |
| 654 | 604 | } |
| 655 | 605 | |
| 656 | 606 | /*********************************************************** |
| r15509 | r15510 | |
| 715 | 665 | DEVCB_DRIVER_LINE_MEMBER(ti99_4x, set_tms9901_INT2) |
| 716 | 666 | }; |
| 717 | 667 | |
| 718 | | static TI99_HANDSET_INTERFACE(ti99_4_handset_interface) |
| 719 | | { |
| 720 | | DEVCB_DRIVER_LINE_MEMBER(ti99_4x, set_tms9901_INT12) |
| 721 | | }; |
| 722 | | |
| 723 | 668 | /* TMS9901 setup. */ |
| 724 | 669 | const tms9901_interface tms9901_wiring_ti99_4 = |
| 725 | 670 | { |
| r15509 | r15510 | |
| 838 | 783 | DEVCB_NULL // Hold acknowledge |
| 839 | 784 | }; |
| 840 | 785 | |
| 786 | static JOYPORT_CONFIG( joyport4_60 ) |
| 787 | { |
| 788 | DEVCB_DRIVER_LINE_MEMBER(ti99_4x, set_tms9901_INT12), |
| 789 | 60 |
| 790 | }; |
| 791 | |
| 792 | static JOYPORT_CONFIG( joyport4_50 ) |
| 793 | { |
| 794 | DEVCB_DRIVER_LINE_MEMBER(ti99_4x, set_tms9901_INT12), |
| 795 | 50 |
| 796 | }; |
| 797 | |
| 798 | static JOYPORT_CONFIG( joyport4a_60 ) |
| 799 | { |
| 800 | DEVCB_NULL, |
| 801 | 60 |
| 802 | }; |
| 803 | |
| 804 | static JOYPORT_CONFIG( joyport4a_50 ) |
| 805 | { |
| 806 | DEVCB_NULL, |
| 807 | 50 |
| 808 | }; |
| 809 | |
| 810 | |
| 841 | 811 | /****************************************************************************** |
| 842 | 812 | Machine definitions |
| 843 | 813 | ******************************************************************************/ |
| r15509 | r15510 | |
| 845 | 815 | MACHINE_START( ti99_4 ) |
| 846 | 816 | { |
| 847 | 817 | ti99_4x *driver = machine.driver_data<ti99_4x>(); |
| 848 | | driver->m_mode = TI994; |
| 849 | 818 | |
| 850 | 819 | driver->m_cpu = static_cast<tms9900_device*>(machine.device("maincpu")); |
| 851 | 820 | driver->m_tms9901 = static_cast<tms9901_device*>(machine.device(TMS9901_TAG)); |
| r15509 | r15510 | |
| 855 | 824 | driver->m_peribox = static_cast<peribox_device*>(machine.device(PERIBOX_TAG)); |
| 856 | 825 | driver->m_datamux = static_cast<ti99_datamux_device*>(machine.device(DATAMUX_TAG)); |
| 857 | 826 | |
| 827 | driver->m_joyport = static_cast<joyport_device*>(machine.device(JOYPORT_TAG)); |
| 828 | |
| 858 | 829 | driver->m_peribox->senila(CLEAR_LINE); |
| 859 | 830 | driver->m_peribox->senilb(CLEAR_LINE); |
| 831 | driver->m_firstjoy = 5; |
| 860 | 832 | |
| 861 | 833 | driver->m_ready_line = driver->m_ready_line_dmux = ASSERT_LINE; |
| 862 | 834 | } |
| r15509 | r15510 | |
| 864 | 836 | MACHINE_RESET( ti99_4 ) |
| 865 | 837 | { |
| 866 | 838 | ti99_4x *driver = machine.driver_data<ti99_4x>(); |
| 867 | | if (machine.root_device().ioport("HANDSET")->read()==0x01) |
| 868 | | driver->m_handset = static_cast<ti99_handset_device*>(machine.device(HANDSET_TAG)); |
| 869 | | else |
| 870 | | driver->m_handset = NULL; |
| 871 | | |
| 872 | | if (machine.root_device().ioport("MECMOUSE")->read()==0x01) |
| 873 | | driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG)); |
| 874 | | else |
| 875 | | driver->m_mecmouse = NULL; |
| 876 | | |
| 877 | 839 | driver->m_cpu->set_ready(ASSERT_LINE); |
| 878 | 840 | driver->m_cpu->set_hold(CLEAR_LINE); |
| 879 | 841 | } |
| r15509 | r15510 | |
| 917 | 879 | MCFG_GROM_ADD( GROM1_TAG, grom1_config ) |
| 918 | 880 | MCFG_GROM_ADD( GROM2_TAG, grom2_config ) |
| 919 | 881 | |
| 920 | | /* User controller */ |
| 921 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 60 ) |
| 922 | | MCFG_HANDSET_ADD( HANDSET_TAG, ti99_4_handset_interface, 60 ) |
| 882 | // Joystick port |
| 883 | MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, joyport4_60 ) |
| 923 | 884 | |
| 924 | | |
| 925 | 885 | MACHINE_CONFIG_END |
| 926 | 886 | |
| 927 | 887 | static MACHINE_CONFIG_START( ti99_4_50hz, ti99_4x ) |
| r15509 | r15510 | |
| 961 | 921 | MCFG_GROM_ADD( GROM1_TAG, grom1_config ) |
| 962 | 922 | MCFG_GROM_ADD( GROM2_TAG, grom2_config ) |
| 963 | 923 | |
| 964 | | /* User controller */ |
| 965 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 50 ) |
| 966 | | MCFG_HANDSET_ADD( HANDSET_TAG, ti99_4_handset_interface, 50 ) |
| 924 | // Joystick port |
| 925 | MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, joyport4_50 ) |
| 926 | |
| 967 | 927 | MACHINE_CONFIG_END |
| 968 | 928 | |
| 969 | 929 | /* |
| r15509 | r15510 | |
| 973 | 933 | MACHINE_START( ti99_4a ) |
| 974 | 934 | { |
| 975 | 935 | ti99_4x *driver = machine.driver_data<ti99_4x>(); |
| 976 | | driver->m_mode = TI994A; |
| 977 | 936 | |
| 978 | 937 | driver->m_cpu = static_cast<tms9900_device*>(machine.device("maincpu")); |
| 979 | 938 | driver->m_tms9901 = static_cast<tms9901_device*>(machine.device(TMS9901_TAG)); |
| 980 | 939 | |
| 981 | | driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG)); |
| 982 | 940 | driver->m_gromport = static_cast<gromport_device*>(machine.device(GROMPORT_TAG)); |
| 983 | 941 | driver->m_peribox = static_cast<peribox_device*>(machine.device(PERIBOX_TAG)); |
| 984 | 942 | |
| 985 | 943 | driver->m_datamux = static_cast<ti99_datamux_device*>(machine.device(DATAMUX_TAG)); |
| 944 | driver->m_joyport = static_cast<joyport_device*>(machine.device(JOYPORT_TAG)); |
| 945 | driver->m_firstjoy = 6; |
| 986 | 946 | |
| 987 | 947 | driver->m_peribox->senila(CLEAR_LINE); |
| 988 | 948 | driver->m_peribox->senilb(CLEAR_LINE); |
| r15509 | r15510 | |
| 992 | 952 | MACHINE_RESET( ti99_4a ) |
| 993 | 953 | { |
| 994 | 954 | ti99_4x *driver = machine.driver_data<ti99_4x>(); |
| 995 | | if (machine.root_device().ioport("MECMOUSE")->read()==0x01) |
| 996 | | driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG)); |
| 997 | | else |
| 998 | | driver->m_mecmouse = NULL; |
| 999 | | |
| 1000 | 955 | driver->m_cpu->set_ready(ASSERT_LINE); |
| 1001 | 956 | driver->m_cpu->set_hold(CLEAR_LINE); |
| 1002 | 957 | } |
| r15509 | r15510 | |
| 1038 | 993 | MCFG_GROM_ADD( GROM1_TAG, grom1_config ) |
| 1039 | 994 | MCFG_GROM_ADD( GROM2_TAG, grom2_config ) |
| 1040 | 995 | |
| 1041 | | /* User controller */ |
| 1042 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 60 ) |
| 996 | // Joystick port |
| 997 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport4a_60 ) |
| 998 | |
| 1043 | 999 | MACHINE_CONFIG_END |
| 1044 | 1000 | |
| 1045 | 1001 | static MACHINE_CONFIG_START( ti99_4a_50hz, ti99_4x ) |
| r15509 | r15510 | |
| 1079 | 1035 | MCFG_GROM_ADD( GROM1_TAG, grom1_config ) |
| 1080 | 1036 | MCFG_GROM_ADD( GROM2_TAG, grom2_config ) |
| 1081 | 1037 | |
| 1082 | | /* User controller */ |
| 1083 | | MCFG_MECMOUSE_ADD( MECMOUSE_TAG, 50 ) |
| 1038 | // Joystick port |
| 1039 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport4a_50 ) |
| 1040 | |
| 1084 | 1041 | MACHINE_CONFIG_END |
| 1085 | 1042 | |
| 1086 | 1043 | |
| r15509 | r15510 | |
| 1134 | 1091 | MCFG_GROM_ADD( GROM0_TAG, grom0_config ) |
| 1135 | 1092 | MCFG_GROM_ADD( GROM1_TAG, grom1_config ) |
| 1136 | 1093 | MCFG_GROM_ADD( GROM2_TAG, grom2_config ) |
| 1094 | |
| 1095 | // Joystick port |
| 1096 | MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, joyport4a_60 ) |
| 1097 | |
| 1137 | 1098 | MACHINE_CONFIG_END |
| 1138 | 1099 | |
| 1139 | 1100 | |