Skip to content

Commit

Permalink
Fix bug with dynarec when RSP interrupt causes dynarec fragment to re…
Browse files Browse the repository at this point in the history
…turn early.
  • Loading branch information
hulkholden committed Nov 18, 2023
1 parent 81e6575 commit 10f3d66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/r4300.js
Original file line number Diff line number Diff line change
Expand Up @@ -2516,8 +2516,9 @@ function addOpToFragment(fragment, entry_pc, instruction, c) {
fragmentMap.addInstructionToFragment(fragment, entry_pc);

// TODO: can we avoid the stuffToDo check? Throw exception?
// TODO: we shouldn't need to set pc for every instruction - this is just to ensure delayedPCUpdate is flushed.
fragment.bodyCode += 'rsp.step();\n';
fragment.bodyCode += `if (c.stuffToDo) { return ${fragment.opsCompiled - 1}; }\n`;
fragment.bodyCode += `if (c.stuffToDo) { c.pc = ${entry_pc}; return ${fragment.opsCompiled - 1}; }\n`;
fragment.bodyCode += `\n`;

const curPC = entry_pc;
Expand Down

0 comments on commit 10f3d66

Please sign in to comment.