fix(barrel_shifter): fix PC being 1 word ahead in barrel shifter

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-01-18 15:08:29 -04:00
parent 8d786cbe25
commit 903b75c7c4
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ fn immShift(comptime S: bool, cpu: *Arm7tdmi, opcode: u32) u32 {
const amount = @truncate(u8, opcode >> 7 & 0x1F);
const rm_idx = opcode & 0xF;
const rm = if (rm_idx == 0xF) cpu.fakePC() + 4 else cpu.r[rm_idx];
const rm = if (rm_idx == 0xF) cpu.fakePC() else cpu.r[rm_idx];
var result: u32 = undefined;
if (amount == 0) {