From f76b8997620b8fb22f3b3c650c6fa9005b7d660b Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 16 Sep 2006 22:54:59 +0000 Subject: Added newer version of the Z80 core --- src/z80.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/z80.c') diff --git a/src/z80.c b/src/z80.c index 60dbca4..3a15a22 100644 --- a/src/z80.c +++ b/src/z80.c @@ -112,11 +112,16 @@ static void Z80_CheckInterrupt(Z80 *cpu) /* ---------------------------------------- INTERFACES */ -Z80 *Z80Init(Z80ReadMemory read_memory, - Z80WriteMemory write_memory, - Z80ReadPort read_port, - Z80WritePort write_port, - Z80ReadMemory read_disassem) +#ifdef ENABLE_ARRAY_MEMORY +Z80 *Z80Init(Z80ReadPort read_port, + Z80WritePort write_port) +#else +Z80 *Z80Init(Z80ReadMemory read_memory, + Z80WriteMemory write_memory, + Z80ReadPort read_port, + Z80WritePort write_port, + Z80ReadMemory read_for_disassem) +#endif { Z80 *cpu; int f; @@ -124,18 +129,22 @@ Z80 *Z80Init(Z80ReadMemory read_memory, InitTables(); +#ifndef ENABLE_ARRAY_MEMORY if (!read_memory || !write_memory) return NULL; +#endif cpu=malloc(sizeof *cpu); if (cpu) { +#ifndef ENABLE_ARRAY_MEMORY cpu->mread=read_memory; cpu->mwrite=write_memory; + cpu->disread=read_for_disassem; +#endif cpu->pread=read_port; cpu->pwrite=write_port; - cpu->disread=read_disassem; for(f=0;fdisread(cpu,opc++))); +#endif + } if (opc!=npc) for(f=1;f<3;f++) -- cgit v1.2.3