mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-24 13:22:28 +00:00
More tests + disable all builds except macOS
This commit is contained in:
parent
e2d19d6cca
commit
6bc080b52c
2 changed files with 236 additions and 225 deletions
|
|
@ -27,117 +27,94 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
configuration: [Release]
|
||||||
platform:
|
platform:
|
||||||
- { name: win-x64, zip_os_name: win_x64 }
|
# - { name: win-x64, zip_os_name: win_x64 }
|
||||||
#- { name: win-arm64, zip_os_name: win_arm64 }
|
# - { name: win-arm64, zip_os_name: win_arm64 }
|
||||||
- { name: linux-x64, zip_os_name: linux_x64 }
|
# - { name: linux-x64, zip_os_name: linux_x64 }
|
||||||
- { name: linux-arm64, zip_os_name: linux_arm64 }
|
# - { name: linux-arm64, zip_os_name: linux_arm64 }
|
||||||
#- { name: osx-x64, zip_os_name: osx_x64 }
|
# - { name: osx-x64, zip_os_name: osx_x64 }
|
||||||
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- uses: actions/setup-dotnet@v5
|
# steps:
|
||||||
with:
|
# - uses: actions/checkout@v6
|
||||||
global-json-file: global.json
|
# - uses: actions/setup-dotnet@v5
|
||||||
|
# with:
|
||||||
- name: Install GLI
|
# global-json-file: global.json
|
||||||
uses: actions/setup-gli@v1
|
# - name: Install GLI
|
||||||
with:
|
# uses: actions/setup-gli@v1
|
||||||
token: ${{ secrets.SETUP_GLI_TOKEN }}
|
# with:
|
||||||
|
# token: ${{ secrets.SETUP_GLI_TOKEN }}
|
||||||
- name: Install 7zip
|
# - name: Install 7zip
|
||||||
run: |
|
# run: |
|
||||||
sudo apt update && sudo apt install -y 7zip
|
# sudo apt update && sudo apt install -y 7zip
|
||||||
|
# - name: Overwrite csc problem matcher
|
||||||
- name: Overwrite csc problem matcher
|
# run: echo "::add-matcher::.forgejo/csc.json"
|
||||||
run: echo "::add-matcher::.forgejo/csc.json"
|
# - name: Get version info
|
||||||
|
# id: version_info
|
||||||
- name: Get version info
|
# run: |
|
||||||
id: version_info
|
# echo "result=$(gli get-next-version -c Canary -R)" >> $FORGEJO_OUTPUT
|
||||||
run: |
|
# echo "git_short_hash=$(git rev-parse --short "${{ forgejo.sha }}")" >> $FORGEJO_OUTPUT
|
||||||
echo "result=$(gli get-next-version -c Canary -R)" >> $FORGEJO_OUTPUT
|
# shell: bash
|
||||||
echo "git_short_hash=$(git rev-parse --short "${{ forgejo.sha }}")" >> $FORGEJO_OUTPUT
|
# - name: Change config filename
|
||||||
shell: bash
|
# run: sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/PRConfig\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
# shell: bash
|
||||||
- name: Change config filename
|
# if: forgejo.event_name == 'pull_request'
|
||||||
run: sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/PRConfig\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
# - name: 'Cache: ~/.nuget/packages'
|
||||||
shell: bash
|
# uses: actions/cache@v5
|
||||||
if: forgejo.event_name == 'pull_request'
|
# with:
|
||||||
|
# path: ~/.nuget/packages
|
||||||
- name: 'Cache: ~/.nuget/packages'
|
# key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
|
||||||
uses: actions/cache@v5
|
# - name: Build
|
||||||
with:
|
# run: dotnet build -c "${{ matrix.configuration }}" -p:Version="${{ steps.version_info.outputs.result }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:ExtraDefineConstants=DISABLE_UPDATER
|
||||||
path: |
|
# - name: Test
|
||||||
~/.nuget/packages
|
# uses: actions/unstable-commands@v1
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
|
# with:
|
||||||
|
# commands: dotnet test --no-build -c "${{ matrix.configuration }}"
|
||||||
- name: Build
|
# timeout-minutes: 10
|
||||||
run: dotnet build -c "${{ matrix.configuration }}" -p:Version="${{ steps.version_info.outputs.result }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:ExtraDefineConstants=DISABLE_UPDATER
|
# retry-codes: 139
|
||||||
|
# if: matrix.platform.name != 'linux-arm64'
|
||||||
- name: Test
|
# - name: Publish Ryujinx
|
||||||
uses: actions/unstable-commands@v1
|
# run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ steps.version_info.outputs.result }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained
|
||||||
with:
|
# if: forgejo.event_name == 'pull_request'
|
||||||
commands: dotnet test --no-build -c "${{ matrix.configuration }}"
|
# - name: Packing Windows builds
|
||||||
timeout-minutes: 10
|
# if: contains(matrix.platform.name, 'win')
|
||||||
retry-codes: 139
|
# run: |
|
||||||
if: matrix.platform.name != 'linux-arm64'
|
# 7z a artifact/ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}.7z publish
|
||||||
|
# shell: bash
|
||||||
- name: Publish Ryujinx
|
# - name: Upload Ryujinx Windows artifact
|
||||||
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ steps.version_info.outputs.result }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained
|
# uses: actions/upload-artifact@v5
|
||||||
if: forgejo.event_name == 'pull_request'
|
# with:
|
||||||
|
# name: ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}
|
||||||
- name: Packing Windows builds
|
# path: artifact
|
||||||
if: contains(matrix.platform.name, 'win')
|
# if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'win')
|
||||||
run: |
|
# - name: Build AppImage
|
||||||
7z a artifact/ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}.7z publish
|
# if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'linux')
|
||||||
shell: bash
|
# run: |
|
||||||
|
# chmod +x ./publish/Ryujinx ./publish/Ryujinx.sh
|
||||||
- name: Upload Ryujinx Windows artifact
|
# PLATFORM_NAME="${{ matrix.platform.name }}"
|
||||||
uses: actions/upload-artifact@v5
|
# sudo apt update && sudo apt install -y zsync desktop-file-utils appstream libfuse2t64
|
||||||
with:
|
# mkdir -p tools
|
||||||
name: ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}
|
# export PATH="$PATH:$(readlink -f tools)"
|
||||||
path: artifact
|
# wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'win')
|
# chmod +x tools/appimagetool
|
||||||
|
# chmod +x distribution/linux/appimage/build-appimage.sh
|
||||||
- name: Build AppImage
|
# if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
||||||
if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'linux')
|
# ARCH_NAME=x64
|
||||||
run: |
|
# export ARCH=x86_64
|
||||||
chmod +x ./publish/Ryujinx ./publish/Ryujinx.sh
|
# elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
||||||
|
# ARCH_NAME=arm64
|
||||||
PLATFORM_NAME="${{ matrix.platform.name }}"
|
# export ARCH=aarch64
|
||||||
|
# else
|
||||||
sudo apt update && sudo apt install -y zsync desktop-file-utils appstream libfuse2t64
|
# echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
||||||
|
# exit 1
|
||||||
mkdir -p tools
|
# fi
|
||||||
export PATH="$PATH:$(readlink -f tools)"
|
# BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
||||||
|
# shell: bash
|
||||||
# Setup appimagetool
|
# - name: Upload Ryujinx AppImage artifact
|
||||||
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
# uses: actions/upload-artifact@v5
|
||||||
chmod +x tools/appimagetool
|
# if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'linux')
|
||||||
chmod +x distribution/linux/appimage/build-appimage.sh
|
# with:
|
||||||
|
# name: ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}-AppImage
|
||||||
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
# path: publish_appimage
|
||||||
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
|
|
||||||
|
|
||||||
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Upload Ryujinx AppImage artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
if: forgejo.event_name == 'pull_request' && contains(matrix.platform.name, 'linux')
|
|
||||||
with:
|
|
||||||
name: ryujinx-${{ matrix.configuration }}-${{ steps.version_info.outputs.result }}+${{ steps.version_info.outputs.git_short_hash }}-${{ matrix.platform.zip_os_name }}-AppImage
|
|
||||||
path: publish_appimage
|
|
||||||
|
|
||||||
build_macos:
|
build_macos:
|
||||||
name: macOS Universal (${{ matrix.configuration }})
|
name: macOS Universal (${{ matrix.configuration }})
|
||||||
|
|
|
||||||
|
|
@ -34,110 +34,6 @@ namespace Ryujinx.Cpu.AppleHv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Pc
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_reg(_vcpu, HvReg.PC, out ulong pc).ThrowOnError();
|
|
||||||
return pc;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_reg(_vcpu, HvReg.PC, value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ulong ElrEl1
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.ELR_EL1, out ulong elr).ThrowOnError();
|
|
||||||
return elr;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.ELR_EL1, value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ulong EsrEl1
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.ESR_EL1, out ulong esr).ThrowOnError();
|
|
||||||
return esr;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.ESR_EL1, value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public long TpidrEl0
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.TPIDR_EL0, out ulong tpidrEl0).ThrowOnError();
|
|
||||||
return (long)tpidrEl0;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.TPIDR_EL0, (ulong)value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public long TpidrroEl0
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.TPIDRRO_EL0, out ulong tpidrroEl0).ThrowOnError();
|
|
||||||
return (long)tpidrroEl0;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.TPIDRRO_EL0, (ulong)value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Pstate
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_reg(_vcpu, HvReg.CPSR, out ulong cpsr).ThrowOnError();
|
|
||||||
return (uint)cpsr;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_reg(_vcpu, HvReg.CPSR, (ulong)value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Fpcr
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_reg(_vcpu, HvReg.FPCR, out ulong fpcr).ThrowOnError();
|
|
||||||
return (uint)fpcr;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_reg(_vcpu, HvReg.FPCR, (ulong)value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Fpsr
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_get_reg(_vcpu, HvReg.FPSR, out ulong fpsr).ThrowOnError();
|
|
||||||
return (uint)fpsr;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
HvApi.hv_vcpu_set_reg(_vcpu, HvReg.FPSR, (ulong)value).ThrowOnError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly ulong _vcpu;
|
private readonly ulong _vcpu;
|
||||||
private int _interruptRequested;
|
private int _interruptRequested;
|
||||||
|
|
||||||
|
|
@ -146,19 +42,163 @@ namespace Ryujinx.Cpu.AppleHv
|
||||||
_vcpu = vcpu;
|
_vcpu = vcpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ulong Pc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.PC, out ulong pc);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on PC"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.PC, value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on PC (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ElrEl1
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.ELR_EL1, out ulong elr);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on ELR_EL1"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return elr;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.ELR_EL1, value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on ELR_EL1 (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong EsrEl1
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.ESR_EL1, out ulong esr);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on ESR_EL1"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return esr;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.ESR_EL1, value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on ESR_EL1 (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public long TpidrEl0
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.TPIDR_EL0, out ulong val);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on TPIDR_EL0"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return (long)val;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.TPIDR_EL0, (ulong)value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on TPIDR_EL0 (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public long TpidrroEl0
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.TPIDRRO_EL0, out ulong val);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on TPIDRRO_EL0"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return (long)val;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.TPIDRRO_EL0, (ulong)value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on TPIDRRO_EL0 (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public uint Pstate
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.CPSR, out ulong cpsr);
|
||||||
|
if (result == HvResult.BadArgument)
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on CPSR (Pstate) - common during early GetThreadContext3");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
result.ThrowOnError();
|
||||||
|
return (uint)cpsr;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.CPSR, (ulong)value);
|
||||||
|
if (result == HvResult.BadArgument)
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on CPSR (set)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public uint Fpcr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.FPCR, out ulong val);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on FPCR"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return (uint)val;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.FPCR, (ulong)value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on FPCR (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public uint Fpsr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.FPSR, out ulong val);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on FPSR"); return 0; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
return (uint)val;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.FPSR, (ulong)value);
|
||||||
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on FPSR (set)"); return; }
|
||||||
|
result.ThrowOnError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ulong GetX(int index)
|
public ulong GetX(int index)
|
||||||
{
|
{
|
||||||
if (index == 31)
|
if (index == 31)
|
||||||
{
|
{
|
||||||
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.SP_EL0, out ulong value);
|
var result = HvApi.hv_vcpu_get_sys_reg(_vcpu, HvSysReg.SP_EL0, out ulong value);
|
||||||
if (result == HvResult.BadArgument) return 0;
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on SP_EL0 (X31)"); return 0; }
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
else if (index >= 0 && index <= 30)
|
else if (index >= 0 && index <= 30)
|
||||||
{
|
{
|
||||||
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.X0 + (uint)index, out ulong value);
|
var result = HvApi.hv_vcpu_get_reg(_vcpu, HvReg.X0 + (uint)index, out ulong value);
|
||||||
if (result == HvResult.BadArgument) return 0;
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, $"HV_BAD_ARGUMENT on X{index}"); return 0; }
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
@ -170,13 +210,13 @@ namespace Ryujinx.Cpu.AppleHv
|
||||||
if (index == 31)
|
if (index == 31)
|
||||||
{
|
{
|
||||||
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.SP_EL0, value);
|
var result = HvApi.hv_vcpu_set_sys_reg(_vcpu, HvSysReg.SP_EL0, value);
|
||||||
if (result == HvResult.BadArgument) return;
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, "HV_BAD_ARGUMENT on SP_EL0 (set)"); return; }
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
}
|
}
|
||||||
else if (index >= 0 && index <= 30)
|
else if (index >= 0 && index <= 30)
|
||||||
{
|
{
|
||||||
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.X0 + (uint)index, value);
|
var result = HvApi.hv_vcpu_set_reg(_vcpu, HvReg.X0 + (uint)index, value);
|
||||||
if (result == HvResult.BadArgument) return;
|
if (result == HvResult.BadArgument) { Logger.Warning?.Print(LogClass.Cpu, $"HV_BAD_ARGUMENT on X{index} (set)"); return; }
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -184,19 +224,16 @@ namespace Ryujinx.Cpu.AppleHv
|
||||||
public V128 GetV(int index)
|
public V128 GetV(int index)
|
||||||
{
|
{
|
||||||
if (index < 0 || index > 31)
|
if (index < 0 || index > 31)
|
||||||
{
|
|
||||||
return V128.Zero;
|
return V128.Zero;
|
||||||
}
|
|
||||||
|
|
||||||
var result = HvApi.hv_vcpu_get_simd_fp_reg(_vcpu, HvSimdFPReg.Q0 + (uint)index, out HvSimdFPUchar16 value);
|
var result = HvApi.hv_vcpu_get_simd_fp_reg(_vcpu, HvSimdFPReg.Q0 + (uint)index, out HvSimdFPUchar16 value);
|
||||||
if (result == HvResult.BadArgument)
|
if (result == HvResult.BadArgument)
|
||||||
{
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Cpu, $"HV_BAD_ARGUMENT on V{index} (SIMD)");
|
||||||
return V128.Zero;
|
return V128.Zero;
|
||||||
}
|
}
|
||||||
if (result != HvResult.Success)
|
if (result != HvResult.Success)
|
||||||
{
|
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
}
|
|
||||||
|
|
||||||
return new V128(value.Low, value.High);
|
return new V128(value.Low, value.High);
|
||||||
}
|
}
|
||||||
|
|
@ -204,19 +241,16 @@ namespace Ryujinx.Cpu.AppleHv
|
||||||
public void SetV(int index, V128 value)
|
public void SetV(int index, V128 value)
|
||||||
{
|
{
|
||||||
if (index < 0 || index > 31)
|
if (index < 0 || index > 31)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
var result = _setSimdFpReg(_vcpu, HvSimdFPReg.Q0 + (uint)index, value, _setSimdFpRegNativePtr);
|
var result = _setSimdFpReg(_vcpu, HvSimdFPReg.Q0 + (uint)index, value, _setSimdFpRegNativePtr);
|
||||||
if (result == HvResult.BadArgument)
|
if (result == HvResult.BadArgument)
|
||||||
{
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Cpu, $"HV_BAD_ARGUMENT on V{index} (SIMD set)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result != HvResult.Success)
|
if (result != HvResult.Success)
|
||||||
{
|
|
||||||
result.ThrowOnError();
|
result.ThrowOnError();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestInterrupt()
|
public void RequestInterrupt()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue