Exemplo n.º 1
0
int SPC_set_state(SPC_Config *cfg)
{
    int i;

    Settings.APUEnabled = TRUE;
    Settings.InterpolatedSound = (cfg->is_interpolation) ? TRUE : FALSE;
    Settings.SoundEnvelopeHeightReading = TRUE;
    Settings.DisableSoundEcho = (cfg->is_echo) ? FALSE : TRUE;
    //   Settings.EnableExtraNoise = TRUE;
	Settings.ReverseStereo = 0;
	Settings.AltSampleDecode = 0;

    // SPC mixer information
    //samples_per_mix = cfg->sampling_rate / RATE * cfg->channels;
    samples_per_mix = cfg->sampling_rate / RATE * cfg->channels;
    so.playback_rate = cfg->sampling_rate;
    so.err_rate = (uint32)(SNES_SCANLINE_TIME * 0x10000UL / (1.0 / (double) so.playback_rate));
    S9xSetEchoDelay(APU.DSP [APU_EDL] & 0xf);
    for (i = 0; i < 8; i++)
	S9xSetSoundFrequency(i, SoundData.channels [i].hertz);
    so.buffer_size = samples_per_mix;
    so.stereo = (cfg->channels == 2) ? TRUE : FALSE;

    if (cfg->resolution == 16){
        so.buffer_size *= 2;
        so.sixteen_bit = TRUE;
    } else
        so.sixteen_bit = FALSE;
    
    so.encoded = FALSE;
    so.mute_sound = FALSE;

    return so.buffer_size;
}
Exemplo n.º 2
0
static inline void S9xSetEchoWriteEnable(uint8 byte) {
    SoundData.echo_write_enabled = byte;
    S9xSetEchoDelay(APU.DSP [APU_EDL] & 15);
}