More sane way of writing 32-bit values to VRAM, palette

This commit is contained in:
Jeffrey Pfau 2013-04-23 02:05:10 -07:00
parent 3a76cdc6e0
commit e82fd991fa
1 changed files with 2 additions and 4 deletions

View File

@ -288,13 +288,11 @@ void GBAStore32(struct ARMMemory* memory, uint32_t address, int32_t value) {
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: