Skip to content

Commit

Permalink
Merge pull request #1465 from nicolasnoble/openbios-fastboot-cop0
Browse files Browse the repository at this point in the history
Tweaking OpenBIOS' fastboot to work with cheat roms.
  • Loading branch information
nicolasnoble authored Nov 22, 2023
2 parents a072e38 + a165d44 commit 54c9d5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mips/openbios/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ int startShell(uint32_t arg) {
}
#endif
#ifdef OPENBIOS_FASTBOOT
return 0;
// Embed a simple jr $ra / nop to simulate a shell being copied and run,
// so cheat cart hooks and other tricks can still work properly.
static const uint32_t dummy[2] = {0x03e00008, 0};
memcpy((uint32_t *)0x80030000, dummy, sizeof(dummy));
#else
memcpy((uint32_t *)0x80030000, _binary_shell_bin_start, _binary_shell_bin_end - _binary_shell_bin_start);
#endif
flushCache();
return ((int (*)(int))0x80030000)(arg);
#endif
}

0 comments on commit 54c9d5d

Please sign in to comment.