CPU (THUMB): LSR instruction now deals correctly with carryflag.

For instance this fixes bugs with CpuSet SWI when "Emulate SWIs by BIOS"
is enabled.
This commit is contained in:
luigi__ 2009-08-06 22:20:18 +00:00
parent 525541d037
commit 90d57bf8ce
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ TEMPLATE static u32 FASTCALL OP_LSR()
{
const u32 &i = cpu->instruction;
u32 v = (i>>6) & 0x1F;
cpu->CPSR.bits.C = BIT_N(cpu->R[REG_NUM(i, 0)], v-1);
cpu->CPSR.bits.C = BIT_N(cpu->R[REG_NUM(i, 3)], v-1);
cpu->R[REG_NUM(i, 0)] = (cpu->R[REG_NUM(i, 3)] >> v);
cpu->CPSR.bits.N = BIT31(cpu->R[REG_NUM(i, 0)]);
cpu->CPSR.bits.Z = cpu->R[REG_NUM(i, 0)] == 0;