trunk/src/emu/cpu/arcompact/arcompact.h
| r242509 | r242510 | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #define ARCOMPACT_HANDLER04_P11_TYPE(name) \ |
| 21 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p11(OPS_16) \ |
| 21 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11(OPS_32) \ |
| 22 | 22 | { \ |
| 23 | 23 | int M = (op & 0x00000020) >> 5; \ |
| 24 | 24 | \ |
| r242509 | r242510 | |
| 32 | 32 | }; \ |
| 33 | 33 | |
| 34 | 34 | #define ARCOMPACT_HANDLER04_TYPE(name) \ |
| 35 | | ARCOMPACT_RETTYPE arcompact_handle##name(OPS_16) \ |
| 35 | ARCOMPACT_RETTYPE arcompact_handle##name(OPS_32) \ |
| 36 | 36 | { \ |
| 37 | 37 | int p = (op & 0x00c00000) >> 22; \ |
| 38 | 38 | \ |
| r242509 | r242510 | |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | #define ARCOMPACT_HANDLER04_TYPE_PM(name) \ |
| 52 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p00(OPS_16); \ |
| 53 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p01(OPS_16); \ |
| 54 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p10(OPS_16); \ |
| 55 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m0(OPS_16); \ |
| 56 | | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m1(OPS_16); \ |
| 52 | ARCOMPACT_RETTYPE arcompact_handle##name##_p00(OPS_32); \ |
| 53 | ARCOMPACT_RETTYPE arcompact_handle##name##_p01(OPS_32); \ |
| 54 | ARCOMPACT_RETTYPE arcompact_handle##name##_p10(OPS_32); \ |
| 55 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m0(OPS_32); \ |
| 56 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m1(OPS_32); \ |
| 57 | 57 | ARCOMPACT_HANDLER04_P11_TYPE(name); \ |
| 58 | 58 | ARCOMPACT_HANDLER04_TYPE(name); \ |
| 59 | 59 | |
| r242509 | r242510 | |
| 156 | 156 | ARCOMPACT_RETTYPE arcompact_handle04_07(OPS_32); |
| 157 | 157 | ARCOMPACT_RETTYPE arcompact_handle04_08(OPS_32); |
| 158 | 158 | ARCOMPACT_RETTYPE arcompact_handle04_09(OPS_32); |
| 159 | | ARCOMPACT_RETTYPE arcompact_handle04_0a(OPS_32); |
| 159 | // ARCOMPACT_RETTYPE arcompact_handle04_0a(OPS_32); |
| 160 | 160 | ARCOMPACT_RETTYPE arcompact_handle04_0b(OPS_32); |
| 161 | 161 | ARCOMPACT_RETTYPE arcompact_handle04_0c(OPS_32); |
| 162 | 162 | ARCOMPACT_RETTYPE arcompact_handle04_0d(OPS_32); |
| r242509 | r242510 | |
| 769 | 769 | |
| 770 | 770 | |
| 771 | 771 | ARCOMPACT_HANDLER04_TYPE_PM(04_20); |
| 772 | ARCOMPACT_HANDLER04_TYPE_PM(04_0a); |
| 772 | 773 | |
| 773 | 774 | |
| 774 | 775 | private: |
trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242509 | r242510 | |
| 4 | 4 | #include "arcompact.h" |
| 5 | 5 | #include "arcompact_common.h" |
| 6 | 6 | |
| 7 | | #define ARCOMPACT_LOGGING 0 |
| 7 | #define ARCOMPACT_LOGGING 1 |
| 8 | 8 | |
| 9 | 9 | #define arcompact_fatal if (ARCOMPACT_LOGGING) fatalerror |
| 10 | 10 | #define arcompact_log if (ARCOMPACT_LOGGING) fatalerror |
| r242509 | r242510 | |
| 1392 | 1392 | } |
| 1393 | 1393 | |
| 1394 | 1394 | |
| 1395 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p00(OPS_32) |
| 1396 | { |
| 1397 | // p00 formats not listed in appendix? |
| 1398 | |
| 1399 | int size = 4; |
| 1400 | UINT32 limm = 0; |
| 1401 | int got_limm = 0; |
| 1402 | |
| 1403 | COMMON32_GET_breg |
| 1404 | COMMON32_GET_creg |
| 1405 | COMMON32_GET_F |
| 1406 | |
| 1407 | if (creg == LIMM_REG) |
| 1408 | { |
| 1409 | // opcode iiii iBBB ppII IIII FBBB CCCC CC-- ---- |
| 1410 | // MOV b <- limm 0010 0RRR 0000 1010 0RRR 1111 10RR RRRR [LIMM] (creg = LIMM) |
| 1411 | // MOV.F b <- limm 0010 0RRR 0000 1010 1RRR 1111 10RR RRRR [LIMM] (creg = LIMM) |
| 1412 | |
| 1413 | if (!got_limm) |
| 1414 | { |
| 1415 | GET_LIMM_32; |
| 1416 | size = 8; |
| 1417 | } |
| 1418 | |
| 1419 | m_regs[breg] = limm; |
| 1420 | |
| 1421 | if (F) |
| 1422 | { // currently not supported |
| 1423 | arcompact_fatal("unimplemented MOV.F %08x", op); |
| 1424 | } |
| 1425 | |
| 1426 | return m_pc + (size>>0); |
| 1427 | |
| 1428 | } |
| 1429 | else |
| 1430 | { |
| 1431 | // opcode iiii iBBB ppII IIII FBBB CCCC CC-- ---- |
| 1432 | // MOV b <- c 0010 0RRR 0000 1010 0RRR cccc ccRR RRRR |
| 1433 | // MOV.F b <- c 0010 0RRR 0000 1010 1RRR cccc ccRR RRRR |
| 1434 | |
| 1435 | arcompact_fatal("unimplemented MOV b <- c %08x", op); |
| 1436 | } |
| 1437 | |
| 1438 | return m_pc + (size>>0); |
| 1439 | |
| 1440 | } |
| 1441 | |
| 1442 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p01(OPS_32) |
| 1443 | { |
| 1444 | // opcode iiii i--- ppII IIII F--- uuuu uu-- ---- |
| 1445 | // MOV b <- u6 0010 0RRR 0100 1010 0RRR uuuu uuRR RRRR |
| 1446 | // MOV.F b <- u6 0010 0RRR 0100 1010 1RRR uuuu uuRR RRRR |
| 1447 | |
| 1448 | int size = 4; |
| 1449 | |
| 1450 | COMMON32_GET_breg |
| 1451 | COMMON32_GET_u6 |
| 1452 | COMMON32_GET_F |
| 1453 | |
| 1454 | m_regs[breg] = u; |
| 1455 | |
| 1456 | if (F) |
| 1457 | { // currently not supported |
| 1458 | arcompact_fatal("unimplemented MOV.F b <- u6 %08x", op); |
| 1459 | } |
| 1460 | |
| 1461 | return m_pc + (size>>0); |
| 1462 | } |
| 1463 | |
| 1464 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p10(OPS_32) |
| 1465 | { |
| 1466 | int size = 4; |
| 1467 | arcompact_fatal("arcompact_handle04_0a_p10\n"); |
| 1468 | return m_pc + (size >> 0); |
| 1469 | } |
| 1470 | |
| 1471 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m0(OPS_32) |
| 1472 | { |
| 1473 | int size = 4; |
| 1474 | arcompact_fatal("arcompact_handle04_0a_p11_m0\n"); |
| 1475 | return m_pc + (size >> 0); |
| 1476 | } |
| 1477 | |
| 1478 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m1(OPS_32) |
| 1479 | { |
| 1480 | int size = 4; |
| 1481 | arcompact_fatal("arcompact_handle04_0a_p11_m1\n"); |
| 1482 | return m_pc + (size >> 0); |
| 1483 | } |
| 1484 | |
| 1485 | #if 0 |
| 1395 | 1486 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a(OPS_32) |
| 1396 | 1487 | { |
| 1397 | 1488 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0a], /*"MOV"*/ 1,0); |
| 1398 | 1489 | } |
| 1490 | #endif |
| 1399 | 1491 | |
| 1400 | 1492 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0b(OPS_32) |
| 1401 | 1493 | { |
| r242509 | r242510 | |
| 1492 | 1584 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1d], /*"MPYU"*/ 0,0); |
| 1493 | 1585 | } // * |
| 1494 | 1586 | |
| 1587 | /* handler template for c+p |
| 1588 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handleXX_xx_p00(OPS_32) |
| 1589 | { |
| 1590 | int size = 4; |
| 1591 | arcompact_fatal("arcompact_handleXX_xx_p00\n"); |
| 1592 | return m_pc + (size >> 0); |
| 1593 | } |
| 1495 | 1594 | |
| 1595 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handleXX_xx_p01(OPS_32) |
| 1596 | { |
| 1597 | int size = 4; |
| 1598 | arcompact_fatal("arcompact_handleXX_xx_p01\n"); |
| 1599 | return m_pc + (size >> 0); |
| 1600 | } |
| 1496 | 1601 | |
| 1497 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p00(OPS_16) |
| 1602 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handleXX_xx_p10(OPS_32) |
| 1498 | 1603 | { |
| 1499 | 1604 | int size = 4; |
| 1605 | arcompact_fatal("arcompact_handleXX_xx_p10\n"); |
| 1606 | return m_pc + (size >> 0); |
| 1607 | } |
| 1608 | |
| 1609 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handleXX_xx_p11_m0(OPS_32) |
| 1610 | { |
| 1611 | int size = 4; |
| 1612 | arcompact_fatal("arcompact_handleXX_xx_p11_m0\n"); |
| 1613 | return m_pc + (size >> 0); |
| 1614 | } |
| 1615 | |
| 1616 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handleXX_xx_p11_m1(OPS_32) |
| 1617 | { |
| 1618 | int size = 4; |
| 1619 | arcompact_fatal("arcompact_handleXX_xx_p11_m1\n"); |
| 1620 | return m_pc + (size >> 0); |
| 1621 | } |
| 1622 | */ |
| 1623 | |
| 1624 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p00(OPS_32) |
| 1625 | { |
| 1626 | int size = 4; |
| 1500 | 1627 | UINT32 limm = 0; |
| 1501 | 1628 | int got_limm = 0; |
| 1502 | 1629 | |
| 1503 | 1630 | COMMON32_GET_creg |
| 1504 | 1631 | |
| 1505 | | if (creg == LIMM_REG) |
| 1632 | if (creg == LIMM_REG) |
| 1506 | 1633 | { |
| 1634 | // opcode iiii i--- ppII IIII F--- CCCC CC-- ---- |
| 1635 | // J limm 0010 0RRR 0010 0000 0RRR 1111 10RR RRRR [LIMM] (creg = LIMM) |
| 1636 | |
| 1507 | 1637 | if (!got_limm) |
| 1508 | 1638 | { |
| 1509 | 1639 | GET_LIMM_32; |
| r242509 | r242510 | |
| 1514 | 1644 | } |
| 1515 | 1645 | else |
| 1516 | 1646 | { |
| 1647 | // opcode iiii i--- ppII IIII F--- CCCC CC-- ---- |
| 1648 | // J [c] 0010 0RRR 0010 0000 0RRR CCCC CCRR RRRR |
| 1649 | // J.F [ilink1] 0010 0RRR 0010 0000 1RRR 0111 01RR RRRR (creg = ILINK1, FLAG must be set) |
| 1650 | // J.F [ilink2] 0010 0RRR 0010 0000 1RRR 0111 10RR RRRR (creg = ILINE2, FLAG must be set) |
| 1651 | |
| 1517 | 1652 | arcompact_log("unimplemented J %08x", op); |
| 1518 | 1653 | } |
| 1519 | 1654 | |
| 1520 | 1655 | return m_pc + (size>>0); |
| 1521 | 1656 | } |
| 1522 | 1657 | |
| 1523 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p01(OPS_16) |
| 1658 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p01(OPS_32) |
| 1524 | 1659 | { |
| 1660 | // opcode iiii i--- ppII IIII F--- uuuu uu-- ---- |
| 1661 | // J u6 0010 0RRR 0110 0000 0RRR uuuu uuRR RRRR |
| 1525 | 1662 | int size = 4; |
| 1526 | 1663 | arcompact_log("unimplemented J %08x", op); |
| 1527 | 1664 | return m_pc + (size>>0); |
| 1528 | 1665 | } |
| 1529 | 1666 | |
| 1530 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p10(OPS_16) |
| 1667 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p10(OPS_32) |
| 1531 | 1668 | { |
| 1669 | // opcode iiii i--- ppII IIII F--- ssss ssSS SSSS |
| 1670 | // J s12 0010 0RRR 1010 0000 0RRR ssss ssSS SSSS |
| 1532 | 1671 | int size = 4; |
| 1533 | 1672 | arcompact_log("unimplemented J %08x", op); |
| 1534 | 1673 | return m_pc + (size>>0); |
| 1535 | 1674 | } |
| 1536 | 1675 | |
| 1537 | 1676 | |
| 1538 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_16) |
| 1677 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) |
| 1539 | 1678 | { |
| 1540 | 1679 | int size = 4; |
| 1541 | 1680 | // UINT32 limm = 0; |
| r242509 | r242510 | |
| 1545 | 1684 | |
| 1546 | 1685 | if (creg == LIMM_REG) |
| 1547 | 1686 | { |
| 1687 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1688 | // Jcc limm 0010 0RRR 1110 0000 0RRR 1111 100Q QQQQ [LIUMM] |
| 1548 | 1689 | if (!got_limm) |
| 1549 | 1690 | { |
| 1550 | 1691 | //GET_LIMM_32; |
| r242509 | r242510 | |
| 1555 | 1696 | } |
| 1556 | 1697 | else |
| 1557 | 1698 | { |
| 1699 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1700 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 1701 | // no conditional links to ILINK1, ILINK2? |
| 1558 | 1702 | arcompact_log("unimplemented J %08x", op); |
| 1559 | 1703 | } |
| 1560 | 1704 | return m_pc + (size>>0); |
| 1561 | 1705 | } |
| 1562 | 1706 | |
| 1563 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m1(OPS_16) |
| 1707 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m1(OPS_32) |
| 1564 | 1708 | { |
| 1709 | // opcode iiii i--- ppII IIII F--- uuuu uumq qqqq |
| 1710 | // Jcc u6 0010 0RRR 1110 0000 0RRR uuuu uu1Q QQQQ |
| 1565 | 1711 | int size = 4; |
| 1566 | 1712 | arcompact_log("unimplemented J %08x", op); |
| 1567 | 1713 | return m_pc + (size>>0); |
trunk/src/mess/drivers/tispeak.c
| r242509 | r242510 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:hap, Lord Nightmare |
| 2 | // copyright-holders:hap |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | Texas Instruments Speak & Spell hardware |
| r242509 | r242510 | |
| 159 | 159 | |
| 160 | 160 | WRITE_LINE_MEMBER(tispeak_state::auto_power_off) |
| 161 | 161 | { |
| 162 | | // power-off request from the MCU, when [OFF] is pressed, also typically after a couple of minutes of idling |
| 162 | // power-off request from the MCU, usually after a couple of minutes of idling |
| 163 | 163 | if (state) |
| 164 | 164 | power_off(); |
| 165 | 165 | } |
| r242509 | r242510 | |
| 186 | 186 | |
| 187 | 187 | INPUT_CHANGED_MEMBER(tispeak_state::power_button) |
| 188 | 188 | { |
| 189 | // note: even though power buttons are on the matrix, they are not MCU-controlled |
| 189 | 190 | int on = (int)(FPTR)param; |
| 190 | 191 | |
| 191 | 192 | if (on) |
| r242509 | r242510 | |
| 244 | 245 | PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 245 | 246 | |
| 246 | 247 | PORT_START("IN.7") // R7 |
| 247 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") // -> auto_power_off |
| 248 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, power_button, (void *)0) |
| 248 | 249 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("Go") |
| 249 | 250 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("Replay") |
| 250 | 251 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Repeat") |
| r242509 | r242510 | |
| 285 | 286 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 286 | 287 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") |
| 287 | 288 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Go") |
| 288 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") // -> auto_power_off |
| 289 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, power_button, (void *)0) |
| 289 | 290 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 290 | 291 | |
| 291 | 292 | PORT_START("IN.4") // R4 |
| r242509 | r242510 | |
| 299 | 300 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") |
| 300 | 301 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") |
| 301 | 302 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) |
| 302 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) // / |
| 303 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) |
| 303 | 304 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Mix It") |
| 304 | 305 | |
| 305 | 306 | PORT_START("IN.6") // R6 |