mirror of https://github.com/mgba-emu/mgba.git
More sane way of writing 32-bit values to VRAM, palette
This commit is contained in:
parent
3a76cdc6e0
commit
e82fd991fa
|
@ -288,13 +288,11 @@ void GBAStore32(struct ARMMemory* memory, uint32_t address, int32_t value) {
|
||||||
GBAIOWrite32(gbaMemory->p, address & (SIZE_IO - 1), value);
|
GBAIOWrite32(gbaMemory->p, address & (SIZE_IO - 1), value);
|
||||||
break;
|
break;
|
||||||
case BASE_PALETTE_RAM:
|
case BASE_PALETTE_RAM:
|
||||||
gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1] = value;
|
((int32_t*) gbaMemory->p->video.palette)[(address & (SIZE_PALETTE_RAM - 1)) >> 2] = value;
|
||||||
gbaMemory->p->video.palette[((address & (SIZE_PALETTE_RAM - 1)) >> 1) + 1] = value >> 16;
|
|
||||||
break;
|
break;
|
||||||
case BASE_VRAM:
|
case BASE_VRAM:
|
||||||
if ((address & OFFSET_MASK) < SIZE_VRAM - 2) {
|
if ((address & OFFSET_MASK) < SIZE_VRAM - 2) {
|
||||||
gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1] = value;
|
((int32_t*) gbaMemory->p->video.vram)[(address & 0x0001FFFF) >> 2] = value;
|
||||||
gbaMemory->p->video.vram[((address & 0x0001FFFF) >> 1) + 1] = value >> 16;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BASE_OAM:
|
case BASE_OAM:
|
||||||
|
|
Loading…
Reference in New Issue