summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-04-20 23:19:13 -0700
committerMichael Pavone <pavone@retrodev.com>2016-04-20 23:19:13 -0700
commit98c157c117131c10b36a269cee8b225240407064 (patch)
tree22b7b7fcfa9dc567362ecd960f5079c8c18c2b9a
parentea4a42adde53588db81488eee153920195a9a95b (diff)
Fix bug in Z80 rrd implementation. This fixes the annoying high pitched wine in Afterburner II.
-rw-r--r--z80_to_x86.c1
-rw-r--r--z80_to_x86.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c
index 8458c06..1ecceb3 100644
--- a/z80_to_x86.c
+++ b/z80_to_x86.c
@@ -1435,6 +1435,7 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address,
shl_ir(code, 4, opts->gen.scratch2, SZ_W);
and_ir(code, 0xF00F, opts->gen.scratch1, SZ_W);
and_ir(code, 0xF0, opts->regs[Z80_A], SZ_B);
+ and_ir(code, 0xF0, opts->gen.scratch2, SZ_W);
//opts->gen.scratch1 = 0x2001
//opts->gen.scratch2 = 0x0040
or_rr(code, opts->gen.scratch2, opts->gen.scratch1, SZ_W);
diff --git a/z80_to_x86.h b/z80_to_x86.h
index b21cdbf..551319b 100644
--- a/z80_to_x86.h
+++ b/z80_to_x86.h
@@ -12,7 +12,7 @@
#ifdef Z80_LOG_ADDRESS
#define ZMAX_NATIVE_SIZE 255
#else
-#define ZMAX_NATIVE_SIZE 128
+#define ZMAX_NATIVE_SIZE 160
#endif
enum {