summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp
diff options
context:
space:
mode:
authorsl1nk3.s <sl1nk3.s@gmail.com>2011-03-16 23:57:13 +0000
committersl1nk3.s <sl1nk3.s@gmail.com>2011-03-16 23:57:13 +0000
commitaabb542d474b4a92099aebceccc95bb47f66de9b (patch)
treed69f4f9e6af849d66000cf01708f59a77171ff0e /Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp
parent9198e83ae1bce49e872da04b5bb531c80ffde818 (diff)
Fix the framerate counter of the software graphic backend.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7363 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp
index a6dbb835d2..8870aaac83 100644
--- a/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp
+++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWmain.cpp
@@ -43,7 +43,8 @@
namespace SW
{
-static bool fifoStateRun = false;
+static volatile bool fifoStateRun = false;
+static volatile bool emuRunningState = false;
std::string VideoSoftware::GetName()
@@ -94,11 +95,12 @@ void VideoSoftware::DoState(PointerWrap&)
void VideoSoftware::RunLoop(bool enable)
{
- //EmulatorState(true);
+ emuRunningState = enable;
}
void VideoSoftware::EmuStateChange(EMUSTATE_CHANGE newState)
{
+ emuRunningState = (newState == EMUSTATE_CHANGE_PLAY) ? true : false;
}
void VideoSoftware::Shutdown()
@@ -167,13 +169,26 @@ void VideoSoftware::Video_EnterLoop()
{
fifoStateRun = true;
- while (fifoStateRun)
- {
+ while (fifoStateRun)
+ {
g_video_backend->PeekMessages();
- if (!SWCommandProcessor::RunBuffer()) {
- Common::YieldCPU();
+
+ if (!SWCommandProcessor::RunBuffer())
+ {
+ Common::YieldCPU();
}
- }
+
+ if (!emuRunningState)
+ {
+ while (!emuRunningState)
+ {
+ g_video_backend->PeekMessages();
+ Common::SleepCurrentThread(1);
+ }
+ }
+ }
+
+
}
void VideoSoftware::Video_ExitLoop()