all repos — mgba @ e82fd991fa89c8b6b4ffbb1d9d65e1f6059349da

mGBA Game Boy Advance Emulator

More sane way of writing 32-bit values to VRAM, palette
Jeffrey Pfau jeffrey@endrift.com
Tue, 23 Apr 2013 02:05:10 -0700
commit

e82fd991fa89c8b6b4ffbb1d9d65e1f6059349da

parent

3a76cdc6e07ac9ea48d98f8a642c45e29ef34215

1 files changed, 2 insertions(+), 4 deletions(-)

jump to
M src/gba/gba-memory.csrc/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: