ggpo: disable full framebuffer emulation. memwatch perf fix

Disable full framebuffer emulation with ggpo if threaded rendering is
enabled. Would require thread synchronization on VRAM page map.
memwatch: do single lookup on page map in hit()
This commit is contained in:
Flyinghead 2022-12-17 10:54:01 +01:00
parent 7fec511463
commit 51758b965e
2 changed files with 9 additions and 5 deletions

View File

@ -802,6 +802,9 @@ void Emulator::start()
verify(state == Loaded);
state = Running;
SetMemoryHandlers();
if (config::GGPOEnable && config::ThreadedRendering)
// Not supported with GGPO
config::EmulateFramebuffer.override(false);
#if FEAT_SHREC != DYNAREC_NONE
if (config::DynarecEnabled)
{

View File

@ -77,11 +77,12 @@ public:
if (offset == (u32)-1)
return false;
offset &= ~PAGE_MASK;
if (pages.count(offset) > 0)
// already saved
return true;
Page& page = pages.emplace(offset, Page()).first->second;
memcpy(&page.data[0], static_cast<T&>(*this).getMemPage(offset), PAGE_SIZE);
auto rv = pages.emplace(offset, Page());
if (!rv.second)
// already saved
return true;
Page& page = rv.first->second;
memcpy(&page.data[0], static_cast<T&>(*this).getMemPage(offset), PAGE_SIZE);
static_cast<T&>(*this).unprotectMem(offset, PAGE_SIZE);
return true;
}