trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242606 | r242607 | |
| 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 | |
| 39 | 50 | m_icount--; |
| 40 | 51 | } |
| 41 | 52 | |
| r242606 | r242607 | |
| 129 | 140 | #define PC_ALIGNED32 \ |
| 130 | 141 | (m_pc&0xfffffffc) |
| 131 | 142 | |
| 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 | } |
| 132 | 180 | |
| 181 | return -1; |
| 182 | |
| 183 | } |
| 184 | |
| 185 | |
| 133 | 186 | ARCOMPACT_RETTYPE arcompact_device::get_insruction(OPS_32) |
| 134 | 187 | { |
| 135 | 188 | UINT8 instruction = ARCOMPACT_OPERATION; |
| r242606 | r242607 | |
| 1101 | 1154 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00_00(OPS_32) |
| 1102 | 1155 | { |
| 1103 | 1156 | int size = 4; |
| 1157 | |
| 1158 | COMMON32_GET_CONDITION |
| 1159 | |
| 1160 | if (!check_condition(condition)) |
| 1161 | return m_pc + (size>>0); |
| 1162 | |
| 1104 | 1163 | // Branch Conditionally |
| 1105 | | arcompact_log("unimplemented Bcc %08x", op); |
| 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 | |
| 1106 | 1185 | return m_pc + (size>>0); |
| 1107 | 1186 | } |
| 1108 | 1187 | |
| r242606 | r242607 | |
| 1422 | 1501 | return m_pc + (size>>0); |
| 1423 | 1502 | } |
| 1424 | 1503 | |
| 1425 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_04(OPS_32) { return arcompact_01_01_01_helper(PARAMS, "BRLO"); } |
| 1504 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_04(OPS_32) // register - immediate BRLO |
| 1505 | { |
| 1506 | BR_REGIMM_SETUP |
| 1426 | 1507 | |
| 1508 | // BRLO (unsigned operation) |
| 1509 | if (b < c) |
| 1510 | { |
| 1511 | BR_TAKEJUMP |
| 1512 | } |
| 1513 | |
| 1514 | return m_pc + (size>>0); |
| 1515 | |
| 1516 | } |
| 1517 | |
| 1427 | 1518 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_05(OPS_32) // register - immediate BRHS |
| 1428 | 1519 | { |
| 1429 | 1520 | BR_REGIMM_SETUP |
| r242606 | r242607 | |
| 1761 | 1852 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0d], /*"RCMP"*/ 1,0); |
| 1762 | 1853 | } |
| 1763 | 1854 | |
| 1764 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e(OPS_32) |
| 1765 | | { |
| 1766 | | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0e], /*"RSUB"*/ 0,0); |
| 1767 | | } |
| 1768 | 1855 | |
| 1769 | 1856 | |
| 1770 | 1857 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_10(OPS_32) |
| r242606 | r242607 | |
| 1782 | 1869 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x12], /*"BXOR"*/ 0,0); |
| 1783 | 1870 | } |
| 1784 | 1871 | |
| 1785 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13(OPS_32) |
| 1786 | | { |
| 1787 | | return arcompact_handle04_helper(PARAMS, opcodes_04[0x13], /*"BMSK"*/ 0,0); |
| 1788 | | } |
| 1789 | 1872 | |
| 1790 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14(OPS_32) |
| 1791 | | { |
| 1792 | | return arcompact_handle04_helper(PARAMS, opcodes_04[0x14], /*"ADD1"*/ 0,0); |
| 1793 | | } |
| 1794 | 1873 | |
| 1795 | 1874 | |
| 1796 | 1875 | |
| 1797 | 1876 | |
| 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 | | |
| 1813 | 1877 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1a(OPS_32) |
| 1814 | 1878 | { |
| 1815 | 1879 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1a], /*"MPY"*/ 0,0); |
| r242606 | r242607 | |
| 1837 | 1901 | int got_limm = 0; |
| 1838 | 1902 | |
| 1839 | 1903 | COMMON32_GET_creg |
| 1904 | COMMON32_GET_F |
| 1840 | 1905 | |
| 1841 | 1906 | if (creg == LIMM_REG) |
| 1842 | 1907 | { |
| r242606 | r242607 | |
| 1858 | 1923 | // J.F [ilink1] 0010 0RRR 0010 0000 1RRR 0111 01RR RRRR (creg = ILINK1, FLAG must be set) |
| 1859 | 1924 | // J.F [ilink2] 0010 0RRR 0010 0000 1RRR 0111 10RR RRRR (creg = ILINE2, FLAG must be set) |
| 1860 | 1925 | |
| 1861 | | arcompact_log("unimplemented J %08x", op); |
| 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 | } |
| 1862 | 1952 | } |
| 1863 | 1953 | |
| 1864 | 1954 | return m_pc + (size>>0); |
| r242606 | r242607 | |
| 1869 | 1959 | // opcode iiii i--- ppII IIII F--- uuuu uu-- ---- |
| 1870 | 1960 | // J u6 0010 0RRR 0110 0000 0RRR uuuu uuRR RRRR |
| 1871 | 1961 | int size = 4; |
| 1872 | | arcompact_log("unimplemented J %08x", op); |
| 1962 | arcompact_log("2 unimplemented J %08x", op); |
| 1873 | 1963 | return m_pc + (size>>0); |
| 1874 | 1964 | } |
| 1875 | 1965 | |
| r242606 | r242607 | |
| 1878 | 1968 | // opcode iiii i--- ppII IIII F--- ssss ssSS SSSS |
| 1879 | 1969 | // J s12 0010 0RRR 1010 0000 0RRR ssss ssSS SSSS |
| 1880 | 1970 | int size = 4; |
| 1881 | | arcompact_log("unimplemented J %08x", op); |
| 1971 | arcompact_log("3 unimplemented J %08x", op); |
| 1882 | 1972 | return m_pc + (size>>0); |
| 1883 | 1973 | } |
| 1884 | 1974 | |
| 1885 | 1975 | |
| 1886 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) |
| 1976 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) // Jcc (no link, no delay) |
| 1887 | 1977 | { |
| 1888 | 1978 | int size = 4; |
| 1889 | | // UINT32 limm = 0; |
| 1979 | UINT32 limm = 0; |
| 1890 | 1980 | int got_limm = 0; |
| 1891 | 1981 | |
| 1892 | 1982 | COMMON32_GET_creg |
| 1983 | COMMON32_GET_CONDITION; |
| 1984 | COMMON32_GET_F |
| 1893 | 1985 | |
| 1986 | UINT32 c = 0; |
| 1987 | |
| 1894 | 1988 | if (creg == LIMM_REG) |
| 1895 | 1989 | { |
| 1896 | 1990 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1897 | 1991 | // Jcc limm 0010 0RRR 1110 0000 0RRR 1111 100Q QQQQ [LIUMM] |
| 1898 | 1992 | if (!got_limm) |
| 1899 | 1993 | { |
| 1900 | | //GET_LIMM_32; |
| 1994 | GET_LIMM_32; |
| 1901 | 1995 | size = 8; |
| 1902 | 1996 | } |
| 1903 | 1997 | |
| 1904 | | arcompact_log("unimplemented J %08x", op); |
| 1998 | c = limm; |
| 1999 | |
| 1905 | 2000 | } |
| 1906 | 2001 | else |
| 1907 | 2002 | { |
| 1908 | 2003 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1909 | 2004 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 1910 | 2005 | // no conditional links to ILINK1, ILINK2? |
| 1911 | | arcompact_log("unimplemented J %08x", op); |
| 2006 | |
| 2007 | c = m_regs[creg]; |
| 1912 | 2008 | } |
| 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 | |
| 1913 | 2044 | return m_pc + (size>>0); |
| 1914 | 2045 | } |
| 1915 | 2046 | |
| r242606 | r242607 | |
| 1918 | 2049 | // opcode iiii i--- ppII IIII F--- uuuu uumq qqqq |
| 1919 | 2050 | // Jcc u6 0010 0RRR 1110 0000 0RRR uuuu uu1Q QQQQ |
| 1920 | 2051 | int size = 4; |
| 1921 | | arcompact_log("unimplemented J %08x", op); |
| 2052 | arcompact_log("unimplemented arcompact_handle04_20_p11_m1 J %08x (u6)", op); |
| 1922 | 2053 | return m_pc + (size>>0); |
| 1923 | 2054 | } |
| 1924 | 2055 | |
| r242606 | r242607 | |
| 1945 | 2076 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_28(OPS_32) // LPcc (loop setup) |
| 1946 | 2077 | { |
| 1947 | 2078 | int size = 4; |
| 1948 | | |
| 2079 | // COMMON32_GET_breg; // breg is reserved |
| 1949 | 2080 | COMMON32_GET_p; |
| 1950 | | |
| 2081 | |
| 1951 | 2082 | if (p == 0x00) |
| 1952 | 2083 | { |
| 2084 | arcompact_fatal("<illegal LPcc, p = 0x00)"); |
| 1953 | 2085 | } |
| 1954 | 2086 | else if (p == 0x01) |
| 1955 | 2087 | { |
| 2088 | arcompact_fatal("<illegal LPcc, p = 0x01)"); |
| 1956 | 2089 | } |
| 1957 | 2090 | else if (p == 0x02) // Loop unconditional |
| 1958 | | { |
| 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); |
| 1959 | 2096 | } |
| 1960 | 2097 | else if (p == 0x03) // Loop conditional |
| 1961 | | { |
| 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 | |
| 1962 | 2117 | } |
| 1963 | 2118 | |
| 1964 | | arcompact_log("unimplemented LPcc %08x", op); |
| 1965 | 2119 | return m_pc + (size>>0); |
| 1966 | 2120 | |
| 1967 | 2121 | } |
| r242606 | r242607 | |
| 2008 | 2162 | return m_pc + (size>>0); |
| 2009 | 2163 | } |
| 2010 | 2164 | |
| 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; |
| 2016 | 2165 | |
| 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 | | |
| 2062 | 2166 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_29(OPS_32) |
| 2063 | 2167 | { |
| 2064 | 2168 | // leapster bios uses formats for FLAG that are not defined, bug I guess work anyway (P modes 0 / 1) |
| r242606 | r242607 | |
| 2102 | 2206 | } |
| 2103 | 2207 | |
| 2104 | 2208 | |
| 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?) */ \ |
| 2127 | 2209 | |
| 2128 | | |
| 2129 | | |
| 2130 | 2210 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_00(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ASL"); } // ASL |
| 2131 | 2211 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_01(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ASR"); } // ASR |
| 2132 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "LSR"); } // LSR |
| 2212 | |
| 2133 | 2213 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ROR"); } // ROR |
| 2134 | 2214 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_04(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "RCC"); } // RCC |
| 2135 | 2215 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_05(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "SEXB"); } // SEXB |
| 2136 | 2216 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_06(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "SEXW"); } // SEXW |
| 2137 | 2217 | |
| 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 | | } |
| 2148 | 2218 | |
| 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 | | |
| 2223 | 2219 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_09(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "ABS"); } // ABS |
| 2224 | 2220 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_0a(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "NOT"); } // NOT |
| 2225 | 2221 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_0b(OPS_32) { return arcompact_handle04_2f_helper(PARAMS, "RCL"); } // RLC |
| r242606 | r242607 | |
| 2444 | 2440 | } |
| 2445 | 2441 | |
| 2446 | 2442 | |
| 2447 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_00(OPS_16) // ADD_S c, b, u3 (note, c destination) |
| 2448 | | { |
| 2449 | | int u, breg, creg; |
| 2450 | 2443 | |
| 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 | | |
| 2484 | 2444 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_03(OPS_16) |
| 2485 | 2445 | { |
| 2486 | 2446 | return arcompact_handle0d_helper(PARAMS, "ASR_S"); |
| r242606 | r242607 | |
| 2640 | 2600 | |
| 2641 | 2601 | |
| 2642 | 2602 | // Zero parameters (ZOP) |
| 2643 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_00(OPS_16) { arcompact_log("NOP_S"); return m_pc + (2 >> 0);} |
| 2603 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_00(OPS_16) { /*arcompact_log("NOP_S");*/ return m_pc + (2 >> 0);} |
| 2644 | 2604 | 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 |
| 2645 | 2605 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_04(OPS_16) { arcompact_log("JEQ_S [blink]"); return m_pc + (2 >> 0);} |
| 2646 | 2606 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07_05(OPS_16) { arcompact_log("JNE_S [blink]"); return m_pc + (2 >> 0);} |
| r242606 | r242607 | |
| 2670 | 2630 | return m_pc + (2 >> 0); |
| 2671 | 2631 | } |
| 2672 | 2632 | |
| 2673 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_02(OPS_16) // SUB_S b <- b,c |
| 2674 | | { |
| 2675 | | int breg, creg; |
| 2676 | 2633 | |
| 2677 | | COMMON16_GET_breg; |
| 2678 | | COMMON16_GET_creg; |
| 2679 | 2634 | |
| 2680 | | REG_16BIT_RANGE(breg); |
| 2681 | | REG_16BIT_RANGE(creg); |
| 2682 | 2635 | |
| 2683 | | m_regs[breg] = m_regs[breg] - m_regs[creg]; |
| 2684 | 2636 | |
| 2685 | | return m_pc + (2 >> 0); |
| 2686 | | } |
| 2687 | 2637 | |
| 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 | | |
| 2720 | 2638 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_06(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "BIC_S",0); } |
| 2721 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_07(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "XOR_S",0); } |
| 2639 | |
| 2722 | 2640 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0b(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "TST_S",1); } |
| 2723 | 2641 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0c(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "MUL64_S",2); } // actual destination is special multiply registers |
| 2724 | 2642 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0d(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "SEXB_S",0); } |
| 2725 | 2643 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0e(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "SEXW_S",0); } |
| 2726 | 2644 | |
| 2727 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0f(OPS_16) // EXTB_S |
| 2728 | | { |
| 2729 | | int breg, creg; |
| 2730 | 2645 | |
| 2731 | | COMMON16_GET_breg; |
| 2732 | | COMMON16_GET_creg; |
| 2733 | 2646 | |
| 2734 | | REG_16BIT_RANGE(breg); |
| 2735 | | REG_16BIT_RANGE(creg); |
| 2736 | 2647 | |
| 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 | | |
| 2758 | 2648 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_11(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ABS_S",0); } |
| 2759 | 2649 | 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); } |
| 2767 | 2650 | |
| 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; |
| 2771 | 2651 | |
| 2772 | | COMMON16_GET_breg; |
| 2773 | | COMMON16_GET_creg; |
| 2652 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_18(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASL_S",0); } |
| 2774 | 2653 | |
| 2775 | | REG_16BIT_RANGE(breg); |
| 2776 | | REG_16BIT_RANGE(creg); |
| 2654 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1a(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASR_S",0); } |
| 2777 | 2655 | |
| 2778 | | m_regs[breg] = m_regs[creg] << 1; |
| 2779 | 2656 | |
| 2780 | | return m_pc + (2 >> 0); |
| 2781 | | } |
| 2782 | | |
| 2783 | 2657 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1c(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "ASR1_S",0); } |
| 2784 | 2658 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1d(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "LSR1_S",0); } |
| 2785 | 2659 | |
| r242606 | r242607 | |
| 3267 | 3141 | |
| 3268 | 3142 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_00(OPS_16) { return arcompact_handle1e_03_0x_helper(PARAMS, "BGT_S"); } |
| 3269 | 3143 | 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"); } |
| 3271 | 3144 | |
| 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 | |
| 3272 | 3159 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_03(OPS_16) // BLE_S |
| 3273 | 3160 | { |
| 3274 | 3161 | if (CONDITION_LE) |
trunk/src/emu/cpu/arcompact/arcompact_make.py
| r242606 | r242607 | |
| 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 | |
| 12 | 46 | def EmitGroup04_no_Flags(f, funcname, opname): |
| 13 | 47 | print >>f, " // no flag changes" |
| 14 | 48 | |
| r242606 | r242607 | |
| 32 | 66 | flaghandler(f, funcname, opname) |
| 33 | 67 | print >>f, " }" |
| 34 | 68 | |
| 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, "{" |
| 69 | def EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler): |
| 39 | 70 | print >>f, " int size = 4;" |
| 40 | 71 | |
| 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 | | |
| 103 | 72 | if breg_is_dst_only == 0: |
| 104 | 73 | print >>f, " UINT32 limm = 0;" |
| 105 | 74 | |
| r242606 | r242607 | |
| 115 | 84 | if ignore_a == 0: |
| 116 | 85 | print >>f, " COMMON32_GET_areg;" |
| 117 | 86 | elif ignore_a == 1: |
| 118 | | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 119 | | |
| 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" |
| 120 | 92 | print >>f, " " |
| 121 | 93 | |
| 122 | 94 | print >>f, " UINT32 c;" |
| r242606 | r242607 | |
| 140 | 112 | print >>f, " c = u;" |
| 141 | 113 | print >>f, " " |
| 142 | 114 | 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?) */" |
| 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) |
| 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) |
| 152 | 119 | print >>f, "{" |
| 153 | 120 | print >>f, " int size = 4;" |
| 154 | | |
| 155 | | if breg_is_dst_only == 0: |
| 156 | | print >>f, " UINT32 limm = 0;" |
| 157 | 121 | |
| 158 | | print >>f, "/* int got_limm = 0; */" |
| 122 | print >>f, " UINT32 limm = 0;" |
| 123 | |
| 124 | print >>f, " int got_limm = 0;" |
| 159 | 125 | print >>f, " " |
| 160 | 126 | print >>f, " COMMON32_GET_breg;" |
| 161 | 127 | |
| 162 | | if flagcondition == -1: |
| 128 | if flagcondition == -1: |
| 163 | 129 | print >>f, " COMMON32_GET_F;" |
| 164 | | |
| 165 | | print >>f, " COMMON32_GET_s12;" |
| 166 | | |
| 167 | | if ignore_a == 0: |
| 130 | |
| 131 | print >>f, " COMMON32_GET_creg;" |
| 132 | |
| 133 | if ignore_a == 0: |
| 168 | 134 | print >>f, " COMMON32_GET_areg;" |
| 169 | 135 | elif ignore_a == 1: |
| 170 | | print >>f, " //COMMON32_GET_areg; // areg is reserved / not used" |
| 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, " " |
| 171 | 141 | |
| 172 | | print >>f, " " |
| 173 | 142 | print >>f, " UINT32 c;" |
| 174 | 143 | if breg_is_dst_only == 0: |
| 175 | 144 | print >>f, " UINT32 b;" |
| 176 | 145 | print >>f, " " |
| 177 | | print >>f, " /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */" |
| 178 | 146 | print >>f, " if (breg == LIMM_REG)" |
| 179 | 147 | print >>f, " {" |
| 180 | 148 | print >>f, " GET_LIMM_32;" |
| 181 | 149 | print >>f, " size = 8;" |
| 182 | | print >>f, "/* got_limm = 1; */" |
| 150 | print >>f, " got_limm = 1;" |
| 183 | 151 | print >>f, " b = limm;" |
| 184 | 152 | print >>f, " }" |
| 185 | 153 | print >>f, " else" |
| r242606 | r242607 | |
| 187 | 155 | print >>f, " b = m_regs[breg];" |
| 188 | 156 | print >>f, " }" |
| 189 | 157 | |
| 190 | | print >>f, " " |
| 191 | | print >>f, " c = (UINT32)S;" |
| 192 | 158 | 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.) */" |
| 193 | 173 | 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?) */" |
| 194 | 174 | print >>f, " %s" % (opexecute) |
| 175 | print >>f, " %s" % (opwrite) |
| 195 | 176 | print >>f, " " |
| 196 | 177 | EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler) |
| 197 | 178 | print >>f, " return m_pc + (size >> 0);" |
| 198 | 179 | print >>f, "}" |
| 199 | 180 | print >>f, "" |
| 200 | 181 | print >>f, "" |
| 201 | | # the mode 0x11 m0 handler |
| 202 | | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m0(OPS_32)" % (funcname) |
| 182 | # the mode 0x01 handler |
| 183 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p01(OPS_32)" % (funcname) |
| 203 | 184 | print >>f, "{" |
| 204 | | print >>f, " int size = 4;" |
| 205 | | print >>f, " arcompact_fatal(\"arcompact_handle%s_p11_m0 (%s)\\n\");" % (funcname, opname) |
| 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) |
| 206 | 190 | print >>f, " return m_pc + (size >> 0);" |
| 207 | 191 | print >>f, "}" |
| 208 | 192 | print >>f, "" |
| 209 | | 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, "" |
| 210 | 265 | # the mode 0x11 m1 handler |
| 211 | 266 | 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) |
| 212 | 293 | print >>f, "{" |
| 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);" |
| 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);" |
| 216 | 307 | 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;" |
| 217 | 315 | print >>f, "" |
| 316 | print >>f, " COMMON16_GET_breg;" |
| 317 | print >>f, " COMMON16_GET_creg;" |
| 218 | 318 | 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, "}" |
| 219 | 327 | |
| 328 | |
| 220 | 329 | # xxx_S b, b, u5 format opcodes |
| 221 | 330 | def EmitGroup17(f,funcname, opname, opexecute): |
| 222 | 331 | print >>f, "ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)" % (funcname) |
| r242606 | r242607 | |
| 244 | 353 | sys.exit(1) |
| 245 | 354 | |
| 246 | 355 | |
| 247 | | EmitGroup04(f, "04_00", "ADD", "UINT32 result = b + c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 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 ) |
| 248 | 357 | |
| 249 | | EmitGroup04(f, "04_02", "SUB", "UINT32 result = b - c; m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 358 | EmitGroup04(f, "04_02", "SUB", "UINT32 result = b - c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 250 | 359 | |
| 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 ) |
| 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 ) |
| 255 | 364 | |
| 256 | | EmitGroup04(f, "04_0a", "MOV", "UINT32 result = c; m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) |
| 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 |
| 257 | 366 | |
| 258 | | EmitGroup04(f, "04_0f", "BSET", "UINT32 result = b | (1 << (c & 0x1f)); m_regs[areg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) |
| 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 ) |
| 259 | 369 | |
| 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 ) |
| 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 ) |
| 262 | 371 | |
| 263 | 372 | |
| 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 ) |
| 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 ) |
| 266 | 379 | |
| 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 | |
| 267 | 414 | # xxx_S b, b, u5 format opcodes |
| 268 | 415 | EmitGroup17(f, "17_00", "ASL_S", "m_regs[breg] = m_regs[breg] << (u&0x1f);" ) |
| 269 | 416 | EmitGroup17(f, "17_01", "LSR_S", "m_regs[breg] = m_regs[breg] >> (u&0x1f);" ) |
trunk/src/mame/drivers/sbrkout.c
| r242606 | r242607 | |
| 6 | 6 | |
| 7 | 7 | Games supported: |
| 8 | 8 | * Super Breakout |
| 9 | | * Super Breakout (Canyon and Vertical Breakout, prototype) - built from original source code |
| 9 | * Super Breakout (Canyon and Vertical Breakout, prototype) |
| 10 | * Super Breakout (Cocktail, prototype) |
| 10 | 11 | |
| 11 | 12 | Known issues: |
| 12 | 13 | * none at this time |
| r242606 | r242607 | |
| 59 | 60 | UINT8 m_pot_trigger[2]; |
| 60 | 61 | DECLARE_WRITE8_MEMBER(irq_ack_w); |
| 61 | 62 | DECLARE_READ8_MEMBER(switches_r); |
| 63 | DECLARE_READ8_MEMBER(sbrkoutct_switches_r); |
| 62 | 64 | DECLARE_WRITE8_MEMBER(pot_mask1_w); |
| 63 | 65 | DECLARE_WRITE8_MEMBER(pot_mask2_w); |
| 64 | 66 | DECLARE_WRITE8_MEMBER(start_1_led_w); |
| 65 | 67 | DECLARE_WRITE8_MEMBER(start_2_led_w); |
| 66 | 68 | DECLARE_WRITE8_MEMBER(serve_led_w); |
| 69 | DECLARE_WRITE8_MEMBER(serve_2_led_w); |
| 67 | 70 | DECLARE_WRITE8_MEMBER(coincount_w); |
| 68 | 71 | DECLARE_READ8_MEMBER(sync_r); |
| 69 | 72 | DECLARE_READ8_MEMBER(sync2_r); |
| r242606 | r242607 | |
| 212 | 215 | return result; |
| 213 | 216 | } |
| 214 | 217 | |
| 218 | READ8_MEMBER(sbrkout_state::sbrkoutct_switches_r) |
| 219 | { |
| 220 | UINT8 result = 0xff; |
| 215 | 221 | |
| 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 | |
| 216 | 236 | void sbrkout_state::update_nmi_state() |
| 217 | 237 | { |
| 218 | 238 | if ((m_pot_trigger[0] & ~m_pot_mask[0]) | (m_pot_trigger[1] & ~m_pot_mask[1])) |
| r242606 | r242607 | |
| 275 | 295 | output_set_led_value(0, ~offset & 1); |
| 276 | 296 | } |
| 277 | 297 | |
| 298 | WRITE8_MEMBER(sbrkout_state::serve_2_led_w) |
| 299 | { |
| 300 | output_set_led_value(1, ~offset & 1); |
| 301 | } |
| 278 | 302 | |
| 279 | 303 | WRITE8_MEMBER(sbrkout_state::coincount_w) |
| 280 | 304 | { |
| r242606 | r242607 | |
| 387 | 411 | AM_RANGE(0x2800, 0x3fff) AM_ROM |
| 388 | 412 | ADDRESS_MAP_END |
| 389 | 413 | |
| 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 |
| 390 | 435 | |
| 391 | 436 | |
| 392 | 437 | /************************************* |
| r242606 | r242607 | |
| 475 | 520 | PORT_CONFSETTING( 0x02, "Vertical" ) |
| 476 | 521 | INPUT_PORTS_END |
| 477 | 522 | |
| 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 | |
| 478 | 536 | /************************************* |
| 479 | 537 | * |
| 480 | 538 | * Graphics definitions |
| r242606 | r242607 | |
| 543 | 601 | MACHINE_CONFIG_END |
| 544 | 602 | |
| 545 | 603 | |
| 604 | static MACHINE_CONFIG_DERIVED(sbrkoutct, sbrkout) |
| 605 | MCFG_CPU_MODIFY("maincpu") |
| 606 | MCFG_CPU_PROGRAM_MAP(sbrkoutct_main_map) |
| 607 | MACHINE_CONFIG_END |
| 546 | 608 | |
| 547 | 609 | /************************************* |
| 548 | 610 | * |
| r242606 | r242607 | |
| 598 | 660 | ROM_LOAD( "006401.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* memory mapper */ |
| 599 | 661 | ROM_END |
| 600 | 662 | |
| 601 | | ROM_START( sbrkoutc ) |
| 663 | ROM_START( sbrkoutc ) // built from original Atari source code |
| 602 | 664 | ROM_REGION( 0x4000, "maincpu", 0 ) |
| 603 | 665 | ROM_LOAD( "a33443.bin", 0x2800, 0x1800, CRC(bf418976) SHA1(d766e220a284a7b9caf876207e8191aff0497a03) ) |
| 604 | 666 | |
| r242606 | r242607 | |
| 614 | 676 | ROM_LOAD( "006401.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* memory mapper */ |
| 615 | 677 | ROM_END |
| 616 | 678 | |
| 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) ) |
| 617 | 684 | |
| 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 | |
| 618 | 697 | /************************************* |
| 619 | 698 | * |
| 620 | 699 | * Game drivers |
| 621 | 700 | * |
| 622 | 701 | *************************************/ |
| 623 | 702 | |
| 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 ) |
| 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 ) |
trunk/src/mame/drivers/sprint2.c
| r242606 | r242607 | |
| 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 | |
| 42 | 50 | int sprint2_state::service_mode() |
| 43 | 51 | { |
| 44 | 52 | UINT8 v = ioport("INB")->read(); |
| r242606 | r242607 | |
| 234 | 242 | set_led_status(machine(), 1, offset & 1); |
| 235 | 243 | } |
| 236 | 244 | |
| 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 | } |
| 237 | 253 | |
| 238 | 254 | static ADDRESS_MAP_START( sprint2_map, AS_PROGRAM, 8, sprint2_state ) |
| 255 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 239 | 256 | AM_RANGE(0x0000, 0x03ff) AM_READWRITE(sprint2_wram_r,sprint2_wram_w) |
| 240 | 257 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sprint2_video_ram_w) AM_SHARE("video_ram") |
| 241 | 258 | AM_RANGE(0x0818, 0x081f) AM_READ(sprint2_input_A_r) |
| r242606 | r242607 | |
| 261 | 278 | AM_RANGE(0x1400, 0x17ff) AM_READ(sprint2_collision2_r) |
| 262 | 279 | AM_RANGE(0x1800, 0x1800) AM_READNOP /* debugger ROM location? */ |
| 263 | 280 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 264 | | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 265 | 281 | ADDRESS_MAP_END |
| 266 | 282 | |
| 267 | 283 | |
| r242606 | r242607 | |
| 441 | 457 | PORT_ADJUSTER( 50, "R23 - Tone Freq" ) |
| 442 | 458 | INPUT_PORTS_END |
| 443 | 459 | |
| 460 | static INPUT_PORTS_START( dominos4 ) |
| 461 | PORT_INCLUDE(dominos) |
| 444 | 462 | |
| 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 | |
| 445 | 487 | static const gfx_layout tile_layout = |
| 446 | 488 | { |
| 447 | 489 | 16, 8, |
| r242606 | r242607 | |
| 542 | 584 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 543 | 585 | MACHINE_CONFIG_END |
| 544 | 586 | |
| 545 | | |
| 546 | 587 | ROM_START( sprint1 ) |
| 547 | 588 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 548 | 589 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 549 | | ROM_RELOAD( 0xe000, 0x0800 ) |
| 550 | 590 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 551 | | ROM_RELOAD( 0xe800, 0x0800 ) |
| 552 | 591 | ROM_LOAD( "6442-01.d1", 0x3000, 0x0800, CRC(e9ff0124) SHA1(42fe028e2e595573ccc0821de3bb6970364c585d) ) |
| 553 | | ROM_RELOAD( 0xf000, 0x0800 ) |
| 554 | 592 | ROM_LOAD( "6443-01.e1", 0x3800, 0x0800, CRC(d6bb00d0) SHA1(cdcd4bb7b32be7a11480d3312fcd8d536e2d0caf) ) |
| 555 | | ROM_RELOAD( 0xf800, 0x0800 ) |
| 556 | 593 | |
| 557 | 594 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 558 | 595 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242606 | r242607 | |
| 571 | 608 | ROM_START( sprint2 ) |
| 572 | 609 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 573 | 610 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 574 | | ROM_RELOAD( 0xe000, 0x0800 ) |
| 575 | 611 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 576 | | ROM_RELOAD( 0xe800, 0x0800 ) |
| 577 | 612 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 578 | | ROM_RELOAD( 0xf000, 0x0800 ) |
| 579 | 613 | ROM_LOAD( "6405.e1", 0x3800, 0x0800, CRC(6c991c80) SHA1(c30a5b340f05dd702c7a186eb62607a48fa19f72) ) |
| 580 | | ROM_RELOAD( 0xf800, 0x0800 ) |
| 581 | 614 | |
| 582 | 615 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 583 | 616 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242606 | r242607 | |
| 596 | 629 | ROM_START( sprint2a ) |
| 597 | 630 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 598 | 631 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 599 | | ROM_RELOAD( 0xe000, 0x0800 ) |
| 600 | 632 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 601 | | ROM_RELOAD( 0xe800, 0x0800 ) |
| 602 | 633 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 603 | | ROM_RELOAD( 0xf000, 0x0800 ) |
| 604 | 634 | ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(e80fd249) SHA1(7bcf7dfd72ca83fdd80593eaf392570da1f71298) ) |
| 605 | | ROM_RELOAD( 0xf800, 0x0800 ) |
| 606 | 635 | |
| 607 | 636 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 608 | 637 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242606 | r242607 | |
| 621 | 650 | ROM_START( sprint2h ) |
| 622 | 651 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 623 | 652 | ROM_LOAD( "6290-01.b1", 0x2000, 0x0800, CRC(41fc985e) SHA1(7178846480cbf8d15955ccd987d0b0e902ab9f90) ) |
| 624 | | ROM_RELOAD( 0xe000, 0x0800 ) |
| 625 | 653 | ROM_LOAD( "6291-01.c1", 0x2800, 0x0800, CRC(07f7a920) SHA1(845f65d2bd290eb295ca6bae2575f27aaa08c0dd) ) |
| 626 | | ROM_RELOAD( 0xe800, 0x0800 ) |
| 627 | 654 | ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) |
| 628 | | ROM_RELOAD( 0xf000, 0x0800 ) |
| 629 | 655 | ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(6de291f1) SHA1(00c2826011d80ac0784649a7bc156a97c26565fd) ) // sldh |
| 630 | | ROM_RELOAD( 0xf800, 0x0800 ) |
| 631 | 656 | |
| 632 | 657 | ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ |
| 633 | 658 | ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) |
| r242606 | r242607 | |
| 646 | 671 | ROM_START( dominos ) |
| 647 | 672 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 648 | 673 | ROM_LOAD( "7352-02.d1", 0x3000, 0x0800, CRC(738b4413) SHA1(3a90ab25bb5f65504692f97da43f03e21392dcd8) ) |
| 649 | | ROM_RELOAD( 0xf000, 0x0800 ) |
| 650 | 674 | ROM_LOAD( "7438-02.e1", 0x3800, 0x0800, CRC(c84e54e2) SHA1(383b388a1448a195f28352fc5e4ff1a2af80cc95) ) |
| 651 | | ROM_RELOAD( 0xf800, 0x0800 ) |
| 652 | 675 | |
| 653 | 676 | ROM_REGION( 0x200, "gfx1", 0 ) /* tiles */ |
| 654 | 677 | ROM_LOAD_NIB_HIGH( "7439-01.p4", 0x0000, 0x0200, CRC(4f42fdd6) SHA1(f8ea4b582e26cad37b746174cdc9f1c7ae0819c3) ) |
| r242606 | r242607 | |
| 662 | 685 | ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ |
| 663 | 686 | ROM_END |
| 664 | 687 | |
| 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) ) |
| 665 | 698 | |
| 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 | |
| 666 | 711 | GAME( 1978, sprint1, 0, sprint1, sprint1, sprint2_state, sprint1, ROT0, "Atari (Kee Games)", "Sprint 1", 0 ) |
| 667 | 712 | GAME( 1976, sprint2, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 1)", 0 ) |
| 668 | 713 | GAME( 1976, sprint2a, sprint1, sprint2, sprint2, sprint2_state, sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 2)", 0 ) |
| 669 | 714 | 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? |
| 670 | 715 | 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
| r242606 | r242607 | |
| 19 | 19 | |
| 20 | 20 | ToDo: |
| 21 | 21 | - Colours are approximate. |
| 22 | | - Disk controller, using the old wd17xx because new wd crashes on loading a disk. |
| 22 | - Disk controller, works with old wd17xx but crashes on new wd. |
| 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 |
| r242606 | r242607 | |
| 29 | 29 | |
| 30 | 30 | ****************************************************************************/ |
| 31 | 31 | |
| 32 | #define NEWFDC 0 |
| 33 | |
| 34 | |
| 32 | 35 | #include "emu.h" |
| 33 | 36 | #include "cpu/z80/z80.h" |
| 34 | 37 | #include "video/mc6845.h" |
| 35 | 38 | #include "machine/i8251.h" |
| 36 | 39 | #include "bus/rs232/rs232.h" |
| 40 | //#include "machine/clock.h" |
| 37 | 41 | #include "machine/pit8253.h" |
| 38 | 42 | #include "machine/i8255.h" |
| 39 | 43 | #include "bus/centronics/ctronics.h" |
| r242606 | r242607 | |
| 43 | 47 | #include "machine/z80dma.h" |
| 44 | 48 | #include "machine/rescap.h" |
| 45 | 49 | #include "machine/74123.h" |
| 50 | #if NEWFDC |
| 51 | #include "machine/wd_fdc.h" |
| 52 | #include "formats/excali64_dsk.h" |
| 53 | #else |
| 46 | 54 | #include "machine/wd17xx.h" |
| 47 | 55 | #include "imagedev/flopdrv.h" |
| 48 | 56 | #include "formats/basicdsk.h" |
| 57 | #endif |
| 49 | 58 | |
| 50 | 59 | class excali64_state : public driver_device |
| 51 | 60 | { |
| r242606 | r242607 | |
| 61 | 70 | , m_u12(*this, "u12") |
| 62 | 71 | , m_centronics(*this, "centronics") |
| 63 | 72 | , m_fdc(*this, "fdc") |
| 73 | #if NEWFDC |
| 74 | , m_floppy0(*this, "fdc:0") |
| 75 | , m_floppy1(*this, "fdc:1") |
| 76 | #endif |
| 64 | 77 | { } |
| 65 | 78 | |
| 66 | 79 | DECLARE_PALETTE_INIT(excali64); |
| r242606 | r242607 | |
| 73 | 86 | DECLARE_WRITE8_MEMBER(porte4_w); |
| 74 | 87 | DECLARE_READ8_MEMBER(porte8_r); |
| 75 | 88 | DECLARE_WRITE8_MEMBER(portec_w); |
| 89 | #if NEWFDC |
| 90 | DECLARE_FLOPPY_FORMATS(floppy_formats); |
| 91 | #endif |
| 76 | 92 | DECLARE_WRITE_LINE_MEMBER(cent_busy_w); |
| 77 | 93 | DECLARE_WRITE_LINE_MEMBER(busreq_w); |
| 78 | 94 | DECLARE_READ8_MEMBER(memory_read_byte); |
| r242606 | r242607 | |
| 103 | 119 | required_device<z80dma_device> m_dma; |
| 104 | 120 | required_device<ttl74123_device> m_u12; |
| 105 | 121 | 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 |
| 106 | 127 | required_device<wd2793_device> m_fdc; |
| 128 | #endif |
| 107 | 129 | }; |
| 108 | 130 | |
| 109 | 131 | static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state) |
| r242606 | r242607 | |
| 129 | 151 | AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w) |
| 130 | 152 | AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r) |
| 131 | 153 | 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 |
| 132 | 157 | AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write) |
| 158 | #endif |
| 133 | 159 | ADDRESS_MAP_END |
| 134 | 160 | |
| 135 | 161 | |
| r242606 | r242607 | |
| 220 | 246 | m_centronics_busy = state; |
| 221 | 247 | } |
| 222 | 248 | |
| 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 |
| 223 | 258 | static LEGACY_FLOPPY_OPTIONS_START(excali64) |
| 224 | 259 | LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 225 | 260 | HEADS([2]) |
| r242606 | r242607 | |
| 235 | 270 | LEGACY_FLOPPY_OPTIONS_NAME(excali64), |
| 236 | 271 | NULL |
| 237 | 272 | }; |
| 273 | #endif |
| 238 | 274 | |
| 239 | 275 | // pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off. |
| 240 | 276 | WRITE8_MEMBER( excali64_state::motor_w ) |
| 241 | 277 | { |
| 242 | 278 | 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 |
| 243 | 283 | legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0); |
| 244 | 284 | flop->floppy_mon_w(!m_motor); // motor on |
| 245 | 285 | flop = subdevice<legacy_floppy_image_device>(FLOPPY_1); |
| 246 | 286 | flop->floppy_mon_w(!m_motor); // motor on |
| 287 | #endif |
| 247 | 288 | } |
| 248 | 289 | |
| 249 | 290 | READ8_MEMBER( excali64_state::porte8_r ) |
| r242606 | r242607 | |
| 253 | 294 | |
| 254 | 295 | WRITE8_MEMBER( excali64_state::porte4_w ) |
| 255 | 296 | { |
| 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 |
| 256 | 310 | if BIT(data, 0) |
| 257 | 311 | m_fdc->set_drive(0); |
| 258 | 312 | |
| r242606 | r242607 | |
| 260 | 314 | m_fdc->set_drive(1); |
| 261 | 315 | |
| 262 | 316 | m_fdc->set_side(BIT(data, 4)); |
| 317 | #endif |
| 263 | 318 | |
| 264 | 319 | m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse |
| 265 | 320 | } |
| r242606 | r242607 | |
| 271 | 326 | */ |
| 272 | 327 | WRITE8_MEMBER( excali64_state::portec_w ) |
| 273 | 328 | { |
| 329 | #if NEWFDC |
| 330 | m_fdc->dden_w(BIT(data, 2)); |
| 331 | #else |
| 274 | 332 | m_fdc->dden_w(!BIT(data, 2)); |
| 333 | #endif |
| 275 | 334 | } |
| 276 | 335 | |
| 277 | 336 | WRITE_LINE_MEMBER( excali64_state::busreq_w ) |
| r242606 | r242607 | |
| 592 | 651 | |
| 593 | 652 | /* Devices */ |
| 594 | 653 | 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 |
| 595 | 660 | MCFG_DEVICE_ADD("fdc", WD2793, 0) |
| 596 | 661 | MCFG_WD17XX_DEFAULT_DRIVE2_TAGS |
| 597 | 662 | MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 598 | 663 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface) |
| 599 | | |
| 664 | #endif |
| 600 | 665 | MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4) |
| 601 | 666 | MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w)) |
| 602 | 667 | MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte)) |
trunk/src/mess/drivers/tispeak.c
| r242606 | r242607 | |
| 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 |
| 8 | 14 | |
| 9 | 15 | ***************************************************************************/ |
| 10 | 16 | |
| r242606 | r242607 | |
| 18 | 24 | #include "tispeak.lh" |
| 19 | 25 | |
| 20 | 26 | // The master clock is a single stage RC oscillator into TMS5100 RCOSC: |
| 21 | | // C is 68pf, R is a 50kohm trimpot wich is set to 33.6kohm. CPUCLK is this/2, ROMCLK is this/4. |
| 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. |
| 22 | 29 | // The typical osc freq curve for TMS5100 is unknown. Let's assume it is set to the default frequency, |
| 23 | | // which is 640kHz according to the TMS5100 documentation. |
| 30 | // which is 640kHz for 8KHz according to the TMS5100 documentation. |
| 24 | 31 | |
| 25 | 32 | #define MASTER_CLOCK (640000) |
| 26 | 33 | |
| r242606 | r242607 | |
| 454 | 461 | |
| 455 | 462 | ROM_START( snspell ) |
| 456 | 463 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 457 | | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // placeholder, use the one we have |
| 464 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // typed in from patent 4189779, may have errors |
| 458 | 465 | |
| 459 | 466 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 460 | 467 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| r242606 | r242607 | |
| 483 | 490 | ROM_LOAD( "cd2350a.vsm", 0x0000, 0x4000, CRC(2adda742) SHA1(3f868ed8284b723c815a30343057e03467c043b5) ) |
| 484 | 491 | ROM_END |
| 485 | 492 | |
| 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 | | |
| 502 | 493 | ROM_START( snspelluk ) |
| 503 | 494 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 504 | 495 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // placeholder, use the one we have |
| r242606 | r242607 | |
| 549 | 540 | |
| 550 | 541 | ROM_START( snmath ) |
| 551 | 542 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 552 | | ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) // placeholder, use the one we have |
| 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) ) |
| 553 | 546 | |
| 554 | 547 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 555 | 548 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 556 | 549 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 557 | | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // placeholder, use the one we have |
| 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 |
| 558 | 551 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 559 | | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // placeholder, use the one we have |
| 552 | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " |
| 560 | 553 | |
| 561 | 554 | ROM_REGION( 0x8000, "tms6100", 0 ) |
| 562 | 555 | ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) |
| r242606 | r242607 | |
| 582 | 575 | ROM_RELOAD( 0x7000, 0x1000 ) |
| 583 | 576 | ROM_END |
| 584 | 577 | |
| 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) ) |
| 590 | 578 | |
| 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) ) // " |
| 597 | 579 | |
| 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 ) |
| 580 | COMP( 1978, snspell, 0, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 |
| 606 | 581 | 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 ) |
| 608 | 582 | COMP( 1978, snspelluk, snspell, 0, snspell, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (UK set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 609 | 583 | 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 |
| 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? |
| 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 |
| 611 | 585 | |
| 612 | | COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 586 | COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 |
| 613 | 587 | 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 ) |