GB: CPU can still decode instructions during DMAs

This commit is contained in:
Jeffrey Pfau 2016-01-26 20:56:03 -08:00
parent 0e4f64088c
commit 81f8ad27d5
3 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ static void _GBMemoryDMAService(struct GB* gb);
void GBMemoryInit(struct GB* gb) {
struct LR35902Core* cpu = gb->cpu;
cpu->memory.cpuLoad8 = GBLoad8;
cpu->memory.load8 = GBLoad8;
cpu->memory.store8 = GBStore8;
cpu->memory.setActiveRegion = GBSetActiveRegion;

View File

@ -106,7 +106,7 @@ void LR35902Tick(struct LR35902Core* cpu) {
cpu->instruction = _LR35902InstructionIRQ;
break;
}
cpu->bus = cpu->memory.load8(cpu, cpu->pc);
cpu->bus = cpu->memory.cpuLoad8(cpu, cpu->pc);
cpu->instruction = _lr35902InstructionTable[cpu->bus];
++cpu->pc;
break;

View File

@ -48,6 +48,7 @@ enum LR35902ExecutionState {
};
struct LR35902Memory {
uint8_t (*cpuLoad8)(struct LR35902Core*, uint16_t address);
uint8_t (*load8)(struct LR35902Core*, uint16_t address);
void (*store8)(struct LR35902Core*, uint16_t address, int8_t value);