summaryrefslogtreecommitdiff
path: root/source/z80_dis.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2007-05-07 02:01:56 +0000
committerIan C <ianc@noddybox.co.uk>2007-05-07 02:01:56 +0000
commitd1591dc8440a5a896f22875b519e94cf177d8855 (patch)
tree871505d3a9cd950e62776f4dc8b0d8173248720d /source/z80_dis.c
parenteeb34217e85320a135a8ee6d2b5888cb98f49575 (diff)
Display not yet working; emulation too slow.HEADmaster
Diffstat (limited to 'source/z80_dis.c')
-rw-r--r--source/z80_dis.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/source/z80_dis.c b/source/z80_dis.c
index 9d42829..8a8ade8 100644
--- a/source/z80_dis.c
+++ b/source/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)
{
- return cpu->disread(cpu,(*pc)++);
+#ifdef ENABLE_ARRAY_MEMORY
+ return Z80_MEMORY[(*pc)++];
+#else
+ return cpu->priv->disread(cpu,(*pc)++);
+#endif
}
@@ -1454,7 +1460,11 @@ static void DIS_DJNZ (Z80 *z80, Z80Byte op, Z80Word *pc)
{
Z80Word new;
- new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
+ new=*pc+(Z80Relative)z80->priv->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;
- new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
+ new=*pc+(Z80Relative)z80->priv->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];
- new=*pc+(Z80Relative)z80->disread(z80,*pc)+1;
+#ifdef ENABLE_ARRAY_MEMORY
+ new=*pc+(Z80Relative)Z80_MEMORY[*pc]+1;
+#else
+ new=*pc+(Z80Relative)z80->priv->disread(z80,*pc)+1;
+#endif
(*pc)++;
if ((p=GetLabel(new)))