Diff for /np2/sound/sound.c between versions 1.9 and 1.12

version 1.9, 2003/11/28 08:01:33 version 1.12, 2004/01/13 05:30:59
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "soundmng.h"  #include        "soundmng.h"
 #include        "i286.h"  #include        "cpucore.h"
 #include        "pccore.h"  #include        "pccore.h"
 #include        "iocore.h"  #include        "iocore.h"
 #include        "sound.h"  #include        "sound.h"
 #include        "sndcsec.h"  #include        "sndcsec.h"
 #include        "beep.h"  #include        "beep.h"
   
   
         SOUNDCFG        soundcfg;          SOUNDCFG        soundcfg;
   
   
Line 126  void sound_reset(void) { Line 125  void sound_reset(void) {
         if (sndstream.buffer) {          if (sndstream.buffer) {
                 soundmng_reset();                  soundmng_reset();
                 streamreset();                  streamreset();
                 soundcfg.lastclock = I286_CLOCK;                  soundcfg.lastclock = CPU_CLOCK;
                 beep_eventreset();                  beep_eventreset();
         }          }
 }  }
Line 142  void sound_changeclock(void) { Line 141  void sound_changeclock(void) {
         }          }
   
         // とりあえず 25で割り切れる。          // とりあえず 25で割り切れる。
         clock = pc.realclock / 25;          clock = pccore.realclock / 25;
         hz = soundcfg.rate / 25;          hz = soundcfg.rate / 25;
   
         // で、クロック数に合せて調整。(64bit演算しろよな的)          // で、クロック数に合せて調整。(64bit演算しろよな的)
Line 154  void sound_changeclock(void) { Line 153  void sound_changeclock(void) {
         soundcfg.hzbase = hz;          soundcfg.hzbase = hz;
         soundcfg.clockbase = clock;          soundcfg.clockbase = clock;
         soundcfg.minclock = 2 * clock / hz;          soundcfg.minclock = 2 * clock / hz;
         soundcfg.lastclock = I286_CLOCK;          soundcfg.lastclock = CPU_CLOCK;
 }  }
   
 void sound_streamregist(void *hdl, SOUNDCB cbfn) {  void sound_streamregist(void *hdl, SOUNDCB cbfn) {
Line 180  void sound_sync(void) { Line 179  void sound_sync(void) {
                 return;                  return;
         }          }
   
         length = I286_CLOCK + I286_BASECLOCK - I286_REMCLOCK - soundcfg.lastclock;          length = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK - soundcfg.lastclock;
         if (length < soundcfg.minclock) {          if (length < soundcfg.minclock) {
                 return;                  return;
         }          }
Line 217  const SINT32 *ret; Line 216  const SINT32 *ret;
                 SNDCSEC_ENTER;                  SNDCSEC_ENTER;
                 if (sndstream.remain > sndstream.reserve) {                  if (sndstream.remain > sndstream.reserve) {
                         streamprepare(sndstream.remain - sndstream.reserve);                          streamprepare(sndstream.remain - sndstream.reserve);
                         soundcfg.lastclock = I286_CLOCK + I286_BASECLOCK - I286_REMCLOCK;                          soundcfg.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK;
                         beep_eventreset();                          beep_eventreset();
                 }                  }
         }          }

Removed from v.1.9  
changed lines
  Added in v.1.12


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