Diff for /np2/i286c/i286c.c between versions 1.1.1.1 and 1.5

version 1.1.1.1, 2003/10/16 17:57:37 version 1.5, 2003/10/19 14:56:15
Line 8 Line 8
 #include        "i286c.mcr"  #include        "i286c.mcr"
   
   
         I286REGS        i286r;          I286REG         i286reg;
         I286STAT        i286s;  
         I286DTR         GDTR;  
         I286DTR         IDTR;  
         UINT16          MSW;  
   
 const BYTE iflags[256] = {                                      // Z_FLAG, S_FLAG, P_FLAG  const BYTE iflags[256] = {                                      // Z_FLAG, S_FLAG, P_FLAG
                         0x44, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x00,                          0x44, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x00,
Line 51  const BYTE iflags[256] = {     // Z_FLAG Line 47  const BYTE iflags[256] = {     // Z_FLAG
   
 // ----  // ----
   
         DWORD   EA_FIX;          UINT32  EA_FIX;
         BYTE    *reg8_b53[256];          BYTE    *reg8_b53[256];
         BYTE    *reg8_b20[256];          BYTE    *reg8_b20[256];
         UINT16  *reg16_b53[256];          UINT16  *reg16_b53[256];
         UINT16  *reg16_b20[256];          UINT16  *reg16_b20[256];
         BYTE    szpcflag[0x200];          BYTE    szpcflag[0x200];
         BYTE    szpflag_w[0x10000];  
         CALCEA  c_calc_ea_dst[256];          CALCEA  c_calc_ea_dst[256];
         CALCLEA c_calc_lea[192];          CALCLEA c_calc_lea[192];
         GETLEA  c_get_ea[192];          GETLEA  c_get_ea[192];
   
   #if !defined(CPUW2TEST)
           BYTE    szpflag_w[0x10000];
   #endif
   
   
 static UINT32 ea_nop(void) {  static UINT32 ea_nop(void) {
   
Line 99  void i286_initialize(void) { Line 98  void i286_initialize(void) {
                 pos = ((i & 0x20)?0:1);                  pos = ((i & 0x20)?0:1);
 #endif  #endif
                 pos += ((i >> 3) & 3) * 2;                  pos += ((i >> 3) & 3) * 2;
                 reg8_b53[i] = ((BYTE *)&i286r) + pos;                  reg8_b53[i] = ((BYTE *)&I286_REG) + pos;
 #if defined(BYTESEX_LITTLE)  #if defined(BYTESEX_LITTLE)
                 pos = ((i & 0x4)?1:0);                  pos = ((i & 0x4)?1:0);
 #else  #else
                 pos = ((i & 0x4)?0:1);                  pos = ((i & 0x4)?0:1);
 #endif  #endif
                 pos += (i & 3) * 2;                  pos += (i & 3) * 2;
                 reg8_b20[i] = ((BYTE *)&i286r) + pos;                  reg8_b20[i] = ((BYTE *)&I286_REG) + pos;
                 reg16_b53[i] = ((UINT16 *)&i286r) + ((i >> 3) & 7);                  reg16_b53[i] = ((UINT16 *)&I286_REG) + ((i >> 3) & 7);
                 reg16_b20[i] = ((UINT16 *)&i286r) + (i & 7);                  reg16_b20[i] = ((UINT16 *)&I286_REG) + (i & 7);
         }          }
   
         for (i=0; i<0xc0; i++) {          for (i=0; i<0xc0; i++) {
Line 120  void i286_initialize(void) { Line 119  void i286_initialize(void) {
         for (; i<0x100; i++) {          for (; i<0x100; i++) {
                 c_calc_ea_dst[i] = ea_nop;                  c_calc_ea_dst[i] = ea_nop;
         }          }
   
   #if !defined(CPUW2TEST)
         for (i=0; i<0x10000; i++) {          for (i=0; i<0x10000; i++) {
                 f = P_FLAG;                  f = P_FLAG;
                 for (bit=0x80; bit; bit>>=1) {                  for (bit=0x80; bit; bit>>=1) {
Line 135  void i286_initialize(void) { Line 136  void i286_initialize(void) {
                 }                  }
                 szpflag_w[i] = f;                  szpflag_w[i] = f;
         }          }
   #endif
 }  }
   
 void i286_reset(void) {  void i286_reset(void) {
   
         i286_initialize();          i286_initialize();
         ZeroMemory(&i286r, sizeof(i286r));          ZeroMemory(&i286reg, sizeof(i286reg));
         ZeroMemory(&i286s, sizeof(i286s));  
         I286_CS = 0x1fc0;          I286_CS = 0x1fc0;
         CS_BASE = 0x1fc00;          CS_BASE = 0x1fc00;
         ZeroMemory(&GDTR, sizeof(GDTR));  
         ZeroMemory(&IDTR, sizeof(IDTR));  
         MSW = 0;  
 }  }
   
 void i286_resetprefetch(void) {  void i286_resetprefetch(void) {
 }  }
   
 void CPUCALL i286_intnum(DWORD vect, WORD IP) {  void CPUCALL i286_intnum(UINT vect, UINT16 IP) {
   
 const BYTE      *ptr;  const BYTE      *ptr;
   
Line 167  const BYTE *ptr; Line 165  const BYTE *ptr;
         I286_IP = LOADINTELWORD(ptr+0);                         // real mode!          I286_IP = LOADINTELWORD(ptr+0);                         // real mode!
         I286_CS = LOADINTELWORD(ptr+2);                         // real mode!          I286_CS = LOADINTELWORD(ptr+2);                         // real mode!
         CS_BASE = I286_CS << 4;          CS_BASE = I286_CS << 4;
         I286_CLOCK(20)          I286_WORKCLOCK(20);
 }  }
   
 void CPUCALL i286_interrupt(BYTE vect) {  void CPUCALL i286_interrupt(BYTE vect) {
   
         BYTE    op;          UINT    op;
 const BYTE      *ptr;  const BYTE      *ptr;
   
         op = i286_memoryread(I286_IP + CS_BASE);          op = i286_memoryread(I286_IP + CS_BASE);
Line 189  const BYTE *ptr; Line 187  const BYTE *ptr;
         ptr = I286_MEM + (vect * 4);          ptr = I286_MEM + (vect * 4);
         I286_IP = LOADINTELWORD(ptr+0);                         // real mode!          I286_IP = LOADINTELWORD(ptr+0);                         // real mode!
         I286_CS = LOADINTELWORD(ptr+2);                         // real mode!          I286_CS = LOADINTELWORD(ptr+2);                         // real mode!
         CS_BASE = (UINT32)I286_CS << 4;          CS_BASE = I286_CS << 4;
         I286_CLOCK(20)          I286_WORKCLOCK(20);
 }  }
   
 void i286(void) {  void i286(void) {
Line 205  void i286(void) { Line 203  void i286(void) {
                                 i286_interrupt(1);                                  i286_interrupt(1);
                         }                          }
                         dmap_i286();                          dmap_i286();
                 } while(nevent.remainclock > 0);                  } while(I286_REMCLOCK > 0);
         }          }
         else if (dmac.working) {          else if (dmac.working) {
                 do {                  do {
                         GET_PCBYTE(opcode);                          GET_PCBYTE(opcode);
                         i286op[opcode]();                          i286op[opcode]();
                         dmap_i286();                          dmap_i286();
                 } while(nevent.remainclock > 0);                  } while(I286_REMCLOCK > 0);
         }          }
         else {          else {
                 do {                  do {
                         GET_PCBYTE(opcode);                          GET_PCBYTE(opcode);
                         i286op[opcode]();                          i286op[opcode]();
                 } while(nevent.remainclock > 0);                  } while(I286_REMCLOCK > 0);
         }          }
 }  }
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.5


RetroPC.NET-CVS <cvs@retropc.net>