mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 17:59:08 +02:00
Make memchecks ignore cached/uncached memory.
You usually want both.
This commit is contained in:
1 parent
f9e4cae3c0
commit
da20bda729
3 files changed
+37
-6
No files matched your search
@@ -248,6 +248,12 @@ void CBreakPoints::ClearAllMemChecks()
|
||||
}
|
||||
}
|
||||
|
||||
static inline u32 NotCached(u32 val)
|
||||
{
|
||||
// Remove the cached part of the address.
|
||||
return val & ~0x40000000;
|
||||
}
|
||||
|
||||
MemCheck *CBreakPoints::GetMemCheck(u32 address, int size)
|
||||
{
|
||||
std::vector<MemCheck>::iterator iter;
|
||||
@@ -256,12 +262,12 @@ MemCheck *CBreakPoints::GetMemCheck(u32 address, int size)
|
||||
MemCheck &check = *iter;
|
||||
if (check.end != 0)
|
||||
{
|
||||
if (address + size > check.start && address < check.end)
|
||||
if (NotCached(address + size) > NotCached(check.start) && NotCached(address) < NotCached(check.end))
|
||||
return ✓
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check.start == address)
|
||||
if (NotCached(check.start) == NotCached(address))
|
||||
return ✓
|
||||
}
|
||||
}
|
||||
@@ -270,6 +276,13 @@ MemCheck *CBreakPoints::GetMemCheck(u32 address, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CBreakPoints::ExecMemCheck(u32 address, bool write, int size, u32 pc)
|
||||
{
|
||||
auto check = GetMemCheck(address, size);
|
||||
if (check)
|
||||
check->Action(address, write, size, pc);
|
||||
}
|
||||
|
||||
void CBreakPoints::SetSkipFirst(u32 pc)
|
||||
{
|
||||
breakSkipFirstAt_ = pc;
|
||||
@@ -283,6 +296,22 @@ u32 CBreakPoints::CheckSkipFirst()
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::vector<MemCheck> CBreakPoints::GetMemCheckRanges()
|
||||
{
|
||||
std::vector<MemCheck> ranges = memChecks_;
|
||||
for (auto it = memChecks_.begin(), end = memChecks_.end(); it != end; ++it)
|
||||
{
|
||||
MemCheck check = *it;
|
||||
// Toggle the cached part of the address.
|
||||
check.start ^= 0x40000000;
|
||||
if (check.end != 0)
|
||||
check.end ^= 0x40000000;
|
||||
ranges.push_back(check);
|
||||
}
|
||||
|
||||
return ranges;
|
||||
}
|
||||
|
||||
const std::vector<MemCheck> CBreakPoints::GetMemChecks()
|
||||
{
|
||||
return memChecks_;
|
||||
|
||||
@@ -123,10 +123,14 @@ public:
|
||||
static void ClearAllMemChecks();
|
||||
|
||||
static MemCheck *GetMemCheck(u32 address, int size);
|
||||
static void ExecMemCheck(u32 address, bool write, int size, u32 pc);
|
||||
|
||||
static void SetSkipFirst(u32 pc);
|
||||
static u32 CheckSkipFirst();
|
||||
|
||||
// Includes uncached addresses.
|
||||
static const std::vector<MemCheck> GetMemCheckRanges();
|
||||
|
||||
static const std::vector<MemCheck> GetMemChecks();
|
||||
static const std::vector<BreakPoint> GetBreakpoints();
|
||||
|
||||
|
||||
@@ -790,9 +790,7 @@ void JitMemCheck(u32 addr, int size, int isWrite)
|
||||
if (coreState != CORE_RUNNING && coreState != CORE_NEXTFRAME)
|
||||
return;
|
||||
|
||||
MemCheck *check = CBreakPoints::GetMemCheck(addr, size);
|
||||
if (check)
|
||||
check->Action(addr, isWrite == 1, size, currentMIPS->pc);
|
||||
CBreakPoints::ExecMemCheck(addr, isWrite == 1, size, currentMIPS->pc);
|
||||
}
|
||||
|
||||
void Jit::JitSafeMem::MemCheckImm(ReadType type)
|
||||
@@ -817,7 +815,7 @@ void Jit::JitSafeMem::MemCheckImm(ReadType type)
|
||||
|
||||
void Jit::JitSafeMem::MemCheckAsm(ReadType type)
|
||||
{
|
||||
const auto memchecks = CBreakPoints::GetMemChecks();
|
||||
const auto memchecks = CBreakPoints::GetMemCheckRanges();
|
||||
bool possible = false;
|
||||
for (auto it = memchecks.begin(), end = memchecks.end(); it != end; ++it)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user