all repos — mgba @ 3b279b3fbe106f14f181fc208dad9cc43a4d39ba

mGBA Game Boy Advance Emulator

LR35902: Add missing M-state to CALL
Jeffrey Pfau jeffrey@endrift.com
Wed, 27 Jan 2016 20:18:39 -0800
commit

3b279b3fbe106f14f181fc208dad9cc43a4d39ba

parent

7c087d5cb9ae92abcc62cdc06321344ddab0e295

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

jump to
M src/lr35902/isa-lr35902.csrc/lr35902/isa-lr35902.c

@@ -72,6 +72,10 @@ cpu->sp = cpu->index;

cpu->executionState = LR35902_CORE_MEMORY_STORE; cpu->instruction = _LR35902InstructionNOP;) +DEFINE_INSTRUCTION_LR35902(CALLUpdateSPH, + cpu->executionState = LR35902_CORE_MEMORY_STORE; + cpu->instruction = _LR35902InstructionCALLUpdateSPL;) + DEFINE_INSTRUCTION_LR35902(CALLUpdatePCH, if (cpu->condition) { int newPc = (cpu->bus << 8) | cpu->index;

@@ -80,8 +84,8 @@ cpu->index = cpu->sp - 1;

cpu->sp = cpu->pc; // GROSS cpu->pc = newPc; cpu->memory.setActiveRegion(cpu, cpu->pc); - cpu->executionState = LR35902_CORE_MEMORY_STORE; - cpu->instruction = _LR35902InstructionCALLUpdateSPL; + cpu->executionState = LR35902_CORE_OP2; + cpu->instruction = _LR35902InstructionCALLUpdateSPH; }) DEFINE_INSTRUCTION_LR35902(CALLUpdatePCL,