From df999066a35ed6a2c70dee4ce16a8644ad0b6fa4 Mon Sep 17 00:00:00 2001 From: Sergio Martin Date: Sat, 13 Jan 2024 13:28:32 +0100 Subject: [PATCH] Adding benchmark and starting to fix warnings --- extern/hqn/options.cpp | 2 +- meson.build | 2 +- source/core/blargg_config.h | 3 ++ tests/games/run_benchmark.sh | 70 ++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100755 tests/games/run_benchmark.sh diff --git a/extern/hqn/options.cpp b/extern/hqn/options.cpp index 2374a63..7fbebaa 100644 --- a/extern/hqn/options.cpp +++ b/extern/hqn/options.cpp @@ -91,7 +91,7 @@ double Options::getNum(const std::string &name, double def) double result; if (!has(name)) return def; - if (sscanf(m_data[name].c_str(), "%f", &result) != 1) + if (sscanf(m_data[name].c_str(), "%lf", &result) != 1) result = def; return result; } diff --git a/meson.build b/meson.build index a8bd55b..85bd2d3 100644 --- a/meson.build +++ b/meson.build @@ -41,7 +41,7 @@ quickerNESCoreSrc = [ # quickerNES Core Configuration quickerNESCoreDependency = declare_dependency( - compile_args : [ '-Wfatal-errors','-Wall' ], + compile_args : [ '-Wfatal-errors', '-Wall', '-Wno-multichar' ], include_directories : include_directories(['source', 'source/core', 'extern']), sources : [ quickerNESCoreSrc, 'extern/metrohash128/metrohash128.cpp' ] ) diff --git a/source/core/blargg_config.h b/source/core/blargg_config.h index e4333a2..3ef8c2d 100644 --- a/source/core/blargg_config.h +++ b/source/core/blargg_config.h @@ -4,11 +4,14 @@ #ifndef BLARGG_CONFIG_H #define BLARGG_CONFIG_H +#ifndef HAVE_STDINT_H #define HAVE_STDINT_H +#endif // Use standard config.h if present #ifdef HAVE_CONFIG_H #include "config.h" #endif + #endif diff --git a/tests/games/run_benchmark.sh b/tests/games/run_benchmark.sh new file mode 100755 index 0000000..f8b00bb --- /dev/null +++ b/tests/games/run_benchmark.sh @@ -0,0 +1,70 @@ +gitBranch=`git branch --show-current` +gitCommit=`git rev-parse HEAD` + +echo "Git revision: ${gitBranch}:${gitCommit}" + +echo "Getting system information" +lscpu +lsmem +echo "Running Tests sequentially..." + +pushd arkanoid +tester warps.test +tester warpless.test +popd + +pushd ninjaGaiden2 +tester pacifist.test +tester anyPercent.test +popd + +pushd superOffroad +tester anyPercent.test +popd + +pushd nigelMansell +tester anyPercent.test +popd + +pushd castlevania1 +tester pacifist.test +tester anyPercent.test +popd + +pushd saintSeiyaKanketsuHen +tester anyPercent.test +popd + +pushd tennis +tester anyPercent.test +popd + +pushd superMarioBros +tester warps.test +tester warpless.test +popd + +pushd ninjaGaiden +tester pacifist.test +tester anyPercent.test +popd + +pushd ironSword +tester anyPercent.test +popd + +pushd saintSeiyaOugonDensetsu +tester anyPercent.test +popd + +pushd princeOfPersia +tester lvl7.test +popd + +pushd solarJetman +tester anyPercent.test +popd + +pushd galaga +tester anyPercent.test +popd