summaryrefslogtreecommitdiff
path: root/z80_dis.c
diff options
context:
space:
mode:
Diffstat (limited to 'z80_dis.c')
-rw-r--r--z80_dis.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/z80_dis.c b/z80_dis.c
index 9d42829..6204f0d 100644
--- a/z80_dis.c
+++ b/z80_dis.c
@@ -25,6 +25,8 @@
*/
static const char ident[]="$Id$";
+#include "z80_config.h"
+
#ifdef ENABLE_DISASSEM
#include <stdio.h>
@@ -62,7 +64,11 @@ const char *Z80_Dis_Printf(const char *format, ...)
Z80Byte Z80_Dis_FetchByte(Z80 *cpu, Z80Word *pc)
{
+#ifdef ENABLE_ARRAY_MEMORY
+ return Z80_MEMORY[(*pc)++];
+#else
return cpu->disread(cpu,(*pc)++);
+#endif
}
@@ -1454,7 +1460,11 @@ static void DIS_DJNZ (Z80 *z80, Z80Byte op, Z80Word *pc)
{
Z80Word new;
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#endif
(*pc)++;
Z80_Dis_Set("djnz",Z80_Dis_Printf("$%.4x",new));
}
@@ -1469,7 +1479,11 @@ static void DIS_JR (Z80 *z80, Z80Byte op, Z80Word *pc)
Z80Word new;
const char *p;
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#endif
(*pc)++;
if ((p=GetLabel(new)))
@@ -1490,7 +1504,11 @@ static void DIS_JR_CO (Z80 *z80, Z80Byte op, Z80Word *pc)
const char *p;
con=z80_dis_condition[(op-0x20)/8];
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#endif
(*pc)++;
if ((p=GetLabel(new)))