diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-09-16 00:41:11 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-09-16 00:41:11 +0000 |
commit | 61b364c3dfeb99579304d83273c06846ed2e75f8 (patch) | |
tree | 6e03adb159494a94954c3409d6a6657627f968c4 /z80_dis.c | |
parent | 6ff1cd8b1cb250130e4196178c90f7efadc620f6 (diff) |
Added a config header that controls inclusion of disassembly and memory model.
Diffstat (limited to 'z80_dis.c')
-rw-r--r-- | z80_dis.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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))) |