mirror of
https://github.com/dolphin-emu/dolphin
synced 2025-10-06 00:13:03 +02:00
Compare commits
4 Commits
be669c7ce3
...
804cf465fc
Author | SHA1 | Date | |
---|---|---|---|
|
804cf465fc | ||
|
ab990018f2 | ||
|
ee68efeee8 | ||
|
ff0560574e |
@@ -226,7 +226,11 @@ void Mixer::MixerFifo::PushSamples(const s16* samples, std::size_t num_samples)
|
|||||||
|
|
||||||
void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
|
void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
|
||||||
{
|
{
|
||||||
m_dma_mixer.PushSamples(samples, num_samples);
|
if (IsOutputSampleRateValid())
|
||||||
|
{
|
||||||
|
m_dma_mixer.PushSamples(samples, num_samples);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_log_dsp_audio)
|
if (m_log_dsp_audio)
|
||||||
{
|
{
|
||||||
const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor();
|
const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor();
|
||||||
@@ -238,7 +242,11 @@ void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
|
|||||||
|
|
||||||
void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
|
void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
|
||||||
{
|
{
|
||||||
m_streaming_mixer.PushSamples(samples, num_samples);
|
if (IsOutputSampleRateValid())
|
||||||
|
{
|
||||||
|
m_streaming_mixer.PushSamples(samples, num_samples);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_log_dtk_audio)
|
if (m_log_dtk_audio)
|
||||||
{
|
{
|
||||||
const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor();
|
const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor();
|
||||||
@@ -251,6 +259,9 @@ void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
|
|||||||
void Mixer::PushWiimoteSpeakerSamples(const s16* samples, std::size_t num_samples,
|
void Mixer::PushWiimoteSpeakerSamples(const s16* samples, std::size_t num_samples,
|
||||||
u32 sample_rate_divisor)
|
u32 sample_rate_divisor)
|
||||||
{
|
{
|
||||||
|
if (!IsOutputSampleRateValid())
|
||||||
|
return;
|
||||||
|
|
||||||
// Max 20 bytes/speaker report, may be 4-bit ADPCM so multiply by 2
|
// Max 20 bytes/speaker report, may be 4-bit ADPCM so multiply by 2
|
||||||
static constexpr std::size_t MAX_SPEAKER_SAMPLES = 20 * 2;
|
static constexpr std::size_t MAX_SPEAKER_SAMPLES = 20 * 2;
|
||||||
std::array<s16, MAX_SPEAKER_SAMPLES * 2> samples_stereo;
|
std::array<s16, MAX_SPEAKER_SAMPLES * 2> samples_stereo;
|
||||||
@@ -274,6 +285,9 @@ void Mixer::PushWiimoteSpeakerSamples(const s16* samples, std::size_t num_sample
|
|||||||
|
|
||||||
void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_samples)
|
void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_samples)
|
||||||
{
|
{
|
||||||
|
if (!IsOutputSampleRateValid())
|
||||||
|
return;
|
||||||
|
|
||||||
// Skylander samples are always supplied as 64 bytes, 32 x 16 bit samples
|
// Skylander samples are always supplied as 64 bytes, 32 x 16 bit samples
|
||||||
// The portal speaker is 1 channel, so duplicate and play as stereo audio
|
// The portal speaker is 1 channel, so duplicate and play as stereo audio
|
||||||
static constexpr std::size_t MAX_PORTAL_SPEAKER_SAMPLES = 32;
|
static constexpr std::size_t MAX_PORTAL_SPEAKER_SAMPLES = 32;
|
||||||
@@ -299,6 +313,9 @@ void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_sample
|
|||||||
|
|
||||||
void Mixer::PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples)
|
void Mixer::PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples)
|
||||||
{
|
{
|
||||||
|
if (!IsOutputSampleRateValid())
|
||||||
|
return;
|
||||||
|
|
||||||
m_gba_mixers[device_number].PushSamples(samples, num_samples);
|
m_gba_mixers[device_number].PushSamples(samples, num_samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,6 +35,10 @@ public:
|
|||||||
void PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples);
|
void PushGBASamples(std::size_t device_number, const s16* samples, std::size_t num_samples);
|
||||||
|
|
||||||
u32 GetSampleRate() const { return m_output_sample_rate; }
|
u32 GetSampleRate() const { return m_output_sample_rate; }
|
||||||
|
void SetSampleRate(u32 output_sample_rate) { m_output_sample_rate = output_sample_rate; }
|
||||||
|
|
||||||
|
// Note: NullSoundStream sets the sample rate to 0.
|
||||||
|
bool IsOutputSampleRateValid() const { return m_output_sample_rate != 0; }
|
||||||
|
|
||||||
void SetDMAInputSampleRateDivisor(u32 rate_divisor);
|
void SetDMAInputSampleRateDivisor(u32 rate_divisor);
|
||||||
void SetStreamInputSampleRateDivisor(u32 rate_divisor);
|
void SetStreamInputSampleRateDivisor(u32 rate_divisor);
|
||||||
|
@@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
bool NullSound::Init()
|
bool NullSound::Init()
|
||||||
{
|
{
|
||||||
|
// Make Mixer aware that audio output is disabled.
|
||||||
|
GetMixer()->SetSampleRate(0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,13 @@ const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
|
|||||||
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
|
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
|
||||||
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
|
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
|
||||||
const Info<bool> MAIN_CORRECT_TIME_DRIFT{{System::Main, "Core", "CorrectTimeDrift"}, false};
|
const Info<bool> MAIN_CORRECT_TIME_DRIFT{{System::Main, "Core", "CorrectTimeDrift"}, false};
|
||||||
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true};
|
#if defined(ANDROID)
|
||||||
|
// Currently enabled by default on Android because the performance boost is really needed.
|
||||||
|
constexpr bool DEFAULT_CPU_THREAD = true;
|
||||||
|
#else
|
||||||
|
constexpr bool DEFAULT_CPU_THREAD = false;
|
||||||
|
#endif
|
||||||
|
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, DEFAULT_CPU_THREAD};
|
||||||
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
|
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
|
||||||
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};
|
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};
|
||||||
const Info<bool> MAIN_ENABLE_CHEATS{{System::Main, "Core", "EnableCheats"}, false};
|
const Info<bool> MAIN_ENABLE_CHEATS{{System::Main, "Core", "EnableCheats"}, false};
|
||||||
|
@@ -371,7 +371,7 @@ void GeneralPane::AddDescriptions()
|
|||||||
"burden by spreading Dolphin's heaviest load across two cores, which usually "
|
"burden by spreading Dolphin's heaviest load across two cores, which usually "
|
||||||
"improves performance. However, it can result in glitches and crashes."
|
"improves performance. However, it can result in glitches and crashes."
|
||||||
"<br><br>This setting cannot be changed while emulation is active."
|
"<br><br>This setting cannot be changed while emulation is active."
|
||||||
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
|
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
|
||||||
static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP(
|
static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP(
|
||||||
"Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. "
|
"Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. "
|
||||||
"These codes can be configured with the Cheats Manager in the Tools menu."
|
"These codes can be configured with the Cheats Manager in the Tools menu."
|
||||||
|
Reference in New Issue
Block a user