forked from eden-emu/eden
Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
60dfad7e4a | ||
![]() |
fa80001513 |
476 changed files with 9589 additions and 16124 deletions
|
@ -16,6 +16,8 @@ chmod +x ./gradlew
|
|||
./gradlew assembleRelease
|
||||
./gradlew bundleRelease
|
||||
|
||||
ccache -s -v
|
||||
|
||||
if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then
|
||||
rm "${ANDROID_KEYSTORE_FILE}"
|
||||
fi
|
||||
|
|
|
@ -4,12 +4,13 @@ HEADER="$(cat "$PWD/.ci/license/header.txt")"
|
|||
|
||||
echo "Getting branch changes"
|
||||
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"`
|
||||
RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}"
|
||||
FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r`
|
||||
# I created this cursed POSIX abomination only to discover a better solution
|
||||
#BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
#COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"`
|
||||
#RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}"
|
||||
#FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r`
|
||||
|
||||
#FILES=$(git diff --name-only master)
|
||||
FILES=$(git diff --name-only master)
|
||||
|
||||
echo "Done"
|
||||
|
||||
|
|
|
@ -1,98 +1,54 @@
|
|||
#!/bin/bash -e
|
||||
#!/bin/bash -ex
|
||||
|
||||
# SPDX-FileCopyrightText: 2025 eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
case "$1" in
|
||||
amd64 | "")
|
||||
echo "Making amd64-v3 optimized build of Eden"
|
||||
ARCH="amd64_v3"
|
||||
ARCH_FLAGS="-march=x86-64-v3"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=v3)
|
||||
;;
|
||||
steamdeck | zen2)
|
||||
echo "Making Steam Deck (Zen 2) optimized build of Eden"
|
||||
ARCH="steamdeck"
|
||||
ARCH_FLAGS="-march=znver2 -mtune=znver2"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
|
||||
;;
|
||||
rog-ally | allyx | zen4)
|
||||
echo "Making ROG Ally X (Zen 4) optimized build of Eden"
|
||||
ARCH="rog-ally-x"
|
||||
ARCH_FLAGS="-march=znver4 -mtune=znver4"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=zen2 -DYUZU_SYSTEM_PROFILE=steamdeck)
|
||||
;;
|
||||
legacy)
|
||||
echo "Making amd64 generic build of Eden"
|
||||
ARCH=amd64
|
||||
ARCH_FLAGS="-march=x86-64 -mtune=generic"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
|
||||
;;
|
||||
aarch64)
|
||||
echo "Making armv8-a build of Eden"
|
||||
ARCH=aarch64
|
||||
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=generic)
|
||||
;;
|
||||
armv9)
|
||||
echo "Making armv9-a build of Eden"
|
||||
ARCH=armv9
|
||||
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=armv9)
|
||||
;;
|
||||
native)
|
||||
echo "Making native build of Eden"
|
||||
ARCH="$(uname -m)"
|
||||
ARCH_FLAGS="-march=native -mtune=native"
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_BUILD_PRESET=native)
|
||||
;;
|
||||
*)
|
||||
echo "Invalid target $1 specified, must be one of native, amd64, steamdeck, zen2, allyx, rog-ally, zen4, legacy, aarch64, armv9"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
export ARCH="$(uname -m)"
|
||||
|
||||
export ARCH_FLAGS="$ARCH_FLAGS -O3"
|
||||
if [ "$ARCH" = 'x86_64' ]; then
|
||||
if [ "$1" = 'v3' ]; then
|
||||
echo "Making x86-64-v3 optimized build of eden"
|
||||
ARCH="${ARCH}_v3"
|
||||
ARCH_FLAGS="-march=x86-64-v3 -O3"
|
||||
else
|
||||
echo "Making x86-64 generic build of eden"
|
||||
ARCH_FLAGS="-march=x86-64 -mtune=generic -O3"
|
||||
fi
|
||||
|
||||
if [ -z "$NPROC" ]; then
|
||||
NPROC="$(nproc)"
|
||||
if [ "$1" != '' ]; then
|
||||
shift
|
||||
fi
|
||||
else
|
||||
echo "Making aarch64 build of eden"
|
||||
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3"
|
||||
fi
|
||||
|
||||
|
||||
NPROC="$1"
|
||||
if [ -z "$NPROC" ]; then
|
||||
NPROC="$(nproc)"
|
||||
else
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$1" != "" ]; then shift; fi
|
||||
|
||||
if [ "$TARGET" = "appimage" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
|
||||
export EXTRA_CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
|
||||
else
|
||||
# For the linux-fresh verification target, verify compilation without PCH as well.
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_PRECOMPILED_HEADERS=OFF)
|
||||
export EXTRA_CMAKE_FLAGS=(-DYUZU_USE_PRECOMPILED_HEADERS=OFF)
|
||||
fi
|
||||
|
||||
if [ "$DEVEL" != "true" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DENABLE_QT_UPDATE_CHECKER=ON)
|
||||
fi
|
||||
|
||||
if [ "$USE_WEBENGINE" = "true" ]; then
|
||||
WEBENGINE=ON
|
||||
else
|
||||
WEBENGINE=OFF
|
||||
fi
|
||||
|
||||
if [ "$USE_MULTIMEDIA" = "false" ]; then
|
||||
MULTIMEDIA=OFF
|
||||
else
|
||||
MULTIMEDIA=ON
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TYPE" ]; then
|
||||
export BUILD_TYPE="Release"
|
||||
fi
|
||||
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
|
||||
|
||||
mkdir -p build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \
|
||||
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
|
||||
|
@ -101,16 +57,16 @@ cmake .. -G Ninja \
|
|||
-DYUZU_USE_BUNDLED_SDL2=OFF \
|
||||
-DYUZU_USE_EXTERNAL_SDL2=ON \
|
||||
-DYUZU_TESTS=OFF \
|
||||
-DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
|
||||
-DYUZU_USE_QT_MULTIMEDIA=ON \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=ON \
|
||||
-DYUZU_USE_FASTER_LD=ON \
|
||||
-DYUZU_ENABLE_LTO=ON \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
|
||||
ninja -j${NPROC}
|
||||
|
||||
if [ -d "bin/Release" ]; then
|
||||
strip -s bin/Release/*
|
||||
strip -s bin/Release/*
|
||||
else
|
||||
strip -s bin/*
|
||||
strip -s bin/*
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh -e
|
||||
#!/bin/sh -ex
|
||||
|
||||
# SPDX-FileCopyrightText: 2025 eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
@ -7,43 +7,18 @@
|
|||
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
export BASE_ARCH="$(uname -m)"
|
||||
export ARCH="$BASE_ARCH"
|
||||
|
||||
export BUILDDIR="$2"
|
||||
|
||||
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
|
||||
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
|
||||
|
||||
case "$1" in
|
||||
amd64|"")
|
||||
echo "Packaging amd64-v3 optimized build of Eden"
|
||||
ARCH="amd64_v3"
|
||||
;;
|
||||
steamdeck|zen2)
|
||||
echo "Packaging Steam Deck (Zen 2) optimized build of Eden"
|
||||
ARCH="steamdeck"
|
||||
;;
|
||||
rog-ally|allyx|zen4)
|
||||
echo "Packaging ROG Ally X (Zen 4) optimized build of Eden"
|
||||
ARCH="rog-ally-x"
|
||||
;;
|
||||
legacy)
|
||||
echo "Packaging amd64 generic build of Eden"
|
||||
ARCH=amd64
|
||||
;;
|
||||
aarch64)
|
||||
echo "Packaging armv8-a build of Eden"
|
||||
ARCH=aarch64
|
||||
;;
|
||||
armv9)
|
||||
echo "Packaging armv9-a build of Eden"
|
||||
ARCH=armv9
|
||||
;;
|
||||
native)
|
||||
echo "Packaging native build of Eden"
|
||||
ARCH="$BASE_ARCH"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
export BUILDDIR="$2"
|
||||
if [ "$ARCH" = 'x86_64' ]; then
|
||||
if [ "$1" = 'v3' ]; then
|
||||
ARCH="${ARCH}_v3"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$BUILDDIR" = '' ]
|
||||
then
|
||||
|
@ -51,7 +26,7 @@ then
|
|||
fi
|
||||
|
||||
EDEN_TAG=$(git describe --tags --abbrev=0)
|
||||
echo "Making \"$EDEN_TAG\" build"
|
||||
echo "Making stable \"$EDEN_TAG\" build"
|
||||
# git checkout "$EDEN_TAG"
|
||||
VERSION="$(echo "$EDEN_TAG")"
|
||||
|
||||
|
@ -64,13 +39,14 @@ cp ../dist/org.eden_emu.eden.svg .
|
|||
|
||||
ln -sf ./org.eden_emu.eden.svg ./.DirIcon
|
||||
|
||||
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
|
||||
|
||||
# TODO(crueter): Nightly
|
||||
if [ "$DEVEL" = 'true' ]; then
|
||||
sed -i 's|Name=Eden|Name=Eden Nightly|' ./org.eden_emu.eden.desktop
|
||||
UPINFO="$(echo "$UPINFO" | sed 's|Releases|nightly|')"
|
||||
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
|
||||
fi
|
||||
|
||||
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
|
||||
|
||||
LIBDIR="/usr/lib"
|
||||
|
||||
# Workaround for Gentoo
|
||||
|
@ -92,6 +68,7 @@ chmod +x ./sharun-aio
|
|||
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
|
||||
../$BUILDDIR/bin/eden* \
|
||||
$LIBDIR/lib*GL*.so* \
|
||||
$LIBDIR/libSDL2*.so* \
|
||||
$LIBDIR/dri/* \
|
||||
$LIBDIR/vdpau/* \
|
||||
$LIBDIR/libvulkan* \
|
||||
|
|
24
.ci/windows/build-bqt.bat
Executable file
24
.ci/windows/build-bqt.bat
Executable file
|
@ -0,0 +1,24 @@
|
|||
@echo off
|
||||
|
||||
set chain=%1
|
||||
|
||||
if not defined DevEnvDir (
|
||||
CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" %chain%
|
||||
)
|
||||
|
||||
CALL mkdir build
|
||||
|
||||
CALL cmake -S . -B build\%chain% ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DENABLE_QT_TRANSLATION=ON ^
|
||||
-DUSE_DISCORD_PRESENCE=ON ^
|
||||
-DYUZU_USE_BUNDLED_QT=ON ^
|
||||
-DYUZU_USE_QT_MULTIMEDIA=ON ^
|
||||
-DYUZU_USE_QT_WEB_ENGINE=ON ^
|
||||
-DYUZU_USE_BUNDLED_VCPKG=ON ^
|
||||
-DYUZU_USE_BUNDLED_SDL2=ON ^
|
||||
-DYUZU_ENABLE_LTO=ON ^
|
||||
-G "Ninja" ^
|
||||
-DYUZU_TESTS=OFF
|
||||
|
||||
CALL cmake --build build\%chain%
|
31
.ci/windows/build.bat
Executable file
31
.ci/windows/build.bat
Executable file
|
@ -0,0 +1,31 @@
|
|||
@echo off
|
||||
|
||||
set chain=%1
|
||||
set qt_ver=%2
|
||||
|
||||
if not defined DevEnvDir (
|
||||
CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" %chain%
|
||||
)
|
||||
|
||||
CALL mkdir build
|
||||
|
||||
CALL cmake -S . -B build\%chain% ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DENABLE_QT_TRANSLATION=ON ^
|
||||
-DUSE_DISCORD_PRESENCE=ON ^
|
||||
-DYUZU_USE_BUNDLED_QT=OFF ^
|
||||
-DYUZU_USE_QT_MULTIMEDIA=ON ^
|
||||
-DYUZU_USE_QT_WEB_ENGINE=ON ^
|
||||
-DYUZU_USE_BUNDLED_VCPKG=ON ^
|
||||
-DYUZU_USE_BUNDLED_SDL2=OFF ^
|
||||
-DYUZU_USE_EXTERNAL_SDL2=ON ^
|
||||
-DYUZU_ENABLE_LTO=ON ^
|
||||
-G "Ninja" ^
|
||||
-DYUZU_TESTS=OFF ^
|
||||
-DQt6_DIR=C:/Qt/%qt_ver%/msvc2022_64
|
||||
|
||||
CALL cmake --build build\%chain%
|
||||
|
||||
set bindir=build/%chain%/bin
|
||||
|
||||
CALL C:\Qt\%qt_ver%\msvc2022_64\bin\windeployqt.exe %bindir%/eden.exe --dir %bindir% --libdir %bindir% --plugindir %bindir%/plugins --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0
|
|
@ -1,65 +0,0 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# SPDX-FileCopyrightText: 2025 eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if [ "$DEVEL" != "true" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DENABLE_QT_UPDATE_CHECKER=ON)
|
||||
fi
|
||||
|
||||
if [ "$CCACHE" = "true" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DUSE_CCACHE=ON)
|
||||
fi
|
||||
|
||||
if [ "$BUNDLE_QT" = "true" ]; then
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_BUNDLED_QT=ON)
|
||||
else
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_BUNDLED_QT=OFF)
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TYPE" ]; then
|
||||
export BUILD_TYPE="Release"
|
||||
fi
|
||||
|
||||
if [ "$WINDEPLOYQT" == "" ]; then
|
||||
echo "You must supply the WINDEPLOYQT environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$USE_WEBENGINE" = "true" ]; then
|
||||
WEBENGINE=ON
|
||||
else
|
||||
WEBENGINE=OFF
|
||||
fi
|
||||
|
||||
if [ "$USE_MULTIMEDIA" = "false" ]; then
|
||||
MULTIMEDIA=OFF
|
||||
else
|
||||
MULTIMEDIA=ON
|
||||
fi
|
||||
|
||||
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
|
||||
|
||||
mkdir -p build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DYUZU_USE_BUNDLED_SDL2=OFF \
|
||||
-DYUZU_USE_EXTERNAL_SDL2=ON \
|
||||
-DYUZU_TESTS=OFF \
|
||||
-DYUZU_CMD=OFF \
|
||||
-DYUZU_ROOM_STANDALONE=OFF \
|
||||
-DYUZU_USE_QT_MULTIMEDIA=$MULTIMEDIA \
|
||||
-DYUZU_USE_QT_WEB_ENGINE=$WEBENGINE \
|
||||
-DYUZU_ENABLE_LTO=ON \
|
||||
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||
|
||||
ninja
|
||||
|
||||
set +e
|
||||
rm -f bin/*.pdb
|
||||
set -e
|
||||
|
||||
$WINDEPLOYQT --release --no-compiler-runtime --no-opengl-sw --no-system-dxc-compiler --no-system-d3d-compiler --dir pkg bin/eden.exe
|
||||
cp bin/* pkg
|
19
.ci/windows/cygwin.bat
Executable file
19
.ci/windows/cygwin.bat
Executable file
|
@ -0,0 +1,19 @@
|
|||
echo off
|
||||
|
||||
call C:\tools\cygwin\cygwinsetup.exe -q -P autoconf,automake,libtool,make,pkg-config
|
||||
|
||||
REM Create wrapper batch files for Cygwin tools in a directory that will be in PATH
|
||||
REM uncomment this for first-run only
|
||||
REM call mkdir C:\cygwin-wrappers
|
||||
|
||||
REM Create autoconf.bat wrapper
|
||||
call echo @echo off > C:\cygwin-wrappers\autoconf.bat
|
||||
call echo C:\tools\cygwin\bin\bash.exe -l -c "autoconf %%*" >> C:\cygwin-wrappers\autoconf.bat
|
||||
|
||||
REM Add other wrappers if needed for other Cygwin tools
|
||||
call echo @echo off > C:\cygwin-wrappers\automake.bat
|
||||
call echo C:\tools\cygwin\bin\bash.exe -l -c "automake %%*" >> C:\cygwin-wrappers\automake.bat
|
||||
|
||||
REM Add the wrappers directory to PATH
|
||||
call echo C:\cygwin-wrappers>>"%GITHUB_PATH%"
|
||||
call echo C:\tools\cygwin\bin>>"%GITHUB_PATH%"
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$VulkanSDKVer = "1.4.321.1"
|
||||
$VulkanSDKVer = "1.3.250.1"
|
||||
$ExeFile = "VulkanSDK-$VulkanSDKVer-Installer.exe"
|
||||
$Uri = "https://sdk.lunarg.com/sdk/download/$VulkanSDKVer/windows/$ExeFile"
|
||||
$Destination = "./$ExeFile"
|
||||
|
|
40
.ci/windows/package.ps1
Executable file
40
.ci/windows/package.ps1
Executable file
|
@ -0,0 +1,40 @@
|
|||
# SPDX-FileCopyrightText: 2025 eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
$target=$args[0]
|
||||
$debug=$args[1]
|
||||
|
||||
$GITDATE = $(git show -s --date=short --format='%ad') -replace "-", ""
|
||||
$GITREV = $(git show -s --format='%h')
|
||||
$RELEASE_DIST = "eden-windows-msvc"
|
||||
$ARTIFACTS_DIR = "artifacts"
|
||||
|
||||
New-Item -ItemType Directory -Path $ARTIFACTS_DIR -Force
|
||||
New-Item -ItemType Directory -Path $RELEASE_DIST -Force
|
||||
|
||||
Copy-Item -Path "build/$target/bin/*" -Destination "$RELEASE_DIST" -Recurse -ErrorAction SilentlyContinue -Force
|
||||
|
||||
if ($debug -eq "yes") {
|
||||
mkdir -p pdb
|
||||
Get-ChildItem -Path "$RELEASE_DIST" -Filter "*.pdb" -Recurse | Move-Item -Destination .\pdb -ErrorAction SilentlyContinue -Force
|
||||
|
||||
if (Test-Path -Path ".\pdb\*.pdb") {
|
||||
$BUILD_PDB = "eden-windows-msvc-$GITDATE-$GITREV-debugsymbols.zip"
|
||||
7z a -tzip $BUILD_PDB .\pdb\*.pdb
|
||||
Move-Item -Path $BUILD_PDB -Destination $ARTIFACTS_DIR/ -ErrorAction SilentlyContinue -Force
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug -ne "yes") {
|
||||
Remove-Item "$RELEASE_DIST\*.pdb" -Recurse -ErrorAction SilentlyContinue -Force
|
||||
}
|
||||
|
||||
Move-Item -Path "$RELEASE_DIST\Release\*" -Destination "$RELEASE_DIST" -ErrorAction SilentlyContinue -Force
|
||||
Remove-Item "$RELEASE_DIST\Release" -ErrorAction SilentlyContinue -Force
|
||||
|
||||
$BUILD_ZIP = "eden-windows-msvc-$GITDATE-$GITREV.zip"
|
||||
7z a -tzip $BUILD_ZIP $RELEASE_DIST\*
|
||||
Move-Item -Path $BUILD_ZIP -Destination $ARTIFACTS_DIR/ -ErrorAction SilentlyContinue -Force
|
||||
|
||||
Copy-Item "LICENSE*" -Destination "$RELEASE_DIST" -ErrorAction SilentlyContinue
|
||||
Copy-Item "README*" -Destination "$RELEASE_DIST" -ErrorAction SilentlyContinue
|
|
@ -1,13 +0,0 @@
|
|||
GITDATE=$(git show -s --date=short --format='%ad' | tr -d "-")
|
||||
GITREV=$(git show -s --format='%h')
|
||||
|
||||
ZIP_NAME="Eden-Windows-${ARCH}-${GITDATE}-${GITREV}.zip"
|
||||
|
||||
mkdir -p artifacts
|
||||
mkdir -p pack
|
||||
|
||||
cp -r build/pkg/* pack
|
||||
|
||||
cp LICENSE* README* pack/
|
||||
|
||||
7z a -tzip artifacts/$ZIP_NAME pack/*
|
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
|
@ -2,9 +2,11 @@
|
|||
# some stuff needs cleaned up etc
|
||||
name: eden-build
|
||||
|
||||
#on:
|
||||
# push:
|
||||
# branches: [ "master" ]
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
# TODO: combine build.yml into trigger_release.yml
|
||||
jobs:
|
||||
|
@ -67,16 +69,13 @@ jobs:
|
|||
run: ./.ci/windows/cygwin.bat
|
||||
|
||||
- name: Configure & Build
|
||||
shell: bash
|
||||
run: |
|
||||
./.ci/windows/qt-envvars.sh
|
||||
DEVEL=true WINDEPLOYQT="/c/Qt/6.9.0/msvc2022_64/bin/windeployqt6.exe" .ci/windows/build.sh -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64/lib/cmake/Qt6
|
||||
id: cmake
|
||||
shell: cmd
|
||||
run: ./.ci/windows/build-bqt.bat amd64 yes
|
||||
|
||||
- name: Package artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
./.ci/windows/qt-envvars.sh
|
||||
./.ci/windows/package.sh
|
||||
shell: powershell
|
||||
run: ./.ci/windows/package.ps1 amd64 yes
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: forgejo/upload-artifact@v4
|
||||
|
@ -101,10 +100,10 @@ jobs:
|
|||
fetch-tags: true
|
||||
|
||||
- name: Build
|
||||
run: TARGET=appimage DEVEL=true ./.ci/linux/build.sh
|
||||
run: TARGET=appimage DEVEL=true ./.ci/linux/build.sh v3 8
|
||||
|
||||
- name: Package AppImage
|
||||
run: DEVEL=true ./.ci/linux/package.sh &> /dev/null
|
||||
run: DEVEL=true ./.ci/linux/package.sh v3 &> /dev/null
|
||||
|
||||
- name: Upload Linux artifacts
|
||||
uses: forgejo/upload-artifact@v4
|
||||
|
@ -117,6 +116,9 @@ jobs:
|
|||
runs-on: android
|
||||
|
||||
env:
|
||||
CCACHE_DIR: /home/runner/.cache/ccache
|
||||
CCACHE_COMPILERCHECK: content
|
||||
CCACHE_SLOPPINESS: time_macros
|
||||
OS: android
|
||||
TARGET: universal
|
||||
|
||||
|
|
17
.github/workflows/trigger_release.yml
vendored
17
.github/workflows/trigger_release.yml
vendored
|
@ -1,8 +1,8 @@
|
|||
name: Build Application and Make Release
|
||||
|
||||
#on:
|
||||
# push:
|
||||
# tags: [ "*" ]
|
||||
on:
|
||||
push:
|
||||
tags: [ "*" ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
@ -64,14 +64,13 @@ jobs:
|
|||
run: ./.ci/windows/cygwin.bat
|
||||
|
||||
- name: Configure & Build
|
||||
shell: bash
|
||||
run: DEVEL=false ./.ci/windows/build.sh
|
||||
id: cmake
|
||||
shell: cmd
|
||||
run: ./.ci/windows/build-bqt.bat amd64 no
|
||||
|
||||
- name: Package artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH="${PATH}:/c/Qt/6.9.0/msvc2022_64/bin"
|
||||
./.ci/windows/package.sh
|
||||
shell: powershell
|
||||
run: ./.ci/windows/package.ps1 amd64 no
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: forgejo/upload-artifact@v4
|
||||
|
|
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -5,7 +5,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Build directory
|
||||
/[Bb]uild*/
|
||||
[Bb]uild*/
|
||||
doc-build/
|
||||
AppDir/
|
||||
uruntime
|
||||
|
@ -19,21 +19,14 @@ dist/english_plurals/generated_en.ts
|
|||
.idea/
|
||||
.vs/
|
||||
.vscode/
|
||||
.cache/
|
||||
profile.json.gz
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# kdevelop
|
||||
.kdev4/
|
||||
*.kdev4
|
||||
|
||||
# *nix related
|
||||
# Common convention for backup or temporary files
|
||||
*~
|
||||
|
||||
# Visual Studio CMake settings
|
||||
CMakeSettings.json
|
||||
.cache/
|
||||
|
||||
# OSX global filetypes
|
||||
# Created by Finder or Spotlight in directories for various OS functionality (indexing, etc)
|
||||
|
@ -52,3 +45,4 @@ Thumbs.db
|
|||
eden-windows-msvc
|
||||
artifacts
|
||||
*.AppImage*
|
||||
*.patch
|
||||
|
|
11
.gitmodules
vendored
11
.gitmodules
vendored
|
@ -12,10 +12,13 @@
|
|||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "xbyak"]
|
||||
path = externals/xbyak
|
||||
url = https://github.com/Lizzie841/xbyak.git
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
[submodule "opus"]
|
||||
path = externals/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "SDL"]
|
||||
path = externals/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
[submodule "cpp-httplib"]
|
||||
path = externals/cpp-httplib
|
||||
url = https://github.com/yhirose/cpp-httplib.git
|
||||
|
@ -46,6 +49,9 @@
|
|||
[submodule "externals/dynarmic/externals/unordered_dense"]
|
||||
path = externals/dynarmic/externals/unordered_dense
|
||||
url = https://github.com/Lizzie841/unordered_dense.git
|
||||
[submodule "externals/dynarmic/externals/xbyak"]
|
||||
path = externals/dynarmic/externals/xbyak
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
[submodule "externals/dynarmic/externals/zycore-c"]
|
||||
path = externals/dynarmic/externals/zycore-c
|
||||
url = https://github.com/zyantific/zycore-c.git
|
||||
|
@ -58,6 +64,3 @@
|
|||
[submodule "externals/sirit/externals/SPIRV-Headers"]
|
||||
path = externals/sirit/externals/SPIRV-Headers
|
||||
url = https://github.com/KhronosGroup/SPIRV-Headers.git
|
||||
[submodule "externals/SPIRV-Tools"]
|
||||
path = externals/SPIRV-Tools
|
||||
url = https://github.com/KhronosGroup/SPIRV-Tools.git
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
diff --git a/quazip/quazipdir.cpp b/quazip/quazipdir.cpp
|
||||
index d43f1c1..eb24bf1 100644
|
||||
--- a/quazip/quazipdir.cpp
|
||||
+++ b/quazip/quazipdir.cpp
|
||||
@@ -293,8 +293,8 @@ bool QuaZipDirComparator::operator()(const QuaZipFileInfo64 &info1,
|
||||
}
|
||||
|
||||
template<typename TFileInfoList>
|
||||
-bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters,
|
||||
- QDir::Filters filter, QDir::SortFlags sort, TFileInfoList &result) const
|
||||
+bool QuaZipDirPrivate::entryInfoList(QStringList _nameFilters,
|
||||
+ QDir::Filters _filter, QDir::SortFlags sort, TFileInfoList &result) const
|
||||
{
|
||||
QString basePath = simplePath();
|
||||
if (!basePath.isEmpty())
|
||||
@@ -305,12 +305,12 @@ bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters,
|
||||
if (!zip->goToFirstFile()) {
|
||||
return zip->getZipError() == UNZ_OK;
|
||||
}
|
||||
- QDir::Filters fltr = filter;
|
||||
+ QDir::Filters fltr = _filter;
|
||||
if (fltr == QDir::NoFilter)
|
||||
fltr = this->filter;
|
||||
if (fltr == QDir::NoFilter)
|
||||
fltr = QDir::AllEntries;
|
||||
- QStringList nmfltr = nameFilters;
|
||||
+ QStringList nmfltr = _nameFilters;
|
||||
if (nmfltr.isEmpty())
|
||||
nmfltr = this->nameFilters;
|
||||
QSet<QString> dirsFound;
|
||||
diff --git a/quazip/quazipfile.cpp b/quazip/quazipfile.cpp
|
||||
index 4a5f2f9..f7865f5 100644
|
||||
--- a/quazip/quazipfile.cpp
|
||||
+++ b/quazip/quazipfile.cpp
|
||||
@@ -241,14 +241,14 @@ void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs
|
||||
p->caseSensitivity=cs;
|
||||
}
|
||||
|
||||
-void QuaZipFilePrivate::setZipError(int zipError) const
|
||||
+void QuaZipFilePrivate::setZipError(int _zipError) const
|
||||
{
|
||||
QuaZipFilePrivate *fakeThis = const_cast<QuaZipFilePrivate*>(this); // non-const
|
||||
- fakeThis->zipError=zipError;
|
||||
- if(zipError==UNZ_OK)
|
||||
+ fakeThis->zipError = _zipError;
|
||||
+ if(_zipError == UNZ_OK)
|
||||
q->setErrorString(QString());
|
||||
else
|
||||
- q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(zipError));
|
||||
+ q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(_zipError));
|
||||
}
|
||||
|
||||
bool QuaZipFile::open(OpenMode mode)
|
||||
diff --git a/quazip/unzip.c b/quazip/unzip.c
|
||||
index a39365d..ee7b487 100644
|
||||
--- a/quazip/unzip.c
|
||||
+++ b/quazip/unzip.c
|
||||
@@ -1054,7 +1054,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
|
||||
/* ZIP64 extra fields */
|
||||
if (headerId == 0x0001)
|
||||
{
|
||||
- uLong uL;
|
||||
+ uLong _uL;
|
||||
|
||||
if(file_info.uncompressed_size == (ZPOS64_T)0xFFFFFFFFu)
|
||||
{
|
||||
@@ -1078,7 +1078,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
|
||||
if(file_info.disk_num_start == 0xFFFFFFFFu)
|
||||
{
|
||||
/* Disk Start Number */
|
||||
- if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
|
||||
+ if (unz64local_getLong(&s->z_filefunc, s->filestream, &_uL) != UNZ_OK)
|
||||
err=UNZ_ERRNO;
|
||||
}
|
||||
|
||||
@@ -2151,3 +2151,4 @@ int ZEXPORT unzClearFlags(unzFile file, unsigned flags)
|
||||
s->flags &= ~flags;
|
||||
return UNZ_OK;
|
||||
}
|
||||
+
|
|
@ -1,26 +0,0 @@
|
|||
diff --git a/quazip/minizip_crypt.h b/quazip/minizip_crypt.h
|
||||
index 2e833f7..ea9d277 100644
|
||||
--- a/quazip/minizip_crypt.h
|
||||
+++ b/quazip/minizip_crypt.h
|
||||
@@ -90,13 +90,14 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR
|
||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
||||
# endif
|
||||
|
||||
-static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||
- const char *passwd; /* password string */
|
||||
- unsigned char *buf; /* where to write header */
|
||||
- int bufSize;
|
||||
- unsigned long* pkeys;
|
||||
- const z_crc_t FAR * pcrc_32_tab;
|
||||
- unsigned long crcForCrypting;
|
||||
+static int crypthead(
|
||||
+ const char *passwd, /* password string */
|
||||
+ unsigned char *buf, /* where to write header */
|
||||
+ int bufSize,
|
||||
+ unsigned long* pkeys,
|
||||
+ const z_crc_t FAR * pcrc_32_tab,
|
||||
+ unsigned long crcForCrypting
|
||||
+)
|
||||
{
|
||||
int n; /* index in random header */
|
||||
int t; /* temporary */
|
|
@ -1,19 +0,0 @@
|
|||
diff --git a/quazip/zip.c b/quazip/zip.c
|
||||
index 7788b88..f4e21aa 100644
|
||||
--- a/quazip/zip.c
|
||||
+++ b/quazip/zip.c
|
||||
@@ -645,6 +645,14 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib
|
||||
return relativeOffset;
|
||||
}
|
||||
|
||||
+// compilers hate this ONE SIMPLE TRICK!
|
||||
+static int LoadCentralDirectoryRecord(zip64_internal* pziinit);
|
||||
+static int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local, uLong version_to_extract);
|
||||
+static int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip);
|
||||
+static int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip);
|
||||
+static int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip);
|
||||
+static int Write_GlobalComment(zip64_internal* zi, const char* global_comment);
|
||||
+
|
||||
int LoadCentralDirectoryRecord(zip64_internal* pziinit)
|
||||
{
|
||||
int err=ZIP_OK;
|
|
@ -1,400 +0,0 @@
|
|||
"Debloats" QuaZip by removing some unneeded stuff (Qt <6, bzip2, emscripten...)
|
||||
|
||||
This is completely optional.
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b376fb2..4aac4ec 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -3,64 +3,16 @@ cmake_minimum_required(VERSION 3.15...3.18)
|
||||
|
||||
project(QuaZip VERSION 1.5)
|
||||
|
||||
-include(cmake/clone-repo.cmake)
|
||||
-
|
||||
set(QUAZIP_LIB_VERSION ${QuaZip_VERSION})
|
||||
set(QUAZIP_LIB_SOVERSION 1.5.0)
|
||||
|
||||
-if(EMSCRIPTEN)
|
||||
- #option(ZLIB_INCLUDE "Path to include dir" "")
|
||||
- #option(ZLIB_LIBRARY "Path to library dir" "")
|
||||
- option(BUILD_SHARED_LIBS "" OFF)
|
||||
- option(QUAZIP_INSTALL "" OFF)
|
||||
- option(QUAZIP_USE_QT_ZLIB "" OFF)
|
||||
- option(QUAZIP_ENABLE_TESTS "Build QuaZip tests" OFF)
|
||||
-else()
|
||||
- option(BUILD_SHARED_LIBS "" ON)
|
||||
- option(QUAZIP_INSTALL "" ON)
|
||||
- option(QUAZIP_USE_QT_ZLIB "" OFF)
|
||||
- option(QUAZIP_ENABLE_TESTS "Build QuaZip tests" OFF)
|
||||
-endif()
|
||||
+option(BUILD_SHARED_LIBS "" ON)
|
||||
+option(QUAZIP_INSTALL "" ON)
|
||||
+option(QUAZIP_ENABLE_TESTS "Build QuaZip tests" OFF)
|
||||
|
||||
OPTION(ZLIB_CONST "Sets ZLIB_CONST preprocessor definition" OFF)
|
||||
|
||||
-# Make BZIP2 optional
|
||||
-option(QUAZIP_BZIP2 "Enables BZIP2 compression" ON)
|
||||
-option(QUAZIP_BZIP2_STDIO "Output BZIP2 errors to stdio" ON)
|
||||
-
|
||||
-option(QUAZIP_FETCH_LIBS "Enables fetching third-party libraries if not found" ${WIN32})
|
||||
-option(QUAZIP_FORCE_FETCH_LIBS "Enables fetching third-party libraries always" OFF)
|
||||
-
|
||||
-if (QUAZIP_USE_QT_ZLIB AND BUILD_SHARED_LIBS)
|
||||
- message(FATAL_ERROR "Using BUILD_SHARED_LIBS=ON together with QUAZIP_USE_QT_ZLIB=ON is not supported." )
|
||||
-endif()
|
||||
-
|
||||
-# Set the default value of `${QUAZIP_QT_MAJOR_VERSION}`.
|
||||
-# We search quietly for Qt6, Qt5 and Qt4 in that order.
|
||||
-# Qt6 and Qt5 provide config files for CMake.
|
||||
-# Qt4 relies on `FindQt4.cmake`.
|
||||
-find_package(
|
||||
- QT NAMES Qt6 Qt5
|
||||
- QUIET COMPONENTS Core
|
||||
-)
|
||||
-if (NOT QT_FOUND)
|
||||
- find_package(Qt4 QUIET COMPONENTS QtCore)
|
||||
- if (Qt4_FOUND)
|
||||
- set(QT_VERSION_MAJOR 4)
|
||||
- else()
|
||||
- # If neither 6, 5 nor 4 are found, we default to 5.
|
||||
- # The setup will fail further down.
|
||||
- set(QT_VERSION_MAJOR 5)
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
-set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (4, 5 or 6), defaults to ${QT_VERSION_MAJOR}")
|
||||
-
|
||||
-if (QUAZIP_QT_MAJOR_VERSION EQUAL 6)
|
||||
- set(CMAKE_CXX_STANDARD 17)
|
||||
-else()
|
||||
- set(CMAKE_CXX_STANDARD 14)
|
||||
-endif()
|
||||
+set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RELEASE)
|
||||
@@ -77,92 +29,17 @@ set(QUAZIP_LIB_TARGET_NAME QuaZip)
|
||||
set(QUAZIP_DIR_NAME QuaZip-Qt${QUAZIP_QT_MAJOR_VERSION}-${QUAZIP_LIB_VERSION})
|
||||
set(QUAZIP_PACKAGE_NAME QuaZip-Qt${QUAZIP_QT_MAJOR_VERSION})
|
||||
|
||||
-message(STATUS "QUAZIP_QT_MAJOR_VERSION set to ${QUAZIP_QT_MAJOR_VERSION}")
|
||||
-message(STATUS "CMAKE_CXX_STANDARD set to ${CMAKE_CXX_STANDARD}")
|
||||
-
|
||||
-if(QUAZIP_QT_MAJOR_VERSION EQUAL 6)
|
||||
- find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat
|
||||
- OPTIONAL_COMPONENTS Network Test)
|
||||
- message(STATUS "Found Qt version ${Qt6_VERSION} at ${Qt6_DIR}")
|
||||
- set(QUAZIP_QT_ZLIB_COMPONENT BundledZLIB)
|
||||
- set(QUAZIP_QT_ZLIB_HEADER_COMPONENT ZlibPrivate)
|
||||
- set(QUAZIP_LIB_LIBRARIES Qt6::Core Qt6::Core5Compat)
|
||||
- set(QUAZIP_TEST_QT_LIBRARIES Qt6::Core Qt6::Core5Compat Qt6::Network Qt6::Test)
|
||||
- set(QUAZIP_PKGCONFIG_REQUIRES "zlib, Qt6Core")
|
||||
-elseif(QUAZIP_QT_MAJOR_VERSION EQUAL 5)
|
||||
- find_package(Qt5 REQUIRED COMPONENTS Core
|
||||
- OPTIONAL_COMPONENTS Network Test)
|
||||
- message(STATUS "Found Qt version ${Qt5_VERSION} at ${Qt5_DIR}")
|
||||
- set(QUAZIP_QT_ZLIB_COMPONENT Zlib)
|
||||
- set(QUAZIP_LIB_LIBRARIES Qt5::Core)
|
||||
- set(QUAZIP_TEST_QT_LIBRARIES Qt5::Core Qt5::Network Qt5::Test)
|
||||
- set(QUAZIP_PKGCONFIG_REQUIRES "zlib, Qt5Core")
|
||||
-elseif(QUAZIP_QT_MAJOR_VERSION EQUAL 4)
|
||||
- find_package(Qt4 4.5.0 REQUIRED COMPONENTS QtCore
|
||||
- OPTIONAL_COMPONENTS QtNetwork QtTest)
|
||||
- set(QUAZIP_QT_ZLIB_COMPONENT Zlib)
|
||||
- set(QUAZIP_LIB_LIBRARIES Qt4::QtCore)
|
||||
- set(QUAZIP_TEST_QT_LIBRARIES Qt4::QtCore Qt4::QtNetwork Qt4::QtTest)
|
||||
- set(QUAZIP_PKGCONFIG_REQUIRES "zlib, QtCore")
|
||||
-else()
|
||||
- message(FATAL_ERROR "Qt version ${QUAZIP_QT_MAJOR_VERSION} is not supported")
|
||||
-endif()
|
||||
-
|
||||
-message(STATUS "Using Qt version ${QUAZIP_QT_MAJOR_VERSION}")
|
||||
-
|
||||
-set(QUAZIP_QT_ZLIB_USED OFF)
|
||||
-if(QUAZIP_USE_QT_ZLIB)
|
||||
- find_package(Qt${QUAZIP_QT_MAJOR_VERSION} OPTIONAL_COMPONENTS ${QUAZIP_QT_ZLIB_COMPONENT})
|
||||
- set(QUAZIP_QT_ZLIB_COMPONENT_FOUND Qt${QUAZIP_QT_MAJOR_VERSION}${QUAZIP_QT_ZLIB_COMPONENT}_FOUND)
|
||||
- if (DEFINED QUAZIP_QT_ZLIB_HEADER_COMPONENT)
|
||||
- find_package(Qt${QUAZIP_QT_MAJOR_VERSION} OPTIONAL_COMPONENTS ${QUAZIP_QT_ZLIB_HEADER_COMPONENT})
|
||||
- set(QUAZIP_QT_ZLIB_HEADER_COMPONENT_FOUND Qt${QUAZIP_QT_MAJOR_VERSION}${QUAZIP_QT_ZLIB_HEADER_COMPONENT}_FOUND)
|
||||
- else()
|
||||
- set(QUAZIP_QT_ZLIB_HEADER_COMPONENT_FOUND ON)
|
||||
- endif()
|
||||
- if(QUAZIP_QT_ZLIB_COMPONENT_FOUND AND QUAZIP_QT_ZLIB_HEADER_COMPONENT_FOUND)
|
||||
- message(STATUS "Qt component ${QUAZIP_QT_ZLIB_COMPONENT} found")
|
||||
- set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} Qt${QUAZIP_QT_MAJOR_VERSION}::${QUAZIP_QT_ZLIB_COMPONENT})
|
||||
- if(DEFINED QUAZIP_QT_ZLIB_HEADER_COMPONENT)
|
||||
- message(STATUS "Qt component ${QUAZIP_QT_ZLIB_HEADER_COMPONENT} found")
|
||||
- set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} Qt${QUAZIP_QT_MAJOR_VERSION}::${QUAZIP_QT_ZLIB_HEADER_COMPONENT})
|
||||
- endif()
|
||||
- set(QUAZIP_QT_ZLIB_USED ON)
|
||||
- else()
|
||||
- message(FATAL_ERROR "QUAZIP_USE_QT_ZLIB was set but bundled zlib was not found. Terminating to prevent accidental linking to system libraries.")
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
-if(QUAZIP_QT_ZLIB_USED AND QUAZIP_QT_ZLIB_COMPONENT STREQUAL BundledZLIB)
|
||||
- # Qt's new BundledZLIB uses z-prefix in zlib
|
||||
- add_compile_definitions(Z_PREFIX)
|
||||
-endif()
|
||||
-
|
||||
-if(NOT QUAZIP_QT_ZLIB_USED)
|
||||
-
|
||||
- if(EMSCRIPTEN)
|
||||
- if(NOT DEFINED ZLIB_LIBRARY)
|
||||
- message(WARNING "ZLIB_LIBRARY is not set")
|
||||
- endif()
|
||||
+find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat
|
||||
+ OPTIONAL_COMPONENTS Network Test)
|
||||
+message(STATUS "Found Qt version ${Qt6_VERSION} at ${Qt6_DIR}")
|
||||
+set(QUAZIP_QT_ZLIB_COMPONENT BundledZLIB)
|
||||
+set(QUAZIP_QT_ZLIB_HEADER_COMPONENT ZlibPrivate)
|
||||
+set(QUAZIP_LIB_LIBRARIES Qt6::Core Qt6::Core5Compat)
|
||||
+set(QUAZIP_TEST_QT_LIBRARIES Qt6::Core Qt6::Core5Compat Qt6::Network Qt6::Test)
|
||||
+set(QUAZIP_PKGCONFIG_REQUIRES "zlib, Qt6Core")
|
||||
|
||||
- if(NOT DEFINED ZLIB_INCLUDE)
|
||||
- message(WARNING "ZLIB_INCLUDE is not set")
|
||||
- else()
|
||||
- include_directories(${ZLIB_INCLUDE})
|
||||
- endif()
|
||||
-
|
||||
- if(NOT DEFINED ZCONF_INCLUDE)
|
||||
- message(WARNING "ZCONF_INCLUDE is not set")
|
||||
- else()
|
||||
- include_directories(${ZCONF_INCLUDE})
|
||||
- endif()
|
||||
-
|
||||
- set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} ${ZLIB_LIBRARY})
|
||||
- else()
|
||||
- find_package(ZLIB REQUIRED)
|
||||
- set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} ZLIB::ZLIB)
|
||||
- endif()
|
||||
-endif()
|
||||
+find_package(ZLIB REQUIRED)
|
||||
+set(QUAZIP_LIB_LIBRARIES ${QUAZIP_LIB_LIBRARIES} ZLIB::ZLIB)
|
||||
|
||||
if (ZLIB_CONST)
|
||||
add_compile_definitions(ZLIB_CONST)
|
||||
@@ -173,65 +50,4 @@ set(QUAZIP_INC)
|
||||
set(QUAZIP_LIB)
|
||||
set(QUAZIP_LBD)
|
||||
|
||||
-if(QUAZIP_BZIP2)
|
||||
- # Check if bzip2 is present
|
||||
- set(QUAZIP_BZIP2 ON)
|
||||
-
|
||||
- if(NOT QUAZIP_FORCE_FETCH_LIBS)
|
||||
- find_package(BZip2 QUIET)
|
||||
- endif()
|
||||
-
|
||||
- if(BZIP2_FOUND AND NOT QUAZIP_FORCE_FETCH_LIBS)
|
||||
- message(STATUS "Using BZIP2 ${BZIP2_VERSION_STRING}")
|
||||
-
|
||||
- list(APPEND QUAZIP_INC ${BZIP2_INCLUDE_DIRS})
|
||||
- list(APPEND QUAZIP_LIB ${BZIP2_LIBRARIES})
|
||||
- list(APPEND QUAZIP_LBD ${BZIP2_LIBRARY_DIRS})
|
||||
-
|
||||
- set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lbzip2")
|
||||
- elseif(QUAZIP_FETCH_LIBS)
|
||||
- clone_repo(bzip2 https://sourceware.org/git/bzip2.git)
|
||||
-
|
||||
- # BZip2 repository does not support cmake so we have to create
|
||||
- # the bzip2 library ourselves
|
||||
- set(BZIP2_SRC
|
||||
- ${BZIP2_SOURCE_DIR}/blocksort.c
|
||||
- ${BZIP2_SOURCE_DIR}/bzlib.c
|
||||
- ${BZIP2_SOURCE_DIR}/compress.c
|
||||
- ${BZIP2_SOURCE_DIR}/crctable.c
|
||||
- ${BZIP2_SOURCE_DIR}/decompress.c
|
||||
- ${BZIP2_SOURCE_DIR}/huffman.c
|
||||
- ${BZIP2_SOURCE_DIR}/randtable.c)
|
||||
-
|
||||
- set(BZIP2_HDR
|
||||
- ${BZIP2_SOURCE_DIR}/bzlib.h
|
||||
- ${BZIP2_SOURCE_DIR}/bzlib_private.h)
|
||||
-
|
||||
- add_library(bzip2 STATIC ${BZIP2_SRC} ${BZIP2_HDR})
|
||||
-
|
||||
- if(NOT QUAZIP_BZIP2_STDIO)
|
||||
- target_compile_definitions(bzip2 PRIVATE -DBZ_NO_STDIO)
|
||||
- endif()
|
||||
-
|
||||
- list(APPEND QUAZIP_DEP bzip2)
|
||||
- list(APPEND QUAZIP_LIB bzip2)
|
||||
- list(APPEND QUAZIP_INC ${BZIP2_SOURCE_DIR})
|
||||
- else()
|
||||
- message(STATUS "BZip2 library not found")
|
||||
-
|
||||
- set(QUAZIP_BZIP2 OFF)
|
||||
- endif()
|
||||
-
|
||||
- if(QUAZIP_BZIP2)
|
||||
- find_package(BZip2)
|
||||
- add_compile_definitions(HAVE_BZIP2)
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
add_subdirectory(quazip)
|
||||
-
|
||||
-if(QUAZIP_ENABLE_TESTS)
|
||||
- message(STATUS "Building QuaZip tests")
|
||||
- enable_testing()
|
||||
- add_subdirectory(qztest)
|
||||
-endif()
|
||||
diff --git a/quazip/CMakeLists.txt b/quazip/CMakeLists.txt
|
||||
index 6cfdf4e..66bc4cb 100644
|
||||
--- a/quazip/CMakeLists.txt
|
||||
+++ b/quazip/CMakeLists.txt
|
||||
@@ -46,10 +46,6 @@ set(QUAZIP_INCLUDE_PATH ${QUAZIP_DIR_NAME}/quazip)
|
||||
set(QUAZIP_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake)
|
||||
set(QUAZIP_PKGCONFIG_NAME quazip${QuaZip_VERSION_MAJOR}-qt${QUAZIP_QT_MAJOR_VERSION})
|
||||
|
||||
-if(EMSCRIPTEN)
|
||||
- set(BUILD_SHARED_LIBS OFF)
|
||||
-endif()
|
||||
-
|
||||
add_library(${QUAZIP_LIB_TARGET_NAME} ${QUAZIP_SOURCES})
|
||||
add_library(QuaZip::QuaZip ALIAS ${QUAZIP_LIB_TARGET_NAME})
|
||||
|
||||
diff --git a/quazip/quazip_qt_compat.h b/quazip/quazip_qt_compat.h
|
||||
index 0dde011..41f9dd1 100644
|
||||
--- a/quazip/quazip_qt_compat.h
|
||||
+++ b/quazip/quazip_qt_compat.h
|
||||
@@ -14,16 +14,11 @@
|
||||
|
||||
// Legacy encodings are still everywhere, but the Qt team decided we
|
||||
// don't need them anymore and moved them out of Core in Qt 6.
|
||||
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
-# include <QtCore5Compat/QTextCodec>
|
||||
-#else
|
||||
-# include <QtCore/QTextCodec>
|
||||
-#endif
|
||||
+#include <QtCore5Compat/QTextCodec>
|
||||
|
||||
// QSaveFile terribly breaks the is-a idiom (Liskov substitution principle):
|
||||
// QSaveFile is-a QIODevice, but it makes close() private and aborts
|
||||
// if you call it through the base class. Hence this ugly hack:
|
||||
-#if (QT_VERSION >= 0x050100)
|
||||
#include <QtCore/QSaveFile>
|
||||
inline bool quazip_close(QIODevice *device) {
|
||||
QSaveFile *file = qobject_cast<QSaveFile*>(device);
|
||||
@@ -34,74 +29,35 @@ inline bool quazip_close(QIODevice *device) {
|
||||
device->close();
|
||||
return true;
|
||||
}
|
||||
-#else
|
||||
-inline bool quazip_close(QIODevice *device) {
|
||||
- device->close();
|
||||
- return true;
|
||||
-}
|
||||
-#endif
|
||||
|
||||
-// this is yet another stupid move and deprecation
|
||||
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
using Qt::SkipEmptyParts;
|
||||
-#else
|
||||
-#include <QtCore/QString>
|
||||
-const auto SkipEmptyParts = QString::SplitBehavior::SkipEmptyParts;
|
||||
-#endif
|
||||
|
||||
// and yet another... (why didn't they just make qSort delegate to std::sort?)
|
||||
#include <QtCore/QList>
|
||||
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
||||
#include <algorithm>
|
||||
template<typename T, typename C>
|
||||
inline void quazip_sort(T begin, T end, C comparator) {
|
||||
std::sort(begin, end, comparator);
|
||||
}
|
||||
-#else
|
||||
-#include <QtCore/QtAlgorithms>
|
||||
-template<typename T, typename C>
|
||||
-inline void quazip_sort(T begin, T end, C comparator) {
|
||||
- qSort(begin, end, comparator);
|
||||
-}
|
||||
-#endif
|
||||
|
||||
// this is a stupid rename...
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QFileInfo>
|
||||
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
inline QDateTime quazip_ctime(const QFileInfo &fi) {
|
||||
return fi.birthTime();
|
||||
}
|
||||
-#else
|
||||
-inline QDateTime quazip_ctime(const QFileInfo &fi) {
|
||||
- return fi.created();
|
||||
-}
|
||||
-#endif
|
||||
|
||||
// this is just a slightly better alternative
|
||||
#include <QtCore/QFileInfo>
|
||||
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
inline bool quazip_is_symlink(const QFileInfo &fi) {
|
||||
return fi.isSymbolicLink();
|
||||
}
|
||||
-#else
|
||||
-inline bool quazip_is_symlink(const QFileInfo &fi) {
|
||||
- // also detects *.lnk on Windows, but better than nothing
|
||||
- return fi.isSymLink();
|
||||
-}
|
||||
-#endif
|
||||
|
||||
// I'm not even sure what this one is, but nevertheless
|
||||
#include <QtCore/QFileInfo>
|
||||
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||
inline QString quazip_symlink_target(const QFileInfo &fi) {
|
||||
return fi.symLinkTarget();
|
||||
}
|
||||
-#else
|
||||
-inline QString quazip_symlink_target(const QFileInfo &fi) {
|
||||
- return fi.readLink(); // What's the difference? I've no idea.
|
||||
-}
|
||||
-#endif
|
||||
|
||||
// deprecation
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||
@@ -125,40 +81,19 @@ inline QDateTime quazip_since_epoch_ntfs() {
|
||||
|
||||
// this is not a deprecation but an improvement, for a change
|
||||
#include <QtCore/QDateTime>
|
||||
-#if (QT_VERSION >= 0x040700)
|
||||
inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) {
|
||||
QDateTime base = quazip_since_epoch_ntfs();
|
||||
return base.msecsTo(time) * 10000 + fineTicks;
|
||||
}
|
||||
-#else
|
||||
-inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) {
|
||||
- QDateTime base = quazip_since_epoch_ntfs();
|
||||
- QDateTime utc = time.toUTC();
|
||||
- return (static_cast<qint64>(base.date().daysTo(utc.date()))
|
||||
- * Q_INT64_C(86400000)
|
||||
- + static_cast<qint64>(base.time().msecsTo(utc.time())))
|
||||
- * Q_INT64_C(10000) + fineTicks;
|
||||
-}
|
||||
-#endif
|
||||
|
||||
// yet another improvement...
|
||||
#include <QtCore/QDateTime>
|
||||
-#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) // Yay! Finally a way to get time as qint64!
|
||||
inline qint64 quazip_to_time64_t(const QDateTime &time) {
|
||||
return time.toSecsSinceEpoch();
|
||||
}
|
||||
-#else
|
||||
-inline qint64 quazip_to_time64_t(const QDateTime &time) {
|
||||
- return static_cast<qint64>(time.toTime_t()); // 32 bits only, but better than nothing
|
||||
-}
|
||||
-#endif
|
||||
|
||||
#include <QtCore/QTextStream>
|
||||
-// and another stupid move
|
||||
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
const auto quazip_endl = Qt::endl;
|
||||
-#else
|
||||
-const auto quazip_endl = endl;
|
||||
-#endif
|
||||
|
||||
#endif // QUAZIP_QT_COMPAT_H
|
||||
+
|
117
CMakeLists.txt
117
CMakeLists.txt
|
@ -17,10 +17,6 @@ if (MSVC)
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX-")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
|
||||
endif()
|
||||
|
||||
# Check if SDL2::SDL2 target exists; if not, create an alias
|
||||
if (TARGET SDL2::SDL2-static)
|
||||
add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
|
||||
|
@ -29,14 +25,10 @@ elseif (TARGET SDL2::SDL2-shared)
|
|||
endif()
|
||||
|
||||
# Set bundled sdl2/qt as dependent options.
|
||||
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
||||
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "ENABLE_SDL2;NOT MSVC" OFF)
|
||||
else()
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
||||
endif()
|
||||
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
|
||||
|
||||
cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF)
|
||||
|
||||
|
@ -50,49 +42,24 @@ option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF)
|
|||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
||||
|
||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||
option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" OFF)
|
||||
else()
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" ON)
|
||||
endif()
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "ON")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" OFF)
|
||||
else()
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||
endif()
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" OFF)
|
||||
else()
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" OFF)
|
||||
else()
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ON)
|
||||
endif()
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ON)
|
||||
|
||||
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||
|
||||
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
||||
|
||||
set(YUZU_QT_MIRROR "" CACHE STRING "What mirror to use for downloading the bundled Qt libraries")
|
||||
|
||||
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
||||
|
||||
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
||||
|
||||
option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
|
||||
else()
|
||||
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||
endif()
|
||||
option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
|
||||
|
||||
option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON)
|
||||
|
||||
|
@ -106,11 +73,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support"
|
|||
|
||||
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" OFF)
|
||||
else()
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||
endif()
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||
|
||||
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||
|
||||
|
@ -123,7 +86,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available
|
|||
CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF)
|
||||
|
||||
set(DEFAULT_ENABLE_OPENSSL ON)
|
||||
if (ANDROID OR WIN32 OR APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
if (ANDROID OR WIN32 OR APPLE)
|
||||
set(DEFAULT_ENABLE_OPENSSL OFF)
|
||||
endif()
|
||||
option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL})
|
||||
|
@ -184,7 +147,7 @@ if (YUZU_USE_BUNDLED_VCPKG)
|
|||
set(VCPKG_DOWNLOADS_PATH ${PROJECT_SOURCE_DIR}/externals/vcpkg/downloads)
|
||||
set(NASM_VERSION "2.16.01")
|
||||
set(NASM_DESTINATION_PATH ${VCPKG_DOWNLOADS_PATH}/nasm-${NASM_VERSION}-win64.zip)
|
||||
set(NASM_DOWNLOAD_URL "https://github.com/eden-emulator/ext-windows-bin/raw/master/nasm/nasm-${NASM_VERSION}-win64.zip")
|
||||
set(NASM_DOWNLOAD_URL "https://git.eden-emu.dev/eden-emu/ext-windows-bin/raw/master/nasm/nasm-${NASM_VERSION}-win64.zip")
|
||||
|
||||
if (NOT EXISTS ${NASM_DESTINATION_PATH})
|
||||
file(DOWNLOAD ${NASM_DOWNLOAD_URL} ${NASM_DESTINATION_PATH} SHOW_PROGRESS STATUS NASM_STATUS)
|
||||
|
@ -332,41 +295,6 @@ if (YUZU_ROOM)
|
|||
add_definitions(-DYUZU_ROOM)
|
||||
endif()
|
||||
|
||||
# Build/optimization presets
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
if (ARCHITECTURE_x86_64)
|
||||
set(YUZU_BUILD_PRESET "generic" CACHE STRING "Build preset to use. One of: generic, v3, zen2, zen4, native")
|
||||
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -mtune=generic")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64 -mtune=generic")
|
||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "v3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64-v3 -mtune=generic")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64-v3 -mtune=generic")
|
||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=znver2 -mtune=znver2")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=znver2 -mtune=znver2")
|
||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen4")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=znver4 -mtune=znver4")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=znver4 -mtune=znver4")
|
||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "native")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native")
|
||||
endif()
|
||||
elseif(ARCHITECTURE_arm64)
|
||||
set(YUZU_BUILD_PRESET "generic" CACHE STRING "Build preset to use. One of: generic, armv9")
|
||||
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a -mtune=generic")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a -mtune=generic")
|
||||
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv9-a -mtune=generic")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv9-a -mtune=generic")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Other presets, e.g. steamdeck
|
||||
set(YUZU_SYSTEM_PROFILE "generic" CACHE STRING "CMake and Externals profile to use. One of: generic, steamdeck")
|
||||
|
||||
# Configure C++ standard
|
||||
# ===========================
|
||||
|
||||
|
@ -382,7 +310,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
|||
# Enforce the search mode of non-required packages for better and shorter failure messages
|
||||
find_package(enet 1.3 MODULE)
|
||||
find_package(fmt 8 REQUIRED)
|
||||
find_package(LLVM MODULE COMPONENTS Demangle)
|
||||
find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)
|
||||
find_package(lz4 REQUIRED)
|
||||
find_package(nlohmann_json 3.8 REQUIRED)
|
||||
find_package(Opus 1.3 MODULE)
|
||||
|
@ -401,17 +329,8 @@ if (NOT YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
|
|||
find_package(VulkanUtilityLibraries REQUIRED)
|
||||
endif()
|
||||
|
||||
if (NOT YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SPIRV-Tools REQUIRED SPIRV-Tools)
|
||||
endif()
|
||||
|
||||
if (ENABLE_LIBUSB)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
find_package(libusb MODULE)
|
||||
else()
|
||||
find_package(libusb 1.0.24 MODULE)
|
||||
endif()
|
||||
find_package(libusb 1.0.24 MODULE)
|
||||
endif()
|
||||
|
||||
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
|
||||
|
@ -450,12 +369,11 @@ if(ENABLE_OPENSSL)
|
|||
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(gamemode 1.7 MODULE)
|
||||
endif()
|
||||
|
||||
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package
|
||||
# TODO(crueter): combine this all with CPM.
|
||||
if (ENABLE_SDL2)
|
||||
if (YUZU_USE_BUNDLED_SDL2)
|
||||
# Detect toolchain and platform
|
||||
|
@ -504,11 +422,7 @@ if (ENABLE_QT)
|
|||
list(APPEND CMAKE_PREFIX_PATH "${Qt6_DIR}")
|
||||
endif()
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent)
|
||||
|
||||
if (YUZU_USE_QT_MULTIMEDIA)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
|
||||
endif()
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia Concurrent)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(Qt6 REQUIRED COMPONENTS DBus)
|
||||
|
@ -564,8 +478,7 @@ if (UNIX AND NOT APPLE AND NOT ANDROID)
|
|||
endif()
|
||||
if (NOT YUZU_USE_BUNDLED_FFMPEG)
|
||||
# Use system installed FFmpeg
|
||||
#find_package(FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${FFmpeg_COMPONENTS})
|
||||
find_package(FFmpeg REQUIRED QUIET COMPONENTS ${FFmpeg_COMPONENTS})
|
||||
find_package(FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${FFmpeg_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if(ENABLE_QT)
|
||||
|
@ -628,7 +541,7 @@ if (NOT CLANG_FORMAT)
|
|||
message(STATUS "Clang format not found! Downloading...")
|
||||
set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
|
||||
file(DOWNLOAD
|
||||
https://github.com/eden-emulator/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
|
||||
https://git.eden-emu.dev/eden-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
|
||||
"${CLANG_FORMAT}" SHOW_PROGRESS
|
||||
STATUS DOWNLOAD_SUCCESS)
|
||||
if (NOT DOWNLOAD_SUCCESS EQUAL 0)
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.42.0)
|
||||
set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a")
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
)
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
|
@ -8,7 +8,7 @@
|
|||
set(CURRENT_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
function(download_bundled_external remote_path lib_name prefix_var)
|
||||
|
||||
set(package_base_url "https://github.com/eden-emulator/")
|
||||
set(package_base_url "https://git.eden-emu.dev/eden-emu/")
|
||||
set(package_repo "no_platform")
|
||||
set(package_extension "no_platform")
|
||||
if (WIN32)
|
||||
|
@ -94,7 +94,7 @@ function(determine_qt_parameters target host_out type_out arch_out arch_path_out
|
|||
else()
|
||||
set(host "linux")
|
||||
set(type "desktop")
|
||||
set(arch "linux_gcc_64")
|
||||
set(arch "gcc_64")
|
||||
set(arch_path "linux")
|
||||
endif()
|
||||
|
||||
|
@ -133,26 +133,12 @@ function(download_qt_configuration prefix_out target host type arch arch_path ba
|
|||
set(install_args ${install_args} install-tool --outputdir ${base_path} ${host} desktop ${target})
|
||||
else()
|
||||
set(prefix "${base_path}/${target}/${arch_path}")
|
||||
set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch} -m qt_base)
|
||||
|
||||
if (YUZU_USE_QT_MULTIMEDIA)
|
||||
set(install_args ${install_args} qtmultimedia)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_QT_WEB_ENGINE)
|
||||
set(install_args ${install_args} qtpositioning qtwebchannel qtwebengine)
|
||||
endif()
|
||||
|
||||
if (NOT ${YUZU_QT_MIRROR} STREQUAL "")
|
||||
message(STATUS "Using Qt mirror ${YUZU_QT_MIRROR}")
|
||||
set(install_args ${install_args} -b ${YUZU_QT_MIRROR})
|
||||
endif()
|
||||
set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch} -m qt3d qt5compat qtactiveqt qtcharts qtconnectivity qtdatavis3d qtgraphs qtgrpc qthttpserver qtimageformats qtlanguageserver qtlocation qtlottie qtmultimedia qtnetworkauth qtpdf qtpositioning qtquick3d qtquick3dphysics qtquickeffectmaker qtquicktimeline qtremoteobjects qtscxml qtsensors qtserialbus qtserialport qtshadertools qtspeech qtvirtualkeyboard qtwebchannel qtwebengine qtwebsockets qtwebview)
|
||||
endif()
|
||||
|
||||
message(STATUS "Install Args ${install_args}")
|
||||
if (NOT EXISTS "${prefix}")
|
||||
message(STATUS "Downloading Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path}")
|
||||
set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.3.0")
|
||||
set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.2.1")
|
||||
if (WIN32)
|
||||
set(aqt_path "${base_path}/aqt.exe")
|
||||
if (NOT EXISTS "${aqt_path}")
|
||||
|
|
|
@ -19,7 +19,7 @@ if (LLVM_FOUND AND LLVM_Demangle_FOUND AND NOT TARGET LLVM::Demangle)
|
|||
target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS})
|
||||
# prefer shared LLVM: https://github.com/llvm/llvm-project/issues/34593
|
||||
# but use ugly hack because llvm_config doesn't support interface library
|
||||
add_library(_dummy_lib SHARED EXCLUDE_FROM_ALL ${CMAKE_SOURCE_DIR}/src/yuzu/main.cpp)
|
||||
add_library(_dummy_lib SHARED EXCLUDE_FROM_ALL src/yuzu/main.cpp)
|
||||
llvm_config(_dummy_lib USE_SHARED demangle)
|
||||
get_target_property(LLVM_LIBRARIES _dummy_lib LINK_LIBRARIES)
|
||||
target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES})
|
||||
|
|
|
@ -31,7 +31,7 @@ endif()
|
|||
|
||||
# Generate cpp with Git revision from template
|
||||
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
|
||||
set(REPO_NAME "Eden")
|
||||
set(REPO_NAME "eden")
|
||||
set(BUILD_ID ${GIT_BRANCH})
|
||||
set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ")
|
||||
|
||||
|
|
30
README.md
30
README.md
|
@ -1,21 +1,21 @@
|
|||
<!--
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# SPDX-FileCopyrightText: 2025 EDEN Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<!-- lang: en-GB -->
|
||||
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<a href="https://git.eden-emu.dev/eden-emu/eden"><img src="./dist/qt_themes/default/icons/256x256/eden_named.png" alt="Eden" width="200"></a>
|
||||
<a href="https://git.eden-emu.dev/eden-emu/eden"><img src="https://git.eden-emu.dev/eden-emu/eden/raw/branch/master/dist/qt_themes/default/icons/256x256/eden_named.png" alt="Eden" width="200"></a>
|
||||
<br>
|
||||
<b>Eden</b>
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
<h4 align="center"><b>Eden</b> is an open-source Nintendo Switch emulator, forked from the Yuzu emulator — started by former Citron developer Camille LaVey and the Eden team.
|
||||
<h4 align="center"><b>Eden</b> is the world's most popular open-source Nintendo Switch emulator, forked from the Yuzu emulator — started by former Citron developer Camille LaVey and the Eden team.
|
||||
<br>
|
||||
It is written in C++ with portability in mind, and we actively maintain builds for Windows, Linux and Android.
|
||||
</h4>
|
||||
|
||||
|
@ -42,31 +42,29 @@ The emulator is capable of running most commercial games at full speed, provided
|
|||
|
||||
A list of supported games will be available in future. Please be patient.
|
||||
|
||||
Check out our [website](https://eden-emu.dev) for the latest news on exciting features, monthly progress reports, and more!
|
||||
Check out our [website](https://eden-emulator.github.io) for the latest news on exciting features, monthly progress reports, and more!
|
||||
|
||||
## Development
|
||||
|
||||
Most of the development happens on our Git server. It is also where [our central repository](https://git.eden-emu.dev/eden-emu/eden) is hosted. For development discussions, please join us on [Discord](https://discord.gg/edenemu).
|
||||
Most of the development happens on our Git server. It is also where [our central repository](https://git.eden-emu.dev/eden-emu/eden) is hosted. For development discussions, please join us on [Discord](https://discord.gg/ynGGJAN4Rx).
|
||||
|
||||
If you would like to contribute, we are open to new developers and pull requests. Please ensure that your work is of a high standard and properly documented.
|
||||
You can also contact any of the developers on Discord to learn more about the current state of the emulator.
|
||||
|
||||
## Building
|
||||
|
||||
* **Windows**: [Windows Building Guide](./docs/build/Windows.md)
|
||||
* **Linux**: [Linux Building Guide](./docs/build/Linux.md)
|
||||
* **Android**: [Android Building Guide](./docs/build/Android.md)
|
||||
* **Solaris**: [Solaris Building Guide](./docs/build/Solaris.md)
|
||||
* **FreeBSD**: [FreeBSD Building Guide](./docs/build/FreeBSD.md)
|
||||
* **macOS**: [macOS Building Guide](./docs/build/macOS.md)
|
||||
* **Windows**: [Windows Building Guide](https://git.eden-emu.dev/eden-emu/eden/wiki/Building-for-Windows.-)
|
||||
* **Linux**: [Linux Building Guide](https://git.eden-emu.dev/eden-emu/eden/wiki/Building-for-Linux.-)
|
||||
* **Android**: [Android Building Guide](https://git.eden-emu.dev/eden-emu/eden/wiki/Building-for-Android.-)
|
||||
|
||||
## Download
|
||||
|
||||
You can download the latest releases from [here](https://github.com/eden-emulator/Releases/releases).
|
||||
You will be able to download the latest releases from [here](https://git.eden-emu.dev/eden-emu/eden/releases), or with MEGA and Archive links provided on Discord.
|
||||
|
||||
## Support
|
||||
|
||||
If you enjoy the project and would like to support us financially, please check out our developers' [donation pages](https://eden-emu.dev/donations.html)!
|
||||
If you enjoy the project and would like to support us financially, please check out our developers' donation pages!
|
||||
- [crueter/Camille](https://liberapay.com/crueter)
|
||||
|
||||
Any donations received will go towards things such as:
|
||||
* Switch consoles to explore and reverse-engineer the hardware
|
||||
|
@ -75,7 +73,7 @@ Any donations received will go towards things such as:
|
|||
* Additional hardware (e.g. GPUs as needed to improve rendering support, other peripherals to add support for, etc.)
|
||||
* CI Infrastructure
|
||||
|
||||
If you would prefer to support us in a different way, please join our [Discord](https://discord.gg/edenemu) and talk to Camille or any of our other developers.
|
||||
If you would prefer to support us in a different way, please join our [Discord](https://discord.gg/ynGGJAN4Rx), once public, and talk to Camille or any of our other developers.
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -1,174 +0,0 @@
|
|||
# Development
|
||||
|
||||
* **Windows**: [Windows Building Guide](./docs/build/Windows.md)
|
||||
* **Linux**: [Linux Building Guide](./docs/build/Linux.md)
|
||||
* **Android**: [Android Building Guide](./docs/build/Android.md)
|
||||
* **Solaris**: [Solaris Building Guide](./docs/build/Solaris.md)
|
||||
* **FreeBSD**: [FreeBSD Building Guide](./docs/build/FreeBSD.md)
|
||||
* **macOS**: [macOS Building Guide](./docs/build/macOS.md)
|
||||
|
||||
# Building speedup
|
||||
|
||||
If you have an HDD, use ramdisk (build in RAM):
|
||||
```sh
|
||||
sudo mkdir /tmp/ramdisk
|
||||
sudo chmod 777 /tmp/ramdisk
|
||||
# about 10GB needed
|
||||
sudo mount -t tmpfs -o size=10G myramdisk /tmp/ramdisk
|
||||
cmake -B /tmp/ramdisk
|
||||
cmake --build /tmp/ramdisk -- -j32
|
||||
sudo umount /tmp/ramdisk
|
||||
```
|
||||
|
||||
# How to test JIT
|
||||
|
||||
## gdb
|
||||
|
||||
Run `./build/bin/eden-cli -c <path to your config file (see logs where you run eden normally to see where it is)> -d -g <path to game>`
|
||||
|
||||
Then hook up an aarch64-gdb (use `yay aarch64-gdb` or `sudo pkg in arch64-gdb` to install)
|
||||
Then type `target remote localhost:1234` and type `c` (for continue) - and then if it crashes just do a `bt` (backtrace) and `layout asm`.
|
||||
|
||||
### gdb cheatsheet
|
||||
|
||||
- `mo <cmd>`: Monitor commands, `get info`, `get fastmem` and `get mappings` are available.
|
||||
- `detach`: Detach from remote (i.e restarting the emulator).
|
||||
- `c`: Continue
|
||||
- `p <expr>`: Print variable, `p/x <expr>` for hexadecimal.
|
||||
- `r`: Run
|
||||
- `bt`: Print backtrace
|
||||
- `info threads`: Print all active threads
|
||||
- `thread <number>`: Switch to the given thread (see `info threads`)
|
||||
- `layout asm`: Display in assembly mode (TUI)
|
||||
- `si`: Step assembly instruction
|
||||
- `s` or `step`: Step over LINE OF CODE (not assembly)
|
||||
- `display <expr>`: Display variable each step.
|
||||
- `n`: Next (skips over call frame of a function)
|
||||
- `frame <number>`: Switches to the given frame (from `bt`)
|
||||
- `br <expr>`: Set breakpoint at `<expr>`.
|
||||
- `delete`: Deletes all breakpoints.
|
||||
- `catch throw`: Breakpoint at throw. Can also use `br __cxa_throw`
|
||||
|
||||
Expressions can be `variable_names` or `1234` (numbers) or `*var` (dereference of a pointer) or `*(1 + var)` (computed expression).
|
||||
|
||||
For more information type `info gdb` and read [the man page](https://man7.org/linux/man-pages/man1/gdb.1.html).
|
||||
|
||||
## Bisecting older commits
|
||||
|
||||
Since going into the past can be tricky (especially due to the dependencies from the project being lost thru time). This should "restore" the URLs for the respective submodules.
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
cat > .gitmodules <<EOF
|
||||
[submodule "enet"]
|
||||
path = externals/enet
|
||||
url = https://github.com/lsalzman/enet.git
|
||||
[submodule "cubeb"]
|
||||
path = externals/cubeb
|
||||
url = https://github.com/mozilla/cubeb.git
|
||||
[submodule "dynarmic"]
|
||||
path = externals/dynarmic
|
||||
url = https://github.com/lioncash/dynarmic.git
|
||||
[submodule "libusb"]
|
||||
path = externals/libusb/libusb
|
||||
url = https://github.com/libusb/libusb.git
|
||||
[submodule "discord-rpc"]
|
||||
path = externals/discord-rpc
|
||||
url = https://github.com/yuzu-emu-mirror/discord-rpc.git
|
||||
[submodule "Vulkan-Headers"]
|
||||
path = externals/Vulkan-Headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "sirit"]
|
||||
path = externals/sirit
|
||||
url = https://github.com/yuzu-emu-mirror/sirit.git
|
||||
[submodule "mbedtls"]
|
||||
path = externals/mbedtls
|
||||
url = https://github.com/yuzu-emu-mirror/mbedtls.git
|
||||
[submodule "xbyak"]
|
||||
path = externals/xbyak
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
[submodule "opus"]
|
||||
path = externals/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "SDL"]
|
||||
path = externals/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
[submodule "cpp-httplib"]
|
||||
path = externals/cpp-httplib
|
||||
url = https://github.com/yhirose/cpp-httplib.git
|
||||
[submodule "ffmpeg"]
|
||||
path = externals/ffmpeg/ffmpeg
|
||||
url = https://github.com/FFmpeg/FFmpeg.git
|
||||
[submodule "vcpkg"]
|
||||
path = externals/vcpkg
|
||||
url = https://github.com/microsoft/vcpkg.git
|
||||
[submodule "cpp-jwt"]
|
||||
path = externals/cpp-jwt
|
||||
url = https://github.com/arun11299/cpp-jwt.git
|
||||
[submodule "libadrenotools"]
|
||||
path = externals/libadrenotools
|
||||
url = https://github.com/bylaws/libadrenotools.git
|
||||
[submodule "tzdb_to_nx"]
|
||||
path = externals/nx_tzdb/tzdb_to_nx
|
||||
url = https://github.com/lat9nq/tzdb_to_nx.git
|
||||
[submodule "VulkanMemoryAllocator"]
|
||||
path = externals/VulkanMemoryAllocator
|
||||
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
|
||||
[submodule "breakpad"]
|
||||
path = externals/breakpad
|
||||
url = https://github.com/yuzu-emu-mirror/breakpad.git
|
||||
[submodule "simpleini"]
|
||||
path = externals/simpleini
|
||||
url = https://github.com/brofield/simpleini.git
|
||||
[submodule "oaknut"]
|
||||
path = externals/oaknut
|
||||
url = https://github.com/merryhime/oaknut.git
|
||||
[submodule "Vulkan-Utility-Libraries"]
|
||||
path = externals/Vulkan-Utility-Libraries
|
||||
url = https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
|
||||
[submodule "oboe"]
|
||||
path = externals/oboe
|
||||
url = https://github.com/google/oboe.git
|
||||
[submodule "externals/boost-headers"]
|
||||
path = externals/boost-headers
|
||||
url = https://github.com/boostorg/headers.git
|
||||
EOF
|
||||
git submodule sync
|
||||
update_or_checkout () {
|
||||
if [ $0 = 'externals/sirit' ] \
|
||||
|| [ $0 = 'externals/dynarmic' ] \
|
||||
|| [ $0 = 'externals/breakpad' ] \
|
||||
|| [ $0 = 'externals/discord-rpc' ] \
|
||||
|| [ $0 = 'externals/mbedtls' ]; then
|
||||
[ -f $0/CMakeLists.txt ] || git submodule update --force --remote --init -- $0
|
||||
echo $0 ':remote' && git submodule update --remote $0
|
||||
exit
|
||||
elif [ $0 = 'externals/nx_tzdb/tzdb_to_nx' ]; then
|
||||
[ -f $0/CMakeLists.txt ] || git submodule update --force --remote --init -- $0
|
||||
echo $0 ':remote' && git submodule update --remote $0
|
||||
else
|
||||
echo $0 ':update' && git submodule update --init $0 && exit
|
||||
echo $0 ':remote' && git submodule update --remote $0 && exit
|
||||
echo $0 ':failure'
|
||||
fi
|
||||
}
|
||||
export -f update_or_checkout
|
||||
grep path .gitmodules | sed 's/.*= //' | xargs -n 1 -I {} bash -c 'update_or_checkout "$@"' {}
|
||||
# Fix for LLVM builds
|
||||
sed -i 's/src\/yuzu\/main.cpp/${CMAKE_SOURCE_DIR}\/src\/yuzu\/main.cpp/g' CMakeModules/FindLLVM.cmake
|
||||
# Only after cloning and everything - fixes issues with Zydis
|
||||
cat > externals/dynarmic/src/dynarmic/common/x64_disassemble.cpp <<EOF
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
namespace Dynarmic::Common {
|
||||
void DumpDisassembledX64(const void* ptr, size_t size) {}
|
||||
std::vector<std::string> DisassembleX64(const void* ptr, size_t size) { return {}; }
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
If having issues with older artifacts, then run `rm -r externals/dynarmic/build externals/dynarmic/externals externals/nx_tzdb/tzdb_to_nx/externals externals/sirit/externals`.
|
||||
|
||||
Configuring CMake with `-DSIRIT_USE_SYSTEM_SPIRV_HEADERS=1 -DCMAKE_CXX_FLAGS="-Wno-error" -DCMAKE_C_FLAGS="-Wno-error -Wno-array-parameter -Wno-stringop-overflow"` is also recommended.
|
||||
|
42
docs/build/Android.md
vendored
42
docs/build/Android.md
vendored
|
@ -1,42 +0,0 @@
|
|||
# Note: These build instructions are a work-in-progress.
|
||||
|
||||
## Dependencies
|
||||
* [Android Studio](https://developer.android.com/studio)
|
||||
* [NDK 25.2.9519653 and CMake 3.22.1](https://developer.android.com/studio/projects/install-ndk#default-version)
|
||||
* [Git](https://git-scm.com/download)
|
||||
|
||||
### WINDOWS ONLY - Additional Dependencies
|
||||
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)** - **Make sure to select "Desktop development with C++" support in the installer. Make sure to update to the latest version if already installed.**
|
||||
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - **Make sure to select Latest SDK.**
|
||||
- A convenience script to install the latest SDK is provided in `.ci\windows\install-vulkan-sdk.ps1`.
|
||||
|
||||
## Cloning Eden with Git
|
||||
```
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden.git
|
||||
```
|
||||
Eden by default will be cloned into -
|
||||
* `C:\Users\<user-name>\eden` on Windows
|
||||
* `~/eden` on Linux
|
||||
* And wherever on macOS
|
||||
|
||||
## Building
|
||||
1. Start Android Studio, on the startup dialog select `Open`.
|
||||
2. Navigate to the `eden/src/android` directory and click on `OK`.
|
||||
3. In `Build > Select Build Variant`, select `release` or `relWithDebInfo` as the "Active build variant".
|
||||
4. Build the project with `Build > Make Project` or run it on an Android device with `Run > Run 'app'`.
|
||||
|
||||
## Building with Terminal
|
||||
1. Download the SDK and NDK from Android Studio.
|
||||
2. Navigate to SDK and NDK paths.
|
||||
3. Then set ANDROID_SDK_ROOT and ANDROID_NDK_ROOT in terminal via
|
||||
`export ANDROID_SDK_ROOT=path/to/sdk`
|
||||
`export ANDROID_NDK_ROOT=path/to/ndk`.
|
||||
4. Navigate to `eden/src/android`.
|
||||
5. Then Build with `./gradlew assemblerelWithDebInfo`.
|
||||
6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo`.
|
||||
|
||||
### Script
|
||||
A convenience script for building is provided in `.ci/android/build.sh`. The built APK can be put into an `artifacts` directory via `.ci/android/package.sh`. On Windows, these must be done in the Git Bash or MinGW terminal.
|
||||
|
||||
### Additional Resources
|
||||
https://developer.android.com/studio/intro
|
81
docs/build/FreeBSD.md
vendored
81
docs/build/FreeBSD.md
vendored
|
@ -1,81 +0,0 @@
|
|||
## One word of caution before proceeding.
|
||||
This is not the usual or preferred way to build programs on FreeBSD.
|
||||
As of writing there is no official fresh port available for eden-emu, but it is in the works.
|
||||
After it is available you can find a link to the eden-emu fresh port here and on Escarys github repo.
|
||||
See this build as an App Image alternative for FreeBSD.
|
||||
|
||||
## Dependencies.
|
||||
Before we start we need some dependencies.
|
||||
These dependencies are generally needed to build eden-emu on FreeBSD.
|
||||
|
||||
```
|
||||
devel/cmake
|
||||
devel/sdl20
|
||||
devel/boost-libs
|
||||
devel/catch2
|
||||
devel/libfmt
|
||||
devel/nlohmann-json
|
||||
devel/ninja
|
||||
devel/nasm
|
||||
devel/autoconf
|
||||
devel/pkg-config
|
||||
devel/qt6-base
|
||||
|
||||
multimedia/ffnvcodec-headers
|
||||
multimedia/ffmpeg
|
||||
|
||||
audio/opus
|
||||
|
||||
archivers/liblz4
|
||||
|
||||
lang/gcc12
|
||||
|
||||
graphics/glslang
|
||||
graphics/vulkan-utility-libraries
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Build preparations:
|
||||
Run the following command to clone eden with git:
|
||||
```sh
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
```
|
||||
You usually want to add the `--recursive` parameter as it also takes care of the external dependencies for you.
|
||||
|
||||
Now change into the eden directory and create a build directory there:
|
||||
```sh
|
||||
cd eden
|
||||
mkdir build
|
||||
```
|
||||
|
||||
Change into that build directory:
|
||||
```sh
|
||||
cd build
|
||||
```
|
||||
|
||||
Now choose one option either 1 or 2, but not both as one option overwrites the other.
|
||||
|
||||
#### 1. Building in Release Mode (usually preferred and the most performant choice):
|
||||
```sh
|
||||
cmake .. -GNinja -DYUZU_TESTS=OFF
|
||||
```
|
||||
|
||||
#### 2. Building in Release Mode with debugging symbols (useful if you want to debug errors for a eventual fix):
|
||||
```sh
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_TESTS=ON
|
||||
```
|
||||
|
||||
Build the emulator locally:
|
||||
```sh
|
||||
ninja
|
||||
```
|
||||
|
||||
Optional: If you wish to install eden globally onto your system issue the following command:
|
||||
```sh
|
||||
sudo ninja install
|
||||
```
|
||||
OR
|
||||
```sh
|
||||
doas -- ninja install
|
||||
```
|
135
docs/build/Linux.md
vendored
135
docs/build/Linux.md
vendored
|
@ -1,135 +0,0 @@
|
|||
### Dependencies
|
||||
|
||||
You'll need to download and install the following to build Eden:
|
||||
|
||||
* [GCC](https://gcc.gnu.org/) v11+ (for C++20 support) & misc
|
||||
* If GCC 12 is installed, [Clang](https://clang.llvm.org/) v14+ is required for compiling
|
||||
* [CMake](https://www.cmake.org/) 3.22+
|
||||
|
||||
The following are handled by Eden's externals:
|
||||
|
||||
* [FFmpeg](https://ffmpeg.org/)
|
||||
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+
|
||||
* [opus](https://opus-codec.org/downloads/)
|
||||
|
||||
All other dependencies will be downloaded by [vcpkg](https://vcpkg.io/) if needed:
|
||||
|
||||
* [Boost](https://www.boost.org/users/download/) 1.79.0+
|
||||
* [Catch2](https://github.com/catchorg/Catch2) 2.13.7 - 2.13.9
|
||||
* [fmt](https://fmt.dev/) 8.0.1+
|
||||
* [lz4](http://www.lz4.org) 1.8+
|
||||
* [nlohmann_json](https://github.com/nlohmann/json) 3.8+
|
||||
* [OpenSSL](https://www.openssl.org/source/)
|
||||
* [ZLIB](https://www.zlib.net/) 1.2+
|
||||
* [zstd](https://facebook.github.io/zstd/) 1.5+
|
||||
|
||||
If an ARM64 build is intended, export `VCPKG_FORCE_SYSTEM_BINARIES=1`.
|
||||
|
||||
Dependencies are listed here as commands that can be copied/pasted. Of course, they should be inspected before being run.
|
||||
|
||||
- Arch / Manjaro:
|
||||
- `sudo pacman -Syu --needed base-devel boost catch2 cmake ffmpeg fmt git glslang libzip lz4 mbedtls ninja nlohmann-json openssl opus qt6-base qt6-multimedia sdl2 zlib zstd zip unzip`
|
||||
- Building with QT Web Engine requires `qt6-webengine` as well.
|
||||
- Proper wayland support requires `qt6-wayland`
|
||||
- GCC 11 or later is required.
|
||||
- Ubuntu / Linux Mint / Debian:
|
||||
- `sudo apt-get install autoconf cmake g++-11 gcc-11 git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qtbase6-dev qtbase6-private-dev qtwebengine6-dev qtmultimedia6-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev`
|
||||
- Ubuntu 22.04, Linux Mint 20, or Debian 12 or later is required.
|
||||
- Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DYUZU_USE_QT_WEB_ENGINE=ON` when running CMake.
|
||||
- Users need to manually specify building with GCC 11. This can be done by adding the parameters `-DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11` when running CMake. i.e.
|
||||
- Users need to manually disable building SDL2 from externals if they intend to use the version provided by their system by adding the parameters `-DYUZU_USE_EXTERNAL_SDL2=OFF`
|
||||
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
|
||||
```
|
||||
|
||||
- Fedora:
|
||||
- `sudo dnf install autoconf ccache cmake fmt-devel gcc{,-c++} glslang hidapi-devel json-devel libtool libusb1-devel libzstd-devel lz4-devel nasm ninja-build openssl-devel pulseaudio-libs-devel qt5-linguist qt5-qtbase{-private,}-devel qt5-qtwebengine-devel qt5-qtmultimedia-devel speexdsp-devel wayland-devel zlib-devel ffmpeg-devel libXext-devel`
|
||||
- Fedora 32 or later is required.
|
||||
- Due to GCC 12, Fedora 36 or later users need to install `clang`, and configure CMake to use it via `-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang`
|
||||
- CMake arguments to force system libraries:
|
||||
- SDL2: `-DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF`
|
||||
- FFmpeg: `-DYUZU_USE_EXTERNAL_FFMPEG=OFF`
|
||||
- [RPM Fusion](https://rpmfusion.org/) (free) is required to install `ffmpeg-devel`
|
||||
|
||||
### Cloning Eden with Git
|
||||
|
||||
**Master:**
|
||||
|
||||
```bash
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
cd eden
|
||||
```
|
||||
|
||||
The `--recursive` option automatically clones the required Git submodules.
|
||||
|
||||
### Building Eden in Release Mode (Optimised)
|
||||
|
||||
If you need to run ctests, you can disable `-DYUZU_TESTS=OFF` and install Catch2.
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
sudo ninja install
|
||||
```
|
||||
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON` after `cmake ..`
|
||||
|
||||
`-DYUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS=OFF` might be needed if ninja command failed with `undefined reference to symbol 'spvOptimizerOptionsCreate`, reason currently unknown
|
||||
|
||||
Optionally, you can use `cmake-gui ..` to adjust various options (e.g. disable the Qt GUI).
|
||||
|
||||
### Building Eden in Debug Mode (Slow)
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
### Building with debug symbols
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU -DYUZU_TESTS=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
### Building with Scripts
|
||||
A convenience script for building is provided in `.ci/linux/build.sh`. You must provide an arch target for optimization, e.g. `.ci/linux/build.sh amd64`. Valid targets:
|
||||
- `legacy`: x86_64 generic, only needed for CPUs older than 2013 or so
|
||||
- `amd64`: x86_64-v3, for CPUs newer than 2013 or so
|
||||
- `steamdeck` / `zen2`: For Steam Deck or Zen >= 2 AMD CPUs (untested on Intel)
|
||||
- `rog-ally` / `allyx` / `zen4`: For ROG Ally X or Zen >= 4 AMD CPUs (untested on Intel)
|
||||
- `aarch64`: For armv8-a CPUs, older than mid-2021 or so
|
||||
- `armv9`: For armv9-a CPUs, newer than mid-2021 or so
|
||||
- `native`: Optimize to your native host architecture
|
||||
|
||||
Extra flags to pass to CMake should be passed after the arch target.
|
||||
|
||||
Additional environment variables can be used to control building:
|
||||
- `NPROC`: Number of threads to use for compilation (defaults to all)
|
||||
- `TARGET`: Set to `appimage` to disable standalone `eden-cli` and `eden-room` executables
|
||||
- `BUILD_TYPE`: Sets the build type to use. Defaults to `Release`
|
||||
|
||||
The following environment variables are boolean flags. Set to `true` to enable or `false` to disable:
|
||||
- `DEVEL` (default FALSE): Disable Qt update checker
|
||||
- `USE_WEBENGINE` (default FALSE): Enable Qt WebEngine
|
||||
- `USE_MULTIMEDIA` (default TRUE): Enable Qt Multimedia
|
||||
|
||||
After building, an AppImage can be packaged via `.ci/linux/package.sh`. This script takes the same arch targets as the build script. If the build was created in a different directory, you can specify its path relative to the source directory, e.g. `.ci/linux/package.sh amd64 build-appimage`. Additionally, set the `DEVEL` environment variable to `true` to change the app name to `Eden Nightly`.
|
||||
|
||||
### Running without installing
|
||||
|
||||
After building, the binaries `eden` and `eden-cmd` (depending on your build options) will end up in `build/bin/`.
|
||||
|
||||
```bash
|
||||
# SDL
|
||||
cd build/bin/
|
||||
./eden-cmd
|
||||
|
||||
# Qt
|
||||
cd build/bin/
|
||||
./eden
|
||||
```
|
94
docs/build/Solaris.md
vendored
94
docs/build/Solaris.md
vendored
|
@ -1,94 +0,0 @@
|
|||
# Building for Solaris
|
||||
|
||||
## Dependencies.
|
||||
Always consult [the OpenIndiana package list](https://pkg.openindiana.org/hipster/en/index.shtml) to cross-verify availability.
|
||||
|
||||
Run the usual update + install of essential toolings: `sudo pkg update && sudo pkg install git cmake`.
|
||||
|
||||
- **gcc**: `sudo pkg install developer/gcc-14`.
|
||||
- **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`.
|
||||
|
||||
Then install the libraies: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm`.
|
||||
|
||||
fmtlib is not available on repositories and has to be manually built:
|
||||
```sh
|
||||
git clone --recurisve --depth=1 https://github.com/fmtlib/fmt.git
|
||||
cd fmt
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
```
|
||||
|
||||
pkg lz4 doesn't provide a proper CMakeFile to find the library, has to also be manually built:
|
||||
```sh
|
||||
git clone --depth=1 https://github.com/lz4/lz4.git
|
||||
cd lz4
|
||||
gmake
|
||||
sudo gmake install
|
||||
```
|
||||
|
||||
Same goes for zstd:
|
||||
```sh
|
||||
git clone --depth=1 https://github.com/facebook/zstd.git
|
||||
cd zstd
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -B build0 -S build/cmake
|
||||
cmake --build build0
|
||||
cd build0
|
||||
sudo gmake install
|
||||
```
|
||||
|
||||
pkg SDL2 is also not nice to work with on CMake, save yourself some pain and compile it yourself:
|
||||
```sh
|
||||
git clone --depth=1 --branch=release-2.32.8 https://github.com/libsdl-org/SDL
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -B build
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
```
|
||||
|
||||
Audio is broken in OpenIndiana [see this issue](https://github.com/libsdl-org/SDL/issues/13405), go into `SDL/CMakeLists.txt` and comment out lines 1468:
|
||||
```diff
|
||||
+# set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
||||
+# file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
||||
+# list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
||||
+# set(HAVE_SDL_AUDIO TRUE)
|
||||
```
|
||||
For Solaris this issue does not exist - however PulseAudio crashes on Solaris - so use a different backend.
|
||||
|
||||
---
|
||||
|
||||
### Build preparations:
|
||||
Run the following command to clone eden with git:
|
||||
```sh
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
```
|
||||
You usually want to add the `--recursive` parameter as it also takes care of the external dependencies for you.
|
||||
|
||||
Now change into the eden directory and create a build directory there:
|
||||
```sh
|
||||
cd eden
|
||||
mkdir build
|
||||
```
|
||||
|
||||
Change into that build directory: `cd build`
|
||||
|
||||
Now choose one option either 1 or 2, but not both as one option overwrites the other.
|
||||
|
||||
### Building
|
||||
|
||||
```sh
|
||||
# Needed for some dependencies that call cc directly (tz)
|
||||
echo '#!/bin/sh' >cc
|
||||
echo 'gcc $@' >>cc
|
||||
chmod +x cc
|
||||
export PATH="$PATH:$PWD"
|
||||
```
|
||||
|
||||
- **Configure**: `cmake -B build -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF -DYUZU_USE_LLVM_DEMANGLE=OFF -DYUZU_USE_QT_MULTIMEDIA=OFF -DYUZU_USE_QT_WEB_ENGINE=OFF -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_USE_BUNDLED_QT=OFF -DENABLE_QT=OFF -DSDL_AUDIO=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_QT_UPDATE_CHECKER=OFF`.
|
||||
- **Build**: `cmake --build build`.
|
||||
- **Installing**: `sudo cmake --install build`.
|
||||
|
||||
### Notes
|
||||
|
||||
- Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`).
|
||||
- If using OpenIndiana, due to a bug in SDL2 cmake configuration; Audio driver defaults to SunOS `<sys/audioio.h>`, which does not exist on OpenIndiana.
|
||||
- Enabling OpenSSL requires compiling OpenSSL manually instead of using the provided one from repositores.
|
195
docs/build/Windows.md
vendored
195
docs/build/Windows.md
vendored
|
@ -1,195 +0,0 @@
|
|||
# THIS GUIDE IS INTENDED FOR DEVELOPERS ONLY, SUPPORT WILL ONLY BE GIVEN IF YOU'RE A DEVELOPER.
|
||||
|
||||
## Method I: MSVC Build for Windows
|
||||
|
||||
### Minimal Dependencies
|
||||
|
||||
On Windows, all library dependencies are automatically included within the `externals` folder, or can be downloaded on-demand. To build Eden, you need to install:
|
||||
|
||||
* **[Visual Studio 2022 Community](https://visualstudio.microsoft.com/downloads/)** - **Make sure to select C++ support in the installer. Make sure to update to the latest version if already installed.**
|
||||
* **[CMake](https://cmake.org/download/)** - Used to generate Visual Studio project files. Does not matter if either 32-bit or 64-bit version is installed.
|
||||
* **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** - **Make sure to select Latest SDK.**
|
||||
- A convenience script to install the latest SDK is provided in `.ci\windows\install-vulkan-sdk.ps1`.
|
||||
|
||||

|
||||
|
||||
* **Git** - We recommend [Git for Windows](https://gitforwindows.org).
|
||||
|
||||

|
||||
|
||||
* While installing Git Bash, you should tell it to include Git in your system path. (Choose the "Git from the command line and also from 3rd-party software" option.) If you missed that, don't worry, you'll just have to manually tell CMake where your git.exe is, since it's used to include version info into the built executable.
|
||||
|
||||

|
||||
|
||||
### Cloning Eden with Git
|
||||
|
||||
**Master:**
|
||||
```cmd
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
cd eden
|
||||
```
|
||||
|
||||

|
||||
|
||||
* *(Note: eden by default downloads to `C:\Users\<user-name>\eden` (Master)
|
||||
|
||||
### Building
|
||||
|
||||
* Open the CMake GUI application and point it to the `eden` (Master)
|
||||
|
||||

|
||||
|
||||
* For the build directory, use a `/build` subdirectory inside the source directory or some other directory of your choice. (Tell CMake to create it.)
|
||||
|
||||
* Click the "Configure" button and choose `Visual Studio 17 2022`, with `x64` for the optional platform.
|
||||
|
||||

|
||||
|
||||
* *(Note: If you used GitHub's own app to clone, run `git submodule update --init --recursive` to get the remaining dependencies)*
|
||||
|
||||
* If you get an error about missing packages, enable `YUZU_USE_BUNDLED_VCPKG`, and then click Configure again.
|
||||
|
||||
* *(You may also want to disable `YUZU_TESTS` in this case since Catch2 is not yet supported with this.)*
|
||||
|
||||

|
||||
|
||||
* Click "Generate" to create the project files.
|
||||
|
||||

|
||||
|
||||
* Open the solution file `yuzu.sln` in Visual Studio 2022, which is located in the build folder.
|
||||
|
||||

|
||||
|
||||
* Depending if you want a graphical user interface or not (`eden` has the graphical user interface, while `eden-cmd` doesn't), select `eden` or `eden-cmd` in the Solution Explorer, right-click and `Set as StartUp Project`.
|
||||
|
||||
 
|
||||
|
||||
* Select the appropriate build type, Debug for debug purposes or Release for performance (in case of doubt choose Release).
|
||||
|
||||

|
||||
|
||||
* Right-click the project you want to build and press Build in the submenu or press F5.
|
||||
|
||||

|
||||
|
||||
## Method II: MinGW-w64 Build with MSYS2
|
||||
|
||||
### Prerequisites to install
|
||||
|
||||
* [MSYS2](https://www.msys2.org)
|
||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - **Make sure to select Latest SDK.**
|
||||
* Make sure to follow the instructions and update to the latest version by running `pacman -Syu` as many times as needed.
|
||||
|
||||
### Install eden dependencies for MinGW-w64
|
||||
|
||||
* Open the `MSYS2 MinGW 64-bit` (mingw64.exe) shell
|
||||
* Download and install all dependencies using: `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
|
||||
* Add MinGW binaries to the PATH: `echo 'PATH=/mingw64/bin:$PATH' >> ~/.bashrc`
|
||||
* Add glslangValidator to the PATH: `echo 'PATH=$(readlink -e /c/VulkanSDK/*/Bin/):$PATH' >> ~/.bashrc`
|
||||
|
||||
### Clone the eden repository with Git
|
||||
|
||||
```bash
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
cd eden
|
||||
```
|
||||
|
||||
### Run the following commands to build eden (dynamically linked build)
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake -G "MSYS Makefiles" -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF ..
|
||||
make -j$(nproc)
|
||||
# test eden out with
|
||||
./bin/eden.exe
|
||||
```
|
||||
|
||||
* *(Note: This build is not a static build meaning that you need to include all of the DLLs with the .exe in order to use it!)*
|
||||
|
||||
e.g.
|
||||
```Bash
|
||||
cp externals/ffmpeg-*/bin/*.dll bin/
|
||||
```
|
||||
|
||||
Bonus Note: Running programs from inside `MSYS2 MinGW x64` shell has a different %PATH% than directly from explorer. This different %PATH% has the locations of the other DLLs required.
|
||||

|
||||
|
||||
|
||||
### Building without Qt (Optional)
|
||||
|
||||
Doesn't require the rather large Qt dependency, but you will lack a GUI frontend:
|
||||
|
||||
* Pass the `-DENABLE_QT=no` flag to cmake
|
||||
|
||||
## Method III: CLion Environment Setup
|
||||
|
||||
### Minimal Dependencies
|
||||
|
||||
To build eden, you need to install the following:
|
||||
|
||||
* [CLion](https://www.jetbrains.com/clion/) - This IDE is not free; for a free alternative, check Method I
|
||||
* [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows) - Make sure to select the Latest SDK.
|
||||
|
||||
### Cloning eden with CLion
|
||||
|
||||
* Clone the Repository:
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
### Building & Setup
|
||||
|
||||
* Once Cloned, You will be taken to a prompt like the image below:
|
||||
|
||||

|
||||
|
||||
* Set the settings to the image below:
|
||||
* Change `Build type: Release`
|
||||
* Change `Name: Release`
|
||||
* Change `Toolchain Visual Studio`
|
||||
* Change `Generator: Let CMake decide`
|
||||
* Change `Build directory: build`
|
||||
|
||||

|
||||
|
||||
* Click OK; now Clion will build a directory and index your code to allow for IntelliSense. Please be patient.
|
||||
* Once this process has been completed (No loading bar bottom right), you can now build eden
|
||||
* In the top right, click on the drop-down menu, select all configurations, then select eden
|
||||
|
||||

|
||||
|
||||
* Now run by clicking the play button or pressing Shift+F10, and eden will auto-launch once built.
|
||||
|
||||

|
||||
|
||||
## Building from the command line with MSVC
|
||||
|
||||
```cmd
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
cd eden
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Building with Scripts
|
||||
A convenience script for building is provided in `.ci/windows/build.sh`. You must run this with Bash, e.g. Git Bash or MinGW TTY. To use this script, you must have windeployqt installed (usually bundled with Qt) and set the `WINDEPLOYQT` environment variable to its canonical Bash location, e.g. `WINDEPLOYQT="/c/Qt/6.9.1/msvc2022_64/bin/windeployqt6.exe" .ci/windows/build.sh`.
|
||||
|
||||
Extra CMake flags should be placed in the arguments of the script.
|
||||
|
||||
Additional environment variables can be used to control building:
|
||||
- `BUILD_TYPE`: Sets the build type to use. Defaults to `Release`
|
||||
|
||||
The following environment variables are boolean flags. Set to `true` to enable or `false` to disable:
|
||||
- `DEVEL` (default FALSE): Disable Qt update checker
|
||||
- `USE_WEBENGINE` (default FALSE): Enable Qt WebEngine
|
||||
- `USE_MULTIMEDIA` (default TRUE): Enable Qt Multimedia
|
||||
- `BUNDLE_QT` (default FALSE): Use bundled Qt
|
||||
* Note that using system Qt requires you to include the Qt CMake directory in `CMAKE_PREFIX_PATH`, e.g. `.ci/windows/build.sh -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64/lib/cmake/Qt6`
|
||||
|
||||
After building, a zip can be packaged via `.ci/windows/package.sh`. Note that you must have 7-zip installed and in your PATH. The resulting zip will be placed into `artifacts` in the source directory.
|
105
docs/build/macOS.md
vendored
105
docs/build/macOS.md
vendored
|
@ -1,105 +0,0 @@
|
|||
Please note this article is intended for development, and eden on macOS is not currently ready for regular use.
|
||||
|
||||
This article was written for developers. eden support for macOS is not ready for casual use.
|
||||
|
||||
## Method I: ninja
|
||||
---
|
||||
If you are compiling on Intel Mac or are using a Rosetta Homebrew installation, you must replace all references of `/opt/homebrew` to `/usr/local`.
|
||||
|
||||
Install dependencies from Homebrew:
|
||||
```sh
|
||||
brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@6 sdl2 speexdsp zlib zlib zstd cmake Catch2 molten-vk vulkan-loader
|
||||
```
|
||||
|
||||
Clone the repo
|
||||
```sh
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
|
||||
cd eden
|
||||
```
|
||||
|
||||
Build for release
|
||||
```sh
|
||||
mkdir build && cd build
|
||||
|
||||
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
|
||||
|
||||
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
|
||||
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
|
||||
|
||||
ninja
|
||||
```
|
||||
|
||||
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON` after `cmake ..`
|
||||
|
||||
Build with debug symbols (vcpkg is not currently used due to broken boost-context library):
|
||||
```sh
|
||||
mkdir build && cd build
|
||||
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
Run the output:
|
||||
```
|
||||
bin/eden.app/Contents/MacOS/eden
|
||||
```
|
||||
|
||||
## Method II: Xcode
|
||||
|
||||
---
|
||||
If you are compiling on Intel Mac or are using a Rosetta Homebrew installation, you must replace all references of `/opt/homebrew` to `/usr/local`.
|
||||
|
||||
Install dependencies from Homebrew:
|
||||
```sh
|
||||
brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@6 sdl2 speexdsp zlib zlib zstd cmake Catch2 molten-vk vulkan-loader
|
||||
```
|
||||
|
||||
Clone the repo
|
||||
```sh
|
||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
||||
|
||||
cd eden
|
||||
```
|
||||
|
||||
Build for release
|
||||
```sh
|
||||
mkdir build && cd build
|
||||
|
||||
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
|
||||
|
||||
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
|
||||
|
||||
cmake .. -GXcode -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=ON -DENABLE_LIBUSB=OFF -DCLANG_FORMAT=ON -DSDL2_DISABLE_INSTALL=ON -DSDL_ALTIVEC=ON
|
||||
|
||||
xcodebuild build -project eden.xcodeproj -scheme "eden" -configuration "RelWithDebInfo"
|
||||
```
|
||||
|
||||
You may also want to include support for Discord Rich Presence by adding `-DUSE_DISCORD_PRESENCE=ON` after `cmake ..`
|
||||
|
||||
Build with debug symbols (vcpkg is not currently used due to broken boost-context library):
|
||||
```sh
|
||||
mkdir build && cd build
|
||||
export Qt6_DIR="/opt/homebrew/opt/qt@6/lib/cmake"
|
||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
|
||||
ninja
|
||||
```
|
||||
|
||||
Run the output:
|
||||
```
|
||||
bin/eden.app/Contents/MacOS/eden
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
To run with MoltenVK, install additional dependencies:
|
||||
```sh
|
||||
brew install molten-vk vulkan-loader
|
||||
```
|
||||
|
||||
Run with Vulkan loader path:
|
||||
```sh
|
||||
export LIBVULKAN_PATH=/opt/homebrew/lib/libvulkan.dylib
|
||||
bin/eden.app/Contents/MacOS/eden
|
||||
```
|
21
externals/CMakeLists.txt
vendored
21
externals/CMakeLists.txt
vendored
|
@ -83,18 +83,7 @@ if (YUZU_USE_EXTERNAL_SDL2)
|
|||
set(SDL_FILE ON)
|
||||
endif()
|
||||
|
||||
include(CPM)
|
||||
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm)
|
||||
set(CPM_USE_LOCAL_PACKAGES OFF)
|
||||
|
||||
if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck")
|
||||
set(SDL_HASH cc016b0046)
|
||||
set(SDL_PIPEWIRE OFF) # build errors out with this on
|
||||
else()
|
||||
set(SDL_HASH 2e4c12cd2c)
|
||||
endif()
|
||||
|
||||
CPMAddPackage("gh:libsdl-org/SDL#${SDL_HASH}")
|
||||
add_subdirectory(SDL)
|
||||
endif()
|
||||
|
||||
# ENet
|
||||
|
@ -171,12 +160,6 @@ if (YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
|
|||
add_subdirectory(Vulkan-Utility-Libraries)
|
||||
endif()
|
||||
|
||||
# SPIRV-Tools
|
||||
if (YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||
set(SPIRV_SKIP_EXECUTABLES ON)
|
||||
add_subdirectory(SPIRV-Tools)
|
||||
endif()
|
||||
|
||||
# Boost headers
|
||||
add_subdirectory(boost-headers)
|
||||
|
||||
|
@ -222,7 +205,7 @@ if (ANDROID)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if ((CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID) AND NOT TARGET gamemode::headers)
|
||||
if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers)
|
||||
add_library(gamemode INTERFACE)
|
||||
target_include_directories(gamemode INTERFACE gamemode)
|
||||
add_library(gamemode::headers ALIAS gamemode)
|
||||
|
|
1
externals/SDL
vendored
Submodule
1
externals/SDL
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 2e4c12cd2cb2c5d0b60ef2196b400339591e733c
|
1
externals/SPIRV-Tools
vendored
1
externals/SPIRV-Tools
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit 40eb301f320e1d85ce3bc12798022149eae3eee3
|
2
externals/Vulkan-Headers
vendored
2
externals/Vulkan-Headers
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 89268a6d17fc87003b209a1422c17ab288be99a0
|
||||
Subproject commit 409c16be502e39fe70dd6fe2d9ad4842ef2c9a53
|
2
externals/Vulkan-Utility-Libraries
vendored
2
externals/Vulkan-Utility-Libraries
vendored
|
@ -1 +1 @@
|
|||
Subproject commit df2e3581520f36776cd42b9fec3ec4a51ab878ef
|
||||
Subproject commit 4e246c56ec5afb5ad66b9b04374d39ac04675c8e
|
2
externals/VulkanMemoryAllocator
vendored
2
externals/VulkanMemoryAllocator
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 1076b348abd17859a116f4b111c43d58a588a086
|
||||
Subproject commit 539c0a8d8e3733c9f25ea9a184c85c77504f1653
|
2
externals/cubeb
vendored
2
externals/cubeb
vendored
|
@ -1 +1 @@
|
|||
Subproject commit fa021607121360af7c171d881dc5bc8af7bb56eb
|
||||
Subproject commit 832fcf38e600bf80b4b728a3e0227403088d992c
|
6
externals/dynarmic/CMakeLists.txt
vendored
6
externals/dynarmic/CMakeLists.txt
vendored
|
@ -98,7 +98,8 @@ else()
|
|||
-Wextra
|
||||
-Wcast-qual
|
||||
-pedantic
|
||||
-Wno-missing-braces)
|
||||
-Wno-missing-braces
|
||||
-Wstack-usage=4096)
|
||||
|
||||
if (ARCHITECTURE STREQUAL "x86_64")
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -mtune=core2)
|
||||
|
@ -122,15 +123,12 @@ else()
|
|||
# GCC knows that the variable is actually a Reg64. isMEM() will never return true for a
|
||||
# Reg64, but GCC doesn't know that.
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -Wno-array-bounds)
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -Wstack-usage=4096)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
# Bracket depth determines maximum size of a fold expression in Clang since 9c9974c3ccb6.
|
||||
# And this in turns limits the size of a std::array.
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -fbracket-depth=1024)
|
||||
# Clang mistakenly blames CMake for using unused arguments during compilation
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -Wno-unused-command-line-argument)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
11
externals/dynarmic/externals/CMakeLists.txt
vendored
11
externals/dynarmic/externals/CMakeLists.txt
vendored
|
@ -64,13 +64,12 @@ if (NOT TARGET ankerl::unordered_dense)
|
|||
endif()
|
||||
|
||||
# xbyak
|
||||
# uncomment if in an independent repo.
|
||||
|
||||
# if (NOT TARGET xbyak::xbyak)
|
||||
# if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
# add_subdirectory(xbyak)
|
||||
# endif()
|
||||
# endif()
|
||||
if (NOT TARGET xbyak::xbyak)
|
||||
if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
add_subdirectory(xbyak)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# zydis
|
||||
|
||||
|
|
2
externals/dynarmic/externals/catch
vendored
2
externals/dynarmic/externals/catch
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 5aa8d113215bd9a97ecc1a2f3fc9506947a2fa57
|
||||
Subproject commit 74fcff6e5b190fb833a231b7f7c1829e3c3ac54d
|
2
externals/dynarmic/externals/fmt
vendored
2
externals/dynarmic/externals/fmt
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 35dcc58263d6b55419a5932bd6b0b3029a0a8c00
|
||||
Subproject commit 02de29e00321787fa515ca60f0f5911e61892dc6
|
1
externals/dynarmic/externals/xbyak
vendored
Submodule
1
externals/dynarmic/externals/xbyak
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 44a72f369268f7d552650891b296693e91db86bb
|
2
externals/dynarmic/externals/zycore-c
vendored
2
externals/dynarmic/externals/zycore-c
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 75a36c45ae1ad382b0f4e0ede0af84c11ee69928
|
||||
Subproject commit 7ad36e52110b39cfb62b47bfdb6def94ac531309
|
2
externals/dynarmic/externals/zydis
vendored
2
externals/dynarmic/externals/zydis
vendored
|
@ -1 +1 @@
|
|||
Subproject commit c2d2bab0255e53a7c3e9b615f4eb69449eb942df
|
||||
Subproject commit 6372690e30389a94db65ece2d8a1f0a2310475ed
|
108
externals/dynarmic/src/dynarmic/CMakeLists.txt
vendored
108
externals/dynarmic/src/dynarmic/CMakeLists.txt
vendored
|
@ -5,10 +5,7 @@ add_library(dynarmic
|
|||
backend/block_range_information.h
|
||||
backend/exception_handler.h
|
||||
common/always_false.h
|
||||
common/assert.cpp
|
||||
common/assert.h
|
||||
common/cast_util.h
|
||||
common/common_types.h
|
||||
common/crypto/aes.cpp
|
||||
common/crypto/aes.h
|
||||
common/crypto/crc32.cpp
|
||||
|
@ -128,6 +125,52 @@ if ("A32" IN_LIST DYNARMIC_FRONTENDS)
|
|||
frontend/A32/translate/a32_translate.h
|
||||
frontend/A32/translate/conditional_state.cpp
|
||||
frontend/A32/translate/conditional_state.h
|
||||
frontend/A32/translate/impl/a32_branch.cpp
|
||||
frontend/A32/translate/impl/a32_crc32.cpp
|
||||
frontend/A32/translate/impl/a32_exception_generating.cpp
|
||||
frontend/A32/translate/impl/a32_translate_impl.cpp
|
||||
frontend/A32/translate/impl/a32_translate_impl.h
|
||||
frontend/A32/translate/impl/asimd_load_store_structures.cpp
|
||||
frontend/A32/translate/impl/asimd_misc.cpp
|
||||
frontend/A32/translate/impl/asimd_one_reg_modified_immediate.cpp
|
||||
frontend/A32/translate/impl/asimd_three_regs.cpp
|
||||
frontend/A32/translate/impl/asimd_two_regs_misc.cpp
|
||||
frontend/A32/translate/impl/asimd_two_regs_scalar.cpp
|
||||
frontend/A32/translate/impl/asimd_two_regs_shift.cpp
|
||||
frontend/A32/translate/impl/barrier.cpp
|
||||
frontend/A32/translate/impl/coprocessor.cpp
|
||||
frontend/A32/translate/impl/data_processing.cpp
|
||||
frontend/A32/translate/impl/divide.cpp
|
||||
frontend/A32/translate/impl/extension.cpp
|
||||
frontend/A32/translate/impl/hint.cpp
|
||||
frontend/A32/translate/impl/load_store.cpp
|
||||
frontend/A32/translate/impl/misc.cpp
|
||||
frontend/A32/translate/impl/multiply.cpp
|
||||
frontend/A32/translate/impl/packing.cpp
|
||||
frontend/A32/translate/impl/parallel.cpp
|
||||
frontend/A32/translate/impl/reversal.cpp
|
||||
frontend/A32/translate/impl/saturated.cpp
|
||||
frontend/A32/translate/impl/status_register_access.cpp
|
||||
frontend/A32/translate/impl/synchronization.cpp
|
||||
frontend/A32/translate/impl/thumb16.cpp
|
||||
frontend/A32/translate/impl/thumb32_branch.cpp
|
||||
frontend/A32/translate/impl/thumb32_control.cpp
|
||||
frontend/A32/translate/impl/thumb32_coprocessor.cpp
|
||||
frontend/A32/translate/impl/thumb32_data_processing_modified_immediate.cpp
|
||||
frontend/A32/translate/impl/thumb32_data_processing_plain_binary_immediate.cpp
|
||||
frontend/A32/translate/impl/thumb32_data_processing_register.cpp
|
||||
frontend/A32/translate/impl/thumb32_data_processing_shifted_register.cpp
|
||||
frontend/A32/translate/impl/thumb32_load_byte.cpp
|
||||
frontend/A32/translate/impl/thumb32_load_halfword.cpp
|
||||
frontend/A32/translate/impl/thumb32_load_store_dual.cpp
|
||||
frontend/A32/translate/impl/thumb32_load_store_multiple.cpp
|
||||
frontend/A32/translate/impl/thumb32_load_word.cpp
|
||||
frontend/A32/translate/impl/thumb32_long_multiply.cpp
|
||||
frontend/A32/translate/impl/thumb32_misc.cpp
|
||||
frontend/A32/translate/impl/thumb32_multiply.cpp
|
||||
frontend/A32/translate/impl/thumb32_parallel.cpp
|
||||
frontend/A32/translate/impl/thumb32_store_single_data_item.cpp
|
||||
frontend/A32/translate/impl/vfp.cpp
|
||||
frontend/A32/translate/translate_arm.cpp
|
||||
frontend/A32/translate/translate_thumb.cpp
|
||||
interface/A32/a32.h
|
||||
|
@ -151,6 +194,65 @@ if ("A64" IN_LIST DYNARMIC_FRONTENDS)
|
|||
frontend/A64/decoder/a64.inc
|
||||
frontend/A64/translate/a64_translate.cpp
|
||||
frontend/A64/translate/a64_translate.h
|
||||
frontend/A64/translate/impl/a64_branch.cpp
|
||||
frontend/A64/translate/impl/a64_exception_generating.cpp
|
||||
frontend/A64/translate/impl/data_processing_addsub.cpp
|
||||
frontend/A64/translate/impl/data_processing_bitfield.cpp
|
||||
frontend/A64/translate/impl/data_processing_conditional_compare.cpp
|
||||
frontend/A64/translate/impl/data_processing_conditional_select.cpp
|
||||
frontend/A64/translate/impl/data_processing_crc32.cpp
|
||||
frontend/A64/translate/impl/data_processing_logical.cpp
|
||||
frontend/A64/translate/impl/data_processing_multiply.cpp
|
||||
frontend/A64/translate/impl/data_processing_pcrel.cpp
|
||||
frontend/A64/translate/impl/data_processing_register.cpp
|
||||
frontend/A64/translate/impl/data_processing_shift.cpp
|
||||
frontend/A64/translate/impl/floating_point_compare.cpp
|
||||
frontend/A64/translate/impl/floating_point_conditional_compare.cpp
|
||||
frontend/A64/translate/impl/floating_point_conditional_select.cpp
|
||||
frontend/A64/translate/impl/floating_point_conversion_fixed_point.cpp
|
||||
frontend/A64/translate/impl/floating_point_conversion_integer.cpp
|
||||
frontend/A64/translate/impl/floating_point_data_processing_one_register.cpp
|
||||
frontend/A64/translate/impl/floating_point_data_processing_three_register.cpp
|
||||
frontend/A64/translate/impl/floating_point_data_processing_two_register.cpp
|
||||
frontend/A64/translate/impl/impl.cpp
|
||||
frontend/A64/translate/impl/impl.h
|
||||
frontend/A64/translate/impl/load_store_exclusive.cpp
|
||||
frontend/A64/translate/impl/load_store_load_literal.cpp
|
||||
frontend/A64/translate/impl/load_store_multiple_structures.cpp
|
||||
frontend/A64/translate/impl/load_store_no_allocate_pair.cpp
|
||||
frontend/A64/translate/impl/load_store_register_immediate.cpp
|
||||
frontend/A64/translate/impl/load_store_register_pair.cpp
|
||||
frontend/A64/translate/impl/load_store_register_register_offset.cpp
|
||||
frontend/A64/translate/impl/load_store_register_unprivileged.cpp
|
||||
frontend/A64/translate/impl/load_store_single_structure.cpp
|
||||
frontend/A64/translate/impl/move_wide.cpp
|
||||
frontend/A64/translate/impl/simd_across_lanes.cpp
|
||||
frontend/A64/translate/impl/simd_aes.cpp
|
||||
frontend/A64/translate/impl/simd_copy.cpp
|
||||
frontend/A64/translate/impl/simd_crypto_four_register.cpp
|
||||
frontend/A64/translate/impl/simd_crypto_three_register.cpp
|
||||
frontend/A64/translate/impl/simd_extract.cpp
|
||||
frontend/A64/translate/impl/simd_modified_immediate.cpp
|
||||
frontend/A64/translate/impl/simd_permute.cpp
|
||||
frontend/A64/translate/impl/simd_scalar_pairwise.cpp
|
||||
frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp
|
||||
frontend/A64/translate/impl/simd_scalar_three_same.cpp
|
||||
frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp
|
||||
frontend/A64/translate/impl/simd_scalar_x_indexed_element.cpp
|
||||
frontend/A64/translate/impl/simd_sha.cpp
|
||||
frontend/A64/translate/impl/simd_sha512.cpp
|
||||
frontend/A64/translate/impl/simd_shift_by_immediate.cpp
|
||||
frontend/A64/translate/impl/simd_table_lookup.cpp
|
||||
frontend/A64/translate/impl/simd_three_different.cpp
|
||||
frontend/A64/translate/impl/simd_three_same.cpp
|
||||
frontend/A64/translate/impl/simd_three_same_extra.cpp
|
||||
frontend/A64/translate/impl/simd_two_register_misc.cpp
|
||||
frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp
|
||||
frontend/A64/translate/impl/sys_dc.cpp
|
||||
frontend/A64/translate/impl/sys_ic.cpp
|
||||
frontend/A64/translate/impl/system.cpp
|
||||
frontend/A64/translate/impl/system_flag_format.cpp
|
||||
frontend/A64/translate/impl/system_flag_manipulation.cpp
|
||||
interface/A64/a64.h
|
||||
interface/A64/config.h
|
||||
ir/opt/a64_callback_config_pass.cpp
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2021 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,9 +7,9 @@
|
|||
#include <mutex>
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/arm64/a32_address_space.h"
|
||||
#include "dynarmic/backend/arm64/a32_core.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -9,7 +6,7 @@
|
|||
#include "dynarmic/backend/arm64/a32_jitstate.h"
|
||||
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::Arm64 {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2021 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||
#include "dynarmic/ir/location_descriptor.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,9 +7,9 @@
|
|||
#include <mutex>
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/arm64/a64_address_space.h"
|
||||
#include "dynarmic/backend/arm64/a64_core.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/frontend/A64/a64_location_descriptor.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <oaknut/oaknut.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::Arm64 {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -13,7 +10,7 @@
|
|||
#include <type_traits>
|
||||
|
||||
#include <mcl/mp/metavalue/lift_value.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <oaknut/oaknut.hpp>
|
||||
|
||||
#include "dynarmic/common/always_false.h"
|
||||
|
@ -62,12 +59,13 @@ constexpr RegisterList ToRegList(oaknut::Reg reg) {
|
|||
}
|
||||
|
||||
if (reg.index() == 31) {
|
||||
ASSERT_FALSE("ZR not allowed in reg list");
|
||||
throw std::out_of_range("ZR not allowed in reg list");
|
||||
}
|
||||
|
||||
if (reg.index() == -1) {
|
||||
return RegisterList{1} << 31;
|
||||
}
|
||||
|
||||
return RegisterList{1} << reg.index();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <map>
|
||||
#include <optional>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <oaknut/code_block.hpp>
|
||||
#include <oaknut/oaknut.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -9,7 +6,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/function_info.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::Arm64 {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -13,7 +10,7 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
#include "dynarmic/backend/arm64/fastmem.h"
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace oaknut {
|
||||
struct CodeGenerator;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
|
||||
namespace Dynarmic {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -12,7 +9,7 @@
|
|||
#include <tuple>
|
||||
|
||||
#include <mcl/hash/xmrx.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
#include "dynarmic/backend/exception_handler.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -8,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace oaknut {
|
||||
struct CodeGenerator;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -12,11 +9,11 @@
|
|||
#include <array>
|
||||
#include <iterator>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include <mcl/mp/metavalue/lift_value.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/arm64/abi.h"
|
||||
#include "dynarmic/backend/arm64/emit_context.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -14,8 +11,8 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/is_instance_of_template.hpp>
|
||||
#include <oaknut/oaknut.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2022 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::Arm64 {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2023 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/arm64/stack_layout.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <boost/icl/interval_map.hpp>
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
namespace Dynarmic::Backend {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2020 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -13,7 +10,7 @@
|
|||
#include <optional>
|
||||
|
||||
#include <mcl/macro/architecture.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#if defined(MCL_ARCHITECTURE_X86_64)
|
||||
namespace Dynarmic::Backend::X64 {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2019 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -18,10 +15,10 @@
|
|||
#include <vector>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include <mcl/macro/architecture.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/exception_handler.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2019 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -16,9 +13,6 @@
|
|||
# ifndef __OpenBSD__
|
||||
# include <ucontext.h>
|
||||
# endif
|
||||
# ifdef __sun__
|
||||
# include <sys/regset.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
|
@ -28,9 +22,9 @@
|
|||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#if defined(MCL_ARCHITECTURE_X86_64)
|
||||
# include "dynarmic/backend/x64/block_of_code.h"
|
||||
|
@ -151,9 +145,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) {
|
|||
|
||||
#ifndef MCL_ARCHITECTURE_RISCV
|
||||
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context);
|
||||
#ifndef __OpenBSD__
|
||||
# ifndef __OpenBSD__
|
||||
auto& mctx = ucontext->uc_mcontext;
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(MCL_ARCHITECTURE_X86_64)
|
||||
|
@ -173,9 +167,6 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) {
|
|||
# elif defined(__OpenBSD__)
|
||||
# define CTX_RIP (ucontext->sc_rip)
|
||||
# define CTX_RSP (ucontext->sc_rsp)
|
||||
# elif defined(__sun__)
|
||||
# define CTX_RIP (mctx.gregs[REG_RIP])
|
||||
# define CTX_RSP (mctx.gregs[REG_RSP])
|
||||
# else
|
||||
# error "Unknown platform"
|
||||
# endif
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -8,7 +5,7 @@
|
|||
|
||||
#include "dynarmic/backend/riscv64/a32_address_space.h"
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
|
||||
#include "dynarmic/backend/riscv64/abi.h"
|
||||
#include "dynarmic/backend/riscv64/emit_riscv64.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,9 +7,9 @@
|
|||
#include <mutex>
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/riscv64/a32_address_space.h"
|
||||
#include "dynarmic/backend/riscv64/a32_core.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -9,7 +6,7 @@
|
|||
#include "dynarmic/backend/riscv64/a32_jitstate.h"
|
||||
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::RV64 {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/frontend/A32/a32_location_descriptor.h"
|
||||
#include "dynarmic/ir/location_descriptor.h"
|
||||
|
|
|
@ -14,26 +14,29 @@ namespace Dynarmic::Backend::RV64 {
|
|||
|
||||
class CodeBlock {
|
||||
public:
|
||||
explicit CodeBlock(std::size_t size) noexcept : memsize(size) {
|
||||
explicit CodeBlock(std::size_t size)
|
||||
: memsize(size) {
|
||||
mem = (u8*)mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
|
||||
if (mem == nullptr)
|
||||
ASSERT_FALSE("out of memory");
|
||||
throw std::bad_alloc{};
|
||||
}
|
||||
|
||||
~CodeBlock() noexcept {
|
||||
~CodeBlock() {
|
||||
if (mem == nullptr)
|
||||
return;
|
||||
|
||||
munmap(mem, memsize);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T ptr() const noexcept {
|
||||
T ptr() const {
|
||||
static_assert(std::is_pointer_v<T> || std::is_same_v<T, uptr> || std::is_same_v<T, sptr>);
|
||||
return reinterpret_cast<T>(mem);
|
||||
}
|
||||
|
||||
protected:
|
||||
u8* mem = nullptr;
|
||||
u8* mem;
|
||||
size_t memsize = 0;
|
||||
};
|
||||
} // namespace Dynarmic::Backend::RV64
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include <biscuit/label.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace biscuit {
|
||||
class Assembler;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,9 +8,9 @@
|
|||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/mp/metavalue/lift_value.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/common/always_false.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -16,8 +13,8 @@
|
|||
|
||||
#include <biscuit/assembler.hpp>
|
||||
#include <biscuit/registers.hpp>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/is_instance_of_template.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2024 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::RV64 {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -14,10 +11,10 @@
|
|||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ostream.h>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <boost/container/static_vector.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/a32_jitstate.h"
|
||||
|
@ -127,36 +124,35 @@ A32EmitX64::BlockDescriptor A32EmitX64::Emit(IR::Block& block) {
|
|||
|
||||
EmitCondPrelude(ctx);
|
||||
|
||||
auto const loop_all_inst = [this, &block, &ctx](auto const func) {
|
||||
for (auto iter = block.begin(); iter != block.end(); ++iter) [[likely]] {
|
||||
auto* inst = &*iter;
|
||||
// Call the relevant Emit* member function.
|
||||
switch (inst->GetOpcode()) {
|
||||
#define OPCODE(name, type, ...) \
|
||||
case IR::Opcode::name: \
|
||||
A32EmitX64::Emit##name(ctx, inst); \
|
||||
break;
|
||||
#define A32OPC(name, type, ...) \
|
||||
case IR::Opcode::A32##name: \
|
||||
A32EmitX64::EmitA32##name(ctx, inst);\
|
||||
break;
|
||||
for (auto iter = block.begin(); iter != block.end(); ++iter) {
|
||||
IR::Inst* inst = &*iter;
|
||||
|
||||
// Call the relevant Emit* member function.
|
||||
switch (inst->GetOpcode()) {
|
||||
#define OPCODE(name, type, ...) \
|
||||
case IR::Opcode::name: \
|
||||
A32EmitX64::Emit##name(ctx, inst); \
|
||||
break;
|
||||
#define A32OPC(name, type, ...) \
|
||||
case IR::Opcode::A32##name: \
|
||||
A32EmitX64::EmitA32##name(ctx, inst); \
|
||||
break;
|
||||
#define A64OPC(...)
|
||||
#include "dynarmic/ir/opcodes.inc"
|
||||
#undef OPCODE
|
||||
#undef A32OPC
|
||||
#undef A64OPC
|
||||
default: [[unlikely]] ASSERT_FALSE("Invalid opcode: {}", inst->GetOpcode());
|
||||
}
|
||||
reg_alloc.EndOfAllocScope();
|
||||
func(reg_alloc);
|
||||
|
||||
default:
|
||||
ASSERT_FALSE("Invalid opcode: {}", inst->GetOpcode());
|
||||
break;
|
||||
}
|
||||
};
|
||||
if (!conf.very_verbose_debugging_output) [[likely]] {
|
||||
loop_all_inst([](auto&) { /*noop*/ });
|
||||
} else [[unlikely]] {
|
||||
loop_all_inst([this](auto& reg_alloc) {
|
||||
|
||||
reg_alloc.EndOfAllocScope();
|
||||
|
||||
if (conf.very_verbose_debugging_output) {
|
||||
EmitVerboseDebuggingOutput(reg_alloc);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
reg_alloc.AssertNoMoreUses();
|
||||
|
@ -233,7 +229,7 @@ void A32EmitX64::GenTerminalHandlers() {
|
|||
terminal_handler_pop_rsb_hint = code.getCurr<const void*>();
|
||||
calculate_location_descriptor();
|
||||
code.mov(eax, dword[r15 + offsetof(A32JitState, rsb_ptr)]);
|
||||
code.dec(eax);
|
||||
code.sub(eax, 1);
|
||||
code.and_(eax, u32(A32JitState::RSBPtrMask));
|
||||
code.mov(dword[r15 + offsetof(A32JitState, rsb_ptr)], eax);
|
||||
code.cmp(rbx, qword[r15 + offsetof(A32JitState, rsb_location_descriptors) + rax * sizeof(u64)]);
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -12,10 +9,10 @@
|
|||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/a32_emit_x64.h"
|
||||
#include "dynarmic/backend/x64/a32_jitstate.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -8,9 +5,9 @@
|
|||
|
||||
#include "dynarmic/backend/x64/a32_jitstate.h"
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
#include "dynarmic/backend/x64/nzcv_util.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
namespace Dynarmic::Backend::X64 {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,9 +7,9 @@
|
|||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ostream.h>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/integer_of_size.hpp>
|
||||
#include <boost/container/static_vector.hpp>
|
||||
|
||||
|
@ -201,19 +198,18 @@ void A64EmitX64::GenTerminalHandlers() {
|
|||
code.or_(rbx, rcx);
|
||||
};
|
||||
|
||||
Xbyak::Label fast_dispatch_cache_miss;
|
||||
Xbyak::Label rsb_cache_miss;
|
||||
Xbyak::Label fast_dispatch_cache_miss, rsb_cache_miss;
|
||||
|
||||
code.align();
|
||||
terminal_handler_pop_rsb_hint = code.getCurr<const void*>();
|
||||
calculate_location_descriptor();
|
||||
code.mov(eax, dword[r15 + offsetof(A64JitState, rsb_ptr)]);
|
||||
code.dec(eax);
|
||||
code.sub(eax, 1);
|
||||
code.and_(eax, u32(A64JitState::RSBPtrMask));
|
||||
code.mov(dword[r15 + offsetof(A64JitState, rsb_ptr)], eax);
|
||||
code.cmp(rbx, qword[r15 + offsetof(A64JitState, rsb_location_descriptors) + rax * sizeof(u64)]);
|
||||
if (conf.HasOptimization(OptimizationFlag::FastDispatch)) {
|
||||
code.jne(rsb_cache_miss, code.T_NEAR);
|
||||
code.jne(rsb_cache_miss);
|
||||
} else {
|
||||
code.jne(code.GetReturnFromRunCodeAddress());
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ void A64EmitX64::GenMemory128Accessors() {
|
|||
#ifdef _WIN32
|
||||
Devirtualize<&A64::UserCallbacks::MemoryRead128>(conf.callbacks).EmitCallWithReturnPointer(code, [&](Xbyak::Reg64 return_value_ptr, [[maybe_unused]] RegList args) {
|
||||
code.mov(code.ABI_PARAM3, code.ABI_PARAM2);
|
||||
code.lea(rsp, ptr[rsp - (8 + 16 + ABI_SHADOW_SPACE)]);
|
||||
code.sub(rsp, 8 + 16 + ABI_SHADOW_SPACE);
|
||||
code.lea(return_value_ptr, ptr[rsp + ABI_SHADOW_SPACE]);
|
||||
});
|
||||
code.movups(xmm1, xword[code.ABI_RETURN]);
|
||||
code.add(rsp, 8 + 16 + ABI_SHADOW_SPACE);
|
||||
#else
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
Devirtualize<&A64::UserCallbacks::MemoryRead128>(conf.callbacks).EmitCall(code);
|
||||
if (code.HasHostFeature(HostFeature::SSE41)) {
|
||||
code.movq(xmm1, code.ABI_RETURN);
|
||||
|
@ -57,13 +57,13 @@ void A64EmitX64::GenMemory128Accessors() {
|
|||
code.align();
|
||||
memory_write_128 = code.getCurr<void (*)()>();
|
||||
#ifdef _WIN32
|
||||
code.lea(rsp, ptr[rsp - (8 + 16 + ABI_SHADOW_SPACE)]);
|
||||
code.sub(rsp, 8 + 16 + ABI_SHADOW_SPACE);
|
||||
code.lea(code.ABI_PARAM3, ptr[rsp + ABI_SHADOW_SPACE]);
|
||||
code.movaps(xword[code.ABI_PARAM3], xmm1);
|
||||
Devirtualize<&A64::UserCallbacks::MemoryWrite128>(conf.callbacks).EmitCall(code);
|
||||
code.add(rsp, 8 + 16 + ABI_SHADOW_SPACE);
|
||||
#else
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
if (code.HasHostFeature(HostFeature::SSE41)) {
|
||||
code.movq(code.ABI_PARAM3, xmm1);
|
||||
code.pextrq(code.ABI_PARAM4, xmm1, 1);
|
||||
|
@ -81,7 +81,7 @@ void A64EmitX64::GenMemory128Accessors() {
|
|||
code.align();
|
||||
memory_exclusive_write_128 = code.getCurr<void (*)()>();
|
||||
#ifdef _WIN32
|
||||
code.lea(rsp, ptr[rsp - (8 + 32 + ABI_SHADOW_SPACE)]);
|
||||
code.sub(rsp, 8 + 32 + ABI_SHADOW_SPACE);
|
||||
code.lea(code.ABI_PARAM3, ptr[rsp + ABI_SHADOW_SPACE]);
|
||||
code.lea(code.ABI_PARAM4, ptr[rsp + ABI_SHADOW_SPACE + 16]);
|
||||
code.movaps(xword[code.ABI_PARAM3], xmm1);
|
||||
|
@ -89,7 +89,7 @@ void A64EmitX64::GenMemory128Accessors() {
|
|||
Devirtualize<&A64::UserCallbacks::MemoryWriteExclusive128>(conf.callbacks).EmitCall(code);
|
||||
code.add(rsp, 8 + 32 + ABI_SHADOW_SPACE);
|
||||
#else
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
if (code.HasHostFeature(HostFeature::SSE41)) {
|
||||
code.movq(code.ABI_PARAM3, xmm1);
|
||||
code.pextrq(code.ABI_PARAM4, xmm1, 1);
|
||||
|
@ -131,8 +131,8 @@ void A64EmitX64::GenFastmemFallbacks() {
|
|||
{64, Devirtualize<&A64::UserCallbacks::MemoryWriteExclusive64>(conf.callbacks)},
|
||||
}};
|
||||
|
||||
for (auto const ordered : {false, true}) {
|
||||
for (auto const vaddr_idx : idxes) {
|
||||
for (bool ordered : {false, true}) {
|
||||
for (int vaddr_idx : idxes) {
|
||||
if (vaddr_idx == 4 || vaddr_idx == 15) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <mutex>
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/nzcv_util.h"
|
||||
#include "dynarmic/frontend/A64/a64_location_descriptor.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2020 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include <mcl/iterator/reverse.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -9,7 +6,7 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/hostloc.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -24,7 +21,7 @@
|
|||
#include <array>
|
||||
#include <cstring>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
|
@ -66,8 +63,7 @@ public:
|
|||
uint8_t* alloc(size_t size) override {
|
||||
void* p = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
|
||||
if (p == nullptr) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||
throw Xbyak::Error(Xbyak::ERR_CANT_ALLOC);
|
||||
}
|
||||
return static_cast<uint8_t*>(p);
|
||||
}
|
||||
|
@ -99,8 +95,7 @@ public:
|
|||
|
||||
void* p = mmap(nullptr, size, PROT_READ | PROT_WRITE, mode, -1, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||
throw Xbyak::Error(Xbyak::ERR_CANT_ALLOC);
|
||||
}
|
||||
std::memcpy(p, &size, sizeof(size_t));
|
||||
return static_cast<uint8_t*>(p) + DYNARMIC_PAGE_SIZE;
|
||||
|
@ -519,8 +514,7 @@ size_t BlockOfCode::GetTotalCodeSize() const {
|
|||
|
||||
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
|
||||
if (size_ + alloc_size >= maxSize_) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
|
||||
throw Xbyak::Error(Xbyak::ERR_CODE_IS_TOO_BIG);
|
||||
}
|
||||
|
||||
EnsureMemoryCommitted(alloc_size);
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -14,7 +11,7 @@
|
|||
#include <type_traits>
|
||||
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <xbyak/xbyak.h>
|
||||
#include <xbyak/xbyak_util.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
namespace Dynarmic::Backend::X64 {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,7 +7,7 @@
|
|||
|
||||
#include <cstring>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -13,7 +10,7 @@
|
|||
#include <span>
|
||||
#include <utility>
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -11,7 +8,7 @@
|
|||
#include <optional>
|
||||
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/common/fp/rounding_mode.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -12,7 +9,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include <mcl/bit_cast.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/function_info.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/callback.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,10 +7,10 @@
|
|||
|
||||
#include <iterator>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/bit/bit_field.hpp>
|
||||
#include <mcl/scope_exit.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
|
@ -107,7 +104,7 @@ void EmitX64::PushRSBHelper(Xbyak::Reg64 loc_desc_reg, Xbyak::Reg64 index_reg, I
|
|||
}
|
||||
|
||||
void EmitX64::EmitVerboseDebuggingOutput(RegAlloc& reg_alloc) {
|
||||
code.lea(rsp, ptr[rsp - sizeof(RegisterData)]);
|
||||
code.sub(rsp, sizeof(RegisterData));
|
||||
code.stmxcsr(dword[rsp + offsetof(RegisterData, mxcsr)]);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (rsp.getIdx() == i) {
|
||||
|
@ -226,7 +223,7 @@ void EmitX64::EmitGetNZCVFromOp(EmitContext& ctx, IR::Inst* inst) {
|
|||
const Xbyak::Reg value = ctx.reg_alloc.UseGpr(args[0]).changeBit(bitsize);
|
||||
code.test(value, value);
|
||||
code.lahf();
|
||||
code.xor_(al, al);
|
||||
code.mov(al, 0);
|
||||
ctx.reg_alloc.DefineValue(inst, nzcv);
|
||||
}
|
||||
|
||||
|
@ -273,6 +270,7 @@ void EmitX64::EmitNZCVFromPackedFlags(EmitContext& ctx, IR::Inst* inst) {
|
|||
code.shr(nzcv, 28);
|
||||
code.imul(nzcv, nzcv, NZCV::to_x64_multiplier);
|
||||
code.and_(nzcv, NZCV::x64_mask);
|
||||
|
||||
ctx.reg_alloc.DefineValue(inst, nzcv);
|
||||
}
|
||||
}
|
||||
|
@ -333,8 +331,10 @@ Xbyak::Label EmitX64::EmitCond(IR::Cond cond) {
|
|||
code.jle(pass);
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
ASSERT_MSG(false, "Unknown cond {}", static_cast<size_t>(cond));
|
||||
break;
|
||||
}
|
||||
|
||||
return pass;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/abi.h"
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -9,8 +6,8 @@
|
|||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/stdint.hpp>
|
||||
|
||||
#include "dynarmic/backend/x64/block_of_code.h"
|
||||
#include "dynarmic/backend/x64/emit_x64.h"
|
||||
|
@ -995,6 +992,7 @@ static void EmitAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst, int bit
|
|||
code.seto(overflow);
|
||||
ctx.reg_alloc.DefineValue(overflow_inst, overflow);
|
||||
}
|
||||
|
||||
ctx.reg_alloc.DefineValue(inst, result);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
|
@ -10,14 +7,14 @@
|
|||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
#include <mcl/assert.hpp>
|
||||
#include <mcl/mp/metavalue/lift_value.hpp>
|
||||
#include <mcl/mp/typelist/cartesian_product.hpp>
|
||||
#include <mcl/mp/typelist/get.hpp>
|
||||
#include <mcl/mp/typelist/lift_sequence.hpp>
|
||||
#include <mcl/mp/typelist/list.hpp>
|
||||
#include <mcl/mp/typelist/lower_to_tuple.hpp>
|
||||
#include "dynarmic/common/common_types.h"
|
||||
#include <mcl/stdint.hpp>
|
||||
#include <mcl/type_traits/integer_of_size.hpp>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
|
@ -36,23 +33,6 @@
|
|||
#include "dynarmic/ir/basic_block.h"
|
||||
#include "dynarmic/ir/microinstruction.h"
|
||||
|
||||
#define FCODE(NAME) \
|
||||
[&code](auto... args) { \
|
||||
if constexpr (fsize == 32) { \
|
||||
code.NAME##s(args...); \
|
||||
} else { \
|
||||
code.NAME##d(args...); \
|
||||
} \
|
||||
}
|
||||
#define ICODE(NAME) \
|
||||
[&code](auto... args) { \
|
||||
if constexpr (fsize == 32) { \
|
||||
code.NAME##d(args...); \
|
||||
} else { \
|
||||
code.NAME##q(args...); \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace Dynarmic::Backend::X64 {
|
||||
|
||||
using namespace Xbyak::util;
|
||||
|
@ -80,6 +60,23 @@ constexpr u64 f64_max_s32 = 0x41dfffffffc00000u; // 2147483647 as a double
|
|||
constexpr u64 f64_max_u32 = 0x41efffffffe00000u; // 4294967295 as a double
|
||||
constexpr u64 f64_max_s64_lim = 0x43e0000000000000u; // 2^63 as a double (actual maximum unrepresentable)
|
||||
|
||||
#define FCODE(NAME) \
|
||||
[&code](auto... args) { \
|
||||
if constexpr (fsize == 32) { \
|
||||
code.NAME##s(args...); \
|
||||
} else { \
|
||||
code.NAME##d(args...); \
|
||||
} \
|
||||
}
|
||||
#define ICODE(NAME) \
|
||||
[&code](auto... args) { \
|
||||
if constexpr (fsize == 32) { \
|
||||
code.NAME##d(args...); \
|
||||
} else { \
|
||||
code.NAME##q(args...); \
|
||||
} \
|
||||
}
|
||||
|
||||
template<size_t fsize>
|
||||
void ForceDenormalsToZero(BlockOfCode& code, std::initializer_list<Xbyak::Xmm> to_daz) {
|
||||
if (code.HasHostFeature(HostFeature::AVX512_OrthoFloat)) {
|
||||
|
@ -476,7 +473,7 @@ static void EmitFPMinMax(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
|||
}
|
||||
|
||||
template<size_t fsize, bool is_max>
|
||||
static inline void EmitFPMinMaxNumeric(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) noexcept {
|
||||
static void EmitFPMinMaxNumeric(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
||||
using FPT = mcl::unsigned_integer_of_size<fsize>;
|
||||
constexpr FPT default_nan = FP::FPInfo<FPT>::DefaultNaN();
|
||||
|
||||
|
@ -704,14 +701,15 @@ static void EmitFPMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
|||
// x64 rounds before flushing to zero
|
||||
// AArch64 rounds after flushing to zero
|
||||
// This difference of behaviour is noticable if something would round to a smallest normalized number
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
|
||||
code.sub(rsp, 8);
|
||||
ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocXmmIdx(result.getIdx()));
|
||||
code.movq(code.ABI_PARAM1, operand1);
|
||||
code.movq(code.ABI_PARAM2, operand2);
|
||||
code.movq(code.ABI_PARAM3, operand3);
|
||||
code.mov(code.ABI_PARAM4.cvt32(), ctx.FPCR().Value());
|
||||
#ifdef _WIN32
|
||||
code.lea(rsp, ptr[rsp - (16 + ABI_SHADOW_SPACE)]);
|
||||
code.sub(rsp, 16 + ABI_SHADOW_SPACE);
|
||||
code.lea(rax, code.ptr[code.r15 + code.GetJitStateInfo().offsetof_fpsr_exc]);
|
||||
code.mov(qword[rsp + ABI_SHADOW_SPACE], rax);
|
||||
code.CallFunction(fallback_fn);
|
||||
|
@ -737,13 +735,13 @@ static void EmitFPMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
|||
code.vmovaps(xmm0, code.Const(xword, FP::FPInfo<FPT>::mantissa_msb));
|
||||
|
||||
FCODE(ucomis)(operand2, operand3);
|
||||
code.jp(has_nan, code.T_NEAR);
|
||||
code.jp(has_nan);
|
||||
FCODE(ucomis)(operand1, operand1);
|
||||
code.jnp(indeterminate, code.T_NEAR);
|
||||
code.jnp(indeterminate);
|
||||
|
||||
// AArch64 specifically emits a default NaN for the case when the addend is a QNaN and the two other arguments are {inf, zero}
|
||||
code.ptest(operand1, xmm0);
|
||||
code.jz(op1_snan, code.T_NEAR);
|
||||
code.jz(op1_snan);
|
||||
FCODE(vmuls)(xmm0, operand2, operand3); // check if {op2, op3} are {inf, zero}/{zero, inf}
|
||||
FCODE(ucomis)(xmm0, xmm0);
|
||||
code.jnp(*end);
|
||||
|
@ -755,10 +753,10 @@ static void EmitFPMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
|||
code.L(has_nan);
|
||||
|
||||
FCODE(ucomis)(operand1, operand1);
|
||||
code.jnp(op1_done, code.T_NEAR);
|
||||
code.jnp(op1_done);
|
||||
code.movaps(result, operand1); // this is done because of NaN behavior of vfmadd231s (priority of op2, op3, op1)
|
||||
code.ptest(operand1, xmm0);
|
||||
code.jnz(op1_done, code.T_NEAR);
|
||||
code.jnz(op1_done);
|
||||
code.L(op1_snan);
|
||||
code.vorps(result, operand1, xmm0);
|
||||
code.jmp(*end);
|
||||
|
@ -776,9 +774,9 @@ static void EmitFPMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
|
|||
code.L(op2_done);
|
||||
|
||||
FCODE(ucomis)(operand3, operand3);
|
||||
code.jnp(op3_done, code.T_NEAR);
|
||||
code.jnp(op3_done);
|
||||
code.ptest(operand3, xmm0);
|
||||
code.jnz(op3_done, code.T_NEAR);
|
||||
code.jnz(op3_done);
|
||||
code.vorps(result, operand3, xmm0);
|
||||
code.jmp(*end);
|
||||
code.L(op3_done);
|
||||
|
@ -1021,7 +1019,7 @@ static void EmitFPRecipStepFused(BlockOfCode& code, EmitContext& ctx, IR::Inst*
|
|||
ctx.deferred_emits.emplace_back([=, &code, &ctx] {
|
||||
code.L(*fallback);
|
||||
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocXmmIdx(result.getIdx()));
|
||||
code.movq(code.ABI_PARAM1, operand1);
|
||||
code.movq(code.ABI_PARAM2, operand2);
|
||||
|
@ -1206,9 +1204,9 @@ static void EmitFPRSqrtEstimate(BlockOfCode& code, EmitContext& ctx, IR::Inst* i
|
|||
}
|
||||
|
||||
// a > 0 && a < 0x00800000;
|
||||
code.dec(tmp);
|
||||
code.sub(tmp, 1);
|
||||
code.cmp(tmp, 0x007FFFFF);
|
||||
code.jb(fallback, code.T_NEAR); //within -127,128
|
||||
code.jb(fallback);
|
||||
needs_fallback = true;
|
||||
}
|
||||
|
||||
|
@ -1237,17 +1235,17 @@ static void EmitFPRSqrtEstimate(BlockOfCode& code, EmitContext& ctx, IR::Inst* i
|
|||
|
||||
code.ucomisd(value, result);
|
||||
if (ctx.FPCR().DN()) {
|
||||
code.jc(default_nan, code.T_NEAR);
|
||||
code.je(zero, code.T_NEAR);
|
||||
code.jc(default_nan);
|
||||
code.je(zero);
|
||||
} else {
|
||||
code.jp(nan, code.T_NEAR);
|
||||
code.je(zero, code.T_NEAR);
|
||||
code.jc(default_nan, code.T_NEAR);
|
||||
code.jp(nan);
|
||||
code.je(zero);
|
||||
code.jc(default_nan);
|
||||
}
|
||||
|
||||
if (!ctx.FPCR().FZ()) {
|
||||
needs_fallback = true;
|
||||
code.jmp(fallback, code.T_NEAR);
|
||||
code.jmp(fallback);
|
||||
} else {
|
||||
// result = 0
|
||||
code.jmp(*end, code.T_NEAR);
|
||||
|
@ -1280,7 +1278,7 @@ static void EmitFPRSqrtEstimate(BlockOfCode& code, EmitContext& ctx, IR::Inst* i
|
|||
|
||||
code.L(fallback);
|
||||
if (needs_fallback) {
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocXmmIdx(result.getIdx()));
|
||||
code.movq(code.ABI_PARAM1, operand);
|
||||
code.mov(code.ABI_PARAM2.cvt32(), ctx.FPCR().Value());
|
||||
|
@ -1363,7 +1361,7 @@ static void EmitFPRSqrtStepFused(BlockOfCode& code, EmitContext& ctx, IR::Inst*
|
|||
ctx.deferred_emits.emplace_back([=, &code, &ctx] {
|
||||
code.L(*fallback);
|
||||
|
||||
code.lea(rsp, ptr[rsp - 8]);
|
||||
code.sub(rsp, 8);
|
||||
ABI_PushCallerSaveRegistersAndAdjustStackExcept(code, HostLocXmmIdx(result.getIdx()));
|
||||
code.movq(code.ABI_PARAM1, operand1);
|
||||
code.movq(code.ABI_PARAM2, operand2);
|
||||
|
@ -2134,6 +2132,3 @@ void EmitX64::EmitFPFixedU64ToSingle(EmitContext& ctx, IR::Inst* inst) {
|
|||
ctx.reg_alloc.DefineValue(inst, result);
|
||||
}
|
||||
} // namespace Dynarmic::Backend::X64
|
||||
|
||||
#undef FCODE
|
||||
#undef ICODE
|
||||
|
|
|
@ -161,7 +161,8 @@ template<>
|
|||
|
||||
template<>
|
||||
[[maybe_unused]] Xbyak::RegExp EmitFastmemVAddr<A64EmitContext>(BlockOfCode& code, A64EmitContext& ctx, Xbyak::Label& abort, Xbyak::Reg64 vaddr, bool& require_abort_handling, std::optional<Xbyak::Reg64> tmp) {
|
||||
auto const unused_top_bits = 64 - ctx.conf.fastmem_address_space_bits;
|
||||
const size_t unused_top_bits = 64 - ctx.conf.fastmem_address_space_bits;
|
||||
|
||||
if (unused_top_bits == 0) {
|
||||
return r13 + vaddr;
|
||||
} else if (ctx.conf.silently_mirror_fastmem) {
|
||||
|
@ -305,7 +306,7 @@ const void* EmitWriteMemoryMov(BlockOfCode& code, const Xbyak::RegExp& addr, int
|
|||
code.L(loop);
|
||||
code.lock();
|
||||
code.cmpxchg16b(xword[addr]);
|
||||
code.jnz(loop, code.T_NEAR);
|
||||
code.jnz(loop);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -372,7 +373,7 @@ void EmitExclusiveTestAndClear(BlockOfCode& code, const UserConfig& conf, Xbyak:
|
|||
Xbyak::Label ok;
|
||||
code.mov(pointer, mcl::bit_cast<u64>(GetExclusiveMonitorAddressPointer(conf.global_monitor, processor_index)));
|
||||
code.cmp(qword[pointer], vaddr);
|
||||
code.jne(ok, code.T_NEAR);
|
||||
code.jne(ok);
|
||||
code.mov(qword[pointer], tmp);
|
||||
code.L(ok);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue