all repos — mgba @ e9e29610a4847edb984075016f146ba75fd5044f

mGBA Game Boy Advance Emulator

Read from palette memory
Jeffrey Pfau jeffrey@endrift.com
Thu, 25 Apr 2013 01:48:28 -0700
commit

e9e29610a4847edb984075016f146ba75fd5044f

parent

65e04453753856408822f80683ac8f2743250e4b

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

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

@@ -115,7 +115,7 @@ return gbaMemory->iwram[(address & (SIZE_WORKING_IRAM - 1)) >> 2];

case BASE_IO: return GBAIORead(gbaMemory->p, address & (SIZE_IO - 1)) | (GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) | 2) << 16); case BASE_PALETTE_RAM: - break; + return ((int32_t*) gbaMemory->p->video.palette)[(address & (SIZE_PALETTE_RAM - 1)) >> 2]; case BASE_VRAM: return ((int32_t*) gbaMemory->p->video.vram)[(address & 0x0001FFFF) >> 2]; case BASE_OAM:

@@ -149,7 +149,7 @@ return ((int16_t*) gbaMemory->iwram)[(address & (SIZE_WORKING_IRAM - 1)) >> 1];

case BASE_IO: return GBAIORead(gbaMemory->p, address & (SIZE_IO - 1)); case BASE_PALETTE_RAM: - break; + return gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1]; case BASE_VRAM: return gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1]; case BASE_OAM:

@@ -183,7 +183,7 @@ return ((uint16_t*) gbaMemory->iwram)[(address & (SIZE_WORKING_IRAM - 1)) >> 1];

case BASE_IO: return GBAIORead(gbaMemory->p, address & (SIZE_IO - 1)); case BASE_PALETTE_RAM: - break; + return gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1]; case BASE_VRAM: return gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1]; case BASE_OAM: