trunk/src/mess/drivers/hh_tms1k.c
| r245155 | r245156 | |
| 1421 | 1421 | // R7 -> 75494 IN2 -> blue lamp |
| 1422 | 1422 | display_matrix(4, 1, data >> 4, 1); |
| 1423 | 1423 | |
| 1424 | | // R8 -> 75494 IN0 -> speaker |
| 1424 | // R8 -> 75494 IN0 -> speaker out |
| 1425 | 1425 | m_speaker->level_w(data >> 8 & 1); |
| 1426 | 1426 | |
| 1427 | | // R0,R1,R2,R9: input mux |
| 1427 | // R0-R2,R9: input mux |
| 1428 | 1428 | // R3: GND |
| 1429 | 1429 | // other bits: N/C |
| 1430 | 1430 | m_inp_mux = (data & 7) | (data >> 6 & 8); |
| r245155 | r245156 | |
| 1450 | 1450 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1451 | 1451 | |
| 1452 | 1452 | PORT_START("IN.1") // R1 |
| 1453 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Green Button") |
| 1454 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Red Button") |
| 1455 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Yellow Button") |
| 1456 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Blue Button") |
| 1453 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Green Button") |
| 1454 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Red Button") |
| 1455 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Yellow Button") |
| 1456 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Blue Button") |
| 1457 | 1457 | |
| 1458 | 1458 | PORT_START("IN.2") // R2 |
| 1459 | 1459 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") |
| 1460 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Last") |
| 1461 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Longest") |
| 1460 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Last") |
| 1461 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Longest") |
| 1462 | 1462 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1463 | 1463 | |
| 1464 | 1464 | PORT_START("IN.3") // R9 |
| 1465 | | PORT_CONFNAME( 0x0f, 0x01, "Skill Level") |
| 1465 | PORT_CONFNAME( 0x0f, 0x02, "Skill Level") |
| 1466 | 1466 | PORT_CONFSETTING( 0x02, "1" ) |
| 1467 | 1467 | PORT_CONFSETTING( 0x04, "2" ) |
| 1468 | 1468 | PORT_CONFSETTING( 0x08, "3" ) |
| r245155 | r245156 | |
| 1504 | 1504 | |
| 1505 | 1505 | WRITE16_MEMBER(hh_tms1k_state::ssimon_write_r) |
| 1506 | 1506 | { |
| 1507 | // R0-R3,R9,R10: input mux |
| 1508 | m_inp_mux = (data & 0xf) | (data >> 5 & 0x30); |
| 1509 | |
| 1510 | // R4: yellow lamps |
| 1511 | // R5: green lamps |
| 1512 | // R6: blue lamps |
| 1513 | // R7: red lamps |
| 1514 | display_matrix(4, 1, data >> 4, 1); |
| 1515 | |
| 1516 | // R8: speaker out |
| 1517 | m_speaker->level_w(data >> 8 & 1); |
| 1507 | 1518 | } |
| 1508 | 1519 | |
| 1509 | 1520 | WRITE16_MEMBER(hh_tms1k_state::ssimon_write_o) |
| r245155 | r245156 | |
| 1513 | 1524 | |
| 1514 | 1525 | READ8_MEMBER(hh_tms1k_state::ssimon_read_k) |
| 1515 | 1526 | { |
| 1516 | | return 0; |
| 1527 | return read_inputs(6); |
| 1517 | 1528 | } |
| 1518 | 1529 | |
| 1519 | 1530 | |
| 1520 | 1531 | static INPUT_PORTS_START( ssimon ) |
| 1532 | PORT_START("IN.0") // R0 |
| 1533 | PORT_CONFNAME( 0x0f, 0x01, "Game Select") |
| 1534 | PORT_CONFSETTING( 0x01, "1" ) |
| 1535 | PORT_CONFSETTING( 0x02, "2" ) |
| 1536 | PORT_CONFSETTING( 0x04, "3" ) |
| 1537 | PORT_CONFSETTING( 0x08, "4" ) |
| 1538 | PORT_CONFSETTING( 0x00, "5" ) |
| 1539 | |
| 1540 | PORT_START("IN.1") // R1 |
| 1541 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Yellow Button") |
| 1542 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Green Button") |
| 1543 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Blue Button") |
| 1544 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Red Button") |
| 1545 | |
| 1546 | PORT_START("IN.2") // R2 |
| 1547 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") |
| 1548 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Last") |
| 1549 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Longest") |
| 1550 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Decision") |
| 1551 | |
| 1552 | PORT_START("IN.3") // R3 |
| 1553 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Yellow Button") |
| 1554 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Green Button") |
| 1555 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Blue Button") |
| 1556 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Red Button") |
| 1557 | |
| 1558 | PORT_START("IN.4") // R9 |
| 1559 | PORT_CONFNAME( 0x0f, 0x02, "Skill Level") |
| 1560 | PORT_CONFSETTING( 0x00, "Head-to-Head" ) // this sets R10 K2, see below |
| 1561 | PORT_CONFSETTING( 0x02, "1" ) |
| 1562 | PORT_CONFSETTING( 0x04, "2" ) |
| 1563 | PORT_CONFSETTING( 0x08, "3" ) |
| 1564 | PORT_CONFSETTING( 0x01, "4" ) |
| 1565 | |
| 1566 | PORT_START("IN.5") // R10 |
| 1567 | PORT_BIT( 0x02, 0x02, IPT_SPECIAL ) PORT_CONDITION("IN.4", 0x0f, EQUALS, 0x00) |
| 1568 | PORT_BIT( 0x02, 0x00, IPT_SPECIAL ) PORT_CONDITION("IN.4", 0x0f, NOTEQUALS, 0x00) |
| 1569 | PORT_BIT( 0x0d, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1570 | |
| 1571 | PORT_START("IN.6") // fake |
| 1572 | PORT_CONFNAME( 0x03, 0x00, "Speed" ) //PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, ssimon_speed_switch, NULL) |
| 1573 | PORT_CONFSETTING( 0x00, "Simple" ) |
| 1574 | PORT_CONFSETTING( 0x01, "Normal" ) |
| 1575 | PORT_CONFSETTING( 0x02, "Super" ) |
| 1521 | 1576 | INPUT_PORTS_END |
| 1522 | 1577 | |
| 1523 | 1578 | |
| 1524 | 1579 | static MACHINE_CONFIG_START( ssimon, hh_tms1k_state ) |
| 1525 | 1580 | |
| 1526 | 1581 | /* basic machine hardware */ |
| 1527 | | MCFG_CPU_ADD("maincpu", TMS1000, 350000) // x |
| 1582 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // x |
| 1528 | 1583 | MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ssimon_read_k)) |
| 1529 | 1584 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ssimon_write_r)) |
| 1530 | 1585 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ssimon_write_o)) |