X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fsh2%2Fmame%2Fsh2pico.c;h=174d469125068bcdd9c1eebbc91166459c535793;hb=6a5b1b362ecf78ce2925068a5d938d319ff583a3;hp=a3ad9f4796fdd533da6993fe6523366270e5392a;hpb=61290a355398cc8f17b183700f637dc65a8b8ab4;p=picodrive.git diff --git a/cpu/sh2/mame/sh2pico.c b/cpu/sh2/mame/sh2pico.c index a3ad9f4..174d469 100644 --- a/cpu/sh2/mame/sh2pico.c +++ b/cpu/sh2/mame/sh2pico.c @@ -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