Compare commits

...

7 Commits

Author SHA1 Message Date
CamilleLaVey
f34a385166 revert e367bdf3cc
revert [maxwell] SURED 4 handling (#2769)

Co-authored-by: Ribbit <ribbit@placeholder.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2769
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Ribbit <ribbit@eden-emu.dev>
Co-committed-by: Ribbit <ribbit@eden-emu.dev>
2025-10-21 04:59:51 +02:00
Ribbit
e367bdf3cc [maxwell] SURED 4 handling (#2769)
Co-authored-by: Ribbit <ribbit@placeholder.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2769
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Ribbit <ribbit@eden-emu.dev>
Co-committed-by: Ribbit <ribbit@eden-emu.dev>
2025-10-20 17:08:25 +02:00
lizzie
226160f639 [docs, tools] Add 3rd party links, debug and testing guidelines; add extra tools for maintaining strings, rewrite lanczos generator in perl (#2749)
RenderDoc checklist inspired by writeup of Charles G. of LunarG
Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2749
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2025-10-20 14:25:03 +02:00
Inix
0eeeee515e [android, gameProperties] Use StaggeredGrid instead stead of Grid layout for cards (#2781)
Fixes weird behavior with new secondary action chips.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2781
Co-authored-by: Inix <Nixy01@proton.me>
Co-committed-by: Inix <Nixy01@proton.me>
2025-10-20 06:46:31 +02:00
crueter
54d6283ac3 [desktop] Fix misaligned output device (#2786)
Builder::BuildWidget previously relied on Qt to handle layout stretching
by implicitly setting each widget to have a stretch of 0. This is very
bad behavior, so to fix this we must set a stretch of 1 on each widget
that's added by the builder

furthermore, default and default_dark did not properly define a min-width or min-height for QComboBox. This caused the platform theme to take over sizing which is NOT GOOD and should basically be avoided always

Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2786
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2025-10-20 04:08:38 +02:00
crueter
2e9dbe3f1d [cmake, tools, docs] Update CPMUtil (#2790)
updates CPMUtil to
[`8f9b39fc98`](8f9b39fc98)

Makes the tooling/docs better and enforces usage of tar.gz everywhere as
opposed to zips

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2790
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2025-10-20 03:43:15 +02:00
crueter
d7cd7c6313 [license-header] refactor: excludes, updating, better logic (#2780)
Rewrite of license-header.sh. Lots of new goodies:
- Fully POSIX compliant
- supports dash arguments (-u/--update, -c/--commit, -uc for both)
- can update year or malformed headers in-place now
- accounts for shell scripts
- exclusion of external files (e.g. sse2neon, my CMake modules/scripts)
- better, more extensible logic all around

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2780
2025-10-20 02:59:43 +02:00
52 changed files with 1095 additions and 361 deletions

View File

@@ -1,47 +0,0 @@
#!/usr/bin/ruby
# frozen_string_literal: true
license_header = <<~EOF
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
EOF
print 'Getting branch changes...'
branch_name = `git rev-parse --abbrev-ref HEAD`.chomp
branch_commits = `git log #{branch_name} --not master --pretty=format:"%h"`.split("\n")
branch_commit_range = "#{branch_commits[-1]}^..#{branch_commits[0]}"
branch_changed_files = `git diff-tree --no-commit-id --name-only #{branch_commit_range} -r`.split("\n")
puts 'done'
print 'Checking files...'
issue_files = []
branch_changed_files.each do |file_name|
if file_name.end_with?('.cpp', '.h', '.kt', '.kts') and File.file?(file_name)
file_content = File.read(file_name)
if not file_content.start_with?(license_header)
issue_files.push(file_name)
end
end
end
puts 'done'
if issue_files.empty?
puts "\nAll changed files have correct headers"
exit 0
end
puts <<-EOF
The following #{issue_files.length} files have incorrect license headers:
#{issue_files.join("\n")}
The following license header should be added to the start of all offending files:
=== BEGIN ===
#{license_header}
=== END ===
If some of the code in this PR is not being contributed by the original author, the files which have been exclusively changed by that code can be ignored.
If this happens, this PR requirement can be bypassed once all other files are addressed.
EOF
exit 1

View File

@@ -1,74 +1,152 @@
#!/bin/sh -e
HEADER="$(cat "$PWD/.ci/license/header.txt")"
HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")"
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
echo "Getting branch changes"
# specify full path if dupes may exist
EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake sse2neon.h renderdoc_app.h tools/cpm tools/shellcheck.sh tools/update-cpm.sh externals/stb externals/glad externals/getopt externals/gamemode externals/FidelityFX-FSR externals/demangle externals/bc_decoder"
# 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`
# license header constants, please change when needed :))))
YEAR=2025
HOLDER="Eden Emulator Project"
LICENSE="GPL-3.0-or-later"
BASE=`git merge-base master HEAD`
FILES=`git diff --name-only $BASE`
usage() {
cat << EOF
Usage: $0 [uc]
Compares the current HEAD to the master branch to check for license
header discrepancies. Each file changed in a branch MUST have a
license header, and this script attempts to enforce that.
#FILES=$(git diff --name-only master)
Options:
-u, --update Fix license headers, if applicable;
if the license header exists but has the incorrect
year or is otherwise malformed, it will be fixed.
echo "Done"
-c, --commit Commit changes to Git (requires --update)
Copyright $YEAR $HOLDER
Licensed under $LICENSE
The following files/directories are marked as external
and thus will not have license headers asserted:
EOF
for file in $EXCLUDE_FILES; do
echo "- $file"
done
exit 0
}
while true; do
case "$1" in
(-uc) UPDATE=true; COMMIT=true ;;
(-u|--update) UPDATE=true ;;
(-c|--commit) COMMIT=true ;;
("$0") break ;;
("") break ;;
(*) usage ;;
esac
shift
done
# human-readable header string
header() {
header_line1 "$1"
header_line2 "$1"
}
header_line1() {
echo "$1 SPDX-FileCopyrightText: Copyright $YEAR $HOLDER"
}
header_line2() {
echo "$1 SPDX-License-Identifier: $LICENSE"
}
# PCRE header string
pcre_header() {
begin="$1"
echo "(?s)$(header_line1 "$begin").*$(header_line2 "$begin")"
}
check_header() {
CONTENT="`head -n3 < $1`"
case "$CONTENT" in
"$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $1" ;;
esac
begin="$1"
file="$2"
content="$(head -n5 < "$2")"
header="$(pcre_header "$begin")"
if ! echo "$content" | grep -Pzo "$header" > /dev/null; then
# SRC_FILES is Kotlin/C++
# OTHER_FILES is sh, CMake
case "$begin" in
"//")
SRC_FILES="$SRC_FILES $file"
;;
"#")
OTHER_FILES="$OTHER_FILES $file"
;;
esac
fi
}
check_cmake_header() {
CONTENT="`head -n3 < $1`"
BASE=$(git merge-base master HEAD)
FILES=$(git diff --name-only "$BASE")
case "$CONTENT" in
"$HEADER_HASH"*) ;;
*)
BAD_CMAKE="$BAD_CMAKE $1" ;;
esac
}
for file in $FILES; do
[ -f "$file" ] || continue
if [ `basename -- "$file"` = "CMakeLists.txt" ]; then
check_cmake_header "$file"
continue
fi
# skip files that are third party (crueter's CMake modules, sse2neon, etc)
for pattern in $EXCLUDE_FILES; do
case "$file" in
*"$pattern"*)
excluded=true
break
;;
*)
excluded=false
;;
esac
done
EXTENSION="${file##*.}"
case "$EXTENSION" in
kts|kt|cpp|h)
check_header "$file"
;;
cmake)
check_cmake_header "$file"
;;
[ "$excluded" = "true" ] && continue
case "$file" in
*.cmake|*.sh|CMakeLists.txt)
begin="#"
;;
*.kt*|*.cpp|*.h)
begin="//"
;;
*)
continue
;;
esac
check_header "$begin" "$file"
done
if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then
echo
echo "All good."
if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then
echo "-- All good."
exit
fi
if [ "$BAD_FILES" != "" ]; then
echo "The following source files have incorrect license headers:"
echo
echo
for file in $BAD_FILES; do echo $file; done
if [ "$SRC_FILES" != "" ]; then
echo "-- The following source files have incorrect license headers:"
HEADER=$(header "//")
for file in $SRC_FILES; do echo "-- * $file"; done
cat << EOF
The following license header should be added to the start of all offending SOURCE files:
-- The following license header should be added to the start of these offending files:
=== BEGIN ===
$HEADER
@@ -78,18 +156,19 @@ EOF
fi
if [ "$BAD_CMAKE" != "" ]; then
echo "The following CMake files have incorrect license headers:"
echo
if [ "$OTHER_FILES" != "" ]; then
echo "-- The following CMake and shell scripts have incorrect license headers:"
for file in $BAD_CMAKE; do echo $file; done
HEADER=$(header "#")
for file in $OTHER_FILES; do echo "-- * $file"; done
cat << EOF
The following license header should be added to the start of all offending CMake files:
-- The following license header should be added to the start of these offending files:
=== BEGIN ===
$HEADER_HASH
$HEADER
=== END ===
EOF
@@ -97,50 +176,76 @@ EOF
fi
cat << EOF
If some of the code in this PR is not being contributed by the original author,
the files which have been exclusively changed by that code can be ignored.
If this happens, this PR requirement can be bypassed once all other files are addressed.
If some of the code in this PR is not being contributed by the original author,
the files which have been exclusively changed by that code can be ignored.
If this happens, this PR requirement can be bypassed once all other files are addressed.
EOF
if [ "$FIX" = "true" ]; then
echo
echo "FIX set to true. Fixing headers."
echo
if [ "$UPDATE" = "true" ]; then
TMP_DIR=$(mktemp -d)
echo "-- Fixing headers..."
for file in $BAD_FILES; do
cat $file > $file.bak
for file in $SRC_FILES $OTHER_FILES; do
case $(basename -- "$file") in
*.cmake|CMakeLists.txt)
begin="#"
shell="false"
;;
*.sh)
begin="#"
shell=true
;;
*.kt*|*.cpp|*.h)
begin="//"
shell="false"
;;
esac
cat .ci/license/header.txt > $file
echo >> $file
cat $file.bak >> $file
# This is fun
match="$begin SPDX-FileCopyrightText.*$HOLDER"
rm $file.bak
# basically if the copyright holder is already defined we can just replace the year
if head -n5 < "$file" | grep -e "$match" >/dev/null; then
replace=$(header_line1 "$begin")
sed "s|$match|$replace|" "$file" > "$file".bak
mv "$file".bak "$file"
else
header "$begin" > "$TMP_DIR"/header
git add $file
done
if [ "$shell" = "true" ]; then
# grab shebang
head -n1 "$file" > "$TMP_DIR/shebang"
echo >> "$TMP_DIR/shebang"
for file in $BAD_CMAKE; do
cat $file > $file.bak
# remove shebang
sed '1d' "$file" > "$file".bak
mv "$file".bak "$file"
cat .ci/license/header-hash.txt > $file
echo >> $file
cat $file.bak >> $file
# add to header
cat "$TMP_DIR"/shebang "$TMP_DIR"/header > "$TMP_DIR"/new-header
mv "$TMP_DIR"/new-header "$TMP_DIR"/header
else
echo >> "$TMP_DIR/header"
fi
rm $file.bak
cat "$TMP_DIR"/header "$file" > "$file".bak
mv "$file".bak "$file"
fi
git add $file
done
echo "License headers fixed."
[ "$shell" = "true" ] && chmod a+x "$file"
[ "$COMMIT" = "true" ] && git add "$file"
done
if [ "$COMMIT" = "true" ]; then
echo
echo "COMMIT set to true. Committing changes."
echo
git commit -m "Fix license headers"
echo "Changes committed. You may now push."
fi
else
exit 1
echo "-- Done"
fi
if [ "$COMMIT" = "true" ]; then
echo "-- Committing changes"
git commit -m "Fix license headers"
echo "-- Changes committed. You may now push."
fi
[ -d "$TMP_DIR" ] && rm -rf "$TMP_DIR"

View File

@@ -1,2 +0,0 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

View File

@@ -1,2 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: Copyright 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# This is a slightly modified version of CPM.cmake
# CPM.cmake - CMake's missing package manager
# ===========================================
# See https://github.com/cpm-cmake/CPM.cmake for usage and update instructions.

View File

@@ -325,7 +325,7 @@ function(AddPackage)
${pkg_git_url}/archive/refs/tags/${PKG_ARGS_TAG}.tar.gz)
endif()
elseif (DEFINED PKG_ARGS_SHA)
set(pkg_url "${pkg_git_url}/archive/${PKG_ARGS_SHA}.zip")
set(pkg_url "${pkg_git_url}/archive/${PKG_ARGS_SHA}.tar.gz")
else()
if (DEFINED PKG_ARGS_BRANCH)
set(PKG_BRANCH ${PKG_ARGS_BRANCH})
@@ -335,7 +335,7 @@ function(AddPackage)
set(PKG_BRANCH master)
endif()
set(pkg_url ${pkg_git_url}/archive/refs/heads/${PKG_BRANCH}.zip)
set(pkg_url ${pkg_git_url}/archive/refs/heads/${PKG_BRANCH}.tar.gz)
endif()
else()
cpm_utils_message(FATAL_ERROR ${PKG_ARGS_NAME} "No URL or repository defined")

View File

@@ -36,7 +36,7 @@
"name": "lz4",
"repo": "lz4/lz4",
"sha": "ebb370ca83",
"hash": "43600e87b35256005c0f2498fa56a77de6783937ba4cfce38c099f27c03188d097863e8a50c5779ca0a7c63c29c4f7ed0ae526ec798c1fd2e3736861b62e0a37",
"hash": "35c21a5d9cfb5bbf314a5321d02b36819491d2ee3cf8007030ca09d13ca4dae672247b7aeab553e973093604fc48221cb03dc92197c6efe8fc3746891363fdab",
"source_subdir": "build/cmake"
},
"nlohmann": {
@@ -62,7 +62,7 @@
"zstd": {
"repo": "facebook/zstd",
"sha": "b8d6101fba",
"hash": "a6c8e5272214fd3e65e03ae4fc375f452bd2f646623886664ee23e239e35751cfc842db4d34a84a8039d89fc8f76556121f2a4ae350d017bdff5e22150f9c3de",
"hash": "cc5ad4b119a9c2ea57f0b71eeff01113bb506e0d17000159c5409cb8236d22e38c52d5e9e97e7947a4bf1b2dfc44b6c503ab2d9aedbd59458435c6a2849cb029",
"version": "1.5",
"source_subdir": "build/cmake",
"find_args": "MODULE",
@@ -74,7 +74,7 @@
"package": "Opus",
"repo": "crueter/opus",
"sha": "ab19c44fad",
"hash": "79d0d015b19e74ce6076197fc32b86fe91d724a0b5a79e86adfc4bdcb946ece384e252adbbf742b74d03040913b70bb0e9556eafa59ef20e42d2f3f4d6f2859a",
"hash": "d632e8f83c5d3245db404bcb637113f9860bf16331498ba2c8e77979d1febee6b52d8b1da448e7d54eeac373e912cd55e3e300fc6c242244923323280dc43fbe",
"version": "1.3",
"find_args": "MODULE",
"options": [
@@ -84,7 +84,7 @@
"boost_headers": {
"repo": "boostorg/headers",
"sha": "95930ca8f5",
"hash": "d1dece16f3b209109de02123c537bfe1adf07a62b16c166367e7e5d62e0f7c323bf804c89b3192dd6871bc58a9d879d25a1cc3f7b9da0e497cf266f165816e2a",
"hash": "8a07d7a6f0065587d3005a83481a794704ae22e773b9f336fbd89ed230aaa7b4c86c03edcbae30bba8b3e20839c3131eaa2dceac037ef811533ef4eadc53b15b",
"bundled": true
},
"llvm-mingw": {

View File

@@ -2,6 +2,12 @@ QAbstractSpinBox {
min-height: 19px;
}
QComboBox {
padding: 0px 4px 0px 4px;
min-width: 60px;
min-height: 19px;
}
QPushButton#TogglableStatusBarButton {
color: #959595;
border: 1px solid transparent;

View File

@@ -6,6 +6,12 @@ QAbstractSpinBox {
min-height: 19px;
}
QComboBox {
padding: 0px 4px 0px 4px;
min-width: 60px;
min-height: 19px;
}
QPushButton#TogglableStatusBarButton {
color: #959595;
border: 1px solid transparent;

View File

@@ -1,17 +0,0 @@
# CPMUtil
CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake.
See more in [its repository](https://git.crueter.xyz/CMake/CPMUtil)
Eden-specific options:
- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing
* If this is `OFF`, required system dependencies will be searched via `find_package`, although most externals use CPM regardless.
- Force system libraries via CMake arguments:
* SDL2: `YUZU_USE_BUNDLED_SDL2` and `YUZU_USE_EXTERNAL_SDL2`
* FFmpeg: `YUZU_USE_EXTERNAL_FFMPEG`
## Tooling
See the [tooling docs](../tools/cpm)

17
docs/CPMUtil/AddCIPackage Normal file
View File

@@ -0,0 +1,17 @@
# AddPackage
- `VERSION` (required): The version to get (the tag will be `v${VERSION}`)
- `NAME` (required): Name used within the artifacts
- `REPO` (required): CI repository, e.g. `crueter-ci/OpenSSL`
- `PACKAGE` (required): `find_package` package name
- `EXTENSION`: Artifact extension (default `tar.zst`)
- `MIN_VERSION`: Minimum version for `find_package`. Only used if platform does not support this package as a bundled artifact
- `DISABLED_PLATFORMS`: List of platforms that lack artifacts for this package. Options:
* `windows-amd64`
* `windows-arm64`
* `android`
* `solaris-amd64`
* `freebsd-amd64`
* `linux-amd64`
* `linux-aarch64`
* `macos-universal`

View File

@@ -0,0 +1,17 @@
# AddPackage
- `VERSION` (required): The version to get (the tag will be `v${VERSION}`)
- `NAME` (required): Name used within the artifacts
- `REPO` (required): CI repository, e.g. `crueter-ci/OpenSSL`
- `PACKAGE` (required): `find_package` package name
- `EXTENSION`: Artifact extension (default `tar.zst`)
- `MIN_VERSION`: Minimum version for `find_package`. Only used if platform does not support this package as a bundled artifact
- `DISABLED_PLATFORMS`: List of platforms that lack artifacts for this package. Options:
* `windows-amd64`
* `windows-arm64`
* `android`
* `solaris-amd64`
* `freebsd-amd64`
* `linux-amd64`
* `linux-aarch64`
* `macos-universal`

View File

@@ -0,0 +1,104 @@
# AddJsonPackage
In each directory that utilizes `CPMUtil`, there must be a `cpmfile.json` that defines dependencies in a similar manner to the individual calls.
The cpmfile is an object of objects, with each sub-object being named according to the package's identifier, e.g. `openssl`, which can then be fetched with `AddJsonPackage(<identifier>)`. Options are designed to map closely to the argument names, and are always strings unless otherwise specified.
<!-- TOC -->
- [Options](#options)
- [Examples](#examples)
<!-- /TOC -->
## Options
- `package` -> `NAME` (`PACKAGE` for CI), defaults to the object key
- `repo` -> `REPO`
- `version` -> `VERSION`
- `ci` (bool)
If `ci` is `false`:
- `hash` -> `HASH`
- `hash_suffix` -> `HASH_SUFFIX`
- `sha` -> `SHA`
- `key` -> `KEY`
- `tag` -> `TAG`
* If the tag contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified
- `url` -> `URL`
- `artifact` -> `ARTIFACT`
* If the artifact contains `%VERSION%`, that part will be replaced by the `git_version`, OR `version` if `git_version` is not specified
* If the artifact contains `%TAG%`, that part will be replaced by the `tag` (with its replacement already done)
- `git_version` -> `GIT_VERSION`
- `git_host` -> `GIT_HOST`
- `source_subdir` -> `SOURCE_SUBDIR`
- `bundled` -> `BUNDLED_PACKAGE`
- `find_args` -> `FIND_PACKAGE_ARGUMENTS`
- `download_only` -> `DOWNLOAD_ONLY`
- `patches` -> `PATCHES` (array)
- `options` -> `OPTIONS` (array)
- `skip_updates`: Tells `check-updates.sh` to not check for new updates on this package.
Other arguments aren't currently supported. If you wish to add them, see the `AddJsonPackage` function in `CMakeModules/CPMUtil.cmake`.
If `ci` is `true`:
- `name` -> `NAME`, defaults to the object key
- `extension` -> `EXTENSION`, defaults to `tar.zst`
- `min_version` -> `MIN_VERSION`
- `extension` -> `EXTENSION`
- `disabled_platforms` -> `DISABLED_PLATFORMS` (array)
## Examples
In order: OpenSSL CI, Boost (tag + artifact), Opus (options + find_args), discord-rpc (sha + options + patches).
```json
{
"openssl": {
"ci": true,
"package": "OpenSSL",
"name": "openssl",
"repo": "crueter-ci/OpenSSL",
"version": "3.6.0",
"min_version": "1.1.1",
"disabled_platforms": [
"macos-universal"
]
},
"boost": {
"package": "Boost",
"repo": "boostorg/boost",
"tag": "boost-%VERSION%",
"artifact": "%TAG%-cmake.7z",
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01",
"git_version": "1.88.0",
"version": "1.57"
},
"opus": {
"package": "Opus",
"repo": "xiph/opus",
"sha": "5ded705cf4",
"hash": "0dc89e58ddda1f3bc6a7037963994770c5806c10e66f5cc55c59286fc76d0544fe4eca7626772b888fd719f434bc8a92f792bdb350c807968b2ac14cfc04b203",
"version": "1.3",
"find_args": "MODULE",
"options": [
"OPUS_BUILD_TESTING OFF",
"OPUS_BUILD_PROGRAMS OFF",
"OPUS_INSTALL_PKG_CONFIG_MODULE OFF",
"OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF"
]
},
"discord-rpc": {
"repo": "discord/discord-rpc",
"sha": "963aa9f3e5",
"hash": "386e1344e9a666d730f2d335ee3aef1fd05b1039febefd51aa751b705009cc764411397f3ca08dffd46205c72f75b235c870c737b2091a4ed0c3b061f5919bde",
"options": [
"BUILD_EXAMPLES OFF"
],
"patches": [
"0001-cmake-version.patch",
"0002-no-clang-format.patch",
"0003-fix-cpp17.patch"
]
}
}
```

116
docs/CPMUtil/AddPackage.md Normal file
View File

@@ -0,0 +1,116 @@
# `AddPackage`
<!-- TOC -->
- [Identification/Fetching](#identificationfetching)
- [Hashing](#hashing)
- [Other Options](#other-options)
- [Extra Variables](#extra-variables)
- [System/Bundled Packages](#systembundled-packages)
- [Identification](#identification)
<!-- /TOC -->
## Identification/Fetching
- `NAME` (required): The package name (must be the same as the `find_package` name if applicable)
- `VERSION`: The minimum version of this package that can be used on the system
- `GIT_VERSION`: The "version" found within git
- `URL`: The URL to fetch.
- `REPO`: The repo to use (`owner/repo`).
- `GIT_HOST`: The Git host to use
* Defaults to `github.com`. Do not include the protocol, as HTTPS is enforced.
- `TAG`: The tag to fetch, if applicable.
- `ARTIFACT`: The name of the artifact, if applicable.
- `SHA`: Commit sha to fetch, if applicable.
- `BRANCH`: Branch to fetch, if applicable.
The following configurations are supported, in descending order of precedence:
- `URL`: Bare URL download, useful for custom artifacts
* If this is set, `GIT_URL` or `REPO` should be set to allow the dependency viewer to link to the project's Git repository.
* If this is NOT set, `REPO` must be defined.
- `REPO + TAG + ARTIFACT`: GitHub release artifact
* The final download URL will be `https://github.com/${REPO}/releases/download/${TAG}/${ARTIFACT}`
* Useful for prebuilt libraries and prefetched archives
- `REPO + TAG`: GitHub tag archive
* The final download URL will be `https://github.com/${REPO}/archive/refs/tags/${TAG}.tar.gz`
* Useful for pinning to a specific tag, better for build identification
- `REPO + SHA`: GitHub commit archive
* The final download URL will be `https://github.com/${REPO}/archive/${SHA}.zip`
* Useful for pinning to a specific commit
- `REPO + BRANCH`: GitHub branch archive
* The final download URL will be `https://github.com/${REPO}/archive/refs/heads/${BRANCH}.zip`
* Generally not recommended unless the branch is frozen
- `REPO`: GitHub master archive
* The final download URL will be `https://github.com/${REPO}/archive/refs/heads/master.zip`
* Generally not recommended unless the project is dead
## Hashing
Hashing is used for verifying downloads. It's highly recommended to use these.
- `HASH_ALGO` (default `SHA512`): Hash algorithm to use
Hashing strategies, descending order of precedence:
- `HASH`: Bare hash verification, useful for static downloads e.g. commit archives
- `HASH_SUFFIX`: Download the hash as `${DOWNLOAD_URL}.${HASH_SUFFIX}`
* The downloaded hash *must* match the hash algorithm and contain nothing but the hash; no filenames or extra content.
- `HASH_URL`: Download the hash from a separate URL
## Other Options
- `KEY`: Custom cache key to use (stored as `.cache/cpm/${packagename_lower}/${key}`)
* Default is based on, in descending order of precedence:
- First 4 characters of the sha
- `GIT_VERSION`
- Tag
- `VERSION`
- Otherwise, CPM defaults will be used. This is not recommended as it doesn't produce reproducible caches
- `DOWNLOAD_ONLY`: Whether or not to configure the downloaded package via CMake
* Useful to turn `OFF` if the project doesn't use CMake
- `SOURCE_SUBDIR`: Subdirectory of the project containing a CMakeLists.txt file
- `FIND_PACKAGE_ARGUMENTS`: Arguments to pass to the `find_package` call
- `BUNDLED_PACKAGE`: Set to `ON` to default to the bundled package
- `FORCE_BUNDLED_PACKAGE`: Set to `ON` to force the usage of the bundled package, regardless of CPMUTIL_FORCE_SYSTEM or `<package>_FORCE_SYSTEM`
- `OPTIONS`: Options to pass to the configuration of the package
- `PATCHES`: Patches to apply to the package, stored in `.patch/${packagename_lower}/0001-patch-name.patch` and so on
- Other arguments can be passed to CPM as well
## Extra Variables
For each added package, users may additionally force usage of the system/bundled package.
- `${package}_FORCE_SYSTEM`: Require the package to be installed on the system
- `${package}_FORCE_BUNDLED`: Force the package to be fetched and use the bundled version
## System/Bundled Packages
Descending order of precedence:
- If `${package}_FORCE_SYSTEM` is true, requires the package to be on the system
- If `${package}_FORCE_BUNDLED` is true, forcefully uses the bundled package
- If `CPMUTIL_FORCE_SYSTEM` is true, requires the package to be on the system
- If `CPMUTIL_FORCE_BUNDLED` is true, forcefully uses the bundled package
- If the `BUNDLED_PACKAGE` argument is true, forcefully uses the bundled package
- Otherwise, CPM will search for the package first, and if not found, will use the bundled package
## Identification
All dependencies must be identifiable in some way for usage in the dependency viewer. Lists are provided in descending order of precedence.
URLs:
- `GIT_URL`
- `REPO` as a Git repository
* You may optionally specify `GIT_HOST` to use a custom host, e.g. `GIT_HOST git.crueter.xyz`. Note that the git host MUST be GitHub-like in its artifact/archive downloads, e.g. Forgejo
* If `GIT_HOST` is unspecified, defaults to `github.com`
- `URL`
Versions (bundled):
- `SHA`
- `GIT_VERSION`
- `VERSION`
- `TAG`
- "unknown"
If the package is a system package, AddPackage will attempt to determine the package version and append ` (system)` to the identifier. Otherwise, it will be marked as `unknown (system)`

46
docs/CPMUtil/README.md Normal file
View File

@@ -0,0 +1,46 @@
# CPMUtil
CPMUtil is a wrapper around CPM that aims to reduce boilerplate and add useful utility functions to make dependency management a piece of cake.
Global Options:
- `CPMUTIL_FORCE_SYSTEM` (default `OFF`): Require all CPM dependencies to use system packages. NOT RECOMMENDED!
* You may optionally override this (section)
- `CPMUTIL_FORCE_BUNDLED` (default `ON` on MSVC and Android, `OFF` elsewhere): Require all CPM dependencies to use bundled packages.
You are highly encouraged to read AddPackage first, even if you plan to only interact with CPMUtil via `AddJsonPackage`.
<!-- TOC -->
- [AddPackage](#addpackage)
- [AddCIPackage](#addcipackage)
- [AddJsonPackage](#addjsonpackage)
- [Lists](#lists)
<!-- /TOC -->
## AddPackage
The core of CPMUtil is the [`AddPackage`](./AddPackage.md) function. [`AddPackage`](./AddPackage.md) itself is fully CMake-based, and largely serves as an interface between CPM and the rest of CPMUtil.
## AddCIPackage
[`AddCIPackage`](./AddCIPackage.md) adds a package that follows [crueter's CI repository spec](https://github.com/crueter-ci).
## AddJsonPackage
[`AddJsonPackage`](./AddJsonPackage.md) is the recommended method of usage for CPMUtil.
## Lists
CPMUtil will create three lists of dependencies where `AddPackage` or similar was used. Each is in order of addition.
- `CPM_PACKAGE_NAMES`: The names of packages included by CPMUtil
- `CPM_PACKAGE_URLS`: The URLs to project/repo pages of packages
- `CPM_PACKAGE_SHAS`: Short version identifiers for each package
* If the package was included as a system package, ` (system)` is appended thereafter
* Packages whose versions can't be deduced will be left as `unknown`.
For an example of how this might be implemented in an application, see Eden's implementation:
- [`dep_hashes.h.in`](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/src/dep_hashes.h.in)
- [`GenerateDepHashes.cmake`](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CMakeModules/GenerateDepHashes.cmake)
- [`deps_dialog.cpp`](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/src/yuzu/deps_dialog.cpp)

10
docs/CrossCompile.md Normal file
View File

@@ -0,0 +1,10 @@
# Cross Compile
## ARM64
A painless guide for cross compilation (or to test NCE) from a x86_64 system without polluting your main.
- Install QEMU: `sudo pkg install qemu`
- Download Debian 13: `wget https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-13.0.0-arm64-netinst.iso`
- Create a system disk: `qemu-img create -f qcow2 debian-13-arm64-ci.qcow2 30G`
- Run the VM: `qemu-system-aarch64 -M virt -m 2G -cpu max -bios /usr/local/share/qemu/edk2-aarch64-code.fd -drive if=none,file=debian-13.0.0-arm64-netinst.iso,format=raw,id=cdrom -device scsi-cd,drive=cdrom -drive if=none,file=debian-13-arm64-ci.qcow2,id=hd0,format=qcow2 -device virtio-blk-device,drive=hd0 -device virtio-gpu-pci -device usb-ehci -device usb-kbd -device intel-hda -device hda-output -nic user,model=virtio-net-pci`

68
docs/Debug.md Normal file
View File

@@ -0,0 +1,68 @@
# Debug Guidelines
## Debugging (host code)
Ignoring SIGSEGV when debugging in host:
- **gdb**: `handle all nostop pass`.
- **lldb**: `pro hand -p true -s false -n false SIGSEGV`.
## Debugging (guest code)
### 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. Type `mo help` for more info.
- `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`
- `br _mesa_error`: Break on mesa errors (set environment variable `MESA_DEBUG=1` beforehand), see [MESA_DEBUG](https://mesa-docs.readthedocs.io/en/latest/debugging.html).
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).
## Simple checklist for debugging black screens using Renderdoc
Renderdoc is a free, cross platform, multi-graphics API debugger. It is an invaluable tool for diagnosing issues with graphics applications, and includes support for Vulkan. Get it [here](https://renderdoc.org).
Before using renderdoc to diagnose issues, it is always good to make sure there are no validation errors. Any errors means the behavior of the application is undefined. That said, renderdoc can help debug validation errors if you do have them.
When debugging a black screen, there are many ways the application could have setup Vulkan wrong.
Here is a short checklist of items to look at to make sure are appropriate:
* Draw call counts are correct (aka not zero, or if rendering many triangles, not 3)
* Vertex buffers are bound
* vertex attributes are correct - Make sure the size & offset of each attribute matches what should it should be
* Any bound push constants and descriptors have the right data - including:
* Matrices have correct values - double check the model, view, & projection matrices are uploaded correctly
* Pipeline state is correct
* viewport range is correct - x,y are 0,0; width & height are screen dimensions, minDepth is 0, maxDepth is 1, NDCDepthRange is 0,1
* Fill mode matches expected - usually solid
* Culling mode makes sense - commonly back or none
* The winding direction is correct - typically CCW (counter clockwise)
* Scissor region is correct - usually same as viewport's x,y,width, &height
* Blend state is correct
* Depth state is correct - typically enabled with Function set to Less than or Equal
* Swapchain images are bound when rendering to the swapchain
* Image being rendered to is the same as the one being presented when rendering to the swapchain
Alternatively, a [RenderDoc Extension](https://github.com/baldurk/renderdoc-contrib/tree/main/baldurk/whereismydraw) ([Archive](https://web.archive.org/web/20250000000000*/https://github.com/baldurk/renderdoc-contrib/tree/main/baldurk/whereismydraw)) exists which automates doing a lot of these manual steps.

View File

@@ -1,4 +1,4 @@
# Guidelines
# Development guidelines
## License Headers
All commits must have proper license header accreditation.
@@ -6,19 +6,21 @@ All commits must have proper license header accreditation.
You can easily add all necessary license headers by running:
```sh
git fetch origin master:master
FIX=true COMMIT=true .ci/license-header.sh
.ci/license-header.sh -u -c
git push
```
Alternatively, you may omit `COMMIT=true` and do an amend commit:
Alternatively, you may omit `-c` and do an amend commit:
```sh
git fetch origin master:master
FIX=true .ci/license-header.sh
.ci/license-header.sh
git commit --amend -a --no-edit
```
If the work is licensed/vendored from other people or projects, you may omit the license headers. Additionally, if you wish to retain authorship over a piece of code, you may attribute it to yourself; however, the code may be changed at any given point and brought under the attribution of Eden.
For more information on the license header script, run `.ci/license-header.sh -h`.
## Pull Requests
Pull requests are only to be merged by core developers when properly tested and discussions conclude on Discord or other communication channels. Labels are recommended but not required. However, all PRs MUST be namespaced and optionally typed:
```
@@ -101,49 +103,6 @@ May not be used but worth mentioning nonethless:
- OGG files: Use [OptiVorbis](https://github.com/OptiVorbis/OptiVorbis).
- Video files: Use ffmpeg, preferably re-encode as AV1.
# Debugging
## Debugging (host code)
Ignoring SIGSEGV when debugging in host:
- **gdb**: `handle all nostop pass`.
- **lldb**: `pro hand -p true -s false -n false SIGSEGV`.
## Debugging (guest code)
### 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. Type `mo help` for more info.
- `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`
- `br _mesa_error`: Break on mesa errors (set environment variable `MESA_DEBUG=1` beforehand), see [MESA_DEBUG](https://mesa-docs.readthedocs.io/en/latest/debugging.html).
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.

View File

@@ -1,10 +1,12 @@
# Eden Build Documentation
This contains documentation created by developers. This contains build instructions, guidelines, instructions/layouts for [cool stuff we made](CPM.md), and more.
This contains documentation created by developers. This contains build instructions, guidelines, instructions/layouts for [cool stuff we made](./CPMUtil), and more.
- **[General Build Instructions](Build.md)**
- **[Cross Compiling](CrossCompile.md)**
- **[Development Guidelines](Development.md)**
- **[Dependencies](Deps.md)**
- **[Debug Guidelines](./Debug.md)**
- **[CPM - CMake Package Manager](CPMUtil.md)**
- **[Platform-Specific Caveats](Caveats.md)**
- **[User Handbook](User.md)**
- **[User Handbook](User.md)**

View File

@@ -8,3 +8,4 @@ This handbook is primarily aimed at the end-user - baking useful knowledge for e
- **[Audio](user/Audio.md)**
- **[Graphics](user/Graphics.md)**
- **[Platforms and Architectures](user/Architectures.md)**
- **[Testing](user/Testing.md)**

View File

@@ -35,6 +35,8 @@ Eden by default will be cloned into -
6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo`.
7. You can pass extra variables to cmake via `-PYUZU_ANDROID_ARGS="-D..."`
Remember to have a Java SDK installed if not already, on Debian and similar this is done with `sudo apt install openjdk-17-jdk`.
### 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.

32
docs/user/Testing.md Normal file
View File

@@ -0,0 +1,32 @@
# User Handbook - Testing
While this is mainly aimed for testers - normal users can benefit from these guidelines to make their life easier when trying to outline and/or report an issue.
## How to Test a PR Against the Based Master When Issues Arise
When you're testing a pull request (PR) and encounter unexpected behavior, it's important to determine whether the issue was introduced by the PR or if it already exists in the base code. To do this, compare the behavior against the based master branch.
Even before an issue occurs, it is best practice to keep the same settings and delete the shader cache. Using an already made shader cache can make the PR look like it is having a regression in some rare cases.
### What to Do When Something Seems Off
If you notice something odd during testing:
- Reproduce the issue using the based master branch.
- Observe whether the same behavior occurs.
### Two Possible Outcomes
- If the issue exists in the based master: This means the problem was already present before the PR. The PR most likely did not introduce the regression.
- If the issue does not exist in the based master: This suggests the PR most likely introduced the regression and needs further investigation.
### Report your findings
When you report your results:
- Clearly state whether the behavior was observed in the based master.
- Indicate whether the result is good (expected behavior) or bad (unexpected or broken behavior). Without mentioning if your post/report/log is good or bad it may confuse the Developer of the PR.
- Example:
```
1. "Tested on based master — issue not present. Bad result for PR, likely regression introduced."
2. "Tested on based master — issue already present. Good result for PR, not a regression."
```
This approach helps maintain clarity and accountability in the testing process and ensures regressions are caught and addressed efficiently. If the behavior seems normal for a certain game/feature then it may not be always required to check against the based master.
If a master build for the PR' based master does not exist. It will be helpful to just test past and future builds nearby. That would help with gathering more information about the problem.

8
docs/user/ThirdParty.md Normal file
View File

@@ -0,0 +1,8 @@
# User Handbook - Third party tools and extras
The Eden emulator by itself lacks some functionality - or otherwise requires external files (such as packaging) to operate correctly in a given OS. Addendum to that some repositories provide nightly or specialised builds of the emulator.
While most of the links mentioned in this guide are relatively "safe"; we urge users to use their due diligence and appropriatedly verify the integrity of all files downloaded and ensure they're not compromised.
- [Nightly Eden builds](https://github.com/pflyly/eden-nightly)
- [NixOS Eden Flake](https://github.com/Grantimatter/eden-flake)

View File

@@ -36,7 +36,7 @@
"version": "1.4",
"repo": "crueter/cpp-jwt",
"sha": "9eaea6328f",
"hash": "e237d92c59ebbf0dc8ac0bae3bc80340e1e9cf430e1c1c9638443001118e16de2b3e9036ac4b98105427667b0386d97831415170b68c432438dcad9ef8052de7",
"hash": "35b0b2bfb143585c7b2bd6dc6ca7df5ae5c6e2681000b2ebca077b0ac4bc1e6b6afbe1ce8e47f6d2edad12fcc6404f677acc2ad205661d819b8821ce6f4823fd",
"find_args": "CONFIG",
"options": [
"CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF"
@@ -70,7 +70,7 @@
"libadrenotools": {
"repo": "bylaws/libadrenotools",
"sha": "8fae8ce254",
"hash": "c74fa855f0edebbf25c9bce40b00966daa2447bfc5e15f0cf1a95f86cbf70fc6b02590707edbde16328a0a2a4fb9a1fc419d2dfc22a4a4150971be91892d4edb",
"hash": "db4a74ce15559c75e01d1868a90701519b655d77f2a343bbee283a42f8332dc9046960fb022dc969f205e457348a3f99cb8be6e1cd91264d2ae1235294b9f9b2",
"patches": [
"0001-linkerns-cpm.patch"
]
@@ -125,7 +125,7 @@
"package": "SPIRV-Tools",
"repo": "crueter/SPIRV-Tools",
"sha": "2fa2d44485",
"hash": "45b198be1d09974ccb2438e8bfa5683f23a0421b058297c28eacfd77e454ec2cf87e77850eddd202efff34b004d8d6b4d12e9615e59bd72be904c196f5eb2169",
"hash": "3124bbddf7bd44f11445edeca6786b5bba9fb314f27dc087d0bbd9951b0936884ece2b9b40b75cfc8e31ab10ba55854e73aa63df835c40423b1c81dd47b1437d",
"git_version": "2025.4",
"options": [
"SPIRV_SKIP_EXECUTABLES ON"
@@ -138,7 +138,7 @@
"package": "SPIRV-Headers",
"repo": "KhronosGroup/SPIRV-Headers",
"sha": "01e0577914",
"hash": "d0f905311faf7d743de686fdf241dc4cb0a4f08e2184f5a3b3b2946e680db3cd89eeb72954eafe6fa457f93550e27d516575c8709cb134d8aecc0b43064636ce",
"hash": "e2b90e95b6f492e640cd27c090d7072f0d03c8fc7382be67cbe176fc8f3fdd78b59f5f0b906198e09808fde645427f409cb9ab8fe4843de7f7dc5b510d454a0a",
"options": [
"SPIRV_WERROR OFF"
]
@@ -146,7 +146,7 @@
"cubeb": {
"repo": "mozilla/cubeb",
"sha": "fa02160712",
"hash": "82d808356752e4064de48c8fecbe7856715ade1e76b53937116bf07129fc1cc5b3de5e4b408de3cd000187ba8dc32ca4109661cb7e0355a52e54bd81b9be1c61",
"hash": "8a4bcb2f83ba590f52c66626e895304a73eb61928dbc57777e1822e55378e3568366f17f9da4b80036cc2ef4ea9723c32abf6e7d9bbe00fb03654f0991596ab0",
"find_args": "CONFIG",
"options": [
"USE_SANITIZERS OFF",
@@ -181,7 +181,7 @@
"package": "DiscordRPC",
"repo": "eden-emulator/discord-rpc",
"sha": "1cf7772bb6",
"hash": "e9b35e6f2c075823257bcd59f06fe7bb2ccce1976f44818d2e28810435ef79c712a3c4f20f40da41f691342a4058cf86b078eb7f9d9e4dae83c0547c21ec4f97",
"hash": "9a6c35887dcacceb4ba1bf3141edb73b05b2abc719a8d81dad9cb9dd5b039ce203946787335d9d738af669c10cf2534638b645635a22096fc28dcae2475e0cbe",
"find_args": "MODULE"
},
"simpleini": {
@@ -206,7 +206,7 @@
"package": "SDL2",
"repo": "libsdl-org/SDL",
"sha": "cc016b0046",
"hash": "34d5ef58da6a4f9efa6689c82f67badcbd741f5a4f562a9c2c30828fa839830fb07681c5dc6a7851520e261c8405a416ac0a2c2513b51984fb3b4fa4dcb3e20b",
"hash": "b8d9873446cdb922387471df9968e078714683046674ef0d0edddf8e25da65a539a3bae83d635496b970237f90b07b36a69f8d7855d450de59311d6d6e8c3dbc",
"key": "steamdeck",
"bundled": true,
"skip_updates": "true"

View File

@@ -2,7 +2,7 @@
"ffmpeg": {
"repo": "FFmpeg/FFmpeg",
"sha": "c2184b65d2",
"hash": "2a89d664119debbb3c006ab1c48d5d7f26e889f4a65ad2e25c8b0503308295123d5a9c5c78bf683aef5ff09acef8c3fc2837f22d3e8c611528b933bf03bcdd97",
"hash": "007b1ccdd4d3ea3324835258d9a255103253bd66edb442b12d9c60dca85149cad52136a3b3120e5094115b6a3d9e80eeacbf9c07e5ffafc9ac459614d5fa3b22",
"bundled": true
},
"ffmpeg-ci": {

View File

@@ -22,7 +22,7 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.findNavController
import androidx.navigation.fragment.navArgs
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.google.android.material.transition.MaterialSharedAxis
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -457,8 +457,14 @@ class GamePropertiesFragment : Fragment() {
}
}
binding.listProperties.apply {
layoutManager =
GridLayoutManager(requireContext(), resources.getInteger(R.integer.grid_columns))
val spanCount = resources.getInteger(R.integer.grid_columns)
val staggered = StaggeredGridLayoutManager(
spanCount,
StaggeredGridLayoutManager.VERTICAL
).apply {
gapStrategy = StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
}
layoutManager = staggered
adapter = GamePropertiesAdapter(viewLifecycleOwner, properties)
}
}

View File

@@ -10,7 +10,7 @@
"version": "0.1.12",
"repo": "azahar-emu/mcl",
"sha": "7b08d83418",
"hash": "f943bac39c1879986decad7a442ff4288eaeca4a2907684c7914e115a55ecc43c2782ded85c0835763fe04e40d5c82220ce864423e489e648e408a84f54dc4f3",
"hash": "9c6ba624cb22ef622f78046a82abb99bf5026284ba17dfacaf46ac842cbd3b0f515f5ba45a1598c7671318a78a2e648db72ce8d10e7537f34e39800bdcb57694",
"options": [
"MCL_INSTALL OFF"
],
@@ -22,14 +22,14 @@
"package": "zycore",
"repo": "zyantific/zycore-c",
"sha": "75a36c45ae",
"hash": "15aa399f39713e042c4345bc3175c82f14dca849fde2a21d4f591f62c43e227b70d868d8bb86beb5f4eb68b1d6bd3792cdd638acf89009e787e3d10ee7401924"
"hash": "e1cf9bdd3163b6429eba94d0f9f82e343de33b77a838748f598c719913c9f91c502b818e37b716e174b55a3a26cdf39d665c4b50a548255973ac287c0e554fb6"
},
"zydis": {
"package": "zydis",
"version": "4",
"repo": "zyantific/zydis",
"sha": "c2d2bab025",
"hash": "7b48f213ff7aab2926f8c9c65195959143bebbfb2b9a25051ffd8b8b0f1baf1670d9739781de674577d955925f91ac89376e16b476a03828c84e2fd765d45020",
"hash": "3808773593536f78d3ddaf4cf712101d3fb6d981c6cc55555ad686a9adbe3397a727f62f561e8d8755bdcd88a763777da30281cc2924fc160b0386c3f99f5bd9",
"options": [
"ZYDIS_BUILD_TOOLS OFF",
"ZYDIS_BUILD_EXAMPLES OFF",

View File

@@ -3,7 +3,7 @@
"package": "QuaZip-Qt6",
"repo": "crueter/quazip-qt6",
"sha": "f838774d63",
"hash": "9f629a438699801244a106c8df6d5f8f8d19e80df54f530a89403a10c8c4e37a6e95606bbdd307f23636961e8ce34eb37a2186d589a1f227ac9c8e2c678e326e",
"hash": "e8f950f47c1f358e2666f08517a9b5b06980677540d3836384e2c27ff5bb129b218f1502b03fdb207d7fd4cd56893f0a0d9094ba8309f19a49cb11e3bb911594",
"version": "1.3",
"options": [
"QUAZIP_INSTALL OFF"
@@ -13,6 +13,6 @@
"package": "frozen",
"repo": "serge-sans-paille/frozen",
"sha": "61dce5ae18",
"hash": "1ae3d073e659c1f24b2cdd76379c90d6af9e06bc707d285a4fafce05f7a4c9e592ff208c94a9ae0f0d07620b3c6cec191f126b03d70ad4dfa496a86ed5658a6d"
"hash": "b8dfe741c82bc178dfc9749d4ab5a130cee718d9ee7b71d9b547cf5f7f23027ed0152ad250012a8546399fcc1e12187efc68d89d6731256c4d2df7d04eef8d5c"
}
}

View File

@@ -126,6 +126,7 @@ void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) {
restore_output_device_button->setVisible(
!Settings::values.audio_output_device_id.UsingGlobal());
widget->layout()->addWidget(restore_output_device_button);
connect(restore_output_device_button, &QAbstractButton::clicked, [this](bool) {
Settings::values.audio_output_device_id.SetGlobal(true);
SetOutputDevicesFromDeviceID();

View File

@@ -507,7 +507,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
created = true;
const auto type = setting.TypeId();
QLayout* layout = new QHBoxLayout(this);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
if (other_setting == nullptr) {
@@ -574,10 +574,10 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
if (require_checkbox) {
QWidget* lhs =
CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
layout->addWidget(lhs);
layout->addWidget(lhs, 1);
} else if (setting.TypeId() != typeid(bool)) {
QLabel* qt_label = CreateLabel(label);
layout->addWidget(qt_label);
layout->addWidget(qt_label, 1);
}
if (setting.TypeId() == typeid(bool)) {
@@ -649,7 +649,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
return;
}
layout->addWidget(data_component);
layout->addWidget(data_component, 1);
if (!managed) {
return;

View File

@@ -11,15 +11,16 @@ Tools for Eden and other subprojects.
- `find-unused-strings.pl`: Find unused strings (for Android XML files).
- `shellcheck.sh`: Ensure POSIX compliance (and syntax sanity) for all tools in this directory and subdirectories.
- `llvmpipe-run.sh`: Sets environment variables needed to run any command (or Eden) with llvmpipe.
- `optimize-assets.sh`: Optimize PNG assets with OptiPng.
- `optimize-assets.sh`: Optimizes PNG assets with OptiPng.
- `update-cpm.sh`: Updates CPM.cmake to the latest version.
- `update-icons.sh`: Rebuild all icons (macOS, Windows, bitmaps) based on the master SVG file (`dist/dev.eden_emu.eden.svg`)
* Also optimizes the master SVG
* Requires: `png2icns` (libicns), ImageMagick, [`svgo`](https://github.com/svg/svgo)
- `dtrace-tool.sh`
- `lanczos_gen.c`
- `lanczos-gen.pl`: Generates constants for the Lanczos filter.
- `clang-format.sh`: Runs `clang-format` on the entire codebase.
* Requires: clang
- `find-unused-strings.sh`: Find any unused strings in the Android app (XML -> Kotlin).
## Android
It's recommended to run these scritps after almost any Android change, as they are relatively fast and important both for APK bloat and CI.
@@ -29,4 +30,4 @@ It's recommended to run these scritps after almost any Android change, as they a
## Translations
- [Translation Scripts](./translations)
- [Translation Scripts](./translations)

0
tools/cpm-fetch-all.sh Normal file → Executable file
View File

View File

@@ -2,7 +2,13 @@
These are supplemental shell scripts for CPMUtil aiming to ease maintenance burden for sanity checking, updates, prefetching, formatting, and standard operations done by these shell scripts, all in one common place.
All scripts are POSIX-compliant.
All scripts are POSIX-compliant. If something doesn't work on your shell, ensure it's POSIX-compliant.
* If your shell doesn't support `$(...)` syntax, you've got bigger problems to worry about.
<!-- TOC -->
- [Meta](#meta)
- [Simple Utilities](#simple-utilities)
- [Functional Utilities](#functional-utilities)
<!-- /TOC -->
## Meta
@@ -39,9 +45,8 @@ These scripts don't really have any functionality, they just help you out a bit
* Inputs:
- The repository (e.g. fmtlib/fmt)
- The sha or tag (e.g. v1.0.1)
- `GIT_HOST`: What git host to use (default github.com)
- `USE_TAG`: Set to "true" if the second argument is a tag instead of a sha
- `ARTIFACT`: The artifact to download, if using a tag. Set to null or empty to use the tag source archive instead
- `-g <GIT_HOST>` or `--host <GIT_HOST>`: What git host to use (default github.com)
- `-a <ARTIFACT>` or `--artifact <ARTIFACT>`: The artifact to download. Set to null or empty to use a source archive instead
* Output: the SHA512 sum of the package
- `url-hash.sh`: Determine the hash of a URL
* Input: the URL
@@ -51,7 +56,7 @@ These scripts don't really have any functionality, they just help you out a bit
These modify the CPM cache or cpmfiles. Each allows you to input all the packages to act on, as well as a `<scriptname>-all.sh` that acts upon all available packages.
For the update and hash scripts, set `UPDATE=true` to update the cpmfile with the new version or hash. Beware: if the hash is `cf83e1357...` that means you got a 404 error!
Beware: if a hash is `cf83e1357...` that means you got a 404 error!
- `fetch.sh`: Prefetch a package according to its cpmfile definition
* Packages are fetched to the `.cache/cpm` directory by default, following the CPMUtil default.
@@ -61,11 +66,14 @@ For the update and hash scripts, set `UPDATE=true` to update the cpmfile with th
- `check-updates.sh`: Check a package for available updates
* This only applies to packages that utilize tags.
* If the tag is a format string, the `git_version` is acted upon instead.
* Setting `FORCE=true` will forcefully update every package and its hash, even if they are on the latest version (`UPDATE` must also be true)
* Specifying `-f` or `--force` will forcefully update the package and its hash, even if it's on on the latest version.
* Alternatively, only specify `-u` or `--update` to update packages that have new versions available.
* This script generally runs fast.
* Packages that should skip updates (e.g. older versions or packages with poorly-made tag structures... looking at you mbedtls) may specify `"skip_updates": true` in their cpmfile definition. This is unnecessary for untagged (e.g. sha or bare URL) packages.
* Packages that should skip updates (e.g. older versions, OR packages with poorly-made tag structures... looking at you mbedtls) may specify `"skip_updates": true` in their cpmfile definition. This is unnecessary for untagged (e.g. sha or bare URL) packages.
- `check-hashes.sh`: Check a package's hash
* Specifying `-f` or `--force` will update the package's hash even if it's not mismatched.
* Alternatively, specify `-u` or `--update` to only fix mismatched hashes.
* This only applies to packages with hardcoded hashes, NOT ones that use hash URLs.
* This script will take a looooooooooooooong time. This is operationally equivalent to a prefetch, and thus checking all hashes will take a while--but it's worth it! Just make sure you're not using dial-up.
* This script will take a long time. This is operationally equivalent to a prefetch, and thus checking all hashes will take a while--but it's worth it! Just make sure you're not using dial-up.
You are recommended to run sanity hash checking for every pull request and commit, and weekly update checks.

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/sh -e
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -7,4 +7,4 @@
. tools/cpm/common.sh
# shellcheck disable=SC2086
tools/cpm/check-hash.sh $LIBS
tools/cpm/check-hash.sh "$@" $LIBS

View File

@@ -3,18 +3,49 @@
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# env vars:
# - UPDATE: fix hashes if needed
# shellcheck disable=SC1091
. tools/cpm/common.sh
RETURN=0
for PACKAGE in "$@"
do
usage() {
cat << EOF
Usage: $0 [uf] [PACKAGE]...
Check the hash of a specific package or packages.
If a hash mismatch occurs, this script will print the corrected hash of the package.
Options:
-u, --update Correct the package's hash if it's a mismatch
-f, --force Update the package's hash anyways (implies -u)
Note that this procedure will usually take a long time
depending on the number and size of dependencies.
This project has defined the following as valid cpmfiles:
EOF
for file in $CPMFILES; do
echo "- $file"
done
exit $RETURN
}
while true; do
case "$1" in
(-uf|-f|--force) UPDATE=true; FORCE=true; shift; continue ;;
(-u|--update) UPDATE=true; shift; continue ;;
(-h) usage ;;
("$0") break ;;
("") break ;;
esac
PACKAGE="$1"
shift
export PACKAGE
# shellcheck disable=SC1091
. tools/cpm/package.sh
if [ "$CI" != null ]; then
@@ -31,11 +62,13 @@ do
export USE_TAG=true
ACTUAL=$(tools/cpm/url-hash.sh "$DOWNLOAD")
# shellcheck disable=SC2028
[ "$ACTUAL" != "$HASH" ] && echo "-- * Expected $HASH" && echo "-- * Got $ACTUAL" && [ "$UPDATE" != "true" ] && RETURN=1
if [ "$ACTUAL" != "$HASH" ]; then
echo "-- * Expected $HASH"
echo "-- * Got $ACTUAL"
[ "$UPDATE" != "true" ] && RETURN=1
fi
if [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; then
# shellcheck disable=SC2034
if { [ "$UPDATE" = "true" ] && [ "$ACTUAL" != "$HASH" ]; } || [ "$FORCE" = "true" ]; then
NEW_JSON=$(echo "$JSON" | jq ".hash = \"$ACTUAL\"")
export NEW_JSON

View File

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/sh -e
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -7,4 +7,4 @@
. tools/cpm/common.sh
# shellcheck disable=SC2086
tools/cpm/check-updates.sh $LIBS
tools/cpm/check-updates.sh "$@" $LIBS

View File

@@ -3,21 +3,51 @@
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# env vars:
# - UPDATE: update if available
# - FORCE: forcefully update
# shellcheck disable=SC1091
. tools/cpm/common.sh
RETURN=0
filter() {
TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]") # vulkan
TAGS=$(echo "$TAGS" | jq "[.[] | select(.name | test(\"$1\"; \"i\") | not)]")
}
for PACKAGE in "$@"
do
usage() {
cat << EOF
Usage: $0 [uf] [PACKAGE]...
Check a specific package or packages for updates.
Options:
-u, --update Update the package if a new version is available.
This will also update the hash if provided.
-f, --force Forcefully update the package version (implies -u)
This is seldom useful, and should only be used in cases of
severe corruption.
This project has defined the following as valid cpmfiles:
EOF
for file in $CPMFILES; do
echo "- $file"
done
exit $RETURN
}
while true; do
case "$1" in
(-uf|--force) UPDATE=true; FORCE=true; continue ;;
(-u|--update) UPDATE=true; continue ;;
(-h) usage ;;
("$0") break ;;
("") break ;;
esac
PACKAGE="$1"
shift
export PACKAGE
# shellcheck disable=SC1091
. tools/cpm/package.sh
@@ -67,7 +97,6 @@ do
echo "-- * Version $LATEST available, current is $TAG"
export USE_TAG=true
HASH=$(tools/cpm/hash.sh "$REPO" "$LATEST")
echo "-- * New hash: $HASH"

View File

@@ -7,22 +7,21 @@
# CHANGE THESE FOR YOUR PROJECT! #
##################################
# Which directories to search
DIRS=". src"
# How many levels to go (3 is 2 subdirs max)
MAXDEPTH=3
# shellcheck disable=SC2038
# shellcheck disable=SC2016
# shellcheck disable=SC2086
[ -z "$PACKAGES" ] && PACKAGES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json | xargs jq -s 'reduce .[] as $item ({}; . * $item)')
# For your project you'll want to change this to define what dirs you have cpmfiles in
# Remember to account for the MAXDEPTH variable!
# Adding ./ before each will help to remove duplicates
[ -z "$CPMFILES" ] && CPMFILES=$(find . ./src -maxdepth "$MAXDEPTH" -name cpmfile.json | sort | uniq)
# shellcheck disable=SC2016
[ -z "$PACKAGES" ] && PACKAGES=$(echo "$CPMFILES" | xargs jq -s 'reduce .[] as $item ({}; . * $item)')
# For your project you'll want to change the PACKAGES call to include whatever locations you may use (externals, src, etc.)
# Always include .
LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")')
export PACKAGES
export CPMFILES
export LIBS
export DIRS
export MAXDEPTH

View File

@@ -3,9 +3,6 @@
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# env vars:
# - UPDATE: fix hashes if needed
# shellcheck disable=SC1091
. tools/cpm/common.sh

View File

@@ -7,4 +7,4 @@
. tools/cpm/common.sh
# shellcheck disable=SC2086
tools/cpm/fetch.sh $LIBS
tools/cpm/fetch.sh "$@" $LIBS

View File

@@ -18,9 +18,33 @@ ROOTDIR="$PWD"
TMP=$(mktemp -d)
# shellcheck disable=SC2034
for PACKAGE in "$@"
do
usage() {
cat << EOF
Usage: $0 [PACKAGE]...
Fetch the specified package or packages from their defined download locations.
If the package is already cached, it will not be re-fetched.
This project has defined the following as valid cpmfiles:
EOF
for file in $CPMFILES; do
echo "- $file"
done
exit 0
}
while true; do
case "$1" in
(-h) usage ;;
("$0") break ;;
("") break ;;
esac
PACKAGE="$1"
shift
export PACKAGE
# shellcheck disable=SC1091
. tools/cpm/package.sh

View File

@@ -6,10 +6,7 @@
# shellcheck disable=SC1091
. tools/cpm/common.sh
# shellcheck disable=SC2086
FILES=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json)
for file in $FILES; do
for file in $CPMFILES; do
jq --indent 4 < "$file" > "$file".new
mv "$file".new "$file"
done

View File

@@ -6,20 +6,94 @@
# usage: hash.sh repo tag-or-sha
# env vars: GIT_HOST, USE_TAG (use tag instead of sha), ARTIFACT (download artifact with that name instead of src archive)
REPO="$1"
[ -z "$GIT_HOST" ] && GIT_HOST=github.com
RETURN=0
usage() {
cat <<EOF
Usage: $0 [-a|--artifact ARTIFACT] [-g|--host GIT_HOST] [REPO] [REF]
Get the hash of a package.
REPO must be in the form of OWNER/REPO, and REF must be a commit sha, branch, or tag.
Options:
-g, --host <GIT_HOST> What Git host to use (defaults to github.com)
-a, --artifact <ARTIFACT> The artifact to download (implies -t)
If -t is specified but not -a, fetches a tag archive.
If ARTIFACT is specified but is null,
EOF
exit "$RETURN"
}
die() {
echo "$@" >&2
RETURN=1 usage
}
artifact() {
if [ $# -lt 2 ]; then
die "You must specify a valid artifact."
fi
shift
ARTIFACT="$1"
}
host() {
if [ $# -lt 2 ]; then
die "You must specify a valid Git host."
fi
shift
GIT_HOST="$1"
}
# this is a semi-hacky way to handle long/shortforms
while true; do
case "$1" in
-[a-z]*)
opt=$(echo "$1" | sed 's/^-//')
while [ -n "$opt" ]; do
# cut out first char from the optstring
char=$(echo "$opt" | cut -c1)
opt=$(echo "$opt" | cut -c2-)
case "$char" in
a) artifact "$@" ;;
g) host "$@" ;;
h) usage ;;
*) die "Invalid option -$char" ;;
esac
done
;;
--artifact) artifact "$@" ;;
--host) host "$@" ;;
--help) usage ;;
--*) die "Invalid option $1" ;;
"$0" | "") break ;;
*)
{ [ -z "$REPO" ] && REPO="$1"; } || REF="$1"
;;
esac
shift
done
[ -z "$REPO" ] && die "A valid repository must be provided."
[ -z "$REF" ] && die "A valid reference must be provided."
GIT_HOST=${GIT_HOST:-github.com}
GIT_URL="https://$GIT_HOST/$REPO"
if [ "$USE_TAG" = "true" ]; then
if [ -z "$ARTIFACT" ] || [ "$ARTIFACT" = "null" ]; then
URL="${GIT_URL}/archive/refs/tags/$2.tar.gz"
else
URL="${GIT_URL}/releases/download/$2/${ARTIFACT}"
fi
if [ -z "$ARTIFACT" ] || [ "$ARTIFACT" = "null" ]; then
URL="${GIT_URL}/archive/$REF.tar.gz"
else
URL="${GIT_URL}/archive/$2.zip"
URL="${GIT_URL}/releases/download/$REF/$ARTIFACT"
fi
SUM=$(wget -q "$URL" -O - | sha512sum)
echo "$SUM" | cut -d " " -f1

View File

@@ -3,9 +3,6 @@
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# env vars:
# - UPDATE: fix hashes if needed
# shellcheck disable=SC1091
. tools/cpm/common.sh
@@ -14,7 +11,7 @@
# shellcheck disable=SC2153
JSON=$(echo "$PACKAGES" | jq -r ".\"$PACKAGE\" | select( . != null )")
[ -z "$JSON" ] && echo "!! No cpmfile definition for $PACKAGE" && exit 1
[ -z "$JSON" ] && echo "!! No cpmfile definition for $PACKAGE" >&2 && exit 1
# unset stuff
export PACKAGE_NAME="null"
@@ -134,13 +131,13 @@ elif [ "$REPO" != "null" ]; then
DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz"
fi
elif [ "$SHA" != "null" ]; then
DOWNLOAD="${GIT_URL}/archive/${SHA}.zip"
DOWNLOAD="${GIT_URL}/archive/${SHA}.tar.gz"
else
if [ "$BRANCH" = null ]; then
BRANCH=master
fi
DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.zip"
DOWNLOAD="${GIT_URL}/archive/refs/heads/${BRANCH}.tar.gz"
fi
else
echo "!! No repo or URL defined for $PACKAGE"

View File

@@ -8,8 +8,8 @@
. tools/cpm/common.sh
# shellcheck disable=SC2086
JSON=$(find $DIRS -maxdepth "$MAXDEPTH" -name cpmfile.json -exec grep -l "$1" {} \;)
JSON=$(echo "$CPMFILES" | xargs grep -l "$1")
[ -z "$JSON" ] && echo "!! No cpmfile definition for $1"
[ -z "$JSON" ] && echo "!! No cpmfile definition for $1" >&2 && exit 1
echo "$JSON"

131
tools/dtrace-tool.pl Executable file
View File

@@ -0,0 +1,131 @@
#!/usr/bin/perl
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# Basic script to run dtrace sampling over the program (requires Flamegraph)
# Usage is either running as: ./dtrace-tool.sh pid (then input the pid of the process)
# Or just run directly with: ./dtrace-tool.sh <command>
use strict;
use warnings;
use POSIX qw(strftime);
my $input;
my $sampling_hz = '4000';
my $sampling_time = '5';
my $sampling_pid = `pgrep eden`;
my $sampling_program = 'eden';
my $sampling_type = 0;
sub dtrace_ask_params {
my $is_ok = 'Y';
do {
print "Sampling HZ [" . $sampling_hz . "]: ";
chomp($input = <STDIN>);
$sampling_hz = $input || $sampling_hz;
print "Sampling time [" . $sampling_time . "]: ";
chomp($input = <STDIN>);
$sampling_time = $input || $sampling_time;
print "Sampling pid [" . $sampling_pid . "]: ";
chomp($input = <STDIN>);
$sampling_pid = $input || $sampling_pid;
print "Are these settings correct?: [" . $is_ok . "]\n";
print "HZ = " . $sampling_hz . "\nTime = " . $sampling_time . "\nPID = " . $sampling_pid . "\n";
chomp($input = <STDIN>);
$is_ok = $input || $is_ok;
} while ($is_ok eq 'n');
}
sub dtrace_probe_profiling {
if ($sampling_type eq 0) {
return "
profile-".$sampling_hz." /pid == ".$sampling_pid." && arg0/ {
@[stack(100)] = count();
}
profile-".$sampling_hz." /pid == ".$sampling_pid." && arg1/ {
@[ustack(100)] = count();
}
tick-".$sampling_time."s {
exit(0);
}";
} elsif ($sampling_type eq 1) {
return "
syscall:::entry /pid == ".$sampling_pid."/ {
\@traces[ustack(100)] = count();
}
tick-".$sampling_time."s {
exit(0);
}";
} elsif ($sampling_type eq 2) {
return "
profile-".$sampling_hz." /pid == ".$sampling_pid." && arg0/ {
@[stringof(curthread->td_name), stack(100)] = count();
}
profile-".$sampling_hz." /pid == ".$sampling_pid." && arg1/ {
@[stringof(curthread->td_name), ustack(100)] = count();
}
tick-".$sampling_time."s {
exit(0);
}";
} elsif ($sampling_type eq 3) {
return "
io::start /pid == ".$sampling_pid."/ {
@[ustack(100)] = count();
}
tick-".$sampling_time."s {
exit(0);
}";
} else {
die "idk";
}
}
sub dtrace_generate {
my @date = (localtime(time))[5, 4, 3, 2, 1, 0];
$date[0] += 1900;
$date[1]++;
my $fmt_date = sprintf "%4d-%02d-%02d_%02d-%02d-%02d", @date;
my $trace_dir = "dtrace-out";
my $trace_file = $trace_dir . "/" . $fmt_date . ".user_stacks";
my $trace_fold = $trace_dir . "/" . $fmt_date . ".fold";
my $trace_svg = $trace_dir . "/" . $fmt_date . ".svg";
my $trace_probe = dtrace_probe_profiling;
print $trace_probe . "\n";
system "sudo", "dtrace", "-Z", "-n", $trace_probe, "-o", $trace_file;
die "$!" if $?;
open (my $trace_fold_handle, ">", $trace_fold) or die "$!";
#run ["perl", "../FlameGraph/stackcollapse.pl", $trace_file], ">", \my $fold_output;
my $fold_output = `perl ../FlameGraph/stackcollapse.pl $trace_file`;
print $trace_fold_handle $fold_output;
open (my $trace_svg_handle, ">", $trace_svg) or die "$!";
#run ["perl", "../FlameGraph/flamegraph.pl", $trace_fold], ">", \my $svg_output;
my $svg_output = `perl ../FlameGraph/flamegraph.pl $trace_fold`;
print $trace_svg_handle $svg_output;
system "sudo", "chmod", "0666", $trace_file;
}
foreach my $i (0 .. $#ARGV) {
if ($ARGV[$i] eq '-h') {
print "Usage: $0\n";
printf "%-20s%s\n", "-p", "Prompt for parameters";
printf "%-20s%s\n", "-g", "Generate dtrace output";
printf "%-20s%s\n", "-s", "Continously generate output until Ctrl^C";
printf "%-20s%s\n", "-<n>", "Select dtrace type";
} elsif ($ARGV[$i] eq '-g') {
dtrace_generate;
} elsif ($ARGV[$i] eq '-s') {
while (1) {
dtrace_generate;
}
} elsif ($ARGV[$i] eq '-p') {
dtrace_ask_params;
} else {
$sampling_type = substr $ARGV[$i], 1;
print "Select: ".$sampling_type."\n";
}
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
cat src/android/app/src/main/res/values/strings.xml \
| grep 'string name="' | awk -F'"' '$0=$2' \
| xargs -I {} sh -c 'grep -qirnw R.string.'{}' src/android/app/src || echo '{}

40
tools/lanczos-gen.pl Normal file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/perl
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
use strict;
use warnings;
sub generate_lanczos {
my $pi = 3.14159265358979;
sub sinc {
if ($_[0] eq 0.0) {
return 1.0;
} else {
return sin($pi * $_[0]) / ($pi * $_[0]);
}
}
sub lanczos {
my $d = sqrt($_[0] * $_[0] + $_[1] * $_[1]);
return sinc($d) / sinc($d / $_[2]);
}
my $r = 3.0; #radius (1 = 3 steps)
my $k_size = ($r * 2.0 + 1.0) * ($r * 2.0 + 1.0);
my $w_sum = \0.0;
my $factor = 1.0 / ($r + 1.0);
#kernel size = (r * 2 + 1) ^ 2
printf("const float w_kernel[%i] = float[] (\n ", $k_size);
for (my $x = -$r; $x <= $r; $x++) {
for (my $y = -$r; $y <= $r; $y++) {
my $w = lanczos($x, $y, $r);
printf("%f, ", $w);
$w_sum += $w;
}
}
printf("\n);\nconst vec2 w_pos[%i] = vec[](\n ", $k_size);
for (my $x = -$r; $x <= $r; $x++) {
for (my $y = -$r; $y <= $r; $y++) {
printf("vec2(%f, %f), ", $x * $factor, $y * $factor);
}
}
printf("\n);\nconst float w_sum = %f;\n", $w_sum);
}
generate_lanczos;

View File

@@ -1,48 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// clang -lm tools/lanczos_gen.c -o tools/lanczos_gen && ./tools/lanczos_gen
#include <stdio.h>
#include <math.h>
double sinc(double x) {
return x == 0.0f ? 1.0f : sin(M_PI * x) / (M_PI * x);
}
typedef struct vec2 {
double x;
double y;
} vec2;
double lanczos(vec2 v, float a) {
double d = sqrt(v.x * v.x + v.y * v.y);
return sinc(d) / sinc(d / a);
}
int main(int argc, char* argv[]) {
const int r = 3; //radius (1 = 3 steps)
const int k_size = (r * 2 + 1) * (r * 2 + 1);
double w_sum = 0.0f;
// kernel size = (r * 2 + 1) ^ 2
printf("const float w_kernel[%i] = float[] (\n ", k_size);
double factor = 1.0f / ((double)r + 1.0f);
for (int x = -r; x <= r; x++)
for (int y = -r; y <= r; y++) {
double w = lanczos((vec2){ .x = x, .y = y }, (double)r);
printf("%lff, ", w);
w_sum += w;
}
printf("\n);\n");
printf("const vec2 w_pos[%i] = vec2[] (\n ", k_size);
for (int x = -r; x <= r; x++)
for (int y = -r; y <= r; y++) {
vec2 kp = (vec2){
.x = x * factor,
.y = y * factor
};
printf("vec2(%lff, %lff), ", kp.x, kp.y);
}
printf("\n);\n");
printf("const float w_sum = %lff;\n", w_sum);
return 0;
}

View File

@@ -1,9 +1,5 @@
#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# Optimizes assets of Eden (requires OptiPng)
which optipng || exit
find . -type f -name "*.png" -exec optipng -o7 {} \;
find . -type f -iname '*.png' -print0 | xargs -0 -P 16 -I {} optipng -o7 {}

View File

@@ -1,11 +1,7 @@
#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-FileCopyrightText: Copyright 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
# fd is slightly faster on NVMe (the syntax sux though)
if command -v fd > /dev/null; then
fd . tools -esh -x shellcheck
else
find tools -name "*.sh" -exec shellcheck -s sh {} \;
fi
# do NOT use fd in scripts, PLEASE
find tools -name "*.sh" -exec shellcheck -s sh {} \;

View File

@@ -1,6 +1,16 @@
#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-FileCopyrightText: Copyright 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
wget -O CMakeModules/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake
# updates CPMUtil, its docs, and related tools from the latest release
if command -v zstd > /dev/null; then
EXT=tar.zst
else
EXT=tar.gz
fi
wget "https://git.crueter.xyz/CMake/CPMUtil/releases/download/continuous/CPMUtil.$EXT"
tar xf "CPMUtil.$EXT"
rm "CPMUtil.$EXT"