diff options
Diffstat (limited to 'src/devices/cpu/clipper/clipper.cpp')
-rw-r--r-- | src/devices/cpu/clipper/clipper.cpp | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/src/devices/cpu/clipper/clipper.cpp b/src/devices/cpu/clipper/clipper.cpp index cf9903e6ec8..aff0b589a45 100644 --- a/src/devices/cpu/clipper/clipper.cpp +++ b/src/devices/cpu/clipper/clipper.cpp @@ -14,11 +14,9 @@ */ #include "emu.h" -#include "debugger.h" #include "clipper.h" #include "clipperd.h" -#define LOG_GENERAL (1U << 0) #define LOG_EXCEPTION (1U << 1) #define LOG_SYSCALLS (1U << 2) @@ -91,31 +89,6 @@ clipper_device::clipper_device(const machine_config &mconfig, device_type type, { } -// rotate helpers to replace MSVC intrinsics -inline u32 rotl32(u32 x, u8 shift) -{ - shift &= 31; - return (x << shift) | (x >> ((32 - shift) & 31)); -} - -inline u32 rotr32(u32 x, u8 shift) -{ - shift &= 31; - return (x >> shift) | (x << ((32 - shift) & 31)); -} - -inline u64 rotl64(u64 x, u8 shift) -{ - shift &= 63; - return (x << shift) | (x >> ((64 - shift) & 63)); -} - -inline u64 rotr64(u64 x, u8 shift) -{ - shift &= 63; - return (x >> shift) | (x << ((64 - shift) & 63)); -} - void clipper_device::device_start() { // configure the cammu address spaces @@ -210,7 +183,7 @@ void clipper_device::execute_run() if (m_nmi) { // acknowledge non-maskable interrupt - standard_irq_callback(INPUT_LINE_NMI); + standard_irq_callback(INPUT_LINE_NMI, m_pc); LOGMASKED(LOG_EXCEPTION, "non-maskable interrupt\n"); m_pc = intrap(EXCEPTION_INTERRUPT_BASE, m_pc); @@ -223,7 +196,7 @@ void clipper_device::execute_run() if ((m_ivec & IVEC_LEVEL) <= SSW(IL)) { // acknowledge interrupt - standard_irq_callback(INPUT_LINE_IRQ0); + standard_irq_callback(INPUT_LINE_IRQ0, m_pc); m_pc = intrap(EXCEPTION_INTERRUPT_BASE + m_ivec * 8, m_pc); @@ -335,9 +308,9 @@ device_memory_interface::space_config_vector clipper_device::memory_space_config }; } -bool clipper_device::memory_translate(int spacenum, int intention, offs_t &address) +bool clipper_device::memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) { - return ((intention & TRANSLATE_TYPE_MASK) == TRANSLATE_FETCH ? get_icammu() : get_dcammu()).memory_translate(m_ssw, spacenum, intention, address); + return (intention == TR_FETCH ? get_icammu() : get_dcammu()).memory_translate(m_ssw, spacenum, intention, address, target_space); } void clipper_device::set_exception(u16 data) @@ -694,18 +667,18 @@ void clipper_device::execute_instruction() case 0x34: // rotw: rotate word if (!BIT31(m_r[R1])) - m_r[R2] = rotl32(m_r[R2], m_r[R1]); + m_r[R2] = rotl_32(m_r[R2], m_r[R1]); else - m_r[R2] = rotr32(m_r[R2], -m_r[R1]); + m_r[R2] = rotr_32(m_r[R2], -m_r[R1]); // FLAGS: 00ZN FLAGS(0, 0, m_r[R2] == 0, BIT31(m_r[R2])); break; case 0x35: // rotl: rotate longword if (!BIT31(m_r[R1])) - set_64(R2, rotl64(get_64(R2), m_r[R1])); + set_64(R2, rotl_64(get_64(R2), m_r[R1])); else - set_64(R2, rotr64(get_64(R2), -m_r[R1])); + set_64(R2, rotr_64(get_64(R2), -m_r[R1])); // FLAGS: 00ZN FLAGS(0, 0, get_64(R2) == 0, BIT63(get_64(R2))); break; @@ -773,9 +746,9 @@ void clipper_device::execute_instruction() case 0x3c: // roti: rotate immediate if (!BIT31(m_info.imm)) - m_r[R2] = rotl32(m_r[R2], m_info.imm); + m_r[R2] = rotl_32(m_r[R2], m_info.imm); else - m_r[R2] = rotr32(m_r[R2], -m_info.imm); + m_r[R2] = rotr_32(m_r[R2], -m_info.imm); FLAGS(0, 0, m_r[R2] == 0, BIT31(m_r[R2])); // FLAGS: 00ZN // TRAPS: I @@ -783,9 +756,9 @@ void clipper_device::execute_instruction() case 0x3d: // rotli: rotate longword immediate if (!BIT31(m_info.imm)) - set_64(R2, rotl64(get_64(R2), m_info.imm)); + set_64(R2, rotl_64(get_64(R2), m_info.imm)); else - set_64(R2, rotr64(get_64(R2), -m_info.imm)); + set_64(R2, rotr_64(get_64(R2), -m_info.imm)); FLAGS(0, 0, get_64(R2) == 0, BIT63(get_64(R2))); // FLAGS: 00ZN // TRAPS: I @@ -1269,7 +1242,7 @@ void clipper_device::execute_instruction() m_r[0]--; m_r[1]++; - m_r[2] = rotr32(m_r[2], 8); + m_r[2] = rotr_32(m_r[2], 8); } // TRAPS: P,W break; |