diff options
| -rw-r--r-- | .github/workflows/ci-linux.yml | 2 | ||||
| -rw-r--r-- | docs/source/initialsetup/compilingmame.rst | 85 | ||||
| -rw-r--r-- | scripts/genie.lua | 22 | ||||
| -rw-r--r-- | scripts/src/osd/modules.lua | 62 | ||||
| -rw-r--r-- | scripts/src/osd/sdl.lua | 2 | ||||
| -rw-r--r-- | scripts/src/osd/sdl3_cfg.lua | 2 | ||||
| -rw-r--r-- | scripts/src/osd/sdl_cfg.lua | 2 | ||||
| -rw-r--r-- | src/osd/modules/debugger/qt/breakpointswindow.cpp | 4 | ||||
| -rw-r--r-- | src/osd/modules/debugger/qt/dasmwindow.cpp | 10 | ||||
| -rw-r--r-- | src/osd/modules/debugger/qt/debuggerview.cpp | 14 | ||||
| -rw-r--r-- | src/osd/modules/debugger/qt/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | src/osd/modules/debugger/qt/memorywindow.cpp | 6 | ||||
| -rw-r--r-- | src/tools/imgtool/modules/vzdos.cpp | 2 |
13 files changed, 75 insertions, 144 deletions
diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 4610644aa1a..03e263bff80 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -48,7 +48,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libasound2-dev libxinerama-dev libxi-dev qtbase5-dev qtbase5-dev-tools + sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libasound2-dev libxinerama-dev libxi-dev qt6-base-dev qt6-base-dev-tools - name: Install clang if: matrix.compiler == 'clang' run: sudo apt-get install -y clang diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst index 5b59b79a3ae..69e6f0c0b14 100644 --- a/docs/source/initialsetup/compilingmame.rst +++ b/docs/source/initialsetup/compilingmame.rst @@ -9,7 +9,7 @@ All Platforms ------------- * To compile MAME, you need a C++20 compiler and runtime library. We - support building with GCC version 11 or later and clang version 11 or + support building with GCC version 11 or later and clang version 13 or later. MAME should run with GNU libstdc++ version 11 or later or libc++ version 11 or later. The initial release of any major version of GCC should be avoided. For example, if you want to compile MAME @@ -96,7 +96,7 @@ Windows 11 or later. will need to install the MSYS2 packages for SDL 2 version 2.0.14 or later. * By default, MAME will include the native Windows debugger. To also include the portable Qt debugger, add **USE_QTDEBUG=1** to the make options. You - will need to install the MSYS2 packages for Qt 5. + will need to install the MSYS2 packages for Qt 6. Using a standard MSYS2 installation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -119,18 +119,22 @@ These instructions assume you have some familiarity with MSYS2 and the ``bash``, ``git`` and ``make``. * For debugging you may want to install ``gdb``. * To build the HTML user/developer documentation, you’ll need - ``mingw-w64-x86_64-librsvg``, ``mingw-w64-x86_64-python-sphinx``, - ``mingw-w64-x86_64-python-sphinx_rtd_theme`` and - ``mingw-w64-x86_64-python-sphinxcontrib-svg2pdfconverter`` for a 64-bit MinGW - environment (or alternatively ``mingw-w64-i686-librsvg``, - ``mingw-w64-i686-python-sphinx``, ``mingw-w64-i686-python-sphinx_rtd_theme`` - and ``mingw-w64-x86_64-python-sphinxcontrib-svg2pdfconverter`` a 32-bit MinGW - environment). + ``mingw-w64-clang-x86_64-librsvg``, ``mingw-w64-clang-x86_64-python-sphinx``, + ``mingw-w64-clang-x86_64-python-sphinx_rtd_theme`` and + ``mingw-w64-clang-x86_64-python-sphinxcontrib-svg2pdfconverter`` for a CLANG64 + environment (or alternatively ``mingw-w64-clang-aarch64-librsvg``, + ``mingw-w64-clang-aarch64-python-sphinx``, + ``mingw-w64-clang-aarch64-python-sphinx_rtd_theme`` and + ``mingw-w64-clang-aarch64-python-sphinxcontrib-svg2pdfconverter`` a CLANGARM64 + environment). You must build the PDF documentation using the CLANG64 (or + CLANGARM64) environment. * To build the PDF documentation, you’ll additionally need - ``mingw-w64-x86_64-texlive-latex-extra`` and - ``mingw-w64-x86_64-texlive-fonts-recommended`` (or - ``mingw-w64-i686-texlive-latex-extra`` and - ``mingw-w64-i686-texlive-fonts-recommended`` for a 32-bit MinGW environment). + ``mingw-w64-clang-x86_64-texlive-latex-extra`` and + ``mingw-w64-clang-x86_64-texlive-fonts-recommended`` (or + ``mingw-w64-clang-aarch64-texlive-latex-extra`` and + ``mingw-w64-clang-aarch64-texlive-fonts-recommended`` for a 64-bit ARM + system). You must build the PDF documentation using the CLANG64 (or + CLANGARM64) environment. * To generate API documentation from source, you’ll need ``doxygen``. * If you plan to rebuild bgfx shaders and you want to rebuild the GLSL parser, you’ll need ``bison``. @@ -182,46 +186,15 @@ building for. use the **MSYS2 CLANGARM64** shortcut to start a Bash shell configured with the correct paths and environment variables. -**32-bit x86 (libstdc++/MSVCRT)** +**32-bit x86** -* You’ll need ``mingw-w64-i686-gcc`` and ``mingw-w64-i686-python``. -* To link using the LLVM linker (generally much faster than the GNU linker), - you’ll need ``mingw-w64-i686-lld``, ``mingw-w64-i686-llvm`` and - ``mingw-w64-i686-libc++``. -* To build against the portable SDL interfaces, you’ll need - ``mingw-w64-i686-SDL2`` and ``mingw-w64-i686-SDL2_ttf``. -* It is no longer possible to include the Qt debugger in 32-bit builds. -* Open the **mingw32.exe** helper from the **msys64** installation folder or the - **MSYS2 MinGW 32-bit** shortcut from the start menu to start a Bash shell - configured with the correct paths and environment variables. - -For example you could use these commands to ensure you have the packages you -need to compile MAME, omitting the ones for configurations you don’t plan to -build for or combining multiple **pacman** commands to install more packages at -once:: - - pacman -Syu - pacman -S curl git make - pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-python - pacman -S mingw-w64-x86_64-llvm mingw-w64-x86_64-libc++ mingw-w64-x86_64-lld - pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf - pacman -S mingw-w64-x86_64-qt5 - pacman -S mingw-w64-i686-gcc mingw-w64-i686-python - pacman -S mingw-w64-i686-llvm mingw-w64-i686-libc++ mingw-w64-i686-lld - pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_ttf - pacman -S mingw-w64-i686-qt5 - pacman -S mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-python mingw-w64-clang-aarch64-gcc-compat - pacman -S mingw-w64-clang-aarch64-lld mingw-w64-clang-aarch64-llvm mingw-w64-clang-aarch64-libc++ - pacman -S mingw-w64-clang-aarch64-SDL2 mingw-w64-clang-aarch64-SDL2_ttf - pacman -S mingw-w64-clang-aarch64-qt5 - -You could use these commands to install the current version of the -mame-essentials package and add the MAME package repository to your pacman -configuration:: - - curl -O "https://repo.mamedev.org/x86_64/mame-essentials-1.0.6-1-x86_64.pkg.tar.xz" - pacman -U mame-essentials-1.0.6-1-x86_64.pkg.tar.xz - echo -e '\n[mame]\nInclude = /etc/pacman.d/mirrorlist.mame\nSigLevel = Never' >> /etc/pacman.conf +It is no longer possible to compile 32-bit x86 MAME build using an MSYS2 +environment. Up-to-date 32-bit versions of GCC exceed the available address +space when compiling MAME’s address space classes and Lua bindings. MSYS2 no +longer provides 32-bit x86 LLVM and clang packages. To build MAME for 32-bit +x86 systems, you must use an environment that allows cross-compiling for a +32-bit target using 64-bit tools (e.g. using a MinGW environment on a Linux +system). Building with Microsoft Visual Studio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -298,7 +271,7 @@ Fedora Linux You’ll need a few prerequisites from your Linux distribution. Make sure you get SDL 2 version 2.0.14 or later as earlier versions lack required functionality:: - sudo dnf install gcc gcc-c++ SDL2-devel SDL2_ttf-devel libXi-devel libXinerama-devel qt5-qtbase-devel qt5-qttools expat-devel fontconfig-devel alsa-lib-devel pulseaudio-libs-devel + sudo dnf install git gcc gcc-c++ SDL2-devel SDL2_ttf-devel libXi-devel libXinerama-devel qt6-qtbase-devel expat-devel fontconfig-devel alsa-lib-devel pulseaudio-libs-devel If you want to use the more efficient LLVM tools for archiving static libraries and linking, you’ll need to install the corresponding packages:: @@ -314,7 +287,7 @@ the theme and the SVG converter:: The HTML documentation can be built with this command:: - make -C docs SPHINXBUILD=sphinx-build-3 html + make -C docs html .. _compiling-ubuntu: @@ -325,7 +298,7 @@ Debian and Ubuntu (including Raspberry Pi and ODROID devices) You’ll need a few prerequisites from your Linux distribution. Make sure you get SDL 2 version 2.0.14 or later as earlier versions lack required functionality:: - sudo apt-get install git build-essential python3 libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libpulse-dev qtbase5-dev qtbase5-dev-tools qtchooser qt5-qmake + sudo apt-get install git build-essential python3 libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libpulse-dev qt6-base-dev qt6-base-dev-tools qtchooser Compilation is exactly as described above in All Platforms. Note the Ubuntu Linux modifies GCC to enable the GNU C Library “fortify source” feature by @@ -339,7 +312,7 @@ Arch Linux You’ll need a few prerequisites from your distro:: - sudo pacman -S base-devel git sdl2_ttf python libxinerama libpulse alsa-lib qt5-base + sudo pacman -S base-devel git sdl2_ttf python libxinerama libpulse alsa-lib qt6-base Compilation is exactly as described above in All Platforms. diff --git a/scripts/genie.lua b/scripts/genie.lua index fcc4680a56d..a11e84548dd 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1012,8 +1012,8 @@ end local version = str_to_version(_OPTIONS["gcc_version"]) if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then - if version < 70000 then - print("Clang version 7.0 or later needed") + if version < 130000 then + print("Clang version 13 or later needed") os.exit(-1) end buildoptions { @@ -1202,18 +1202,12 @@ configuration { "osx*" } } configuration { "mingw*" } - if _OPTIONS["osd"]=="sdl" then - linkoptions { - "-Wl,--start-group", - } - else - linkoptions { - "-static", - } - flags { - "LinkSupportCircularDependencies", - } - end + linkoptions { + "-static", + } + flags { + "LinkSupportCircularDependencies", + } links { "user32", "winmm", diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index aaaf8965ad0..e0a3025f9de 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -410,9 +410,9 @@ function qtdebuggerbuild() if _OPTIONS["QT_HOME"]~=nil then qt_host_libexecs = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_HOST_LIBEXECS") else - qt_host_libexecs = backtick("qmake -query QT_HOST_LIBEXECS") + qt_host_libexecs = backtick("qmake6 -query QT_HOST_LIBEXECS") end - MOCTST = backtick(qt_host_libexecs .. "/moc --version") + local MOCTST = backtick(qt_host_libexecs .. "/moc --version") if MOCTST=='' then print("Qt's Meta Object Compiler (moc) wasn't found!") os.exit(1) @@ -438,15 +438,14 @@ function qtdebuggerbuild() MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" end else - local MOCTST = backtick("which moc-qt5 2>/dev/null") - if MOCTST=='' then - MOCTST = backtick("which moc 2>/dev/null") - end + local qt_host_libexecs = backtick("qmake6 -query QT_HOST_LIBEXECS") + MOCTST = backtick(qt_host_libexecs .. "/moc --version 2>/dev/null") if MOCTST=='' then print("Qt's Meta Object Compiler (moc) wasn't found!") os.exit(1) + else + MOC = qt_host_libexecs .. "/moc" end - MOC = MOCTST end end @@ -467,7 +466,7 @@ function qtdebuggerbuild() if _OPTIONS["targetos"]=="windows" then configuration { "mingw*" } buildoptions { - "-I$(shell qmake -query QT_INSTALL_HEADERS)", + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } configuration { } elseif _OPTIONS["targetos"]=="macosx" then @@ -481,7 +480,7 @@ function qtdebuggerbuild() } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end end @@ -529,7 +528,7 @@ function osdmodulestargetconf() if _OPTIONS["USE_QTDEBUG"]=="1" then if _OPTIONS["targetos"]=="windows" then linkoptions { - "-L$(shell qmake -query QT_INSTALL_LIBS)", + "-L$(shell qmake6 -query QT_INSTALL_LIBS)", } links { "Qt6Core.dll", @@ -537,47 +536,30 @@ function osdmodulestargetconf() "Qt6Widgets.dll", } elseif _OPTIONS["targetos"]=="macosx" then - local qt_version = str_to_version(backtick("qmake -query QT_VERSION")) linkoptions { "-F" .. backtick("qmake -query QT_INSTALL_LIBS"), } - if qt_version < 60000 then - links { - "Qt5Core.framework", - "Qt5Gui.framework", - "Qt5Widgets.framework", - } - else - links { - "QtCore.framework", - "QtGui.framework", - "QtWidgets.framework", - } - end + links { + "QtCore.framework", + "QtGui.framework", + "QtWidgets.framework", + } else if _OPTIONS["QT_HOME"]~=nil then - local qt_version = str_to_version(backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_VERSION")) linkoptions { "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), } - if qt_version < 60000 then - links { - "Qt5Core", - "Qt5Gui", - "Qt5Widgets", - } - else - links { - "Qt6Core", - "Qt6Gui", - "Qt6Widgets", - } end else - local str = backtick(pkgconfigcmd() .. " --libs Qt5Widgets") - addlibfromstring(str) - addoptionsfromstring(str) + linkoptions { + "-L$(shell qmake6 -query QT_INSTALL_LIBS)", + } end + links { + "Qt6Core", + "Qt6Gui", + "Qt6Widgets", + } end end diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 814bb32eea3..a53b7fe858f 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -59,6 +59,8 @@ function maintargetosdoptions(_target,_subtarget) links { "SDL2main", "SDL2", + "imm32", + "version", } configuration { "vs*" } links { diff --git a/scripts/src/osd/sdl3_cfg.lua b/scripts/src/osd/sdl3_cfg.lua index b0195355d7c..7eace8f65f6 100644 --- a/scripts/src/osd/sdl3_cfg.lua +++ b/scripts/src/osd/sdl3_cfg.lua @@ -133,7 +133,7 @@ elseif _OPTIONS["targetos"]=="linux" then } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end elseif _OPTIONS["targetos"]=="macosx" then diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index 400a559862e..9efd4944cf2 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -142,7 +142,7 @@ elseif _OPTIONS["targetos"]=="linux" then } else buildoptions { - backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + "-I$(shell qmake6 -query QT_INSTALL_HEADERS)", } end elseif _OPTIONS["targetos"]=="macosx" then diff --git a/src/osd/modules/debugger/qt/breakpointswindow.cpp b/src/osd/modules/debugger/qt/breakpointswindow.cpp index 7dc3db34179..6cd924a5639 100644 --- a/src/osd/modules/debugger/qt/breakpointswindow.cpp +++ b/src/osd/modules/debugger/qt/breakpointswindow.cpp @@ -5,11 +5,7 @@ #include "util/xmlfile.h" -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtGui/QActionGroup> -#else -#include <QtWidgets/QActionGroup> -#endif #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp index a7d57f0518c..9a9cd087144 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.cpp +++ b/src/osd/modules/debugger/qt/dasmwindow.cpp @@ -11,17 +11,13 @@ #include "util/xmlfile.h" -#include <QtGui/QKeyEvent> -#include <QtWidgets/QHBoxLayout> -#include <QtWidgets/QVBoxLayout> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtGui/QAction> #include <QtGui/QActionGroup> -#else -#include <QtWidgets/QAction> -#endif +#include <QtGui/QKeyEvent> +#include <QtWidgets/QHBoxLayout> #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> +#include <QtWidgets/QVBoxLayout> namespace osd::debugger::qt { diff --git a/src/osd/modules/debugger/qt/debuggerview.cpp b/src/osd/modules/debugger/qt/debuggerview.cpp index 2da7a58c3fd..e57e0902845 100644 --- a/src/osd/modules/debugger/qt/debuggerview.cpp +++ b/src/osd/modules/debugger/qt/debuggerview.cpp @@ -133,11 +133,11 @@ void DebuggerView::paintEvent(QPaintEvent *event) if ((textAttr & DCA_SELECTED) && (textAttr & DCA_CURRENT)) { - #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bgColor.setRgb(palette.color(QPalette::Accent).rgb()); - #else - bgColor.setRgb(0xff,0xc0,0x80); - #endif +#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) + bgColor.setRgb(palette.color(QPalette::Accent).rgb()); +#else + bgColor.setRgb(0xff,0xc0,0x80); +#endif } if (textAttr & DCA_CHANGED) @@ -317,11 +317,7 @@ void DebuggerView::mousePressEvent(QMouseEvent *event) debug_view_xy const topLeft = m_view->visible_position(); debug_view_xy const visibleCharDims = m_view->visible_size(); debug_view_xy clickViewPosition; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QPointF mousePosition = event->position(); -#else - const QPointF mousePosition = event->localPos(); -#endif clickViewPosition.x = (std::min)(int(topLeft.x + (mousePosition.x() / fontWidth)), topLeft.x + visibleCharDims.x - 1); clickViewPosition.y = (std::min)(int(topLeft.y + (mousePosition.y() / fontHeight)), topLeft.y + visibleCharDims.y - 1); diff --git a/src/osd/modules/debugger/qt/mainwindow.cpp b/src/osd/modules/debugger/qt/mainwindow.cpp index 1f765afc2a6..6ed30d52114 100644 --- a/src/osd/modules/debugger/qt/mainwindow.cpp +++ b/src/osd/modules/debugger/qt/mainwindow.cpp @@ -11,13 +11,9 @@ #include "util/xmlfile.h" -#include <QtGui/QCloseEvent> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtGui/QAction> #include <QtGui/QActionGroup> -#else -#include <QtWidgets/QAction> -#endif +#include <QtGui/QCloseEvent> #include <QtWidgets/QDockWidget> #include <QtWidgets/QFileDialog> #include <QtWidgets/QMenu> diff --git a/src/osd/modules/debugger/qt/memorywindow.cpp b/src/osd/modules/debugger/qt/memorywindow.cpp index 34147169f39..44f09e0b836 100644 --- a/src/osd/modules/debugger/qt/memorywindow.cpp +++ b/src/osd/modules/debugger/qt/memorywindow.cpp @@ -10,14 +10,10 @@ #include "util/xmlfile.h" +#include <QtGui/QActionGroup> #include <QtGui/QClipboard> #include <QtGui/QKeyEvent> #include <QtGui/QMouseEvent> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -#include <QtGui/QActionGroup> -#else -#include <QtWidgets/QActionGroup> -#endif #include <QtWidgets/QApplication> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QMenu> diff --git a/src/tools/imgtool/modules/vzdos.cpp b/src/tools/imgtool/modules/vzdos.cpp index b7dee751434..b9cdc7160d8 100644 --- a/src/tools/imgtool/modules/vzdos.cpp +++ b/src/tools/imgtool/modules/vzdos.cpp @@ -132,7 +132,7 @@ static imgtoolerr_t vzdos_read_sector_data(imgtool::image &img, int track, int s if (ret) return (imgtoolerr_t)ret; /* verify sector checksums */ - if (get_u16le(&buffer[DATA_SIZE + 2]) != util::sum16_creator::simple(buffer, DATA_SIZE + 2)) + if (get_u16le(&buffer[DATA_SIZE + 2]) != uint16_t(util::sum16_creator::simple(buffer, DATA_SIZE + 2))) return IMGTOOLERR_CORRUPTFILE; memcpy(data, &buffer, DATA_SIZE + 2); |
