mirror of https://github.com/mgba-emu/mgba.git
Fix reading 32-bit unaligned IO registers
This commit is contained in:
parent
45501658b5
commit
40a0a0eb11
|
@ -143,7 +143,7 @@ int32_t GBALoad32(struct ARMMemory* memory, uint32_t address, int* cycleCounter)
|
|||
value = gbaMemory->iwram[(address & (SIZE_WORKING_IRAM - 1)) >> 2];
|
||||
break;
|
||||
case BASE_IO:
|
||||
value = GBAIORead(gbaMemory->p, address & (SIZE_IO - 1)) | (GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) | 2) << 16);
|
||||
value = GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) & ~2) | (GBAIORead(gbaMemory->p, (address & (SIZE_IO - 1)) | 2) << 16);
|
||||
break;
|
||||
case BASE_PALETTE_RAM:
|
||||
value = ((int32_t*) gbaMemory->p->video.palette)[(address & (SIZE_PALETTE_RAM - 1)) >> 2];
|
||||
|
|
Loading…
Reference in New Issue