diff --git a/source/preferences.cpp b/source/preferences.cpp index a109ce9..168fe4c 100644 --- a/source/preferences.cpp +++ b/source/preferences.cpp @@ -498,7 +498,7 @@ DefaultSettings () Settings.Stereo = true; Settings.ReverseStereo = true; Settings.SoundPlaybackRate = 48000; - Settings.SoundInputRate = 31950; + Settings.SoundInputRate = 31920; Settings.DynamicRateControl = true; // Interpolation Method diff --git a/source/snes9x/apu/apu.cpp b/source/snes9x/apu/apu.cpp index 0d1e8a4..bd4e045 100644 --- a/source/snes9x/apu/apu.cpp +++ b/source/snes9x/apu/apu.cpp @@ -15,10 +15,10 @@ #define APU_DEFAULT_INPUT_RATE 32040 #define APU_MINIMUM_SAMPLE_COUNT 512 #define APU_MINIMUM_SAMPLE_BLOCK 128 -#define APU_NUMERATOR_NTSC 15664 -#define APU_DENOMINATOR_NTSC 328125 -#define APU_NUMERATOR_PAL 34176 -#define APU_DENOMINATOR_PAL 709379 +#define APU_NUMERATOR_NTSC 5632 +#define APU_DENOMINATOR_NTSC 118125 +#define APU_NUMERATOR_PAL 35527 +#define APU_DENOMINATOR_PAL 738343 SNES_SPC *spc_core = NULL; @@ -314,7 +314,7 @@ void UpdatePlaybackRate (void) if (Settings.MSU1) { - time_ratio = (44100.0 / Settings.SoundPlaybackRate) * (Settings.SoundInputRate / 32040.0); + time_ratio = (44100.0 / Settings.SoundPlaybackRate) * (Settings.SoundInputRate / 32000.0); msu::resampler->time_ratio(time_ratio); } } diff --git a/source/snes9x/msu1.cpp b/source/snes9x/msu1.cpp index 9829a63..752e3ec 100644 --- a/source/snes9x/msu1.cpp +++ b/source/snes9x/msu1.cpp @@ -237,7 +237,7 @@ void S9xMSU1Generate(size_t sample_count) { partial_frames += 4410 * (sample_count / 2); - while ((bufPos < (bufEnd - 2)) && partial_frames >= 3204) + while ((bufPos < (bufEnd - 2)) && partial_frames >= 3200) { if (MSU1.MSU1_STATUS & AudioPlaying && audioStream) { @@ -255,7 +255,7 @@ void S9xMSU1Generate(size_t sample_count) *(bufPos++) = *left; *(bufPos++) = *right; MSU1.MSU1_AUDIO_POS += 4; - partial_frames -= 3204; + partial_frames -= 3200; } else if (bytes_read >= 0) @@ -279,7 +279,7 @@ void S9xMSU1Generate(size_t sample_count) else { MSU1.MSU1_STATUS &= ~(AudioPlaying | AudioRepeating); - partial_frames -= 3204; + partial_frames -= 3200; *(bufPos++) = 0; *(bufPos++) = 0; } diff --git a/source/snes9x/snes9x.h b/source/snes9x/snes9x.h index a2cfc72..2c60df8 100644 --- a/source/snes9x/snes9x.h +++ b/source/snes9x/snes9x.h @@ -62,7 +62,7 @@ #define IMAGE_WIDTH (Settings.SupportHiRes ? MAX_SNES_WIDTH : SNES_WIDTH) #define IMAGE_HEIGHT (Settings.SupportHiRes ? MAX_SNES_HEIGHT : SNES_HEIGHT_EXTENDED) -#define NTSC_MASTER_CLOCK 21477272.0 +#define NTSC_MASTER_CLOCK 21477272.727272 // 21477272 + 8/11 exact #define PAL_MASTER_CLOCK 21281370.0 #define SNES_MAX_NTSC_VCOUNTER 262 diff --git a/source/video.cpp b/source/video.cpp index be284bd..cf565f0 100644 --- a/source/video.cpp +++ b/source/video.cpp @@ -638,7 +638,7 @@ ResetVideo_Emu () else ResetFbWidth(512, rmode); - Settings.SoundInputRate = 31950; + Settings.SoundInputRate = 31920; UpdatePlaybackRate(); }