More sane way of writing 32-bit values to VRAM, palette
Jeffrey Pfau jeffrey@endrift.com
Tue, 23 Apr 2013 02:05:10 -0700
1 files changed,
2 insertions(+),
4 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -288,13 +288,11 @@ case BASE_IO:
GBAIOWrite32(gbaMemory->p, address & (SIZE_IO - 1), value); break; case BASE_PALETTE_RAM: - gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1] = value; - gbaMemory->p->video.palette[((address & (SIZE_PALETTE_RAM - 1)) >> 1) + 1] = value >> 16; + ((int32_t*) gbaMemory->p->video.palette)[(address & (SIZE_PALETTE_RAM - 1)) >> 2] = value; break; case BASE_VRAM: if ((address & OFFSET_MASK) < SIZE_VRAM - 2) { - gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1] = value; - gbaMemory->p->video.vram[((address & 0x0001FFFF) >> 1) + 1] = value >> 16; + ((int32_t*) gbaMemory->p->video.vram)[(address & 0x0001FFFF) >> 2] = value; } break; case BASE_OAM: