示例#1
0
static void UpdateFM(void)
{
 int32 cycles = sms.timestamp - fm_last_timestamp;

 fm_div -= cycles;
 while(fm_div <= 0)
 {
  int32 new_value;

  new_value = EMU2413_calc(FMThing);

  //if(new_value > 32767) { printf("MOO0: %d\n", new_value); new_value = 32767; }
  //else if(new_value < -32768) { printf("MOO1: %d\n", new_value); new_value = -32768; }

  //if(abs(new_value) > 95)
  //{
  // printf("new=%d, last=%d\n", new_value, fm_last_value);
  // if(new_value < -) new_value = -95;
  // else new_value = 95;
  //}

  fmsynth.offset(sms.timestamp + fm_div, new_value - fm_last_value, zebuf.left());
  fmsynth.offset(sms.timestamp + fm_div, new_value - fm_last_value, zebuf.right());
  fm_last_value = new_value;
  fm_div += 72;
 }

 fm_last_timestamp = sms.timestamp;
}
示例#2
0
文件: sound.cpp 项目: IcooN/OpenEmu
static void RedoVolume(void)
{
 apu.output(zebuf.center(), zebuf.left(), zebuf.right());
 //apu.volume(0.15);
 apu.volume(0.25);
 FMSynth.volume(1.00);
}
示例#3
0
void init_apu() {
#if !defined(PSP) && !defined(EMSCRIPTEN)
    if ( SDL_Init( SDL_INIT_AUDIO ) < 0 )
    {
        atexit( SDL_Quit );
    }

  
    stereo_buf.clock_rate(CLOCK_RATE); 
    stereo_buf.set_sample_rate(SAMPLE_RATE);
    apu.treble_eq(-15.0);
    stereo_buf.bass_freq(100);
    apu.set_output( stereo_buf.center(), stereo_buf.left(), stereo_buf.right() );
    sound.start(SAMPLE_RATE, 2); 
#endif    
}
示例#4
0
static void RedoVolume(void)
{
 apu.output(zebuf.center(), zebuf.left(), zebuf.right());
 apu.volume(0.50);
 fmsynth.volume(1.0 / 16384); //32768); //1.0 / 256); // / 65536); //0.15 / 8192);
}