--- np2/i286c/i286c.c 2003/10/17 11:10:02 1.3 +++ np2/i286c/i286c.c 2003/10/26 07:50:36 1.6 @@ -1,6 +1,7 @@ #include "compiler.h" #include "i286.h" #include "i286c.h" +#include "v30patch.h" #include "memory.h" #include "pccore.h" #include "iocore.h" @@ -53,11 +54,14 @@ const BYTE iflags[256] = { // Z_FLAG UINT16 *reg16_b53[256]; UINT16 *reg16_b20[256]; BYTE szpcflag[0x200]; - BYTE szpflag_w[0x10000]; CALCEA c_calc_ea_dst[256]; CALCLEA c_calc_lea[192]; GETLEA c_get_ea[192]; +#if !defined(CPUW2TEST) + BYTE szpflag_w[0x10000]; +#endif + static UINT32 ea_nop(void) { @@ -116,6 +120,8 @@ void i286_initialize(void) { for (; i<0x100; i++) { c_calc_ea_dst[i] = ea_nop; } + +#if !defined(CPUW2TEST) for (i=0; i<0x10000; i++) { f = P_FLAG; for (bit=0x80; bit; bit>>=1) { @@ -131,6 +137,8 @@ void i286_initialize(void) { } szpflag_w[i] = f; } +#endif + v30init(); } void i286_reset(void) { @@ -159,7 +167,7 @@ const BYTE *ptr; I286_IP = LOADINTELWORD(ptr+0); // real mode! I286_CS = LOADINTELWORD(ptr+2); // real mode! CS_BASE = I286_CS << 4; - I286_CLOCK(20) + I286_WORKCLOCK(20); } void CPUCALL i286_interrupt(BYTE vect) { @@ -171,7 +179,7 @@ const BYTE *ptr; if (op == 0xf4) { // hlt I286_IP++; } - REGPUSH0(REAL_FLAGREG) + REGPUSH0(REAL_FLAGREG) // ここV30で辻褄が合わない REGPUSH0(I286_CS) REGPUSH0(I286_IP) @@ -182,7 +190,7 @@ const BYTE *ptr; I286_IP = LOADINTELWORD(ptr+0); // real mode! I286_CS = LOADINTELWORD(ptr+2); // real mode! CS_BASE = I286_CS << 4; - I286_CLOCK(20) + I286_WORKCLOCK(20); } void i286(void) { @@ -197,20 +205,20 @@ void i286(void) { i286_interrupt(1); } dmap_i286(); - } while(nevent.remainclock > 0); + } while(I286_REMCLOCK > 0); } else if (dmac.working) { do { GET_PCBYTE(opcode); i286op[opcode](); dmap_i286(); - } while(nevent.remainclock > 0); + } while(I286_REMCLOCK > 0); } else { do { GET_PCBYTE(opcode); i286op[opcode](); - } while(nevent.remainclock > 0); + } while(I286_REMCLOCK > 0); } }