| Previous | 199869 Revisions | Next |
| r19087 Wednesday 21st November, 2012 at 10:55:53 UTC by Jonathan Gevaryahu |
|---|
| (MESS) APC: Fixed a few missing keys (a few are still missing though), and hooked the rtc clock, command and strobe lines up in a plausible configuration. The status line clock now works though shows an invalid value for year (the upd1990a didn't have a year response, so perhaps whatever rtc is being used here is a later variant which does store a year). The "date set" command doesn't work properly and doesn't even seem to poke the rtc at all. Needs further investigation. [Lord Nightmare] |
| [src/mess/drivers] | apc.c |
| r19086 | r19087 | |
|---|---|---|
| 423 | 423 | /* TODO: bit arrangement is completely wrong */ |
| 424 | 424 | READ8_MEMBER(apc_state::apc_rtc_r) |
| 425 | 425 | { |
| 426 | //fprintf(stderr, "RTC Read: %d\n", m_rtc->data_out_r()); | |
| 426 | 427 | return m_rtc->data_out_r(); |
| 427 | 428 | } |
| 428 | 429 | |
| 429 | 430 | WRITE8_MEMBER(apc_state::apc_rtc_w) |
| 430 | 431 | { |
| 431 | m_rtc->data_in_w(BIT(data, 0)); | |
| 432 | m_rtc->stb_w(BIT(data, 1)); | |
| 433 | m_rtc->clk_w(BIT(data, 2)); | |
| 434 | m_rtc->oe_w(BIT(data, 3)); | |
| 435 | m_rtc->c0_w(BIT(data, 3)); | |
| 436 | m_rtc->c1_w(BIT(data, 4)); | |
| 437 | m_rtc->c2_w(BIT(data, 5)); | |
| 432 | /* | |
| 433 | RTC write: 0x01 0001 | |
| 434 | RTC write: 0x03 0011 | |
| 435 | RTC write: 0x0b 1011 <- cmd: read clock to shifter latch | |
| 436 | RTC write: 0x03 0011 | |
| 437 | RTC write: 0x01 0001 | |
| 438 | RTC write: 0x09 1001 <- cmd: begin shifting latch data out | |
| 439 | RTC write: 0x01 0001 | |
| 440 | RTC write: 0x11 | |
| 441 | RTC write: 0x01 | |
| 442 | RTC write: 0x11 | |
| 443 | RTC write: 0x01 | |
| 444 | RTC write: 0x11 | |
| 445 | ... | |
| 446 | ||
| 447 | RTC write bits: 76543210 | |
| 448 | |||||||\- c0 (or OE?) | |
| 449 | ||||||\-- c1 | |
| 450 | |||||\--- c2 | |
| 451 | ||||\---- STB | |
| 452 | |||\----- CLK | |
| 453 | ||\------ DATA_IN | |
| 454 | |\------- ? | |
| 455 | \-------- ? | |
| 456 | */ | |
| 457 | if (data&0xE0) fprintf(stderr,"RTC write: 0x%02x\n", data); | |
| 458 | m_rtc->c0_w(BIT(data, 0)); // correct assuming theres a delay for changing command lines before stb | |
| 459 | m_rtc->c1_w(BIT(data, 1)); // " | |
| 460 | m_rtc->c2_w(BIT(data, 2)); // " | |
| 461 | m_rtc->stb_w(BIT(data, 3)); // seems correct assuming delay for changing command line | |
| 462 | m_rtc->clk_w(BIT(data, 4)); // correct for sure | |
| 463 | m_rtc->data_in_w(BIT(data, 5)); // ? no idea about this. | |
| 464 | m_rtc->oe_w(1); | |
| 438 | 465 | } |
| 439 | 466 | |
| 440 | 467 | static ADDRESS_MAP_START( apc_map, AS_PROGRAM, 16, apc_state ) |
| r19086 | r19087 | |
| 496 | 523 | PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x37) |
| 497 | 524 | |
| 498 | 525 | PORT_START("KEY1") |
| 499 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('0') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x38) | |
| 500 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('1') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x39) | |
| 526 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x38) | |
| 527 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x39) | |
| 501 | 528 | |
| 502 | 529 | PORT_START("KEY2") |
| 503 | 530 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x41) |
| r19086 | r19087 | |
| 532 | 559 | PORT_START("KEY5") |
| 533 | 560 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x59) |
| 534 | 561 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5a) |
| 535 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("[ / {") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5b) | |
| 536 | PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\\ / |") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5c) | |
| 537 | PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("] / }") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5d) | |
| 562 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("[ / {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5b) | |
| 563 | PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\\ / |") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5c) | |
| 564 | PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("] / }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5d) | |
| 538 | 565 | PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("(up score) / ^") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5e) |
| 539 | PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("- / _") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5f) | |
| 566 | PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("- / _") PORT_CODE(KEYCODE_MINUS) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x5f) | |
| 540 | 567 | // PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("unk6") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x26) |
| 541 | 568 | |
| 542 | 569 | PORT_START("KEY6") |
| 543 | 570 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x20) |
| 544 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("; / :") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x3a) | |
| 545 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("= / +") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x2d) | |
| 546 | PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' / ~") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x40) | |
| 547 | PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' / \"") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x3b) | |
| 548 | PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' / \"") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x3b) | |
| 571 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("; / :") PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x3a) | |
| 572 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("= / +") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x2d) | |
| 573 | PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("` / ~") PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x40) | |
| 574 | PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' / \"") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x3b) | |
| 575 | PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(", / <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x2c) | |
| 576 | PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(". / >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x2e) | |
| 577 | PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("/ / ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0x2f) | |
| 549 | 578 | |
| 579 | ||
| 550 | 580 | /* |
| 551 | 581 | ; |
| 552 | 582 | ; Special table for screwed-up keys. Scan codes are converted. |
| r19086 | r19087 | |
| 698 | 728 | PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("ENTER (PAD)") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(0x0d) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, apc_state, key_stroke, 0xfd) |
| 699 | 729 | |
| 700 | 730 | PORT_START("KEY_MOD") |
| 701 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) | |
| 731 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) | |
| 702 | 732 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 703 | 733 | INPUT_PORTS_END |
| 704 | 734 |
| Previous | 199869 Revisions | Next |