From 2bc11c9aac79865582d3943b6d86f335253a8823 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 3 May 2013 01:33:20 -0700 Subject: [PATCH] 32- and 16-bit reads of OAM --- src/gba/gba-memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gba/gba-memory.c b/src/gba/gba-memory.c index f61de5463..091d2e8a3 100644 --- a/src/gba/gba-memory.c +++ b/src/gba/gba-memory.c @@ -128,6 +128,7 @@ int32_t GBALoad32(struct ARMMemory* memory, uint32_t address) { value = ((int32_t*) gbaMemory->p->video.vram)[(address & 0x0001FFFF) >> 2]; break; case BASE_OAM: + value = ((int32_t*) gbaMemory->p->video.oam.raw)[(address & (SIZE_OAM - 1)) >> 2]; break; case BASE_CART0: case BASE_CART0_EX: @@ -167,7 +168,7 @@ int16_t GBALoad16(struct ARMMemory* memory, uint32_t address) { case BASE_VRAM: return gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1]; case BASE_OAM: - break; + return gbaMemory->p->video.oam.raw[(address & (SIZE_OAM - 1)) >> 1]; case BASE_CART0: case BASE_CART0_EX: case BASE_CART1: @@ -208,7 +209,7 @@ uint16_t GBALoadU16(struct ARMMemory* memory, uint32_t address) { case BASE_VRAM: return gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1]; case BASE_OAM: - break; + return gbaMemory->p->video.oam.raw[(address & (SIZE_OAM - 1)) >> 1]; case BASE_CART0: case BASE_CART0_EX: case BASE_CART1: