This commit is contained in:
thrust26 2017-10-17 19:07:28 +02:00
commit 631a8c1567
8 changed files with 27 additions and 14 deletions

View File

@ -53,7 +53,7 @@ CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers
ifdef HAVE_GCC
CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor -std=c++14
endif
ifdef HAVE_CLANG
ifdef CLANG_WARNINGS
CXXFLAGS+= -Weverything -Wno-c++17-extensions -Wno-c++98-compat -Wno-c++98-compat-pedantic \
-Wno-double-promotion -Wno-switch-enum -Wno-conversion -Wno-covered-switch-default \
-Wno-inconsistent-missing-destructor-override \

8
configure vendored
View File

@ -414,12 +414,16 @@ if test "$have_clang" = yes; then
cxx_version="$cxx_version, bad"
cxx_verc_fail=yes
fi
# Only clang >= 5.0 supports extra warnings
if [ $clang_major -ge 5 ]; then
_make_def_CLANG_WARNINGS='CLANG_WARNINGS = 1'
fi
fi
CXXFLAGS="$CXXFLAGS"
_make_def_HAVE_GCC3='HAVE_GCC3 = 1'
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
_make_def_HAVE_GCC='HAVE_GCC = 1'
_make_def_HAVE_CLANG='HAVE_CLANG = 1'
echo "$cxx_version"
elif test "$have_gcc" = yes; then
@ -817,7 +821,7 @@ PROFILE := $_build_profile
$_make_def_HAVE_GCC
$_make_def_HAVE_GCC3
$_make_def_HAVE_CLANG
$_make_def_CLANG_WARNINGS
INCLUDES += $INCLUDES
OBJS += $OBJS

View File

@ -28,7 +28,7 @@
#include "StateManager.hxx"
#define STATE_HEADER "05000303state"
#define STATE_HEADER "05000304state"
// #define MOVIE_HEADER "03030000movie"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -244,7 +244,7 @@ void Console::autodetectYStart()
YStartDetector ystartDetector;
ystartDetector.setLayout(myDisplayFormat == "PAL" ? FrameLayout::pal : FrameLayout::ntsc);
myTIA->setFrameManager(&ystartDetector);
mySystem->reset();
mySystem->reset(true);
for (int i = 0; i < 80; i++) myTIA->update();

View File

@ -69,7 +69,7 @@ void PaddleReader::update(double value, double timestamp, ConsoleTiming consoleT
setConsoleTiming(consoleTiming);
}
if (value != myValue) { // FIXME - warning on 'no-float-equal'
if (value != myValue) {
myValue = value;
if (myValue < 0) {

View File

@ -162,7 +162,6 @@ void FrameManager::setState(FrameManager::State state)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TODO: kill this with fire once frame manager refactoring is complete
void FrameManager::onLayoutChange()
{
switch (layout())

View File

@ -18,9 +18,10 @@
#include "JitterEmulation.hxx"
enum Metrics: uInt32 {
framesForStableHeight = 2,
minDeltaForJitter = 3,
maxJitter = 50
framesForStableHeight = 2,
framesUntilDestabilization = 10,
minDeltaForJitter = 3,
maxJitter = 50
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -32,27 +33,32 @@ JitterEmulation::JitterEmulation() :
void JitterEmulation::reset()
{
myLastFrameScanlines = 0;
myStableFrameFinalLines = 0;
myStableFrameFinalLines = -1;
myStableFrames = 0;
myStabilizationCounter = 0;
myDestabilizationCounter = 0;
myJitter = 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void JitterEmulation::frameComplete(uInt32 scanlineCount)
{
if (scanlineCount != myStableFrameFinalLines) {
if (Int32(scanlineCount) != myStableFrameFinalLines) {
if (myDestabilizationCounter++ > Metrics::framesUntilDestabilization) myStableFrameFinalLines = -1;
if (scanlineCount == myLastFrameScanlines) {
if (++myStabilizationCounter >= Metrics::framesForStableHeight) {
if (myStableFrameFinalLines > 0) updateJitter(scanlineCount - myStableFrameFinalLines);
myStableFrameFinalLines = scanlineCount;
myDestabilizationCounter = 0;
}
}
else myStabilizationCounter = 0;
}
else myDestabilizationCounter = 0;
myLastFrameScanlines = scanlineCount;
@ -65,7 +71,7 @@ void JitterEmulation::updateJitter(Int32 scanlineDifference)
{
if (uInt32(abs(scanlineDifference)) < Metrics::minDeltaForJitter) return;
Int32 jitter = std::min<Int32>(jitter, Metrics::maxJitter);
Int32 jitter = std::min<Int32>(scanlineDifference, Metrics::maxJitter);
jitter = std::max<Int32>(jitter, -myYStart);
if (jitter > 0) jitter += myJitterFactor;
@ -84,6 +90,7 @@ bool JitterEmulation::save(Serializer& out) const
out.putInt(myStableFrameFinalLines);
out.putInt(myStableFrames);
out.putInt(myStabilizationCounter);
out.putInt(myDestabilizationCounter);
out.putInt(myJitter);
out.putInt(myJitterFactor);
out.putInt(myYStart);
@ -108,6 +115,7 @@ bool JitterEmulation::load(Serializer& in)
myStableFrameFinalLines = in.getInt();
myStableFrames = in.getInt();
myStabilizationCounter = in.getInt();
myDestabilizationCounter = in.getInt();
myJitter = in.getInt();
myJitterFactor = in.getInt();
myYStart = in.getInt();

View File

@ -58,12 +58,14 @@ class JitterEmulation: public Serializable {
uInt32 myLastFrameScanlines;
uInt32 myStableFrameFinalLines;
Int32 myStableFrameFinalLines;
uInt32 myStableFrames;
uInt32 myStabilizationCounter;
uInt32 myDestabilizationCounter;
Int32 myJitter;
Int32 myJitterFactor;