LR35902: Fix RET timing

This commit is contained in:
Jeffrey Pfau 2016-01-26 02:41:58 -08:00
parent c6a8cdbe73
commit cf982746c2
1 changed files with 6 additions and 2 deletions

View File

@ -100,11 +100,15 @@ DEFINE_INSTRUCTION_LR35902(CALLUpdateSPH,
DEFINE_CONDITIONAL_INSTRUCTION_LR35902(CALL) DEFINE_CONDITIONAL_INSTRUCTION_LR35902(CALL)
DEFINE_INSTRUCTION_LR35902(RETFinish,
cpu->sp += 2; /* TODO: Atomic incrementing? */
cpu->executionState = LR35902_CORE_STALL;)
DEFINE_INSTRUCTION_LR35902(RETUpdateSPL, DEFINE_INSTRUCTION_LR35902(RETUpdateSPL,
cpu->pc |= cpu->bus << 8; cpu->pc |= cpu->bus << 8;
cpu->sp += 2; /* TODO: Atomic incrementing? */
cpu->memory.setActiveRegion(cpu, cpu->pc); cpu->memory.setActiveRegion(cpu, cpu->pc);
cpu->executionState = LR35902_CORE_STALL;) cpu->executionState = LR35902_CORE_OP2;
cpu->instruction = _LR35902InstructionRETFinish;)
DEFINE_INSTRUCTION_LR35902(RETUpdateSPH, DEFINE_INSTRUCTION_LR35902(RETUpdateSPH,
if (cpu->condition) { if (cpu->condition) {