--- np2/i286c/cpucore.h 2003/12/26 22:24:06 1.9 +++ np2/i286c/cpucore.h 2005/03/18 06:49:16 1.22 @@ -12,7 +12,7 @@ #error : not support CPUCORE_IA32 #endif -#if !defined(CPUDEBUG) +#if 1 // !defined(CPUDEBUG) enum { I286_MEMREADMAX = 0xa4000, I286_MEMWRITEMAX = 0xa0000 @@ -148,22 +148,16 @@ typedef struct { I286REG8 b; I286REG16 w; } r; - SINT32 remainclock; - SINT32 baseclock; - UINT32 clock; - UINT32 adrsmask; // ver0.72 UINT32 es_base; UINT32 cs_base; UINT32 ss_base; UINT32 ds_base; UINT32 ss_fix; UINT32 ds_fix; + UINT32 adrsmask; // ver0.72 UINT16 prefix; UINT8 trap; - UINT8 cpu_type; - UINT32 ____pf_semaphore; // ج¤؛بحر - UINT32 ____repbak; // ج¤؛بحر - UINT32 inport; + UINT8 resetreq; // ver0.72 UINT32 ovflag; I286DTR GDTR; UINT16 MSW; @@ -172,13 +166,23 @@ typedef struct { I286DTR LDTRC; UINT16 TR; I286DTR TRC; - UINT8 resetreq; // ver0.72 + UINT8 padding[2]; + + UINT8 cpu_type; UINT8 itfbank; // ver0.72 + UINT16 ram_d0; + SINT32 remainclock; + SINT32 baseclock; + UINT32 clock; } I286STAT; typedef struct { // for ver0.73 - BYTE *ext; + UINT8 *ext; UINT32 extsize; + UINT8 *extbase; // ext - 0x100000 + UINT32 extlimit16mb; // extsize + 0x100000 + UINT8 *ems[4]; + UINT32 inport; #if defined(CPUSTRUC_MEMWAIT) UINT8 tramwait; UINT8 vramwait; @@ -201,8 +205,11 @@ extern I286CORE i286core; extern const UINT8 iflags[]; void i286c_initialize(void); +void i286c_deinitialize(void); void i286c_reset(void); void i286c_shut(void); +void i286c_setextsize(UINT32 size); +void i286c_setemm(UINT frame, UINT32 addr); void CPUCALL i286c_interrupt(REG8 vect); @@ -235,6 +242,16 @@ void v30c_step(void); #define CPU_SS i286core.s.r.w.ss #define CPU_IP i286core.s.r.w.ip +#define CPU_EAX i286core.s.r.w.ax +#define CPU_EBX i286core.s.r.w.bx +#define CPU_ECX i286core.s.r.w.cx +#define CPU_EDX i286core.s.r.w.dx +#define CPU_ESI i286core.s.r.w.si +#define CPU_EDI i286core.s.r.w.di +#define CPU_EBP i286core.s.r.w.bp +#define CPU_ESP i286core.s.r.w.sp +#define CPU_EIP i286core.s.r.w.ip + #define ES_BASE i286core.s.es_base #define CS_BASE i286core.s.cs_base #define SS_BASE i286core.s.ss_base @@ -259,10 +276,14 @@ void v30c_step(void); #define CPU_MSW i286core.s.MSW #define CPU_RESETREQ i286core.s.resetreq #define CPU_ITFBANK i286core.s.itfbank -#define CPU_INPADRS i286core.s.inport +#define CPU_RAM_D000 i286core.s.ram_d0 #define CPU_EXTMEM i286core.e.ext #define CPU_EXTMEMSIZE i286core.e.extsize +#define CPU_EXTMEMBASE i286core.e.extbase +#define CPU_EXTLIMIT16 i286core.e.extlimit16mb +#define CPU_INPADRS i286core.e.inport +#define CPU_EMSPTR i286core.e.ems #define CPU_TYPE i286core.s.cpu_type @@ -279,12 +300,18 @@ void v30c_step(void); i286core.s.trap = 0; #define CPU_STI i286core.s.r.w.flag |= I_FLAG; \ i286core.s.trap = (i286core.s.r.w.flag >> 8) & 1; +#define CPU_A20EN(en) CPU_ADRSMASK = (en)?0x00ffffff:0x000fffff; + +#define CPU_INITIALIZE i286c_initialize +#define CPU_DEINITIALIZE i286c_deinitialize +#define CPU_RESET i286c_reset +#define CPU_CLEARPREFETCH() +#define CPU_INTERRUPT(vect, soft) i286c_interrupt(vect) +#define CPU_EXEC i286c +#define CPU_EXECV30 v30c +#define CPU_SHUT i286c_shut +#define CPU_SETEXTSIZE(size) i286c_setextsize((UINT32)(size) << 20) +#define CPU_SETEMM(frame, addr) i286c_setemm(frame, addr) -#define CPU_INITIALIZE i286c_initialize -#define CPU_RESET i286c_reset -#define CPU_CLEARPREFETCH() -#define CPU_INTERRUPT(v) i286c_interrupt(v) -#define CPU_EXEC i286c -#define CPU_EXECV30 v30c -#define CPU_SHUT i286c_shut +#define CPU_STEPEXEC i286c_step