mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
verify writable msr bits
This commit is contained in:
parent
048b0b8878
commit
42218106b0
@ -101,9 +101,9 @@ void A_MSR_IMM(ARM* cpu)
|
||||
|
||||
u32 mask = 0;
|
||||
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 |= (cpu->Num ? 0xF0000000 /* checkme */ : 0xF8000000);
|
||||
//if (cpu->CurInstr & (1<<17)) mask |= 0x0000FF00; // unused by arm 7 & 9
|
||||
//if (cpu->CurInstr & (1<<18)) mask |= 0x00FF0000; // unused by arm 7 & 9
|
||||
if (cpu->CurInstr & (1<<19)) mask |= ((cpu->Num==1) ? 0xF0000000 : 0xF8000000);
|
||||
|
||||
if (!(cpu->CurInstr & (1<<22)))
|
||||
mask &= 0xFFFFFFDF;
|
||||
@ -154,9 +154,9 @@ void A_MSR_REG(ARM* cpu)
|
||||
|
||||
u32 mask = 0;
|
||||
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 |= (cpu->Num ? 0xF0000000 /* checkme */ : 0xF8000000);
|
||||
//if (cpu->CurInstr & (1<<17)) mask |= 0x0000FF00; // unused by arm 7 & 9
|
||||
//if (cpu->CurInstr & (1<<18)) mask |= 0x00FF0000; // unused by arm 7 & 9
|
||||
if (cpu->CurInstr & (1<<19)) mask |= ((cpu->Num==1) ? 0xF0000000 : 0xF8000000);
|
||||
|
||||
if (!(cpu->CurInstr & (1<<22)))
|
||||
mask &= 0xFFFFFFDF;
|
||||
|
@ -411,7 +411,7 @@ void A_SWP(ARM* cpu)
|
||||
// rd only gets updated if both read and write succeed
|
||||
u32 rd = (cpu->CurInstr >> 12) & 0xF;
|
||||
if (rd != 15) cpu->R[rd] = ROR(val, 8*(base&0x3));
|
||||
else if (cpu->Num) cpu->JumpTo(ROR(val, 8*(base&0x3)) & ~1); // for some reason these jumps don't work on the arm 9?
|
||||
else if (cpu->Num==1) cpu->JumpTo(ROR(val, 8*(base&0x3)) & ~1); // for some reason these jumps don't work on the arm 9?
|
||||
}
|
||||
cpu->DataCycles += numD;
|
||||
}
|
||||
@ -433,7 +433,7 @@ void A_SWPB(ARM* cpu)
|
||||
// rd only gets updated if both read and write succeed
|
||||
u32 rd = (cpu->CurInstr >> 12) & 0xF;
|
||||
if (rd != 15) cpu->R[rd] = val;
|
||||
else if (cpu->Num) cpu->JumpTo(val & ~1); // for some reason these jumps don't work on the arm 9?
|
||||
else if (cpu->Num==1) cpu->JumpTo(val & ~1); // for some reason these jumps don't work on the arm 9?
|
||||
}
|
||||
cpu->DataCycles += numD;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user