Work around some crashes I got trying to load a GTA:LCS savestate from 2014.

However, the savestate still loads to a black screen, although background audio is working.
This commit is contained in:
Henrik Rydgard 2015-10-04 10:32:15 +02:00
parent 77b40c2ee4
commit 68fc776fa7
2 changed files with 15 additions and 2 deletions

View File

@ -66,6 +66,11 @@ public:
GeIntrHandler() : IntrHandler(PSP_GE_INTR) {}
bool run(PendingInterrupt& pend) override {
if (ge_pending_cb.empty()) {
ERROR_LOG_REPORT(SCEGE, "Unable to run GE interrupt: no pending interrupt");
return false;
}
GeInterruptData intrdata = ge_pending_cb.front();
DisplayList* dl = gpu->getList(intrdata.listid);

View File

@ -603,15 +603,23 @@ void Jit::Comp_ReplacementFunc(MIPSOpcode op)
}
}
// Hack for old savestates: Avoid stack overflow (MIPSCompileOp/CompReplacementFunc)
// Not sure about the cause.
Memory::Opcode origInstruction = Memory::Read_Instruction(GetCompilerPC(), true);
if (origInstruction.encoding == op.encoding) {
ERROR_LOG(HLE, "Replacement broken (savestate problem?): %08x", op.encoding);
return;
}
if (disabled) {
MIPSCompileOp(Memory::Read_Instruction(GetCompilerPC(), true));
MIPSCompileOp(origInstruction);
} else if (entry->jitReplaceFunc) {
MIPSReplaceFunc repl = entry->jitReplaceFunc;
int cycles = (this->*repl)();
if (entry->flags & (REPFLAG_HOOKENTER | REPFLAG_HOOKEXIT)) {
// Compile the original instruction at this address. We ignore cycles for hooks.
MIPSCompileOp(Memory::Read_Instruction(GetCompilerPC(), true));
MIPSCompileOp(origInstruction);
} else {
FlushAll();
MOV(32, R(ECX), M(&mips_->r[MIPS_REG_RA]));