Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CPU: Relative Jump ops must always increment PC after reading offset

  • Loading branch information...
commit e26339655564d52dd7bd31b402e1327bce0e2f66 1 parent 2d6ef53
@NTmatter authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/sys/cpu.c
View
5 src/sys/cpu.c
@@ -626,12 +626,11 @@ CPU_OP(JPHL)
{ \
CPU_INSTRUCTION_PRE; \
state->cpu.m = 2; \
+ int8_t offset = (int8_t) mmu_rb(state, state->cpu.pc++); \
if(test) \
{ \
- state->cpu.pc += (int8_t) mmu_rb(state, state->cpu.pc); \
+ state->cpu.pc += offset; \
state->cpu.m++; \
- } else { \
- state->cpu.pc++; \
} \
CPU_INSTRUCTION_POST; \
}
Please sign in to comment.
Something went wrong with that request. Please try again.