mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Make memory breakpoint faster
Currently, slowmem is used at any time that memory breakpoints are in use. This commit makes it so that whenever the DBAT gets updated, if the address is overllaping any memchecks, it forces the use of slowmem. This allows to keep fastmem for any other cases and noticably increases performance when using memory breakpoints.
This commit is contained in:
@ -173,8 +173,8 @@ void MemChecks::Add(const TMemCheck& memory_check)
|
||||
if (GetMemCheck(memory_check.start_address) == nullptr)
|
||||
{
|
||||
bool had_any = HasAny();
|
||||
m_mem_checks.push_back(memory_check);
|
||||
bool lock = Core::PauseAndLock(true);
|
||||
m_mem_checks.push_back(memory_check);
|
||||
// If this is the first one, clear the JIT cache so it can switch to
|
||||
// watchpoint-compatible code.
|
||||
if (!had_any && g_jit)
|
||||
@ -190,8 +190,8 @@ void MemChecks::Remove(u32 address)
|
||||
{
|
||||
if (i->start_address == address)
|
||||
{
|
||||
m_mem_checks.erase(i);
|
||||
bool lock = Core::PauseAndLock(true);
|
||||
m_mem_checks.erase(i);
|
||||
if (!HasAny() && g_jit)
|
||||
g_jit->ClearCache();
|
||||
PowerPC::DBATUpdated();
|
||||
@ -220,6 +220,25 @@ TMemCheck* MemChecks::GetMemCheck(u32 address)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool MemChecks::OverlapsMemcheck(u32 address, u32 length)
|
||||
{
|
||||
if (!HasAny())
|
||||
return false;
|
||||
u32 page_end_suffix = length - 1;
|
||||
u32 page_end_address = address | page_end_suffix;
|
||||
for (TMemCheck memcheck : m_mem_checks)
|
||||
{
|
||||
if (((memcheck.start_address | page_end_suffix) == page_end_address ||
|
||||
(memcheck.end_address | page_end_suffix) == page_end_address) ||
|
||||
((memcheck.start_address | page_end_suffix) < page_end_address &&
|
||||
(memcheck.end_address | page_end_suffix) > page_end_address))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TMemCheck::Action(DebugInterface* debug_interface, u32 value, u32 addr, bool write, int size,
|
||||
u32 pc)
|
||||
{
|
||||
|
Reference in New Issue
Block a user