mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
arm7thmb.cpp this should be more accurate ROR fix
This commit is contained in:
parent
365d94a31b
commit
b943e67aa4
@ -657,12 +657,12 @@ void arm7_cpu_device::tg04_00_07(uint32_t pc, uint32_t op) /* ROR Rd, Rs */
|
||||
const uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT;
|
||||
const uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT;
|
||||
const uint32_t rrd = GetRegister(rd);
|
||||
const uint32_t imm = GetRegister(rs);
|
||||
const uint32_t imm = GetRegister(rs) & 0xff;
|
||||
const uint32_t imm_masked = imm & 0x1f;
|
||||
SetRegister(rd, (rrd >> imm_masked) | (rrd << (32 - imm_masked)));
|
||||
if (imm > 0)
|
||||
{
|
||||
if (rrd & (1 << (imm - 1)))
|
||||
SetRegister(rd, (rrd >> imm_masked) | (rrd << (32 - imm_masked)));
|
||||
if (rrd & (1 << ((imm - 1) & 0x1f)))
|
||||
{
|
||||
set_cpsr(GET_CPSR | C_MASK);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user