MMU: Invert conditionals in Memcheck()
Lets us unindent code a little bit.
This commit is contained in:
parent
c2c30b4d50
commit
a8ebca4fc6
|
@ -501,21 +501,27 @@ TryReadResult<u32> HostTryReadInstruction(const u32 address, RequestedAddressSpa
|
|||
|
||||
static void Memcheck(u32 address, u32 var, bool write, size_t size)
|
||||
{
|
||||
if (PowerPC::memchecks.HasAny())
|
||||
{
|
||||
TMemCheck* mc = PowerPC::memchecks.GetMemCheck(address, size);
|
||||
if (mc)
|
||||
{
|
||||
if (!memchecks.HasAny())
|
||||
return;
|
||||
|
||||
TMemCheck* mc = memchecks.GetMemCheck(address, size);
|
||||
if (mc == nullptr)
|
||||
return;
|
||||
|
||||
if (CPU::IsStepping())
|
||||
{
|
||||
// Disable when stepping so that resume works.
|
||||
return;
|
||||
}
|
||||
|
||||
mc->num_hits++;
|
||||
bool pause = mc->Action(&PowerPC::debug_interface, var, address, write, size, PC);
|
||||
if (pause)
|
||||
{
|
||||
|
||||
const bool pause = mc->Action(&debug_interface, var, address, write, size, PC);
|
||||
if (!pause)
|
||||
return;
|
||||
|
||||
CPU::Break();
|
||||
|
||||
// Fake a DSI so that all the code that tests for it in order to skip
|
||||
// the rest of the instruction will apply. (This means that
|
||||
// watchpoints will stop the emulator before the offending load/store,
|
||||
|
@ -523,10 +529,7 @@ static void Memcheck(u32 address, u32 var, bool write, size_t size)
|
|||
// make sure resuming after that works.)
|
||||
// It doesn't matter if ReadFromHardware triggers its own DSI because
|
||||
// we'll take it after resuming.
|
||||
PowerPC::ppcState.Exceptions |= EXCEPTION_DSI | EXCEPTION_FAKE_MEMCHECK_HIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
ppcState.Exceptions |= EXCEPTION_DSI | EXCEPTION_FAKE_MEMCHECK_HIT;
|
||||
}
|
||||
|
||||
u8 Read_U8(const u32 address)
|
||||
|
|
Loading…
Reference in New Issue