trunk/src/mess/drivers/hh_tms1k.c
| r244949 | r244950 | |
| 136 | 136 | |
| 137 | 137 | // game-specific handlers |
| 138 | 138 | void mathmagi_display(); |
| 139 | | DECLARE_READ8_MEMBER(mathmagi_read_k); |
| 140 | 139 | DECLARE_WRITE16_MEMBER(mathmagi_write_r); |
| 141 | 140 | DECLARE_WRITE16_MEMBER(mathmagi_write_o); |
| 141 | DECLARE_READ8_MEMBER(mathmagi_read_k); |
| 142 | 142 | |
| 143 | 143 | void amaztron_display(); |
| 144 | | DECLARE_READ8_MEMBER(amaztron_read_k); |
| 145 | 144 | DECLARE_WRITE16_MEMBER(amaztron_write_r); |
| 146 | 145 | DECLARE_WRITE16_MEMBER(amaztron_write_o); |
| 146 | DECLARE_READ8_MEMBER(amaztron_read_k); |
| 147 | 147 | |
| 148 | 148 | void tc4_display(); |
| 149 | | DECLARE_READ8_MEMBER(tc4_read_k); |
| 150 | 149 | DECLARE_WRITE16_MEMBER(tc4_write_r); |
| 151 | 150 | DECLARE_WRITE16_MEMBER(tc4_write_o); |
| 151 | DECLARE_READ8_MEMBER(tc4_read_k); |
| 152 | 152 | |
| 153 | 153 | void ebball_display(); |
| 154 | | DECLARE_READ8_MEMBER(ebball_read_k); |
| 155 | 154 | DECLARE_WRITE16_MEMBER(ebball_write_r); |
| 156 | 155 | DECLARE_WRITE16_MEMBER(ebball_write_o); |
| 156 | DECLARE_READ8_MEMBER(ebball_read_k); |
| 157 | 157 | |
| 158 | 158 | void ebball3_display(); |
| 159 | | DECLARE_READ8_MEMBER(ebball3_read_k); |
| 160 | 159 | DECLARE_WRITE16_MEMBER(ebball3_write_r); |
| 161 | 160 | DECLARE_WRITE16_MEMBER(ebball3_write_o); |
| 161 | DECLARE_READ8_MEMBER(ebball3_read_k); |
| 162 | 162 | void ebball3_set_clock(); |
| 163 | 163 | DECLARE_INPUT_CHANGED_MEMBER(ebball3_difficulty_switch); |
| 164 | 164 | DECLARE_MACHINE_RESET(ebball3); |
| 165 | 165 | |
| 166 | | DECLARE_READ8_MEMBER(elecdet_read_k); |
| 167 | 166 | DECLARE_WRITE16_MEMBER(elecdet_write_r); |
| 168 | 167 | DECLARE_WRITE16_MEMBER(elecdet_write_o); |
| 168 | DECLARE_READ8_MEMBER(elecdet_read_k); |
| 169 | 169 | |
| 170 | 170 | void starwbc_display(); |
| 171 | | DECLARE_READ8_MEMBER(starwbc_read_k); |
| 172 | 171 | DECLARE_WRITE16_MEMBER(starwbc_write_r); |
| 173 | 172 | DECLARE_WRITE16_MEMBER(starwbc_write_o); |
| 173 | DECLARE_READ8_MEMBER(starwbc_read_k); |
| 174 | 174 | |
| 175 | | DECLARE_READ8_MEMBER(comp4_read_k); |
| 176 | 175 | DECLARE_WRITE16_MEMBER(comp4_write_r); |
| 177 | 176 | DECLARE_WRITE16_MEMBER(comp4_write_o); |
| 177 | DECLARE_READ8_MEMBER(comp4_read_k); |
| 178 | 178 | |
| 179 | | DECLARE_READ8_MEMBER(simon_read_k); |
| 180 | 179 | DECLARE_WRITE16_MEMBER(simon_write_r); |
| 181 | 180 | DECLARE_WRITE16_MEMBER(simon_write_o); |
| 181 | DECLARE_READ8_MEMBER(simon_read_k); |
| 182 | 182 | |
| 183 | | DECLARE_READ8_MEMBER(cnsector_read_k); |
| 184 | 183 | DECLARE_WRITE16_MEMBER(cnsector_write_r); |
| 185 | 184 | DECLARE_WRITE16_MEMBER(cnsector_write_o); |
| 185 | DECLARE_READ8_MEMBER(cnsector_read_k); |
| 186 | 186 | |
| 187 | | DECLARE_READ8_MEMBER(merlin_read_k); |
| 188 | 187 | DECLARE_WRITE16_MEMBER(merlin_write_r); |
| 189 | 188 | DECLARE_WRITE16_MEMBER(merlin_write_o); |
| 189 | DECLARE_READ8_MEMBER(merlin_read_k); |
| 190 | 190 | |
| 191 | | DECLARE_READ8_MEMBER(stopthief_read_k); |
| 192 | 191 | DECLARE_WRITE16_MEMBER(stopthief_write_r); |
| 193 | 192 | DECLARE_WRITE16_MEMBER(stopthief_write_o); |
| 193 | DECLARE_READ8_MEMBER(stopthief_read_k); |
| 194 | 194 | |
| 195 | | DECLARE_READ8_MEMBER(bankshot_read_k); |
| 196 | 195 | DECLARE_WRITE16_MEMBER(bankshot_write_r); |
| 197 | 196 | DECLARE_WRITE16_MEMBER(bankshot_write_o); |
| 197 | DECLARE_READ8_MEMBER(bankshot_read_k); |
| 198 | 198 | |
| 199 | | DECLARE_READ8_MEMBER(splitsec_read_k); |
| 200 | 199 | DECLARE_WRITE16_MEMBER(splitsec_write_r); |
| 201 | 200 | DECLARE_WRITE16_MEMBER(splitsec_write_o); |
| 201 | DECLARE_READ8_MEMBER(splitsec_read_k); |
| 202 | 202 | |
| 203 | 203 | void tandy12_display(); |
| 204 | | DECLARE_READ8_MEMBER(tandy12_read_k); |
| 205 | 204 | DECLARE_WRITE16_MEMBER(tandy12_write_r); |
| 206 | 205 | DECLARE_WRITE16_MEMBER(tandy12_write_o); |
| 206 | DECLARE_READ8_MEMBER(tandy12_read_k); |
| 207 | 207 | }; |
| 208 | 208 | |
| 209 | 209 | |
| r244949 | r244950 | |
| 408 | 408 | display_update(); |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | | READ8_MEMBER(hh_tms1k_state::mathmagi_read_k) |
| 412 | | { |
| 413 | | return read_inputs(6); |
| 414 | | } |
| 415 | | |
| 416 | 411 | WRITE16_MEMBER(hh_tms1k_state::mathmagi_write_r) |
| 417 | 412 | { |
| 418 | 413 | // R3,R5-R7,R9,R10: input mux |
| r244949 | r244950 | |
| 431 | 426 | m_o = data; |
| 432 | 427 | } |
| 433 | 428 | |
| 429 | READ8_MEMBER(hh_tms1k_state::mathmagi_read_k) |
| 430 | { |
| 431 | return read_inputs(6); |
| 432 | } |
| 434 | 433 | |
| 434 | |
| 435 | 435 | /* physical button layout and labels is like this: |
| 436 | 436 | |
| 437 | 437 | ON ONE [SEL] [NXT] [?] [/] |
| r244949 | r244950 | |
| 568 | 568 | display_update(); |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | | READ8_MEMBER(hh_tms1k_state::amaztron_read_k) |
| 572 | | { |
| 573 | | UINT8 k = read_inputs(6); |
| 574 | | |
| 575 | | // the 5th column is tied to K4+K8 |
| 576 | | if (k & 0x10) k |= 0xc; |
| 577 | | return k & 0xf; |
| 578 | | } |
| 579 | | |
| 580 | 571 | WRITE16_MEMBER(hh_tms1k_state::amaztron_write_r) |
| 581 | 572 | { |
| 582 | 573 | // R0-R5: input mux |
| r244949 | r244950 | |
| 598 | 589 | amaztron_display(); |
| 599 | 590 | } |
| 600 | 591 | |
| 592 | READ8_MEMBER(hh_tms1k_state::amaztron_read_k) |
| 593 | { |
| 594 | UINT8 k = read_inputs(6); |
| 601 | 595 | |
| 596 | // the 5th column is tied to K4+K8 |
| 597 | if (k & 0x10) k |= 0xc; |
| 598 | return k & 0xf; |
| 599 | } |
| 600 | |
| 601 | |
| 602 | 602 | static INPUT_PORTS_START( amaztron ) |
| 603 | 603 | PORT_START("IN.0") // R0 |
| 604 | 604 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Button 1") |
| r244949 | r244950 | |
| 711 | 711 | display_matrix(9, 10, (m_o | (m_r << 2 & 0x100)), m_r); |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | | READ8_MEMBER(hh_tms1k_state::tc4_read_k) |
| 715 | | { |
| 716 | | UINT8 k = read_inputs(6); |
| 717 | | |
| 718 | | // read from cartridge |
| 719 | | if (m_inp_mux & 0x200) |
| 720 | | k |= m_inp_matrix[6]->read(); |
| 721 | | |
| 722 | | return k; |
| 723 | | } |
| 724 | | |
| 725 | 714 | WRITE16_MEMBER(hh_tms1k_state::tc4_write_r) |
| 726 | 715 | { |
| 727 | 716 | // R10: speaker out |
| r244949 | r244950 | |
| 744 | 733 | tc4_display(); |
| 745 | 734 | } |
| 746 | 735 | |
| 736 | READ8_MEMBER(hh_tms1k_state::tc4_read_k) |
| 737 | { |
| 738 | UINT8 k = read_inputs(6); |
| 747 | 739 | |
| 740 | // read from cartridge |
| 741 | if (m_inp_mux & 0x200) |
| 742 | k |= m_inp_matrix[6]->read(); |
| 743 | |
| 744 | return k; |
| 745 | } |
| 746 | |
| 747 | |
| 748 | 748 | static INPUT_PORTS_START( tc4 ) |
| 749 | 749 | PORT_START("IN.0") // R0 |
| 750 | 750 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Pass/Shoot Button 3") // right |
| r244949 | r244950 | |
| 853 | 853 | display_matrix(7, 9, ~m_o, m_r); |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | | READ8_MEMBER(hh_tms1k_state::ebball_read_k) |
| 857 | | { |
| 858 | | // note: K8(Vss row) is always on |
| 859 | | return m_inp_matrix[5]->read() | read_inputs(5); |
| 860 | | } |
| 861 | | |
| 862 | 856 | WRITE16_MEMBER(hh_tms1k_state::ebball_write_r) |
| 863 | 857 | { |
| 864 | 858 | // R1-R5: input mux |
| r244949 | r244950 | |
| 880 | 874 | ebball_display(); |
| 881 | 875 | } |
| 882 | 876 | |
| 877 | READ8_MEMBER(hh_tms1k_state::ebball_read_k) |
| 878 | { |
| 879 | // note: K8(Vss row) is always on |
| 880 | return m_inp_matrix[5]->read() | read_inputs(5); |
| 881 | } |
| 883 | 882 | |
| 883 | |
| 884 | 884 | static INPUT_PORTS_START( ebball ) |
| 885 | 885 | PORT_START("IN.0") // R1 |
| 886 | 886 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Change Up") |
| r244949 | r244950 | |
| 989 | 989 | display_update(); |
| 990 | 990 | } |
| 991 | 991 | |
| 992 | | READ8_MEMBER(hh_tms1k_state::ebball3_read_k) |
| 993 | | { |
| 994 | | return read_inputs(3); |
| 995 | | } |
| 996 | | |
| 997 | 992 | WRITE16_MEMBER(hh_tms1k_state::ebball3_write_r) |
| 998 | 993 | { |
| 999 | 994 | // R0-R2: input mux |
| r244949 | r244950 | |
| 1015 | 1010 | ebball3_display(); |
| 1016 | 1011 | } |
| 1017 | 1012 | |
| 1013 | READ8_MEMBER(hh_tms1k_state::ebball3_read_k) |
| 1014 | { |
| 1015 | return read_inputs(3); |
| 1016 | } |
| 1018 | 1017 | |
| 1018 | |
| 1019 | 1019 | /* physical button layout and labels is like this: |
| 1020 | 1020 | |
| 1021 | 1021 | main device (batter side): remote pitcher: |
| r244949 | r244950 | |
| 1113 | 1113 | |
| 1114 | 1114 | ***************************************************************************/ |
| 1115 | 1115 | |
| 1116 | | READ8_MEMBER(hh_tms1k_state::elecdet_read_k) |
| 1117 | | { |
| 1118 | | // note: the Vss row is always on |
| 1119 | | return m_inp_matrix[4]->read() | read_inputs(4); |
| 1120 | | } |
| 1121 | | |
| 1122 | 1116 | WRITE16_MEMBER(hh_tms1k_state::elecdet_write_r) |
| 1123 | 1117 | { |
| 1124 | 1118 | // R7,R8: speaker on |
| r244949 | r244950 | |
| 1141 | 1135 | m_o = data; |
| 1142 | 1136 | } |
| 1143 | 1137 | |
| 1138 | READ8_MEMBER(hh_tms1k_state::elecdet_read_k) |
| 1139 | { |
| 1140 | // note: the Vss row is always on |
| 1141 | return m_inp_matrix[4]->read() | read_inputs(4); |
| 1142 | } |
| 1144 | 1143 | |
| 1144 | |
| 1145 | 1145 | /* physical button layout and labels is like this: |
| 1146 | 1146 | |
| 1147 | 1147 | [1] [2] [3] [SUSPECT] |
| r244949 | r244950 | |
| 1233 | 1233 | display_matrix(8, 10, m_o, m_r); |
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | | READ8_MEMBER(hh_tms1k_state::starwbc_read_k) |
| 1237 | | { |
| 1238 | | return read_inputs(5); |
| 1239 | | } |
| 1240 | | |
| 1241 | 1236 | WRITE16_MEMBER(hh_tms1k_state::starwbc_write_r) |
| 1242 | 1237 | { |
| 1243 | 1238 | // R0,R1,R3,R5,R7: input mux |
| r244949 | r244950 | |
| 1258 | 1253 | starwbc_display(); |
| 1259 | 1254 | } |
| 1260 | 1255 | |
| 1256 | READ8_MEMBER(hh_tms1k_state::starwbc_read_k) |
| 1257 | { |
| 1258 | return read_inputs(5); |
| 1259 | } |
| 1261 | 1260 | |
| 1261 | |
| 1262 | 1262 | /* physical button layout and labels is like this: |
| 1263 | 1263 | |
| 1264 | 1264 | (reconnnaissance=yellow) (tactical reaction=green) |
| r244949 | r244950 | |
| 1339 | 1339 | |
| 1340 | 1340 | ***************************************************************************/ |
| 1341 | 1341 | |
| 1342 | | READ8_MEMBER(hh_tms1k_state::comp4_read_k) |
| 1343 | | { |
| 1344 | | return read_inputs(3); |
| 1345 | | } |
| 1346 | | |
| 1347 | 1342 | WRITE16_MEMBER(hh_tms1k_state::comp4_write_r) |
| 1348 | 1343 | { |
| 1349 | 1344 | // leds: |
| r244949 | r244950 | |
| 1367 | 1362 | display_matrix(11, 1, m_r, m_o); |
| 1368 | 1363 | } |
| 1369 | 1364 | |
| 1365 | READ8_MEMBER(hh_tms1k_state::comp4_read_k) |
| 1366 | { |
| 1367 | return read_inputs(3); |
| 1368 | } |
| 1370 | 1369 | |
| 1370 | |
| 1371 | 1371 | static INPUT_PORTS_START( comp4 ) |
| 1372 | 1372 | PORT_START("IN.0") // O1 |
| 1373 | 1373 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R") |
| r244949 | r244950 | |
| 1422 | 1422 | |
| 1423 | 1423 | ***************************************************************************/ |
| 1424 | 1424 | |
| 1425 | | READ8_MEMBER(hh_tms1k_state::simon_read_k) |
| 1426 | | { |
| 1427 | | return read_inputs(4); |
| 1428 | | } |
| 1429 | | |
| 1430 | 1425 | WRITE16_MEMBER(hh_tms1k_state::simon_write_r) |
| 1431 | 1426 | { |
| 1432 | 1427 | // R4-R8 go through an 75494 IC first: |
| r244949 | r244950 | |
| 1450 | 1445 | // N/C |
| 1451 | 1446 | } |
| 1452 | 1447 | |
| 1448 | READ8_MEMBER(hh_tms1k_state::simon_read_k) |
| 1449 | { |
| 1450 | return read_inputs(4); |
| 1451 | } |
| 1453 | 1452 | |
| 1453 | |
| 1454 | 1454 | static INPUT_PORTS_START( simon ) |
| 1455 | 1455 | PORT_START("IN.0") // R0 |
| 1456 | 1456 | PORT_CONFNAME( 0x07, 0x02, "Game Select") |
| r244949 | r244950 | |
| 1514 | 1514 | |
| 1515 | 1515 | ***************************************************************************/ |
| 1516 | 1516 | |
| 1517 | | READ8_MEMBER(hh_tms1k_state::cnsector_read_k) |
| 1518 | | { |
| 1519 | | return read_inputs(5); |
| 1520 | | } |
| 1521 | | |
| 1522 | 1517 | WRITE16_MEMBER(hh_tms1k_state::cnsector_write_r) |
| 1523 | 1518 | { |
| 1524 | 1519 | m_display_maxx = 8; |
| r244949 | r244950 | |
| 1546 | 1541 | m_o = data; |
| 1547 | 1542 | } |
| 1548 | 1543 | |
| 1544 | READ8_MEMBER(hh_tms1k_state::cnsector_read_k) |
| 1545 | { |
| 1546 | return read_inputs(5); |
| 1547 | } |
| 1549 | 1548 | |
| 1549 | |
| 1550 | 1550 | static INPUT_PORTS_START( cnsector ) |
| 1551 | 1551 | PORT_START("IN.0") // O0 |
| 1552 | 1552 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Next Ship") |
| r244949 | r244950 | |
| 1622 | 1622 | |
| 1623 | 1623 | ***************************************************************************/ |
| 1624 | 1624 | |
| 1625 | | READ8_MEMBER(hh_tms1k_state::merlin_read_k) |
| 1626 | | { |
| 1627 | | return read_inputs(4); |
| 1628 | | } |
| 1629 | | |
| 1630 | 1625 | WRITE16_MEMBER(hh_tms1k_state::merlin_write_r) |
| 1631 | 1626 | { |
| 1632 | 1627 | /* leds: |
| r244949 | r244950 | |
| 1651 | 1646 | m_inp_mux = data & 0xf; |
| 1652 | 1647 | } |
| 1653 | 1648 | |
| 1649 | READ8_MEMBER(hh_tms1k_state::merlin_read_k) |
| 1650 | { |
| 1651 | return read_inputs(4); |
| 1652 | } |
| 1654 | 1653 | |
| 1654 | |
| 1655 | 1655 | static INPUT_PORTS_START( merlin ) |
| 1656 | 1656 | PORT_START("IN.0") // O0 |
| 1657 | 1657 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME("Button 0") |
| r244949 | r244950 | |
| 1716 | 1716 | |
| 1717 | 1717 | ***************************************************************************/ |
| 1718 | 1718 | |
| 1719 | | READ8_MEMBER(hh_tms1k_state::stopthief_read_k) |
| 1720 | | { |
| 1721 | | // note: the Vss row is always on |
| 1722 | | return m_inp_matrix[2]->read() | read_inputs(2); |
| 1723 | | } |
| 1724 | | |
| 1725 | 1719 | WRITE16_MEMBER(hh_tms1k_state::stopthief_write_r) |
| 1726 | 1720 | { |
| 1727 | 1721 | m_display_maxx = 7; |
| r244949 | r244950 | |
| 1751 | 1745 | m_o = data; |
| 1752 | 1746 | } |
| 1753 | 1747 | |
| 1748 | READ8_MEMBER(hh_tms1k_state::stopthief_read_k) |
| 1749 | { |
| 1750 | // note: the Vss row is always on |
| 1751 | return m_inp_matrix[2]->read() | read_inputs(2); |
| 1752 | } |
| 1754 | 1753 | |
| 1754 | |
| 1755 | 1755 | /* physical button layout and labels is like this: |
| 1756 | 1756 | |
| 1757 | 1757 | [1] [2] [OFF] |
| r244949 | r244950 | |
| 1824 | 1824 | |
| 1825 | 1825 | ***************************************************************************/ |
| 1826 | 1826 | |
| 1827 | | READ8_MEMBER(hh_tms1k_state::bankshot_read_k) |
| 1828 | | { |
| 1829 | | return read_inputs(2); |
| 1830 | | } |
| 1831 | | |
| 1832 | 1827 | WRITE16_MEMBER(hh_tms1k_state::bankshot_write_r) |
| 1833 | 1828 | { |
| 1834 | 1829 | // R0: speaker out |
| r244949 | r244950 | |
| 1850 | 1845 | display_matrix(7, 11, m_o, m_r); |
| 1851 | 1846 | } |
| 1852 | 1847 | |
| 1848 | READ8_MEMBER(hh_tms1k_state::bankshot_read_k) |
| 1849 | { |
| 1850 | return read_inputs(2); |
| 1851 | } |
| 1853 | 1852 | |
| 1853 | |
| 1854 | 1854 | /* physical button layout and labels is like this: |
| 1855 | 1855 | (note: remember that you can rotate the display in MESS) |
| 1856 | 1856 | |
| r244949 | r244950 | |
| 1931 | 1931 | |
| 1932 | 1932 | ***************************************************************************/ |
| 1933 | 1933 | |
| 1934 | | READ8_MEMBER(hh_tms1k_state::splitsec_read_k) |
| 1935 | | { |
| 1936 | | return read_inputs(2); |
| 1937 | | } |
| 1938 | | |
| 1939 | 1934 | WRITE16_MEMBER(hh_tms1k_state::splitsec_write_r) |
| 1940 | 1935 | { |
| 1941 | 1936 | // R8: speaker out |
| r244949 | r244950 | |
| 1957 | 1952 | display_matrix(7, 8, m_o, m_r); |
| 1958 | 1953 | } |
| 1959 | 1954 | |
| 1955 | READ8_MEMBER(hh_tms1k_state::splitsec_read_k) |
| 1956 | { |
| 1957 | return read_inputs(2); |
| 1958 | } |
| 1959 | |
| 1960 | |
| 1960 | 1961 | static INPUT_PORTS_START( splitsec ) |
| 1961 | 1962 | PORT_START("IN.0") // R9 |
| 1962 | 1963 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // 4 separate directional buttons, hence 16way |
| r244949 | r244950 | |
| 2021 | 2022 | display_matrix(13, 1, (m_o << 1 & 0x1fe) | (m_r << 9 & 0x1e00), 1); |
| 2022 | 2023 | } |
| 2023 | 2024 | |
| 2024 | | READ8_MEMBER(hh_tms1k_state::tandy12_read_k) |
| 2025 | | { |
| 2026 | | return read_inputs(5); |
| 2027 | | } |
| 2028 | | |
| 2029 | 2025 | WRITE16_MEMBER(hh_tms1k_state::tandy12_write_r) |
| 2030 | 2026 | { |
| 2031 | 2027 | // R10: speaker out |
| r244949 | r244950 | |
| 2045 | 2041 | tandy12_display(); |
| 2046 | 2042 | } |
| 2047 | 2043 | |
| 2044 | READ8_MEMBER(hh_tms1k_state::tandy12_read_k) |
| 2045 | { |
| 2046 | return read_inputs(5); |
| 2047 | } |
| 2048 | 2048 | |
| 2049 | |
| 2049 | 2050 | /* physical button layout and labels is like this: |
| 2050 | 2051 | |
| 2051 | 2052 | REPEAT-2 SPACE-2 |
trunk/src/mess/drivers/hh_ucom4.c
| r244949 | r244950 | |
| 79 | 79 | |
| 80 | 80 | // game-specific handlers |
| 81 | 81 | void ssfball_display(); |
| 82 | | DECLARE_READ8_MEMBER(ssfball_input_b_r); |
| 83 | 82 | DECLARE_WRITE8_MEMBER(ssfball_grid_w); |
| 84 | 83 | DECLARE_WRITE8_MEMBER(ssfball_plate_w); |
| 84 | DECLARE_READ8_MEMBER(ssfball_input_b_r); |
| 85 | 85 | |
| 86 | 86 | void splasfgt_display(); |
| 87 | | DECLARE_READ8_MEMBER(splasfgt_input_b_r); |
| 88 | 87 | DECLARE_WRITE8_MEMBER(splasfgt_grid_w); |
| 89 | 88 | DECLARE_WRITE8_MEMBER(splasfgt_plate_w); |
| 89 | DECLARE_READ8_MEMBER(splasfgt_input_b_r); |
| 90 | 90 | |
| 91 | 91 | void astrocmd_display(); |
| 92 | 92 | DECLARE_WRITE8_MEMBER(astrocmd_grid_w); |
| r244949 | r244950 | |
| 95 | 95 | DECLARE_WRITE8_MEMBER(edracula_grid_w); |
| 96 | 96 | DECLARE_WRITE8_MEMBER(edracula_plate_w); |
| 97 | 97 | |
| 98 | | DECLARE_READ8_MEMBER(tmtennis_input_r); |
| 99 | 98 | DECLARE_WRITE8_MEMBER(tmtennis_grid_w); |
| 100 | 99 | DECLARE_WRITE8_MEMBER(tmtennis_plate_w); |
| 101 | 100 | DECLARE_WRITE8_MEMBER(tmtennis_port_e_w); |
| 101 | DECLARE_READ8_MEMBER(tmtennis_input_r); |
| 102 | 102 | void tmtennis_set_clock(); |
| 103 | 103 | DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch); |
| 104 | 104 | DECLARE_MACHINE_RESET(tmtennis); |
| r244949 | r244950 | |
| 107 | 107 | DECLARE_WRITE8_MEMBER(tmpacman_grid_w); |
| 108 | 108 | DECLARE_WRITE8_MEMBER(tmpacman_plate_w); |
| 109 | 109 | |
| 110 | DECLARE_WRITE8_MEMBER(alnchase_output_w); |
| 110 | 111 | DECLARE_READ8_MEMBER(alnchase_input_r); |
| 111 | | DECLARE_WRITE8_MEMBER(alnchase_output_w); |
| 112 | 112 | }; |
| 113 | 113 | |
| 114 | 114 | |
| r244949 | r244950 | |
| 253 | 253 | display_matrix(16, 9, plate, m_grid); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | | READ8_MEMBER(hh_ucom4_state::ssfball_input_b_r) |
| 257 | | { |
| 258 | | // B: input port 2, where B3 is multiplexed |
| 259 | | return m_inp_matrix[2]->read() | read_inputs(2); |
| 260 | | } |
| 261 | | |
| 262 | 256 | WRITE8_MEMBER(hh_ucom4_state::ssfball_grid_w) |
| 263 | 257 | { |
| 264 | 258 | // C,D(,E): vfd matrix grid 0-7(,8) |
| r244949 | r244950 | |
| 287 | 281 | ssfball_display(); |
| 288 | 282 | } |
| 289 | 283 | |
| 284 | READ8_MEMBER(hh_ucom4_state::ssfball_input_b_r) |
| 285 | { |
| 286 | // B: input port 2, where B3 is multiplexed |
| 287 | return m_inp_matrix[2]->read() | read_inputs(2); |
| 288 | } |
| 290 | 289 | |
| 290 | |
| 291 | 291 | static INPUT_PORTS_START( ssfball ) |
| 292 | 292 | PORT_START("IN.0") // F3 port B3 |
| 293 | 293 | PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r244949 | r244950 | |
| 362 | 362 | display_matrix(16, 9, plate, m_grid); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | | READ8_MEMBER(hh_ucom4_state::splasfgt_input_b_r) |
| 366 | | { |
| 367 | | // B: multiplexed buttons |
| 368 | | return read_inputs(4); |
| 369 | | } |
| 370 | | |
| 371 | 365 | WRITE8_MEMBER(hh_ucom4_state::splasfgt_grid_w) |
| 372 | 366 | { |
| 373 | 367 | // G,H,I0: vfd matrix grid |
| r244949 | r244950 | |
| 397 | 391 | ssfball_display(); |
| 398 | 392 | } |
| 399 | 393 | |
| 394 | READ8_MEMBER(hh_ucom4_state::splasfgt_input_b_r) |
| 395 | { |
| 396 | // B: multiplexed buttons |
| 397 | return read_inputs(4); |
| 398 | } |
| 400 | 399 | |
| 400 | |
| 401 | 401 | /* physical button layout and labels is like this: |
| 402 | 402 | |
| 403 | 403 | * left = P1 side * * right = P2 side * (note: in 1P mode, switch sides between turns) |
| r244949 | r244950 | |
| 674 | 674 | |
| 675 | 675 | ***************************************************************************/ |
| 676 | 676 | |
| 677 | | READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) |
| 678 | | { |
| 679 | | // A,B: multiplexed buttons |
| 680 | | return ~read_inputs(2) >> (offset*4); |
| 681 | | } |
| 682 | | |
| 683 | 677 | WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w) |
| 684 | 678 | { |
| 685 | 679 | // G,H,I: vfd matrix grid |
| r244949 | r244950 | |
| 708 | 702 | m_speaker->level_w(data >> 2 & 1); |
| 709 | 703 | } |
| 710 | 704 | |
| 705 | READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) |
| 706 | { |
| 707 | // A,B: multiplexed buttons |
| 708 | return ~read_inputs(2) >> (offset*4); |
| 709 | } |
| 711 | 710 | |
| 711 | |
| 712 | 712 | /* Pro-Tennis physical button layout and labels is like this: |
| 713 | 713 | |
| 714 | 714 | * left = P2/CPU side * * right = P1 side * |
| r244949 | r244950 | |
| 910 | 910 | |
| 911 | 911 | ***************************************************************************/ |
| 912 | 912 | |
| 913 | | READ8_MEMBER(hh_ucom4_state::alnchase_input_r) |
| 914 | | { |
| 915 | | // A: buttons |
| 916 | | return read_inputs(2); |
| 917 | | } |
| 918 | | |
| 919 | 913 | WRITE8_MEMBER(hh_ucom4_state::alnchase_output_w) |
| 920 | 914 | { |
| 921 | 915 | if (offset <= NEC_UCOM4_PORTE) |
| r244949 | r244950 | |
| 943 | 937 | display_matrix(17, 9, m_plate, m_grid); |
| 944 | 938 | } |
| 945 | 939 | |
| 940 | READ8_MEMBER(hh_ucom4_state::alnchase_input_r) |
| 941 | { |
| 942 | // A: buttons |
| 943 | return read_inputs(2); |
| 944 | } |
| 946 | 945 | |
| 946 | |
| 947 | 947 | /* physical button layout and labels is like this: |
| 948 | 948 | |
| 949 | 949 | POWER SOUND LEVEL PLAYER |
trunk/src/mess/drivers/ticalc1x.c
| r244949 | r244950 | |
| 70 | 70 | void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask); |
| 71 | 71 | |
| 72 | 72 | // calculator-specific handlers |
| 73 | | DECLARE_READ8_MEMBER(tisr16_read_k); |
| 73 | void tisr16_display_update(); |
| 74 | 74 | DECLARE_WRITE16_MEMBER(tisr16_write_o); |
| 75 | 75 | DECLARE_WRITE16_MEMBER(tisr16_write_r); |
| 76 | | void tisr16_display_update(); |
| 76 | DECLARE_READ8_MEMBER(tisr16_read_k); |
| 77 | 77 | |
| 78 | | DECLARE_READ8_MEMBER(ti1270_read_k); |
| 79 | 78 | DECLARE_WRITE16_MEMBER(ti1270_write_o); |
| 80 | 79 | DECLARE_WRITE16_MEMBER(ti1270_write_r); |
| 80 | DECLARE_READ8_MEMBER(ti1270_read_k); |
| 81 | 81 | |
| 82 | | DECLARE_READ8_MEMBER(wizatron_read_k); |
| 83 | 82 | DECLARE_WRITE16_MEMBER(wizatron_write_o); |
| 84 | 83 | DECLARE_WRITE16_MEMBER(wizatron_write_r); |
| 84 | DECLARE_READ8_MEMBER(wizatron_read_k); |
| 85 | 85 | |
| 86 | | DECLARE_READ8_MEMBER(lilprof_read_k); |
| 87 | 86 | DECLARE_WRITE16_MEMBER(lilprof_write_o); |
| 88 | 87 | DECLARE_WRITE16_MEMBER(lilprof_write_r); |
| 88 | DECLARE_READ8_MEMBER(lilprof_read_k); |
| 89 | 89 | |
| 90 | | DECLARE_READ8_MEMBER(ti30_read_k); |
| 91 | 90 | DECLARE_WRITE16_MEMBER(ti30_write_o); |
| 92 | 91 | DECLARE_WRITE16_MEMBER(ti30_write_r); |
| 92 | DECLARE_READ8_MEMBER(ti30_read_k); |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | 95 | |
| r244949 | r244950 | |
| 262 | 262 | display_update(); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | | READ8_MEMBER(ticalc1x_state::tisr16_read_k) |
| 266 | | { |
| 267 | | return read_inputs(11); |
| 268 | | } |
| 269 | | |
| 270 | 265 | WRITE16_MEMBER(ticalc1x_state::tisr16_write_r) |
| 271 | 266 | { |
| 272 | 267 | // R0-R10: input mux |
| r244949 | r244950 | |
| 282 | 277 | tisr16_display_update(); |
| 283 | 278 | } |
| 284 | 279 | |
| 280 | READ8_MEMBER(ticalc1x_state::tisr16_read_k) |
| 281 | { |
| 282 | return read_inputs(11); |
| 283 | } |
| 285 | 284 | |
| 285 | |
| 286 | 286 | static INPUT_PORTS_START( tisr16 ) |
| 287 | 287 | PORT_START("IN.0") // R0 |
| 288 | 288 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r244949 | r244950 | |
| 379 | 379 | |
| 380 | 380 | ***************************************************************************/ |
| 381 | 381 | |
| 382 | | READ8_MEMBER(ticalc1x_state::ti1270_read_k) |
| 383 | | { |
| 384 | | return read_inputs(6); |
| 385 | | } |
| 386 | | |
| 387 | 382 | WRITE16_MEMBER(ticalc1x_state::ti1270_write_r) |
| 388 | 383 | { |
| 389 | 384 | // R0-R7: select digit (right-to-left) |
| r244949 | r244950 | |
| 398 | 393 | m_o = data; |
| 399 | 394 | } |
| 400 | 395 | |
| 396 | READ8_MEMBER(ticalc1x_state::ti1270_read_k) |
| 397 | { |
| 398 | return read_inputs(6); |
| 399 | } |
| 401 | 400 | |
| 401 | |
| 402 | 402 | static INPUT_PORTS_START( ti1270 ) |
| 403 | 403 | PORT_START("IN.0") // O1 |
| 404 | 404 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("CE/C") |
| r244949 | r244950 | |
| 465 | 465 | |
| 466 | 466 | ***************************************************************************/ |
| 467 | 467 | |
| 468 | | READ8_MEMBER(ticalc1x_state::wizatron_read_k) |
| 469 | | { |
| 470 | | return read_inputs(4); |
| 471 | | } |
| 472 | | |
| 473 | 468 | WRITE16_MEMBER(ticalc1x_state::wizatron_write_r) |
| 474 | 469 | { |
| 475 | 470 | // note: 6th digit is custom(not 7seg), for math symbols, and 3rd digit |
| r244949 | r244950 | |
| 489 | 484 | m_o = data & 0x7f; |
| 490 | 485 | } |
| 491 | 486 | |
| 487 | READ8_MEMBER(ticalc1x_state::wizatron_read_k) |
| 488 | { |
| 489 | return read_inputs(4); |
| 490 | } |
| 492 | 491 | |
| 492 | |
| 493 | 493 | static INPUT_PORTS_START( wizatron ) |
| 494 | 494 | PORT_START("IN.0") // O1 |
| 495 | 495 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("CLEAR") |
| r244949 | r244950 | |
| 544 | 544 | |
| 545 | 545 | ***************************************************************************/ |
| 546 | 546 | |
| 547 | | READ8_MEMBER(ticalc1x_state::lilprof_read_k) |
| 548 | | { |
| 549 | | return read_inputs(5); |
| 550 | | } |
| 551 | | |
| 552 | 547 | WRITE16_MEMBER(ticalc1x_state::lilprof_write_r) |
| 553 | 548 | { |
| 554 | 549 | // update leds state |
| r244949 | r244950 | |
| 578 | 573 | m_o = data; |
| 579 | 574 | } |
| 580 | 575 | |
| 576 | READ8_MEMBER(ticalc1x_state::lilprof_read_k) |
| 577 | { |
| 578 | return read_inputs(5); |
| 579 | } |
| 581 | 580 | |
| 581 | |
| 582 | 582 | static INPUT_PORTS_START( lilprof ) |
| 583 | 583 | PORT_START("IN.0") // O0 |
| 584 | 584 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") |
| r244949 | r244950 | |
| 642 | 642 | |
| 643 | 643 | ***************************************************************************/ |
| 644 | 644 | |
| 645 | | READ8_MEMBER(ticalc1x_state::ti30_read_k) |
| 646 | | { |
| 647 | | // note: the Vss row is always on |
| 648 | | return m_inp_matrix[7]->read() | read_inputs(7); |
| 649 | | } |
| 650 | | |
| 651 | 645 | WRITE16_MEMBER(ticalc1x_state::ti30_write_r) |
| 652 | 646 | { |
| 653 | 647 | // note: 1st digit only has segments B,F,G,DP |
| r244949 | r244950 | |
| 665 | 659 | m_o = data; |
| 666 | 660 | } |
| 667 | 661 | |
| 662 | READ8_MEMBER(ticalc1x_state::ti30_read_k) |
| 663 | { |
| 664 | // note: the Vss row is always on |
| 665 | return m_inp_matrix[7]->read() | read_inputs(7); |
| 666 | } |
| 668 | 667 | |
| 668 | |
| 669 | 669 | static INPUT_PORTS_START( ti30 ) |
| 670 | 670 | PORT_START("IN.0") // O0 |
| 671 | 671 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("y" UTF8_POW_X) |