mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 12:35:27 +00:00
Merge pull request #7109 from degasus/cached_interpreter
CachedInterpreter: Implement breakpoints.
This commit is contained in:
commit
8b68a7d88a
@ -109,6 +109,7 @@ void CachedInterpreter::ExecuteOneBlock()
|
|||||||
|
|
||||||
void CachedInterpreter::Run()
|
void CachedInterpreter::Run()
|
||||||
{
|
{
|
||||||
|
const CPU::State* state_ptr = CPU::GetStatePtr();
|
||||||
while (CPU::GetState() == CPU::State::Running)
|
while (CPU::GetState() == CPU::State::Running)
|
||||||
{
|
{
|
||||||
// Start new timing slice
|
// Start new timing slice
|
||||||
@ -118,7 +119,7 @@ void CachedInterpreter::Run()
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
ExecuteOneBlock();
|
ExecuteOneBlock();
|
||||||
} while (PowerPC::ppcState.downcount > 0);
|
} while (PowerPC::ppcState.downcount > 0 && *state_ptr == CPU::State::Running);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,6 +170,17 @@ static bool CheckDSI(u32 data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool CheckBreakpoint(u32 data)
|
||||||
|
{
|
||||||
|
PowerPC::CheckBreakPoints();
|
||||||
|
if (CPU::GetState() != CPU::State::Running)
|
||||||
|
{
|
||||||
|
PowerPC::ppcState.downcount -= data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool CachedInterpreter::HandleFunctionHooking(u32 address)
|
bool CachedInterpreter::HandleFunctionHooking(u32 address)
|
||||||
{
|
{
|
||||||
return HLE::ReplaceFunctionIfPossible(address, [&](u32 function, HLE::HookType type) {
|
return HLE::ReplaceFunctionIfPossible(address, [&](u32 function, HLE::HookType type) {
|
||||||
@ -225,10 +237,18 @@ void CachedInterpreter::Jit(u32 address)
|
|||||||
|
|
||||||
if (!op.skip)
|
if (!op.skip)
|
||||||
{
|
{
|
||||||
|
const bool breakpoint = SConfig::GetInstance().bEnableDebugging &&
|
||||||
|
PowerPC::breakpoints.IsAddressBreakPoint(op.address);
|
||||||
const bool check_fpu = (op.opinfo->flags & FL_USE_FPU) && !js.firstFPInstructionFound;
|
const bool check_fpu = (op.opinfo->flags & FL_USE_FPU) && !js.firstFPInstructionFound;
|
||||||
const bool endblock = (op.opinfo->flags & FL_ENDBLOCK) != 0;
|
const bool endblock = (op.opinfo->flags & FL_ENDBLOCK) != 0;
|
||||||
const bool memcheck = (op.opinfo->flags & FL_LOADSTORE) && jo.memcheck;
|
const bool memcheck = (op.opinfo->flags & FL_LOADSTORE) && jo.memcheck;
|
||||||
|
|
||||||
|
if (breakpoint)
|
||||||
|
{
|
||||||
|
m_code.emplace_back(WritePC, op.address);
|
||||||
|
m_code.emplace_back(CheckBreakpoint, js.downcountAmount);
|
||||||
|
}
|
||||||
|
|
||||||
if (check_fpu)
|
if (check_fpu)
|
||||||
{
|
{
|
||||||
m_code.emplace_back(WritePC, op.address);
|
m_code.emplace_back(WritePC, op.address);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user