From 35bea51ca2d9ece948c5a084764626ab010c0b76 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:15:43 -0300 Subject: [PATCH 01/13] Jenkins: Return Windows builds to Win32 --- .ci/Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index a9c11c69e..0fd252253 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -24,6 +24,11 @@ def osArchs = [ 'Linux': ['x86', 'x86_64', 'arm32', 'arm64'] ] +def osFlags = [ + 'Windows': '', + 'Linux': '-D QT=ON' +] + def archNames = [ '32': 'x86 (32-bit)', 'x86': 'x86 (32-bit)', @@ -229,7 +234,7 @@ pipeline { /* Run build process. */ def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}" dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") { - runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} -D QT=ON -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"") + runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} ${osFlags[os]} -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"") } /* Archive resulting artifacts. */ From 135eb348713a0470a0ad8604262f4de330d9f9f0 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:44:42 -0300 Subject: [PATCH 02/13] CMake: Fix mistakes on ARM64 flags --- cmake/flags-gcc-aarch64.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/flags-gcc-aarch64.cmake b/cmake/flags-gcc-aarch64.cmake index 2de0cc053..d1f36af9c 100644 --- a/cmake/flags-gcc-aarch64.cmake +++ b/cmake/flags-gcc-aarch64.cmake @@ -14,7 +14,7 @@ # Copyright 2021 David Hrdlička. # -string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") -string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") +string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a ${CMAKE_C_FLAGS_INIT}") +string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a ${CMAKE_CXX_FLAGS_INIT}") include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) \ No newline at end of file From 1437c86245f48aa602cd9f419387f690d521803e Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:53:57 -0300 Subject: [PATCH 03/13] CMake: Move x86-specific -mstackrealign flag across toolchain files --- cmake/flags-gcc-i686.cmake | 4 ++-- cmake/flags-gcc-x86_64.cmake | 4 ++-- cmake/flags-gcc.cmake | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/flags-gcc-i686.cmake b/cmake/flags-gcc-i686.cmake index 6d1afd6a9..870fbc5df 100644 --- a/cmake/flags-gcc-i686.cmake +++ b/cmake/flags-gcc-i686.cmake @@ -14,7 +14,7 @@ # Copyright 2021 David Hrdlička. # -string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") -string(APPEND CMAKE_CXX_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") +string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_C_FLAGS_INIT}") +string(APPEND CMAKE_CXX_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_CXX_FLAGS_INIT}") include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) diff --git a/cmake/flags-gcc-x86_64.cmake b/cmake/flags-gcc-x86_64.cmake index e373a1fec..9099d8749 100644 --- a/cmake/flags-gcc-x86_64.cmake +++ b/cmake/flags-gcc-x86_64.cmake @@ -14,7 +14,7 @@ # Copyright 2021 David Hrdlička. # -string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") -string(APPEND CMAKE_CXX_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}") +string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_C_FLAGS_INIT}") +string(APPEND CMAKE_CXX_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign ${CMAKE_CXX_FLAGS_INIT}") include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) diff --git a/cmake/flags-gcc.cmake b/cmake/flags-gcc.cmake index 266b70d44..3339ad063 100644 --- a/cmake/flags-gcc.cmake +++ b/cmake/flags-gcc.cmake @@ -14,8 +14,8 @@ # # Define our flags -string(APPEND CMAKE_C_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") -string(APPEND CMAKE_CXX_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") +string(APPEND CMAKE_C_FLAGS_INIT " -fomit-frame-pointer -Wall -fno-strict-aliasing") +string(APPEND CMAKE_CXX_FLAGS_INIT " -fomit-frame-pointer -Wall -fno-strict-aliasing") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -g0 -O3") string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -g0 -O3") string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -ggdb -Og") From e14bbb6f1bb3849d2d2c8b56924558122f2a5237 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:55:12 -0300 Subject: [PATCH 04/13] Jenkins: Use CMake toolchain files for compiler flags --- .ci/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.ci/build.sh b/.ci/build.sh index 2f6902e6b..dddd32d9d 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -250,6 +250,14 @@ else *) libdir="$arch_gnu";; esac + # Determine toolchain file for this architecture. + case $arch in + x86) toolchain="flags-gcc-i686";; + arm32) toolchain="flags-gcc-armv7";; + arm64) toolchain="flags-gcc-aarch64";; + *) toolchain="flags-gcc-$arch";; + esac + # Create CMake toolchain file. cat << EOF > toolchain.cmake set(CMAKE_SYSTEM_NAME Linux) @@ -271,6 +279,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(ENV{PKG_CONFIG_PATH} "") set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/$libdir/pkgconfig:/usr/share/$libdir/pkgconfig") + +include("$cwd/cmake/$toolchain.cmake") EOF cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake" strip_binary="$arch_gnu-strip" From 57c03d9fa327210ff0f25e9367119e6f52d9f186 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:55:35 -0300 Subject: [PATCH 05/13] CMake: Remove compiler flags from presets --- CMakePresets.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 8ff0e502c..f85564b19 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,15 +9,7 @@ { "name": "flags-base", "cacheVariables": { - "CMAKE_CONFIGURATION_TYPES": "Debug;Release;Optimized", - "CMAKE_C_FLAGS": "-msse2 -mfpmath=sse -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing", - "CMAKE_CXX_FLAGS": "-msse2 -mfpmath=sse -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing", - "CMAKE_C_FLAGS_RELEASE": "-g0 -O3", - "CMAKE_CXX_FLAGS_RELEASE": "-g0 -O3", - "CMAKE_C_FLAGS_DEBUG": "-ggdb -Og", - "CMAKE_CXX_FLAGS_DEBUG": "-ggdb -Og", - "CMAKE_C_FLAGS_OPTIMIZED": "-march=native -mtune=native -O3 -ffp-contract=fast -flto", - "CMAKE_CXX_FLAGS_OPTIMIZED": "-march=native -mtune=native -O3 -ffp-contract=fast -flto" + "CMAKE_CONFIGURATION_TYPES": "Debug;Release;Optimized" }, "hidden": true, "binaryDir": "build" From c39a2a69dc811b0302cea10bcb9e07801196bccb Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:56:11 -0300 Subject: [PATCH 06/13] Jenkins: Remove redundant packaging-related package dependencies --- .ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index dddd32d9d..722dc2611 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -214,7 +214,7 @@ else esac # Establish general dependencies. - pkgs="cmake pkg-config git tar xz-utils dpkg-dev rpm wayland-protocols" + pkgs="cmake pkg-config git tar xz-utils wayland-protocols" if [ "$(dpkg --print-architecture)" = "$arch_deb" ] then pkgs="$pkgs build-essential" From e45f5f67d280555d22921ae255694a37194e0df2 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 14:06:07 -0300 Subject: [PATCH 07/13] Jenkins: Use CMake toolchain files on Windows as well --- .ci/build.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 722dc2611..445b5fbfb 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -176,6 +176,15 @@ fi echo [-] Building [$package_name] for [$arch] with flags [$cmake_flags] +# Determine CMake toolchain file for this architecture. +case $arch in + 32 | x86) toolchain="flags-gcc-i686";; + 64 | x86_64) toolchain="flags-gcc-x86_64";; + ARM32 | arm32) toolchain="flags-gcc-armv7";; + ARM64 | arm64) toolchain="flags-gcc-aarch64";; + *) toolchain="flags-gcc-$arch";; +esac + # Perform platform-specific setup. strip_binary=strip if is_windows @@ -200,6 +209,9 @@ then exit 2 fi echo [-] Using MSYSTEM [$MSYSTEM] + + # Point CMake to the toolchain file. + cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=\"$cwd/cmake/$toolchain.cmake\"" elif is_mac then # macOS lacks nproc, but sysctl can do the same job. @@ -250,14 +262,6 @@ else *) libdir="$arch_gnu";; esac - # Determine toolchain file for this architecture. - case $arch in - x86) toolchain="flags-gcc-i686";; - arm32) toolchain="flags-gcc-armv7";; - arm64) toolchain="flags-gcc-aarch64";; - *) toolchain="flags-gcc-$arch";; - esac - # Create CMake toolchain file. cat << EOF > toolchain.cmake set(CMAKE_SYSTEM_NAME Linux) @@ -306,11 +310,11 @@ find . \( -name Makefile -o -name CMakeCache.txt -o -name CMakeFiles \) -exec rm # Add ARCH to skip the arch_detect process. case $arch in - 32 | x86) cmake_flags_extra="$cmake_flags_extra -D ARCH=i386";; - 64 | x86_64) cmake_flags_extra="$cmake_flags_extra -D ARCH=x86_64";; - ARM32 | arm32) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm";; - ARM64 | arm64) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm64";; - *) cmake_flags_extra="$cmake_flags_extra -D \"ARCH=$arch\"";; + 32 | x86) cmake_flags_extra="$cmake_flags_extra -D ARCH=i386";; + 64 | x86_64) cmake_flags_extra="$cmake_flags_extra -D ARCH=x86_64";; + ARM32 | arm32) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm";; + ARM64 | arm64) cmake_flags_extra="$cmake_flags_extra -D ARCH=arm64";; + *) cmake_flags_extra="$cmake_flags_extra -D \"ARCH=$arch\"";; esac # Add git hash. From 1eb32a6877cd3192acb86827f8b401967c9bed72 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 14:09:21 -0300 Subject: [PATCH 08/13] Jenkins: Fix Windows CMake toolchain file path --- .ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index 445b5fbfb..76c714018 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -211,7 +211,7 @@ then echo [-] Using MSYSTEM [$MSYSTEM] # Point CMake to the toolchain file. - cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=\"$cwd/cmake/$toolchain.cmake\"" + cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=\"cmake/$toolchain.cmake\"" elif is_mac then # macOS lacks nproc, but sysctl can do the same job. From 84ae673d70688b3092d4f1a30a4fd0453c080474 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 14:23:34 -0300 Subject: [PATCH 09/13] Some Jenkins clarifications --- .ci/Jenkinsfile | 2 +- .ci/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 0fd252253..f42350f04 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -149,7 +149,7 @@ pipeline { parameters { string(name: 'BUILD_TYPE', defaultValue: 'beta', /* !!! CHANGE HERE !!! for build type */ - description: "Build type to pass on to CMake. Don't change this, you should instead change the default value on .ci/Jenkinsfile") + description: "Build type to pass on to CMake. Should only be changed for one-off builds, otherwise change the default on .ci/Jenkinsfile") } stages { diff --git a/.ci/build.sh b/.ci/build.sh index 76c714018..45c599f69 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -211,7 +211,7 @@ then echo [-] Using MSYSTEM [$MSYSTEM] # Point CMake to the toolchain file. - cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=\"cmake/$toolchain.cmake\"" + cmake_flags_extra="$cmake_flags_extra -D \"CMAKE_TOOLCHAIN_FILE=cmake/$toolchain.cmake\"" elif is_mac then # macOS lacks nproc, but sysctl can do the same job. From 8243773eb15a76b765c27f6fee19d4cfb2ec9a5c Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 14:31:13 -0300 Subject: [PATCH 10/13] Jenkins: Fix Linux CMake toolchain file path --- .ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index 45c599f69..7c77b3fb0 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -284,7 +284,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(ENV{PKG_CONFIG_PATH} "") set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/$libdir/pkgconfig:/usr/share/$libdir/pkgconfig") -include("$cwd/cmake/$toolchain.cmake") +include("$(pwd)/cmake/$toolchain.cmake") EOF cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake" strip_binary="$arch_gnu-strip" From 286399461bb522bf32a893e1d1c7cdba311a7834 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 12 Feb 2022 01:50:04 +0600 Subject: [PATCH 11/13] qt: Set font immediately after QApplication initialization --- src/qt/qt_main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 9ce65411f..e24b81283 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef QT_STATIC /* Static builds need plugin imports */ @@ -139,6 +140,11 @@ int main(int argc, char* argv[]) { #endif QApplication app(argc, argv); QLocale::setDefault(QLocale::C); +#ifdef Q_OS_WINDOWS + auto font_name = QObject::tr("FONT_NAME"); + auto font_size = QObject::tr("FONT_SIZE"); + QApplication::setFont(QFont(font_name, font_size.toInt())); +#endif qt_set_sequence_auto_mnemonic(false); Q_INIT_RESOURCE(qt_resources); Q_INIT_RESOURCE(qt_translations); From c2ec86a11116415ae343da363e537b28ca7609be Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 12 Feb 2022 01:50:50 +0600 Subject: [PATCH 12/13] Update qt_main.cpp --- src/qt/qt_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index e24b81283..150dae8ed 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef QT_STATIC /* Static builds need plugin imports */ From 971402af2f6ceb52eb5105a0023abbf822b05268 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Fri, 11 Feb 2022 22:54:54 +0100 Subject: [PATCH 13/13] Ported the SCAMP IDE fix from PCem. --- src/disk/hdc_ide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 2239e9247..a1409175f 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -1602,7 +1602,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) if (ide->type == IDE_ATAPI) ide->sc->status = DRDY_STAT; else - ide->atastat = BSY_STAT; + ide->atastat = READY_STAT | BSY_STAT; if (ide->type == IDE_ATAPI) ide->sc->callback = 100.0 * IDE_TIME;