tst z80f,#1<<CFlag\r
bne opcode_1_8\r
add z80pc,z80pc,#1\r
- fetch 8\r
+ fetch 7\r
;@ADD HL,SP\r
opcode_3_9:\r
.if FAST_Z80SP\r
orr r0,r0,r1, lsl #8\r
readmem8\r
mov z80a,r0, lsl #24\r
- fetch 11\r
+ fetch 13\r
;@DEC SP\r
opcode_3_B:\r
sub z80sp,z80sp,#1\r
ldrb r0,[cpucontext,#z80if]\r
orr r0,r0,#Z80_HALT\r
strb r0,[cpucontext,#z80if]\r
+ mov z80_icount,#0\r
b z80_execute_end\r
;@LD (HL),A\r
opcode_7_7:\r
;@RET NZ\r
opcode_C_0:\r
tst z80f,#1<<ZFlag\r
- beq opcode_C_9 ;@unconditional RET\r
+ beq opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
\r
;@POP BC\r
;@RET Z\r
opcode_C_8:\r
tst z80f,#1<<ZFlag\r
- bne opcode_C_9 ;@unconditional RET\r
+ bne opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
+\r
+opcode_C_9_cond:\r
+ sub z80_icount,#1\r
;@RET\r
opcode_C_9:\r
opPOP\r
;@RET NC\r
opcode_D_0:\r
tst z80f,#1<<CFlag\r
- beq opcode_C_9 ;@unconditional RET\r
+ beq opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@POP DE\r
opcode_D_1:\r
;@RET C\r
opcode_D_8:\r
tst z80f,#1<<CFlag\r
- bne opcode_C_9 ;@unconditional RET\r
+ bne opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@EXX\r
opcode_D_9:\r
;@RET PO\r
opcode_E_0:\r
tst z80f,#1<<VFlag\r
- beq opcode_C_9 ;@unconditional RET\r
+ beq opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@POP HL\r
opcode_E_1:\r
;@RET PE\r
opcode_E_8:\r
tst z80f,#1<<VFlag\r
- bne opcode_C_9 ;@unconditional RET\r
+ bne opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@JP (HL)\r
opcode_E_9:\r
;@RET P\r
opcode_F_0:\r
tst z80f,#1<<SFlag\r
- beq opcode_C_9 ;@unconditional RET\r
+ beq opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@POP AF\r
opcode_F_1:\r
;@RET M\r
opcode_F_8:\r
tst z80f,#1<<SFlag\r
- bne opcode_C_9 ;@unconditional RET\r
+ bne opcode_C_9_cond ;@unconditional RET\r
fetch 5\r
;@LD SP,HL\r
opcode_F_9:\r
.else\r
mov z80sp,z80hl, lsr #16\r
.endif\r
- fetch 4\r
+ fetch 6\r
;@JP M,$+3\r
opcode_F_A:\r
tst z80f,#1<<SFlag\r
;@ b end_loop\r
\r
opcode_DD_NF2:\r
- fetch 15\r
+ fetch 23\r
;@ notaz: we don't want to deadlock here\r
;@ mov r0,#0xDD0000\r
;@ orr r0,r0,#0xCB00\r