summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-06-15 04:30:02 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-06-15 04:30:02 +0000
commit5c04af50a406fe8d81ed5dbd83a691b96d34838d (patch)
treeca5c19b3a09d460e03353395430b8e320eca383f /Source/Core/AudioCommon
parent3295ec38eb5a314a2a8e3dd18d2e0f4c832f2304 (diff)
Attempt to calculate actual refresh rate (i.e. a CPU-GPU synced Mhz), no real success. Anybody have any ideas?
Is there no indication from the game when the screen refresh should occur? No, not what I could find, we currently calculate the refresh rate and m_VBeamPos from the CPU ticks progress. That works perfectly if the CPU and GPU is perfectly synced as in the single core and no-idle skipping mode. So I guess it's possible that the game doesn't indicate when the screen should be refreshed, but rather that the hardware calculate that from the CPU ticks progress. That leaves us with a problem in the dual core and idle skipping modes to calculate a CPU-GPU synced CPU ticks progress. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3447 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/AudioCommon')
-rw-r--r--Source/Core/AudioCommon/Src/Mixer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/Src/Mixer.cpp b/Source/Core/AudioCommon/Src/Mixer.cpp
index 2e9f54d327..264254e6ed 100644
--- a/Source/Core/AudioCommon/Src/Mixer.cpp
+++ b/Source/Core/AudioCommon/Src/Mixer.cpp
@@ -92,14 +92,16 @@ void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample
// Write Other Audio
if (!m_throttle)
- return;
-
+ return;
+ // -----------------------------------------------------------------------
+ // The auto throttle function. This loop will put a ceiling on the CPU MHz.
+ // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
/* This is only needed for non-AX sound, currently directly
streamed and DTK sound. For AX we call SoundStream::Update in
AXTask() for example. */
- while (m_queueSize > queue_maxlength / 2) {
-
+ while (m_queueSize > queue_maxlength / 2)
+ {
// Urgh.
if (g_dspInitialize.pEmulatorState) {
if (*g_dspInitialize.pEmulatorState != 0)
@@ -108,7 +110,8 @@ void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample
soundStream->Update();
Common::SleepCurrentThread(0);
}
-
+ // -----------------------------------------------------------------------
+
push_sync.Enter();
while (num_stereo_samples) {
acc += core_sample_rate;