mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-23 09:34:55 +00:00
Add Memory utility to detect shutdown.
This commit is contained in:
parent
68717411b1
commit
eee98966f4
@ -383,18 +383,15 @@ void DoState(PointerWrap &p)
|
||||
p.DoMarker("ScratchPad");
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
void Shutdown() {
|
||||
lock_guard guard(g_shutdownLock);
|
||||
u32 flags = 0;
|
||||
|
||||
MemoryMap_Shutdown(flags);
|
||||
base = NULL;
|
||||
base = nullptr;
|
||||
DEBUG_LOG(MEMMAP, "Memory system shut down.");
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
void Clear() {
|
||||
if (m_pRAM)
|
||||
memset(GetPointerUnchecked(PSP_GetKernelMemoryBase()), 0, g_MemorySize);
|
||||
if (m_pScratchPad)
|
||||
@ -403,6 +400,10 @@ void Clear()
|
||||
memset(m_pVRAM, 0, VRAM_SIZE);
|
||||
}
|
||||
|
||||
bool IsActive() {
|
||||
return base != nullptr;
|
||||
}
|
||||
|
||||
// Wanting to avoid include pollution, MemMap.h is included a lot.
|
||||
MemoryInitedLock::MemoryInitedLock()
|
||||
{
|
||||
|
@ -130,6 +130,8 @@ void Init();
|
||||
void Shutdown();
|
||||
void DoState(PointerWrap &p);
|
||||
void Clear();
|
||||
// False when shutdown has already been called.
|
||||
bool IsActive();
|
||||
|
||||
class MemoryInitedLock
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user