Check active region instead of pc for BIOS loads

This commit is contained in:
Jeffrey Pfau 2014-08-29 01:46:46 -07:00
parent 6cff3d423e
commit 1e1b0fc89e
1 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ int32_t GBALoad32(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
switch (address & ~OFFSET_MASK) { switch (address & ~OFFSET_MASK) {
case BASE_BIOS: case BASE_BIOS:
if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { if (memory->activeRegion == REGION_BIOS) {
if (address < SIZE_BIOS) { if (address < SIZE_BIOS) {
LOAD_32(value, address, memory->bios); LOAD_32(value, address, memory->bios);
} else { } else {
@ -239,7 +239,7 @@ int16_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
switch (address & ~OFFSET_MASK) { switch (address & ~OFFSET_MASK) {
case BASE_BIOS: case BASE_BIOS:
if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { if (memory->activeRegion == REGION_BIOS) {
if (address < SIZE_BIOS) { if (address < SIZE_BIOS) {
LOAD_16(value, address, memory->bios); LOAD_16(value, address, memory->bios);
} else { } else {
@ -316,7 +316,7 @@ int8_t GBALoad8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
switch (address & ~OFFSET_MASK) { switch (address & ~OFFSET_MASK) {
case BASE_BIOS: case BASE_BIOS:
if (cpu->gprs[ARM_PC] >> BASE_OFFSET == REGION_BIOS) { if (memory->activeRegion == REGION_BIOS) {
if (address < SIZE_BIOS) { if (address < SIZE_BIOS) {
value = ((int8_t*) memory->bios)[address]; value = ((int8_t*) memory->bios)[address];
} else { } else {