From 1e1b0fc89e46f3120d24efad54841fb5d8826764 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 29 Aug 2014 01:46:46 -0700 Subject: [PATCH] Check active region instead of pc for BIOS loads --- src/gba/gba-memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gba/gba-memory.c b/src/gba/gba-memory.c index 424be1932..66b31428b 100644 --- a/src/gba/gba-memory.c +++ b/src/gba/gba-memory.c @@ -165,7 +165,7 @@ int32_t GBALoad32(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { switch (address & ~OFFSET_MASK) { case BASE_BIOS: - if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { + if (memory->activeRegion == REGION_BIOS) { if (address < SIZE_BIOS) { LOAD_32(value, address, memory->bios); } else { @@ -239,7 +239,7 @@ int16_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { switch (address & ~OFFSET_MASK) { case BASE_BIOS: - if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { + if (memory->activeRegion == REGION_BIOS) { if (address < SIZE_BIOS) { LOAD_16(value, address, memory->bios); } else { @@ -316,7 +316,7 @@ int8_t GBALoad8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { switch (address & ~OFFSET_MASK) { case BASE_BIOS: - if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { + if (memory->activeRegion == REGION_BIOS) { if (address < SIZE_BIOS) { value = ((int8_t*) memory->bios)[address]; } else {