mirror of https://github.com/mgba-emu/mgba.git
GBA Memory: Fix misaligned BIOS reads
This commit is contained in:
parent
64d8d80eee
commit
cd3e304dd8
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
||||||
|
0.5.2: (Future)
|
||||||
|
Bugfixes:
|
||||||
|
- GBA Memory: Fix misaligned BIOS reads
|
||||||
|
|
||||||
0.5.1: (2016-10-05)
|
0.5.1: (2016-10-05)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Core: Fix importing save games as read-only
|
- Core: Fix importing save games as read-only
|
||||||
|
|
|
@ -352,7 +352,7 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
|
||||||
#define LOAD_BIOS \
|
#define LOAD_BIOS \
|
||||||
if (address < SIZE_BIOS) { \
|
if (address < SIZE_BIOS) { \
|
||||||
if (memory->activeRegion == REGION_BIOS) { \
|
if (memory->activeRegion == REGION_BIOS) { \
|
||||||
LOAD_32(value, address, memory->bios); \
|
LOAD_32(value, address & -4, memory->bios); \
|
||||||
} else { \
|
} else { \
|
||||||
mLOG(GBA_MEM, GAME_ERROR, "Bad BIOS Load32: 0x%08X", address); \
|
mLOG(GBA_MEM, GAME_ERROR, "Bad BIOS Load32: 0x%08X", address); \
|
||||||
value = memory->biosPrefetch; \
|
value = memory->biosPrefetch; \
|
||||||
|
@ -479,7 +479,7 @@ uint32_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
|
||||||
case REGION_BIOS:
|
case REGION_BIOS:
|
||||||
if (address < SIZE_BIOS) {
|
if (address < SIZE_BIOS) {
|
||||||
if (memory->activeRegion == REGION_BIOS) {
|
if (memory->activeRegion == REGION_BIOS) {
|
||||||
LOAD_16(value, address, memory->bios);
|
LOAD_16(value, address & -2, memory->bios);
|
||||||
} else {
|
} else {
|
||||||
mLOG(GBA_MEM, GAME_ERROR, "Bad BIOS Load16: 0x%08X", address);
|
mLOG(GBA_MEM, GAME_ERROR, "Bad BIOS Load16: 0x%08X", address);
|
||||||
value = (memory->biosPrefetch >> ((address & 2) * 8)) & 0xFFFF;
|
value = (memory->biosPrefetch >> ((address & 2) * 8)) & 0xFFFF;
|
||||||
|
|
Loading…
Reference in New Issue