Diff for /np2/bios/bios1b.c between versions 1.26 and 1.37

version 1.26, 2004/03/31 19:23:37 version 1.37, 2012/01/23 09:59:51
Line 27  static BOOL setfdcmode(REG8 drv, REG8 ty Line 27  static BOOL setfdcmode(REG8 drv, REG8 ty
         if ((rpm) && (!fdc.support144)) {          if ((rpm) && (!fdc.support144)) {
                 return(FAILURE);                  return(FAILURE);
         }          }
           if ((fdc.chgreg ^ type) & 1) {
                   return(FAILURE);
           }
         fdc.chgreg = type;          fdc.chgreg = type;
         fdc.rpm[drv] = rpm;          fdc.rpm[drv] = rpm;
         if (type & 2) {          if (type & 2) {
Line 68  static void biosfd_setchrn(void) { Line 71  static void biosfd_setchrn(void) {
 #if 0  #if 0
 static void biosfd_resultout(UINT32 result) {  static void biosfd_resultout(UINT32 result) {
   
         BYTE    *ptr;          UINT8   *ptr;
   
         ptr = mem + 0x00564 + (fdc.us*8);          ptr = mem + 0x00564 + (fdc.us*8);
         ptr[0] = (BYTE)(result & 0xff) | (fdc.hd << 2) | fdc.us;          ptr[0] = (UINT8)(result & 0xff) | (fdc.hd << 2) | fdc.us;
         ptr[1] = (BYTE)(result >> 8);          ptr[1] = (UINT8)(result >> 8);
         ptr[2] = (BYTE)(result >> 16);          ptr[2] = (UINT8)(result >> 16);
         ptr[3] = fdc.C;          ptr[3] = fdc.C;
         ptr[4] = fdc.H;          ptr[4] = fdc.H;
         ptr[5] = fdc.R;          ptr[5] = fdc.R;
Line 121  static UINT16 fdfmt_biospara(REG8 type,  Line 124  static UINT16 fdfmt_biospara(REG8 type, 
                 off = 0x2361;                                                                   // see bios.cpp                  off = 0x2361;                                                                   // see bios.cpp
         }          }
         off += fdc.us * 2;          off += fdc.us * 2;
         off = MEML_READ16(seg, off);          off = MEMR_READ16(seg, off);
         off += n * 8;          off += n * 8;
         if (!(CPU_AH & 0x40)) {          if (!(CPU_AH & 0x40)) {
                 off += 4;                  off += 4;
Line 129  static UINT16 fdfmt_biospara(REG8 type,  Line 132  static UINT16 fdfmt_biospara(REG8 type, 
         if (fmt) {          if (fmt) {
                 off += 2;                  off += 2;
         }          }
         return(MEML_READ16(seg, off));          return(MEMR_READ16(seg, off));
 }  }
   
   
Line 147  enum { Line 150  enum {
   
 static void fdd_int(int result) {  static void fdd_int(int result) {
   
         if (result == FDCBIOS_NORESULT) {                                               // ver0.29          if (result == FDCBIOS_NORESULT) {
                 return;                  return;
         }          }
         switch(CPU_AH & 0x0f) {          switch(CPU_AH & 0x0f) {
Line 202  static void fdd_int(int result) { Line 205  static void fdd_int(int result) {
                         return;                          return;
         }          }
         if (fdc.chgreg & 1) {          if (fdc.chgreg & 1) {
                 mem[0x0055e] &= ~(0x01 << fdc.us);                  mem[MEMB_DISK_INTL] &= ~(0x01 << fdc.us);
         }          }
         else {          else {
                 mem[0x0055f] &= ~(0x10 << fdc.us);                  mem[MEMB_DISK_INTH] &= ~(0x10 << fdc.us);
         }          }
         CPU_IP = BIOSOFST_WAIT;          CPU_IP = BIOSOFST_WAIT;
 }  }
Line 235  static void b0patch(void) { Line 238  static void b0patch(void) {
                         REG8    c;                          REG8    c;
                         REG8    cl;                          REG8    cl;
                         REG8    last;                          REG8    last;
                         addr = ES_BASE + CPU_BP;                          addr = CPU_BP;
                         size = CPU_BX;                          size = CPU_BX;
                         cnt = 0;                          cnt = 0;
                         last = 0;                          last = 0;
                         while(size--) {                          while(size--) {
                                 c = i286_memoryread(addr++);                                  c = MEMR_READ8(CPU_ES, addr++);
                                 cl = 0;                                  cl = 0;
                                 do {                                  do {
                                         REG8 now = c & 0x80;                                          REG8 now = c & 0x80;
Line 264  static void b0patch(void) { Line 267  static void b0patch(void) {
                         }                          }
                 }                  }
                 if ((b0p.pos >> 3) < CPU_BX) {                  if ((b0p.pos >> 3) < CPU_BX) {
                         UINT32 addr;                          UINT addr;
                         REG8 c;                          REG8 c;
                         addr = ES_BASE + CPU_BP + (b0p.pos >> 3);                          addr = CPU_BP + (b0p.pos >> 3);
                         c = i286_memoryread(addr);                          c = MEMR_READ8(CPU_ES, addr);
                         c ^= (1 << (b0p.pos & 7));                          c ^= (1 << (b0p.pos & 7));
                         b0p.pos++;                          b0p.pos++;
                         i286_memorywrite(addr, c);                          MEMR_WRITE8(CPU_ES, addr, c);
                 }                  }
         }          }
 }  }
Line 288  static REG8 fdd_operate(REG8 type, REG8  Line 291  static REG8 fdd_operate(REG8 type, REG8 
         UINT16  accesssize;          UINT16  accesssize;
         UINT16  secsize;          UINT16  secsize;
         UINT16  para;          UINT16  para;
         BYTE    s;          UINT8   s;
         BYTE    ID[4];          UINT8   ID[4];
         BYTE    hd;          UINT8   hd;
         int             result = FDCBIOS_NORESULT;          int             result = FDCBIOS_NORESULT;
         UINT32  addr;          UINT32  addr;
         UINT8   mtr_c;          UINT8   mtr_c;
         UINT    mtr_r;          UINT    mtr_r;
           UINT    fmode;
   
         mtr_c = fdc.ncn;          mtr_c = fdc.ncn;
         mtr_r = 0;          mtr_r = 0;
   
         // とりあえずBIOSの時は無視する          // とりあえずBIOSの時は無視する
         fdc.mf = 0xff;                                          // ver0.29          fdc.mf = 0xff;
   
 //      TRACE_("int 1Bh", CPU_AH);  //      TRACE_("int 1Bh", CPU_AH);
   
Line 333  static REG8 fdd_operate(REG8 type, REG8  Line 337  static REG8 fdd_operate(REG8 type, REG8 
                 }                  }
                 if (!fdd_diskready(fdc.us)) {                  if (!fdd_diskready(fdc.us)) {
                         fdd_int(FDCBIOS_NONREADY);                          fdd_int(FDCBIOS_NONREADY);
                         if (CPU_AH == 0x84) {                                                           // ver0.28                          ret_ah = 0x60;
                                 return(0x68);                   // 新センスは 両用ドライブ情報も                          if ((CPU_AX & 0x8f40) == 0x8400) {
                         }                                  ret_ah |= 8;                                    // 1MB/640KB両用ドライブ
                         if (CPU_AH == 0xc4) {                                                           // ver0.31                                  if ((CPU_AH & 0x40) && (fdc.support144)) {
                                 if (fdc.support144) {                                          ret_ah |= 4;                            // 1.44対応ドライブ
                                         return(0x6c);  
                                 }                                  }
                                 return(0x68);  
                         }                          }
                         return(0x60);                          return(ret_ah);
                 }                  }
         }          }
   
         // 2DDのモード選択                                                      // ver0.29          // モード選択                                                                                                   // ver0.78
         if (type == DISKTYPE_2DD) {          fmode = (type & 1)?MEMB_F2HD_MODE:MEMB_F2DD_MODE;
                 if (!(mem[MEMB_F2DD_MODE] & (0x10 << fdc.us))) {          if (!(CPU_AL & 0x80)) {
                         ndensity = 1;                  if (!(mem[fmode] & (0x10 << fdc.us))) {
                           ndensity = TRUE;
                 }                  }
         }          }
   
Line 401  static REG8 fdd_operate(REG8 type, REG8  Line 404  static REG8 fdd_operate(REG8 type, REG8 
                                         break;                                          break;
                                 }                                  }
                                 size -= accesssize;                                  size -= accesssize;
                                 mtr_r += accesssize;                                            // ver0.26                                  mtr_r += accesssize;
                                 if ((fdc.R++ == (UINT8)para) &&                                  if ((fdc.R++ == (UINT8)para) &&
                                         (CPU_AH & 0x80) && (!fdc.hd)) {                                          (CPU_AH & 0x80) && (!fdc.hd)) {
                                         fdc.hd = 1;                                          fdc.hd = 1;
Line 439  static REG8 fdd_operate(REG8 type, REG8  Line 442  static REG8 fdd_operate(REG8 type, REG8 
                                 ret_ah |= 0x01;                                  ret_ah |= 0x01;
                         }                          }
                         else {                                                          // 2DD                          else {                                                          // 2DD
                                 if (mem[0x005ca] & (0x01 << fdc.us)) {                                  if (mem[fmode] & (0x01 << fdc.us)) {
                                         ret_ah++;                                          ret_ah |= 0x01;
                                 }                                  }
                                 if (mem[0x005ca] & (0x10 << fdc.us)) {                          // ver0.30                                  if (mem[fmode] & (0x10 << fdc.us)) {
                                         ret_ah |= 0x04;                                          ret_ah |= 0x04;
                                 }                                  }
                         }                          }
                         if (CPU_AH & 0x80) {                            // ver0.30                          if ((CPU_AX & 0x8f40) == 0x8400) {
                                 ret_ah |= 8;                                    // 1MB/640KB両用ドライブ                                  ret_ah |= 8;                                    // 1MB/640KB両用ドライブ
                                 if ((CPU_AH & 0x40) && (fdc.support144)) {                                  if ((CPU_AH & 0x40) && (fdc.support144)) {
                                         ret_ah |= 4;                            // 1.44対応ドライブ                                          ret_ah |= 4;                            // 1.44対応ドライブ
Line 491  static REG8 fdd_operate(REG8 type, REG8  Line 494  static REG8 fdd_operate(REG8 type, REG8 
                                 else {                                  else {
                                         accesssize = size;                                          accesssize = size;
                                 }                                  }
                                 MEML_READ(addr, fdc.buf, accesssize);                                  MEML_READS(addr, fdc.buf, accesssize);
                                 if (fdd_write()) {                                  if (fdd_write()) {
                                         break;                                          break;
                                 }                                  }
                                 addr += accesssize;                                  addr += accesssize;
                                 size -= accesssize;                                  size -= accesssize;
                                 mtr_r += accesssize;                                            // ver0.26                                  mtr_r += accesssize;
                                 if ((fdc.R++ == (UINT8)para) &&                                  if ((fdc.R++ == (UINT8)para) &&
                                         (CPU_AH & 0x80) && (!fdc.hd)) {                                          (CPU_AH & 0x80) && (!fdc.hd)) {
                                         fdc.hd = 1;                                          fdc.hd = 1;
Line 513  static REG8 fdd_operate(REG8 type, REG8  Line 516  static REG8 fdd_operate(REG8 type, REG8 
                                 result = FDCBIOS_SUCCESS;                                  result = FDCBIOS_SUCCESS;
                         }                          }
                         else {                          else {
                                 ret_ah = fddlasterror;                  // 0xc0         // ver0.28                                  ret_ah = fddlasterror;                  // 0xc0
                                 result = FDCBIOS_WRITEERROR;                                  result = FDCBIOS_WRITEERROR;
                         }                          }
                         break;                          break;
Line 560  static REG8 fdd_operate(REG8 type, REG8  Line 563  static REG8 fdd_operate(REG8 type, REG8 
                                 if (fdd_read()) {                                  if (fdd_read()) {
                                         break;                                          break;
                                 }                                  }
                                 MEML_WRITE(addr, fdc.buf, accesssize);                                  MEML_WRITES(addr, fdc.buf, accesssize);
                                 addr += accesssize;                                  addr += accesssize;
                                 size -= accesssize;                                  size -= accesssize;
                                 mtr_r += accesssize;                                            // ver0.26                                  mtr_r += accesssize;
                                 if (fdc.R++ == (UINT8)para) {                                  if (fdc.R++ == (UINT8)para) {
                                         if ((CPU_AH & 0x80) && (!fdc.hd)) {                                          if ((CPU_AH & 0x80) && (!fdc.hd)) {
                                                 fdc.hd = 1;                                                  fdc.hd = 1;
Line 601  static REG8 fdd_operate(REG8 type, REG8  Line 604  static REG8 fdd_operate(REG8 type, REG8 
                         }                          }
 #endif  #endif
                         else {                          else {
                                 ret_ah = fddlasterror;                          // 0xc0;        // ver0.28                                  ret_ah = fddlasterror;                          // 0xc0;
                                 result = FDCBIOS_READERROR;                                  result = FDCBIOS_READERROR;
                         }                          }
                         break;                          break;
Line 613  static REG8 fdd_operate(REG8 type, REG8  Line 616  static REG8 fdd_operate(REG8 type, REG8 
                         break;                          break;
   
                 case 0x0a:                                              // READ ID                  case 0x0a:                                              // READ ID
                         fdc.mf = CPU_AH & 0x40;                                                 // ver0.29                          fdc.mf = CPU_AH & 0x40;
                         if (CPU_AH & 0x10) {                                                    // ver0.28                          if (CPU_AH & 0x10) {
                                 if (!biosfd_seek(CPU_CL, ndensity)) {                                  if (!biosfd_seek(CPU_CL, ndensity)) {
                                         result = FDCBIOS_SEEKSUCCESS;                                          result = FDCBIOS_SEEKSUCCESS;
                                 }                                  }
Line 625  static REG8 fdd_operate(REG8 type, REG8  Line 628  static REG8 fdd_operate(REG8 type, REG8 
                                 }                                  }
                         }                          }
                         if (fdd_readid()) {                          if (fdd_readid()) {
                                 ret_ah = fddlasterror;                  // 0xa0;        // ver0.28                                  ret_ah = fddlasterror;                  // 0xa0;
                                 break;                                  break;
                         }                          }
                         if (fdc.N < 8) {                                                                // ver0.26                          if (fdc.N < 8) {
                                 mtr_r += 128 << fdc.N;                                  mtr_r += 128 << fdc.N;
                         }                          }
                         else {                          else {
Line 661  static REG8 fdd_operate(REG8 type, REG8  Line 664  static REG8 fdd_operate(REG8 type, REG8 
                         fdd_formatinit();                          fdd_formatinit();
                         pos = CPU_BP;                          pos = CPU_BP;
                         for (s=0; s<fdc.sc; s++) {                          for (s=0; s<fdc.sc; s++) {
                                 MEML_READSTR(CPU_ES, pos, ID, 4);                                  MEMR_READS(CPU_ES, pos, ID, 4);
                                 fdd_formating(ID);                                  fdd_formating(ID);
                                 pos += 4;                                  pos += 4;
                                 if (ID[3] < 8) {                                  if (ID[3] < 8) {
Line 673  static REG8 fdd_operate(REG8 type, REG8  Line 676  static REG8 fdd_operate(REG8 type, REG8 
                         }                          }
                         ret_ah = 0x00;                          ret_ah = 0x00;
                         break;                          break;
   
                   case 0x0e:                                                                                                      // ver0.78
                           if (CPU_AH & 0x80) {                    // 密度設定
                                   mem[fmode] &= 0x0f;
                                   mem[fmode] |= (UINT8)((CPU_AH & 0x0f) << 4);
                           }
                           else {                                                  // 面設定
                                   mem[fmode] &= 0xf0;
                                   mem[fmode] |= (UINT8)(CPU_AH & 0x0f);
                           }
                           ret_ah = 0x00;
                           break;
         }          }
         fdd_int(result);          fdd_int(result);
         if (mtr_c != fdc.ncn) {          if (mtr_c != fdc.ncn) {
Line 737  static UINT16 boot_fd1(REG8 type, REG8 r Line 752  static UINT16 boot_fd1(REG8 type, REG8 r
         return(bootseg);          return(bootseg);
 }  }
   
 static UINT16 boot_fd(REG8 drv, REG8 type) {                                            // ver0.27  static UINT16 boot_fd(REG8 drv, REG8 type) {
   
         UINT16  bootseg;          UINT16  bootseg;
   
Line 751  static UINT16 boot_fd(REG8 drv, REG8 typ Line 766  static UINT16 boot_fd(REG8 drv, REG8 typ
   
         // 2HD          // 2HD
         if (type & 1) {          if (type & 1) {
                   fdc.chgreg |= 0x01;
                 // 1.25MB                  // 1.25MB
                 bootseg = boot_fd1(3, 0);                  bootseg = boot_fd1(3, 0);
                 if (bootseg) {                  if (bootseg) {
Line 766  static UINT16 boot_fd(REG8 drv, REG8 typ Line 782  static UINT16 boot_fd(REG8 drv, REG8 typ
                         return(bootseg);                          return(bootseg);
                 }                  }
         }          }
         if (type & 2) {                                                                         // ver0.29          if (type & 2) {
                   fdc.chgreg &= ~0x01;
                 // 2DD                  // 2DD
                 bootseg = boot_fd1(0, 0);                  bootseg = boot_fd1(0, 0);
                 if (bootseg) {                  if (bootseg) {
                         mem[MEMB_DISK_BOOT] = (BYTE)(0x70 + drv);                          mem[MEMB_DISK_BOOT] = (UINT8)(0x70 + drv);
                         fddbios_equip(0, TRUE);                          fddbios_equip(0, TRUE);
                         return(bootseg);                          return(bootseg);
                 }                  }
         }          }
           fdc.chgreg |= 0x01;
         return(0);          return(0);
 }  }
   
Line 792  static REG16 boot_hd(REG8 drv) { Line 810  static REG16 boot_hd(REG8 drv) {
   
 REG16 bootstrapload(void) {  REG16 bootstrapload(void) {
   
         BYTE    i;          UINT8   i;
         REG16   bootseg;          REG16   bootseg;
   
 //      fdmode = 0;  //      fdmode = 0;
Line 859  void bios0x1b(void) { Line 877  void bios0x1b(void) {
         REG8    ret_ah;          REG8    ret_ah;
         REG8    flag;          REG8    flag;
   
 #if defined(SUPPORT_SCSI)  
         if ((CPU_AL & 0xf0) == 0xc0) {  
                 TRACEOUT(("%.4x:%.4x AX=%.4x BX=%.4x CX=%.4x DX=%.4 ES=%.4x BP=%.4x",  
                                                         MEML_READ16(CPU_SS, CPU_SP+2),  
                                                         MEML_READ16(CPU_SS, CPU_SP),  
                                                         CPU_AX, CPU_BX, CPU_CX, CPU_DX, CPU_ES, CPU_BP));  
                 scsicmd_bios();  
                 return;  
         }  
 #endif  
   
 #if 1                   // bypass to disk bios  #if 1                   // bypass to disk bios
 {  
         REG8    seg;          REG8    seg;
         UINT    sp;          UINT    sp;
   
         seg = mem[0x004b0 + (CPU_AL >> 4)];          seg = mem[MEMX_DISK_XROM + (CPU_AL >> 4)];
         if (seg) {          if (seg) {
                 sp = CPU_SP;                  sp = CPU_SP;
                 MEML_WRITE16(CPU_SS, sp - 2, CPU_DS);                  MEMR_WRITE16(CPU_SS, sp - 2, CPU_DS);
                 MEML_WRITE16(CPU_SS, sp - 4, CPU_SI);                  MEMR_WRITE16(CPU_SS, sp - 4, CPU_SI);
                 MEML_WRITE16(CPU_SS, sp - 6, CPU_DI);                  MEMR_WRITE16(CPU_SS, sp - 6, CPU_DI);
                 MEML_WRITE16(CPU_SS, sp - 8, CPU_ES);           // +a                  MEMR_WRITE16(CPU_SS, sp - 8, CPU_ES);           // +a
                 MEML_WRITE16(CPU_SS, sp - 10, CPU_BP);          // +8                  MEMR_WRITE16(CPU_SS, sp - 10, CPU_BP);          // +8
                 MEML_WRITE16(CPU_SS, sp - 12, CPU_DX);          // +6                  MEMR_WRITE16(CPU_SS, sp - 12, CPU_DX);          // +6
                 MEML_WRITE16(CPU_SS, sp - 14, CPU_CX);          // +4                  MEMR_WRITE16(CPU_SS, sp - 14, CPU_CX);          // +4
                 MEML_WRITE16(CPU_SS, sp - 16, CPU_BX);          // +2                  MEMR_WRITE16(CPU_SS, sp - 16, CPU_BX);          // +2
                 MEML_WRITE16(CPU_SS, sp - 18, CPU_AX);          // +0                  MEMR_WRITE16(CPU_SS, sp - 18, CPU_AX);          // +0
 #if 0  #if 0
                 TRACEOUT(("call by %.4x:%.4x",                  TRACEOUT(("call by %.4x:%.4x",
                                                         MEML_READ16(CPU_SS, CPU_SP+2),                                                          MEMR_READ16(CPU_SS, CPU_SP+2),
                                                         MEML_READ16(CPU_SS, CPU_SP)));                                                          MEMR_READ16(CPU_SS, CPU_SP)));
                 TRACEOUT(("bypass to %.4x:0018", seg << 8));                  TRACEOUT(("bypass to %.4x:0018", seg << 8));
                 TRACEOUT(("AX=%04x BX=%04x %02x:%02x:%02x:%02x ES=%04x BP=%04x",                  TRACEOUT(("AX=%04x BX=%04x %02x:%02x:%02x:%02x ES=%04x BP=%04x",
                                                         CPU_AX, CPU_BX, CPU_CL, CPU_DH, CPU_DL, CPU_CH,                                                          CPU_AX, CPU_BX, CPU_CL, CPU_DH, CPU_DL, CPU_CH,
Line 906  void bios0x1b(void) { Line 912  void bios0x1b(void) {
                 CPU_IP = 0x18;                  CPU_IP = 0x18;
                 return;                  return;
         }          }
 }  #endif
   
   #if defined(SUPPORT_SCSI)
           if ((CPU_AL & 0xf0) == 0xc0) {
                   TRACEOUT(("%.4x:%.4x AX=%.4x BX=%.4x CX=%.4x DX=%.4 ES=%.4x BP=%.4x",
                                                           MEMR_READ16(CPU_SS, CPU_SP+2),
                                                           MEMR_READ16(CPU_SS, CPU_SP),
                                                           CPU_AX, CPU_BX, CPU_CX, CPU_DX, CPU_ES, CPU_BP));
                   scsicmd_bios();
                   return;
           }
 #endif  #endif
   
         switch(CPU_AL & 0xf0) {          switch(CPU_AL & 0xf0) {
                 case 0x90:                  case 0x90:
                         ret_ah = fdd_operate(3, 0, 0);                          ret_ah = fdd_operate(3, 0, FALSE);
                         break;                          break;
   
                 case 0x30:                  case 0x30:
                 case 0xb0:                  case 0xb0:
                         ret_ah = fdd_operate(3, 1, 0);                          ret_ah = fdd_operate(3, 1, FALSE);
                         break;                          break;
   
                 case 0x10:                  case 0x10:
                         ret_ah = fdd_operate(1, 0, 0);                          ret_ah = fdd_operate(1, 0, FALSE);
                         break;                          break;
   
                 case 0x70:                  case 0x70:
                 case 0xf0:                  case 0xf0:
                         ret_ah = fdd_operate(0, 0, 0);                          ret_ah = fdd_operate(0, 0, FALSE);
                         break;                          break;
   
                 case 0x50:                  case 0x50:
                         ret_ah = fdd_operate(0, 0, 1);                          ret_ah = fdd_operate(0, 0, TRUE);
                         break;                          break;
   
                 case 0x00:                  case 0x00:
Line 951  void bios0x1b(void) { Line 967  void bios0x1b(void) {
 #if 0  #if 0
         TRACEOUT(("%04x:%04x AX=%04x BX=%04x %02x:%02x:%02x:%02x\n"     \          TRACEOUT(("%04x:%04x AX=%04x BX=%04x %02x:%02x:%02x:%02x\n"     \
                                                 "ES=%04x BP=%04x \nret=%02x",                                                  "ES=%04x BP=%04x \nret=%02x",
                                                         MEML_READ16(CPU_SS, CPU_SP+2),                                                          MEMR_READ16(CPU_SS, CPU_SP+2),
                                                         MEML_READ16(CPU_SS, CPU_SP),                                                          MEMR_READ16(CPU_SS, CPU_SP),
                                                         CPU_AX, CPU_BX, CPU_CL, CPU_DH, CPU_DL, CPU_CH,                                                          CPU_AX, CPU_BX, CPU_CL, CPU_DH, CPU_DL, CPU_CH,
                                                         CPU_ES, CPU_BP, ret_ah));                                                          CPU_ES, CPU_BP, ret_ah));
 #endif  #endif
         CPU_AH = ret_ah;          CPU_AH = ret_ah;
         flag = MEML_READ8(CPU_SS, CPU_SP+4) & 0xfe;          flag = MEMR_READ8(CPU_SS, CPU_SP+4) & 0xfe;
         if (ret_ah >= 0x20) {          if (ret_ah >= 0x20) {
                 flag += 1;                  flag += 1;
         }          }
         MEML_WRITE8(CPU_SS, CPU_SP + 4, flag);          MEMR_WRITE8(CPU_SS, CPU_SP + 4, flag);
   }
   
   UINT bios0x1b_wait(void) {
   
           UINT    addr;
           REG8    bit;
   
           if (fddmtr.busy) {
                   CPU_REMCLOCK = -1;
           }
           else {
                   if (fdc.chgreg & 1) {
                           addr = MEMB_DISK_INTL;
                           bit = 0x01;
                   }
                   else {
                           addr = MEMB_DISK_INTH;
                           bit = 0x10;
                   }
                   bit <<= fdc.us;
                   if (mem[addr] & bit) {
                           mem[addr] &= ~bit;
                           return(0);
                   }
                   else {
                           CPU_REMCLOCK -= 1000;
                   }
           }
           CPU_IP--;
           return(1);
 }  }
   

Removed from v.1.26  
changed lines
  Added in v.1.37


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