simplify arm branch exchange logic

This commit is contained in:
Matthew Berry 2021-05-09 23:48:23 -07:00
parent bdda6b0509
commit 8b6f300f67

View file

@ -1,13 +1,9 @@
module GBA
module ARM
def arm_branch_exchange(instr : Word) : Nil
rn = bits(instr, 0..3)
if bit?(@r[rn], 0)
@cpsr.thumb = true
set_reg(15, @r[rn])
else
set_reg(15, @r[rn])
end
address = @r[bits(instr, 0..3)]
@cpsr.thumb = bit?(address, 0)
set_reg(15, address)
end
end
end