Diff for /np2/cbus/pcm86io.c between versions 1.4 and 1.6

version 1.4, 2003/12/08 00:55:30 version 1.6, 2004/03/30 07:12:03
Line 46  static void IOOUTCALL pcm86_oa468(UINT p Line 46  static void IOOUTCALL pcm86_oa468(UINT p
                 pcm86.wrtpos = 0;                  pcm86.wrtpos = 0;
                 pcm86.realbuf = 0;                  pcm86.realbuf = 0;
                 pcm86.virbuf = 0;                  pcm86.virbuf = 0;
                 pcm86.write = 0;  
                 pcm86.reqirq = 0;  
                 pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;                  pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;
                 pcm86.lastclock <<= 6;                  pcm86.lastclock <<= 6;
         }          }
           if ((xchgbit & 0x10) && (!(val & 0x10))) {
                   pcm86.write = 0;
                   pcm86.reqirq = 0;
           }
         // サンプリングレート変更          // サンプリングレート変更
         if (xchgbit & 7) {          if (xchgbit & 7) {
                 pcm86.rescue = pcm86rescue[val & 7] << pcm86.stepbit;                  pcm86.rescue = pcm86rescue[val & 7] << pcm86.stepbit;
Line 61  static void IOOUTCALL pcm86_oa468(UINT p Line 63  static void IOOUTCALL pcm86_oa468(UINT p
                 pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;                  pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;
                 pcm86.lastclock <<= 6;                  pcm86.lastclock <<= 6;
         }          }
         pcm86.write = 1;  
         pcm86_setnextintr();          pcm86_setnextintr();
         (void)port;          (void)port;
 }  }
Line 124  static REG8 IOINPCALL pcm86_ia466(UINT p Line 125  static REG8 IOINPCALL pcm86_ia466(UINT p
         UINT32  past;          UINT32  past;
         REG8    ret;          REG8    ret;
   
         sound_sync();          // こんなんでお茶濁すんなら ちゃんと書き直しましょうね 漏れ…
         nowclk = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;          if (!(pcm86.fifo & 0x80)) {
         nowclk <<= 6;                  ret = 0;
         past = nowclk - pcm86.lastclock;          }
         if (past >= pcm86.stepclock) {          else {
                 RECALC_NOWCLKWAIT;                  sound_sync();
                   nowclk = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;
                   nowclk <<= 6;
                 past = nowclk - pcm86.lastclock;                  past = nowclk - pcm86.lastclock;
                   if (past >= pcm86.stepclock) {
                           RECALC_NOWCLKWAIT;
                           past = nowclk - pcm86.lastclock;
                   }
                   ret = ((past << 1) >= pcm86.stepclock)?1:0;
         }          }
         ret = ((past << 1) >= pcm86.stepclock)?1:0;  
         if (pcm86.virbuf >= PCM86_LOGICALBUF) {                 // バッファフル          if (pcm86.virbuf >= PCM86_LOGICALBUF) {                 // バッファフル
                 ret |= 0x80;                  ret |= 0x80;
         }          }
Line 148  static REG8 IOINPCALL pcm86_ia468(UINT p Line 155  static REG8 IOINPCALL pcm86_ia468(UINT p
         REG8    ret;          REG8    ret;
   
         ret = pcm86.fifo & (~0x10);          ret = pcm86.fifo & (~0x10);
   #if 1
           if (pcm86gen_intrq()) {
                   ret |= 0x10;
           }
   #elif 1         // むしろこう?
           if (pcm86.fifo & 0x20) {
                   sound_sync();
                   if (pcm86.virbuf <= pcm86.fifosize) {
                           if (pcm86.write) {
                                   pcm86.write = 0;
                           }
                           else {
                                   ret |= 0x10;
                           }
                   }
           }
   #else
         if ((pcm86.write) && (pcm86.fifo & 0x20)) {          if ((pcm86.write) && (pcm86.fifo & 0x20)) {
 //              pcm86.write = 0;  //              pcm86.write = 0;
                 sound_sync();                  sound_sync();
Line 156  static REG8 IOINPCALL pcm86_ia468(UINT p Line 180  static REG8 IOINPCALL pcm86_ia468(UINT p
                         ret |= 0x10;                          ret |= 0x10;
                 }                  }
         }          }
   #endif
         (void)port;          (void)port;
         return(ret);          return(ret);
 }  }

Removed from v.1.4  
changed lines
  Added in v.1.6


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