mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
add some missing shit to savestates
This commit is contained in:
@ -188,6 +188,17 @@ void GPU2D::DoSavestate(Savestate* file)
|
|||||||
file->Var32(&CaptureCnt);
|
file->Var32(&CaptureCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file->IsAtleastVersion(2, 1))
|
||||||
|
{
|
||||||
|
file->Var32(&Win0Active);
|
||||||
|
file->Var32(&Win1Active);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Win0Active = 0;
|
||||||
|
Win1Active = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!file->Saving)
|
if (!file->Saving)
|
||||||
{
|
{
|
||||||
// refresh those
|
// refresh those
|
||||||
|
@ -518,18 +518,26 @@ void DoSavestate(Savestate* file)
|
|||||||
|
|
||||||
// probably not worth storing the vblank-latched Renderxxxxxx variables
|
// probably not worth storing the vblank-latched Renderxxxxxx variables
|
||||||
|
|
||||||
if (file->Saving ||
|
if (file->IsAtleastVersion(2, 1))
|
||||||
file->VersionMajor > 2 ||
|
|
||||||
(file->VersionMajor == 2 && file->VersionMinor >= 1))
|
|
||||||
{
|
{
|
||||||
// command stall queue, only in version 2.1 and up
|
// command stall queue, only in version 2.1 and up
|
||||||
CmdStallQueue->DoSavestate(file);
|
CmdStallQueue->DoSavestate(file);
|
||||||
|
file->Var32((u32*)&VertexPipeline);
|
||||||
|
file->Var32((u32*)&NormalPipeline);
|
||||||
|
file->Var32((u32*)&PolygonPipeline);
|
||||||
|
file->Var32((u32*)&VertexSlotCounter);
|
||||||
|
file->Var32(&VertexSlotsFree);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// for version 2.0, just clear it. not having it doesn't matter
|
// for version 2.0, just clear it. not having it doesn't matter
|
||||||
// if this comes from older melonDS revisions.
|
// if this comes from older melonDS revisions.
|
||||||
CmdStallQueue->Clear();
|
CmdStallQueue->Clear();
|
||||||
|
VertexPipeline = 0;
|
||||||
|
NormalPipeline = 0;
|
||||||
|
PolygonPipeline = 0;
|
||||||
|
VertexSlotCounter = 0;
|
||||||
|
VertexSlotsFree = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file->Saving)
|
if (!file->Saving)
|
||||||
|
@ -48,6 +48,13 @@ public:
|
|||||||
|
|
||||||
void VarArray(void* data, u32 len);
|
void VarArray(void* data, u32 len);
|
||||||
|
|
||||||
|
bool IsAtleastVersion(u32 major, u32 minor)
|
||||||
|
{
|
||||||
|
if (VersionMajor > major) return true;
|
||||||
|
if (VersionMajor == major && VersionMinor >= minor) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE* file;
|
FILE* file;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user