all repos — mgba @ cf982746c214c56cb51a96558a1e40e1ebb524e2

mGBA Game Boy Advance Emulator

LR35902: Fix RET timing
Jeffrey Pfau jeffrey@endrift.com
Tue, 26 Jan 2016 02:41:58 -0800
commit

cf982746c214c56cb51a96558a1e40e1ebb524e2

parent

c6a8cdbe73614d3e34edf7cb143f3ed56cbe1b5f

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M src/lr35902/isa-lr35902.csrc/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) {