Fix OAM deserialization

This commit is contained in:
Jeffrey Pfau 2014-01-25 15:06:28 -08:00
parent 941c629f8b
commit 668c4f68b7
1 changed files with 3 additions and 1 deletions

View File

@ -204,8 +204,10 @@ void GBAVideoSerialize(struct GBAVideo* video, struct GBASerializedState* state)
void GBAVideoDeserialize(struct GBAVideo* video, struct GBASerializedState* state) {
memcpy(video->renderer->vram, state->vram, SIZE_VRAM);
memcpy(video->oam.raw, state->oam, SIZE_OAM);
int i;
for (i = 0; i < SIZE_OAM; i += 2) {
GBAStore16(&video->p->memory.d, BASE_OAM | i, state->oam[i >> 1], 0);
}
for (i = 0; i < SIZE_PALETTE_RAM; i += 2) {
GBAStore16(&video->p->memory.d, BASE_PALETTE_RAM | i, state->pram[i >> 1], 0);
}