mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-25 17:19:42 +00:00
Initial state saving for kernelObjects.
This commit is contained in:
parent
75ce287213
commit
a2f4c83c90
@ -136,6 +136,18 @@ void __KernelShutdown()
|
||||
kernelRunning = false;
|
||||
}
|
||||
|
||||
void __KernelDoState(PointerWrap &p)
|
||||
{
|
||||
kernelObjects.DoState(p);
|
||||
p.DoMarker("KernelObjects");
|
||||
// TODO
|
||||
// kernelObjects
|
||||
// modules
|
||||
// core timing
|
||||
// memstick
|
||||
// filesystem
|
||||
}
|
||||
|
||||
bool __KernelIsRunning() {
|
||||
return kernelRunning;
|
||||
}
|
||||
@ -304,6 +316,29 @@ int KernelObjectPool::GetCount()
|
||||
return count;
|
||||
}
|
||||
|
||||
void KernelObjectPool::DoState(PointerWrap &p)
|
||||
{
|
||||
int _maxCount = maxCount;
|
||||
p.Do(_maxCount);
|
||||
p.DoArray(occupied, maxCount);
|
||||
for (int i = 0; i < maxCount; ++i)
|
||||
{
|
||||
if (!occupied[i])
|
||||
continue;
|
||||
|
||||
KernelObject *t = pool[i];
|
||||
if (!t)
|
||||
{
|
||||
// TODO: Pass down error?
|
||||
ERROR_LOG(HLE, "Unable to save state: inconsistent kernel object pool.");
|
||||
return;
|
||||
}
|
||||
|
||||
t->DoState(p);
|
||||
}
|
||||
p.DoMarker("KernelObjectPool");
|
||||
}
|
||||
|
||||
void sceKernelIcacheInvalidateAll()
|
||||
{
|
||||
DEBUG_LOG(CPU, "Icache invalidated - should clear JIT someday");
|
||||
|
@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../Globals.h"
|
||||
#include "../../Common/ChunkFile.h"
|
||||
#include <cstring>
|
||||
|
||||
enum
|
||||
@ -263,6 +264,7 @@ struct SceKernelLoadExecParam
|
||||
|
||||
void __KernelInit();
|
||||
void __KernelShutdown();
|
||||
void __KernelDoState(PointerWrap &p);
|
||||
bool __KernelIsRunning();
|
||||
bool __KernelLoadExec(const char *filename, SceKernelLoadExecParam *param);
|
||||
|
||||
@ -311,9 +313,11 @@ public:
|
||||
// Implement this in all subclasses:
|
||||
// static u32 GetMissingErrorCode()
|
||||
|
||||
// Future
|
||||
// void Serialize(ChunkFile)
|
||||
// void DeSerialize(ChunkFile)
|
||||
virtual void DoState(PointerWrap &p)
|
||||
{
|
||||
// TODO
|
||||
//_dbg_assert_msg_(HLE, false, "Bad kernel object");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -325,7 +329,7 @@ public:
|
||||
// Allocates a UID within the range and inserts the object into the map.
|
||||
SceUID Create(KernelObject *obj, int rangeBottom = 16, int rangeTop = 0x7fffffff);
|
||||
|
||||
// TODO: How will we ever save/restore this pool?
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
template <class T>
|
||||
u32 Destroy(SceUID handle)
|
||||
|
Loading…
Reference in New Issue
Block a user