Compare commits

..

No commits in common. "master" and "Canary-1.3.35" have entirely different histories.

673 changed files with 3959 additions and 5885 deletions

View File

@ -16,17 +16,6 @@ tab_width = 4
# New line preferences # New line preferences
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_explicit_tuple_names = true:suggestion
# Markdown, JSON, YAML, props and csproj files # Markdown, JSON, YAML, props and csproj files
[*.{md,json,yml,props,csproj}] [*.{md,json,yml,props,csproj}]
@ -117,7 +106,7 @@ csharp_style_conditional_delegate_call = true:suggestion
csharp_prefer_static_local_function = true:suggestion csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
csharp_style_prefer_readonly_struct = true csharp_style_prefer_readonly_struct = true
csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_method_group_conversion = true
# Code-block preferences # Code-block preferences
csharp_prefer_braces = true:silent csharp_prefer_braces = true:silent
@ -188,9 +177,9 @@ csharp_preserve_single_line_statements = false
# Naming rules # Naming rules
dotnet_naming_rule.interfaces_should_be_prefixed_with_i.severity = suggestion dotnet_naming_rule.interfaces_should_be_prefixed_with_I.severity = suggestion
dotnet_naming_rule.interfaces_should_be_prefixed_with_I.symbols = interface dotnet_naming_rule.interfaces_should_be_prefixed_with_I.symbols = interface
dotnet_naming_rule.interfaces_should_be_prefixed_with_i.style = IPascalCase dotnet_naming_rule.interfaces_should_be_prefixed_with_I.style = IPascalCase
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types dotnet_naming_rule.types_should_be_pascal_case.symbols = types
@ -247,22 +236,28 @@ dotnet_naming_style.IPascalCase.required_suffix =
dotnet_naming_style.IPascalCase.word_separator = dotnet_naming_style.IPascalCase.word_separator =
dotnet_naming_style.IPascalCase.capitalization = pascal_case dotnet_naming_style.IPascalCase.capitalization = pascal_case
# Other settings # TODO:
csharp_style_prefer_top_level_statements = true:suggestion # .NET 8 migration (new warnings are caused by the NET 8 C# compiler and analyzer)
csharp_style_prefer_primary_constructors = false:suggestion # The following info messages might need to be fixed in the source code instead of hiding the actual message
csharp_prefer_system_threading_lock = true:suggestion # Without the following lines, dotnet format would fail
# Disable "Collection initialization can be simplified"
# Analyzers
dotnet_diagnostic.CA1069.severity = none # CA1069: Enums values should not be duplicated
# Disable Collection initialization can be simplified
dotnet_diagnostic.IDE0028.severity = none dotnet_diagnostic.IDE0028.severity = none
dotnet_diagnostic.IDE0300.severity = none dotnet_diagnostic.IDE0300.severity = none
dotnet_diagnostic.IDE0301.severity = none dotnet_diagnostic.IDE0301.severity = none
dotnet_diagnostic.IDE0302.severity = none dotnet_diagnostic.IDE0302.severity = none
dotnet_diagnostic.IDE0305.severity = none dotnet_diagnostic.IDE0305.severity = none
dotnet_diagnostic.CS9113.severity = none # CS9113: Parameter 'value' is unread # Disable "'new' expression can be simplified"
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure dotnet_diagnostic.IDE0090.severity = none
# Disable "Use primary constructor"
dotnet_diagnostic.IDE0290.severity = none
# Disable "Member '' does not access instance data and can be marked as static"
dotnet_diagnostic.CA1822.severity = none
# Disable "Change type of field '' from '' to '' for improved performance"
dotnet_diagnostic.CA1859.severity = none
# Disable "Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array"
dotnet_diagnostic.CA1861.severity = none
# Disable "Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'"
dotnet_diagnostic.CA1862.severity = none
[src/Ryujinx/UI/ViewModels/**.cs] [src/Ryujinx/UI/ViewModels/**.cs]
# Disable "mark members as static" rule for ViewModels # Disable "mark members as static" rule for ViewModels

View File

@ -21,9 +21,60 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.3" RYUJINX_BASE_VERSION: "1.3"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "canary" RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "canary"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryubing"
RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO: "Ryujinx"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Canary-Releases"
RELEASE: 1 RELEASE: 1
jobs: jobs:
tag:
name: Create tag
runs-on: ubuntu-24.04
steps:
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
shell: bash
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitLab tag
run: gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=CreateTag "Canary-${{ steps.version_info.outputs.build_version }}|master"
- name: Create release
uses: ncipollo/release-action@v1
with:
name: "Canary ${{ steps.version_info.outputs.build_version }}"
tag: ${{ steps.version_info.outputs.build_version }}
body: |
# Canary builds:
These builds are experimental and may sometimes not work, use [regular builds](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/Stable-Releases/releases/latest) instead if that sounds like something you don't want to deal with.
| Platform | Artifact |
|--|--|
| Windows 64-bit | [Canary Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
| Windows ARM 64-bit | [Canary Windows ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-win_arm64.zip) |
| Linux 64-bit | [Canary Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
| Linux ARM 64-bit | [Canary Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
| macOS | [Canary macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
**[Full Changelog](https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }})**
omitBodyDuringUpdate: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
release: release:
name: Release for ${{ matrix.platform.name }} name: Release for ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
@ -31,7 +82,7 @@ jobs:
matrix: matrix:
platform: platform:
- { name: win-x64, os: windows-latest, zip_os_name: win_x64 } - { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
#- { name: win-arm64, os: windows-latest, zip_os_name: win_arm64 } - { name: win-arm64, os: windows-latest, zip_os_name: win_arm64 }
- { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 } - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
- { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 } - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
steps: steps:
@ -57,6 +108,9 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place '/^Name=Ryujinx$/s/Name=Ryujinx/Name=Ryujinx-Canary/' distribution/linux/Ryujinx.desktop sed -r --in-place '/^Name=Ryujinx$/s/Name=Ryujinx/Name=Ryujinx-Canary/' distribution/linux/Ryujinx.desktop
shell: bash shell: bash
@ -75,24 +129,7 @@ jobs:
rm libarmeilleure-jitsupport.dylib rm libarmeilleure-jitsupport.dylib
7z a ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish 7z a ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
popd popd
gh release download -R GreemDev/GLI -O gli.exe -p 'GitLabCli-win_x64.exe'
./gli.exe --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip"
shell: bash shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitLabCli
if: matrix.platform.os == 'ubuntu-latest'
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Packing Linux builds - name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest' if: matrix.platform.os == 'ubuntu-latest'
@ -102,8 +139,6 @@ jobs:
chmod +x Ryujinx.sh Ryujinx chmod +x Ryujinx.sh Ryujinx
tar -czvf ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish tar -czvf ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
popd popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz"
shell: bash shell: bash
- name: Build AppImage (Linux) - name: Build AppImage (Linux)
@ -134,18 +169,42 @@ jobs:
exit 1 exit 1
fi fi
export UFLAG="gh-releases-zsync|${{ secrets.RC_OWNER }}${{ secrets.RC_CANARY_NAME }}|latest|*-$ARCH_NAME.AppImage.zsync" export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|Canary-Releases|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
pushd publish_appimage pushd publish_appimage
mv Ryujinx.AppImage ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage mv Ryujinx.AppImage ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync mv Ryujinx.AppImage.zsync ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage"
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync"
shell: bash shell: bash
- name: Pushing new release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip,release_output/*AppImage*"
tag: ${{ steps.version_info.outputs.build_version }}
body: |
# Canary builds:
These builds are experimental and may sometimes not work, use [regular builds](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/latest) instead if that sounds like something you don't want to deal with.
| Platform | Artifact |
|--|--|
| Windows 64-bit | [Canary Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
| Windows ARM 64-bit | [Canary Windows ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-win_arm64.zip) |
| Linux 64-bit | [Canary Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
| Linux ARM 64-bit | [Canary Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
| macOS | [Canary macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
**[Full Changelog](https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }})**
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
macos_release: macos_release:
name: Release MacOS universal name: Release MacOS universal
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
@ -162,16 +221,6 @@ jobs:
chmod +x llvm.sh chmod +x llvm.sh
sudo ./llvm.sh 17 sudo ./llvm.sh 17
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install rcodesign - name: Install rcodesign
run: | run: |
mkdir -p $HOME/.bin mkdir -p $HOME/.bin
@ -197,53 +246,24 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash shell: bash
- name: Publish macOS Ryujinx - name: Publish macOS Ryujinx
run: | run: |
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 1 ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 1
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|publish_ava/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz"
create_gitlab_release: - name: Pushing new release
name: Create GitLab Release uses: ncipollo/release-action@v1
runs-on: ubuntu-24.04 with:
needs: name: "Canary ${{ steps.version_info.outputs.build_version }}"
- macos_release artifacts: "publish_ava/*.tar.gz"
- release tag: ${{ steps.version_info.outputs.build_version }}
steps: body: ""
- uses: actions/checkout@v4 omitBodyDuringUpdate: true
allowUpdates: true
- name: Get version info replacesArtifacts: true
id: version_info owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
run: | repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT token: ${{ secrets.RELEASE_TOKEN }}
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=CreateTag "Canary-${{ steps.version_info.outputs.build_version }}|${{ steps.version_info.outputs.git_short_hash }}"
- name: Create release
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=CreateReleaseFromGenericPackageFiles "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|main|Canary ${{ steps.version_info.outputs.build_version }}|**Full Changelog:** [${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}](https://git.ryujinx.app/ryubing/ryujinx/-/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }})"
- name: Send notification webhook
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=SendUpdateMessage "${{ steps.version_info.outputs.build_version }}|FF4500|${{ secrets.CANARY_DISCORD_WEBHOOK }}|https://avatars.githubusercontent.com/u/192939710?s=200&v=4|false"
- name: Notify update server of new builds
run: |
curl 'https://update.ryujinx.app/api/v1/admin/refresh_cache?rc=canary' -X PATCH -H 'accept: */*' -H 'Authorization: ${{ secrets.UPDATE_SERVER_ADMIN_TOKEN }}'

View File

@ -1,224 +0,0 @@
name: Release job (Debug)
on:
workflow_dispatch:
inputs: {}
concurrency: release
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.3"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release"
RELEASE: 1
jobs:
release:
name: Release for ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
#- { name: win-arm64, os: windows-latest, zip_os_name: win_arm64 }
- { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
- { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Overwrite csc problem matcher
run: echo "::add-matcher::.github/csc.json"
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} + 10))" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
- name: Configure for release
run: |
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
- name: Create output dir
run: "mkdir release_output"
- name: Publish
run: |
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained
- name: Packing Windows builds
if: matrix.platform.os == 'windows-latest'
run: |
pushd publish
rm libarmeilleure-jitsupport.dylib
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
popd
gh release download -R GreemDev/GLI -O gli.exe -p 'GitLabCli-win_x64.exe'
./gli.exe --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitLabCli
if: matrix.platform.os == 'ubuntu-latest'
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest'
run: |
pushd publish
rm libarmeilleure-jitsupport.dylib
chmod +x Ryujinx.sh Ryujinx
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz"
shell: bash
- name: Build AppImage (Linux)
if: matrix.platform.os == 'ubuntu-latest'
run: |
BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
PLATFORM_NAME="${{ matrix.platform.name }}"
sudo apt install -y zsync desktop-file-utils appstream
mkdir -p tools
export PATH="$PATH:$(readlink -f tools)"
# Setup appimagetool
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x tools/appimagetool
chmod +x distribution/linux/appimage/build-appimage.sh
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
ARCH_NAME=x64
export ARCH=x86_64
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
ARCH_NAME=arm64
export ARCH=aarch64
else
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
exit 1
fi
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
pushd publish_appimage
mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage"
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync"
shell: bash
macos_release:
name: Release MacOS universal
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Setup LLVM 17
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install rcodesign
run: |
mkdir -p $HOME/.bin
gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
rm apple-codesign.tar.gz
mv rcodesign $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} + 10))" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
- name: Configure for release
run: |
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
- name: Publish macOS Ryujinx
run: |
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|publish/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz"
create_gitlab_release:
name: Create GitLab Release
runs-on: ubuntu-24.04
needs:
- macos_release
- release
steps:
- uses: actions/checkout@v4
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} + 10))" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=CreateReleaseFromGenericPackageFiles "Ryubing|${{ steps.version_info.outputs.build_version }}|${{ steps.version_info.outputs.git_short_hash }}|test|THIS IS NOT INTENDED FOR END USER USAGE"

View File

@ -11,9 +11,57 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.3" RYUJINX_BASE_VERSION: "1.3"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release" RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryubing"
RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO: "Ryujinx"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Stable-Releases"
RELEASE: 1 RELEASE: 1
jobs: jobs:
tag:
name: Create tag
runs-on: ubuntu-24.04
steps:
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
shell: bash
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitLab tag
run: gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=CreateTag "${{ steps.version_info.outputs.build_version }}|master"
- name: Create release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
tag: ${{ steps.version_info.outputs.build_version }}
body: |
# Stable builds:
| Platform | Artifact |
|--|--|
| Windows 64-bit | [Stable Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
| Windows ARM 64-bit | [Stable Windows ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_arm64.zip) |
| Linux 64-bit | [Stable Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
| Linux ARM 64-bit | [Stable Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
| macOS | [Stable macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
**[Full Changelog](https://git.ryujinx.app/ryubing/ryujinx/-/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }})**
omitBodyDuringUpdate: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
release: release:
name: Release for ${{ matrix.platform.name }} name: Release for ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
@ -21,7 +69,7 @@ jobs:
matrix: matrix:
platform: platform:
- { name: win-x64, os: windows-latest, zip_os_name: win_x64 } - { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
#- { name: win-arm64, os: windows-latest, zip_os_name: win_arm64 } - { name: win-arm64, os: windows-latest, zip_os_name: win_arm64 }
- { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 } - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
- { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 } - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
steps: steps:
@ -47,6 +95,9 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash shell: bash
@ -64,24 +115,7 @@ jobs:
rm libarmeilleure-jitsupport.dylib rm libarmeilleure-jitsupport.dylib
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
popd popd
gh release download -R GreemDev/GLI -O gli.exe -p 'GitLabCli-win_x64.exe'
./gli.exe --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip"
shell: bash shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitLabCli
if: matrix.platform.os == 'ubuntu-latest'
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Packing Linux builds - name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest' if: matrix.platform.os == 'ubuntu-latest'
@ -91,11 +125,7 @@ jobs:
chmod +x Ryujinx.sh Ryujinx chmod +x Ryujinx.sh Ryujinx
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
popd popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz"
shell: bash shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build AppImage (Linux) - name: Build AppImage (Linux)
if: matrix.platform.os == 'ubuntu-latest' if: matrix.platform.os == 'ubuntu-latest'
@ -132,11 +162,32 @@ jobs:
mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage"
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync"
shell: bash shell: bash
- name: Pushing new release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip,release_output/*AppImage*"
tag: ${{ steps.version_info.outputs.build_version }}
body: |
# Stable builds:
| Platform | Artifact |
|--|--|
| Windows 64-bit | [Stable Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
| Windows ARM 64-bit | [Stable Windows ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_arm64.zip) |
| Linux 64-bit | [Stable Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
| Linux ARM 64-bit | [Stable Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
| macOS | [Stable macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
**[Full Changelog](https://git.ryujinx.app/ryubing/ryujinx/-/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }})**
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
macos_release: macos_release:
name: Release MacOS universal name: Release MacOS universal
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
@ -153,16 +204,6 @@ jobs:
chmod +x llvm.sh chmod +x llvm.sh
sudo ./llvm.sh 17 sudo ./llvm.sh 17
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install rcodesign - name: Install rcodesign
run: | run: |
mkdir -p $HOME/.bin mkdir -p $HOME/.bin
@ -186,49 +227,26 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash shell: bash
- name: Publish macOS Ryujinx - name: Publish macOS Ryujinx
run: | run: |
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0 ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|publish/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz"
create_gitlab_release: - name: Pushing new release
name: Create GitLab Release uses: ncipollo/release-action@v1
runs-on: ubuntu-24.04 with:
needs: name: ${{ steps.version_info.outputs.build_version }}
- macos_release artifacts: "publish/*.tar.gz"
- release tag: ${{ steps.version_info.outputs.build_version }}
steps: body: ""
- uses: actions/checkout@v4 omitBodyDuringUpdate: true
allowUpdates: true
- name: Get version info replacesArtifacts: true
id: version_info owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
run: | repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT token: ${{ secrets.RELEASE_TOKEN }}
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
- name: Install GitLabCli
run: |
mkdir -p $HOME/.bin
gh release download -R GreemDev/GLI -O gli -p 'GitLabCli-linux_x64'
chmod +x gli
mv gli $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=CreateReleaseFromGenericPackageFiles "Ryubing|${{ steps.version_info.outputs.build_version }}|${{ steps.version_info.outputs.git_short_hash }}|${{ steps.version_info.outputs.build_version }}|msd:${{ steps.version_info.outputs.build_version }}"
- name: Send notification webhook
run: |
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=SendUpdateMessage "${{ steps.version_info.outputs.build_version }}|32cd32|${{ secrets.STABLE_DISCORD_WEBHOOK }}|https://avatars.githubusercontent.com/u/192939710?s=200&v=4|false"
- name: Notify update server of new builds
run: |
curl 'https://update.ryujinx.app/api/v1/admin/refresh_cache?rc=stable' -X PATCH -H 'accept: */*' -H 'Authorization: ${{ secrets.UPDATE_SERVER_ADMIN_TOKEN }}'

View File

@ -1,18 +0,0 @@
function pub {
dotnet publish -c release
}
function package {
cd src/$1
pub
mv bin/Release/$1.1.0.0.nupkg ../../pkgs/$1.1.0.0.nupkg
cd ../../
}
rm -rf pkgs
mkdir pkgs
package ARMeilleure
package Ryujinx.Memory
dotnet nuget push pkgs/*.nupkg --source RyubingPkgs

View File

@ -2,17 +2,18 @@
All updates to this Ryujinx branch will be documented in this file. All updates to this Ryujinx branch will be documented in this file.
## [1.3.2](<https://git.ryujinx.app/ryubing/ryujinx/-/releases/1.3.2>) - 2025-06-09
## [1.3.1](<https://git.ryujinx.app/ryubing/ryujinx/-/releases/1.3.1>) - 2025-04-23 ## [1.2.86](<https://git.ryujinx.app/ryubing/ryujinx/-/releases/1.2.86>) - 2025-03-13
A list of notable changes can be found on the release linked in the version number above.
## [1.2.86](<https://github.com/Ryubing/Stable-Releases/releases/tag/1.2.86>) - 2025-03-13
## [1.2.82](<https://web.archive.org/web/20250312010534/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.82>) - 2025-02-16 ## [1.2.82](<https://web.archive.org/web/20250312010534/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.82>) - 2025-02-16
A list of notable changes can be found on the release linked in the version number above.
## [1.2.80-81](<https://web.archive.org/web/20250302064257/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.81>) - 2025-01-22 ## [1.2.80-81](<https://web.archive.org/web/20250302064257/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.81>) - 2025-01-22
A list of notable changes can be found on the release linked in the version number above.
## [1.2.78](<https://web.archive.org/web/20250301174537/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.78>) - 2024-12-19 ## [1.2.78](<https://web.archive.org/web/20250301174537/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.78>) - 2024-12-19
A list of notable changes can be found on the release linked in the version number above.
## [1.2.73-1.2.76](<https://web.archive.org/web/20250209202612/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.76>) - 2024-11-19 ## [1.2.73-1.2.76](<https://web.archive.org/web/20250209202612/https://github.com/Ryubing/Ryujinx/releases/tag/1.2.76>) - 2024-11-19
A list of notable changes can be found on the release linked in the version number above. A list of notable changes can be found on the release linked in the version number above.

View File

@ -23,6 +23,7 @@
<PackageVersion Include="DynamicData" Version="9.0.4" /> <PackageVersion Include="DynamicData" Version="9.0.4" />
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" /> <PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" />
<PackageVersion Include="Humanizer" Version="2.14.1" /> <PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="LibHac" Version="0.19.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" /> <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" /> <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.3.0" /> <PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.3.0" />
@ -40,7 +41,6 @@
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" /> <PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" Version="6.1.2-build3" /> <PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies.AllArch" Version="6.1.2-build3" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" /> <PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.LibHac" Version="0.20.0" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" /> <PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Gommon" Version="2.7.1.1" /> <PackageVersion Include="Gommon" Version="2.7.1.1" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" /> <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />

View File

@ -7,8 +7,8 @@
# Ryujinx # Ryujinx
[![Latest release](https://img.shields.io/gitlab/v/release/ryubing%2Fryujinx?gitlab_url=https%3A%2F%2Fgit.ryujinx.app&label=stable&color=32cd32)](https://git.ryujinx.app/ryubing/ryujinx/-/releases) [![Latest release](https://img.shields.io/github/v/release/Ryubing/Stable-Releases?label=stable)](https://github.com/Ryubing/Stable-Releases/releases/latest)
[![Latest canary release](https://img.shields.io/gitlab/v/release/ryubing%2Fcanary?gitlab_url=https%3A%2F%2Fgit.ryujinx.app&label=canary&color=FF4500)](https://git.ryujinx.app/ryubing/canary/-/releases) [![Latest canary release](https://img.shields.io/github/v/release/Ryubing/Canary-Releases?label=canary)](https://github.com/Ryubing/Canary-Releases/releases/latest)
<br> <br>
<a href="https://discord.gg/PEuzjrFXUA"> <a href="https://discord.gg/PEuzjrFXUA">
<img src="https://img.shields.io/discord/1294443224030511104?color=5865F2&label=Ryubing&logo=discord&logoColor=white" alt="Discord"> <img src="https://img.shields.io/discord/1294443224030511104?color=5865F2&label=Ryubing&logo=discord&logoColor=white" alt="Discord">
@ -31,7 +31,7 @@
<br> <br>
This is not a Ryujinx revival project. This is not a Phoenix project. This is not a Ryujinx revival project. This is not a Phoenix project.
<br> <br>
Guides and documentation can be found on the <a href="https://git.ryujinx.app/groups/ryubing/-/wikis/home">Wiki tab</a>. Guides and documentation can be found on the <a href="https://git.ryujinx.app/ryubing/ryujinx/-/wikis/home">Wiki tab</a>.
</p> </p>
<p align="center"> <p align="center">
@ -49,13 +49,13 @@ Stable builds are made every so often, based on the `master` branch, that then g
These stable builds exist so that the end user can get a more **enjoyable and stable experience**. These stable builds exist so that the end user can get a more **enjoyable and stable experience**.
They are released every month or so, to ensure consistent updates, while not being an annoying amount of individual updates to download over the course of that month. They are released every month or so, to ensure consistent updates, while not being an annoying amount of individual updates to download over the course of that month.
You can find the stable releases [here](https://git.ryujinx.app/ryubing/ryujinx/-/releases). You can find the latest stable release [here](https://github.com/Ryubing/Stable-Releases/releases/latest).
Canary builds are compiled automatically for each commit on the `master` branch. Canary builds are compiled automatically for each commit on the `master` branch.
While we strive to ensure optimal stability and performance prior to pushing an update, these builds **may be unstable or completely broken**. While we strive to ensure optimal stability and performance prior to pushing an update, these builds **may be unstable or completely broken**.
These canary builds are only recommended for experienced users. These canary builds are only recommended for experienced users.
You can find the canary releases [here](https://git.ryujinx.app/ryubing/canary/-/releases). You can find the latest canary release [here](https://github.com/Ryubing/Canary-Releases/releases/latest).
## Documentation ## Documentation
@ -111,7 +111,7 @@ See [LICENSE.txt](LICENSE.txt) and [THIRDPARTY.md](distribution/legal/THIRDPARTY
## Credits ## Credits
- [LibHac](https://git.ryujinx.app/ryubing/libhac) is used for our file-system. - [LibHac](https://github.com/Thealexbarney/LibHac) is used for our file-system.
- [AmiiboAPI](https://www.amiiboapi.com) is used in our Amiibo emulation. - [AmiiboAPI](https://www.amiiboapi.com) is used in our Amiibo emulation.
- [ldn_mitm](https://github.com/spacemeowx2/ldn_mitm) is used for one of our available multiplayer modes. - [ldn_mitm](https://github.com/spacemeowx2/ldn_mitm) is used for one of our available multiplayer modes.
- [ShellLink](https://github.com/securifybv/ShellLink) is used for Windows shortcut generation. - [ShellLink](https://github.com/securifybv/ShellLink) is used for Windows shortcut generation.

View File

@ -77,8 +77,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon.Kernel.Gene
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.BuildValidationTasks", "src\Ryujinx.BuildValidationTasks\Ryujinx.BuildValidationTasks.csproj", "{4A89A234-4F19-497D-A576-DDE8CDFC5B22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig .editorconfig = .editorconfig
@ -86,9 +84,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.github\workflows\canary.yml = .github\workflows\canary.yml .github\workflows\canary.yml = .github\workflows\canary.yml
Directory.Packages.props = Directory.Packages.props Directory.Packages.props = Directory.Packages.props
.github\workflows\release.yml = .github\workflows\release.yml .github\workflows\release.yml = .github\workflows\release.yml
nuget.config = nuget.config
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.BuildValidationTasks", "src\Ryujinx.BuildValidationTasks\Ryujinx.BuildValidationTasks.csproj", "{4A89A234-4F19-497D-A576-DDE8CDFC5B22}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

File diff suppressed because it is too large Load Diff

View File

@ -33,29 +33,23 @@ echo -n "APPL????" > "$APP_BUNDLE_DIRECTORY/Contents/PkgInfo"
echo "Running bundle fix up python script" echo "Running bundle fix up python script"
python3 bundle_fix_up.py "$APP_BUNDLE_DIRECTORY" MacOS/Ryujinx python3 bundle_fix_up.py "$APP_BUNDLE_DIRECTORY" MacOS/Ryujinx
# Resign all dyplib files as ad-hoc after changing them
find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec codesign --force --sign - {} \;
# Now sign it # Now sign it
echo "Starting signing process" echo "Starting signing process"
if ! [ -x "$(command -v codesign)" ]; if ! [ -x "$(command -v codesign)" ];
then then
if ! [ -x "$(command -v rcodesign)" ]; if ! [ -x "$(command -v rcodesign)" ];
then then
echo "Cannot find rcodesign on your system, please install rcodesign and ensure it is in your search path." echo "Cannot find rcodesign on your system, please install rcodesign."
exit 1 exit 1
fi fi
# cargo install apple-codesign
echo "Using rcodesign for ad-hoc signing" echo "Using rcodesign for ad-hoc signing"
echo "Resigning all frameworks dylib files as ad-hoc"
find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec rcodesign sign {} \;
echo "Signing app bundle as ad-hoc"
rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY" rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY"
else else
echo "Using codesign for ad-hoc signing" echo "Using codesign for ad-hoc signing"
echo "Resigning all frameworks dylib files as ad-hoc"
find "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" -type f -name "*.dylib" -exec codesign --force --sign - {} \;
echo "Signing app bundle as ad-hoc"
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$APP_BUNDLE_DIRECTORY" codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$APP_BUNDLE_DIRECTORY"
fi fi

View File

@ -20,18 +20,6 @@ SOURCE_REVISION_ID=$6
CONFIGURATION=$7 CONFIGURATION=$7
CANARY=$8 CANARY=$8
if [[ "$(uname)" == "Darwin" ]]; then
echo "Clearing xattr on all dot undercsore files"
find "$BASE_DIR" -type f -name "._*" -exec sh -c '
for f; do
dir=$(dirname "$f")
base=$(basename "$f")
orig="$dir/${base#._}"
[ -f "$orig" ] && xattr -c "$orig" || true
done
' sh {} +
fi
if [ "$CANARY" == "1" ]; then if [ "$CANARY" == "1" ]; then
RELEASE_TAR_FILE_NAME=ryujinx-canary-$VERSION-macos_universal.app.tar RELEASE_TAR_FILE_NAME=ryujinx-canary-$VERSION-macos_universal.app.tar
elif [ "$VERSION" == "1.1.0" ]; then elif [ "$VERSION" == "1.1.0" ]; then

View File

@ -20,18 +20,6 @@ SOURCE_REVISION_ID=$6
CONFIGURATION=$7 CONFIGURATION=$7
CANARY=$8 CANARY=$8
if [[ "$(uname)" == "Darwin" ]]; then
echo "Clearing xattr on all dot undercsore files"
find "$BASE_DIR" -type f -name "._*" -exec sh -c '
for f; do
dir=$(dirname "$f")
base=$(basename "$f")
orig="$dir/${base#._}"
[ -f "$orig" ] && xattr -c "$orig" || true
done
' sh {} +
fi
if [ "$CANARY" == "1" ]; then if [ "$CANARY" == "1" ]; then
RELEASE_TAR_FILE_NAME=nogui-ryujinx-canary-$VERSION-macos_universal.tar RELEASE_TAR_FILE_NAME=nogui-ryujinx-canary-$VERSION-macos_universal.tar
elif [ "$VERSION" == "1.1.0" ]; then elif [ "$VERSION" == "1.1.0" ]; then

View File

@ -601,7 +601,6 @@
010060200A4BE000,"Brawlout",ldn-untested;online,playable,2021-06-04 17:35:35 010060200A4BE000,"Brawlout",ldn-untested;online,playable,2021-06-04 17:35:35
0100C1B00E1CA000,"Brawlout Demo",demo,playable,2021-02-13 22:46:53 0100C1B00E1CA000,"Brawlout Demo",demo,playable,2021-02-13 22:46:53
010022C016DC8000,"Breakout: Recharged",slow,ingame,2022-11-06 15:32:57 010022C016DC8000,"Breakout: Recharged",slow,ingame,2022-11-06 15:32:57
010048A021C40000,"Breakout Beyond",,playable,2025-04-26 19:11:35
01000AA013A5E000,"Breathedge",UE4;nvdec,playable,2021-05-06 15:44:28 01000AA013A5E000,"Breathedge",UE4;nvdec,playable,2021-05-06 15:44:28
01003D50100F4000,"Breathing Fear",,playable,2020-07-14 15:12:29 01003D50100F4000,"Breathing Fear",,playable,2020-07-14 15:12:29
010026800BB06000,"Brick Breaker",nvdec;online,playable,2020-12-15 18:26:23 010026800BB06000,"Brick Breaker",nvdec;online,playable,2020-12-15 18:26:23
@ -1125,7 +1124,6 @@
0100034012606000,"Family Mysteries: Poisonous Promises",audio;crash,menus,2021-11-26 12:35:06 0100034012606000,"Family Mysteries: Poisonous Promises",audio;crash,menus,2021-11-26 12:35:06
010017C012726000,"Fantasy Friends",,playable,2022-10-17 19:42:39 010017C012726000,"Fantasy Friends",,playable,2022-10-17 19:42:39
0100767008502000,"FANTASY HERO unsigned legacy",,playable,2022-07-26 12:28:52 0100767008502000,"FANTASY HERO unsigned legacy",,playable,2022-07-26 12:28:52
0100755017EE0000,"FANTASY LIFE i: The Girl Who Steals Time",gpu;crash;vulkan-backend-bug,ingame,2025-06-08 20:41:00
0100944003820000,"Fantasy Strike",online,playable,2021-02-27 01:59:18 0100944003820000,"Fantasy Strike",online,playable,2021-02-27 01:59:18
01000E2012F6E000,"Fantasy Tavern Sextet -Vol.1 New World Days-",gpu;crash;Needs Update,ingame,2022-12-05 16:48:00 01000E2012F6E000,"Fantasy Tavern Sextet -Vol.1 New World Days-",gpu;crash;Needs Update,ingame,2022-12-05 16:48:00
01005C10136CA000,"Fantasy Tavern Sextet -Vol.2 Adventurer's Days-",gpu;slow;crash,ingame,2021-11-06 02:57:29 01005C10136CA000,"Fantasy Tavern Sextet -Vol.2 Adventurer's Days-",gpu;slow;crash,ingame,2021-11-06 02:57:29
@ -2030,7 +2028,6 @@
0100628004BCE000,"Nights of Azure 2: Bride of the New Moon",crash;nvdec;regression,menus,2022-11-24 16:00:39 0100628004BCE000,"Nights of Azure 2: Bride of the New Moon",crash;nvdec;regression,menus,2022-11-24 16:00:39
010042300C4F6000,"Nightshade百花百狼",nvdec,playable,2020-05-10 19:43:31 010042300C4F6000,"Nightshade百花百狼",nvdec,playable,2020-05-10 19:43:31
0100AA0008736000,"Nihilumbra",,playable,2020-05-10 16:00:12 0100AA0008736000,"Nihilumbra",,playable,2020-05-10 16:00:12
01009FA01FF6C000,"Nikoderiko: The Magical World",gpu,ingame,2025-04-26 19:13:31
0100D03003F0E000,"Nine Parchments",ldn-untested,playable,2022-08-07 12:32:08 0100D03003F0E000,"Nine Parchments",ldn-untested,playable,2022-08-07 12:32:08
0100E2F014F46000,"NINJA GAIDEN Σ",nvdec,playable,2022-11-13 16:27:02 0100E2F014F46000,"NINJA GAIDEN Σ",nvdec,playable,2022-11-13 16:27:02
0100696014F4A000,"NINJA GAIDEN Σ2",nvdec,playable,2024-07-31 21:53:48 0100696014F4A000,"NINJA GAIDEN Σ2",nvdec,playable,2024-07-31 21:53:48
@ -2746,7 +2743,6 @@
01005D701264A000,"SpyHack",,playable,2021-04-15 10:53:51 01005D701264A000,"SpyHack",,playable,2021-04-15 10:53:51
010077B00E046000,"Spyro™ Reignited Trilogy",nvdec;UE4,playable,2022-09-11 18:38:33 010077B00E046000,"Spyro™ Reignited Trilogy",nvdec;UE4,playable,2022-09-11 18:38:33
0100085012A0E000,"Squeakers",,playable,2020-12-13 12:13:05 0100085012A0E000,"Squeakers",,playable,2020-12-13 12:13:05
0100E1D01EB2E000,"Squeakross: Home Squeak Home",,playable,2025-06-16 02:02:00
010009300D31C000,"Squidgies Takeover",,playable,2020-07-20 22:28:08 010009300D31C000,"Squidgies Takeover",,playable,2020-07-20 22:28:08
0100FCD0102EC000,"Squidlit",,playable,2020-08-06 12:38:32 0100FCD0102EC000,"Squidlit",,playable,2020-08-06 12:38:32
0100EBF00E702000,"STAR OCEAN First Departure R",nvdec,playable,2021-07-05 19:29:16 0100EBF00E702000,"STAR OCEAN First Departure R",nvdec,playable,2021-07-05 19:29:16

1 title_id game_name labels status last_updated
601 010060200A4BE000 Brawlout ldn-untested;online playable 2021-06-04 17:35:35
602 0100C1B00E1CA000 Brawlout Demo demo playable 2021-02-13 22:46:53
603 010022C016DC8000 Breakout: Recharged slow ingame 2022-11-06 15:32:57
010048A021C40000 Breakout Beyond playable 2025-04-26 19:11:35
604 01000AA013A5E000 Breathedge UE4;nvdec playable 2021-05-06 15:44:28
605 01003D50100F4000 Breathing Fear playable 2020-07-14 15:12:29
606 010026800BB06000 Brick Breaker nvdec;online playable 2020-12-15 18:26:23
1124 0100034012606000 Family Mysteries: Poisonous Promises audio;crash menus 2021-11-26 12:35:06
1125 010017C012726000 Fantasy Friends playable 2022-10-17 19:42:39
1126 0100767008502000 FANTASY HERO ~unsigned legacy~ playable 2022-07-26 12:28:52
0100755017EE0000 FANTASY LIFE i: The Girl Who Steals Time gpu;crash;vulkan-backend-bug ingame 2025-06-08 20:41:00
1127 0100944003820000 Fantasy Strike online playable 2021-02-27 01:59:18
1128 01000E2012F6E000 Fantasy Tavern Sextet -Vol.1 New World Days- gpu;crash;Needs Update ingame 2022-12-05 16:48:00
1129 01005C10136CA000 Fantasy Tavern Sextet -Vol.2 Adventurer's Days- gpu;slow;crash ingame 2021-11-06 02:57:29
2028 0100628004BCE000 Nights of Azure 2: Bride of the New Moon crash;nvdec;regression menus 2022-11-24 16:00:39
2029 010042300C4F6000 Nightshade/百花百狼 nvdec playable 2020-05-10 19:43:31
2030 0100AA0008736000 Nihilumbra playable 2020-05-10 16:00:12
01009FA01FF6C000 Nikoderiko: The Magical World gpu ingame 2025-04-26 19:13:31
2031 0100D03003F0E000 Nine Parchments ldn-untested playable 2022-08-07 12:32:08
2032 0100E2F014F46000 NINJA GAIDEN Σ nvdec playable 2022-11-13 16:27:02
2033 0100696014F4A000 NINJA GAIDEN Σ2 nvdec playable 2024-07-31 21:53:48
2743 01005D701264A000 SpyHack playable 2021-04-15 10:53:51
2744 010077B00E046000 Spyro™ Reignited Trilogy nvdec;UE4 playable 2022-09-11 18:38:33
2745 0100085012A0E000 Squeakers playable 2020-12-13 12:13:05
0100E1D01EB2E000 Squeakross: Home Squeak Home playable 2025-06-16 02:02:00
2746 010009300D31C000 Squidgies Takeover playable 2020-07-20 22:28:08
2747 0100FCD0102EC000 Squidlit playable 2020-08-06 12:38:32
2748 0100EBF00E702000 STAR OCEAN First Departure R nvdec playable 2021-07-05 19:29:16

View File

@ -1,23 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<packageSources> <packageSources>
<clear /> <clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- Only needed when using pre-release versions of Ryujinx.LibHac. --> </packageSources>
<!--<add key="LibHacAlpha" value="https://git.ryujinx.app/api/v4/projects/17/packages/nuget/index.json" />-->
<add key="Ryujinx.UpdateClient" value="https://git.ryujinx.app/api/v4/projects/71/packages/nuget/index.json" />
</packageSources>
<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="Ryujinx.UpdateClient">
<package pattern="Ryujinx.UpdateClient" />
</packageSource>
<!--<packageSource key="LibHacAlpha">
<package pattern="Ryujinx.LibHac" />
</packageSource>-->
</packageSourceMapping>
</configuration> </configuration>

View File

@ -3,10 +3,10 @@
<PropertyGroup> <PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
<ProjectReference Include="..\Ryujinx.Memory\Ryujinx.Memory.csproj" /> <ProjectReference Include="..\Ryujinx.Memory\Ryujinx.Memory.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -254,7 +254,7 @@ namespace ARMeilleure.CodeGen.Arm64
private static bool IsMemoryLoadOrStore(Instruction inst) private static bool IsMemoryLoadOrStore(Instruction inst)
{ {
return inst is Instruction.Load or Instruction.Store; return inst == Instruction.Load || inst == Instruction.Store;
} }
private static bool ConstTooLong(Operand constOp, OperandType accessType) private static bool ConstTooLong(Operand constOp, OperandType accessType)

View File

@ -774,7 +774,6 @@ namespace ARMeilleure.CodeGen.Arm64
instI |= 1 << 22; // sh flag instI |= 1 << 22; // sh flag
imm >>= 12; imm >>= 12;
} }
WriteInstructionAuto(instI | (EncodeUImm12(imm, 0) << 10), rd, rn); WriteInstructionAuto(instI | (EncodeUImm12(imm, 0) << 10), rd, rn);
} }
else else

View File

@ -52,7 +52,7 @@ namespace ARMeilleure.CodeGen.Arm64
// Any value AND all ones will be equal itself, so it's effectively a no-op. // Any value AND all ones will be equal itself, so it's effectively a no-op.
// Any value OR all ones will be equal all ones, so one can just use MOV. // Any value OR all ones will be equal all ones, so one can just use MOV.
// Any value XOR all ones will be equal its inverse, so one can just use MVN. // Any value XOR all ones will be equal its inverse, so one can just use MVN.
if (value is 0 or ulong.MaxValue) if (value == 0 || value == ulong.MaxValue)
{ {
immN = 0; immN = 0;
immS = 0; immS = 0;

View File

@ -1,7 +1,6 @@
using ARMeilleure.CodeGen.Linking; using ARMeilleure.CodeGen.Linking;
using ARMeilleure.CodeGen.RegisterAllocators; using ARMeilleure.CodeGen.RegisterAllocators;
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using Microsoft.IO;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -15,7 +14,7 @@ namespace ARMeilleure.CodeGen.Arm64
private const int CbnzInstLength = 4; private const int CbnzInstLength = 4;
private const int LdrLitInstLength = 4; private const int LdrLitInstLength = 4;
private readonly RecyclableMemoryStream _stream; private readonly Stream _stream;
public int StreamOffset => (int)_stream.Length; public int StreamOffset => (int)_stream.Length;

View File

@ -189,8 +189,8 @@ namespace ARMeilleure.CodeGen.Arm64
// The only blocks which can have 0 successors are exit blocks. // The only blocks which can have 0 successors are exit blocks.
Operation last = block.Operations.Last; Operation last = block.Operations.Last;
Debug.Assert(last.Instruction is Instruction.Tailcall or Debug.Assert(last.Instruction == Instruction.Tailcall ||
Instruction.Return); last.Instruction == Instruction.Return);
} }
else else
{ {
@ -464,7 +464,7 @@ namespace ARMeilleure.CodeGen.Arm64
Operand dest = operation.Destination; Operand dest = operation.Destination;
Operand source = operation.GetSource(0); Operand source = operation.GetSource(0);
Debug.Assert(dest.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(dest.Type == OperandType.FP32 || dest.Type == OperandType.FP64);
Debug.Assert(dest.Type != source.Type); Debug.Assert(dest.Type != source.Type);
Debug.Assert(source.Type != OperandType.V128); Debug.Assert(source.Type != OperandType.V128);
@ -483,7 +483,7 @@ namespace ARMeilleure.CodeGen.Arm64
Operand dest = operation.Destination; Operand dest = operation.Destination;
Operand source = operation.GetSource(0); Operand source = operation.GetSource(0);
Debug.Assert(dest.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(dest.Type == OperandType.FP32 || dest.Type == OperandType.FP64);
Debug.Assert(dest.Type != source.Type); Debug.Assert(dest.Type != source.Type);
Debug.Assert(source.Type.IsInteger()); Debug.Assert(source.Type.IsInteger());
@ -1463,7 +1463,7 @@ namespace ARMeilleure.CodeGen.Arm64
private static bool IsLoadOrStore(Operation operation) private static bool IsLoadOrStore(Operation operation)
{ {
return operation.Instruction is Instruction.Load or Instruction.Store; return operation.Instruction == Instruction.Load || operation.Instruction == Instruction.Store;
} }
private static OperandType GetMemOpValueType(Operation operation) private static OperandType GetMemOpValueType(Operation operation)
@ -1499,7 +1499,6 @@ namespace ARMeilleure.CodeGen.Arm64
return false; return false;
} }
} }
if (memOp.Index != default) if (memOp.Index != default)
{ {
return false; return false;
@ -1554,7 +1553,7 @@ namespace ARMeilleure.CodeGen.Arm64
private static void EnsureSameReg(Operand op1, Operand op2) private static void EnsureSameReg(Operand op1, Operand op2)
{ {
Debug.Assert(op1.Kind is OperandKind.Register or OperandKind.Memory); Debug.Assert(op1.Kind == OperandKind.Register || op1.Kind == OperandKind.Memory);
Debug.Assert(op1.Kind == op2.Kind); Debug.Assert(op1.Kind == op2.Kind);
Debug.Assert(op1.Value == op2.Value); Debug.Assert(op1.Value == op2.Value);
} }

View File

@ -509,6 +509,7 @@ namespace ARMeilleure.CodeGen.Arm64
context.Assembler.WriteInstruction(instruction, rd, rn); context.Assembler.WriteInstruction(instruction, rd, rn);
} }
} }
private static void GenerateScalarTernary( private static void GenerateScalarTernary(

View File

@ -137,7 +137,6 @@ namespace ARMeilleure.CodeGen.Arm64
{ {
return val != 0; return val != 0;
} }
return false; return false;
} }

View File

@ -736,19 +736,19 @@ namespace ARMeilleure.CodeGen.Arm64
{ {
IntrinsicInfo info = IntrinsicTable.GetInfo(intrinsic & ~(Intrinsic.Arm64VTypeMask | Intrinsic.Arm64VSizeMask)); IntrinsicInfo info = IntrinsicTable.GetInfo(intrinsic & ~(Intrinsic.Arm64VTypeMask | Intrinsic.Arm64VSizeMask));
return info.Type is IntrinsicType.ScalarBinaryRd or return info.Type == IntrinsicType.ScalarBinaryRd ||
IntrinsicType.ScalarTernaryFPRdByElem or info.Type == IntrinsicType.ScalarTernaryFPRdByElem ||
IntrinsicType.ScalarTernaryShlRd or info.Type == IntrinsicType.ScalarTernaryShlRd ||
IntrinsicType.ScalarTernaryShrRd or info.Type == IntrinsicType.ScalarTernaryShrRd ||
IntrinsicType.Vector128BinaryRd or info.Type == IntrinsicType.Vector128BinaryRd ||
IntrinsicType.VectorBinaryRd or info.Type == IntrinsicType.VectorBinaryRd ||
IntrinsicType.VectorInsertByElem or info.Type == IntrinsicType.VectorInsertByElem ||
IntrinsicType.VectorTernaryRd or info.Type == IntrinsicType.VectorTernaryRd ||
IntrinsicType.VectorTernaryRdBitwise or info.Type == IntrinsicType.VectorTernaryRdBitwise ||
IntrinsicType.VectorTernaryFPRdByElem or info.Type == IntrinsicType.VectorTernaryFPRdByElem ||
IntrinsicType.VectorTernaryRdByElem or info.Type == IntrinsicType.VectorTernaryRdByElem ||
IntrinsicType.VectorTernaryShlRd or info.Type == IntrinsicType.VectorTernaryShlRd ||
IntrinsicType.VectorTernaryShrRd; info.Type == IntrinsicType.VectorTernaryShrRd;
} }
private static bool HasConstSrc1(Operation node, ulong value) private static bool HasConstSrc1(Operation node, ulong value)
@ -849,7 +849,7 @@ namespace ARMeilleure.CodeGen.Arm64
Comparison compType = (Comparison)comp.AsInt32(); Comparison compType = (Comparison)comp.AsInt32();
return compType is Comparison.Equal or Comparison.NotEqual; return compType == Comparison.Equal || compType == Comparison.NotEqual;
} }
} }
@ -871,9 +871,9 @@ namespace ARMeilleure.CodeGen.Arm64
IntrinsicInfo info = IntrinsicTable.GetInfo(intrinsic & ~(Intrinsic.Arm64VTypeMask | Intrinsic.Arm64VSizeMask)); IntrinsicInfo info = IntrinsicTable.GetInfo(intrinsic & ~(Intrinsic.Arm64VTypeMask | Intrinsic.Arm64VSizeMask));
// Those have integer inputs that don't support consts. // Those have integer inputs that don't support consts.
return info.Type is not IntrinsicType.ScalarFPConvGpr and return info.Type != IntrinsicType.ScalarFPConvGpr &&
not IntrinsicType.ScalarFPConvFixedGpr and info.Type != IntrinsicType.ScalarFPConvFixedGpr &&
not IntrinsicType.SetRegister; info.Type != IntrinsicType.SetRegister;
} }
return false; return false;

View File

@ -37,7 +37,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x + y); EvaluateBinaryI64(operation, (x, y) => x + y);
} }
break; break;
case Instruction.BitwiseAnd: case Instruction.BitwiseAnd:
@ -49,7 +48,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x & y); EvaluateBinaryI64(operation, (x, y) => x & y);
} }
break; break;
case Instruction.BitwiseExclusiveOr: case Instruction.BitwiseExclusiveOr:
@ -61,7 +59,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x ^ y); EvaluateBinaryI64(operation, (x, y) => x ^ y);
} }
break; break;
case Instruction.BitwiseNot: case Instruction.BitwiseNot:
@ -73,7 +70,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => ~x); EvaluateUnaryI64(operation, (x) => ~x);
} }
break; break;
case Instruction.BitwiseOr: case Instruction.BitwiseOr:
@ -85,7 +81,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x | y); EvaluateBinaryI64(operation, (x, y) => x | y);
} }
break; break;
case Instruction.ConvertI64ToI32: case Instruction.ConvertI64ToI32:
@ -93,7 +88,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI32(operation, (x) => x); EvaluateUnaryI32(operation, (x) => x);
} }
break; break;
case Instruction.Compare: case Instruction.Compare:
@ -135,7 +129,6 @@ namespace ARMeilleure.CodeGen.Optimizations
break; break;
} }
} }
break; break;
case Instruction.Copy: case Instruction.Copy:
@ -147,7 +140,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => x); EvaluateUnaryI64(operation, (x) => x);
} }
break; break;
case Instruction.Divide: case Instruction.Divide:
@ -159,7 +151,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => y != 0 ? x / y : 0); EvaluateBinaryI64(operation, (x, y) => y != 0 ? x / y : 0);
} }
break; break;
case Instruction.DivideUI: case Instruction.DivideUI:
@ -171,7 +162,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => y != 0 ? (long)((ulong)x / (ulong)y) : 0); EvaluateBinaryI64(operation, (x, y) => y != 0 ? (long)((ulong)x / (ulong)y) : 0);
} }
break; break;
case Instruction.Multiply: case Instruction.Multiply:
@ -183,7 +173,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x * y); EvaluateBinaryI64(operation, (x, y) => x * y);
} }
break; break;
case Instruction.Negate: case Instruction.Negate:
@ -195,7 +184,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => -x); EvaluateUnaryI64(operation, (x) => -x);
} }
break; break;
case Instruction.ShiftLeft: case Instruction.ShiftLeft:
@ -207,7 +195,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x << (int)y); EvaluateBinaryI64(operation, (x, y) => x << (int)y);
} }
break; break;
case Instruction.ShiftRightSI: case Instruction.ShiftRightSI:
@ -219,7 +206,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x >> (int)y); EvaluateBinaryI64(operation, (x, y) => x >> (int)y);
} }
break; break;
case Instruction.ShiftRightUI: case Instruction.ShiftRightUI:
@ -231,7 +217,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => (long)((ulong)x >> (int)y)); EvaluateBinaryI64(operation, (x, y) => (long)((ulong)x >> (int)y));
} }
break; break;
case Instruction.SignExtend16: case Instruction.SignExtend16:
@ -243,7 +228,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (short)x); EvaluateUnaryI64(operation, (x) => (short)x);
} }
break; break;
case Instruction.SignExtend32: case Instruction.SignExtend32:
@ -255,7 +239,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (int)x); EvaluateUnaryI64(operation, (x) => (int)x);
} }
break; break;
case Instruction.SignExtend8: case Instruction.SignExtend8:
@ -267,7 +250,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (sbyte)x); EvaluateUnaryI64(operation, (x) => (sbyte)x);
} }
break; break;
case Instruction.ZeroExtend16: case Instruction.ZeroExtend16:
@ -279,7 +261,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (ushort)x); EvaluateUnaryI64(operation, (x) => (ushort)x);
} }
break; break;
case Instruction.ZeroExtend32: case Instruction.ZeroExtend32:
@ -291,7 +272,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (uint)x); EvaluateUnaryI64(operation, (x) => (uint)x);
} }
break; break;
case Instruction.ZeroExtend8: case Instruction.ZeroExtend8:
@ -303,7 +283,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateUnaryI64(operation, (x) => (byte)x); EvaluateUnaryI64(operation, (x) => (byte)x);
} }
break; break;
case Instruction.Subtract: case Instruction.Subtract:
@ -315,7 +294,6 @@ namespace ARMeilleure.CodeGen.Optimizations
{ {
EvaluateBinaryI64(operation, (x, y) => x - y); EvaluateBinaryI64(operation, (x, y) => x - y);
} }
break; break;
} }
} }

View File

@ -227,11 +227,11 @@ namespace ARMeilleure.CodeGen.Optimizations
private static bool HasSideEffects(Operation node) private static bool HasSideEffects(Operation node)
{ {
return node.Instruction is Instruction.Call return node.Instruction == Instruction.Call
or Instruction.Tailcall || node.Instruction == Instruction.Tailcall
or Instruction.CompareAndSwap || node.Instruction == Instruction.CompareAndSwap
or Instruction.CompareAndSwap16 || node.Instruction == Instruction.CompareAndSwap16
or Instruction.CompareAndSwap8; || node.Instruction == Instruction.CompareAndSwap8;
} }
private static bool IsPropagableCompare(Operation operation) private static bool IsPropagableCompare(Operation operation)

View File

@ -847,7 +847,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
// If this is a copy (or copy-like operation), set the copy source interval as well. // If this is a copy (or copy-like operation), set the copy source interval as well.
// This is used for register preferencing later on, which allows the copy to be eliminated // This is used for register preferencing later on, which allows the copy to be eliminated
// in some cases. // in some cases.
if (node.Instruction is Instruction.Copy or Instruction.ZeroExtend32) if (node.Instruction == Instruction.Copy || node.Instruction == Instruction.ZeroExtend32)
{ {
Operand source = node.GetSource(0); Operand source = node.GetSource(0);
@ -1120,8 +1120,8 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
private static bool IsLocalOrRegister(OperandKind kind) private static bool IsLocalOrRegister(OperandKind kind)
{ {
return kind is OperandKind.LocalVariable or return kind == OperandKind.LocalVariable ||
OperandKind.Register; kind == OperandKind.Register;
} }
} }
} }

View File

@ -1478,7 +1478,7 @@ namespace ARMeilleure.CodeGen.X86
private static bool Is64Bits(OperandType type) private static bool Is64Bits(OperandType type)
{ {
return type is OperandType.I64 or OperandType.FP64; return type == OperandType.I64 || type == OperandType.FP64;
} }
private static bool IsImm8(ulong immediate, OperandType type) private static bool IsImm8(ulong immediate, OperandType type)

View File

@ -13,6 +13,7 @@ namespace ARMeilleure.CodeGen.X86
private const int BadOp = 0; private const int BadOp = 0;
[Flags] [Flags]
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
private enum InstructionFlags private enum InstructionFlags
{ {
None = 0, None = 0,

View File

@ -1,6 +1,5 @@
using ARMeilleure.CodeGen.RegisterAllocators; using ARMeilleure.CodeGen.RegisterAllocators;
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using Microsoft.IO;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using System.IO; using System.IO;
using System.Numerics; using System.Numerics;
@ -9,7 +8,7 @@ namespace ARMeilleure.CodeGen.X86
{ {
class CodeGenContext class CodeGenContext
{ {
private readonly RecyclableMemoryStream _stream; private readonly Stream _stream;
private readonly Operand[] _blockLabels; private readonly Operand[] _blockLabels;
public int StreamOffset => (int)_stream.Length; public int StreamOffset => (int)_stream.Length;

View File

@ -175,8 +175,8 @@ namespace ARMeilleure.CodeGen.X86
// The only blocks which can have 0 successors are exit blocks. // The only blocks which can have 0 successors are exit blocks.
Operation last = block.Operations.Last; Operation last = block.Operations.Last;
Debug.Assert(last.Instruction is Instruction.Tailcall or Debug.Assert(last.Instruction == Instruction.Tailcall ||
Instruction.Return); last.Instruction == Instruction.Return);
} }
else else
{ {
@ -478,7 +478,7 @@ namespace ARMeilleure.CodeGen.X86
Debug.Assert(HardwareCapabilities.SupportsVexEncoding); Debug.Assert(HardwareCapabilities.SupportsVexEncoding);
Debug.Assert(dest.Kind == OperandKind.Register && src1.Kind == OperandKind.Register && src2.Kind == OperandKind.Register); Debug.Assert(dest.Kind == OperandKind.Register && src1.Kind == OperandKind.Register && src2.Kind == OperandKind.Register);
Debug.Assert(src3.Kind is OperandKind.Register or OperandKind.Memory); Debug.Assert(src3.Kind == OperandKind.Register || src3.Kind == OperandKind.Memory);
EnsureSameType(dest, src1, src2, src3); EnsureSameType(dest, src1, src2, src3);
Debug.Assert(dest.Type == OperandType.V128); Debug.Assert(dest.Type == OperandType.V128);
@ -788,7 +788,7 @@ namespace ARMeilleure.CodeGen.X86
Operand dest = operation.Destination; Operand dest = operation.Destination;
Operand source = operation.GetSource(0); Operand source = operation.GetSource(0);
Debug.Assert(dest.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(dest.Type == OperandType.FP32 || dest.Type == OperandType.FP64);
if (dest.Type == OperandType.FP32) if (dest.Type == OperandType.FP32)
{ {
@ -1723,7 +1723,7 @@ namespace ARMeilleure.CodeGen.X86
return; return;
} }
Debug.Assert(op1.Kind is OperandKind.Register or OperandKind.Memory); Debug.Assert(op1.Kind == OperandKind.Register || op1.Kind == OperandKind.Memory);
Debug.Assert(op1.Kind == op2.Kind); Debug.Assert(op1.Kind == op2.Kind);
Debug.Assert(op1.Value == op2.Value); Debug.Assert(op1.Value == op2.Value);
} }

View File

@ -66,7 +66,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
PreAllocatorSystemV.InsertCallCopies(block.Operations, node); PreAllocatorSystemV.InsertCallCopies(block.Operations, node);
} }
break; break;
case Instruction.ConvertToFPUI: case Instruction.ConvertToFPUI:
@ -82,7 +81,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
nextNode = PreAllocatorSystemV.InsertLoadArgumentCopy(cctx, ref buffer, block.Operations, preservedArgs, node); nextNode = PreAllocatorSystemV.InsertLoadArgumentCopy(cctx, ref buffer, block.Operations, preservedArgs, node);
} }
break; break;
case Instruction.Negate: case Instruction.Negate:
@ -90,7 +88,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
GenerateNegate(block.Operations, node); GenerateNegate(block.Operations, node);
} }
break; break;
case Instruction.Return: case Instruction.Return:
@ -102,7 +99,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
PreAllocatorSystemV.InsertReturnCopy(block.Operations, node); PreAllocatorSystemV.InsertReturnCopy(block.Operations, node);
} }
break; break;
case Instruction.Tailcall: case Instruction.Tailcall:
@ -114,7 +110,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
PreAllocatorSystemV.InsertTailcallCopies(block.Operations, node); PreAllocatorSystemV.InsertTailcallCopies(block.Operations, node);
} }
break; break;
case Instruction.VectorInsert8: case Instruction.VectorInsert8:
@ -122,7 +117,6 @@ namespace ARMeilleure.CodeGen.X86
{ {
GenerateVectorInsert8(block.Operations, node); GenerateVectorInsert8(block.Operations, node);
} }
break; break;
case Instruction.Extended: case Instruction.Extended:
@ -138,7 +132,6 @@ namespace ARMeilleure.CodeGen.X86
node.SetSources([Const(stackOffset)]); node.SetSources([Const(stackOffset)]);
} }
break; break;
} }
} }
@ -319,9 +312,9 @@ namespace ARMeilleure.CodeGen.X86
case Instruction.Extended: case Instruction.Extended:
{ {
bool isBlend = node.Intrinsic is Intrinsic.X86Blendvpd or bool isBlend = node.Intrinsic == Intrinsic.X86Blendvpd ||
Intrinsic.X86Blendvps or node.Intrinsic == Intrinsic.X86Blendvps ||
Intrinsic.X86Pblendvb; node.Intrinsic == Intrinsic.X86Pblendvb;
// BLENDVPD, BLENDVPS, PBLENDVB last operand is always implied to be XMM0 when VEX is not supported. // BLENDVPD, BLENDVPS, PBLENDVB last operand is always implied to be XMM0 when VEX is not supported.
// SHA256RNDS2 always has an implied XMM0 as a last operand. // SHA256RNDS2 always has an implied XMM0 as a last operand.
@ -520,8 +513,8 @@ namespace ARMeilleure.CodeGen.X86
Operand dest = node.Destination; Operand dest = node.Destination;
Operand source = node.GetSource(0); Operand source = node.GetSource(0);
Debug.Assert(dest.Type is OperandType.FP32 or Debug.Assert(dest.Type == OperandType.FP32 ||
OperandType.FP64, $"Invalid destination type \"{dest.Type}\"."); dest.Type == OperandType.FP64, $"Invalid destination type \"{dest.Type}\".");
Operation currentNode = node; Operation currentNode = node;
@ -768,7 +761,7 @@ namespace ARMeilleure.CodeGen.X86
Comparison compType = (Comparison)comp.AsInt32(); Comparison compType = (Comparison)comp.AsInt32();
return compType is Comparison.Equal or Comparison.NotEqual; return compType == Comparison.Equal || compType == Comparison.NotEqual;
} }
} }

View File

@ -248,12 +248,12 @@ namespace ARMeilleure.CodeGen.X86
private static bool IsMemoryLoadOrStore(Instruction inst) private static bool IsMemoryLoadOrStore(Instruction inst)
{ {
return inst is Instruction.Load or return inst == Instruction.Load ||
Instruction.Load16 or inst == Instruction.Load16 ||
Instruction.Load8 or inst == Instruction.Load8 ||
Instruction.Store or inst == Instruction.Store ||
Instruction.Store16 or inst == Instruction.Store16 ||
Instruction.Store8; inst == Instruction.Store8;
} }
} }
} }

View File

@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.CodeGen.X86 namespace ARMeilleure.CodeGen.X86
{ {
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
enum X86Register enum X86Register
{ {
Invalid = -1, Invalid = -1,

View File

@ -254,8 +254,8 @@ namespace ARMeilleure.Decoders
} }
// Compare and branch instructions are always conditional. // Compare and branch instructions are always conditional.
if (opCode.Instruction.Name is InstName.Cbz or if (opCode.Instruction.Name == InstName.Cbz ||
InstName.Cbnz) opCode.Instruction.Name == InstName.Cbnz)
{ {
return false; return false;
} }
@ -274,10 +274,9 @@ namespace ARMeilleure.Decoders
{ {
if (opCode is OpCodeT32) if (opCode is OpCodeT32)
{ {
return opCode.Instruction.Name is not InstName.Tst and not InstName.Teq and return opCode.Instruction.Name != InstName.Tst && opCode.Instruction.Name != InstName.Teq &&
not InstName.Cmp and not InstName.Cmn; opCode.Instruction.Name != InstName.Cmp && opCode.Instruction.Name != InstName.Cmn;
} }
return true; return true;
} }
@ -285,7 +284,7 @@ namespace ARMeilleure.Decoders
// register (Rt == 15 or (mask & (1 << 15)) != 0), and cases where there is // register (Rt == 15 or (mask & (1 << 15)) != 0), and cases where there is
// a write back to PC (wback == true && Rn == 15), however the later may // a write back to PC (wback == true && Rn == 15), however the later may
// be "undefined" depending on the CPU, so compilers should not produce that. // be "undefined" depending on the CPU, so compilers should not produce that.
if (opCode is IOpCode32Mem or IOpCode32MemMult) if (opCode is IOpCode32Mem || opCode is IOpCode32MemMult)
{ {
int rt, rn; int rt, rn;
@ -327,15 +326,15 @@ namespace ARMeilleure.Decoders
} }
// Explicit branch instructions. // Explicit branch instructions.
return opCode is IOpCode32BImm or return opCode is IOpCode32BImm ||
IOpCode32BReg; opCode is IOpCode32BReg;
} }
private static bool IsCall(OpCode opCode) private static bool IsCall(OpCode opCode)
{ {
return opCode.Instruction.Name is InstName.Bl or return opCode.Instruction.Name == InstName.Bl ||
InstName.Blr or opCode.Instruction.Name == InstName.Blr ||
InstName.Blx; opCode.Instruction.Name == InstName.Blx;
} }
private static bool IsException(OpCode opCode) private static bool IsException(OpCode opCode)
@ -345,9 +344,9 @@ namespace ARMeilleure.Decoders
private static bool IsTrap(OpCode opCode) private static bool IsTrap(OpCode opCode)
{ {
return opCode.Instruction.Name is InstName.Brk or return opCode.Instruction.Name == InstName.Brk ||
InstName.Trap or opCode.Instruction.Name == InstName.Trap ||
InstName.Und; opCode.Instruction.Name == InstName.Und;
} }
public static OpCode DecodeOpCode(IMemoryManager memory, ulong address, ExecutionMode mode) public static OpCode DecodeOpCode(IMemoryManager memory, ulong address, ExecutionMode mode)

View File

@ -162,7 +162,6 @@ namespace ARMeilleure.Decoders
} }
} }
} }
return false; return false;
} }
} }

View File

@ -20,7 +20,6 @@ namespace ARMeilleure.Decoders
Instruction = InstDescriptor.Undefined; Instruction = InstDescriptor.Undefined;
return; return;
} }
Q = ((opCode >> 21) & 0x1) != 0; Q = ((opCode >> 21) & 0x1) != 0;
RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64; RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64;

View File

@ -40,7 +40,7 @@ namespace ARMeilleure.Decoders
Rn = (opCode >> 16) & 0xf; Rn = (opCode >> 16) & 0xf;
WBack = Rm != RegisterAlias.Aarch32Pc; WBack = Rm != RegisterAlias.Aarch32Pc;
RegisterIndex = Rm is not RegisterAlias.Aarch32Pc and not RegisterAlias.Aarch32Sp; RegisterIndex = Rm != RegisterAlias.Aarch32Pc && Rm != RegisterAlias.Aarch32Sp;
Regs = _regsMap[(opCode >> 8) & 0xf]; Regs = _regsMap[(opCode >> 8) & 0xf];

View File

@ -45,7 +45,7 @@ namespace ARMeilleure.Decoders
Rn = (opCode >> 16) & 0xf; Rn = (opCode >> 16) & 0xf;
WBack = Rm != RegisterAlias.Aarch32Pc; WBack = Rm != RegisterAlias.Aarch32Pc;
RegisterIndex = Rm is not RegisterAlias.Aarch32Pc and not RegisterAlias.Aarch32Sp; RegisterIndex = Rm != RegisterAlias.Aarch32Pc && Rm != RegisterAlias.Aarch32Sp;
} }
} }
} }

View File

@ -28,8 +28,8 @@ namespace ARMeilleure.Decoders
MemOp type = WBack ? (MemOp)((opCode >> 10) & 3) : MemOp.Unsigned; MemOp type = WBack ? (MemOp)((opCode >> 10) & 3) : MemOp.Unsigned;
PostIdx = type == MemOp.PostIndexed; PostIdx = type == MemOp.PostIndexed;
Unscaled = type is MemOp.Unscaled or Unscaled = type == MemOp.Unscaled ||
MemOp.Unprivileged; type == MemOp.Unprivileged;
// Unscaled and Unprivileged doesn't write back, // Unscaled and Unprivileged doesn't write back,
// but they do use the 9-bits Signed Immediate. // but they do use the 9-bits Signed Immediate.

View File

@ -1381,7 +1381,6 @@ namespace ARMeilleure.Decoders
{ {
thumbEncoding = $"1110{thumbEncoding.AsSpan(4)}"; thumbEncoding = $"1110{thumbEncoding.AsSpan(4)}";
} }
SetT32(thumbEncoding, name, emitter, makeOpT32); SetT32(thumbEncoding, name, emitter, makeOpT32);
} }
@ -1410,7 +1409,6 @@ namespace ARMeilleure.Decoders
{ {
throw new ArgumentException("Invalid ASIMD instruction encoding"); throw new ArgumentException("Invalid ASIMD instruction encoding");
} }
SetT32(thumbEncoding, name, emitter, makeOpT32); SetT32(thumbEncoding, name, emitter, makeOpT32);
} }

View File

@ -9,7 +9,7 @@ namespace ARMeilleure.Diagnostics
{ {
class IRDumper class IRDumper
{ {
private const char Indentation = ' '; private const string Indentation = " ";
private int _indentLevel; private int _indentLevel;
@ -30,11 +30,14 @@ namespace ARMeilleure.Diagnostics
private void Indent() private void Indent()
{ {
if (_indentLevel == 0) _builder.EnsureCapacity(_builder.Capacity + _indentLevel * Indentation.Length);
return;
_builder.EnsureCapacity(_builder.Capacity + _indentLevel); for (int index = 0; index < _indentLevel; index++)
_builder.Append(Indentation, _indentLevel); {
#pragma warning disable CA1834 // Use StringBuilder.Append(char) for single character strings
_builder.Append(Indentation);
#pragma warning restore CA1834
}
} }
private void IncreaseIndentation() private void IncreaseIndentation()
@ -232,8 +235,8 @@ namespace ARMeilleure.Diagnostics
{ {
_builder.Append('.').Append(operation.Intrinsic); _builder.Append('.').Append(operation.Intrinsic);
} }
else if (operation.Instruction is Instruction.BranchIf or else if (operation.Instruction == Instruction.BranchIf ||
Instruction.Compare) operation.Instruction == Instruction.Compare)
{ {
comparison = true; comparison = true;
} }
@ -259,7 +262,6 @@ namespace ARMeilleure.Diagnostics
DumpOperand(source); DumpOperand(source);
} }
} }
break; break;
} }

View File

@ -899,7 +899,6 @@ namespace ARMeilleure.Instructions
{ {
n = context.ShiftLeft(n, Const(shift)); n = context.ShiftLeft(n, Const(shift));
} }
break; break;
case ShiftType.Asr: case ShiftType.Asr:
if (shift == 32) if (shift == 32)
@ -910,7 +909,6 @@ namespace ARMeilleure.Instructions
{ {
n = context.ShiftRightSI(n, Const(shift)); n = context.ShiftRightSI(n, Const(shift));
} }
break; break;
} }

View File

@ -266,7 +266,7 @@ namespace ARMeilleure.Instructions
} }
} }
private static InvalidOperationException InvalidOpCodeType(OpCode opCode) private static Exception InvalidOpCodeType(OpCode opCode)
{ {
return new InvalidOperationException($"Invalid OpCode type \"{opCode?.GetType().Name ?? "null"}\"."); return new InvalidOperationException($"Invalid OpCode type \"{opCode?.GetType().Name ?? "null"}\".");
} }
@ -318,7 +318,6 @@ namespace ARMeilleure.Instructions
{ {
m = GetRrxC(context, m, setCarry); m = GetRrxC(context, m, setCarry);
} }
break; break;
} }
} }

View File

@ -17,7 +17,7 @@ namespace ARMeilleure.Instructions
public static Operand EmitCrc32(ArmEmitterContext context, Operand crc, Operand value, int size, bool castagnoli) public static Operand EmitCrc32(ArmEmitterContext context, Operand crc, Operand value, int size, bool castagnoli)
{ {
Debug.Assert(crc.Type.IsInteger() && value.Type.IsInteger()); Debug.Assert(crc.Type.IsInteger() && value.Type.IsInteger());
Debug.Assert(size is >= 0 and < 4); Debug.Assert(size >= 0 && size < 4);
Debug.Assert((size < 3) || (value.Type == OperandType.I64)); Debug.Assert((size < 3) || (value.Type == OperandType.I64));
if (castagnoli && Optimizations.UseSse42) if (castagnoli && Optimizations.UseSse42)

View File

@ -90,7 +90,6 @@ namespace ARMeilleure.Instructions
{ {
value = context.ConvertI64ToI32(value); value = context.ConvertI64ToI32(value);
} }
Operand reg = Register(GetRegisterAlias(context.Mode, regIndex), RegisterType.Integer, OperandType.I32); Operand reg = Register(GetRegisterAlias(context.Mode, regIndex), RegisterType.Integer, OperandType.I32);
context.Copy(reg, value); context.Copy(reg, value);

View File

@ -140,7 +140,7 @@ namespace ARMeilleure.Instructions
if (pair) if (pair)
{ {
Debug.Assert(op.Size is 2 or 3, "Invalid size for pairwise store."); Debug.Assert(op.Size == 2 || op.Size == 3, "Invalid size for pairwise store.");
Operand t2 = GetIntOrZR(context, op.Rt2); Operand t2 = GetIntOrZR(context, op.Rt2);

View File

@ -42,7 +42,6 @@ namespace ARMeilleure.Instructions
{ {
context.Store(exValuePtr, Const(0UL)); context.Store(exValuePtr, Const(0UL));
} }
if (size < 4) if (size < 4)
{ {
context.Store(context.Add(exValuePtr, Const(exValuePtr.Type, 8L)), Const(0UL)); context.Store(context.Add(exValuePtr, Const(exValuePtr.Type, 8L)), Const(0UL));

View File

@ -59,7 +59,7 @@ namespace ARMeilleure.Instructions
{ {
Operand value = GetInt(context, rt); Operand value = GetInt(context, rt);
if (ext is Extension.Sx32 or Extension.Sx64) if (ext == Extension.Sx32 || ext == Extension.Sx64)
{ {
OperandType destType = ext == Extension.Sx64 ? OperandType.I64 : OperandType.I32; OperandType destType = ext == Extension.Sx64 ? OperandType.I64 : OperandType.I32;
@ -123,9 +123,9 @@ namespace ARMeilleure.Instructions
private static bool IsSimd(ArmEmitterContext context) private static bool IsSimd(ArmEmitterContext context)
{ {
return context.CurrOp is IOpCodeSimd and return context.CurrOp is IOpCodeSimd &&
not (OpCodeSimdMemMs or !(context.CurrOp is OpCodeSimdMemMs ||
OpCodeSimdMemSs); context.CurrOp is OpCodeSimdMemSs);
} }
public static Operand EmitReadInt(ArmEmitterContext context, Operand address, int size) public static Operand EmitReadInt(ArmEmitterContext context, Operand address, int size)
@ -717,7 +717,7 @@ namespace ARMeilleure.Instructions
}; };
} }
private static InvalidOperationException InvalidOpCodeType(OpCode opCode) private static Exception InvalidOpCodeType(OpCode opCode)
{ {
return new InvalidOperationException($"Invalid OpCode type \"{opCode?.GetType().Name ?? "null"}\"."); return new InvalidOperationException($"Invalid OpCode type \"{opCode?.GetType().Name ?? "null"}\".");
} }
@ -768,7 +768,6 @@ namespace ARMeilleure.Instructions
{ {
m = InstEmitAluHelper.GetRrxC(context, m, setCarry); m = InstEmitAluHelper.GetRrxC(context, m, setCarry);
} }
break; break;
} }
} }

View File

@ -33,6 +33,7 @@ namespace ARMeilleure.Instructions
public static void Umsubl(ArmEmitterContext context) => EmitMull(context, MullFlags.Subtract); public static void Umsubl(ArmEmitterContext context) => EmitMull(context, MullFlags.Subtract);
[Flags] [Flags]
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
private enum MullFlags private enum MullFlags
{ {
Subtract = 0, Subtract = 0,

View File

@ -5266,7 +5266,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitSse2Sll_128(ArmEmitterContext context, Operand op, int shift) private static Operand EmitSse2Sll_128(ArmEmitterContext context, Operand op, int shift)
{ {
// The upper part of op is assumed to be zero. // The upper part of op is assumed to be zero.
Debug.Assert(shift is >= 0 and < 64); Debug.Assert(shift >= 0 && shift < 64);
if (shift == 0) if (shift == 0)
{ {

View File

@ -231,12 +231,10 @@ namespace ARMeilleure.Instructions
{ {
result |= (long)((i >= end || i < start) ? 0x80 : b++) << (i * 8); result |= (long)((i >= end || i < start) ? 0x80 : b++) << (i * 8);
} }
for (int i = 8; i < 16; i++) for (int i = 8; i < 16; i++)
{ {
result2 |= (long)((i >= end || i < start) ? 0x80 : b++) << ((i - 8) * 8); result2 |= (long)((i >= end || i < start) ? 0x80 : b++) << ((i - 8) * 8);
} }
return (result2, result); return (result2, result);
} }
@ -263,7 +261,6 @@ namespace ARMeilleure.Instructions
nMaskHigh = nMaskLow + 0x0808080808080808L; nMaskHigh = nMaskLow + 0x0808080808080808L;
mMaskHigh = mMaskLow + 0x0808080808080808L; mMaskHigh = mMaskLow + 0x0808080808080808L;
} }
nMask = X86GetElements(context, nMaskHigh, nMaskLow); nMask = X86GetElements(context, nMaskHigh, nMaskLow);
mMask = X86GetElements(context, mMaskHigh, mMaskLow); mMask = X86GetElements(context, mMaskHigh, mMaskLow);
Operand nPart = context.AddIntrinsic(Intrinsic.X86Pshufb, n, nMask); Operand nPart = context.AddIntrinsic(Intrinsic.X86Pshufb, n, nMask);
@ -288,7 +285,6 @@ namespace ARMeilleure.Instructions
{ {
extract = EmitVectorExtractZx32(context, op.Qn, op.In + byteOff, op.Size); extract = EmitVectorExtractZx32(context, op.Qn, op.In + byteOff, op.Size);
} }
byteOff++; byteOff++;
res = EmitVectorInsert(context, res, extract, op.Id + index, op.Size); res = EmitVectorInsert(context, res, extract, op.Id + index, op.Size);
@ -1308,7 +1304,6 @@ namespace ARMeilleure.Instructions
case 2: case 2:
return context.AddIntrinsic(Intrinsic.X86Shufps, op1, op1, Const(1 | (0 << 2) | (3 << 4) | (2 << 6))); return context.AddIntrinsic(Intrinsic.X86Shufps, op1, op1, Const(1 | (0 << 2) | (3 << 4) | (2 << 6)));
} }
break; break;
case 2: case 2:
// Rev32 // Rev32
@ -1321,7 +1316,6 @@ namespace ARMeilleure.Instructions
mask = X86GetElements(context, 0x0d0c0f0e_09080b0aL, 0x05040706_01000302L); mask = X86GetElements(context, 0x0d0c0f0e_09080b0aL, 0x05040706_01000302L);
return context.AddIntrinsic(Intrinsic.X86Pshufb, op1, mask); return context.AddIntrinsic(Intrinsic.X86Pshufb, op1, mask);
} }
break; break;
case 1: case 1:
// Rev16 // Rev16
@ -1347,7 +1341,6 @@ namespace ARMeilleure.Instructions
case 3: case 3:
return context.ByteSwap(op1); return context.ByteSwap(op1);
} }
break; break;
case 1: case 1:
switch (op.Size) switch (op.Size)
@ -1362,7 +1355,6 @@ namespace ARMeilleure.Instructions
context.BitwiseOr(context.ShiftRightUI(context.BitwiseAnd(op1, Const(0x0000ffff00000000ul)), Const(16)), context.BitwiseOr(context.ShiftRightUI(context.BitwiseAnd(op1, Const(0x0000ffff00000000ul)), Const(16)),
context.ShiftLeft(context.BitwiseAnd(op1, Const(0x00000000ffff0000ul)), Const(16)))); context.ShiftLeft(context.BitwiseAnd(op1, Const(0x00000000ffff0000ul)), Const(16))));
} }
break; break;
case 2: case 2:
// Swap upper and lower halves. // Swap upper and lower halves.

View File

@ -1119,7 +1119,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, int size, bool signed) private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, int size, bool signed)
{ {
Debug.Assert(value.Type is OperandType.I32 or OperandType.I64); Debug.Assert(value.Type == OperandType.I32 || value.Type == OperandType.I64);
Debug.Assert((uint)size < 2); Debug.Assert((uint)size < 2);
OperandType type = size == 0 ? OperandType.FP32 : OperandType.FP64; OperandType type = size == 0 ? OperandType.FP32 : OperandType.FP64;
@ -1136,7 +1136,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitScalarFcvts(ArmEmitterContext context, Operand value, int fBits) private static Operand EmitScalarFcvts(ArmEmitterContext context, Operand value, int fBits)
{ {
Debug.Assert(value.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(value.Type == OperandType.FP32 || value.Type == OperandType.FP64);
value = EmitF2iFBitsMul(context, value, fBits); value = EmitF2iFBitsMul(context, value, fBits);
@ -1160,7 +1160,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitScalarFcvtu(ArmEmitterContext context, Operand value, int fBits) private static Operand EmitScalarFcvtu(ArmEmitterContext context, Operand value, int fBits)
{ {
Debug.Assert(value.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(value.Type == OperandType.FP32 || value.Type == OperandType.FP64);
value = EmitF2iFBitsMul(context, value, fBits); value = EmitF2iFBitsMul(context, value, fBits);
@ -1184,7 +1184,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitF2iFBitsMul(ArmEmitterContext context, Operand value, int fBits) private static Operand EmitF2iFBitsMul(ArmEmitterContext context, Operand value, int fBits)
{ {
Debug.Assert(value.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(value.Type == OperandType.FP32 || value.Type == OperandType.FP64);
if (fBits == 0) if (fBits == 0)
{ {
@ -1203,7 +1203,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitI2fFBitsMul(ArmEmitterContext context, Operand value, int fBits) private static Operand EmitI2fFBitsMul(ArmEmitterContext context, Operand value, int fBits)
{ {
Debug.Assert(value.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(value.Type == OperandType.FP32 || value.Type == OperandType.FP64);
if (fBits == 0) if (fBits == 0)
{ {

View File

@ -385,7 +385,6 @@ namespace ARMeilleure.Instructions
{ {
res = context.AddIntrinsic(Intrinsic.X86Cvtsd2ss, context.VectorZero(), res); res = context.AddIntrinsic(Intrinsic.X86Cvtsd2ss, context.VectorZero(), res);
} }
res = context.AddIntrinsic(Intrinsic.X86Vcvtps2ph, res, Const(X86GetRoundControl(FPRoundingMode.ToNearest))); res = context.AddIntrinsic(Intrinsic.X86Vcvtps2ph, res, Const(X86GetRoundControl(FPRoundingMode.ToNearest)));
res = context.VectorExtract16(res, 0); res = context.VectorExtract16(res, 0);
InsertScalar16(context, op.Vd, op.T, res); InsertScalar16(context, op.Vd, op.T, res);
@ -398,7 +397,6 @@ namespace ARMeilleure.Instructions
{ {
res = context.AddIntrinsic(Intrinsic.X86Cvtss2sd, context.VectorZero(), res); res = context.AddIntrinsic(Intrinsic.X86Cvtss2sd, context.VectorZero(), res);
} }
res = context.VectorExtract(op.Size == 1 ? OperandType.I64 : OperandType.I32, res, 0); res = context.VectorExtract(op.Size == 1 ? OperandType.I64 : OperandType.I32, res, 0);
InsertScalar(context, op.Vd, res); InsertScalar(context, op.Vd, res);
} }
@ -637,7 +635,7 @@ namespace ARMeilleure.Instructions
private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, OperandType type, bool signed) private static Operand EmitFPConvert(ArmEmitterContext context, Operand value, OperandType type, bool signed)
{ {
Debug.Assert(value.Type is OperandType.I32 or OperandType.I64); Debug.Assert(value.Type == OperandType.I32 || value.Type == OperandType.I64);
if (signed) if (signed)
{ {

View File

@ -363,7 +363,7 @@ namespace ARMeilleure.Instructions
public static Operand EmitCountSetBits8(ArmEmitterContext context, Operand op) // "size" is 8 (SIMD&FP Inst.). public static Operand EmitCountSetBits8(ArmEmitterContext context, Operand op) // "size" is 8 (SIMD&FP Inst.).
{ {
Debug.Assert(op.Type is OperandType.I32 or OperandType.I64); Debug.Assert(op.Type == OperandType.I32 || op.Type == OperandType.I64);
Operand op0 = context.Subtract(op, context.BitwiseAnd(context.ShiftRightUI(op, Const(1)), Const(op.Type, 0x55L))); Operand op0 = context.Subtract(op, context.BitwiseAnd(context.ShiftRightUI(op, Const(1)), Const(op.Type, 0x55L)));
@ -489,7 +489,7 @@ namespace ARMeilleure.Instructions
public static Operand EmitRoundByRMode(ArmEmitterContext context, Operand op) public static Operand EmitRoundByRMode(ArmEmitterContext context, Operand op)
{ {
Debug.Assert(op.Type is OperandType.FP32 or OperandType.FP64); Debug.Assert(op.Type == OperandType.FP32 || op.Type == OperandType.FP64);
Operand lbl1 = Label(); Operand lbl1 = Label();
Operand lbl2 = Label(); Operand lbl2 = Label();
@ -1676,7 +1676,7 @@ namespace ARMeilleure.Instructions
int eSize = 8 << size; int eSize = 8 << size;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand lbl1 = Label(); Operand lbl1 = Label();
Operand lblEnd = Label(); Operand lblEnd = Label();
@ -1709,7 +1709,7 @@ namespace ARMeilleure.Instructions
int eSize = 8 << size; int eSize = 8 << size;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand lblEnd = Label(); Operand lblEnd = Label();
@ -1735,7 +1735,7 @@ namespace ARMeilleure.Instructions
int eSizeDst = 8 << sizeDst; int eSizeDst = 8 << sizeDst;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSizeDst is 8 or 16 or 32); Debug.Assert(eSizeDst == 8 || eSizeDst == 16 || eSizeDst == 32);
Operand lbl1 = Label(); Operand lbl1 = Label();
Operand lblEnd = Label(); Operand lblEnd = Label();
@ -1768,7 +1768,7 @@ namespace ARMeilleure.Instructions
int eSizeDst = 8 << sizeDst; int eSizeDst = 8 << sizeDst;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSizeDst is 8 or 16 or 32); Debug.Assert(eSizeDst == 8 || eSizeDst == 16 || eSizeDst == 32);
Operand lblEnd = Label(); Operand lblEnd = Label();

View File

@ -31,7 +31,7 @@ namespace ARMeilleure.Instructions
{ {
Debug.Assert(type != OperandType.V128); Debug.Assert(type != OperandType.V128);
if (type is OperandType.FP64 or OperandType.I64) if (type == OperandType.FP64 || type == OperandType.I64)
{ {
// From dreg. // From dreg.
return context.VectorExtract(type, GetVecA32(reg >> 1), reg & 1); return context.VectorExtract(type, GetVecA32(reg >> 1), reg & 1);
@ -48,7 +48,7 @@ namespace ARMeilleure.Instructions
Debug.Assert(value.Type != OperandType.V128); Debug.Assert(value.Type != OperandType.V128);
Operand vec, insert; Operand vec, insert;
if (value.Type is OperandType.FP64 or OperandType.I64) if (value.Type == OperandType.FP64 || value.Type == OperandType.I64)
{ {
// From dreg. // From dreg.
vec = GetVecA32(reg >> 1); vec = GetVecA32(reg >> 1);
@ -71,7 +71,7 @@ namespace ARMeilleure.Instructions
public static void InsertScalar16(ArmEmitterContext context, int reg, bool top, Operand value) public static void InsertScalar16(ArmEmitterContext context, int reg, bool top, Operand value)
{ {
Debug.Assert(value.Type is OperandType.FP32 or OperandType.I32); Debug.Assert(value.Type == OperandType.FP32 || value.Type == OperandType.I32);
Operand vec, insert; Operand vec, insert;
vec = GetVecA32(reg >> 2); vec = GetVecA32(reg >> 2);
@ -880,7 +880,6 @@ namespace ARMeilleure.Instructions
{ {
res = EmitMoveDoubleWordToSide(context, res, side, op.Vd); res = EmitMoveDoubleWordToSide(context, res, side, op.Vd);
} }
res = EmitDoubleWordInsert(context, d, res, op.Vd); res = EmitDoubleWordInsert(context, d, res, op.Vd);
} }

View File

@ -146,7 +146,6 @@ namespace ARMeilleure.Instructions
{ {
res = EmitMoveDoubleWordToSide(context, res, side, op.Vd); res = EmitMoveDoubleWordToSide(context, res, side, op.Vd);
} }
res = EmitDoubleWordInsert(context, d, res, op.Vd); res = EmitDoubleWordInsert(context, d, res, op.Vd);
} }

View File

@ -268,7 +268,6 @@ namespace ARMeilleure.Instructions
{ {
m = context.BitwiseNot(m); m = context.BitwiseNot(m);
} }
return context.BitwiseExclusiveOr( return context.BitwiseExclusiveOr(
context.BitwiseAnd(m, context.BitwiseAnd(m,
context.BitwiseExclusiveOr(d, n)), d); context.BitwiseExclusiveOr(d, n)), d);

View File

@ -110,7 +110,6 @@ namespace ARMeilleure.Instructions
EmitStoreSimd(context, address, d >> 1, index, op.Size); EmitStoreSimd(context, address, d >> 1, index, op.Size);
} }
} }
offset += eBytes; offset += eBytes;
d += op.Increment; d += op.Increment;
} }

View File

@ -1634,7 +1634,7 @@ namespace ARMeilleure.Instructions
int eSize = 8 << size; int eSize = 8 << size;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand res = context.AllocateLocal(OperandType.I64); Operand res = context.AllocateLocal(OperandType.I64);
@ -1657,7 +1657,7 @@ namespace ARMeilleure.Instructions
int eSize = 8 << size; int eSize = 8 << size;
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand lblEnd = Label(); Operand lblEnd = Label();
@ -1732,7 +1732,7 @@ namespace ARMeilleure.Instructions
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(shiftLsB.Type == OperandType.I32); Debug.Assert(shiftLsB.Type == OperandType.I32);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand lbl1 = Label(); Operand lbl1 = Label();
Operand lblEnd = Label(); Operand lblEnd = Label();
@ -1769,7 +1769,7 @@ namespace ARMeilleure.Instructions
Debug.Assert(op.Type == OperandType.I64); Debug.Assert(op.Type == OperandType.I64);
Debug.Assert(shiftLsB.Type == OperandType.I32); Debug.Assert(shiftLsB.Type == OperandType.I32);
Debug.Assert(eSize is 8 or 16 or 32 or 64); Debug.Assert(eSize == 8 || eSize == 16 || eSize == 32 || eSize == 64);
Operand lbl1 = Label(); Operand lbl1 = Label();
Operand lbl2 = Label(); Operand lbl2 = Label();
@ -1813,7 +1813,6 @@ namespace ARMeilleure.Instructions
? EmitSignedSrcSatQ(context, shl, size, signedDst: true) ? EmitSignedSrcSatQ(context, shl, size, signedDst: true)
: EmitUnsignedSrcSatQ(context, shl, size, signedDst: false)); : EmitUnsignedSrcSatQ(context, shl, size, signedDst: false));
} }
context.Branch(lblEnd); context.Branch(lblEnd);
context.MarkLabel(lblEnd); context.MarkLabel(lblEnd);
@ -1851,7 +1850,6 @@ namespace ARMeilleure.Instructions
{ {
context.Copy(res, sar); context.Copy(res, sar);
} }
context.Branch(lblEnd); context.Branch(lblEnd);
context.MarkLabel(lblEnd); context.MarkLabel(lblEnd);
@ -1908,7 +1906,6 @@ namespace ARMeilleure.Instructions
Operand right = context.BitwiseOr(shr, context.ShiftRightUI(oneShl63UL, context.Subtract(shift, one))); Operand right = context.BitwiseOr(shr, context.ShiftRightUI(oneShl63UL, context.Subtract(shift, one)));
context.Copy(res, context.ConditionalSelect(isEqual, oneUL, right)); context.Copy(res, context.ConditionalSelect(isEqual, oneUL, right));
} }
context.Branch(lblEnd); context.Branch(lblEnd);
context.MarkLabel(lblEnd); context.MarkLabel(lblEnd);

View File

@ -69,13 +69,13 @@ namespace ARMeilleure.Instructions
[UnmanagedCallersOnly] [UnmanagedCallersOnly]
public static ulong GetCtrEl0() public static ulong GetCtrEl0()
{ {
return ExecutionContext.CtrEl0; return GetContext().CtrEl0;
} }
[UnmanagedCallersOnly] [UnmanagedCallersOnly]
public static ulong GetDczidEl0() public static ulong GetDczidEl0()
{ {
return ExecutionContext.DczidEl0; return GetContext().DczidEl0;
} }
[UnmanagedCallersOnly] [UnmanagedCallersOnly]

View File

@ -24,7 +24,7 @@ namespace ARMeilleure.Instructions
{ {
uint src = (uint)idx + 256u; uint src = (uint)idx + 256u;
Debug.Assert(src is >= 256u and < 512u); Debug.Assert(256u <= src && src < 512u);
src = (src << 1) + 1u; src = (src << 1) + 1u;
@ -32,7 +32,7 @@ namespace ARMeilleure.Instructions
uint dst = (aux + 1u) >> 1; uint dst = (aux + 1u) >> 1;
Debug.Assert(dst is >= 256u and < 512u); Debug.Assert(256u <= dst && dst < 512u);
tbl[idx] = (byte)(dst - 256u); tbl[idx] = (byte)(dst - 256u);
} }
@ -48,7 +48,7 @@ namespace ARMeilleure.Instructions
{ {
uint src = (uint)idx + 128u; uint src = (uint)idx + 128u;
Debug.Assert(src is >= 128u and < 512u); Debug.Assert(128u <= src && src < 512u);
if (src < 256u) if (src < 256u)
{ {
@ -69,7 +69,7 @@ namespace ARMeilleure.Instructions
uint dst = (aux + 1u) >> 1; uint dst = (aux + 1u) >> 1;
Debug.Assert(dst is >= 256u and < 512u); Debug.Assert(256u <= dst && dst < 512u);
tbl[idx] = (byte)(dst - 256u); tbl[idx] = (byte)(dst - 256u);
} }
@ -322,7 +322,7 @@ namespace ARMeilleure.Instructions
float result; float result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
if ((context.Fpcr & FPCR.Dn) != 0) if ((context.Fpcr & FPCR.Dn) != 0)
{ {
@ -498,7 +498,7 @@ namespace ARMeilleure.Instructions
double result; double result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
if ((context.Fpcr & FPCR.Dn) != 0) if ((context.Fpcr & FPCR.Dn) != 0)
{ {
@ -676,7 +676,7 @@ namespace ARMeilleure.Instructions
ushort resultBits; ushort resultBits;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
if (altHp) if (altHp)
{ {
@ -1522,7 +1522,7 @@ namespace ARMeilleure.Instructions
float result; float result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -1689,7 +1689,7 @@ namespace ARMeilleure.Instructions
float result; float result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -1726,7 +1726,7 @@ namespace ARMeilleure.Instructions
float result; float result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -1920,7 +1920,7 @@ namespace ARMeilleure.Instructions
float result; float result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -2211,7 +2211,7 @@ namespace ARMeilleure.Instructions
ushort resultBits; ushort resultBits;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
if (altHp) if (altHp)
{ {
@ -3057,7 +3057,7 @@ namespace ARMeilleure.Instructions
double result; double result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -3224,7 +3224,7 @@ namespace ARMeilleure.Instructions
double result; double result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -3261,7 +3261,7 @@ namespace ARMeilleure.Instructions
double result; double result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }
@ -3455,7 +3455,7 @@ namespace ARMeilleure.Instructions
double result; double result;
if (type is FPType.SNaN or FPType.QNaN) if (type == FPType.SNaN || type == FPType.QNaN)
{ {
result = FPProcessNaN(type, op, context, fpcr); result = FPProcessNaN(type, op, context, fpcr);
} }

View File

@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.IntermediateRepresentation namespace ARMeilleure.IntermediateRepresentation
{ {
[Flags] [Flags]
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
enum Intrinsic : ushort enum Intrinsic : ushort
{ {
// X86 (SSE and AVX) // X86 (SSE and AVX)

View File

@ -446,7 +446,7 @@ namespace ARMeilleure.IntermediateRepresentation
Data* data = null; Data* data = null;
// If constant or register, then try to look up in the intern table before allocating. // If constant or register, then try to look up in the intern table before allocating.
if (kind is OperandKind.Constant or OperandKind.Register) if (kind == OperandKind.Constant || kind == OperandKind.Register)
{ {
uint hash = (uint)HashCode.Combine(kind, type, value); uint hash = (uint)HashCode.Combine(kind, type, value);

View File

@ -16,8 +16,8 @@ namespace ARMeilleure.IntermediateRepresentation
{ {
public static bool IsInteger(this OperandType type) public static bool IsInteger(this OperandType type)
{ {
return type is OperandType.I32 or return type == OperandType.I32 ||
OperandType.I64; type == OperandType.I64;
} }
public static RegisterType ToRegisterType(this OperandType type) public static RegisterType ToRegisterType(this OperandType type)

View File

@ -47,12 +47,12 @@ namespace ARMeilleure.Memory
{ {
public static bool IsHostMapped(this MemoryManagerType type) public static bool IsHostMapped(this MemoryManagerType type)
{ {
return type is MemoryManagerType.HostMapped or MemoryManagerType.HostMappedUnsafe; return type == MemoryManagerType.HostMapped || type == MemoryManagerType.HostMappedUnsafe;
} }
public static bool IsHostTracked(this MemoryManagerType type) public static bool IsHostTracked(this MemoryManagerType type)
{ {
return type is MemoryManagerType.HostTracked or MemoryManagerType.HostTrackedUnsafe; return type == MemoryManagerType.HostTracked || type == MemoryManagerType.HostTrackedUnsafe;
} }
public static bool IsHostMappedOrTracked(this MemoryManagerType type) public static bool IsHostMappedOrTracked(this MemoryManagerType type)

View File

@ -16,8 +16,10 @@ namespace ARMeilleure.State
public ulong Pc => _nativeContext.GetPc(); public ulong Pc => _nativeContext.GetPc();
public static uint CtrEl0 => 0x8444c004; #pragma warning disable CA1822 // Mark member as static
public static uint DczidEl0 => 0x00000004; public uint CtrEl0 => 0x8444c004;
public uint DczidEl0 => 0x00000004;
#pragma warning restore CA1822
public ulong CntfrqEl0 => _counter.Frequency; public ulong CntfrqEl0 => _counter.Frequency;
public ulong CntpctEl0 => _counter.Counter; public ulong CntpctEl0 => _counter.Counter;

View File

@ -111,7 +111,6 @@ namespace ARMeilleure.State
{ {
value |= GetStorage().Flags[flag] != 0 ? 1u << flag : 0u; value |= GetStorage().Flags[flag] != 0 ? 1u << flag : 0u;
} }
return value; return value;
} }
@ -156,7 +155,6 @@ namespace ARMeilleure.State
value |= GetStorage().FpFlags[flag] != 0 ? bit : 0u; value |= GetStorage().FpFlags[flag] != 0 ? bit : 0u;
} }
} }
return value; return value;
} }

View File

@ -24,7 +24,7 @@ namespace ARMeilleure.Translation.Cache
private static JitCacheInvalidation _jitCacheInvalidator; private static JitCacheInvalidation _jitCacheInvalidator;
private static readonly List<CacheMemoryAllocator> _cacheAllocators = []; private static List<CacheMemoryAllocator> _cacheAllocators = [];
private static readonly List<CacheEntry> _cacheEntries = []; private static readonly List<CacheEntry> _cacheEntries = [];
@ -205,6 +205,7 @@ namespace ARMeilleure.Translation.Cache
return allocOffsetNew; return allocOffsetNew;
} }
private static int AlignCodeSize(int codeSize) private static int AlignCodeSize(int codeSize)
{ {
return checked(codeSize + (CodeAlignment - 1)) & ~(CodeAlignment - 1); return checked(codeSize + (CodeAlignment - 1)) & ~(CodeAlignment - 1);

View File

@ -124,7 +124,7 @@ namespace ARMeilleure.Translation
/// </summary> /// </summary>
/// <param name="node">The node to search for values within</param> /// <param name="node">The node to search for values within</param>
/// <param name="list">The list to add values to</param> /// <param name="list">The list to add values to</param>
private static void AddToList(IntervalTreeNode<TK, TV> node, List<TV> list) private void AddToList(IntervalTreeNode<TK, TV> node, List<TV> list)
{ {
if (node == null) if (node == null)
{ {
@ -165,7 +165,6 @@ namespace ARMeilleure.Translation
return node; return node;
} }
} }
return null; return null;
} }
@ -176,7 +175,7 @@ namespace ARMeilleure.Translation
/// <param name="end">End of the range</param> /// <param name="end">End of the range</param>
/// <param name="overlaps">Overlaps array to place results in</param> /// <param name="overlaps">Overlaps array to place results in</param>
/// <param name="overlapCount">Overlaps count to update</param> /// <param name="overlapCount">Overlaps count to update</param>
private static void GetKeys(IntervalTreeNode<TK, TV> node, TK start, TK end, ref TK[] overlaps, ref int overlapCount) private void GetKeys(IntervalTreeNode<TK, TV> node, TK start, TK end, ref TK[] overlaps, ref int overlapCount)
{ {
if (node == null || start.CompareTo(node.Max) >= 0) if (node == null || start.CompareTo(node.Max) >= 0)
{ {
@ -312,7 +311,6 @@ namespace ARMeilleure.Translation
return false; return false;
} }
} }
IntervalTreeNode<TK, TV> newNode = new(start, end, value, parent); IntervalTreeNode<TK, TV> newNode = new(start, end, value, parent);
if (newNode.Parent == null) if (newNode.Parent == null)
{ {
@ -424,14 +422,12 @@ namespace ARMeilleure.Translation
{ {
return Maximum(node.Left); return Maximum(node.Left);
} }
IntervalTreeNode<TK, TV> parent = node.Parent; IntervalTreeNode<TK, TV> parent = node.Parent;
while (parent != null && node == parent.Left) while (parent != null && node == parent.Left)
{ {
node = parent; node = parent;
parent = parent.Parent; parent = parent.Parent;
} }
return parent; return parent;
} }
@ -456,7 +452,6 @@ namespace ARMeilleure.Translation
RotateLeft(ParentOf(ptr)); RotateLeft(ParentOf(ptr));
sibling = RightOf(ParentOf(ptr)); sibling = RightOf(ParentOf(ptr));
} }
if (ColorOf(LeftOf(sibling)) == Black && ColorOf(RightOf(sibling)) == Black) if (ColorOf(LeftOf(sibling)) == Black && ColorOf(RightOf(sibling)) == Black)
{ {
SetColor(sibling, Red); SetColor(sibling, Red);
@ -471,7 +466,6 @@ namespace ARMeilleure.Translation
RotateRight(sibling); RotateRight(sibling);
sibling = RightOf(ParentOf(ptr)); sibling = RightOf(ParentOf(ptr));
} }
SetColor(sibling, ColorOf(ParentOf(ptr))); SetColor(sibling, ColorOf(ParentOf(ptr)));
SetColor(ParentOf(ptr), Black); SetColor(ParentOf(ptr), Black);
SetColor(RightOf(sibling), Black); SetColor(RightOf(sibling), Black);
@ -490,7 +484,6 @@ namespace ARMeilleure.Translation
RotateRight(ParentOf(ptr)); RotateRight(ParentOf(ptr));
sibling = LeftOf(ParentOf(ptr)); sibling = LeftOf(ParentOf(ptr));
} }
if (ColorOf(RightOf(sibling)) == Black && ColorOf(LeftOf(sibling)) == Black) if (ColorOf(RightOf(sibling)) == Black && ColorOf(LeftOf(sibling)) == Black)
{ {
SetColor(sibling, Red); SetColor(sibling, Red);
@ -505,7 +498,6 @@ namespace ARMeilleure.Translation
RotateLeft(sibling); RotateLeft(sibling);
sibling = LeftOf(ParentOf(ptr)); sibling = LeftOf(ParentOf(ptr));
} }
SetColor(sibling, ColorOf(ParentOf(ptr))); SetColor(sibling, ColorOf(ParentOf(ptr)));
SetColor(ParentOf(ptr), Black); SetColor(ParentOf(ptr), Black);
SetColor(LeftOf(sibling), Black); SetColor(LeftOf(sibling), Black);
@ -514,7 +506,6 @@ namespace ARMeilleure.Translation
} }
} }
} }
SetColor(ptr, Black); SetColor(ptr, Black);
} }
@ -541,7 +532,6 @@ namespace ARMeilleure.Translation
balanceNode = ParentOf(balanceNode); balanceNode = ParentOf(balanceNode);
RotateLeft(balanceNode); RotateLeft(balanceNode);
} }
SetColor(ParentOf(balanceNode), Black); SetColor(ParentOf(balanceNode), Black);
SetColor(ParentOf(ParentOf(balanceNode)), Red); SetColor(ParentOf(ParentOf(balanceNode)), Red);
RotateRight(ParentOf(ParentOf(balanceNode))); RotateRight(ParentOf(ParentOf(balanceNode)));
@ -565,14 +555,12 @@ namespace ARMeilleure.Translation
balanceNode = ParentOf(balanceNode); balanceNode = ParentOf(balanceNode);
RotateRight(balanceNode); RotateRight(balanceNode);
} }
SetColor(ParentOf(balanceNode), Black); SetColor(ParentOf(balanceNode), Black);
SetColor(ParentOf(ParentOf(balanceNode)), Red); SetColor(ParentOf(ParentOf(balanceNode)), Red);
RotateLeft(ParentOf(ParentOf(balanceNode))); RotateLeft(ParentOf(ParentOf(balanceNode)));
} }
} }
} }
SetColor(_root, Black); SetColor(_root, Black);
} }
@ -586,7 +574,6 @@ namespace ARMeilleure.Translation
{ {
node.Right.Parent = node; node.Right.Parent = node;
} }
IntervalTreeNode<TK, TV> nodeParent = ParentOf(node); IntervalTreeNode<TK, TV> nodeParent = ParentOf(node);
right.Parent = nodeParent; right.Parent = nodeParent;
if (nodeParent == null) if (nodeParent == null)
@ -601,7 +588,6 @@ namespace ARMeilleure.Translation
{ {
nodeParent.Right = right; nodeParent.Right = right;
} }
right.Left = node; right.Left = node;
node.Parent = right; node.Parent = right;
@ -619,7 +605,6 @@ namespace ARMeilleure.Translation
{ {
node.Left.Parent = node; node.Left.Parent = node;
} }
IntervalTreeNode<TK, TV> nodeParent = ParentOf(node); IntervalTreeNode<TK, TV> nodeParent = ParentOf(node);
left.Parent = nodeParent; left.Parent = nodeParent;
if (nodeParent == null) if (nodeParent == null)
@ -634,7 +619,6 @@ namespace ARMeilleure.Translation
{ {
nodeParent.Left = left; nodeParent.Left = left;
} }
left.Right = node; left.Right = node;
node.Parent = left; node.Parent = left;

View File

@ -33,7 +33,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0"; private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0"; private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 7008; //! To be incremented manually for each change to the ARMeilleure project. private const uint InternalVersion = 7007; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0"; private const string ActualDir = "0";
private const string BackupDir = "1"; private const string BackupDir = "1";
@ -193,7 +193,7 @@ namespace ARMeilleure.Translation.PTC
_infosStream.Seek(0L, SeekOrigin.Begin); _infosStream.Seek(0L, SeekOrigin.Begin);
bool foundBadFunction = false; bool foundBadFunction = false;
for (int index = 0; index < _infosStream.Length / Unsafe.SizeOf<InfoEntry>(); index++) for (int index = 0; index < GetEntriesCount(); index++)
{ {
InfoEntry infoEntry = DeserializeStructure<InfoEntry>(_infosStream); InfoEntry infoEntry = DeserializeStructure<InfoEntry>(_infosStream);
foreach (ulong address in blacklist) foreach (ulong address in blacklist)
@ -566,7 +566,9 @@ namespace ARMeilleure.Translation.PTC
{ {
if (AreCarriersEmpty() || ContainsBlacklistedFunctions()) if (AreCarriersEmpty() || ContainsBlacklistedFunctions())
{ {
ResetCarriersIfNeeded(); _infosStream.SetLength(0);
_relocsStream.SetLength(0);
_unwindInfosStream.SetLength(0);
return; return;
} }
@ -835,6 +837,8 @@ namespace ARMeilleure.Translation.PTC
return; return;
} }
int degreeOfParallelism = Environment.ProcessorCount; int degreeOfParallelism = Environment.ProcessorCount;
if (Optimizations.LowPower) if (Optimizations.LowPower)
@ -871,7 +875,7 @@ namespace ARMeilleure.Translation.PTC
Debug.Assert(Profiler.IsAddressInStaticCodeRange(address)); Debug.Assert(Profiler.IsAddressInStaticCodeRange(address));
TranslatedFunction func = translator.Translate(address, executionMode, highCq, pptcTranslation: true); TranslatedFunction func = translator.Translate(address, executionMode, highCq);
if (func == null) if (func == null)
{ {
@ -894,6 +898,7 @@ namespace ARMeilleure.Translation.PTC
} }
} }
List<Thread> threads = Enumerable.Range(0, degreeOfParallelism) List<Thread> threads = Enumerable.Range(0, degreeOfParallelism)
.Select(idx => .Select(idx =>
new Thread(TranslateFuncs) new Thread(TranslateFuncs)
@ -909,7 +914,6 @@ namespace ARMeilleure.Translation.PTC
{ {
thread.Start(); thread.Start();
} }
foreach (Thread thread in threads) foreach (Thread thread in threads)
{ {
thread.Join(); thread.Join();
@ -1162,8 +1166,8 @@ namespace ARMeilleure.Translation.PTC
public void Close() public void Close()
{ {
if (State is PtcState.Enabled or if (State == PtcState.Enabled ||
PtcState.Continuing) State == PtcState.Continuing)
{ {
State = PtcState.Closing; State = PtcState.Closing;
} }

View File

@ -1,6 +1,5 @@
using ARMeilleure.State; using ARMeilleure.State;
using Humanizer; using Humanizer;
using Microsoft.IO;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
@ -220,7 +219,7 @@ namespace ARMeilleure.Translation.PTC
return false; return false;
} }
using RecyclableMemoryStream stream = MemoryStreamManager.Shared.GetStream(); using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
Debug.Assert(stream.Seek(0L, SeekOrigin.Begin) == 0L && stream.Length == 0L); Debug.Assert(stream.Seek(0L, SeekOrigin.Begin) == 0L && stream.Length == 0L);
try try
@ -294,10 +293,10 @@ namespace ARMeilleure.Translation.PTC
{ {
if (migrateEntryFunc != null) if (migrateEntryFunc != null)
{ {
return DeserializeAndUpdateDictionary(stream, stream => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); }, migrateEntryFunc); return DeserializeAndUpdateDictionary(stream, (Stream stream) => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); }, migrateEntryFunc);
} }
return DeserializeDictionary<ulong, FuncProfile>(stream, stream => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); }); return DeserializeDictionary<ulong, FuncProfile>(stream, (Stream stream) => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); });
} }
private static ReadOnlySpan<byte> GetReadOnlySpan(MemoryStream memoryStream) private static ReadOnlySpan<byte> GetReadOnlySpan(MemoryStream memoryStream)
@ -468,8 +467,8 @@ namespace ARMeilleure.Translation.PTC
public void Start() public void Start()
{ {
if (_ptc.State is PtcState.Enabled or if (_ptc.State == PtcState.Enabled ||
PtcState.Continuing) _ptc.State == PtcState.Continuing)
{ {
Enabled = true; Enabled = true;

View File

@ -219,7 +219,7 @@ namespace ARMeilleure.Translation
} }
} }
internal TranslatedFunction Translate(ulong address, ExecutionMode mode, bool highCq, bool singleStep = false, bool pptcTranslation = false) internal TranslatedFunction Translate(ulong address, ExecutionMode mode, bool highCq, bool singleStep = false)
{ {
ArmEmitterContext context = new( ArmEmitterContext context = new(
Memory, Memory,
@ -246,7 +246,7 @@ namespace ARMeilleure.Translation
context.Branch(context.GetLabel(address)); context.Branch(context.GetLabel(address));
} }
ControlFlowGraph cfg = EmitAndGetCFG(context, blocks, out Range funcRange, out Counter<uint> counter, pptcTranslation); ControlFlowGraph cfg = EmitAndGetCFG(context, blocks, out Range funcRange, out Counter<uint> counter);
if (cfg == null) if (cfg == null)
{ {
@ -326,8 +326,7 @@ namespace ARMeilleure.Translation
ArmEmitterContext context, ArmEmitterContext context,
Block[] blocks, Block[] blocks,
out Range range, out Range range,
out Counter<uint> counter, out Counter<uint> counter)
bool pptcTranslation)
{ {
counter = null; counter = null;
@ -412,10 +411,7 @@ namespace ARMeilleure.Translation
if (opCode.Instruction.Emitter != null) if (opCode.Instruction.Emitter != null)
{ {
opCode.Instruction.Emitter(context); opCode.Instruction.Emitter(context);
// if we're pre-compiling PPTC functions, and we hit an Undefined instruction as the first if (opCode.Instruction.Name == InstName.Und && blkIndex == 0)
// instruction in the block, mark the function as blacklisted
// this way, we don't pre-compile Exlaunch hooks, which allows ExeFS mods to run with PPTC
if (pptcTranslation && opCode.Instruction.Name == InstName.Und && blkIndex == 0)
{ {
range = new Range(rangeStart, rangeEnd); range = new Range(rangeStart, rangeEnd);
return null; return null;

View File

@ -178,7 +178,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
public bool SupportsChannelCount(uint channelCount) public bool SupportsChannelCount(uint channelCount)
{ {
return channelCount is 1 or 2 or 6; return channelCount == 1 || channelCount == 2 || channelCount == 6;
} }
public bool SupportsDirection(Direction direction) public bool SupportsDirection(Direction direction)

View File

@ -24,8 +24,10 @@ namespace Ryujinx.Audio.Backends.SDL2
// TODO: Add this to SDL2-CS // TODO: Add this to SDL2-CS
// NOTE: We use a DllImport here because of marshaling issue for spec. // NOTE: We use a DllImport here because of marshaling issue for spec.
#pragma warning disable SYSLIB1054
[DllImport("SDL2")] [DllImport("SDL2")]
private static extern int SDL_GetDefaultAudioInfo(nint name, out SDL_AudioSpec spec, int isCapture); private static extern int SDL_GetDefaultAudioInfo(nint name, out SDL_AudioSpec spec, int isCapture);
#pragma warning restore SYSLIB1054
public SDL2HardwareDeviceDriver() public SDL2HardwareDeviceDriver()
{ {

View File

@ -162,7 +162,7 @@ namespace Ryujinx.Audio.Backends.CompatLayer
public bool SupportsChannelCount(uint channelCount) public bool SupportsChannelCount(uint channelCount)
{ {
return channelCount is 1 or 2 or 6; return channelCount == 1 || channelCount == 2 || channelCount == 6;
} }
public bool SupportsSampleFormat(SampleFormat sampleFormat) public bool SupportsSampleFormat(SampleFormat sampleFormat)
@ -184,7 +184,7 @@ namespace Ryujinx.Audio.Backends.CompatLayer
public bool SupportsDirection(Direction direction) public bool SupportsDirection(Direction direction)
{ {
return direction is Direction.Input or Direction.Output; return direction == Direction.Input || direction == Direction.Output;
} }
} }
} }

View File

@ -73,12 +73,12 @@ namespace Ryujinx.Audio.Backends.Dummy
public bool SupportsDirection(Direction direction) public bool SupportsDirection(Direction direction)
{ {
return direction is Direction.Output or Direction.Input; return direction == Direction.Output || direction == Direction.Input;
} }
public bool SupportsChannelCount(uint channelCount) public bool SupportsChannelCount(uint channelCount)
{ {
return channelCount is 1 or 2 or 6; return channelCount == 1 || channelCount == 2 || channelCount == 6;
} }
} }
} }

View File

@ -109,7 +109,7 @@ namespace Ryujinx.Audio.Common
/// <returns>The state of the session</returns> /// <returns>The state of the session</returns>
public AudioDeviceState GetState() public AudioDeviceState GetState()
{ {
Debug.Assert(_state is AudioDeviceState.Started or AudioDeviceState.Stopped); Debug.Assert(_state == AudioDeviceState.Started || _state == AudioDeviceState.Stopped);
return _state; return _state;
} }

View File

@ -166,7 +166,7 @@ namespace Ryujinx.Audio.Input
/// </summary> /// </summary>
/// <param name="filtered">If true, filter disconnected devices</param> /// <param name="filtered">If true, filter disconnected devices</param>
/// <returns>The list of all audio inputs name</returns> /// <returns>The list of all audio inputs name</returns>
public static string[] ListAudioIns(bool filtered) public string[] ListAudioIns(bool filtered)
{ {
if (filtered) if (filtered)
{ {

View File

@ -91,12 +91,12 @@ namespace Ryujinx.Audio.Input
return ResultCode.DeviceNotFound; return ResultCode.DeviceNotFound;
} }
if (configuration.SampleRate is not 0 and not Constants.TargetSampleRate) if (configuration.SampleRate != 0 && configuration.SampleRate != Constants.TargetSampleRate)
{ {
return ResultCode.UnsupportedSampleRate; return ResultCode.UnsupportedSampleRate;
} }
if (configuration.ChannelCount is not 0 and not 1 and not 2 and not 6) if (configuration.ChannelCount != 0 && configuration.ChannelCount != 1 && configuration.ChannelCount != 2 && configuration.ChannelCount != 6)
{ {
return ResultCode.UnsupportedChannelConfiguration; return ResultCode.UnsupportedChannelConfiguration;
} }

View File

@ -47,7 +47,7 @@ namespace Ryujinx.Audio.Integration
{ {
uint channelCount = GetChannelCount(); uint channelCount = GetChannelCount();
Debug.Assert(channelCount is > 0 and <= Constants.ChannelCountMax); Debug.Assert(channelCount > 0 && channelCount <= Constants.ChannelCountMax);
return channelCount != Constants.ChannelCountMax; return channelCount != Constants.ChannelCountMax;
} }

View File

@ -165,7 +165,7 @@ namespace Ryujinx.Audio.Output
/// Get the list of all audio outputs name. /// Get the list of all audio outputs name.
/// </summary> /// </summary>
/// <returns>The list of all audio outputs name</returns> /// <returns>The list of all audio outputs name</returns>
public static string[] ListAudioOuts() public string[] ListAudioOuts()
{ {
return [Constants.DefaultDeviceOutputName]; return [Constants.DefaultDeviceOutputName];
} }

View File

@ -91,12 +91,12 @@ namespace Ryujinx.Audio.Output
return ResultCode.DeviceNotFound; return ResultCode.DeviceNotFound;
} }
if (configuration.SampleRate is not 0 and not Constants.TargetSampleRate) if (configuration.SampleRate != 0 && configuration.SampleRate != Constants.TargetSampleRate)
{ {
return ResultCode.UnsupportedSampleRate; return ResultCode.UnsupportedSampleRate;
} }
if (configuration.ChannelCount is not 0 and not 1 and not 2 and not 6) if (configuration.ChannelCount != 0 && configuration.ChannelCount != 1 && configuration.ChannelCount != 2 && configuration.ChannelCount != 6)
{ {
return ResultCode.UnsupportedChannelConfiguration; return ResultCode.UnsupportedChannelConfiguration;
} }

View File

@ -58,7 +58,7 @@ namespace Ryujinx.Audio.Renderer.Device
/// <param name="volume">The new master volume.</param> /// <param name="volume">The new master volume.</param>
public void UpdateMasterVolume(float volume) public void UpdateMasterVolume(float volume)
{ {
Debug.Assert(volume is >= 0.0f and <= 1.0f); Debug.Assert(volume >= 0.0f && volume <= 1.0f);
MasterVolume = volume; MasterVolume = volume;
} }

View File

@ -17,7 +17,9 @@ namespace Ryujinx.Audio.Renderer.Device
/// The default <see cref="VirtualDevice"/>. /// The default <see cref="VirtualDevice"/>.
/// </summary> /// </summary>
/// <remarks>This is used when the USB device is the default one on older revision.</remarks> /// <remarks>This is used when the USB device is the default one on older revision.</remarks>
public static VirtualDevice DefaultDevice => VirtualDevice.Devices[0]; #pragma warning disable CA1822 // Mark member as static
public VirtualDevice DefaultDevice => VirtualDevice.Devices[0];
#pragma warning restore CA1822
/// <summary> /// <summary>
/// The current active <see cref="VirtualDevice"/>. /// The current active <see cref="VirtualDevice"/>.

View File

@ -81,14 +81,14 @@ namespace Ryujinx.Audio.Renderer.Dsp
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static short GetCoefficientAtIndex(ReadOnlySpan<short> coefficients, int index) private static short GetCoefficientAtIndex(ReadOnlySpan<short> coefficients, int index)
{ {
if ((uint)index < (uint)coefficients.Length) if ((uint)index >= (uint)coefficients.Length)
{ {
return coefficients[index]; Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}");
return 0;
} }
Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}"); return coefficients[index];
return 0;
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@ -129,6 +129,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
delayFeedbackCrossGain, 0.0f, delayFeedbackBaseGain, delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f, delayFeedbackBaseGain, delayFeedbackCrossGain,
0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain); 0.0f, delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain);
for (int i = 0; i < sampleCount; i++) for (int i = 0; i < sampleCount; i++)
{ {
Vector4 channelInput = new() Vector4 channelInput = new()

View File

@ -40,7 +40,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
DelayFeedbackBaseGain = (1.0f - channelSpread) * FeedbackGain; DelayFeedbackBaseGain = (1.0f - channelSpread) * FeedbackGain;
if (parameter.ChannelCount is 4 or 6) if (parameter.ChannelCount == 4 || parameter.ChannelCount == 6)
{ {
DelayFeedbackCrossGain = channelSpread * 0.5f * FeedbackGain; DelayFeedbackCrossGain = channelSpread * 0.5f * FeedbackGain;
} }

View File

@ -27,7 +27,6 @@ namespace Ryujinx.Audio.Renderer.Dsp
{ {
return 1.0f; return 1.0f;
} }
return (MathF.Sin(MathF.PI * x) / (MathF.PI * x)); return (MathF.Sin(MathF.PI * x) / (MathF.PI * x));
} }
@ -142,7 +141,6 @@ namespace Ryujinx.Audio.Renderer.Dsp
state.Phase = (state.Phase + 1) % 6; state.Phase = (state.Phase + 1) % 6;
} }
break; break;
case 3.0f: case 3.0f:
for (int i = 0; i < outputSampleCount; i++) for (int i = 0; i < outputSampleCount; i++)
@ -163,7 +161,6 @@ namespace Ryujinx.Audio.Renderer.Dsp
state.Phase = (state.Phase + 1) % 3; state.Phase = (state.Phase + 1) % 3;
} }
break; break;
case 1.5f: case 1.5f:
// Upsample by 3 then decimate by 2. // Upsample by 3 then decimate by 2.
@ -186,7 +183,6 @@ namespace Ryujinx.Audio.Renderer.Dsp
state.Phase = (state.Phase + 1) % 3; state.Phase = (state.Phase + 1) % 3;
} }
break; break;
default: default:
throw new ArgumentOutOfRangeException(nameof(state), state.Scale, null); throw new ArgumentOutOfRangeException(nameof(state), state.Scale, null);

View File

@ -91,7 +91,7 @@ namespace Ryujinx.Audio.Renderer.Parameter
/// <returns>Returns true if the channel count is valid.</returns> /// <returns>Returns true if the channel count is valid.</returns>
public static bool IsChannelCountValid(int channelCount) public static bool IsChannelCountValid(int channelCount)
{ {
return channelCount is 1 or 2 or 4 or 6; return channelCount == 1 || channelCount == 2 || channelCount == 4 || channelCount == 6;
} }
} }
} }

View File

@ -91,7 +91,7 @@ namespace Ryujinx.Audio.Renderer.Parameter
/// <returns>Returns true if the channel count is valid.</returns> /// <returns>Returns true if the channel count is valid.</returns>
public static bool IsChannelCountValid(int channelCount) public static bool IsChannelCountValid(int channelCount)
{ {
return channelCount is 1 or 2 or 4 or 6; return channelCount == 1 || channelCount == 2 || channelCount == 4 || channelCount == 6;
} }
} }
} }

View File

@ -532,13 +532,13 @@ namespace Ryujinx.Audio.Renderer.Server
CommandType commandType = command.CommandType; CommandType commandType = command.CommandType;
if (commandType is CommandType.AdpcmDataSourceVersion1 or if (commandType == CommandType.AdpcmDataSourceVersion1 ||
CommandType.AdpcmDataSourceVersion2 or commandType == CommandType.AdpcmDataSourceVersion2 ||
CommandType.PcmInt16DataSourceVersion1 or commandType == CommandType.PcmInt16DataSourceVersion1 ||
CommandType.PcmInt16DataSourceVersion2 or commandType == CommandType.PcmInt16DataSourceVersion2 ||
CommandType.PcmFloatDataSourceVersion1 or commandType == CommandType.PcmFloatDataSourceVersion1 ||
CommandType.PcmFloatDataSourceVersion2 or commandType == CommandType.PcmFloatDataSourceVersion2 ||
CommandType.Performance) commandType == CommandType.Performance)
{ {
break; break;
} }

View File

@ -467,6 +467,7 @@ namespace Ryujinx.Audio.Renderer.Server
} }
} }
/// <summary> /// <summary>
/// Generate a new <see cref="DelayCommand"/>. /// Generate a new <see cref="DelayCommand"/>.
/// </summary> /// </summary>

View File

@ -20,7 +20,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PerformanceCommand command) public uint Estimate(PerformanceCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -32,7 +32,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(ClearMixBufferCommand command) public uint Estimate(ClearMixBufferCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
float costPerBuffer = 668.8f; float costPerBuffer = 668.8f;
float baseCost = 193.2f; float baseCost = 193.2f;
@ -48,7 +48,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(BiquadFilterCommand command) public uint Estimate(BiquadFilterCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -62,7 +62,7 @@ namespace Ryujinx.Audio.Renderer.Server
{ {
const float CostPerSample = 7.245f; const float CostPerSample = 7.245f;
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
int volumeCount = 0; int volumeCount = 0;
@ -79,7 +79,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(MixRampCommand command) public uint Estimate(MixRampCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -91,7 +91,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DepopPrepareCommand command) public uint Estimate(DepopPrepareCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -103,7 +103,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(VolumeRampCommand command) public uint Estimate(VolumeRampCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -115,7 +115,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PcmInt16DataSourceCommandVersion1 command) public uint Estimate(PcmInt16DataSourceCommandVersion1 command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
float costPerSample = 1195.5f; float costPerSample = 1195.5f;
float baseCost = 7797.0f; float baseCost = 7797.0f;
@ -131,7 +131,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(AdpcmDataSourceCommandVersion1 command) public uint Estimate(AdpcmDataSourceCommandVersion1 command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
float costPerSample = 3564.1f; float costPerSample = 3564.1f;
float baseCost = 6225.5f; float baseCost = 6225.5f;
@ -147,7 +147,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DepopForMixBuffersCommand command) public uint Estimate(DepopForMixBuffersCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -159,7 +159,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(CopyMixBufferCommand command) public uint Estimate(CopyMixBufferCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -171,7 +171,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(MixCommand command) public uint Estimate(MixCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -183,7 +183,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DelayCommand command) public uint Estimate(DelayCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -234,7 +234,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(ReverbCommand command) public uint Estimate(ReverbCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -285,7 +285,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(Reverb3dCommand command) public uint Estimate(Reverb3dCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -335,7 +335,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(AuxiliaryBufferCommand command) public uint Estimate(AuxiliaryBufferCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -357,7 +357,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(VolumeCommand command) public uint Estimate(VolumeCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -369,7 +369,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(CircularBufferSinkCommand command) public uint Estimate(CircularBufferSinkCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
float costPerBuffer = 1726.0f; float costPerBuffer = 1726.0f;
float baseCost = 1369.7f; float baseCost = 1369.7f;
@ -385,7 +385,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DownMixSurroundToStereoCommand command) public uint Estimate(DownMixSurroundToStereoCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -397,7 +397,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(UpsampleCommand command) public uint Estimate(UpsampleCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
if (_sampleCount == 160) if (_sampleCount == 160)
{ {
@ -409,8 +409,8 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DeviceSinkCommand command) public uint Estimate(DeviceSinkCommand command)
{ {
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
Debug.Assert(command.InputCount is 2 or 6); Debug.Assert(command.InputCount == 2 || command.InputCount == 6);
if (command.InputCount == 2) if (command.InputCount == 2)
{ {
@ -433,7 +433,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PcmFloatDataSourceCommandVersion1 command) public uint Estimate(PcmFloatDataSourceCommandVersion1 command)
{ {
// NOTE: This was added between REV7 and REV8 and for some reasons the estimator v2 was changed... // NOTE: This was added between REV7 and REV8 and for some reasons the estimator v2 was changed...
Debug.Assert(_sampleCount is 160 or 240); Debug.Assert(_sampleCount == 160 || _sampleCount == 240);
float costPerSample = 3490.9f; float costPerSample = 3490.9f;
float baseCost = 10091.0f; float baseCost = 10091.0f;

View File

@ -23,7 +23,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PerformanceCommand command) public uint Estimate(PerformanceCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -35,7 +35,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(ClearMixBufferCommand command) public uint Estimate(ClearMixBufferCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
float costPerBuffer = 440.68f; float costPerBuffer = 440.68f;
float baseCost = 0; float baseCost = 0;
@ -50,7 +50,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(BiquadFilterCommand command) public uint Estimate(BiquadFilterCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -64,7 +64,7 @@ namespace Ryujinx.Audio.Renderer.Server
{ {
float costPerSample = 6.4434f; float costPerSample = 6.4434f;
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -86,7 +86,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(MixRampCommand command) public uint Estimate(MixRampCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -103,7 +103,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(VolumeRampCommand command) public uint Estimate(VolumeRampCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -115,7 +115,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PcmInt16DataSourceCommandVersion1 command) public uint Estimate(PcmInt16DataSourceCommandVersion1 command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
float costPerSample = 710.143f; float costPerSample = 710.143f;
float baseCost = 7853.286f; float baseCost = 7853.286f;
@ -131,7 +131,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(AdpcmDataSourceCommandVersion1 command) public uint Estimate(AdpcmDataSourceCommandVersion1 command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
float costPerSample = 3564.1f; float costPerSample = 3564.1f;
float baseCost = 9736.702f; float baseCost = 9736.702f;
@ -147,7 +147,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DepopForMixBuffersCommand command) public uint Estimate(DepopForMixBuffersCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -159,7 +159,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(CopyMixBufferCommand command) public uint Estimate(CopyMixBufferCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -171,7 +171,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(MixCommand command) public uint Estimate(MixCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -183,7 +183,7 @@ namespace Ryujinx.Audio.Renderer.Server
public virtual uint Estimate(DelayCommand command) public virtual uint Estimate(DelayCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -233,7 +233,7 @@ namespace Ryujinx.Audio.Renderer.Server
public virtual uint Estimate(ReverbCommand command) public virtual uint Estimate(ReverbCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -283,7 +283,7 @@ namespace Ryujinx.Audio.Renderer.Server
public virtual uint Estimate(Reverb3dCommand command) public virtual uint Estimate(Reverb3dCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -333,7 +333,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(AuxiliaryBufferCommand command) public uint Estimate(AuxiliaryBufferCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -355,7 +355,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(VolumeCommand command) public uint Estimate(VolumeCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -367,7 +367,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(CircularBufferSinkCommand command) public uint Estimate(CircularBufferSinkCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
float costPerBuffer = 770.26f; float costPerBuffer = 770.26f;
float baseCost = 0f; float baseCost = 0f;
@ -382,7 +382,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DownMixSurroundToStereoCommand command) public uint Estimate(DownMixSurroundToStereoCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -394,7 +394,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(UpsampleCommand command) public uint Estimate(UpsampleCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -406,8 +406,8 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DeviceSinkCommand command) public uint Estimate(DeviceSinkCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
Debug.Assert(command.InputCount is 2 or 6); Debug.Assert(command.InputCount == 2 || command.InputCount == 6);
if (command.InputCount == 2) if (command.InputCount == 2)
{ {
@ -429,7 +429,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(PcmFloatDataSourceCommandVersion1 command) public uint Estimate(PcmFloatDataSourceCommandVersion1 command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
float costPerSample = 3490.9f; float costPerSample = 3490.9f;
float baseCost = 10090.9f; float baseCost = 10090.9f;
@ -445,7 +445,7 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(DataSourceVersion2Command command) public uint Estimate(DataSourceVersion2Command command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
(float baseCost, float costPerSample) = GetCostByFormat(SampleCount, command.SampleFormat, command.SrcQuality); (float baseCost, float costPerSample) = GetCostByFormat(SampleCount, command.SampleFormat, command.SrcQuality);
@ -454,7 +454,7 @@ namespace Ryujinx.Audio.Renderer.Server
private static (float, float) GetCostByFormat(uint sampleCount, SampleFormat format, SampleRateConversionQuality quality) private static (float, float) GetCostByFormat(uint sampleCount, SampleFormat format, SampleRateConversionQuality quality)
{ {
Debug.Assert(sampleCount is 160 or 240); Debug.Assert(sampleCount == 160 || sampleCount == 240);
switch (format) switch (format)
{ {
@ -546,7 +546,7 @@ namespace Ryujinx.Audio.Renderer.Server
private uint EstimateLimiterCommandCommon(LimiterParameter parameter, bool enabled) private uint EstimateLimiterCommandCommon(LimiterParameter parameter, bool enabled)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -596,14 +596,14 @@ namespace Ryujinx.Audio.Renderer.Server
public uint Estimate(LimiterCommandVersion1 command) public uint Estimate(LimiterCommandVersion1 command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
return EstimateLimiterCommandCommon(command.Parameter, command.IsEffectEnabled); return EstimateLimiterCommandCommon(command.Parameter, command.IsEffectEnabled);
} }
public uint Estimate(LimiterCommandVersion2 command) public uint Estimate(LimiterCommandVersion2 command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (!command.Parameter.StatisticsEnabled || !command.IsEffectEnabled) if (!command.Parameter.StatisticsEnabled || !command.IsEffectEnabled)
{ {

View File

@ -12,7 +12,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(MultiTapBiquadFilterCommand command) public override uint Estimate(MultiTapBiquadFilterCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -24,7 +24,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(CaptureBufferCommand command) public override uint Estimate(CaptureBufferCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {

View File

@ -13,7 +13,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(DelayCommand command) public override uint Estimate(DelayCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -63,7 +63,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(ReverbCommand command) public override uint Estimate(ReverbCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -113,7 +113,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(Reverb3dCommand command) public override uint Estimate(Reverb3dCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -163,7 +163,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(CompressorCommand command) public override uint Estimate(CompressorCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (SampleCount == 160) if (SampleCount == 160)
{ {
@ -241,7 +241,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(BiquadFilterAndMixCommand command) public override uint Estimate(BiquadFilterAndMixCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (command.HasVolumeRamp) if (command.HasVolumeRamp)
{ {
@ -265,7 +265,7 @@ namespace Ryujinx.Audio.Renderer.Server
public override uint Estimate(MultiTapBiquadFilterAndMixCommand command) public override uint Estimate(MultiTapBiquadFilterAndMixCommand command)
{ {
Debug.Assert(SampleCount is 160 or 240); Debug.Assert(SampleCount == 160 || SampleCount == 240);
if (command.HasVolumeRamp) if (command.HasVolumeRamp)
{ {

View File

@ -257,7 +257,7 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
const uint PageSize = 0x1000; const uint PageSize = 0x1000;
if (inputState is not MemoryPoolUserState.RequestAttach and not MemoryPoolUserState.RequestDetach) if (inputState != MemoryPoolUserState.RequestAttach && inputState != MemoryPoolUserState.RequestDetach)
{ {
return UpdateResult.Success; return UpdateResult.Success;
} }

View File

@ -153,7 +153,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
/// <returns>The volume for the given destination.</returns> /// <returns>The volume for the given destination.</returns>
public float GetMixVolume(int destinationIndex) public float GetMixVolume(int destinationIndex)
{ {
Debug.Assert(destinationIndex is >= 0 and < Constants.MixBufferCountMax); Debug.Assert(destinationIndex >= 0 && destinationIndex < Constants.MixBufferCountMax);
return MixBufferVolume[destinationIndex]; return MixBufferVolume[destinationIndex];
} }
@ -165,7 +165,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
/// <returns>The volume for the given destination.</returns> /// <returns>The volume for the given destination.</returns>
public float GetMixVolumePrev(int destinationIndex) public float GetMixVolumePrev(int destinationIndex)
{ {
Debug.Assert(destinationIndex is >= 0 and < Constants.MixBufferCountMax); Debug.Assert(destinationIndex >= 0 && destinationIndex < Constants.MixBufferCountMax);
return PreviousMixBufferVolume[destinationIndex]; return PreviousMixBufferVolume[destinationIndex];
} }

View File

@ -160,7 +160,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
/// <returns>The volume for the given destination.</returns> /// <returns>The volume for the given destination.</returns>
public float GetMixVolume(int destinationIndex) public float GetMixVolume(int destinationIndex)
{ {
Debug.Assert(destinationIndex is >= 0 and < Constants.MixBufferCountMax); Debug.Assert(destinationIndex >= 0 && destinationIndex < Constants.MixBufferCountMax);
return MixBufferVolume[destinationIndex]; return MixBufferVolume[destinationIndex];
} }
@ -172,7 +172,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
/// <returns>The volume for the given destination.</returns> /// <returns>The volume for the given destination.</returns>
public float GetMixVolumePrev(int destinationIndex) public float GetMixVolumePrev(int destinationIndex)
{ {
Debug.Assert(destinationIndex is >= 0 and < Constants.MixBufferCountMax); Debug.Assert(destinationIndex >= 0 && destinationIndex < Constants.MixBufferCountMax);
return PreviousMixBufferVolume[destinationIndex]; return PreviousMixBufferVolume[destinationIndex];
} }

Some files were not shown because too many files have changed in this diff Show More