CPU/NewRec: Handle inside-block SMC

i.e. Spyro 2/3 PAL.
This commit is contained in:
Stenzek
2023-11-21 13:26:17 +10:00
parent 20de40a597
commit e10ff550d5
6 changed files with 37 additions and 2 deletions

View File

@ -2212,7 +2212,12 @@ void CPU::NewRec::RISCV64Compiler::TestInterrupts(const biscuit::GPR& sr)
rvAsm->SRLIW(sr, sr, 8);
rvAsm->ANDI(sr, sr, 0xFF);
SwitchToFarCode(true, &Assembler::BEQ, sr, zero);
BackupHostState();
// Update load delay, this normally happens at the end of an instruction, but we're finishing it early.
UpdateLoadDelay();
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
// Can't use EndBlockWithException() here, because it'll use the wrong PC.