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

version 1.1.1.1, 2003/10/16 17:57:06 version 1.5, 2003/12/08 00:55:30
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "pccore.h"  #include        "pccore.h"
 #include        "timing.h"  
 #include        "diskdrv.h"  #include        "diskdrv.h"
 #include        "fdd_mtr.h"  #include        "fdd_mtr.h"
   #include        "timing.h"
   
   
   typedef struct {
           UINT32  tick;
           UINT    cnt;
           UINT32  fraction;
   } TIMING;
   
 static  UINT    timercnt = 0;  static  TIMING  timing;
 static  UINT32  tick = 0;  
 static  UINT32  cnt = 0;  
   
   
 void timing_init(void) {  void timing_reset(void) {
   
         cnt = 0;          timing.tick = GETTICK();
         timercnt = 0;          timing.cnt = 0;
         tick = GETTICK();          timing.fraction = 0;
 }  }
   
 void timing_setcount(UINT value) {  void timing_setcount(UINT value) {
   
         timercnt = value;          timing.cnt = value;
 }  }
   
 UINT timing_getcount(void) {                    // ver0.12 60.0Hz вк 56.4Hz  UINT timing_getcount(void) {                    // ver0.12 60.0Hz вк 56.4Hz
Line 29  UINT timing_getcount(void) {   // ver0.1 Line 33  UINT timing_getcount(void) {   // ver0.1
         UINT    steps;          UINT    steps;
   
         ticknow = GETTICK();          ticknow = GETTICK();
         span = ticknow - tick;          span = ticknow - timing.tick;
         if (span) {          if (span) {
                 fddmtr_callback(ticknow);                  fddmtr_callback(ticknow);
   
                 tick = ticknow;                  timing.tick = ticknow;
                 if (span < 1000) {                  if (span < 1000) {
                         cnt += (span * 388);                          timing.fraction += (span * 388);
                         steps = cnt / 6875;                          steps = timing.fraction / 6875;
                         timercnt += steps;                          timing.cnt += steps;
                         cnt -= (steps * 6875);                          timing.fraction -= (steps * 6875);
                 }                  }
                 else {                  else {
                         cnt = 0;                          timing.fraction = 0;
                         timercnt += 56;                          timing.cnt += 56;
                 }                  }
         }          }
         return(timercnt);          return(timing.cnt);
 }  }
   
 void timing_term(void) {  void timing_term(void) {

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


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