GPU: Saving/loading of VRAM

This commit is contained in:
Connor McLaughlin
2019-09-14 20:45:26 +10:00
parent 2560efbebd
commit f6ef3f7ba6
4 changed files with 63 additions and 0 deletions

View File

@ -66,6 +66,22 @@ bool GPU::DoState(StateWrapper& sw)
UpdateGPUSTAT();
}
if (!sw.DoMarker("GPU-VRAM"))
return false;
if (sw.IsReading())
{
std::vector<u16> vram;
sw.Do(&vram);
UpdateVRAM(0, 0, VRAM_WIDTH, VRAM_HEIGHT, vram.data());
}
else
{
std::vector<u16> vram(VRAM_WIDTH * VRAM_HEIGHT);
ReadVRAM(0, 0, VRAM_WIDTH, VRAM_HEIGHT, vram.data());
sw.Do(&vram);
}
return !sw.HasError();
}
@ -476,6 +492,8 @@ void GPU::UpdateDisplay()
m_system->IncrementFrameNumber();
}
void GPU::ReadVRAM(u32 x, u32 y, u32 width, u32 height, void* buffer) {}
void GPU::FillVRAM(u32 x, u32 y, u32 width, u32 height, u32 color) {}
void GPU::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data) {}