From d1591dc8440a5a896f22875b519e94cf177d8855 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 7 May 2007 02:01:56 +0000 Subject: Display not yet working; emulation too slow. --- source/z80_dis.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'source/z80_dis.c') 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 @@ -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))) -- cgit v1.2.3