fix bug that could cause nested IRQs.

fix potential bug in MSR.
This commit is contained in:
StapleButter
2017-01-18 03:11:07 +01:00
parent 7f5ee5c00e
commit bff3a92cc0
3 changed files with 9 additions and 17 deletions

View File

@ -67,11 +67,14 @@ s32 A_MSR_IMM(ARM* cpu)
u32 oldpsr = *psr;
u32 mask = 0;
if (cpu->CurInstr & (1<<16)) mask |= 0x000000DF;
if (cpu->CurInstr & (1<<16)) mask |= 0x000000FF;
if (cpu->CurInstr & (1<<17)) mask |= 0x0000FF00;
if (cpu->CurInstr & (1<<18)) mask |= 0x00FF0000;
if (cpu->CurInstr & (1<<19)) mask |= 0xFF000000;
if (!(cpu->CurInstr & (1<<22)))
mask &= 0xFFFFFFDF;
if ((cpu->CPSR & 0x1F) == 0x10) mask &= 0xFFFFFF00;
u32 val = ROR((cpu->CurInstr & 0xFF), ((cpu->CurInstr >> 7) & 0x1E));