src/mess/machine/mac.c
| r9561 | r9562 | |
| 1514 | 1514 | * ADB (Mac II-style) |
| 1515 | 1515 | * *************************************************************************/ |
| 1516 | 1516 | |
| 1517 | | // ADB mouse state |
| 1518 | | static int adb_mouseaddr = 3; |
| 1519 | | static int adb_lastmousex, adb_lastmousey, adb_lastbutton, adb_mouse_initialized; |
| 1520 | | |
| 1521 | | // ADB keyboard state |
| 1522 | | static int adb_keybaddr = 2; |
| 1523 | | static int adb_keybinitialized, adb_currentkeys[2], adb_modifiers; |
| 1524 | | |
| 1525 | 1517 | #if LOG_ADB |
| 1526 | 1518 | static const char *const adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" }; |
| 1527 | 1519 | #endif |
| 1528 | 1520 | |
| 1529 | | static int mac_adb_pollkbd(running_machine *machine, int update) |
| 1521 | int mac_state::adb_pollkbd(running_machine *machine, int update) |
| 1530 | 1522 | { |
| 1531 | 1523 | int i, j, keybuf, report, codes[2], result; |
| 1532 | 1524 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; |
| 1533 | | mac_state *mac = machine->driver_data<mac_state>(); |
| 1534 | 1525 | |
| 1535 | 1526 | codes[0] = codes[1] = 0x80; // key up |
| 1536 | 1527 | report = result = 0; |
| r9561 | r9562 | |
| 1540 | 1531 | keybuf = input_port_read(machine, keynames[i]); |
| 1541 | 1532 | |
| 1542 | 1533 | // any changes in this row? |
| 1543 | | if ((keybuf != mac->m_key_matrix[i]) && (report < 2)) |
| 1534 | if ((keybuf != m_key_matrix[i]) && (report < 2)) |
| 1544 | 1535 | { |
| 1545 | 1536 | // check each column bit |
| 1546 | 1537 | for (j=0; j<16; j++) |
| 1547 | 1538 | { |
| 1548 | | if (((keybuf ^ mac->m_key_matrix[i]) >> j) & 1) |
| 1539 | if (((keybuf ^ m_key_matrix[i]) >> j) & 1) |
| 1549 | 1540 | { |
| 1550 | | // update mac->m_key_matrix |
| 1541 | // update m_key_matrix |
| 1551 | 1542 | if (update) |
| 1552 | 1543 | { |
| 1553 | | mac->m_key_matrix[i] = (mac->m_key_matrix[i] & ~ (1 << j)) | (keybuf & (1 << j)); |
| 1544 | m_key_matrix[i] = (m_key_matrix[i] & ~ (1 << j)) | (keybuf & (1 << j)); |
| 1554 | 1545 | } |
| 1555 | 1546 | |
| 1556 | 1547 | codes[report] = (i<<4)|j; |
| r9561 | r9562 | |
| 1568 | 1559 | { |
| 1569 | 1560 | if (codes[report] & 0x80) |
| 1570 | 1561 | { |
| 1571 | | adb_modifiers &= ~0x20; |
| 1562 | m_adb_modifiers &= ~0x20; |
| 1572 | 1563 | } |
| 1573 | 1564 | else |
| 1574 | 1565 | { |
| 1575 | | adb_modifiers |= 0x20; |
| 1566 | m_adb_modifiers |= 0x20; |
| 1576 | 1567 | } |
| 1577 | 1568 | } |
| 1578 | 1569 | if (((i<<4)|j) == 0x36) |
| 1579 | 1570 | { |
| 1580 | 1571 | if (codes[report] & 0x80) |
| 1581 | 1572 | { |
| 1582 | | adb_modifiers &= ~0x8; |
| 1573 | m_adb_modifiers &= ~0x8; |
| 1583 | 1574 | } |
| 1584 | 1575 | else |
| 1585 | 1576 | { |
| 1586 | | adb_modifiers |= 0x08; |
| 1577 | m_adb_modifiers |= 0x08; |
| 1587 | 1578 | } |
| 1588 | 1579 | } |
| 1589 | 1580 | if (((i<<4)|j) == 0x38) |
| 1590 | 1581 | { |
| 1591 | 1582 | if (codes[report] & 0x80) |
| 1592 | 1583 | { |
| 1593 | | adb_modifiers &= ~0x4; |
| 1584 | m_adb_modifiers &= ~0x4; |
| 1594 | 1585 | } |
| 1595 | 1586 | else |
| 1596 | 1587 | { |
| 1597 | | adb_modifiers |= 0x04; |
| 1588 | m_adb_modifiers |= 0x04; |
| 1598 | 1589 | } |
| 1599 | 1590 | } |
| 1600 | 1591 | if (((i<<4)|j) == 0x3a) |
| 1601 | 1592 | { |
| 1602 | 1593 | if (codes[report] & 0x80) |
| 1603 | 1594 | { |
| 1604 | | adb_modifiers &= ~0x2; |
| 1595 | m_adb_modifiers &= ~0x2; |
| 1605 | 1596 | } |
| 1606 | 1597 | else |
| 1607 | 1598 | { |
| 1608 | | adb_modifiers |= 0x02; |
| 1599 | m_adb_modifiers |= 0x02; |
| 1609 | 1600 | } |
| 1610 | 1601 | } |
| 1611 | 1602 | if (((i<<4)|j) == 0x37) |
| 1612 | 1603 | { |
| 1613 | 1604 | if (codes[report] & 0x80) |
| 1614 | 1605 | { |
| 1615 | | adb_modifiers &= ~0x1; |
| 1606 | m_adb_modifiers &= ~0x1; |
| 1616 | 1607 | } |
| 1617 | 1608 | else |
| 1618 | 1609 | { |
| 1619 | | adb_modifiers |= 0x01; |
| 1610 | m_adb_modifiers |= 0x01; |
| 1620 | 1611 | } |
| 1621 | 1612 | } |
| 1622 | 1613 | } |
| r9561 | r9562 | |
| 1641 | 1632 | // printf("ADB keyboard: update %d keys %02x %02x\n", update, codes[0], codes[1]); |
| 1642 | 1633 | |
| 1643 | 1634 | // figure out if there was a change |
| 1644 | | if ((adb_currentkeys[0] != codes[0]) || (adb_currentkeys[1] != codes[1])) |
| 1635 | if ((m_adb_currentkeys[0] != codes[0]) || (m_adb_currentkeys[1] != codes[1])) |
| 1645 | 1636 | { |
| 1646 | 1637 | result = 1; |
| 1647 | 1638 | |
| 1648 | 1639 | // if we want to update the current read, do so |
| 1649 | 1640 | if (update) |
| 1650 | 1641 | { |
| 1651 | | adb_currentkeys[0] = codes[0]; |
| 1652 | | adb_currentkeys[1] = codes[1]; |
| 1642 | m_adb_currentkeys[0] = codes[0]; |
| 1643 | m_adb_currentkeys[1] = codes[1]; |
| 1653 | 1644 | } |
| 1654 | 1645 | } |
| 1655 | 1646 | |
| 1656 | 1647 | return result; |
| 1657 | 1648 | } |
| 1658 | 1649 | |
| 1659 | | static int mac_adb_pollmouse(running_machine *machine) |
| 1650 | int mac_state::adb_pollmouse(running_machine *machine) |
| 1660 | 1651 | { |
| 1661 | 1652 | int NewX, NewY, NewButton; |
| 1662 | 1653 | |
| 1663 | | if (!adb_mouse_initialized) |
| 1654 | if (!m_adb_mouse_initialized) |
| 1664 | 1655 | { |
| 1665 | 1656 | return 0; |
| 1666 | 1657 | } |
| r9561 | r9562 | |
| 1669 | 1660 | NewX = input_port_read(machine, "MOUSE2"); |
| 1670 | 1661 | NewY = input_port_read(machine, "MOUSE1"); |
| 1671 | 1662 | |
| 1672 | | if ((NewX != adb_lastmousex) || (NewY != adb_lastmousey) || (NewButton != adb_lastbutton)) |
| 1663 | if ((NewX != m_adb_lastmousex) || (NewY != m_adb_lastmousey) || (NewButton != m_adb_lastbutton)) |
| 1673 | 1664 | { |
| 1674 | 1665 | return 1; |
| 1675 | 1666 | } |
| r9561 | r9562 | |
| 1677 | 1668 | return 0; |
| 1678 | 1669 | } |
| 1679 | 1670 | |
| 1680 | | static void mac_adb_accummouse( running_machine *machine, UINT8 *MouseX, UINT8 *MouseY ) |
| 1671 | void mac_state::adb_accummouse( running_machine *machine, UINT8 *MouseX, UINT8 *MouseY ) |
| 1681 | 1672 | { |
| 1682 | 1673 | int MouseCountX = 0, MouseCountY = 0; |
| 1683 | 1674 | int NewX, NewY; |
| r9561 | r9562 | |
| 1686 | 1677 | NewY = input_port_read(machine, "MOUSE1"); |
| 1687 | 1678 | |
| 1688 | 1679 | /* see if it moved in the x coord */ |
| 1689 | | if (NewX != adb_lastmousex) |
| 1680 | if (NewX != m_adb_lastmousex) |
| 1690 | 1681 | { |
| 1691 | | int diff = NewX - adb_lastmousex; |
| 1682 | int diff = NewX - m_adb_lastmousex; |
| 1692 | 1683 | |
| 1693 | 1684 | /* check for wrap */ |
| 1694 | 1685 | if (diff > 0x80) |
| r9561 | r9562 | |
| 1697 | 1688 | diff = -0x100-diff; |
| 1698 | 1689 | |
| 1699 | 1690 | MouseCountX += diff; |
| 1700 | | adb_lastmousex = NewX; |
| 1691 | m_adb_lastmousex = NewX; |
| 1701 | 1692 | } |
| 1702 | 1693 | |
| 1703 | 1694 | /* see if it moved in the y coord */ |
| 1704 | | if (NewY != adb_lastmousey) |
| 1695 | if (NewY != m_adb_lastmousey) |
| 1705 | 1696 | { |
| 1706 | | int diff = NewY - adb_lastmousey; |
| 1697 | int diff = NewY - m_adb_lastmousey; |
| 1707 | 1698 | |
| 1708 | 1699 | /* check for wrap */ |
| 1709 | 1700 | if (diff > 0x80) |
| r9561 | r9562 | |
| 1712 | 1703 | diff = -0x100-diff; |
| 1713 | 1704 | |
| 1714 | 1705 | MouseCountY += diff; |
| 1715 | | adb_lastmousey = NewY; |
| 1706 | m_adb_lastmousey = NewY; |
| 1716 | 1707 | } |
| 1717 | 1708 | |
| 1718 | | adb_lastbutton = input_port_read(machine, "MOUSE0") & 0x01; |
| 1709 | m_adb_lastbutton = input_port_read(machine, "MOUSE0") & 0x01; |
| 1719 | 1710 | |
| 1720 | 1711 | *MouseX = (UINT8)MouseCountX; |
| 1721 | 1712 | *MouseY = (UINT8)MouseCountY; |
| 1722 | 1713 | } |
| 1723 | 1714 | |
| 1724 | | static void mac_adb_talk(running_machine *machine) |
| 1715 | void mac_state::adb_talk(running_machine *machine) |
| 1725 | 1716 | { |
| 1726 | 1717 | int addr, reg; |
| 1727 | | mac_state *mac = machine->driver_data<mac_state>(); |
| 1728 | 1718 | |
| 1729 | | addr = (mac->m_adb_command>>4); |
| 1730 | | reg = (mac->m_adb_command & 3); |
| 1719 | addr = (m_adb_command>>4); |
| 1720 | reg = (m_adb_command & 3); |
| 1731 | 1721 | |
| 1732 | | // printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", mac->m_adb_command, (mac->m_adb_command>>2)&3, addr, reg, adb_mouseaddr, adb_keybaddr); |
| 1722 | // printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", mac->m_adb_command, (mac->m_adb_command>>2)&3, addr, reg, m_adb_mouseaddr, m_adb_keybaddr); |
| 1733 | 1723 | |
| 1734 | | if (mac->m_adb_waiting_cmd) |
| 1724 | if (m_adb_waiting_cmd) |
| 1735 | 1725 | { |
| 1736 | | switch ((mac->m_adb_command>>2)&3) |
| 1726 | switch ((m_adb_command>>2)&3) |
| 1737 | 1727 | { |
| 1738 | 1728 | case 0: |
| 1739 | 1729 | case 1: |
| r9561 | r9562 | |
| 1743 | 1733 | #if LOG_ADB |
| 1744 | 1734 | printf("ADB RESET: reg %x address %x\n", reg, addr); |
| 1745 | 1735 | #endif |
| 1746 | | mac->m_adb_direction = 0; |
| 1747 | | mac->m_adb_send = 0; |
| 1736 | m_adb_direction = 0; |
| 1737 | m_adb_send = 0; |
| 1748 | 1738 | break; |
| 1749 | 1739 | |
| 1750 | 1740 | case ADB_CMD_FLUSH: |
| r9561 | r9562 | |
| 1752 | 1742 | printf("ADB FLUSH: reg %x address %x\n", reg, addr); |
| 1753 | 1743 | #endif |
| 1754 | 1744 | |
| 1755 | | mac->m_adb_direction = 0; |
| 1756 | | mac->m_adb_send = 0; |
| 1745 | m_adb_direction = 0; |
| 1746 | m_adb_send = 0; |
| 1757 | 1747 | break; |
| 1758 | 1748 | |
| 1759 | 1749 | default: // reserved/unused |
| r9561 | r9562 | |
| 1766 | 1756 | printf("ADB LISTEN: reg %x address %x\n", reg, addr); |
| 1767 | 1757 | #endif |
| 1768 | 1758 | |
| 1769 | | mac->m_adb_direction = 1; // input from Mac |
| 1770 | | mac->m_adb_listenreg = reg; |
| 1771 | | mac->m_adb_listenaddr = addr; |
| 1772 | | mac->m_adb_command = 0; |
| 1759 | m_adb_direction = 1; // input from Mac |
| 1760 | m_adb_listenreg = reg; |
| 1761 | m_adb_listenaddr = addr; |
| 1762 | m_adb_command = 0; |
| 1773 | 1763 | break; |
| 1774 | 1764 | |
| 1775 | 1765 | case 3: // talk |
| r9561 | r9562 | |
| 1778 | 1768 | #endif |
| 1779 | 1769 | |
| 1780 | 1770 | // keep track of what device the Mac last TALKed to |
| 1781 | | mac->m_adb_last_talk = addr; |
| 1771 | m_adb_last_talk = addr; |
| 1782 | 1772 | |
| 1783 | | mac->m_adb_direction = 0; // output to Mac |
| 1784 | | if (addr == adb_mouseaddr) |
| 1773 | m_adb_direction = 0; // output to Mac |
| 1774 | if (addr == m_adb_mouseaddr) |
| 1785 | 1775 | { |
| 1786 | 1776 | UINT8 mouseX, mouseY; |
| 1787 | 1777 | |
| r9561 | r9562 | |
| 1793 | 1783 | { |
| 1794 | 1784 | // read mouse |
| 1795 | 1785 | case 0: |
| 1796 | | if (mac->m_adb_srq_switch) |
| 1786 | if (m_adb_srq_switch) |
| 1797 | 1787 | { |
| 1798 | | mac->m_adb_srq_switch = 0; |
| 1788 | m_adb_srq_switch = 0; |
| 1799 | 1789 | mouseX = mouseY = 0; |
| 1800 | 1790 | } |
| 1801 | 1791 | else |
| 1802 | 1792 | { |
| 1803 | | mac_adb_accummouse(machine, &mouseX, &mouseY); |
| 1793 | adb_accummouse(machine, &mouseX, &mouseY); |
| 1804 | 1794 | } |
| 1805 | | mac->m_adb_buffer[0] = (adb_lastbutton & 0x01) ? 0x00 : 0x80; |
| 1806 | | mac->m_adb_buffer[0] |= mouseX & 0x7f; |
| 1807 | | mac->m_adb_buffer[1] = mouseY & 0x7f; |
| 1808 | | mac->m_adb_datasize = 2; |
| 1795 | m_adb_buffer[0] = (m_adb_lastbutton & 0x01) ? 0x00 : 0x80; |
| 1796 | m_adb_buffer[0] |= mouseX & 0x7f; |
| 1797 | m_adb_buffer[1] = mouseY & 0x7f; |
| 1798 | m_adb_datasize = 2; |
| 1809 | 1799 | break; |
| 1810 | 1800 | |
| 1811 | 1801 | // get ID/handler |
| 1812 | 1802 | case 3: |
| 1813 | | mac->m_adb_buffer[0] = 0x60 | ((adb_mouseaddr<<8)&0xf); // SRQ enable, no exceptional event |
| 1814 | | mac->m_adb_buffer[1] = 0x01; // handler 1 |
| 1815 | | mac->m_adb_datasize = 2; |
| 1803 | m_adb_buffer[0] = 0x60 | ((m_adb_mouseaddr<<8)&0xf); // SRQ enable, no exceptional event |
| 1804 | m_adb_buffer[1] = 0x01; // handler 1 |
| 1805 | m_adb_datasize = 2; |
| 1816 | 1806 | |
| 1817 | | adb_mouse_initialized = 1; |
| 1807 | m_adb_mouse_initialized = 1; |
| 1818 | 1808 | break; |
| 1819 | 1809 | |
| 1820 | 1810 | default: |
| 1821 | 1811 | break; |
| 1822 | 1812 | } |
| 1823 | 1813 | } |
| 1824 | | else if (addr == adb_keybaddr) |
| 1814 | else if (addr == m_adb_keybaddr) |
| 1825 | 1815 | { |
| 1826 | 1816 | #if LOG_ADB |
| 1827 | 1817 | printf("Talking to keyboard, register %x\n", reg); |
| r9561 | r9562 | |
| 1831 | 1821 | { |
| 1832 | 1822 | // read keyboard |
| 1833 | 1823 | case 0: |
| 1834 | | if (mac->m_adb_srq_switch) |
| 1824 | if (m_adb_srq_switch) |
| 1835 | 1825 | { |
| 1836 | | mac->m_adb_srq_switch = 0; |
| 1826 | m_adb_srq_switch = 0; |
| 1837 | 1827 | } |
| 1838 | 1828 | else |
| 1839 | 1829 | { |
| 1840 | | mac_adb_pollkbd(machine, 1); |
| 1830 | adb_pollkbd(machine, 1); |
| 1841 | 1831 | } |
| 1842 | | // printf("keyboard = %02x %02x\n", adb_currentkeys[0], adb_currentkeys[1]); |
| 1843 | | mac->m_adb_buffer[0] = adb_currentkeys[1]; |
| 1844 | | mac->m_adb_buffer[1] = adb_currentkeys[0]; |
| 1845 | | mac->m_adb_datasize = 2; |
| 1832 | // printf("keyboard = %02x %02x\n", m_adb_currentkeys[0], m_adb_currentkeys[1]); |
| 1833 | m_adb_buffer[0] = m_adb_currentkeys[1]; |
| 1834 | m_adb_buffer[1] = m_adb_currentkeys[0]; |
| 1835 | m_adb_datasize = 2; |
| 1846 | 1836 | break; |
| 1847 | 1837 | |
| 1848 | 1838 | // read modifier keys |
| 1849 | 1839 | case 2: |
| 1850 | | mac_adb_pollkbd(machine, 1); |
| 1851 | | mac->m_adb_buffer[0] = adb_modifiers; // nothing pressed |
| 1852 | | mac->m_adb_buffer[1] = 0; |
| 1853 | | mac->m_adb_datasize = 2; |
| 1840 | adb_pollkbd(machine, 1); |
| 1841 | m_adb_buffer[0] = m_adb_modifiers; // nothing pressed |
| 1842 | m_adb_buffer[1] = 0; |
| 1843 | m_adb_datasize = 2; |
| 1854 | 1844 | break; |
| 1855 | 1845 | |
| 1856 | 1846 | // get ID/handler |
| 1857 | 1847 | case 3: |
| 1858 | | mac->m_adb_buffer[0] = 0x60 | ((adb_keybaddr<<8)&0xf); // SRQ enable, no exceptional event |
| 1859 | | mac->m_adb_buffer[1] = 0x01; // handler 1 |
| 1860 | | mac->m_adb_datasize = 2; |
| 1848 | m_adb_buffer[0] = 0x60 | ((m_adb_keybaddr<<8)&0xf); // SRQ enable, no exceptional event |
| 1849 | m_adb_buffer[1] = 0x01; // handler 1 |
| 1850 | m_adb_datasize = 2; |
| 1861 | 1851 | |
| 1862 | | adb_keybinitialized = 1; |
| 1852 | m_adb_keybinitialized = 1; |
| 1863 | 1853 | break; |
| 1864 | 1854 | |
| 1865 | 1855 | default: |
| r9561 | r9562 | |
| 1871 | 1861 | #if LOG_ADB |
| 1872 | 1862 | printf("ADB: talking to unconnected device\n"); |
| 1873 | 1863 | #endif |
| 1874 | | mac->m_adb_buffer[0] = mac->m_adb_buffer[1] = 0; |
| 1875 | | mac->m_adb_datasize = 0; |
| 1864 | m_adb_buffer[0] = m_adb_buffer[1] = 0; |
| 1865 | m_adb_datasize = 0; |
| 1876 | 1866 | } |
| 1877 | 1867 | break; |
| 1878 | 1868 | } |
| 1879 | 1869 | |
| 1880 | | mac->m_adb_waiting_cmd = 0; |
| 1870 | m_adb_waiting_cmd = 0; |
| 1881 | 1871 | } |
| 1882 | 1872 | else |
| 1883 | 1873 | { |
| 1884 | 1874 | #if LOG_ADB |
| 1885 | | printf("Got LISTEN data %x for device %x reg %x\n", mac->m_adb_command, mac->m_adb_listenaddr, mac->m_adb_listenreg); |
| 1875 | printf("Got LISTEN data %x for device %x reg %x\n", m_adb_command, m_adb_listenaddr, m_adb_listenreg); |
| 1886 | 1876 | #endif |
| 1887 | 1877 | |
| 1888 | | if (mac->m_adb_listenaddr == adb_mouseaddr) |
| 1878 | if (m_adb_listenaddr == m_adb_mouseaddr) |
| 1889 | 1879 | { |
| 1890 | | if ((mac->m_adb_listenreg == 3) && (mac->m_adb_command > 0) && (mac->m_adb_command < 16)) |
| 1880 | if ((m_adb_listenreg == 3) && (m_adb_command > 0) && (m_adb_command < 16)) |
| 1891 | 1881 | { |
| 1892 | 1882 | #if LOG_ADB |
| 1893 | | printf("MOUSE: moving to address %x\n", mac->m_adb_command); |
| 1883 | printf("MOUSE: moving to address %x\n", m_adb_command); |
| 1894 | 1884 | #endif |
| 1895 | | adb_mouseaddr = mac->m_adb_command&0x0f; |
| 1885 | m_adb_mouseaddr = m_adb_command&0x0f; |
| 1896 | 1886 | } |
| 1897 | 1887 | } |
| 1898 | | else if (mac->m_adb_listenaddr == adb_keybaddr) |
| 1888 | else if (m_adb_listenaddr == m_adb_keybaddr) |
| 1899 | 1889 | { |
| 1900 | | if ((mac->m_adb_listenreg == 3) && (mac->m_adb_command > 0) && (mac->m_adb_command < 16)) |
| 1890 | if ((m_adb_listenreg == 3) && (m_adb_command > 0) && (m_adb_command < 16)) |
| 1901 | 1891 | { |
| 1902 | 1892 | #if LOG_ADB |
| 1903 | | printf("KEYBOARD: moving to address %x\n", mac->m_adb_command); |
| 1893 | printf("KEYBOARD: moving to address %x\n", m_adb_command); |
| 1904 | 1894 | #endif |
| 1905 | | adb_keybaddr = mac->m_adb_command&0x0f; |
| 1895 | m_adb_keybaddr = m_adb_command&0x0f; |
| 1906 | 1896 | } |
| 1907 | 1897 | } |
| 1908 | 1898 | } |
| r9561 | r9562 | |
| 1925 | 1915 | |
| 1926 | 1916 | if ((mac->m_adb_direction) && (ADB_IS_BITBANG)) |
| 1927 | 1917 | { |
| 1928 | | mac_adb_talk(machine); |
| 1918 | mac->adb_talk(machine); |
| 1929 | 1919 | } |
| 1930 | 1920 | else if (ADB_IS_EGRET) |
| 1931 | 1921 | { |
| r9561 | r9562 | |
| 2091 | 2081 | timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0); |
| 2092 | 2082 | } |
| 2093 | 2083 | |
| 2084 | static void mac_egret_response_adb(mac_state *mac, int type, int flag, int cmd, int extra) |
| 2085 | { |
| 2086 | mac->m_adb_send = 0xaa; |
| 2087 | mac->m_adb_buffer[4] = extra; |
| 2088 | mac->m_adb_buffer[3] = type; |
| 2089 | mac->m_adb_buffer[2] = flag; |
| 2090 | mac->m_adb_buffer[1] = cmd; |
| 2091 | mac->m_adb_state |= 1; |
| 2092 | mac->m_adb_timer_ticks = 8; |
| 2093 | mac->m_adb_datasize = 4; |
| 2094 | timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0); |
| 2095 | } |
| 2096 | |
| 2094 | 2097 | static void mac_egret_response_read_pram(mac_state *mac, int cmd, int addr) |
| 2095 | 2098 | { |
| 2096 | 2099 | mac->m_adb_datasize = 4; |
| r9561 | r9562 | |
| 2239 | 2242 | mac_egret_response_std(mac, 1, 0, 0x0e); |
| 2240 | 2243 | break; |
| 2241 | 2244 | |
| 2245 | case 0x19: // set device list bitmap |
| 2246 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2247 | printf("ADB: Egret set device list bitmap %02x%02x\n", mac->m_adb_buffer[2], mac->m_adb_buffer[3]); |
| 2248 | #endif |
| 2249 | |
| 2250 | mac_egret_response_std(mac, 1, 0, 0x19); |
| 2251 | break; |
| 2252 | |
| 2242 | 2253 | case 0x1b: // set one-second interrupt |
| 2243 | 2254 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2244 | 2255 | if (mac->m_adb_buffer[2]) |
| r9561 | r9562 | |
| 2344 | 2355 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2345 | 2356 | printf("Egret: ADB Reset\n"); |
| 2346 | 2357 | #endif |
| 2347 | | mac_egret_response_std(mac, 0, 0, 0); |
| 2358 | mac_egret_response_adb(mac, 0, 0, 0, 0); |
| 2348 | 2359 | break; |
| 2349 | 2360 | |
| 2350 | 2361 | case 1: // flush |
| 2351 | 2362 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2352 | | printf("Egret: ADB Reset\n"); |
| 2363 | printf("Egret: ADB Flush\n"); |
| 2353 | 2364 | #endif |
| 2354 | | mac_egret_response_std(mac, 1, 0, 0); |
| 2365 | mac_egret_response_std(mac, 1, 1, 0); |
| 2355 | 2366 | break; |
| 2356 | 2367 | |
| 2357 | 2368 | default: |
| 2358 | | printf("Egret: Unhandled ADB command %x\n", mac->m_adb_buffer[1]); |
| 2369 | switch ((mac->m_adb_buffer[1]>>2)&3) |
| 2370 | { |
| 2371 | case 2: // ADB listen |
| 2372 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2373 | printf("Egret: ADB listen to device %d\n", mac->m_adb_buffer[1]>>4); |
| 2374 | #endif |
| 2375 | mac_egret_response_adb(mac, 0, 2, 0, 0); |
| 2376 | break; |
| 2377 | |
| 2378 | case 3: // ADB talk |
| 2379 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2380 | printf("Egret: ADB talk to device %d\n", mac->m_adb_buffer[1]>>4); |
| 2381 | #endif |
| 2382 | mac_egret_response_adb(mac, 0, 2, 0, 0); |
| 2383 | break; |
| 2384 | } |
| 2385 | |
| 2386 | #if LOG_ADB || LOG_ADB_MCU_CMD |
| 2387 | printf("Egret: Unhandled ADB command %02x\n", mac->m_adb_buffer[1]); |
| 2388 | #endif |
| 2359 | 2389 | mac->m_adb_datasize = 0; |
| 2360 | 2390 | break; |
| 2361 | 2391 | |
| r9561 | r9562 | |
| 2478 | 2508 | { |
| 2479 | 2509 | if (m_adb_state == ADB_STATE_IDLE) |
| 2480 | 2510 | { |
| 2481 | | if (mac_adb_pollmouse(machine)) |
| 2511 | if (adb_pollmouse(machine)) |
| 2482 | 2512 | { |
| 2483 | 2513 | // if the mouse was the last TALK, we can just send the new data |
| 2484 | 2514 | // otherwise we need to pull SRQ |
| 2485 | | if (m_adb_last_talk == adb_mouseaddr) |
| 2515 | if (m_adb_last_talk == m_adb_mouseaddr) |
| 2486 | 2516 | { |
| 2487 | 2517 | // repeat last TALK to get updated data |
| 2488 | 2518 | m_adb_waiting_cmd = 1; |
| 2489 | | mac_adb_talk(machine); |
| 2519 | adb_talk(machine); |
| 2490 | 2520 | |
| 2491 | 2521 | m_adb_timer_ticks = 8; |
| 2492 | 2522 | timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0); |
| r9561 | r9562 | |
| 2500 | 2530 | m_adb_srq_switch = 1; |
| 2501 | 2531 | } |
| 2502 | 2532 | } |
| 2503 | | else if (mac_adb_pollkbd(machine, 0)) |
| 2533 | else if (adb_pollkbd(machine, 0)) |
| 2504 | 2534 | { |
| 2505 | | if (m_adb_last_talk == adb_keybaddr) |
| 2535 | if (m_adb_last_talk == m_adb_keybaddr) |
| 2506 | 2536 | { |
| 2507 | 2537 | // repeat last TALK to get updated data |
| 2508 | 2538 | m_adb_waiting_cmd = 1; |
| 2509 | | mac_adb_talk(machine); |
| 2539 | adb_talk(machine); |
| 2510 | 2540 | |
| 2511 | 2541 | m_adb_timer_ticks = 8; |
| 2512 | 2542 | timer_adjust_oneshot(mac_adb_timer, attotime_make(0, ATTOSECONDS_IN_USEC(100)), 0); |
| r9561 | r9562 | |
| 2545 | 2575 | m_adb_last_talk = -1; |
| 2546 | 2576 | |
| 2547 | 2577 | // mouse |
| 2548 | | adb_mouseaddr = 3; |
| 2549 | | adb_lastmousex = adb_lastmousey = adb_lastbutton = 0; |
| 2550 | | adb_mouse_initialized = 0; |
| 2578 | m_adb_mouseaddr = 3; |
| 2579 | m_adb_lastmousex = m_adb_lastmousey = m_adb_lastbutton = 0; |
| 2580 | m_adb_mouse_initialized = 0; |
| 2551 | 2581 | |
| 2552 | 2582 | // keyboard |
| 2553 | | adb_keybaddr = 2; |
| 2554 | | adb_keybinitialized = 0; |
| 2555 | | adb_currentkeys[0] = adb_currentkeys[1] = 0x80; |
| 2556 | | adb_modifiers = 0; |
| 2583 | m_adb_keybaddr = 2; |
| 2584 | m_adb_keybinitialized = 0; |
| 2585 | m_adb_currentkeys[0] = m_adb_currentkeys[1] = 0x80; |
| 2586 | m_adb_modifiers = 0; |
| 2557 | 2587 | for (i=0; i<7; i++) |
| 2558 | 2588 | { |
| 2559 | 2589 | m_key_matrix[i] = 0; |
| r9561 | r9562 | |
| 3026 | 3056 | // stop 60.15 Hz timer |
| 3027 | 3057 | timer_adjust_oneshot(m_6015_timer, attotime_never, 0); |
| 3028 | 3058 | |
| 3029 | | // start 60.15 Hz timer for IIci/IIsi (and eventually others) |
| 3030 | | if ((m_model == MODEL_MAC_IICI) || (m_model == MODEL_MAC_IISI)) |
| 3059 | // start 60.15 Hz timer for most systems |
| 3060 | if (((m_model >= MODEL_MAC_IICI) && (m_model <= MODEL_MAC_IIVI)) || (m_model >= MODEL_MAC_LC)) |
| 3031 | 3061 | { |
| 3032 | 3062 | timer_adjust_periodic(m_6015_timer, ATTOTIME_IN_HZ(60.15), 0, ATTOTIME_IN_HZ(60.15)); |
| 3033 | 3063 | } |
src/mess/video/mac.c
| r9561 | r9562 | |
| 324 | 324 | { |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | VIDEO_RESET(maceagle) |
| 328 | { |
| 329 | mac_state *mac = machine->driver_data<mac_state>(); |
| 330 | |
| 331 | mac->m_rbv_montype = 32; |
| 332 | mac->m_rbv_palette[0xfe] = 0xffffff; |
| 333 | mac->m_rbv_palette[0xff] = 0; |
| 334 | } |
| 335 | |
| 327 | 336 | VIDEO_RESET(macrbv) |
| 328 | 337 | { |
| 329 | 338 | mac_state *mac = machine->driver_data<mac_state>(); |
| r9561 | r9562 | |
| 344 | 353 | visarea.min_x = 0; |
| 345 | 354 | visarea.min_y = 0; |
| 346 | 355 | |
| 347 | | if (mac->m_model == MODEL_MAC_CLASSIC_II) |
| 356 | mac->m_rbv_montype = input_port_read_safe(machine, "MONTYPE", 2); |
| 357 | switch (mac->m_rbv_montype) |
| 348 | 358 | { |
| 349 | | mac->m_rbv_montype = 32; |
| 350 | | visarea.max_x = MAC_H_VIS-1; |
| 351 | | visarea.max_y = MAC_V_VIS-1; |
| 352 | | htotal = MAC_H_TOTAL; |
| 353 | | vtotal = MAC_V_TOTAL; |
| 354 | | framerate = 60.15; |
| 355 | | } |
| 356 | | else |
| 357 | | { |
| 358 | | mac->m_rbv_montype = input_port_read_safe(machine, "MONTYPE", 2); |
| 359 | | switch (mac->m_rbv_montype) |
| 360 | | { |
| 361 | | case 1: // 15" portrait display |
| 362 | | visarea.max_x = 640-1; |
| 363 | | visarea.max_y = 870-1; |
| 364 | | htotal = 832; |
| 365 | | vtotal = 918; |
| 366 | | framerate = 75.0; |
| 367 | | break; |
| 359 | case 1: // 15" portrait display |
| 360 | visarea.max_x = 640-1; |
| 361 | visarea.max_y = 870-1; |
| 362 | htotal = 832; |
| 363 | vtotal = 918; |
| 364 | framerate = 75.0; |
| 365 | break; |
| 368 | 366 | |
| 369 | | case 2: // 12" RGB |
| 370 | | visarea.max_x = 512-1; |
| 371 | | visarea.max_y = 384-1; |
| 372 | | htotal = 640; |
| 373 | | vtotal = 407; |
| 374 | | framerate = 60.15; |
| 375 | | break; |
| 367 | case 2: // 12" RGB |
| 368 | visarea.max_x = 512-1; |
| 369 | visarea.max_y = 384-1; |
| 370 | htotal = 640; |
| 371 | vtotal = 407; |
| 372 | framerate = 60.15; |
| 373 | break; |
| 376 | 374 | |
| 377 | | case 6: // 13" RGB |
| 378 | | default: |
| 379 | | visarea.max_x = 640-1; |
| 380 | | visarea.max_y = 480-1; |
| 381 | | htotal = 800; |
| 382 | | vtotal = 525; |
| 383 | | framerate = 59.94; |
| 384 | | break; |
| 385 | | } |
| 375 | case 6: // 13" RGB |
| 376 | default: |
| 377 | visarea.max_x = 640-1; |
| 378 | visarea.max_y = 480-1; |
| 379 | htotal = 800; |
| 380 | vtotal = 525; |
| 381 | framerate = 59.94; |
| 382 | break; |
| 386 | 383 | } |
| 387 | 384 | |
| 388 | | // printf("RBV reset: monitor is %dx%d @ %f Hz\n", visarea.max_x+1, visarea.max_y+1, framerate); |
| 385 | // printf("RBV reset: monitor is %dx%d @ %f Hz\n", visarea.max_x+1, visarea.max_y+1, framerate); |
| 389 | 386 | machine->primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS(framerate)); |
| 390 | 387 | } |
| 391 | 388 | |
| r9561 | r9562 | |
| 432 | 429 | UINT32 *scanline; |
| 433 | 430 | int x, y, hres, vres; |
| 434 | 431 | mac_state *mac = screen->machine->driver_data<mac_state>(); |
| 432 | UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram")); |
| 435 | 433 | |
| 436 | 434 | switch (mac->m_rbv_montype) |
| 437 | 435 | { |
| 438 | 436 | case 32: // classic II built-in display |
| 439 | 437 | hres = MAC_H_VIS; |
| 440 | 438 | vres = MAC_V_VIS; |
| 439 | vram8 += 0x1f9a80; // Classic II apparently doesn't use VRAM? |
| 441 | 440 | break; |
| 442 | 441 | |
| 443 | 442 | case 1: // 15" portrait display |
| r9561 | r9562 | |
| 461 | 460 | { |
| 462 | 461 | case 0: // 1bpp |
| 463 | 462 | { |
| 464 | | UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram")); |
| 465 | 463 | UINT8 pixels; |
| 466 | 464 | |
| 467 | 465 | for (y = 0; y < vres; y++) |
| r9561 | r9562 | |
| 486 | 484 | |
| 487 | 485 | case 1: // 2bpp |
| 488 | 486 | { |
| 489 | | UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram")); |
| 490 | 487 | UINT8 pixels; |
| 491 | 488 | |
| 492 | 489 | for (y = 0; y < vres; y++) |
| r9561 | r9562 | |
| 507 | 504 | |
| 508 | 505 | case 2: // 4bpp |
| 509 | 506 | { |
| 510 | | UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram")); |
| 511 | 507 | UINT8 pixels; |
| 512 | 508 | |
| 513 | 509 | for (y = 0; y < vres; y++) |
| r9561 | r9562 | |
| 527 | 523 | |
| 528 | 524 | case 3: // 8bpp |
| 529 | 525 | { |
| 530 | | UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram")); |
| 531 | 526 | UINT8 pixels; |
| 532 | 527 | |
| 533 | 528 | for (y = 0; y < vres; y++) |
| r9561 | r9562 | |
| 578 | 573 | UINT8 *vram8 = (UINT8 *)mac->m_rbv_vram; |
| 579 | 574 | UINT8 pixels; |
| 580 | 575 | |
| 581 | | for (y = 0; y < 480; y++) |
| 576 | |
| 577 | if (mac->m_rbv_type == RBV_TYPE_SONORA) |
| 582 | 578 | { |
| 583 | | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 584 | | for (x = 0; x < 640; x+=8) |
| 579 | for (y = 0; y < 480; y++) |
| 585 | 580 | { |
| 586 | | pixels = vram8[(y * 80) + ((x/8)^3)]; |
| 581 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 582 | for (x = 0; x < 640; x+=8) |
| 583 | { |
| 584 | pixels = vram8[(y * 80) + ((x/8)^3)]; |
| 587 | 585 | |
| 588 | | *scanline++ = mac->m_rbv_palette[0xfe|(pixels>>7)]; |
| 589 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>6)&1)]; |
| 590 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>5)&1)]; |
| 591 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>4)&1)]; |
| 592 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>3)&1)]; |
| 593 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>2)&1)]; |
| 594 | | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>1)&1)]; |
| 595 | | *scanline++ = mac->m_rbv_palette[0xfe|(pixels&1)]; |
| 586 | *scanline++ = mac->m_rbv_palette[0x7f|(pixels&0x80)]; |
| 587 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<1)&0x80)]; |
| 588 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<2)&0x80)]; |
| 589 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<3)&0x80)]; |
| 590 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<4)&0x80)]; |
| 591 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<5)&0x80)]; |
| 592 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<6)&0x80)]; |
| 593 | *scanline++ = mac->m_rbv_palette[0x7f|((pixels<<7)&0x80)]; |
| 594 | } |
| 596 | 595 | } |
| 597 | 596 | } |
| 597 | else |
| 598 | { |
| 599 | for (y = 0; y < 480; y++) |
| 600 | { |
| 601 | scanline = BITMAP_ADDR32(bitmap, y, 0); |
| 602 | for (x = 0; x < 640; x+=8) |
| 603 | { |
| 604 | pixels = vram8[(y * 80) + ((x/8)^3)]; |
| 605 | |
| 606 | *scanline++ = mac->m_rbv_palette[0xfe|(pixels>>7)]; |
| 607 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>6)&1)]; |
| 608 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>5)&1)]; |
| 609 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>4)&1)]; |
| 610 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>3)&1)]; |
| 611 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>2)&1)]; |
| 612 | *scanline++ = mac->m_rbv_palette[0xfe|((pixels>>1)&1)]; |
| 613 | *scanline++ = mac->m_rbv_palette[0xfe|(pixels&1)]; |
| 614 | } |
| 615 | } |
| 616 | } |
| 598 | 617 | } |
| 599 | 618 | break; |
| 600 | 619 | |
src/mess/drivers/mac.c
| r9561 | r9562 | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | WRITE32_MEMBER( mac_state::ariel_ramdac_w ) // this is for the "Ariel" style RAMDAC |
| 125 | { |
| 126 | if (mem_mask == 0xff000000) |
| 127 | { |
| 128 | m_rbv_clutoffs = data>>24; |
| 129 | m_rbv_count = 0; |
| 130 | } |
| 131 | else if (mem_mask == 0x00ff0000) |
| 132 | { |
| 133 | m_rbv_colors[m_rbv_count++] = data>>16; |
| 134 | |
| 135 | if (m_rbv_count == 3) |
| 136 | { |
| 137 | // for portrait display, force monochrome by using the blue channel |
| 138 | if (m_model != MODEL_MAC_CLASSIC_II) |
| 139 | { |
| 140 | // Color Classic has no MONTYPE so the safe read gets us 512x384, which is right |
| 141 | if (input_port_read_safe(space.machine, "MONTYPE", 2) == 1) |
| 142 | { |
| 143 | palette_set_color(space.machine, m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2])); |
| 144 | m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]); |
| 145 | m_rbv_clutoffs++; |
| 146 | m_rbv_count = 0; |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | palette_set_color(space.machine, m_rbv_clutoffs, MAKE_RGB(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2])); |
| 151 | m_rbv_palette[m_rbv_clutoffs] = MAKE_RGB(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]); |
| 152 | m_rbv_clutoffs++; |
| 153 | m_rbv_count = 0; |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | else if (mem_mask == 0x0000ff00) |
| 159 | { |
| 160 | // config reg |
| 161 | // printf("Ariel: %02x to config\n", (data>>8)&0xff); |
| 162 | } |
| 163 | else // color key reg |
| 164 | { |
| 165 | } |
| 166 | } |
| 167 | |
| 124 | 168 | READ8_MEMBER( mac_state::mac_sonora_vctl_r ) |
| 125 | 169 | { |
| 126 | 170 | if (offset == 2) |
| r9561 | r9562 | |
| 133 | 177 | |
| 134 | 178 | WRITE8_MEMBER( mac_state::mac_sonora_vctl_w ) |
| 135 | 179 | { |
| 180 | // printf("Sonora: %02x to vctl %x\n", data, offset); |
| 136 | 181 | m_sonora_vctl[offset] = data; |
| 137 | 182 | } |
| 138 | 183 | |
| r9561 | r9562 | |
| 154 | 199 | |
| 155 | 200 | if (offset == 0x10) |
| 156 | 201 | { |
| 157 | | if (!m_rbv_immed10wr) |
| 158 | | { |
| 159 | | data &= ~0x38; |
| 160 | | data |= (input_port_read_safe(space.machine, "MONTYPE", 2)<<3); |
| 161 | | } |
| 162 | | else |
| 163 | | { |
| 164 | | m_rbv_immed10wr = 0; |
| 165 | | } |
| 202 | data &= ~0x38; |
| 203 | data |= (input_port_read_safe(space.machine, "MONTYPE", 2)<<3); |
| 204 | // printf("rbv_r montype: %02x (PC %x)\n", data, cpu_get_pc(space.cpu)); |
| 166 | 205 | } |
| 167 | 206 | |
| 168 | 207 | // bit 7 of these registers always reads as 0 on RBV |
| r9561 | r9562 | |
| 402 | 441 | AM_RANGE(0xf12060, 0xf12063) AM_READ(macii_scsi_drq_r) AM_MIRROR(0x00f00000) |
| 403 | 442 | AM_RANGE(0xf14000, 0xf15fff) AM_DEVREADWRITE8("asc", asc_device, read, write, 0xffffffff) AM_MIRROR(0x00f00000) |
| 404 | 443 | AM_RANGE(0xf16000, 0xf17fff) AM_READWRITE16(mac_iwm_r, mac_iwm_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 405 | | AM_RANGE(0xf24000, 0xf24003) AM_READWRITE(rbv_ramdac_r, rbv_ramdac_w) |
| 444 | AM_RANGE(0xf24000, 0xf24003) AM_READWRITE(rbv_ramdac_r, ariel_ramdac_w) |
| 406 | 445 | AM_RANGE(0xf26000, 0xf27fff) AM_READWRITE8(mac_rbv_r, mac_rbv_w, 0xffffffff) // VIA2 (V8) |
| 407 | 446 | AM_RANGE(0xf40000, 0xfbffff) AM_RAM AM_BASE(m_rbv_vram) |
| 408 | 447 | ADDRESS_MAP_END |
| r9561 | r9562 | |
| 412 | 451 | |
| 413 | 452 | AM_RANGE(0x50000000, 0x50001fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 414 | 453 | AM_RANGE(0x50004000, 0x50005fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 454 | AM_RANGE(0x50010000, 0x50011fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 455 | AM_RANGE(0x50012060, 0x50012063) AM_READ(macii_scsi_drq_r) AM_MIRROR(0x00f00000) |
| 415 | 456 | AM_RANGE(0x50014000, 0x50015fff) AM_DEVREADWRITE8("asc", asc_device, read, write, 0xffffffff) AM_MIRROR(0x00f00000) |
| 416 | 457 | AM_RANGE(0x50016000, 0x50017fff) AM_READWRITE16(mac_iwm_r, mac_iwm_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 417 | | AM_RANGE(0x50024000, 0x50024007) AM_WRITE( rbv_ramdac_w ) AM_MIRROR(0x00f00000) |
| 458 | AM_RANGE(0x50024000, 0x50025fff) AM_WRITE( ariel_ramdac_w ) AM_MIRROR(0x00f00000) |
| 418 | 459 | AM_RANGE(0x50026000, 0x50027fff) AM_READWRITE8(mac_rbv_r, mac_rbv_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 419 | 460 | AM_RANGE(0x50028000, 0x50028003) AM_READWRITE8(mac_sonora_vctl_r, mac_sonora_vctl_w, 0xffffffff) AM_MIRROR(0x00f00000) |
| 420 | 461 | |
| r9561 | r9562 | |
| 742 | 783 | MDRV_PALETTE_LENGTH(256) |
| 743 | 784 | |
| 744 | 785 | MDRV_VIDEO_START(macv8) |
| 786 | MDRV_VIDEO_RESET(macrbv) |
| 745 | 787 | MDRV_VIDEO_UPDATE(macrbvvram) |
| 746 | 788 | |
| 747 | 789 | MDRV_RAM_MODIFY("messram") |
| r9561 | r9562 | |
| 771 | 813 | MDRV_CPU_VBLANK_INT("screen", mac_rbv_vbl) |
| 772 | 814 | |
| 773 | 815 | MDRV_VIDEO_START(macsonora) |
| 816 | MDRV_VIDEO_RESET(macrbv) |
| 774 | 817 | MDRV_VIDEO_UPDATE(macrbvvram) |
| 775 | 818 | |
| 776 | 819 | MDRV_RAM_MODIFY("messram") |
| r9561 | r9562 | |
| 850 | 893 | MDRV_CPU_PROGRAM_MAP(maclc_map) |
| 851 | 894 | |
| 852 | 895 | MDRV_VIDEO_START(macv8) |
| 896 | MDRV_VIDEO_RESET(maceagle) |
| 853 | 897 | MDRV_VIDEO_UPDATE(macrbv) |
| 854 | 898 | |
| 899 | MDRV_SCREEN_MODIFY("screen") |
| 900 | MDRV_SCREEN_SIZE(MAC_H_TOTAL, MAC_V_TOTAL) |
| 901 | MDRV_SCREEN_VISIBLE_AREA(0, MAC_H_VIS-1, 0, MAC_V_VIS-1) |
| 902 | |
| 855 | 903 | MDRV_ASC_REPLACE("asc", C15M, ASC_TYPE_EAGLE, mac_asc_irq) |
| 856 | 904 | MDRV_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 857 | 905 | MDRV_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r9561 | r9562 | |
| 874 | 922 | MDRV_VIDEO_UPDATE(macrbv) |
| 875 | 923 | |
| 876 | 924 | MDRV_SCREEN_MODIFY("screen") |
| 877 | | MDRV_DEFAULT_LAYOUT(layout_lcd) |
| 878 | 925 | MDRV_SCREEN_SIZE(640, 870) |
| 879 | 926 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 880 | 927 | |
| r9561 | r9562 | |
| 897 | 944 | MDRV_VIDEO_UPDATE(macrbv) |
| 898 | 945 | |
| 899 | 946 | MDRV_SCREEN_MODIFY("screen") |
| 900 | | MDRV_DEFAULT_LAYOUT(layout_lcd) |
| 901 | 947 | MDRV_SCREEN_SIZE(640, 870) |
| 902 | 948 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 903 | 949 | |
| r9561 | r9562 | |
| 925 | 971 | MDRV_PALETTE_LENGTH(256) |
| 926 | 972 | |
| 927 | 973 | MDRV_VIDEO_START(macsonora) |
| 974 | MDRV_VIDEO_RESET(macrbv) |
| 928 | 975 | MDRV_VIDEO_UPDATE(macrbv) |
| 929 | 976 | |
| 930 | 977 | /* sound hardware */ |