Skip to content

Commit 4f1e2f7

Browse files
rofl0rcarmiker
authored andcommitted
jgz80: fix inir/indr mem_ptr value when b != 0
1 parent 98c557a commit 4f1e2f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

z80.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,7 @@ static unsigned exec_opcode_ed(z80* const z, uint8_t opcode) {
21332133
if (z->b > 0) {
21342134
z->pc -= 2;
21352135
cyc += 5;
2136+
z->mem_ptr = z->pc + 1;
21362137
}
21372138
break; // inir
21382139
case 0xAA: cyc += 16; ind(z); break; // ind
@@ -2142,6 +2143,7 @@ static unsigned exec_opcode_ed(z80* const z, uint8_t opcode) {
21422143
if (z->b > 0) {
21432144
z->pc -= 2;
21442145
cyc += 5;
2146+
z->mem_ptr = z->pc + 1;
21452147
}
21462148
break; // indr
21472149

0 commit comments

Comments
 (0)