LR35902: Fix RET timing
Jeffrey Pfau jeffrey@endrift.com
Tue, 26 Jan 2016 02:41:58 -0800
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
src/lr35902/isa-lr35902.c
→
src/lr35902/isa-lr35902.c
@@ -100,11 +100,15 @@ })
DEFINE_CONDITIONAL_INSTRUCTION_LR35902(CALL) +DEFINE_INSTRUCTION_LR35902(RETFinish, + cpu->sp += 2; /* TODO: Atomic incrementing? */ + cpu->executionState = LR35902_CORE_STALL;) + DEFINE_INSTRUCTION_LR35902(RETUpdateSPL, cpu->pc |= cpu->bus << 8; - cpu->sp += 2; /* TODO: Atomic incrementing? */ cpu->memory.setActiveRegion(cpu, cpu->pc); - cpu->executionState = LR35902_CORE_STALL;) + cpu->executionState = LR35902_CORE_OP2; + cpu->instruction = _LR35902InstructionRETFinish;) DEFINE_INSTRUCTION_LR35902(RETUpdateSPH, if (cpu->condition) {