R5900: Fully get rid of exceptions

This commit is contained in:
Stenzek 2023-06-28 20:09:30 +10:00 committed by Connor McLaughlin
parent 4d22102fd1
commit 4bfbc355a2
2 changed files with 9 additions and 56 deletions

View File

@ -145,7 +145,7 @@ void psxBreakpoint(bool memcheck)
CBreakPoints::SetBreakpointTriggered(true);
VMManager::SetPaused(true);
throw Exception::ExitCpuExecute();
Cpu->ExitExecution();
}
void psxMemcheck(u32 op, u32 bits, bool store)
@ -274,23 +274,15 @@ static s32 intExecuteBlock( s32 eeCycles )
psxRegs.iopBreak = 0;
psxRegs.iopCycleEE = eeCycles;
try
while (psxRegs.iopCycleEE > 0)
{
while (psxRegs.iopCycleEE > 0) {
if ((psxHu32(HW_ICFG) & 8) && ((psxRegs.pc & 0x1fffffffU) == 0xa0 || (psxRegs.pc & 0x1fffffffU) == 0xb0 || (psxRegs.pc & 0x1fffffffU) == 0xc0))
psxBiosCall();
branch2 = 0;
while (!branch2) {
while (!branch2)
execI();
}
}
}
catch (Exception::ExitCpuExecute&)
{
// Get out of the EE too, regardless of whether it's int or rec.
Cpu->ExitExecution();
}
return psxRegs.iopBreak + psxRegs.iopCycleEE;
}

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2023 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -15,34 +15,7 @@
#pragma once
#include "common/Exceptions.h"
class BaseR5900Exception;
// --------------------------------------------------------------------------------------
// Recompiler Stuffs
// --------------------------------------------------------------------------------------
// This code section contains recompiler vars that are used in "shared" code. Placing
// them in iR5900.h would mean having to include that into more files than I care to
// right now, so we're sticking them here for now until a better solution comes along.
namespace Exception
{
// Implementation Note: this exception has no meaningful type information and we don't
// care to have it be caught by any BaseException handlers lying about, so let's not
// derive from BaseException :D
class ExitCpuExecute
{
public:
explicit ExitCpuExecute() { }
};
class CancelInstruction
{
public:
explicit CancelInstruction() { }
};
}
#include "common/Pcsx2Defs.h"
// --------------------------------------------------------------------------------------
// EE Bios function name tables.
@ -214,18 +187,6 @@ struct tlbs
#ifndef _PC_
/*#define _i64(x) (s64)x
#define _u64(x) (u64)x
#define _i32(x) (s32)x
#define _u32(x) (u32)x
#define _i16(x) (s16)x
#define _u16(x) (u16)x
#define _i8(x) (s8)x
#define _u8(x) (u8)x*/
////////////////////////////////////////////////////////////////////
// R5900 Instruction Macros