--- xmil/z80c/z80core.h 2004/08/11 13:53:54 1.4 +++ xmil/z80c/z80core.h 2008/06/02 20:07:32 1.8 @@ -1,11 +1,10 @@ -//---------------------------------------------------------------------------- -// -// Z80C : Z80 Engine - GENERIC -// -// Copyright by Studio Milmake 1999-2000,2004 -// -//---------------------------------------------------------------------------- - +/* ----------------------------------------------------------------------- + * + * Z80C : Z80 Engine - GENERIC + * + * Copyright by Studio Milmake 1999-2000,2004 + * + *------------------------------------------------------------------------ */ #ifndef CPUCALL #define CPUCALL @@ -22,9 +21,8 @@ enum { enum { IFF_IFLAG = 0, - IFF_IRQ = 1, - IFF_NMI = 2, - IFF_HALT = 3 + IFF_NMI = 1, + IFF_HALT = 2 }; @@ -86,7 +84,8 @@ typedef struct { UINT8 r2; UINT8 iff; UINT8 padding[3]; - UINT reqirq; + UINT32 irq; + UINT32 reqirq; SINT32 remainclock; SINT32 baseclock; @@ -94,7 +93,8 @@ typedef struct { } Z80STAT; typedef struct { - UINT dummy; +const UINT8 *memread; + UINT8 *memwrite; } Z80EXT; typedef struct { @@ -111,11 +111,11 @@ extern "C" { #endif extern Z80CORE z80core; +extern UINT8 mainmem[0x10000]; void CPUCALL z80c_initialize(void); void CPUCALL z80c_reset(void); void CPUCALL z80c_maketable(void); -REG8 CPUCALL z80c_ableinterrupt(void); void CPUCALL z80c_interrupt(REG8 irq); void CPUCALL z80c_nonmaskedinterrupt(void); void CPUCALL z80c_execute(void); @@ -155,16 +155,20 @@ void CPUCALL z80c_step(void); #define Z80_R2 z80core.s.r2 #define Z80_IFF z80core.s.iff +#define CPU_IRQ z80core.s.irq #define CPU_REQIRQ z80core.s.reqirq #define CPU_REMCLOCK z80core.s.remainclock #define CPU_BASECLOCK z80core.s.baseclock #define CPU_CLOCK z80core.s.clock +#define CPU_CLOCKCOUNT (CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK) + +#define Z80_DI ((z80core.s.iff & 3) != 0) +#define Z80_EI ((z80core.s.iff & 3) == 0) #define Z80_INITIALIZE z80c_initialize #define Z80_DEINITIALIZE() #define Z80_RESET z80c_reset -#define Z80_ABLEINTERRUPT z80c_ableinterrupt #define Z80_INTERRUPT(a) z80c_interrupt(a) #define Z80_NMI z80c_nonmaskedinterrupt #define Z80_EXECUTE z80c_execute