commit 14ec7800d010bec3e668a390e131f4ba03c48c25
Author: Andrea Musuruane <musuruan(a)gmail.com>
Date: Tue Nov 7 16:08:38 2023 +0100
Added a patch to fix building on non-x86 CPUs
fceux-2.6.6-timestamp-nonx86.patch | 42 ++++++++++++++++++++++++++++++++++++++
fceux.spec | 8 +++++++-
2 files changed, 49 insertions(+), 1 deletion(-)
---
diff --git a/fceux-2.6.6-timestamp-nonx86.patch b/fceux-2.6.6-timestamp-nonx86.patch
new file mode 100644
index 0000000..7096d59
--- /dev/null
+++ b/fceux-2.6.6-timestamp-nonx86.patch
@@ -0,0 +1,42 @@
+diff --git a/src/utils/timeStamp.cpp b/src/utils/timeStamp.cpp
+index f62d019f..efb45aac 100644
+--- a/src/utils/timeStamp.cpp
++++ b/src/utils/timeStamp.cpp
+@@ -14,6 +14,7 @@
+ //-------------------------------------------------------------------------
+ //---- Time Stamp Record
+ //-------------------------------------------------------------------------
++#ifdef __FCEU_X86_TSC_ENABLE
+ #if defined(WIN32)
+ #include <intrin.h>
+ #pragma intrinsic(__rdtsc)
+@@ -25,6 +26,7 @@ static uint64_t rdtsc()
+ {
+ return __rdtsc();
+ }
++#endif
+
+ namespace FCEU
+ {
+@@ -36,12 +38,15 @@ uint64_t timeStampRecord::qpcFreq = 0;
+
+ void timeStampRecord::readNew(void)
+ {
+-#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
+- clock_gettime( CLOCK_REALTIME, &ts );
+-#else
+- QueryPerformanceCounter((LARGE_INTEGER*)&ts);
+-#endif
+- tsc = rdtsc();
++ #ifdef __FCEU_X86_TSC_ENABLE
++ tsc = rdtsc();
++ #endif
++
++ #if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
++ clock_gettime( CLOCK_REALTIME, &ts );
++ #else
++ QueryPerformanceCounter((LARGE_INTEGER*)&ts);
++ #endif
+ }
+ #if defined(WIN32)
+ void timeStampRecord::qpcCalibrate(void)
diff --git a/fceux.spec b/fceux.spec
index 71857d3..11f86de 100644
--- a/fceux.spec
+++ b/fceux.spec
@@ -3,13 +3,16 @@
Name: fceux
Version: 2.6.6
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A cross platform, NTSC and PAL Famicom/NES emulator
License: GPLv2+
URL:
http://fceux.com/
Source:
https://github.com/TASEmulators/fceux/archive/v%{version}.tar.gz#/%{name}...
Patch0: gcc13.patch
+# Added feature macro __FCEU_X86_TSC_ENABLE to enable usage of the X86 TSC
+#
https://github.com/TASEmulators/fceux/issues/663
+Patch1: fceux-2.6.6-timestamp-nonx86.patch
BuildRequires: gcc-c++
BuildRequires: cmake
@@ -114,6 +117,9 @@ desktop-file-validate \
%changelog
+* Tue Nov 07 2023 Andrea Musuruane <musuruan(a)gmail.com> - 2.6.6-2
+- Added a patch to fix building on non-x86 CPUs
+
* Wed Aug 30 2023 Andrea Musuruane <musuruan(a)gmail.com> - 2.6.6-1
- Updated to new upstream release