trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242566 | r242567 | |
| 80 | 80 | int S_temp = (op & 0x0000003f) >> 0; \ |
| 81 | 81 | int s_temp = (op & 0x00000fc0) >> 6; \ |
| 82 | 82 | INT32 S = s_temp | (S_temp<<6); \ |
| 83 | | if (S & 0x800) S = -0x800 + (S&0x7ff) /* sign extend */ \ |
| 83 | if (S & 0x800) S = -0x800 + (S&0x7ff); /* sign extend */ \ |
| 84 | 84 | |
| 85 | 85 | #define COMMON32_GET_CONDITION \ |
| 86 | 86 | UINT8 condition = op & 0x0000001f; |
| r242566 | r242567 | |
| 1784 | 1784 | /* 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?) */ \ |
| 1785 | 1785 | |
| 1786 | 1786 | |
| 1787 | #define SETUP_HANDLE04_0x_P10 \ |
| 1788 | int size = 4; \ |
| 1789 | UINT32 limm = 0; \ |
| 1790 | /* int got_limm = 0; */ \ |
| 1791 | \ |
| 1792 | COMMON32_GET_breg; \ |
| 1793 | COMMON32_GET_F; \ |
| 1794 | COMMON32_GET_s12; \ |
| 1795 | COMMON32_GET_areg; \ |
| 1796 | \ |
| 1797 | UINT32 b, c; \ |
| 1798 | \ |
| 1799 | /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */ \ |
| 1800 | if (breg == LIMM_REG) \ |
| 1801 | { \ |
| 1802 | GET_LIMM_32; \ |
| 1803 | size = 8; \ |
| 1804 | /* got_limm = 1; */ \ |
| 1805 | b = limm; \ |
| 1806 | } \ |
| 1807 | else \ |
| 1808 | { \ |
| 1809 | b = m_regs[breg]; \ |
| 1810 | } \ |
| 1811 | \ |
| 1812 | c = (UINT32)S; \ |
| 1813 | \ |
| 1814 | /* 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?) */ \ |
| 1787 | 1815 | |
| 1816 | |
| 1788 | 1817 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32) |
| 1789 | 1818 | { |
| 1790 | 1819 | SETUP_HANDLE04_0x_P00 |
| r242566 | r242567 | |
| 1880 | 1909 | |
| 1881 | 1910 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p10(OPS_32) |
| 1882 | 1911 | { |
| 1883 | | int size = 4; |
| 1884 | | arcompact_fatal("arcompact_handle04_04_p10 (AND)\n"); |
| 1912 | SETUP_HANDLE04_0x_P10 |
| 1913 | m_regs[areg] = b & c; |
| 1914 | |
| 1915 | if (F) |
| 1916 | { |
| 1917 | arcompact_fatal("arcompact_handle04_04_p10 (AND) (F set)\n"); // not yet supported |
| 1918 | } |
| 1919 | |
| 1885 | 1920 | return m_pc + (size >> 0); |
| 1886 | 1921 | } |
| 1887 | 1922 | |
| r242566 | r242567 | |
| 1917 | 1952 | |
| 1918 | 1953 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p01(OPS_32) |
| 1919 | 1954 | { |
| 1920 | | int size = 4; |
| 1921 | | arcompact_fatal("arcompact_handle04_05_p01 (OR)\n"); |
| 1922 | | return m_pc + (size >> 0); |
| 1923 | | } |
| 1955 | SETUP_HANDLE04_0x_P01 |
| 1924 | 1956 | |
| 1957 | m_regs[areg] = b | c; |
| 1958 | |
| 1959 | if (F) |
| 1960 | { |
| 1961 | arcompact_fatal("arcompact_handle04_05_p01 (OR) (F set)\n"); // not yet supported |
| 1962 | } |
| 1963 | |
| 1964 | return m_pc + (size >> 0);} |
| 1965 | |
| 1925 | 1966 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p10(OPS_32) |
| 1926 | 1967 | { |
| 1927 | 1968 | int size = 4; |
| r242566 | r242567 | |
| 2119 | 2160 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p10(OPS_32) |
| 2120 | 2161 | { |
| 2121 | 2162 | int size = 4; |
| 2122 | | arcompact_fatal("arcompact_handle04_0a_p10\n"); |
| 2123 | | return m_pc + (size >> 0); |
| 2124 | | } |
| 2125 | 2163 | |
| 2164 | COMMON32_GET_breg; |
| 2165 | COMMON32_GET_s12; |
| 2166 | COMMON32_GET_F; |
| 2167 | |
| 2168 | m_regs[breg] = S; |
| 2169 | |
| 2170 | if (F) |
| 2171 | { // currently not supported |
| 2172 | arcompact_fatal("unimplemented MOV.F b <- s12 %08x", op); |
| 2173 | } |
| 2174 | |
| 2175 | return m_pc + (size>>0);} |
| 2176 | |
| 2126 | 2177 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m0(OPS_32) |
| 2127 | 2178 | { |
| 2128 | 2179 | int size = 4; |
| r242566 | r242567 | |
| 3218 | 3269 | return m_pc + (2 >> 0); |
| 3219 | 3270 | } |
| 3220 | 3271 | |
| 3221 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "OR_S",0); } |
| 3272 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16) // OR_S b <- b,c |
| 3273 | { |
| 3274 | int breg, creg; |
| 3275 | |
| 3276 | COMMON16_GET_breg; |
| 3277 | COMMON16_GET_creg; |
| 3278 | |
| 3279 | REG_16BIT_RANGE(breg); |
| 3280 | REG_16BIT_RANGE(creg); |
| 3281 | |
| 3282 | m_regs[breg] = m_regs[breg] | m_regs[creg]; |
| 3283 | |
| 3284 | return m_pc + (2 >> 0); |
| 3285 | } |
| 3286 | |
| 3287 | |
| 3222 | 3288 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_06(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "BIC_S",0); } |
| 3223 | 3289 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_07(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "XOR_S",0); } |
| 3224 | 3290 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0b(OPS_16) { return arcompact_handle0f_0x_helper(PARAMS, "TST_S",1); } |
| r242566 | r242567 | |
| 3488 | 3554 | return arcompact_handle_l7_0x_helper(PARAMS, "BCLR_S"); |
| 3489 | 3555 | } |
| 3490 | 3556 | |
| 3491 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_06(OPS_16) |
| 3557 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_06(OPS_16) // BMSK b,b,u5 |
| 3492 | 3558 | { |
| 3493 | | return arcompact_handle_l7_0x_helper(PARAMS, "BSMK_S"); |
| 3559 | int breg, u; |
| 3560 | |
| 3561 | COMMON16_GET_breg; |
| 3562 | COMMON16_GET_u5; |
| 3563 | |
| 3564 | REG_16BIT_RANGE(breg); |
| 3565 | |
| 3566 | u &= 0x1f; |
| 3567 | |
| 3568 | m_regs[breg] = m_regs[breg] | ((1 << (u + 1)) - 1); |
| 3569 | |
| 3570 | return m_pc + (2 >> 0); |
| 3494 | 3571 | } |
| 3495 | 3572 | |
| 3496 | 3573 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_07(OPS_16) |
trunk/src/mess/drivers/leapster.c
| r242566 | r242567 | |
| 227 | 227 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(leapster_cart); |
| 228 | 228 | DECLARE_DRIVER_INIT(leapster); |
| 229 | 229 | |
| 230 | DECLARE_READ32_MEMBER(leapster_random_r) |
| 231 | { |
| 232 | return rand() | (rand()<<16); // there is a loop checking that this is above a certain value |
| 233 | } |
| 234 | |
| 230 | 235 | protected: |
| 231 | 236 | required_device<cpu_device> m_maincpu; |
| 232 | 237 | required_device<generic_slot_device> m_cart; |
| r242566 | r242567 | |
| 277 | 282 | |
| 278 | 283 | static ADDRESS_MAP_START( leapster_map, AS_PROGRAM, 32, leapster_state ) |
| 279 | 284 | AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_MIRROR(0x40000000) // pointers in the bios region seem to be to the 40xxxxxx region, either we mirror there or something (real bios?) is acutally missing |
| 285 | AM_RANGE(0x0180D800, 0x0180D803) AM_READ(leapster_random_r) |
| 280 | 286 | AM_RANGE(0x03000000, 0x030007ff) AM_RAM // puts stack here, writes a pointer @ 0x03000000 on startup |
| 281 | 287 | // AM_RANGE(0x80000000, 0x807fffff) AM_ROMBANK("cartrom") // game ROM pointers are all to the 80xxxxxx region, so I assume it maps here - installed if a cart is present |
| 282 | 288 | ADDRESS_MAP_END |