Diff for /xmil/io/fdc.c between versions 1.16 and 1.19

version 1.16, 2004/08/15 07:52:16 version 1.19, 2004/08/18 08:08:13
Line 12 Line 12
   
 static const UINT8 fdctype[] = {1,1,1,1,1,1,1,1,2,2,2,2,3,4,3,3};  static const UINT8 fdctype[] = {1,1,1,1,1,1,1,1,2,2,2,2,3,4,3,3};
   
   enum {
           TAO_MODE_GAP    = 0x4e,
           TAO_MODE_SYNC   = 0x00,
           TAO_MODE_AM             = 0xf5,
           TAO_MODE_IM             = 0xf6,
           TAO_MODE_ID             = 0xfe,
           TAO_MODE_DATA   = 0xfb,
           TAO_ENDOFDATA   = 0xf7,
   
           TAO_CMD_GAP             = 0x4e,
           TAO_CMD_SYNC    = 0x00,
           TAO_CMD_IM_IN   = 0xf6,
           TAO_CMD_IM              = 0xfc,
           TAO_CMD_AM_IN   = 0xf5,
           TAO_CMD_IAM             = 0xfe,
           TAO_CMD_DAM             = 0xfb,
           TAO_CMD_DDAM    = 0xf8,
           TAO_CMD_CRC             = 0xf7
   };
   
   
   // ----
   
 void neitem_fdcbusy(UINT id) {  void neitem_fdcbusy(UINT id) {
   
Line 35  static void setbusy(SINT32 clock) { Line 57  static void setbusy(SINT32 clock) {
         }          }
 }  }
   
   #if defined(SUPPORT_MOTORRISEUP)
 static void setmotor(REG8 drvcmd) {  static void setmotor(REG8 drvcmd) {
   
         UINT    drv;          UINT    drv;
Line 80  void fdc_callback(void) { Line 103  void fdc_callback(void) {
         }          }
 }  }
   
   static SINT32 motorwait(REG8 drv) {
   
           SINT32  curclock;
           SINT32  nextclock;
   
           if (fdc.s.motorevent[drv] == FDCMOTOR_STARTING) {
                   curclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;
                   curclock -= fdc.s.motorclock[drv];
                   if (curclock < (SINT32)pccore.realclock) {
                           nextclock = pccore.realclock - curclock;
   //                      TRACEOUT(("motor starting busy %d", nextclock));
                           return(nextclock);
                   }
           }
           return(0);
   }
   #endif
   
   
 static REG8 getstat(void) {  static REG8 getstat(void) {
   
         FDDFILE fdd;          FDDFILE fdd;
Line 149  static REG8 type2cmd(REG8 sc) { Line 191  static REG8 type2cmd(REG8 sc) {
         FDDFILE fdd;          FDDFILE fdd;
         UINT    size;          UINT    size;
         REG8    stat;          REG8    stat;
 #if defined(SUPPORT_DISKEXT)  
         SINT32  clock;          SINT32  clock;
   #if defined(SUPPORT_DISKEXT)
         SINT32  curclock;          SINT32  curclock;
         SINT32  nextclock;          SINT32  nextclock;
         UINT32  secinfo;          UINT32  secinfo;
Line 190  static REG8 type2cmd(REG8 sc) { Line 232  static REG8 type2cmd(REG8 sc) {
         fdc.s.bufsize = size;          fdc.s.bufsize = size;
         fdc.s.curtime = 0;          fdc.s.curtime = 0;
   
 #if defined(SUPPORT_DISKEXT)  
         // ウェイト値を計算  
         clock = 0;          clock = 0;
         if (fdc.s.motorevent[fdc.s.drv] == FDCMOTOR_STARTING) {  #if defined(SUPPORT_MOTORRISEUP)
                 curclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;          clock += motorwait(fdc.s.drv);
                 curclock -= fdc.s.motorclock[fdc.s.drv];  #endif
                 if (curclock < (SINT32)pccore.realclock) {  #if defined(SUPPORT_DISKEXT)
                         nextclock = pccore.realclock - curclock;  
 //                      TRACEOUT(("motor starting busy %d", nextclock));  
                         clock += nextclock;  
                 }  
         }  
         secinfo = fdd->sec(fdd, fdc.s.media, track, sc);          secinfo = fdd->sec(fdd, fdc.s.media, track, sc);
         if (secinfo) {          if (secinfo) {
                 nextclock = LOW16(secinfo);                  nextclock = LOW16(secinfo);
Line 216  static REG8 type2cmd(REG8 sc) { Line 251  static REG8 type2cmd(REG8 sc) {
 //                                                                      LOW16(secinfo), LOW16(secinfo >> 16)));  //                                                                      LOW16(secinfo), LOW16(secinfo >> 16)));
                 clock += nextclock;                  clock += nextclock;
         }          }
         setbusy(max(clock, 500));  
 #else  
         setbusy(500);  
 #endif  #endif
           setbusy(max(clock, 500));
         return(stat);          return(stat);
 }  }
   
Line 310  void IOOUTCALL fdc_o(UINT port, REG8 val Line 343  void IOOUTCALL fdc_o(UINT port, REG8 val
         if ((port & (~7)) != 0x0ff8) {          if ((port & (~7)) != 0x0ff8) {
                 return;                  return;
         }          }
 //      TRACEOUT(("fdc %.4x,%.2x [%.4x]", port, value, Z80_PC));          TRACEOUT(("fdc %.4x,%.2x [%.4x]", port, value, Z80_PC));
         switch(port & 7) {          switch(port & 7) {
                 case 0:                                                                 // コマンド                  case 0:                                                                 // コマンド
                         fdc.s.cmd = value;                          fdc.s.cmd = value;
Line 440  void IOOUTCALL fdc_o(UINT port, REG8 val Line 473  void IOOUTCALL fdc_o(UINT port, REG8 val
                                 fdc.s.r = 0;                                            // SACOM TELENET                                  fdc.s.r = 0;                                            // SACOM TELENET
                                 fdc.s.rreg = 0;                                  fdc.s.rreg = 0;
                         }                          }
   #if defined(SUPPORT_MOTORRISEUP)
                         setmotor(value);                          setmotor(value);
   #endif
                         break;                          break;
         }          }
 }  }

Removed from v.1.16  
changed lines
  Added in v.1.19


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