trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242605 | r242606 | |
| 36 | 36 | m_pc = get_insruction(op); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | | // hardware loops |
| 40 | | if (m_pc == m_LP_END) |
| 41 | | { |
| 42 | | if (m_regs[REG_LP_COUNT] != 1) |
| 43 | | { |
| 44 | | m_pc = m_LP_START; |
| 45 | | } |
| 46 | | m_regs[REG_LP_COUNT]--; |
| 47 | | |
| 48 | | } |
| 49 | | |
| 50 | 39 | m_icount--; |
| 51 | 40 | } |
| 52 | 41 | |
| r242605 | r242606 | |
| 140 | 129 | #define PC_ALIGNED32 \ |
| 141 | 130 | (m_pc&0xfffffffc) |
| 142 | 131 | |
| 143 | | int arcompact_device::check_condition(UINT8 condition) |
| 144 | | { |
| 145 | | switch (condition & 0x1f) |
| 146 | | { |
| 147 | | case 0x00: return 1; // AL |
| 148 | | case 0x01: return CONDITION_EQ; |
| 149 | | case 0x02: return !CONDITION_EQ; // NE |
| 150 | | case 0x03: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 151 | | case 0x04: return CONDITION_MI; // MI (N) |
| 152 | | case 0x05: return CONDITION_CS; // CS (Carry Set / Lower than) |
| 153 | | case 0x06: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 154 | | case 0x07: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 155 | | case 0x08: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 156 | | case 0x09: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 157 | | case 0x0a: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 158 | | case 0x0b: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 159 | | case 0x0c: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 160 | | case 0x0d: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 161 | | case 0x0e: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 162 | | case 0x0f: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 163 | | case 0x10: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 164 | | case 0x11: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 165 | | case 0x12: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 166 | | case 0x13: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 167 | | case 0x14: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 168 | | case 0x15: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 169 | | case 0x16: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 170 | | case 0x17: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 171 | | case 0x18: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 172 | | case 0x19: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 173 | | case 0x1a: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 174 | | case 0x1b: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 175 | | case 0x1c: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 176 | | case 0x1d: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 177 | | case 0x1e: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 178 | | case 0x1f: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 179 | | } |
| 180 | 132 | |
| 181 | | return -1; |
| 182 | | |
| 183 | | } |
| 184 | | |
| 185 | | |
| 186 | 133 | ARCOMPACT_RETTYPE arcompact_device::get_insruction(OPS_32) |
| 187 | 134 | { |
| 188 | 135 | UINT8 instruction = ARCOMPACT_OPERATION; |
| r242605 | r242606 | |
| 1154 | 1101 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00_00(OPS_32) |
| 1155 | 1102 | { |
| 1156 | 1103 | int size = 4; |
| 1157 | | |
| 1158 | | COMMON32_GET_CONDITION |
| 1159 | | |
| 1160 | | if (!check_condition(condition)) |
| 1161 | | return m_pc + (size>>0); |
| 1162 | | |
| 1163 | 1104 | // Branch Conditionally |
| 1164 | | // 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ |
| 1165 | | INT32 address = (op & 0x07fe0000) >> 17; |
| 1166 | | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 1167 | | if (address & 0x80000) address = -0x80000 + (address & 0x7ffff); |
| 1168 | | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 1169 | | |
| 1170 | | UINT32 realaddress = PC_ALIGNED32 + (address * 2); |
| 1171 | | |
| 1172 | | if (n) |
| 1173 | | { |
| 1174 | | m_delayactive = 1; |
| 1175 | | m_delayjump = realaddress; |
| 1176 | | m_delaylinks = 0; // don't link |
| 1177 | | } |
| 1178 | | else |
| 1179 | | { |
| 1180 | | // m_regs[REG_BLINK] = m_pc + (size >> 0); // don't link |
| 1181 | | return realaddress; |
| 1182 | | } |
| 1183 | | |
| 1184 | | |
| 1105 | arcompact_log("unimplemented Bcc %08x", op); |
| 1185 | 1106 | return m_pc + (size>>0); |
| 1186 | 1107 | } |
| 1187 | 1108 | |
| r242605 | r242606 | |
| 1501 | 1422 | return m_pc + (size>>0); |
| 1502 | 1423 | } |
| 1503 | 1424 | |
| 1504 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_04(OPS_32) // register - immediate BRLO |
| 1505 | | { |
| 1506 | | BR_REGIMM_SETUP |
| 1425 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_04(OPS_32) { return arcompact_01_01_01_helper(PARAMS, "BRLO"); } |
| 1507 | 1426 | |
| 1508 | | // BRLO (unsigned operation) |
| 1509 | | if (b < c) |
| 1510 | | { |
| 1511 | | BR_TAKEJUMP |
| 1512 | | } |
| 1513 | | |
| 1514 | | return m_pc + (size>>0); |
| 1515 | | |
| 1516 | | } |
| 1517 | | |
| 1518 | 1427 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_05(OPS_32) // register - immediate BRHS |
| 1519 | 1428 | { |
| 1520 | 1429 | BR_REGIMM_SETUP |
| r242605 | r242606 | |
| 1852 | 1761 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0d], /*"RCMP"*/ 1,0); |
| 1853 | 1762 | } |
| 1854 | 1763 | |
| 1764 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e(OPS_32) |
| 1765 | { |
| 1766 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0e], /*"RSUB"*/ 0,0); |
| 1767 | } |
| 1855 | 1768 | |
| 1856 | 1769 | |
| 1857 | 1770 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_10(OPS_32) |
| r242605 | r242606 | |
| 1869 | 1782 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x12], /*"BXOR"*/ 0,0); |
| 1870 | 1783 | } |
| 1871 | 1784 | |
| 1785 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13(OPS_32) |
| 1786 | { |
| 1787 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x13], /*"BMSK"*/ 0,0); |
| 1788 | } |
| 1872 | 1789 | |
| 1790 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14(OPS_32) |
| 1791 | { |
| 1792 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x14], /*"ADD1"*/ 0,0); |
| 1793 | } |
| 1873 | 1794 | |
| 1874 | 1795 | |
| 1875 | 1796 | |
| 1876 | 1797 | |
| 1798 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17(OPS_32) |
| 1799 | { |
| 1800 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x17], /*"SUB1"*/ 0,0); |
| 1801 | } |
| 1802 | |
| 1803 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18(OPS_32) |
| 1804 | { |
| 1805 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x18], /*"SUB2"*/ 0,0); |
| 1806 | } |
| 1807 | |
| 1808 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19(OPS_32) |
| 1809 | { |
| 1810 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x19], /*"SUB3"*/ 0,0); |
| 1811 | } |
| 1812 | |
| 1877 | 1813 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1a(OPS_32) |
| 1878 | 1814 | { |
| 1879 | 1815 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1a], /*"MPY"*/ 0,0); |
| r242605 | r242606 | |
| 1901 | 1837 | int got_limm = 0; |
| 1902 | 1838 | |
| 1903 | 1839 | COMMON32_GET_creg |
| 1904 | | COMMON32_GET_F |
| 1905 | 1840 | |
| 1906 | 1841 | if (creg == LIMM_REG) |
| 1907 | 1842 | { |
| r242605 | r242606 | |
| 1923 | 1858 | // J.F [ilink1] 0010 0RRR 0010 0000 1RRR 0111 01RR RRRR (creg = ILINK1, FLAG must be set) |
| 1924 | 1859 | // J.F [ilink2] 0010 0RRR 0010 0000 1RRR 0111 10RR RRRR (creg = ILINE2, FLAG must be set) |
| 1925 | 1860 | |
| 1926 | | if (F) |
| 1927 | | { |
| 1928 | | if ((creg == REG_ILINK1) || (creg == REG_ILINK2)) |
| 1929 | | { |
| 1930 | | arcompact_log("1 unimplemented J.F %08x", op); |
| 1931 | | } |
| 1932 | | else |
| 1933 | | { |
| 1934 | | // should not use .F unless jumping to ILINK1/2 |
| 1935 | | arcompact_fatal ("illegal 1 unimplemented J.F (F should not be set) %08x", op); |
| 1936 | | } |
| 1937 | | |
| 1938 | | } |
| 1939 | | else |
| 1940 | | { |
| 1941 | | if ((creg == REG_ILINK1) || (creg == REG_ILINK2)) |
| 1942 | | { |
| 1943 | | // should only jumping to ILINK1/2 if .F is set |
| 1944 | | arcompact_fatal("illegal 1 unimplemented J (F not set) %08x", op); |
| 1945 | | } |
| 1946 | | else |
| 1947 | | { |
| 1948 | | |
| 1949 | | return m_regs[creg]; |
| 1950 | | } |
| 1951 | | } |
| 1861 | arcompact_log("unimplemented J %08x", op); |
| 1952 | 1862 | } |
| 1953 | 1863 | |
| 1954 | 1864 | return m_pc + (size>>0); |
| r242605 | r242606 | |
| 1959 | 1869 | // opcode iiii i--- ppII IIII F--- uuuu uu-- ---- |
| 1960 | 1870 | // J u6 0010 0RRR 0110 0000 0RRR uuuu uuRR RRRR |
| 1961 | 1871 | int size = 4; |
| 1962 | | arcompact_log("2 unimplemented J %08x", op); |
| 1872 | arcompact_log("unimplemented J %08x", op); |
| 1963 | 1873 | return m_pc + (size>>0); |
| 1964 | 1874 | } |
| 1965 | 1875 | |
| r242605 | r242606 | |
| 1968 | 1878 | // opcode iiii i--- ppII IIII F--- ssss ssSS SSSS |
| 1969 | 1879 | // J s12 0010 0RRR 1010 0000 0RRR ssss ssSS SSSS |
| 1970 | 1880 | int size = 4; |
| 1971 | | arcompact_log("3 unimplemented J %08x", op); |
| 1881 | arcompact_log("unimplemented J %08x", op); |
| 1972 | 1882 | return m_pc + (size>>0); |
| 1973 | 1883 | } |
| 1974 | 1884 | |
| 1975 | 1885 | |
| 1976 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) // Jcc (no link, no delay) |
| 1886 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) |
| 1977 | 1887 | { |
| 1978 | 1888 | int size = 4; |
| 1979 | | UINT32 limm = 0; |
| 1889 | // UINT32 limm = 0; |
| 1980 | 1890 | int got_limm = 0; |
| 1981 | 1891 | |
| 1982 | 1892 | COMMON32_GET_creg |
| 1983 | | COMMON32_GET_CONDITION; |
| 1984 | | COMMON32_GET_F |
| 1985 | 1893 | |
| 1986 | | UINT32 c = 0; |
| 1987 | | |
| 1988 | 1894 | if (creg == LIMM_REG) |
| 1989 | 1895 | { |
| 1990 | 1896 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1991 | 1897 | // Jcc limm 0010 0RRR 1110 0000 0RRR 1111 100Q QQQQ [LIUMM] |
| 1992 | 1898 | if (!got_limm) |
| 1993 | 1899 | { |
| 1994 | | GET_LIMM_32; |
| 1900 | //GET_LIMM_32; |
| 1995 | 1901 | size = 8; |
| 1996 | 1902 | } |
| 1997 | 1903 | |
| 1998 | | c = limm; |
| 1999 | | |
| 1904 | arcompact_log("unimplemented J %08x", op); |
| 2000 | 1905 | } |
| 2001 | 1906 | else |
| 2002 | 1907 | { |
| 2003 | 1908 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 2004 | 1909 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 2005 | 1910 | // no conditional links to ILINK1, ILINK2? |
| 2006 | | |
| 2007 | | c = m_regs[creg]; |
| 1911 | arcompact_log("unimplemented J %08x", op); |
| 2008 | 1912 | } |
| 2009 | | |
| 2010 | | if (!check_condition(condition)) |
| 2011 | | return m_pc + (size>>0); |
| 2012 | | |
| 2013 | | if (!F) |
| 2014 | | { |
| 2015 | | // if F isn't set then the destination can't be ILINK1 or ILINK2 |
| 2016 | | |
| 2017 | | if ((creg == REG_ILINK1) || (creg == REG_ILINK1)) |
| 2018 | | { |
| 2019 | | arcompact_fatal ("fatal arcompact_handle04_20_p11_m0 J %08x (F not set but ILINK1 or ILINK2 used as dst)", op); |
| 2020 | | } |
| 2021 | | else |
| 2022 | | { |
| 2023 | | UINT32 realaddress = c; |
| 2024 | | return realaddress; |
| 2025 | | } |
| 2026 | | } |
| 2027 | | |
| 2028 | | if (F) |
| 2029 | | { |
| 2030 | | // if F is set then the destination MUST be ILINK1 or ILINK2 |
| 2031 | | |
| 2032 | | if ((creg == REG_ILINK1) || (creg == REG_ILINK1)) |
| 2033 | | { |
| 2034 | | arcompact_log("unimplemented arcompact_handle04_20_p11_m0 J %08x (F set)", op); |
| 2035 | | } |
| 2036 | | else |
| 2037 | | { |
| 2038 | | arcompact_fatal ("fatal arcompact_handle04_20_p11_m0 J %08x (F set but not ILINK1 or ILINK2 used as dst)", op); |
| 2039 | | |
| 2040 | | } |
| 2041 | | } |
| 2042 | | |
| 2043 | | |
| 2044 | 1913 | return m_pc + (size>>0); |
| 2045 | 1914 | } |
| 2046 | 1915 | |
| r242605 | r242606 | |
| 2049 | 1918 | // opcode iiii i--- ppII IIII F--- uuuu uumq qqqq |
| 2050 | 1919 | // Jcc u6 0010 0RRR 1110 0000 0RRR uuuu uu1Q QQQQ |
| 2051 | 1920 | int size = 4; |
| 2052 | | arcompact_log("unimplemented arcompact_handle04_20_p11_m1 J %08x (u6)", op); |
| 1921 | arcompact_log("unimplemented J %08x", op); |
| 2053 | 1922 | return m_pc + (size>>0); |
| 2054 | 1923 | } |
| 2055 | 1924 | |
| r242605 | r242606 | |
| 2076 | 1945 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_28(OPS_32) // LPcc (loop setup) |
| 2077 | 1946 | { |
| 2078 | 1947 | int size = 4; |
| 2079 | | // COMMON32_GET_breg; // breg is reserved |
| 1948 | |
| 2080 | 1949 | COMMON32_GET_p; |
| 2081 | | |
| 1950 | |
| 2082 | 1951 | if (p == 0x00) |
| 2083 | 1952 | { |
| 2084 | | arcompact_fatal("<illegal LPcc, p = 0x00)"); |
| 2085 | 1953 | } |
| 2086 | 1954 | else if (p == 0x01) |
| 2087 | 1955 | { |
| 2088 | | arcompact_fatal("<illegal LPcc, p = 0x01)"); |
| 2089 | 1956 | } |
| 2090 | 1957 | else if (p == 0x02) // Loop unconditional |
| 2091 | | { // 0010 0RRR 1010 1000 0RRR ssss ssSS SSSS |
| 2092 | | COMMON32_GET_s12 |
| 2093 | | if (S & 0x800) S = -0x800 + (S&0x7ff); |
| 2094 | | |
| 2095 | | arcompact_fatal("Lp unconditional not supported %d", S); |
| 1958 | { |
| 2096 | 1959 | } |
| 2097 | 1960 | else if (p == 0x03) // Loop conditional |
| 2098 | | { // 0010 0RRR 1110 1000 0RRR uuuu uu1Q QQQQ |
| 2099 | | COMMON32_GET_u6 |
| 2100 | | COMMON32_GET_CONDITION |
| 2101 | | //arcompact_fatal("Lp conditional %s not supported %d", conditions[condition], u); |
| 2102 | | |
| 2103 | | // if the loop condition fails then just jump to after the end of the loop, don't set any registers |
| 2104 | | if (!check_condition(condition)) |
| 2105 | | { |
| 2106 | | UINT32 realoffset = PC_ALIGNED32 + (u * 2); |
| 2107 | | return realoffset; |
| 2108 | | } |
| 2109 | | else |
| 2110 | | { |
| 2111 | | // otherwise set up the loop positions |
| 2112 | | m_LP_START = m_pc + (size >> 0); |
| 2113 | | m_LP_END = PC_ALIGNED32 + (u * 2); |
| 2114 | | return m_pc + (size>>0); |
| 2115 | | } |
| 2116 | | |
| 1961 | { |
| 2117 | 1962 | } |
| 2118 | 1963 | |
| 1964 | arcompact_log("unimplemented LPcc %08x", op); |
| 2119 | 1965 | return m_pc + (size>>0); |
| 2120 | 1966 | |
| 2121 | 1967 | } |
| r242605 | r242606 | |
| 2162 | 2008 | return m_pc + (size>>0); |
| 2163 | 2009 | } |
| 2164 | 2010 | |
| 2011 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b(OPS_32) // Store TO Auxiliary register FROM register |
| 2012 | { |
| 2013 | int size = 4; |
| 2014 | // UINT32 limm = 0; |
| 2015 | int got_limm = 0; |
| 2165 | 2016 | |
| 2017 | COMMON32_GET_p; |
| 2018 | COMMON32_GET_breg; |
| 2019 | |
| 2020 | if (breg == LIMM_REG) |
| 2021 | { |
| 2022 | //GET_LIMM_32; |
| 2023 | size = 8; |
| 2024 | got_limm = 1; |
| 2025 | |
| 2026 | } |
| 2027 | else |
| 2028 | { |
| 2029 | } |
| 2030 | |
| 2031 | if (p == 0) |
| 2032 | { |
| 2033 | |
| 2034 | COMMON32_GET_creg |
| 2035 | |
| 2036 | if (creg == LIMM_REG) |
| 2037 | { |
| 2038 | if (!got_limm) |
| 2039 | { |
| 2040 | //GET_LIMM_32; |
| 2041 | size = 8; |
| 2042 | } |
| 2043 | } |
| 2044 | else |
| 2045 | { |
| 2046 | } |
| 2047 | } |
| 2048 | else if (p == 1) |
| 2049 | { |
| 2050 | } |
| 2051 | else if (p == 2) |
| 2052 | { |
| 2053 | } |
| 2054 | else if (p == 3) |
| 2055 | { |
| 2056 | } |
| 2057 | |
| 2058 | arcompact_log("unimplemented SR %08x", op); |
| 2059 | return m_pc + (size>>0); |
| 2060 | } |
| 2061 | |
| 2166 | 2062 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_29(OPS_32) |
| 2167 | 2063 | { |
| 2168 | 2064 | // leapster bios uses formats for FLAG that are not defined, bug I guess work anyway (P modes 0 / 1) |
| r242605 | r242606 | |
| 2206 | 2102 | } |
| 2207 | 2103 | |
| 2208 | 2104 | |
| 2105 | #define SETUP_HANDLE04_2f_0x_P00 \ |
| 2106 | int size = 4; \ |
| 2107 | UINT32 limm = 0; \ |
| 2108 | \ |
| 2109 | COMMON32_GET_breg; \ |
| 2110 | COMMON32_GET_F; \ |
| 2111 | COMMON32_GET_creg; \ |
| 2112 | \ |
| 2113 | UINT32 c; \ |
| 2114 | \ |
| 2115 | if (creg == LIMM_REG) \ |
| 2116 | { \ |
| 2117 | GET_LIMM_32; \ |
| 2118 | size = 8; \ |
| 2119 | c = limm; \ |
| 2120 | } \ |
| 2121 | else \ |
| 2122 | { \ |
| 2123 | c = m_regs[creg]; \ |
| 2124 | } \ |
| 2125 | /* todo: is the limm, limm syntax valid? (it's pointless.) */ \ |
| 2126 | /* todo: if breg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */ \ |
| 2209 | 2127 | |
| 2128 | |
| 2129 | |
| 2210 | 2130 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_00(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ASL"); } // ASL |
| 2211 | 2131 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_01(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ASR"); } // ASR |
| 2212 | | |
| 2132 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "LSR"); } // LSR |
| 2213 | 2133 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ROR"); } // ROR |
| 2214 | 2134 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_04(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "RCC"); } // RCC |
| 2215 | 2135 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_05(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "SEXB"); } // SEXB |
| 2216 | 2136 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_06(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "SEXW"); } // SEXW |
| 2217 | 2137 | |
| 2138 | // EXTB |
| 2139 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p00(OPS_32) // note 'b' destination for 04_2f_07_xx group |
| 2140 | { |
| 2141 | SETUP_HANDLE04_2f_0x_P00; |
| 2142 | |
| 2143 | m_regs[breg] = c & 0x000000ff; |
| 2144 | if (F) |
| 2145 | { |
| 2146 | arcompact_fatal("arcompact_handle04_2f_08_p00 (EXTW) (F set)\n"); // not yet supported |
| 2147 | } |
| 2218 | 2148 | |
| 2149 | return m_pc + (size >> 0); |
| 2150 | } |
| 2151 | |
| 2152 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p01(OPS_32) |
| 2153 | { |
| 2154 | int size = 4; |
| 2155 | arcompact_fatal("arcompact_handle04_2f_07_p01 (EXTB)\n"); |
| 2156 | return m_pc + (size >> 0); |
| 2157 | } |
| 2158 | |
| 2159 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p10(OPS_32) |
| 2160 | { |
| 2161 | int size = 4; |
| 2162 | arcompact_fatal("illegal 04_2f_07_p10 (EXTB)\n"); // illegal mode because 'S' bits have already been used for opcode select |
| 2163 | return m_pc + (size >> 0); |
| 2164 | } |
| 2165 | |
| 2166 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p11_m0(OPS_32) |
| 2167 | { |
| 2168 | int size = 4; |
| 2169 | arcompact_fatal("arcompact_handle04_2f_07_p11_m0 (EXTB)\n"); // illegal mode because 'Q' bits have already been used for opcode select |
| 2170 | return m_pc + (size >> 0); |
| 2171 | } |
| 2172 | |
| 2173 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p11_m1(OPS_32) |
| 2174 | { |
| 2175 | int size = 4; |
| 2176 | arcompact_fatal("arcompact_handle04_2f_07_p11_m1 (EXTB)\n"); // illegal mode because 'Q' bits have already been used for opcode select |
| 2177 | return m_pc + (size >> 0); |
| 2178 | } |
| 2179 | |
| 2180 | // EXTW b <- c or EXTW b <- limm or EXTW limm <- c (no result) or EXTW limm, limm (invalid?) |
| 2181 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p00(OPS_32) // note 'b' destination for 04_2f_08_xx group |
| 2182 | { |
| 2183 | SETUP_HANDLE04_2f_0x_P00; |
| 2184 | |
| 2185 | m_regs[breg] = c & 0x0000ffff; |
| 2186 | if (F) |
| 2187 | { |
| 2188 | arcompact_fatal("arcompact_handle04_2f_08_p00 (EXTW) (F set)\n"); // not yet supported |
| 2189 | } |
| 2190 | |
| 2191 | return m_pc + (size >> 0); |
| 2192 | } |
| 2193 | |
| 2194 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p01(OPS_32) |
| 2195 | { |
| 2196 | int size = 4; |
| 2197 | arcompact_fatal("arcompact_handle04_2f_08_p01 (EXTW)\n"); |
| 2198 | return m_pc + (size >> 0); |
| 2199 | } |
| 2200 | |
| 2201 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p10(OPS_32) |
| 2202 | { |
| 2203 | int size = 4; |
| 2204 | arcompact_fatal("illegal 04_2f_08_p10 (EXTW)\n"); // illegal mode because 'S' bits have already been used for opcode select |
| 2205 | return m_pc + (size >> 0); |
| 2206 | } |
| 2207 | |
| 2208 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p11_m0(OPS_32) |
| 2209 | { |
| 2210 | int size = 4; |
| 2211 | arcompact_fatal("arcompact_handle04_2f_08_p11_m0 (EXTW)\n"); // illegal mode because 'Q' bits have already been used for opcode select |
| 2212 | return m_pc + (size >> 0); |
| 2213 | } |
| 2214 | |
| 2215 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p11_m1(OPS_32) |
| 2216 | { |
| 2217 | int size = 4; |
| 2218 | arcompact_fatal("arcompact_handle04_2f_08_p11_m1 (EXTW)\n"); // illegal mode because 'Q' bits have already been used for opcode select |
| 2219 | return m_pc + (size >> 0); |
| 2220 | } |
| 2221 | |
| 2222 | |
| 2219 | 2223 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_09(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ABS"); } // ABS |
| 2220 | 2224 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_0a(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "NOT"); } // NOT |
| 2221 | 2225 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_0b(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "RCL"); } // RLC |
| r242605 | r242606 | |
| 2440 | 2444 | } |
| 2441 | 2445 | |
| 2442 | 2446 | |
| 2447 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_00(OPS_16) // ADD_S c, b, u3 (note, c destination) |
| 2448 | { |
| 2449 | int u, breg, creg; |
| 2443 | 2450 | |
| 2451 | COMMON16_GET_u3; |
| 2452 | COMMON16_GET_breg; |
| 2453 | COMMON16_GET_creg; |
| 2454 | |
| 2455 | REG_16BIT_RANGE(breg); |
| 2456 | REG_16BIT_RANGE(creg); |
| 2457 | |
| 2458 | m_regs[creg] = m_regs[breg] + u; |
| 2459 | |
| 2460 | return m_pc + (2 >> 0); |
| 2461 | } |
| 2462 | |
| 2463 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_01(OPS_16) |
| 2464 | { |
| 2465 | return arcompact_handle0d_helper(PARAMS, "SUB_S"); |
| 2466 | } |
| 2467 | |
| 2468 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_02(OPS_16) // ASL_S c, b asl u3 (note, c destination) |
| 2469 | { |
| 2470 | int u, breg, creg; |
| 2471 | |
| 2472 | COMMON16_GET_u3; |
| 2473 | COMMON16_GET_breg; |
| 2474 | COMMON16_GET_creg; |
| 2475 | |
| 2476 | REG_16BIT_RANGE(breg); |
| 2477 | REG_16BIT_RANGE(creg); |
| 2478 | |
| 2479 | m_regs[creg] = m_regs[breg] << u; |
| 2480 | |
| 2481 | return m_pc + (2 >> 0); |
| 2482 | } |
| 2483 | |
| 2444 | 2484 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_03(OPS_16) |
| 2445 | 2485 | { |
| 2446 | 2486 | return arcompact_handle0d_helper(PARAMS, "ASR_S"); |
| r242605 | r242606 | |
| 2600 | 2640 | |
| 2601 | 2641 | |
| 2602 | 2642 | // Zero parameters (ZOP) |
| 2603 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_00(OPS_16) { /*arcompact_log("NOP_S");*/ return m_pc + (2 >> 0);} |
| 2643 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_00(OPS_16) { arcompact_log("NOP_S"); return m_pc + (2 >> 0);} |
| 2604 | 2644 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_01(OPS_16) { arcompact_log("UNIMP_S"); return m_pc + (2 >> 0);} // Unimplemented Instruction, same as illegal, but recommended to fill blank space |
| 2605 | 2645 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_04(OPS_16) { arcompact_log("JEQ_S [blink]"); return m_pc + (2 >> 0);} |
| 2606 | 2646 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_05(OPS_16) { arcompact_log("JNE_S [blink]"); return m_pc + (2 >> 0);} |
| r242605 | r242606 | |
| 2630 | 2670 | return m_pc + (2 >> 0); |
| 2631 | 2671 | } |
| 2632 | 2672 | |
| 2673 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_02(OPS_16) // SUB_S b <- b,c |
| 2674 | { |
| 2675 | int breg, creg; |
| 2633 | 2676 | |
| 2677 | COMMON16_GET_breg; |
| 2678 | COMMON16_GET_creg; |
| 2634 | 2679 | |
| 2680 | REG_16BIT_RANGE(breg); |
| 2681 | REG_16BIT_RANGE(creg); |
| 2635 | 2682 | |
| 2683 | m_regs[breg] = m_regs[breg] - m_regs[creg]; |
| 2636 | 2684 | |
| 2685 | return m_pc + (2 >> 0); |
| 2686 | } |
| 2637 | 2687 | |
| 2688 | |
| 2689 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_04(OPS_16) // AND_S b <- b, c |
| 2690 | { |
| 2691 | int breg, creg; |
| 2692 | |
| 2693 | COMMON16_GET_breg; |
| 2694 | COMMON16_GET_creg; |
| 2695 | |
| 2696 | REG_16BIT_RANGE(breg); |
| 2697 | REG_16BIT_RANGE(creg); |
| 2698 | |
| 2699 | m_regs[breg] = m_regs[breg] & m_regs[creg]; |
| 2700 | |
| 2701 | return m_pc + (2 >> 0); |
| 2702 | } |
| 2703 | |
| 2704 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16) // OR_S b <- b,c |
| 2705 | { |
| 2706 | int breg, creg; |
| 2707 | |
| 2708 | COMMON16_GET_breg; |
| 2709 | COMMON16_GET_creg; |
| 2710 | |
| 2711 | REG_16BIT_RANGE(breg); |
| 2712 | REG_16BIT_RANGE(creg); |
| 2713 | |
| 2714 | m_regs[breg] = m_regs[breg] | m_regs[creg]; |
| 2715 | |
| 2716 | return m_pc + (2 >> 0); |
| 2717 | } |
| 2718 | |
| 2719 | |
| 2638 | 2720 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_06(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "BIC_S",0); } |
| 2639 | | |
| 2721 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_07(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "XOR_S",0); } |
| 2640 | 2722 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0b(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "TST_S",1); } |
| 2641 | 2723 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0c(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "MUL64_S",2); } // actual destination is special multiply registers |
| 2642 | 2724 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0d(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "SEXB_S",0); } |
| 2643 | 2725 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0e(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "SEXW_S",0); } |
| 2644 | 2726 | |
| 2727 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0f(OPS_16) // EXTB_S |
| 2728 | { |
| 2729 | int breg, creg; |
| 2645 | 2730 | |
| 2731 | COMMON16_GET_breg; |
| 2732 | COMMON16_GET_creg; |
| 2646 | 2733 | |
| 2734 | REG_16BIT_RANGE(breg); |
| 2735 | REG_16BIT_RANGE(creg); |
| 2647 | 2736 | |
| 2737 | m_regs[breg] = m_regs[creg] & 0x000000ff; |
| 2738 | |
| 2739 | return m_pc + (2 >> 0); |
| 2740 | |
| 2741 | } |
| 2742 | |
| 2743 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_10(OPS_16) // EXTW_S |
| 2744 | { |
| 2745 | int breg, creg; |
| 2746 | |
| 2747 | COMMON16_GET_breg; |
| 2748 | COMMON16_GET_creg; |
| 2749 | |
| 2750 | REG_16BIT_RANGE(breg); |
| 2751 | REG_16BIT_RANGE(creg); |
| 2752 | |
| 2753 | m_regs[breg] = m_regs[creg] & 0x0000ffff; |
| 2754 | |
| 2755 | return m_pc + (2 >> 0); |
| 2756 | } |
| 2757 | |
| 2648 | 2758 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_11(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ABS_S",0); } |
| 2649 | 2759 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_12(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "NOT_S",0); } |
| 2760 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_13(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "NEG_S",0); } |
| 2761 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_14(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ADD1_S",0); } |
| 2762 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_15(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ADD2_S",0); } |
| 2763 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_16(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ADD3_S",0); } |
| 2764 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_18(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASL_S",0); } |
| 2765 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_19(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "LSR_S",0); } |
| 2766 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1a(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASR_S",0); } |
| 2650 | 2767 | |
| 2768 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1b(OPS_16) // ASL b, c asl 1 (can also be impleneted as b = c + c) |
| 2769 | { |
| 2770 | int breg, creg; |
| 2651 | 2771 | |
| 2652 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_18(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASL_S",0); } |
| 2772 | COMMON16_GET_breg; |
| 2773 | COMMON16_GET_creg; |
| 2653 | 2774 | |
| 2654 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1a(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASR_S",0); } |
| 2775 | REG_16BIT_RANGE(breg); |
| 2776 | REG_16BIT_RANGE(creg); |
| 2655 | 2777 | |
| 2778 | m_regs[breg] = m_regs[creg] << 1; |
| 2656 | 2779 | |
| 2780 | return m_pc + (2 >> 0); |
| 2781 | } |
| 2782 | |
| 2657 | 2783 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1c(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASR1_S",0); } |
| 2658 | 2784 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1d(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "LSR1_S",0); } |
| 2659 | 2785 | |
| r242605 | r242606 | |
| 3141 | 3267 | |
| 3142 | 3268 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_00(OPS_16) { return arcompact_handle1e_03_0x_helper(PARAMS, "BGT_S"); } |
| 3143 | 3269 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_01(OPS_16) { return arcompact_handle1e_03_0x_helper(PARAMS, "BGE_S"); } |
| 3270 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_02(OPS_16) { return arcompact_handle1e_03_0x_helper(PARAMS, "BLT_S"); } |
| 3144 | 3271 | |
| 3145 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_02(OPS_16) // BLT_S |
| 3146 | | { |
| 3147 | | if (CONDITION_LT) |
| 3148 | | { |
| 3149 | | int s = (op & 0x003f) >> 0; op &= ~0x003f; |
| 3150 | | if (s & 0x020) s = -0x20 + (s & 0x1f); |
| 3151 | | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3152 | | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| 3153 | | return realaddress; |
| 3154 | | } |
| 3155 | | |
| 3156 | | return m_pc + (2 >> 0); |
| 3157 | | } |
| 3158 | | |
| 3159 | 3272 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_03(OPS_16) // BLE_S |
| 3160 | 3273 | { |
| 3161 | 3274 | if (CONDITION_LE) |
trunk/src/emu/cpu/arcompact/arcompact_make.py
| r242605 | r242606 | |
| 9 | 9 | print >>f, " if (result == 0x00000000) { STATUS32_SET_Z; }" |
| 10 | 10 | print >>f, " else { STATUS32_CLEAR_Z; }" |
| 11 | 11 | |
| 12 | | def EmitGroup04_Handle_NZC_LSR1_Flags(f, funcname, opname): |
| 13 | | print >>f, " if (result & 0x80000000) { STATUS32_SET_N; }" |
| 14 | | print >>f, " else { STATUS32_CLEAR_N; }" |
| 15 | | print >>f, " if (result == 0x00000000) { STATUS32_SET_Z; }" |
| 16 | | print >>f, " else { STATUS32_CLEAR_Z; }" |
| 17 | | print >>f, " if (c == 0x00000001) { STATUS32_SET_C; }" |
| 18 | | print >>f, " else { STATUS32_CLEAR_C; }" |
| 19 | | |
| 20 | | def EmitGroup04_Handle_NZCV_ADD_Flags(f, funcname, opname): |
| 21 | | print >>f, " if (result & 0x80000000) { STATUS32_SET_N; }" |
| 22 | | print >>f, " else { STATUS32_CLEAR_N; }" |
| 23 | | print >>f, " if (result == 0x00000000) { STATUS32_SET_Z; }" |
| 24 | | print >>f, " else { STATUS32_CLEAR_Z; }" |
| 25 | | print >>f, " if ((b & 0x80000000) == (c & 0x80000000))" |
| 26 | | print >>f, " {" |
| 27 | | print >>f, " if ((result & 0x80000000) != (b & 0x80000000))" |
| 28 | | print >>f, " {" |
| 29 | | print >>f, " STATUS32_SET_V;" |
| 30 | | print >>f, " }" |
| 31 | | print >>f, " else" |
| 32 | | print >>f, " {" |
| 33 | | print >>f, " STATUS32_CLEAR_V;" |
| 34 | | print >>f, " }" |
| 35 | | print >>f, " }" |
| 36 | | print >>f, " if (b < c)" |
| 37 | | print >>f, " {" |
| 38 | | print >>f, " STATUS32_SET_C;" |
| 39 | | print >>f, " }" |
| 40 | | print >>f, " else" |
| 41 | | print >>f, " {" |
| 42 | | print >>f, " STATUS32_CLEAR_C;" |
| 43 | | print >>f, " }" |
| 44 | | |
| 45 | | |
| 46 | 12 | def EmitGroup04_no_Flags(f, funcname, opname): |
| 47 | 13 | print >>f, " // no flag changes" |
| 48 | 14 | |
| r242605 | r242606 | |
| 66 | 32 | flaghandler(f, funcname, opname) |
| 67 | 33 | print >>f, " }" |
| 68 | 34 | |
| 69 | | def EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler): |
| 35 | def EmitGroup04(f,funcname, opname, opexecute, ignore_a, breg_is_dst_only, flagcondition, flaghandler): |
| 36 | # the mode 0x00 handler |
| 37 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p00(OPS_32)" % (funcname) |
| 38 | print >>f, "{" |
| 70 | 39 | print >>f, " int size = 4;" |
| 71 | 40 | |
| 41 | print >>f, " UINT32 limm = 0;" |
| 42 | |
| 43 | print >>f, " int got_limm = 0;" |
| 44 | print >>f, " " |
| 45 | print >>f, " COMMON32_GET_breg;" |
| 46 | |
| 47 | if flagcondition == -1: |
| 48 | print >>f, " COMMON32_GET_F;" |
| 49 | |
| 50 | print >>f, " COMMON32_GET_creg;" |
| 51 | |
| 52 | if ignore_a == 0: |
| 53 | print >>f, " COMMON32_GET_areg;" |
| 54 | elif ignore_a == 1: |
| 55 | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 56 | |
| 57 | print >>f, " " |
| 58 | |
| 59 | print >>f, " UINT32 c;" |
| 60 | if breg_is_dst_only == 0: |
| 61 | print >>f, " UINT32 b;" |
| 62 | print >>f, " " |
| 63 | print >>f, " if (breg == LIMM_REG)" |
| 64 | print >>f, " {" |
| 65 | print >>f, " GET_LIMM_32;" |
| 66 | print >>f, " size = 8;" |
| 67 | print >>f, " got_limm = 1;" |
| 68 | print >>f, " b = limm;" |
| 69 | print >>f, " }" |
| 70 | print >>f, " else" |
| 71 | print >>f, " {" |
| 72 | print >>f, " b = m_regs[breg];" |
| 73 | print >>f, " }" |
| 74 | |
| 75 | print >>f, " " |
| 76 | print >>f, " if (creg == LIMM_REG)" |
| 77 | print >>f, " {" |
| 78 | print >>f, " if (!got_limm)" |
| 79 | print >>f, " {" |
| 80 | print >>f, " GET_LIMM_32;" |
| 81 | print >>f, " size = 8;" |
| 82 | print >>f, " }" |
| 83 | print >>f, " c = limm;" |
| 84 | print >>f, " }" |
| 85 | print >>f, " else" |
| 86 | print >>f, " {" |
| 87 | print >>f, " c = m_regs[creg];" |
| 88 | print >>f, " }" |
| 89 | print >>f, " /* todo: is the limm, limm syntax valid? (it's pointless.) */" |
| 90 | print >>f, " /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */" |
| 91 | print >>f, " %s" % (opexecute) |
| 92 | print >>f, " " |
| 93 | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 94 | print >>f, " return m_pc + (size >> 0);" |
| 95 | print >>f, "}" |
| 96 | print >>f, "" |
| 97 | print >>f, "" |
| 98 | # the mode 0x01 handler |
| 99 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p01(OPS_32)" % (funcname) |
| 100 | print >>f, "{" |
| 101 | print >>f, " int size = 4;" |
| 102 | |
| 72 | 103 | if breg_is_dst_only == 0: |
| 73 | 104 | print >>f, " UINT32 limm = 0;" |
| 74 | 105 | |
| r242605 | r242606 | |
| 84 | 115 | if ignore_a == 0: |
| 85 | 116 | print >>f, " COMMON32_GET_areg;" |
| 86 | 117 | elif ignore_a == 1: |
| 87 | | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 88 | | elif ignore_a == 2: |
| 89 | | print >>f, " //COMMON32_GET_areg; // areg bits already used as opcode select" |
| 90 | | elif ignore_a == 3: |
| 91 | | print >>f, " //COMMON32_GET_areg; // areg bits already used as condition code select" |
| 118 | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 119 | |
| 92 | 120 | print >>f, " " |
| 93 | 121 | |
| 94 | 122 | print >>f, " UINT32 c;" |
| r242605 | r242606 | |
| 112 | 140 | print >>f, " c = u;" |
| 113 | 141 | print >>f, " " |
| 114 | 142 | print >>f, " /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */" |
| 115 | | |
| 116 | | def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler): |
| 117 | | # the mode 0x00 handler |
| 118 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p00(OPS_32)" % (funcname) |
| 143 | print >>f, " %s" % (opexecute) |
| 144 | print >>f, " " |
| 145 | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 146 | print >>f, " return m_pc + (size >> 0);" |
| 147 | print >>f, "}" |
| 148 | print >>f, "" |
| 149 | print >>f, "" |
| 150 | # the mode 0x10 handler |
| 151 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p10(OPS_32)" % (funcname) |
| 119 | 152 | print >>f, "{" |
| 120 | 153 | print >>f, " int size = 4;" |
| 154 | |
| 155 | if breg_is_dst_only == 0: |
| 156 | print >>f, " UINT32 limm = 0;" |
| 121 | 157 | |
| 122 | | print >>f, " UINT32 limm = 0;" |
| 123 | | |
| 124 | | print >>f, " int got_limm = 0;" |
| 158 | print >>f, "/* int got_limm = 0; */" |
| 125 | 159 | print >>f, " " |
| 126 | 160 | print >>f, " COMMON32_GET_breg;" |
| 127 | 161 | |
| 128 | | if flagcondition == -1: |
| 162 | if flagcondition == -1: |
| 129 | 163 | print >>f, " COMMON32_GET_F;" |
| 130 | | |
| 131 | | print >>f, " COMMON32_GET_creg;" |
| 132 | | |
| 133 | | if ignore_a == 0: |
| 164 | |
| 165 | print >>f, " COMMON32_GET_s12;" |
| 166 | |
| 167 | if ignore_a == 0: |
| 134 | 168 | print >>f, " COMMON32_GET_areg;" |
| 135 | 169 | elif ignore_a == 1: |
| 136 | | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 137 | | elif ignore_a == 2: |
| 138 | | print >>f, " //COMMON32_GET_areg; // areg bits already used as opcode select" |
| 139 | | |
| 140 | | print >>f, " " |
| 170 | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 141 | 171 | |
| 172 | print >>f, " " |
| 142 | 173 | print >>f, " UINT32 c;" |
| 143 | 174 | if breg_is_dst_only == 0: |
| 144 | 175 | print >>f, " UINT32 b;" |
| 145 | 176 | print >>f, " " |
| 177 | print >>f, " /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */" |
| 146 | 178 | print >>f, " if (breg == LIMM_REG)" |
| 147 | 179 | print >>f, " {" |
| 148 | 180 | print >>f, " GET_LIMM_32;" |
| 149 | 181 | print >>f, " size = 8;" |
| 150 | | print >>f, " got_limm = 1;" |
| 182 | print >>f, "/* got_limm = 1; */" |
| 151 | 183 | print >>f, " b = limm;" |
| 152 | 184 | print >>f, " }" |
| 153 | 185 | print >>f, " else" |
| r242605 | r242606 | |
| 155 | 187 | print >>f, " b = m_regs[breg];" |
| 156 | 188 | print >>f, " }" |
| 157 | 189 | |
| 190 | print >>f, " " |
| 191 | print >>f, " c = (UINT32)S;" |
| 158 | 192 | print >>f, " " |
| 159 | | print >>f, " if (creg == LIMM_REG)" |
| 160 | | print >>f, " {" |
| 161 | | print >>f, " if (!got_limm)" |
| 162 | | print >>f, " {" |
| 163 | | print >>f, " GET_LIMM_32;" |
| 164 | | print >>f, " size = 8;" |
| 165 | | print >>f, " }" |
| 166 | | print >>f, " c = limm;" |
| 167 | | print >>f, " }" |
| 168 | | print >>f, " else" |
| 169 | | print >>f, " {" |
| 170 | | print >>f, " c = m_regs[creg];" |
| 171 | | print >>f, " }" |
| 172 | | print >>f, " /* todo: is the limm, limm syntax valid? (it's pointless.) */" |
| 173 | 193 | print >>f, " /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */" |
| 174 | 194 | print >>f, " %s" % (opexecute) |
| 175 | | print >>f, " %s" % (opwrite) |
| 176 | 195 | print >>f, " " |
| 177 | 196 | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 178 | 197 | print >>f, " return m_pc + (size >> 0);" |
| 179 | 198 | print >>f, "}" |
| 180 | 199 | print >>f, "" |
| 181 | 200 | print >>f, "" |
| 182 | | # the mode 0x01 handler |
| 183 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p01(OPS_32)" % (funcname) |
| 201 | # the mode 0x11 m0 handler |
| 202 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m0(OPS_32)" % (funcname) |
| 184 | 203 | print >>f, "{" |
| 185 | | EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler) |
| 186 | | print >>f, " %s" % (opexecute) |
| 187 | | print >>f, " %s" % (opwrite) |
| 188 | | print >>f, " " |
| 189 | | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 204 | print >>f, " int size = 4;" |
| 205 | print >>f, " arcompact_fatal(\"arcompact_handle%s_p11_m0 (%s)\\n\");" % (funcname, opname) |
| 190 | 206 | print >>f, " return m_pc + (size >> 0);" |
| 191 | 207 | print >>f, "}" |
| 192 | 208 | print >>f, "" |
| 193 | | print >>f, "" |
| 194 | | # the mode 0x10 handler |
| 195 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p10(OPS_32)" % (funcname) |
| 196 | | if ignore_a == 2: |
| 197 | | print >>f, "{" |
| 198 | | print >>f, " int size = 4;" |
| 199 | | print >>f, " arcompact_fatal(\"illegal arcompact_handle%s_p10 (ares bits already used as opcode select, can't be used as s12) (%s)\\n\");" % (funcname, opname) |
| 200 | | print >>f, " return m_pc + (size >> 0);" |
| 201 | | print >>f, "}" |
| 202 | | else: |
| 203 | | print >>f, "{" |
| 204 | | print >>f, " int size = 4;" |
| 205 | | if breg_is_dst_only == 0: |
| 206 | | print >>f, " UINT32 limm = 0;" |
| 207 | | |
| 208 | | print >>f, "/* int got_limm = 0; */" |
| 209 | | print >>f, " " |
| 210 | | print >>f, " COMMON32_GET_breg;" |
| 211 | | |
| 212 | | if flagcondition == -1: |
| 213 | | print >>f, " COMMON32_GET_F;" |
| 214 | | |
| 215 | | print >>f, " COMMON32_GET_s12;" |
| 216 | | |
| 217 | | # areg can't be used here, it's used for s12 bits |
| 218 | | |
| 219 | | print >>f, " " |
| 220 | | print >>f, " UINT32 c;" |
| 221 | | if breg_is_dst_only == 0: |
| 222 | | print >>f, " UINT32 b;" |
| 223 | | print >>f, " " |
| 224 | | print >>f, " /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */" |
| 225 | | print >>f, " if (breg == LIMM_REG)" |
| 226 | | print >>f, " {" |
| 227 | | print >>f, " GET_LIMM_32;" |
| 228 | | print >>f, " size = 8;" |
| 229 | | print >>f, "/* got_limm = 1; */" |
| 230 | | print >>f, " b = limm;" |
| 231 | | print >>f, " }" |
| 232 | | print >>f, " else" |
| 233 | | print >>f, " {" |
| 234 | | print >>f, " b = m_regs[breg];" |
| 235 | | print >>f, " }" |
| 236 | | |
| 237 | | print >>f, " " |
| 238 | | print >>f, " c = (UINT32)S;" |
| 239 | | print >>f, " " |
| 240 | | print >>f, " /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */" |
| 241 | | print >>f, " %s" % (opexecute) |
| 242 | | print >>f, " %s" % (opwrite_alt) |
| 243 | | print >>f, " " |
| 244 | | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 245 | | print >>f, " return m_pc + (size >> 0);" |
| 246 | | print >>f, "}" |
| 247 | | print >>f, "" |
| 248 | | print >>f, "" |
| 249 | | # the mode 0x11 m0 handler |
| 250 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m0(OPS_32)" % (funcname) |
| 251 | | if ignore_a == 2: |
| 252 | | print >>f, "{" |
| 253 | | print >>f, " int size = 4;" |
| 254 | | print >>f, " arcompact_fatal(\"illegal arcompact_handle%s_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (%s)\\n\");" % (funcname, opname) |
| 255 | | print >>f, " return m_pc + (size >> 0);" |
| 256 | | print >>f, "}" |
| 257 | | else: |
| 258 | | print >>f, "{" |
| 259 | | print >>f, " int size = 4;" |
| 260 | | print >>f, " arcompact_fatal(\"arcompact_handle%s_p11_m0 (%s)\\n\");" % (funcname, opname) |
| 261 | | print >>f, " return m_pc + (size >> 0);" |
| 262 | | print >>f, "}" |
| 263 | | print >>f, "" |
| 264 | | print >>f, "" |
| 209 | print >>f, "" |
| 265 | 210 | # the mode 0x11 m1 handler |
| 266 | 211 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m1(OPS_32)" % (funcname) |
| 267 | | if ignore_a == 2: |
| 268 | | print >>f, "{" |
| 269 | | print >>f, " int size = 4;" |
| 270 | | print >>f, " arcompact_fatal(\"illegal arcompact_handle%s_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (%s)\\n\");" % (funcname, opname) |
| 271 | | print >>f, " return m_pc + (size >> 0);" |
| 272 | | print >>f, "}" |
| 273 | | else: |
| 274 | | print >>f, "{" |
| 275 | | EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, 3, breg_is_dst_only, flagcondition, flaghandler) |
| 276 | | print >>f, " COMMON32_GET_CONDITION;" |
| 277 | | print >>f, " if (!check_condition(condition))" |
| 278 | | print >>f, " return m_pc + (size>>0);" |
| 279 | | print >>f, "" |
| 280 | | print >>f, " %s" % (opexecute) |
| 281 | | print >>f, " %s" % (opwrite_alt) |
| 282 | | print >>f, " " |
| 283 | | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 284 | | print >>f, " return m_pc + (size >> 0);" |
| 285 | | print >>f, "}" |
| 286 | | print >>f, "" |
| 287 | | print >>f, "" |
| 288 | | |
| 289 | | |
| 290 | | # xxx_S c, b, u3 format opcodes (note c is destination) |
| 291 | | def EmitGroup0d(f,funcname, opname, opexecute, opwrite): |
| 292 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)" % (funcname) |
| 293 | 212 | print >>f, "{" |
| 294 | | print >>f, " int u, breg, creg;" |
| 295 | | print >>f, "" |
| 296 | | print >>f, " COMMON16_GET_u3;" |
| 297 | | print >>f, " COMMON16_GET_breg;" |
| 298 | | print >>f, " COMMON16_GET_creg;" |
| 299 | | print >>f, "" |
| 300 | | print >>f, " REG_16BIT_RANGE(breg);" |
| 301 | | print >>f, " REG_16BIT_RANGE(creg);" |
| 302 | | print >>f, "" |
| 303 | | print >>f, " %s" % (opexecute) |
| 304 | | print >>f, " %s" % (opwrite) |
| 305 | | print >>f, "" |
| 306 | | print >>f, " return m_pc + (2 >> 0);" |
| 213 | print >>f, " int size = 4;" |
| 214 | print >>f, " arcompact_fatal(\"arcompact_handle%s_p11_m1 (%s)\\n\");" % (funcname, opname) |
| 215 | print >>f, " return m_pc + (size >> 0);" |
| 307 | 216 | print >>f, "}" |
| 308 | | |
| 309 | | |
| 310 | | # xxx_S b <- b,c format opcodes |
| 311 | | def EmitGroup0f(f,funcname, opname, opexecute, opwrite): |
| 312 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)"% (funcname) |
| 313 | | print >>f, "{" |
| 314 | | print >>f, " int breg, creg;" |
| 315 | 217 | print >>f, "" |
| 316 | | print >>f, " COMMON16_GET_breg;" |
| 317 | | print >>f, " COMMON16_GET_creg;" |
| 318 | 218 | print >>f, "" |
| 319 | | print >>f, " REG_16BIT_RANGE(breg);" |
| 320 | | print >>f, " REG_16BIT_RANGE(creg);" |
| 321 | | print >>f, "" |
| 322 | | print >>f, " %s" % (opexecute) |
| 323 | | print >>f, " %s" % (opwrite) |
| 324 | | print >>f, "" |
| 325 | | print >>f, " return m_pc + (2 >> 0);" |
| 326 | | print >>f, "}" |
| 327 | 219 | |
| 328 | | |
| 329 | 220 | # xxx_S b, b, u5 format opcodes |
| 330 | 221 | def EmitGroup17(f,funcname, opname, opexecute): |
| 331 | 222 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)" % (funcname) |
| r242605 | r242606 | |
| 353 | 244 | sys.exit(1) |
| 354 | 245 | |
| 355 | 246 | |
| 356 | | EmitGroup04(f, "04_00", "ADD", "UINT32 result = b + c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_Handle_NZCV_ADD_Flags ) |
| 247 | EmitGroup04(f, "04_00", "ADD", "UINT32 result = b + c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 357 | 248 | |
| 358 | | EmitGroup04(f, "04_02", "SUB", "UINT32 result = b - c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 249 | EmitGroup04(f, "04_02", "SUB", "UINT32 result = b - c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 359 | 250 | |
| 360 | | EmitGroup04(f, "04_04", "AND", "UINT32 result = b & c;", "if (areg != LIMM_REG) { m_regs[areg] = result; }", "if (breg != LIMM_REG) { m_regs[breg] = result; }", 0,0, -1, EmitGroup04_Handle_NZ_Flags ) |
| 361 | | EmitGroup04(f, "04_05", "OR", "UINT32 result = b | c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 362 | | EmitGroup04(f, "04_06", "BIC", "UINT32 result = b & (~c);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 363 | | EmitGroup04(f, "04_07", "XOR", "UINT32 result = b ^ c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 251 | EmitGroup04(f, "04_04", "AND", "UINT32 result = b & c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 252 | EmitGroup04(f, "04_05", "OR", "UINT32 result = b | c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 253 | EmitGroup04(f, "04_06", "BIC", "UINT32 result = b & (~c); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 254 | EmitGroup04(f, "04_07", "XOR", "UINT32 result = b ^ c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 364 | 255 | |
| 365 | | EmitGroup04(f, "04_0a", "MOV", "UINT32 result = c;", "m_regs[breg] = result;", "m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) # special case, result always goes to breg |
| 256 | EmitGroup04(f, "04_0a", "MOV", "UINT32 result = c; m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) |
| 366 | 257 | |
| 367 | | EmitGroup04(f, "04_0e", "RSUB", "UINT32 result = c - b;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 368 | | EmitGroup04(f, "04_0f", "BSET", "UINT32 result = b | (1 << (c & 0x1f));", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 258 | EmitGroup04(f, "04_0f", "BSET", "UINT32 result = b | (1 << (c & 0x1f)); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 369 | 259 | |
| 370 | | EmitGroup04(f, "04_13", "BMSK", "UINT32 result = b & ((1<<(c+1))-1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 260 | EmitGroup04(f, "04_15", "ADD2", "UINT32 result = b + (c << 2); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 261 | EmitGroup04(f, "04_16", "ADD3", "UINT32 result = b + (c << 3); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 371 | 262 | |
| 372 | 263 | |
| 373 | | EmitGroup04(f, "04_14", "ADD1", "UINT32 result = b + (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 374 | | EmitGroup04(f, "04_15", "ADD2", "UINT32 result = b + (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 375 | | EmitGroup04(f, "04_16", "ADD3", "UINT32 result = b + (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 376 | | EmitGroup04(f, "04_17", "SUB1", "UINT32 result = b - (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 377 | | EmitGroup04(f, "04_18", "SUB2", "UINT32 result = b - (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 378 | | EmitGroup04(f, "04_19", "SUB3", "UINT32 result = b - (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 264 | EmitGroup04(f, "05_00", "ASL", "UINT32 result = b << (c&0x1f); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 265 | EmitGroup04(f, "05_01", "LSR", "UINT32 result = b >> (c&0x1f); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 379 | 266 | |
| 380 | | EmitGroup04(f, "04_2b", "SR", "WRITEAUX(c,b);", "", "", 1,0, -1, EmitGroup04_unsupported_Flags ) # this can't be conditional (todo) |
| 381 | | |
| 382 | | |
| 383 | | |
| 384 | | EmitGroup04(f, "05_00", "ASL", "UINT32 result = b << (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 385 | | EmitGroup04(f, "05_01", "LSR", "UINT32 result = b >> (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 386 | | |
| 387 | | # the 04_2f subgroup uses the same encoding, but the areg is already used as sub-opcode select, so any modes relying on areg bits for other reasons (sign, condition) (modes 10, 11m0, 11m1) are illegal. the destination is also breg not areg |
| 388 | | EmitGroup04(f, "04_2f_02", "LSR1", "UINT32 result = c >> 1;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) # no alt handler (invalid path) |
| 389 | | EmitGroup04(f, "04_2f_07", "EXTB", "UINT32 result = c & 0x000000ff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ |
| 390 | | EmitGroup04(f, "04_2f_08", "EXTW", "UINT32 result = c & 0x0000ffff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ |
| 391 | | |
| 392 | | # xxx_S c, b, u3 format opcodes (note c is destination) |
| 393 | | EmitGroup0d(f, "0d_00", "ADD_S", "UINT32 result = m_regs[breg] + u;", "m_regs[creg] = result;" ) |
| 394 | | EmitGroup0d(f, "0d_01", "SUB_S", "UINT32 result = m_regs[breg] - u;", "m_regs[creg] = result;" ) |
| 395 | | EmitGroup0d(f, "0d_02", "ASL_S", "UINT32 result = m_regs[breg] << u;", "m_regs[creg] = result;" ) |
| 396 | | |
| 397 | | # xxx_S b <- b,c format opcodes (or in some cases xxx_S b,c) |
| 398 | | EmitGroup0f(f, "0f_02", "SUB_S", "UINT32 result = m_regs[breg] - m_regs[creg];", "m_regs[breg] = result;" ) |
| 399 | | EmitGroup0f(f, "0f_04", "AND_S", "UINT32 result = m_regs[breg] & m_regs[creg];", "m_regs[breg] = result;" ) |
| 400 | | EmitGroup0f(f, "0f_05", "OR_S", "UINT32 result = m_regs[breg] | m_regs[creg];", "m_regs[breg] = result;" ) |
| 401 | | EmitGroup0f(f, "0f_07", "XOR_S", "UINT32 result = m_regs[breg] ^ m_regs[creg];", "m_regs[breg] = result;" ) |
| 402 | | EmitGroup0f(f, "0f_0f", "EXTB_S","UINT32 result = m_regs[creg] & 0x000000ff;", "m_regs[breg] = result;" ) |
| 403 | | EmitGroup0f(f, "0f_10", "EXTW_S","UINT32 result = m_regs[creg] & 0x0000ffff;", "m_regs[breg] = result;" ) |
| 404 | | EmitGroup0f(f, "0f_13", "NEG_S"," UINT32 result = 0 - m_regs[creg];", "m_regs[breg] = result;" ) |
| 405 | | |
| 406 | | EmitGroup0f(f, "0f_14", "ADD1_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<1);", "m_regs[breg] = result;" ) |
| 407 | | EmitGroup0f(f, "0f_15", "ADD2_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<2);", "m_regs[breg] = result;" ) |
| 408 | | EmitGroup0f(f, "0f_16", "ADD3_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<3);", "m_regs[breg] = result;" ) |
| 409 | | |
| 410 | | EmitGroup0f(f, "0f_19", "LSR_S", "UINT32 result = m_regs[breg] >> (m_regs[creg]&0x1f);","m_regs[breg] = result;" ) |
| 411 | | EmitGroup0f(f, "0f_1b", "ASL1_S","UINT32 result = m_regs[creg] << 1;", "m_regs[breg] = result;" ) |
| 412 | | |
| 413 | | |
| 414 | 267 | # xxx_S b, b, u5 format opcodes |
| 415 | 268 | EmitGroup17(f, "17_00", "ASL_S", "m_regs[breg] = m_regs[breg] << (u&0x1f);" ) |
| 416 | 269 | EmitGroup17(f, "17_01", "LSR_S", "m_regs[breg] = m_regs[breg] >> (u&0x1f);" ) |
trunk/src/mame/drivers/sbrkout.c
| r242605 | r242606 | |
| 6 | 6 | |
| 7 | 7 | Games supported: |
| 8 | 8 | * Super Breakout |
| 9 | | * Super Breakout (Canyon and Vertical Breakout, prototype) |
| 10 | | * Super Breakout (Cocktail, prototype) |
| 9 | * Super Breakout (Canyon and Vertical Breakout, prototype) - built from original source code |
| 11 | 10 | |
| 12 | 11 | Known issues: |
| 13 | 12 | * none at this time |
| r242605 | r242606 | |
| 60 | 59 | UINT8 m_pot_trigger[2]; |
| 61 | 60 | DECLARE_WRITE8_MEMBER(irq_ack_w); |
| 62 | 61 | DECLARE_READ8_MEMBER(switches_r); |
| 63 | | DECLARE_READ8_MEMBER(sbrkoutct_switches_r); |
| 64 | 62 | DECLARE_WRITE8_MEMBER(pot_mask1_w); |
| 65 | 63 | DECLARE_WRITE8_MEMBER(pot_mask2_w); |
| 66 | 64 | DECLARE_WRITE8_MEMBER(start_1_led_w); |
| 67 | 65 | DECLARE_WRITE8_MEMBER(start_2_led_w); |
| 68 | 66 | DECLARE_WRITE8_MEMBER(serve_led_w); |
| 69 | | DECLARE_WRITE8_MEMBER(serve_2_led_w); |
| 70 | 67 | DECLARE_WRITE8_MEMBER(coincount_w); |
| 71 | 68 | DECLARE_READ8_MEMBER(sync_r); |
| 72 | 69 | DECLARE_READ8_MEMBER(sync2_r); |
| r242605 | r242606 | |
| 215 | 212 | return result; |
| 216 | 213 | } |
| 217 | 214 | |
| 218 | | READ8_MEMBER(sbrkout_state::sbrkoutct_switches_r) |
| 219 | | { |
| 220 | | UINT8 result = 0xff; |
| 221 | 215 | |
| 222 | | switch( offset ) |
| 223 | | { |
| 224 | | case 0x28: result = ioport("SELECT")->read(); break; |
| 225 | | case 0x2e: result = ioport("SERVE")->read(); break; |
| 226 | | case 0x2f: result = ioport("SERVE2")->read(); break; |
| 227 | | case 0x30: result = (ioport("DIPS")->read() & 0x03) << 6; break; |
| 228 | | case 0x31: result = (ioport("DIPS")->read() & 0x0c) << 4; break; |
| 229 | | case 0x32: result = ioport("DIPS")->read() & 0xc0; break; |
| 230 | | case 0x33: result = (ioport("DIPS")->read() & 0x30) << 2; break; |
| 231 | | default: logerror("Unknown port read %x\n", offset); break; |
| 232 | | } |
| 233 | | return result; |
| 234 | | } |
| 235 | | |
| 236 | 216 | void sbrkout_state::update_nmi_state() |
| 237 | 217 | { |
| 238 | 218 | if ((m_pot_trigger[0] & ~m_pot_mask[0]) | (m_pot_trigger[1] & ~m_pot_mask[1])) |
| r242605 | r242606 | |
| 295 | 275 | output_set_led_value(0, ~offset & 1); |
| 296 | 276 | } |
| 297 | 277 | |
| 298 | | WRITE8_MEMBER(sbrkout_state::serve_2_led_w) |
| 299 | | { |
| 300 | | output_set_led_value(1, ~offset & 1); |
| 301 | | } |
| 302 | 278 | |
| 303 | 279 | WRITE8_MEMBER(sbrkout_state::coincount_w) |
| 304 | 280 | { |
| r242605 | r242606 | |
| 411 | 387 | AM_RANGE(0x2800, 0x3fff) AM_ROM |
| 412 | 388 | ADDRESS_MAP_END |
| 413 | 389 | |
| 414 | | static ADDRESS_MAP_START( sbrkoutct_main_map, AS_PROGRAM, 8, sbrkout_state ) |
| 415 | | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 416 | | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x380) AM_RAMBANK("bank1") |
| 417 | | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sbrkout_videoram_w) AM_SHARE("videoram") |
| 418 | | AM_RANGE(0x0800, 0x083f) AM_READ(sbrkoutct_switches_r) |
| 419 | | AM_RANGE(0x0840, 0x0840) AM_MIRROR(0x003f) AM_READ_PORT("COIN") |
| 420 | | AM_RANGE(0x0880, 0x0880) AM_MIRROR(0x003f) AM_READ_PORT("START") |
| 421 | | AM_RANGE(0x08c0, 0x08c0) AM_MIRROR(0x003f) AM_READ_PORT("SERVICE") |
| 422 | | AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03ff) AM_READ(sync_r) |
| 423 | | AM_RANGE(0x0c10, 0x0c11) AM_MIRROR(0x000e) AM_WRITE(serve_led_w) |
| 424 | | AM_RANGE(0x0c20, 0x0c21) AM_MIRROR(0x000e) AM_WRITE(serve_2_led_w) |
| 425 | | AM_RANGE(0x0c30, 0x0c31) AM_MIRROR(0x000e) AM_WRITE(start_1_led_w) |
| 426 | | AM_RANGE(0x0c40, 0x0c41) AM_MIRROR(0x000e) AM_WRITE(start_2_led_w) |
| 427 | | AM_RANGE(0x0c50, 0x0c51) AM_MIRROR(0x000e) AM_WRITE(pot_mask1_w) |
| 428 | | AM_RANGE(0x0c60, 0x0c61) AM_MIRROR(0x000e) AM_WRITE(pot_mask2_w) |
| 429 | | AM_RANGE(0x0c70, 0x0c71) AM_MIRROR(0x000e) AM_WRITE(coincount_w) |
| 430 | | AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_WRITE(watchdog_reset_w) |
| 431 | | AM_RANGE(0x0e00, 0x0e00) AM_MIRROR(0x007f) AM_WRITE(irq_ack_w) |
| 432 | | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03ff) AM_READ(sync2_r) |
| 433 | | AM_RANGE(0x2800, 0x3fff) AM_ROM |
| 434 | | ADDRESS_MAP_END |
| 435 | 390 | |
| 436 | 391 | |
| 437 | 392 | /************************************* |
| r242605 | r242606 | |
| 520 | 475 | PORT_CONFSETTING( 0x02, "Vertical" ) |
| 521 | 476 | INPUT_PORTS_END |
| 522 | 477 | |
| 523 | | static INPUT_PORTS_START( sbrkoutct ) |
| 524 | | PORT_INCLUDE(sbrkout) |
| 525 | | |
| 526 | | PORT_START("SERVE2") |
| 527 | | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 528 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 529 | | |
| 530 | | PORT_MODIFY("SELECT") |
| 531 | | PORT_CONFNAME(0x80, 0x00, "Game Select" ) |
| 532 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 533 | | PORT_CONFSETTING( 0x80, DEF_STR( On ) ) |
| 534 | | INPUT_PORTS_END |
| 535 | | |
| 536 | 478 | /************************************* |
| 537 | 479 | * |
| 538 | 480 | * Graphics definitions |
| r242605 | r242606 | |
| 601 | 543 | MACHINE_CONFIG_END |
| 602 | 544 | |
| 603 | 545 | |
| 604 | | static MACHINE_CONFIG_DERIVED(sbrkoutct, sbrkout) |
| 605 | | MCFG_CPU_MODIFY("maincpu") |
| 606 | | MCFG_CPU_PROGRAM_MAP(sbrkoutct_main_map) |
| 607 | | MACHINE_CONFIG_END |
| 608 | 546 | |
| 609 | 547 | /************************************* |
| 610 | 548 | * |
| r242605 | r242606 | |
| 660 | 598 | ROM_LOAD( "006401.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* memory mapper */ |
| 661 | 599 | ROM_END |
| 662 | 600 | |
| 663 | | ROM_START( sbrkoutc ) // built from original Atari source code |
| 601 | ROM_START( sbrkoutc ) |
| 664 | 602 | ROM_REGION( 0x4000, "maincpu", 0 ) |
| 665 | 603 | ROM_LOAD( "a33443.bin", 0x2800, 0x1800, CRC(bf418976) SHA1(d766e220a284a7b9caf876207e8191aff0497a03) ) |
| 666 | 604 | |
| r242605 | r242606 | |
| 676 | 614 | ROM_LOAD( "006401.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* memory mapper */ |
| 677 | 615 | ROM_END |
| 678 | 616 | |
| 679 | | ROM_START( sbrkoutct ) // built from original Atari source code |
| 680 | | ROM_REGION( 0x4000, "maincpu", 0 ) |
| 681 | | ROM_LOAD( "034555-01.c1", 0x2800, 0x0800, CRC(2da82521) SHA1(1f53e549676052647486cea6738c5c7a45133538) ) |
| 682 | | ROM_LOAD( "034556-01.d11", 0x3000, 0x0800, CRC(5a6497ae) SHA1(96c2a136fb1e649e2db17bcb12bdc2a8d250a63e) ) |
| 683 | | ROM_LOAD( "034557-01.ef1", 0x3800, 0x0800, CRC(b6b3b07b) SHA1(c4d2cdcca89c2944afd4a4ed0bb5003b3eca4c7e) ) |
| 684 | 617 | |
| 685 | | ROM_REGION( 0x0400, "gfx1", 0 ) |
| 686 | | ROM_LOAD( "034559-01.r4", 0x0000, 0x0200, CRC(84368539) SHA1(50b2c3f443346e3a355492ed1f7ec0a8cc6364d4) ) |
| 687 | | ROM_LOAD( "034558-01.p4", 0x0200, 0x0200, CRC(cc0f81f2) SHA1(a2180280991c9cf43f4e941d9ba4fe5654d1af65) ) |
| 688 | | |
| 689 | | ROM_REGION( 0x0020, "gfx2", 0 ) |
| 690 | | ROM_LOAD( "033282.k6", 0x0000, 0x0020, CRC(6228736b) SHA1(bc176261dba11521df19d545ce604f8cc294287a) ) |
| 691 | | |
| 692 | | ROM_REGION( 0x0120, "proms", 0 ) |
| 693 | | ROM_LOAD( "006400.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* sync (not used) */ |
| 694 | | ROM_LOAD( "006401.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* memory mapper */ |
| 695 | | ROM_END |
| 696 | | |
| 697 | 618 | /************************************* |
| 698 | 619 | * |
| 699 | 620 | * Game drivers |
| 700 | 621 | * |
| 701 | 622 | *************************************/ |
| 702 | 623 | |
| 703 | | GAMEL( 1978, sbrkout, 0, sbrkout, sbrkout, driver_device, 0, ROT270, "Atari", "Super Breakout (rev 04)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 704 | | GAMEL( 1978, sbrkout3, sbrkout, sbrkout, sbrkout, driver_device, 0, ROT270, "Atari", "Super Breakout (rev 03)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 705 | | GAMEL( 1978, sbrkoutc, sbrkout, sbrkout, sbrkoutc, driver_device, 0, ROT270, "Atari", "Super Breakout (Canyon and Vertical Breakout, prototype)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 706 | | GAMEL( 1978, sbrkoutct, sbrkout, sbrkoutct, sbrkoutct, driver_device, 0, ROT270, "Atari", "Super Breakout (Cocktail, prototype)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 624 | GAMEL( 1978, sbrkout, 0, sbrkout, sbrkout, driver_device, 0, ROT270, "Atari", "Super Breakout (rev 04)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 625 | GAMEL( 1978, sbrkout3, sbrkout, sbrkout, sbrkout, driver_device, 0, ROT270, "Atari", "Super Breakout (rev 03)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
| 626 | GAMEL( 1978, sbrkoutc, sbrkout, sbrkout, sbrkoutc, driver_device, 0, ROT270, "Atari", "Super Breakout (Canyon and Vertical Breakout, prototype)", GAME_SUPPORTS_SAVE, layout_sbrkout ) |
trunk/src/mame/drivers/sprint2.c
| r242605 | r242606 | |
| 39 | 39 | m_game = 3; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | | DRIVER_INIT_MEMBER(sprint2_state,dominos4) |
| 43 | | { |
| 44 | | m_game = 3; |
| 45 | | m_maincpu->space(AS_PROGRAM).install_read_port(0x0880, 0x0880, "SELFTTEST"); |
| 46 | | m_maincpu->space(AS_PROGRAM).install_write_handler(0x0c50, 0x0c5f, write8_delegate(FUNC(sprint2_state::dominos4_lamp3_w),this)); |
| 47 | | m_maincpu->space(AS_PROGRAM).install_write_handler(0x0c60, 0x0c6f, write8_delegate(FUNC(sprint2_state::dominos4_lamp4_w),this)); |
| 48 | | } |
| 49 | | |
| 50 | 42 | int sprint2_state::service_mode() |
| 51 | 43 | { |
| 52 | 44 | UINT8 v = ioport("INB")->read(); |
| r242605 | r242606 | |
| 242 | 234 | set_led_status(machine(), 1, offset & 1); |
| 243 | 235 | } |
| 244 | 236 | |
| 245 | | WRITE8_MEMBER(sprint2_state::dominos4_lamp3_w) |
| 246 | | { |
| 247 | | set_led_status(machine(), 2, offset & 1); |
| 248 | | } |
| 249 | | WRITE8_MEMBER(sprint2_state::dominos4_lamp4_w) |
| 250 | | { |
| 251 | | set_led_status(machine(), 3, offset & 1); |
| 252 | | } |
| 253 | 237 | |
| 254 | 238 | static ADDRESS_MAP_START( sprint2_map, AS_PROGRAM, 8, sprint2_state ) |
| 255 | | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 256 | 239 | AM_RANGE(0x0000, 0x03ff) AM_READWRITE(sprint2_wram_r,sprint2_wram_w) |
| 257 | 240 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sprint2_video_ram_w) AM_SHARE("video_ram") |
| 258 | 241 | AM_RANGE(0x0818, 0x081f) AM_READ(sprint2_input_A_r) |
| r242605 | r242606 | |
| 278 | 261 | AM_RANGE(0x1400, 0x17ff) AM_READ(sprint2_collision2_r) |
| 279 | 262 | AM_RANGE(0x1800, 0x1800) AM_READNOP /* debugger ROM location? */ |
| 280 | 263 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 264 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 281 | 265 | ADDRESS_MAP_END |
| 282 | 266 | |
| 283 | 267 | |
| r242605 | r242606 | |
| 457 | 441 | PORT_ADJUSTER( 50, "R23 - Tone Freq" ) |
| 458 | 442 | INPUT_PORTS_END |
| 459 | 443 | |
| 460 | | static INPUT_PORTS_START( dominos4 ) |
| 461 | | PORT_INCLUDE(dominos) |
| 462 | 444 | |
| 463 | | PORT_MODIFY("INA") /* input A */ |
| 464 | | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) |
| 465 | | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| 466 | | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 467 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) |
| 468 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) |
| 469 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) |
| 470 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) |
| 471 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) |
| 472 | | |
| 473 | | PORT_MODIFY("INB") /* input A */ |
| 474 | | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(3) |
| 475 | | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(3) |
| 476 | | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(3) |
| 477 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(3) |
| 478 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(4) |
| 479 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(4) |
| 480 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(4) |
| 481 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(4) |
| 482 | | |
| 483 | | PORT_START("SELFTTEST") |
| 484 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 485 | | INPUT_PORTS_END |
| 486 | | |
| 487 | 445 | static const gfx_layout tile_layout = |
| 488 | 446 | { |
| 489 | 447 | 16, 8, |
| r242605 | r242606 | |
| 584 | 542 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 585 | 543 | MACHINE_CONFIG_END |
| 586 | 544 | |
| 545 | |
| 587 | 546 | ROM_START( sprint1 ) |
| 588 | 547 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 589 | 548 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 549 | ROM_RELOAD( 0xe000, 0x0800 ) |
| 590 | 550 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 551 | ROM_RELOAD( 0xe800, 0x0800 ) |
| 591 | 552 | ROM_LOAD( "6442-01.d1", 0x3000, 0x0800, CRC(e9ff0124) SHA1(42fe028e2e595573ccc0821de3bb6970364c585d) ) |
| 553 | ROM_RELOAD( 0xf000, 0x0800 ) |
| 592 | 554 | ROM_LOAD( "6443-01.e1", 0x3800, 0x0800, CRC(d6bb00d0) SHA1(cdcd4bb7b32be7a11480d3312fcd8d536e2d0caf) ) |
| 555 | ROM_RELOAD( 0xf800, 0x0800 ) |
| 593 | 556 | |
| 594 | 557 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 595 | 558 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242605 | r242606 | |
| 608 | 571 | ROM_START( sprint2 ) |
| 609 | 572 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 610 | 573 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 574 | ROM_RELOAD( 0xe000, 0x0800 ) |
| 611 | 575 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 576 | ROM_RELOAD( 0xe800, 0x0800 ) |
| 612 | 577 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 578 | ROM_RELOAD( 0xf000, 0x0800 ) |
| 613 | 579 | ROM_LOAD( "6405.e1", 0x3800, 0x0800, CRC(6c991c80) SHA1(c30a5b340f05dd702c7a186eb62607a48fa19f72) ) |
| 580 | ROM_RELOAD( 0xf800, 0x0800 ) |
| 614 | 581 | |
| 615 | 582 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 616 | 583 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242605 | r242606 | |
| 629 | 596 | ROM_START( sprint2a ) |
| 630 | 597 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 631 | 598 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 599 | ROM_RELOAD( 0xe000, 0x0800 ) |
| 632 | 600 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 601 | ROM_RELOAD( 0xe800, 0x0800 ) |
| 633 | 602 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 603 | ROM_RELOAD( 0xf000, 0x0800 ) |
| 634 | 604 | ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(e80fd249) SHA1(7bcf7dfd72ca83fdd80593eaf392570da1f71298) ) |
| 605 | ROM_RELOAD( 0xf800, 0x0800 ) |
| 635 | 606 | |
| 636 | 607 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 637 | 608 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242605 | r242606 | |
| 650 | 621 | ROM_START( sprint2h ) |
| 651 | 622 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 652 | 623 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 624 | ROM_RELOAD( 0xe000, 0x0800 ) |
| 653 | 625 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 626 | ROM_RELOAD( 0xe800, 0x0800 ) |
| 654 | 627 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 628 | ROM_RELOAD( 0xf000, 0x0800 ) |
| 655 | 629 | ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(6de291f1) SHA1(00c2826011d80ac0784649a7bc156a97c26565fd) ) // sldh |
| 630 | ROM_RELOAD( 0xf800, 0x0800 ) |
| 656 | 631 | |
| 657 | 632 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 658 | 633 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242605 | r242606 | |
| 671 | 646 | ROM_START( dominos ) |
| 672 | 647 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 673 | 648 | ROM_LOAD( "7352-02.d1", 0x3000, 0x0800, CRC(738b4413) SHA1(3a90ab25bb5f65504692f97da43f03e21392dcd8) ) |
| 649 | ROM_RELOAD( 0xf000, 0x0800 ) |
| 674 | 650 | ROM_LOAD( "7438-02.e1", 0x3800, 0x0800, CRC(c84e54e2) SHA1(383b388a1448a195f28352fc5e4ff1a2af80cc95) ) |
| 651 | ROM_RELOAD( 0xf800, 0x0800 ) |
| 675 | 652 | |
| 676 | 653 | ROM_REGION( 0x200, "gfx1", 0 ) /* tiles */ |
| 677 | 654 | ROM_LOAD_NIB_HIGH( "7439-01.p4", 0x0000, 0x0200, CRC(4f42fdd6) SHA1(f8ea4b582e26cad37b746174cdc9f1c7ae0819c3) ) |
| r242605 | r242606 | |
| 685 | 662 | ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ |
| 686 | 663 | ROM_END |
| 687 | 664 | |
| 688 | | ROM_START( dominos4 ) // built from original Atari source code |
| 689 | | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 690 | | ROM_LOAD_NIB_HIGH( "007754-01.l1", 0x3000, 0x0400, CRC(03fae4a9) SHA1(a132bd8bc866e33cdf6b4881064c8d265c2b25f4) ) |
| 691 | | ROM_LOAD_NIB_LOW ( "007755-01.l0", 0x3000, 0x0400, CRC(fa2d0c04) SHA1(fcf618c7089db46d55933d58ea04701af515ad49) ) |
| 692 | | ROM_LOAD_NIB_HIGH( "007756-01.m1", 0x3400, 0x0400, CRC(d2acb1b5) SHA1(ad81eed9dd0a2d5ecfd42daf90825726e64063b3) ) |
| 693 | | ROM_LOAD_NIB_LOW ( "007757-01.m0", 0x3400, 0x0400, CRC(69f2db90) SHA1(a064c840599c4e7cb65670e5480adeb310247f16) ) |
| 694 | | ROM_LOAD_NIB_HIGH( "007758-01.n1", 0x3800, 0x0400, CRC(b49083b4) SHA1(41999e8d3fd6104c42f3a034045f9f9c75d8247a) ) |
| 695 | | ROM_LOAD_NIB_LOW ( "007759-01.n0", 0x3800, 0x0400, CRC(542200c7) SHA1(111f06e942e247b00b9f90fae2986c3c8d9ec8c5) ) |
| 696 | | ROM_LOAD_NIB_HIGH( "007760-01.p1", 0x3c00, 0x0400, CRC(7dc2a7a1) SHA1(9d02572cf689c6476b33226a5358dd1f72c4e61d) ) |
| 697 | | ROM_LOAD_NIB_LOW ( "007761-01.p0", 0x3c00, 0x0400, CRC(04365e0d) SHA1(fefc3c04e55f1aa8c80b1e5e1e403af8698c3530) ) |
| 698 | 665 | |
| 699 | | ROM_REGION( 0x200, "gfx1", 0 ) /* tiles */ |
| 700 | | ROM_LOAD_NIB_HIGH( "007764-01.p4", 0x0000, 0x0200, CRC(e4332dc0) SHA1(1f16c5b9f9fd7d478fd729cc79968f17746111f4) ) |
| 701 | | ROM_LOAD_NIB_LOW ( "007765-01.r4", 0x0000, 0x0200, CRC(6e4e6c75) SHA1(0fc77fecaa73eac57baf778bc51387c75883aad4) ) |
| 702 | | |
| 703 | | ROM_REGION( 0x200, "gfx2", 0 ) /* sprites, not used */ |
| 704 | | ROM_FILL( 0x0000, 0x0200, 0 ) |
| 705 | | |
| 706 | | ROM_REGION( 0x0120, "proms", 0 ) |
| 707 | | ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ |
| 708 | | ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ |
| 709 | | ROM_END |
| 710 | | |
| 711 | 666 | GAME( 1978, sprint1, 0, sprint1, sprint1, sprint2_state, sprint1, ROT0, "Atari (Kee Games)", "Sprint 1", 0 ) |
| 712 | 667 | GAME( 1976, sprint2, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 1)", 0 ) |
| 713 | 668 | GAME( 1976, sprint2a, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 2)", 0 ) |
| 714 | 669 | GAME( 1976, sprint2h, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "hack", "Sprint 2 (color kit, Italy)", GAME_WRONG_COLORS ) // Italian hack, supposedly is color instead of b/w? how? |
| 715 | 670 | GAME( 1977, dominos, 0, dominos, dominos, sprint2_state, dominos, ROT0, "Atari", "Dominos", 0 ) |
| 716 | | GAME( 1977, dominos4, dominos, dominos, dominos4,sprint2_state, dominos4,ROT0, "Atari", "Dominos 4 (Cocktail)", 0 ) |
trunk/src/mess/drivers/excali64.c
| r242605 | r242606 | |
| 19 | 19 | |
| 20 | 20 | ToDo: |
| 21 | 21 | - Colours are approximate. |
| 22 | | - Disk controller, works with old wd17xx but crashes on new wd. |
| 22 | - Disk controller, using the old wd17xx because new wd crashes on loading a disk. |
| 23 | 23 | - Hardware supports 20cm and 13cm floppies, but we only support 13cm as this |
| 24 | 24 | is the only software that exists. |
| 25 | 25 | - The schematic shows the audio counter connected to 2MHz, but this produces |
| r242605 | r242606 | |
| 29 | 29 | |
| 30 | 30 | ****************************************************************************/ |
| 31 | 31 | |
| 32 | | #define NEWFDC 0 |
| 33 | | |
| 34 | | |
| 35 | 32 | #include "emu.h" |
| 36 | 33 | #include "cpu/z80/z80.h" |
| 37 | 34 | #include "video/mc6845.h" |
| 38 | 35 | #include "machine/i8251.h" |
| 39 | 36 | #include "bus/rs232/rs232.h" |
| 40 | | //#include "machine/clock.h" |
| 41 | 37 | #include "machine/pit8253.h" |
| 42 | 38 | #include "machine/i8255.h" |
| 43 | 39 | #include "bus/centronics/ctronics.h" |
| r242605 | r242606 | |
| 47 | 43 | #include "machine/z80dma.h" |
| 48 | 44 | #include "machine/rescap.h" |
| 49 | 45 | #include "machine/74123.h" |
| 50 | | #if NEWFDC |
| 51 | | #include "machine/wd_fdc.h" |
| 52 | | #include "formats/excali64_dsk.h" |
| 53 | | #else |
| 54 | 46 | #include "machine/wd17xx.h" |
| 55 | 47 | #include "imagedev/flopdrv.h" |
| 56 | 48 | #include "formats/basicdsk.h" |
| 57 | | #endif |
| 58 | 49 | |
| 59 | 50 | class excali64_state : public driver_device |
| 60 | 51 | { |
| r242605 | r242606 | |
| 70 | 61 | , m_u12(*this, "u12") |
| 71 | 62 | , m_centronics(*this, "centronics") |
| 72 | 63 | , m_fdc(*this, "fdc") |
| 73 | | #if NEWFDC |
| 74 | | , m_floppy0(*this, "fdc:0") |
| 75 | | , m_floppy1(*this, "fdc:1") |
| 76 | | #endif |
| 77 | 64 | { } |
| 78 | 65 | |
| 79 | 66 | DECLARE_PALETTE_INIT(excali64); |
| r242605 | r242606 | |
| 86 | 73 | DECLARE_WRITE8_MEMBER(porte4_w); |
| 87 | 74 | DECLARE_READ8_MEMBER(porte8_r); |
| 88 | 75 | DECLARE_WRITE8_MEMBER(portec_w); |
| 89 | | #if NEWFDC |
| 90 | | DECLARE_FLOPPY_FORMATS(floppy_formats); |
| 91 | | #endif |
| 92 | 76 | DECLARE_WRITE_LINE_MEMBER(cent_busy_w); |
| 93 | 77 | DECLARE_WRITE_LINE_MEMBER(busreq_w); |
| 94 | 78 | DECLARE_READ8_MEMBER(memory_read_byte); |
| r242605 | r242606 | |
| 119 | 103 | required_device<z80dma_device> m_dma; |
| 120 | 104 | required_device<ttl74123_device> m_u12; |
| 121 | 105 | required_device<centronics_device> m_centronics; |
| 122 | | #if NEWFDC |
| 123 | | required_device<wd2793_t> m_fdc; |
| 124 | | required_device<floppy_connector> m_floppy0; |
| 125 | | required_device<floppy_connector> m_floppy1; |
| 126 | | #else |
| 127 | 106 | required_device<wd2793_device> m_fdc; |
| 128 | | #endif |
| 129 | 107 | }; |
| 130 | 108 | |
| 131 | 109 | static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state) |
| r242605 | r242606 | |
| 151 | 129 | AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w) |
| 152 | 130 | AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r) |
| 153 | 131 | AM_RANGE(0xec, 0xef) AM_WRITE(portec_w) |
| 154 | | #if NEWFDC |
| 155 | | AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_t, read, write) |
| 156 | | #else |
| 157 | 132 | AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write) |
| 158 | | #endif |
| 159 | 133 | ADDRESS_MAP_END |
| 160 | 134 | |
| 161 | 135 | |
| r242605 | r242606 | |
| 246 | 220 | m_centronics_busy = state; |
| 247 | 221 | } |
| 248 | 222 | |
| 249 | | #if NEWFDC |
| 250 | | FLOPPY_FORMATS_MEMBER( excali64_state::floppy_formats ) |
| 251 | | FLOPPY_EXCALI64_FORMAT |
| 252 | | FLOPPY_FORMATS_END |
| 253 | | |
| 254 | | static SLOT_INTERFACE_START( excali64_floppies ) |
| 255 | | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 256 | | SLOT_INTERFACE_END |
| 257 | | #else |
| 258 | 223 | static LEGACY_FLOPPY_OPTIONS_START(excali64) |
| 259 | 224 | LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 260 | 225 | HEADS([2]) |
| r242605 | r242606 | |
| 270 | 235 | LEGACY_FLOPPY_OPTIONS_NAME(excali64), |
| 271 | 236 | NULL |
| 272 | 237 | }; |
| 273 | | #endif |
| 274 | 238 | |
| 275 | 239 | // pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off. |
| 276 | 240 | WRITE8_MEMBER( excali64_state::motor_w ) |
| 277 | 241 | { |
| 278 | 242 | m_motor = BIT(data, 0); |
| 279 | | #if NEWFDC |
| 280 | | m_floppy1->get_device()->mon_w(!m_motor); |
| 281 | | m_floppy0->get_device()->mon_w(!m_motor); |
| 282 | | #else |
| 283 | 243 | legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0); |
| 284 | 244 | flop->floppy_mon_w(!m_motor); // motor on |
| 285 | 245 | flop = subdevice<legacy_floppy_image_device>(FLOPPY_1); |
| 286 | 246 | flop->floppy_mon_w(!m_motor); // motor on |
| 287 | | #endif |
| 288 | 247 | } |
| 289 | 248 | |
| 290 | 249 | READ8_MEMBER( excali64_state::porte8_r ) |
| r242605 | r242606 | |
| 294 | 253 | |
| 295 | 254 | WRITE8_MEMBER( excali64_state::porte4_w ) |
| 296 | 255 | { |
| 297 | | #if NEWFDC |
| 298 | | floppy_image_device *floppy = NULL; |
| 299 | | if (BIT(data, 0)) |
| 300 | | floppy = m_floppy0->get_device(); |
| 301 | | |
| 302 | | if (BIT(data, 1)) |
| 303 | | floppy = m_floppy1->get_device(); |
| 304 | | |
| 305 | | m_fdc->set_floppy(floppy); |
| 306 | | if (floppy) |
| 307 | | floppy->ss_w(BIT(data, 4)); |
| 308 | | |
| 309 | | #else |
| 310 | 256 | if BIT(data, 0) |
| 311 | 257 | m_fdc->set_drive(0); |
| 312 | 258 | |
| r242605 | r242606 | |
| 314 | 260 | m_fdc->set_drive(1); |
| 315 | 261 | |
| 316 | 262 | m_fdc->set_side(BIT(data, 4)); |
| 317 | | #endif |
| 318 | 263 | |
| 319 | 264 | m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse |
| 320 | 265 | } |
| r242605 | r242606 | |
| 326 | 271 | */ |
| 327 | 272 | WRITE8_MEMBER( excali64_state::portec_w ) |
| 328 | 273 | { |
| 329 | | #if NEWFDC |
| 330 | | m_fdc->dden_w(BIT(data, 2)); |
| 331 | | #else |
| 332 | 274 | m_fdc->dden_w(!BIT(data, 2)); |
| 333 | | #endif |
| 334 | 275 | } |
| 335 | 276 | |
| 336 | 277 | WRITE_LINE_MEMBER( excali64_state::busreq_w ) |
| r242605 | r242606 | |
| 651 | 592 | |
| 652 | 593 | /* Devices */ |
| 653 | 594 | MCFG_CASSETTE_ADD( "cassette" ) |
| 654 | | #if NEWFDC |
| 655 | | MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16) |
| 656 | | MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 657 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "525dd", excali64_state::floppy_formats) |
| 658 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", excali64_state::floppy_formats) |
| 659 | | #else |
| 660 | 595 | MCFG_DEVICE_ADD("fdc", WD2793, 0) |
| 661 | 596 | MCFG_WD17XX_DEFAULT_DRIVE2_TAGS |
| 662 | 597 | MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 663 | 598 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface) |
| 664 | | #endif |
| 599 | |
| 665 | 600 | MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4) |
| 666 | 601 | MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w)) |
| 667 | 602 | MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte)) |
trunk/src/mess/drivers/tispeak.c
| r242605 | r242606 | |
| 5 | 5 | Texas Instruments Speak & Spell hardware |
| 6 | 6 | |
| 7 | 7 | (still need to write notes here..) |
| 8 | | |
| 9 | | Other stuff on similar hardware: |
| 10 | | - Language Tutor/Translator |
| 11 | | - Touch & Tell, but it runs on a TMS1100! |
| 12 | | - Speak & Spell Compact, Speak & Write (UK version), TMS1100? TMS0980? |
| 13 | | - Speak & Read |
| 14 | 8 | |
| 15 | 9 | ***************************************************************************/ |
| 16 | 10 | |
| r242605 | r242606 | |
| 24 | 18 | #include "tispeak.lh" |
| 25 | 19 | |
| 26 | 20 | // The master clock is a single stage RC oscillator into TMS5100 RCOSC: |
| 27 | | // In an early 1979 Speak & Spell, C is 68pf, R is a 50kohm trimpot which is set to around 33.6kohm |
| 28 | | // (measured in-circuit). CPUCLK is this osc freq /2, ROMCLK is this osc freq /4. |
| 21 | // C is 68pf, R is a 50kohm trimpot wich is set to 33.6kohm. CPUCLK is this/2, ROMCLK is this/4. |
| 29 | 22 | // The typical osc freq curve for TMS5100 is unknown. Let's assume it is set to the default frequency, |
| 30 | | // which is 640kHz for 8KHz according to the TMS5100 documentation. |
| 23 | // which is 640kHz according to the TMS5100 documentation. |
| 31 | 24 | |
| 32 | 25 | #define MASTER_CLOCK (640000) |
| 33 | 26 | |
| r242605 | r242606 | |
| 461 | 454 | |
| 462 | 455 | ROM_START( snspell ) |
| 463 | 456 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 464 | | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // typed in from patent 4189779, may have errors |
| 457 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // placeholder, use the one we have |
| 465 | 458 | |
| 466 | 459 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 467 | 460 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| r242605 | r242606 | |
| 490 | 483 | ROM_LOAD( "cd2350a.vsm", 0x0000, 0x4000, CRC(2adda742) SHA1(3f868ed8284b723c815a30343057e03467c043b5) ) |
| 491 | 484 | ROM_END |
| 492 | 485 | |
| 486 | ROM_START( snspellp ) |
| 487 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 488 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // typed in from patent 4189779, may have errors |
| 489 | |
| 490 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 491 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 492 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 493 | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as tmc0271 |
| 494 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 495 | ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) |
| 496 | |
| 497 | ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge |
| 498 | ROM_LOAD( "tmc0351.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) ) |
| 499 | ROM_LOAD( "tmc0352.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) ) |
| 500 | ROM_END |
| 501 | |
| 493 | 502 | ROM_START( snspelluk ) |
| 494 | 503 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 495 | 504 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // placeholder, use the one we have |
| r242605 | r242606 | |
| 540 | 549 | |
| 541 | 550 | ROM_START( snmath ) |
| 542 | 551 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 543 | | // typed in from patent 4946391, verified with source code (mark BAD_DUMP just to be unsure) |
| 544 | | // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too. |
| 545 | | ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) |
| 552 | ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) // placeholder, use the one we have |
| 546 | 553 | |
| 547 | 554 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 548 | 555 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 549 | 556 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 550 | | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as cd2704 |
| 557 | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // placeholder, use the one we have |
| 551 | 558 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 552 | | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " |
| 559 | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // placeholder, use the one we have |
| 553 | 560 | |
| 554 | 561 | ROM_REGION( 0x8000, "tms6100", 0 ) |
| 555 | 562 | ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) |
| r242605 | r242606 | |
| 575 | 582 | ROM_RELOAD( 0x7000, 0x1000 ) |
| 576 | 583 | ROM_END |
| 577 | 584 | |
| 585 | ROM_START( snmathp ) |
| 586 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 587 | // typed in from patent 4946391, verified with source code (mark BAD_DUMP just to be unsure) |
| 588 | // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too. |
| 589 | ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) |
| 578 | 590 | |
| 591 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 592 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 593 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 594 | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as cd2704 |
| 595 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 596 | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " |
| 579 | 597 | |
| 580 | | COMP( 1978, snspell, 0, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 |
| 598 | ROM_REGION( 0x8000, "tms6100", 0 ) |
| 599 | ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) |
| 600 | ROM_LOAD( "cd2393.vsm", 0x4000, 0x4000, CRC(571d5b5a) SHA1(83284755d9b77267d320b5b87fdc39f352433715) ) |
| 601 | ROM_END |
| 602 | |
| 603 | |
| 604 | |
| 605 | COMP( 1978, snspell, 0, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 581 | 606 | COMP( 1980, snspella, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 607 | COMP( 1978, snspellp, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US prototype)", GAME_IMPERFECT_SOUND ) |
| 582 | 608 | COMP( 1978, snspelluk, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (UK set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 583 | 609 | COMP( 1981, snspelluka, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (UK set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // different voice actor |
| 584 | | COMP( 1980, ladictee, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "La Dictee Magnifique (France)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // doesn't work due to missing CD2702 MCU dump, German version has CD2702 too |
| 610 | COMP( 1980, ladictee, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "La Dictee Magnifique (France)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // doesn't work, custom MCU ROM? |
| 585 | 611 | |
| 586 | | COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 |
| 612 | COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 587 | 613 | COMP( 1986, snmatha, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 614 | COMP( 1980, snmathp, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US prototype)", GAME_IMPERFECT_SOUND ) |