Previous 15994 Revisions Next

r9319 Tuesday 5th October, 2010 at 01:58:53 UTC by R. Belmont
SH2: fix BSRF and JSR so delay slot insns can trash the calculated PR if they want
[src/emu/cpu/sh2]sh2drc.c

src/emu/cpu/sh2/sh2drc.c
r9318r9319
18381838         UML_ADD(block, MEM(&sh2->target), R32(Rn), IMM(4));   // add target, Rm, #4
18391839         UML_ADD(block, MEM(&sh2->target), MEM(&sh2->target), IMM(desc->pc));   // add target, target, pc
18401840
1841         // 32x Cosmic Carnage @ 6002cb0 relies on the delay slot
1842         // clobbering the calculated PR, so do it first
1843         UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4));   // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot)
1844
18411845         generate_delay_slot(sh2, block, compiler, desc);
18421846
1843         UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4));   // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot)
1844
18451847         generate_update_cycles(sh2, block, compiler, MEM(&sh2->target), TRUE);   // <subtract cycles>
18461848         UML_HASHJMP(block, IMM(0), MEM(&sh2->target), sh2->nocode);   // jmp target
18471849         return TRUE;
r9318r9319
24552457   case 0x0b: // JSR(Rn);
24562458      UML_MOV(block, MEM(&sh2->target), R32(Rn));      // mov target, Rn
24572459
2460      UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4));   // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot)
2461
24582462      generate_delay_slot(sh2, block, compiler, desc);
24592463
2460      UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4));   // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot)
2461
24622464      generate_update_cycles(sh2, block, compiler, MEM(&sh2->target), TRUE);   // <subtract cycles>
24632465      UML_HASHJMP(block, IMM(0), MEM(&sh2->target), sh2->nocode);   // and do the jump
24642466      return TRUE;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team