mirror of https://github.com/stella-emu/stella.git
Remove busy waiting.
This commit is contained in:
parent
50ee957a29
commit
89a6cb11d1
|
@ -686,8 +686,6 @@ double OSystem::dispatchEmulation(EmulationWorker& emulationWorker)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void OSystem::mainLoop()
|
||||
{
|
||||
// Sleep-based wait: good for CPU, bad for graphical sync
|
||||
bool busyWait = mySettings->getString("timing") != "sleep";
|
||||
// 6507 time
|
||||
time_point<high_resolution_clock> virtualTime = high_resolution_clock::now();
|
||||
// The emulation worker
|
||||
|
@ -726,10 +724,7 @@ void OSystem::mainLoop()
|
|||
virtualTime = now;
|
||||
else if (virtualTime > now) {
|
||||
// Wait until we have caught up with 6507 time
|
||||
if (busyWait && myEventHandler->state() == EventHandlerState::EMULATION) {
|
||||
while (high_resolution_clock::now() < virtualTime);
|
||||
}
|
||||
else std::this_thread::sleep_until(virtualTime);
|
||||
std::this_thread::sleep_until(virtualTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ Settings::Settings(OSystem& osystem)
|
|||
setInternal("fullscreen", "false");
|
||||
setInternal("center", "false");
|
||||
setInternal("palette", "standard");
|
||||
setInternal("timing", "sleep");
|
||||
setInternal("uimessages", "true");
|
||||
|
||||
// TIA specific options
|
||||
|
@ -308,9 +307,6 @@ void Settings::validate()
|
|||
f = getFloat("speed");
|
||||
if (f <= 0) setInternal("speed", "1.0");
|
||||
|
||||
s = getString("timing");
|
||||
if(s != "sleep" && s != "busy") setInternal("timing", "sleep");
|
||||
|
||||
i = getInt("tia.aspectn");
|
||||
if(i < 80 || i > 120) setInternal("tia.aspectn", "90");
|
||||
i = getInt("tia.aspectp");
|
||||
|
|
|
@ -215,11 +215,6 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
wid.push_back(myCenter);
|
||||
ypos += (lineHeight + VGAP) * 2;
|
||||
|
||||
// Timing to use between frames
|
||||
myFrameTiming = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Idle between frames (*)");
|
||||
wid.push_back(myFrameTiming);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// Use multi-threading
|
||||
myUseThreads = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Multi-threading");
|
||||
wid.push_back(myUseThreads);
|
||||
|
@ -359,9 +354,6 @@ void VideoDialog::loadConfig()
|
|||
// TIA interpolation
|
||||
myTIAInterpolate->setState(instance().settings().getBool("tia.inter"));
|
||||
|
||||
// Wait between frames
|
||||
myFrameTiming->setState(instance().settings().getString("timing") == "sleep");
|
||||
|
||||
// Aspect ratio setting (NTSC and PAL)
|
||||
myNAspectRatio->setValue(instance().settings().getInt("tia.aspectn"));
|
||||
myPAspectRatio->setValue(instance().settings().getInt("tia.aspectp"));
|
||||
|
@ -431,9 +423,6 @@ void VideoDialog::saveConfig()
|
|||
instance().settings().setValue("palette",
|
||||
myTIAPalette->getSelectedTag().toString());
|
||||
|
||||
// Wait between frames
|
||||
instance().settings().setValue("timing", myFrameTiming->getState() ? "sleep" : "busy");
|
||||
|
||||
// TIA interpolation
|
||||
instance().settings().setValue("tia.inter", myTIAInterpolate->getState());
|
||||
|
||||
|
@ -514,7 +503,6 @@ void VideoDialog::setDefaults()
|
|||
myRenderer->setSelectedIndex(0);
|
||||
myTIAZoom->setSelected("3", "");
|
||||
myTIAPalette->setSelected("standard", "");
|
||||
myFrameTiming->setState(true);
|
||||
myTIAInterpolate->setState(false);
|
||||
myNAspectRatio->setValue(91);
|
||||
myPAspectRatio->setValue(109);
|
||||
|
|
|
@ -54,7 +54,6 @@ class VideoDialog : public Dialog
|
|||
PopUpWidget* myRenderer;
|
||||
PopUpWidget* myTIAZoom; // TODO: SliderWidget
|
||||
PopUpWidget* myTIAPalette;
|
||||
CheckboxWidget* myFrameTiming;
|
||||
CheckboxWidget* myTIAInterpolate;
|
||||
SliderWidget* myNAspectRatio;
|
||||
SliderWidget* myPAspectRatio;
|
||||
|
|
Loading…
Reference in New Issue