Fixed timing bug reported on AtariAge, also noticed on several versions

of OSX.  It was partially caused by 'negative time', or successive
calls to SDL_GetTicks() returning smaller values than previous calls.
This obviously totally confused the timing logic, which was never
designed for time to go backwards.  Related to this, setting the
framerate to 0 from the VideoDialog UI (indicating that auto-frame
should be used) ended up setting the time-per-frame to approx. 71
minutes, resulting in a delay of 71 minutes to the next frame
(which is what caused the 'lockup').

Changed all references to the Intel OSX build to also mention OSX
Snow Leopard (10.6), since the build won't run on 10.4 or 10.5.

Bumped version number to 3.1 (again).  Hopefully this is good to go.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2016 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-04-21 15:45:44 +00:00
parent 10022676e9
commit 31d3233dc0
8 changed files with 34 additions and 15 deletions

View File

@ -33,7 +33,7 @@ distributions currently available are:
* Binary distribution for MacOSX 32-bit & 64-bit : * Binary distribution for MacOSX 32-bit & 64-bit :
Stella-3.1-macosx.dmg (32-bit Universal Binary) Stella-3.1-macosx.dmg (32-bit Universal Binary)
Stella-3.1_intel-macosx.dmg (32/64-bit Intel-only) Stella-3.1_intel_10.6-macosx.dmg (32/64-bit Intel/Snow-Leopard only)
* Binary distribution in 32-bit & 64-bit Ubuntu DEB format : * Binary distribution in 32-bit & 64-bit Ubuntu DEB format :
stella_3.1-1_i386.deb stella_3.1-1_i386.deb

View File

@ -12,12 +12,16 @@
Release History Release History
=========================================================================== ===========================================================================
3.0 to 3.1: (April 16, 2010) 3.0 to 3.1: (April 22, 2010)
* Fixed a major bug with text drawing in software rendering mode. * Fixed a major bug with text drawing in software rendering mode.
Switching between windowed and fullscreen mode while text was being Switching between windowed and fullscreen mode while text was being
shown could result in garbled text or even a program crash. shown could result in garbled text or even a program crash.
* Fixed issues when using 'sleep' timing, whereby a lockup could occur
when changing video modes, and/or Stella would consume more CPU time
than was necessary.
* Integrated Distella disassembler, completely replacing the previous * Integrated Distella disassembler, completely replacing the previous
disassembler. The entire infrastructure has not been completely disassembler. The entire infrastructure has not been completely
ported yet. As a result, labels defined by the user or from a ported yet. As a result, labels defined by the user or from a
@ -45,8 +49,8 @@
actions are tied to the same keys as the enable ones, except the actions are tied to the same keys as the enable ones, except the
'Shift' key is also used. 'Shift' key is also used.
* Added 'DPC+' bankswitching scheme, thanks to Darrell Spice Jr and * Added preliminary support for 'DPC+' bankswitching scheme, thanks to
Fred Quimby. Darrell Spice Jr and Fred Quimby.
* Added '16in1' bankswitching scheme, which works with various * Added '16in1' bankswitching scheme, which works with various
ROMs labeled '128-in-1 ...' (the database has been updated for ROMs labeled '128-in-1 ...' (the database has been updated for
@ -104,9 +108,8 @@
Two versions are available: the first is a 32-bit Universal Binary Two versions are available: the first is a 32-bit Universal Binary
for OSX 10.4 - 10.6, and the second is 32/64-bit Intel-only for for OSX 10.4 - 10.6, and the second is 32/64-bit Intel-only for
OSX 10.4 - 10.6 (64-bit requires 10.6). The Intel version is OSX 10.6 (aka Snow Leopard). The Intel version is compiled with the
compiled with the very latest compiler (Clang), resulting in very latest compiler (LLVM/Clang), resulting in better performance.
better performance.
The keyboard handling is changed to match other systems in terms of The keyboard handling is changed to match other systems in terms of
where the keys actually are on the keyboard (ie, the OSX Command key where the keys actually are on the keyboard (ie, the OSX Command key

View File

@ -9,4 +9,4 @@ the Stella Website at:
Enjoy, Enjoy,
The Stella Team The Stella Team
April 16, 2010 April 23, 2010

View File

@ -438,7 +438,7 @@
&nbsp;&nbsp;&nbsp;<b>OR</b> &nbsp;&nbsp;&nbsp;<b>OR</b>
<li>Copy the <b>Stella.app</b> package to your 'Applications' folder.</li> <li>Copy the <b>Stella.app</b> package to your 'Applications' folder.</li>
</ul> </ul>
<li>For compiling the Intel version only, open the <b>stella-<i>release</i>/src/macosx/stella_intel.xcodeproj</b> file instead, and continue from <li>For compiling the Intel/Snow Leopard version, open the <b>stella-<i>release</i>/src/macosx/stella_intel.xcodeproj</b> file instead, and continue from
step 2 above.</li> step 2 above.</li>
</ol> </ol>
</li> </li>

View File

@ -22,7 +22,7 @@
#include <cstdlib> #include <cstdlib>
#define STELLA_VERSION "3.1_test6" #define STELLA_VERSION "3.1"
#define STELLA_BUILD atoi("$Rev$"+6) #define STELLA_BUILD atoi("$Rev$"+6)

View File

@ -366,8 +366,11 @@ void OSystem::setConfigFile(const string& file)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::setFramerate(float framerate) void OSystem::setFramerate(float framerate)
{ {
myDisplayFrameRate = framerate; if(framerate > 0.0)
myTimePerFrame = (uInt32)(1000000.0 / myDisplayFrameRate); {
myDisplayFrameRate = framerate;
myTimePerFrame = (uInt32)(1000000.0 / myDisplayFrameRate);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -819,8 +822,10 @@ string OSystem::getROMInfo(const Console* console)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::resetLoopTiming() void OSystem::resetLoopTiming()
{ {
memset(&myTimingInfo, 0, sizeof(TimingInfo));
myTimingInfo.start = myTimingInfo.virt = getTicks(); myTimingInfo.start = myTimingInfo.virt = getTicks();
myTimingInfo.current = 0;
myTimingInfo.totalTime = 0;
myTimingInfo.totalFrames = 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -913,6 +918,15 @@ void OSystem::mainLoop()
myTimingInfo.current = getTicks(); myTimingInfo.current = getTicks();
myTimingInfo.virt += myTimePerFrame; myTimingInfo.virt += myTimePerFrame;
// Timestamps may periodically go out of sync, particularly on systems
// that can have 'negative time' (ie, when the time seems to go backwards)
// This normally results in having a very large delay time, so we check
// for that and reset the timers when appropriate
if((myTimingInfo.virt - myTimingInfo.current) > (myTimePerFrame << 1))
{
myTimingInfo.start = myTimingInfo.current = myTimingInfo.virt = getTicks();
}
if(myTimingInfo.current < myTimingInfo.virt) if(myTimingInfo.current < myTimingInfo.virt)
SDL_Delay((myTimingInfo.virt - myTimingInfo.current) / 1000); SDL_Delay((myTimingInfo.virt - myTimingInfo.current) / 1000);

View File

@ -1813,6 +1813,7 @@
); );
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
SDKROOT = "";
VALID_ARCHS = "i386 x86_64"; VALID_ARCHS = "i386 x86_64";
}; };
name = Development; name = Development;
@ -1829,6 +1830,7 @@
GCC_OPTIMIZATION_LEVEL = 3; GCC_OPTIMIZATION_LEVEL = 3;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
MACOSX_DEPLOYMENT_TARGET = ""; MACOSX_DEPLOYMENT_TARGET = "";
SDKROOT = "";
VALID_ARCHS = "i386 x86_64"; VALID_ARCHS = "i386 x86_64";
}; };
name = Deployment; name = Deployment;
@ -1839,7 +1841,7 @@
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
MACOSX_DEPLOYMENT_TARGET = 10.4; MACOSX_DEPLOYMENT_TARGET = 10.4;
SDKROOT = macosx10.4; SDKROOT = "";
VALID_ARCHS = "i386 x86_64"; VALID_ARCHS = "i386 x86_64";
}; };
name = Default; name = Default;

View File

@ -107,7 +107,7 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
%_datadir/icons/large/%{name}.png %_datadir/icons/large/%{name}.png
%changelog %changelog
* Fri Apr 16 2010 Stephen Anthony <stephena@users.sf.net> 3.1-1 * Fri Apr 23 2010 Stephen Anthony <stephena@users.sf.net> 3.1-1
- Version 3.1 release - Version 3.1 release
* Fri Sep 11 2009 Stephen Anthony <stephena@users.sf.net> 3.0-1 * Fri Sep 11 2009 Stephen Anthony <stephena@users.sf.net> 3.0-1