Diff for /np2/io/pit.c between versions 1.13 and 1.14

version 1.13, 2003/12/26 03:41:05 version 1.14, 2004/01/13 05:30:58
Line 19 Line 19
 // ver0.31 常に回す…  // ver0.31 常に回す…
 static void setsystimerevent_noint(BOOL absolute) {  static void setsystimerevent_noint(BOOL absolute) {
   
         nevent_set(NEVENT_ITIMER, pc.multiple << 16, systimer_noint, absolute);          nevent_set(NEVENT_ITIMER, pccore.multiple << 16,
                                                                                                   systimer_noint, absolute);
 }  }
   
 void systimer_noint(NEVENTITEM item) {  void systimer_noint(NEVENTITEM item) {
Line 35  static void setsystimerevent(BOOL absolu Line 36  static void setsystimerevent(BOOL absolu
   
         cnt = pit.value[0];          cnt = pit.value[0];
         if (cnt > 8) {                                                                  // 根拠なし          if (cnt > 8) {                                                                  // 根拠なし
                 cnt *= pc.multiple;                  cnt *= pccore.multiple;
         }          }
         else {          else {
                 cnt = pc.multiple << 16;                  cnt = pccore.multiple << 16;
         }          }
         nevent_set(NEVENT_ITIMER, cnt, systimer, absolute);          nevent_set(NEVENT_ITIMER, cnt, systimer, absolute);
 }  }
Line 56  void systimer(NEVENTITEM item) { Line 57  void systimer(NEVENTITEM item) {
                         setsystimerevent(NEVENT_RELATIVE);                          setsystimerevent(NEVENT_RELATIVE);
                 }                  }
                 else {                  else {
                         nevent_set(NEVENT_ITIMER, pc.multiple << 16,                          nevent_set(NEVENT_ITIMER, pccore.multiple << 16,
                                                                                                 systimer, NEVENT_RELATIVE);                                                                                                  systimer, NEVENT_RELATIVE);
                 }                  }
         }          }
Line 72  static void setbeepeventex(BOOL absolute Line 73  static void setbeepeventex(BOOL absolute
   
         cnt = pit.value[1];          cnt = pit.value[1];
         if (cnt > 2) {          if (cnt > 2) {
                 cnt *= pc.multiple;                  cnt *= pccore.multiple;
         }          }
         else {          else {
                 cnt = pc.multiple << 16;                  cnt = pccore.multiple << 16;
         }          }
         while(cnt < 0x100000) {          while(cnt < 0x100000) {
                 cnt <<= 1;                  cnt <<= 1;
Line 90  static void setbeepevent(BOOL absolute)  Line 91  static void setbeepevent(BOOL absolute) 
   
         cnt = pit.value[1];          cnt = pit.value[1];
         if (cnt > 2) {          if (cnt > 2) {
                 cnt *= pc.multiple;                  cnt *= pccore.multiple;
         }          }
         else {          else {
                 cnt = pc.multiple << 16;                  cnt = pccore.multiple << 16;
         }          }
         nevent_set(NEVENT_BEEP, cnt, beeponeshot, absolute);          nevent_set(NEVENT_BEEP, cnt, beeponeshot, absolute);
 }  }
Line 127  static void setrs232cevent(BOOL absolute Line 128  static void setrs232cevent(BOOL absolute
         SINT32  cnt;          SINT32  cnt;
   
         if (pit.value[2] > 1) {          if (pit.value[2] > 1) {
                 cnt = pc.multiple * pit.value[2] * rs232c.mul;                  cnt = pccore.multiple * pit.value[2] * rs232c.mul;
         }          }
         else {          else {
                 cnt = (pc.multiple << 16) * rs232c.mul;                  cnt = (pccore.multiple << 16) * rs232c.mul;
         }          }
         nevent_set(NEVENT_RS232C, cnt, rs232ctimer, absolute);          nevent_set(NEVENT_RS232C, cnt, rs232ctimer, absolute);
 }  }
Line 170  static UINT pit_latch(int ch) { Line 171  static UINT pit_latch(int ch) {
                 if (clock < 0) {                  if (clock < 0) {
                         return(0);                          return(0);
                 }                  }
                 clock /= pc.multiple;                  clock /= pccore.multiple;
                 if (pit.value[1] > 2) {                  if (pit.value[1] > 2) {
                         clock %= pit.value[1];                          clock %= pit.value[1];
                 }                  }
Line 182  static UINT pit_latch(int ch) { Line 183  static UINT pit_latch(int ch) {
         }          }
         clock = nevent_getremain(NEVENT_ITIMER + ch);          clock = nevent_getremain(NEVENT_ITIMER + ch);
         if (clock >= 0) {          if (clock >= 0) {
                 return(clock / pc.multiple);                  return(clock / pccore.multiple);
         }          }
         return(0);          return(0);
 }  }
Line 336  static const IOINP piti71[4] = { Line 337  static const IOINP piti71[4] = {
 void itimer_reset(void) {  void itimer_reset(void) {
   
         ZeroMemory(&pit, sizeof(pit));          ZeroMemory(&pit, sizeof(pit));
         if (pc.cpumode & CPUMODE_8MHz) {          if (pccore.cpumode & CPUMODE_8MHz) {
                 pit.value[1] = 998;                             // 4MHz                  pit.value[1] = 998;                             // 4MHz
         }          }
         else {          else {

Removed from v.1.13  
changed lines
  Added in v.1.14


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