mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
sh2: handle some branch exceptions
This commit is contained in:
parent
61290a3553
commit
6a5b1b362e
3 changed files with 40 additions and 4 deletions
|
@ -122,6 +122,18 @@ int sh2_execute_interpreter(SH2 *sh2, int cycles)
|
|||
{
|
||||
sh2->ppc = sh2->delay;
|
||||
opcode = RW(sh2, sh2->delay);
|
||||
|
||||
// TODO: more branch types
|
||||
if ((opcode >> 13) == 5) { // BRA/BSR
|
||||
sh2->r[15] -= 4;
|
||||
WL(sh2, sh2->r[15], sh2->sr);
|
||||
sh2->r[15] -= 4;
|
||||
WL(sh2, sh2->r[15], sh2->pc);
|
||||
sh2->pc = RL(sh2, sh2->vbr + 6 * 4);
|
||||
sh2->icount -= 5;
|
||||
opcode = 9; // NOP
|
||||
}
|
||||
|
||||
sh2->pc -= 2;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue