all repos — mgba @ 668c4f68b76a5d9d4ac5345201ef162078d56601

mGBA Game Boy Advance Emulator

Fix OAM deserialization
Jeffrey Pfau jeffrey@endrift.com
Sat, 25 Jan 2014 15:06:28 -0800
commit

668c4f68b76a5d9d4ac5345201ef162078d56601

parent

941c629f8b09f2e6000a9722a8837ca76c943c95

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/gba/gba-video.csrc/gba/gba-video.c

@@ -204,8 +204,10 @@ }

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); }