mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-05 04:46:37 +00:00
Compare commits
13 Commits
Canary-1.3
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
d22756f1bd | ||
|
324f18aa5f | ||
|
31870707cf | ||
|
fd6648e30a | ||
|
bc6be4e088 | ||
|
64a6494d90 | ||
|
ddb8afa6f4 | ||
|
c2f4118b1f | ||
|
47aa2c1513 | ||
|
f3a2f59683 | ||
|
51bcb9e128 | ||
|
dce5f0eb55 | ||
|
f2eb3749f9 |
78
.github/workflows/canary.yml
vendored
78
.github/workflows/canary.yml
vendored
@ -106,45 +106,47 @@ jobs:
|
|||||||
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"
|
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)
|
# If anyone wants to look into why appimagetool randomly errors with exit code 8, that would be cool
|
||||||
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
|
# - name: Build AppImage (Linux)
|
||||||
|
# if: matrix.platform.os == 'ubuntu-latest'
|
||||||
mkdir -p tools
|
# run: |
|
||||||
export PATH="$PATH:$(readlink -f tools)"
|
# BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
|
||||||
|
# PLATFORM_NAME="${{ matrix.platform.name }}"
|
||||||
# Setup appimagetool
|
#
|
||||||
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
# sudo apt install -y zsync desktop-file-utils appstream
|
||||||
chmod +x tools/appimagetool
|
#
|
||||||
chmod +x distribution/linux/appimage/build-appimage.sh
|
# mkdir -p tools
|
||||||
|
# export PATH="$PATH:$(readlink -f tools)"
|
||||||
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
#
|
||||||
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
# # Setup appimagetool
|
||||||
ARCH_NAME=x64
|
# wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
export ARCH=x86_64
|
# chmod +x tools/appimagetool
|
||||||
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
# chmod +x distribution/linux/appimage/build-appimage.sh
|
||||||
ARCH_NAME=arm64
|
#
|
||||||
export ARCH=aarch64
|
# # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
||||||
else
|
# if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
||||||
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
# ARCH_NAME=x64
|
||||||
exit 1
|
# export ARCH=x86_64
|
||||||
fi
|
# elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
||||||
|
# ARCH_NAME=arm64
|
||||||
export UFLAG="gh-releases-zsync|${{ secrets.RC_OWNER }}${{ secrets.RC_CANARY_NAME }}|latest|*-$ARCH_NAME.AppImage.zsync"
|
# export ARCH=aarch64
|
||||||
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
# else
|
||||||
|
# echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
||||||
pushd publish_appimage
|
# exit 1
|
||||||
mv Ryujinx.AppImage ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage
|
# fi
|
||||||
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
|
#
|
||||||
popd
|
# export UFLAG="gh-releases-zsync|${{ secrets.RC_OWNER }}${{ secrets.RC_CANARY_NAME }}|latest|*-$ARCH_NAME.AppImage.zsync"
|
||||||
|
# BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
||||||
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"
|
# pushd publish_appimage
|
||||||
shell: bash
|
# 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
|
||||||
|
# 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
|
||||||
|
|
||||||
macos_release:
|
macos_release:
|
||||||
name: Release MacOS universal
|
name: Release MacOS universal
|
||||||
|
78
.github/workflows/release.yml
vendored
78
.github/workflows/release.yml
vendored
@ -97,45 +97,47 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build AppImage (Linux)
|
# If anyone wants to look into why appimagetool randomly errors with exit code 8, that would be cool
|
||||||
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
|
# - name: Build AppImage (Linux)
|
||||||
|
# if: matrix.platform.os == 'ubuntu-latest'
|
||||||
mkdir -p tools
|
# run: |
|
||||||
export PATH="$PATH:$(readlink -f tools)"
|
# BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
|
||||||
|
# PLATFORM_NAME="${{ matrix.platform.name }}"
|
||||||
# Setup appimagetool
|
#
|
||||||
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
# sudo apt install -y zsync desktop-file-utils appstream
|
||||||
chmod +x tools/appimagetool
|
#
|
||||||
chmod +x distribution/linux/appimage/build-appimage.sh
|
# mkdir -p tools
|
||||||
|
# export PATH="$PATH:$(readlink -f tools)"
|
||||||
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
#
|
||||||
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
# # Setup appimagetool
|
||||||
ARCH_NAME=x64
|
# wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
export ARCH=x86_64
|
# chmod +x tools/appimagetool
|
||||||
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
# chmod +x distribution/linux/appimage/build-appimage.sh
|
||||||
ARCH_NAME=arm64
|
#
|
||||||
export ARCH=aarch64
|
# # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
||||||
else
|
# if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
||||||
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
# ARCH_NAME=x64
|
||||||
exit 1
|
# export ARCH=x86_64
|
||||||
fi
|
# elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
||||||
|
# ARCH_NAME=arm64
|
||||||
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
|
# export ARCH=aarch64
|
||||||
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
# else
|
||||||
|
# echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
||||||
pushd publish_appimage
|
# exit 1
|
||||||
mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
|
# fi
|
||||||
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
|
#
|
||||||
popd
|
# 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
|
||||||
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"
|
# pushd publish_appimage
|
||||||
shell: bash
|
# 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:
|
macos_release:
|
||||||
name: Release MacOS universal
|
name: Release MacOS universal
|
||||||
|
2619
assets/locales.json
2619
assets/locales.json
File diff suppressed because it is too large
Load Diff
@ -188,6 +188,8 @@
|
|||||||
01003DD00BFEE000,"Airheart - Tales of broken Wings",,playable,2021-02-26 15:20:27
|
01003DD00BFEE000,"Airheart - Tales of broken Wings",,playable,2021-02-26 15:20:27
|
||||||
01007F100DE52000,"Akane",nvdec,playable,2022-07-21 00:12:18
|
01007F100DE52000,"Akane",nvdec,playable,2022-07-21 00:12:18
|
||||||
01009A800F0C8000,"Akash: Path of the Five",gpu;nvdec,ingame,2020-12-14 22:33:12
|
01009A800F0C8000,"Akash: Path of the Five",gpu;nvdec,ingame,2020-12-14 22:33:12
|
||||||
|
01009E8012976000,"AKIBA'S TRIP: Hellbound & Debriefed",,playable,2025-07-30 23:22:47
|
||||||
|
0100D74019A0E000,"AKIBA'S TRIP: Undead & Undressed Director's Cut",,playable,2025-07-31 13:58:42
|
||||||
010053100B0EA000,"Akihabara - Feel the Rhythm Remixed",,playable,2021-02-22 14:39:35
|
010053100B0EA000,"Akihabara - Feel the Rhythm Remixed",,playable,2021-02-22 14:39:35
|
||||||
0100D4C00EE0C000,"Akuarium",slow,playable,2020-12-12 23:43:36
|
0100D4C00EE0C000,"Akuarium",slow,playable,2020-12-12 23:43:36
|
||||||
010026E00FEBE000,"Akuto: Showdown",,playable,2020-08-04 19:43:27
|
010026E00FEBE000,"Akuto: Showdown",,playable,2020-08-04 19:43:27
|
||||||
@ -1095,6 +1097,7 @@
|
|||||||
0100F9600E746000,"ESP Ra.De. Psi",audio;slow,ingame,2024-03-07 15:05:08
|
0100F9600E746000,"ESP Ra.De. Psi",audio;slow,ingame,2024-03-07 15:05:08
|
||||||
010073000FE18000,"Esports powerful pro yakyuu 2020",gpu;crash;Needs More Attention,ingame,2024-04-29 05:34:14
|
010073000FE18000,"Esports powerful pro yakyuu 2020",gpu;crash;Needs More Attention,ingame,2024-04-29 05:34:14
|
||||||
01004F9012FD8000,"Estranged: The Departure",nvdec;UE4,playable,2022-10-24 10:37:58
|
01004F9012FD8000,"Estranged: The Departure",nvdec;UE4,playable,2022-10-24 10:37:58
|
||||||
|
010018f01e0a0000,"Eternights",,playable,2025-07-30 12:10:24
|
||||||
0100CB900B498000,"Eternum Ex",,playable,2021-01-13 20:28:32
|
0100CB900B498000,"Eternum Ex",,playable,2021-01-13 20:28:32
|
||||||
010092501EB2C000,"Europa (Demo)",gpu;crash;UE4,ingame,2024-04-23 10:47:12
|
010092501EB2C000,"Europa (Demo)",gpu;crash;UE4,ingame,2024-04-23 10:47:12
|
||||||
01007BE0160D6000,"EVE ghost enemies",gpu,ingame,2023-01-14 03:13:30
|
01007BE0160D6000,"EVE ghost enemies",gpu,ingame,2023-01-14 03:13:30
|
||||||
@ -1240,6 +1243,8 @@
|
|||||||
010003F00BD48000,"Friday the 13th: Killer Puzzle",,playable,2021-01-28 01:33:38
|
010003F00BD48000,"Friday the 13th: Killer Puzzle",,playable,2021-01-28 01:33:38
|
||||||
010092A00C4B6000,"Friday the 13th: The Game Ultimate Slasher Edition",nvdec;online-broken;UE4,playable,2022-09-06 17:33:27
|
010092A00C4B6000,"Friday the 13th: The Game Ultimate Slasher Edition",nvdec;online-broken;UE4,playable,2022-09-06 17:33:27
|
||||||
0100F200178F4000,"FRONT MISSION 1st: Remake",,playable,2023-06-09 07:44:24
|
0100F200178F4000,"FRONT MISSION 1st: Remake",,playable,2023-06-09 07:44:24
|
||||||
|
0100c4e018a24000,"FRONT MISSION 2: Remake",,playable,2025-07-30 12:11:23
|
||||||
|
01007E6019872000,"FRONT MISSION 3: Remake",,playable,2025-07-30 12:12:02
|
||||||
0100861012474000,"Frontline Zed",,playable,2020-10-03 12:55:59
|
0100861012474000,"Frontline Zed",,playable,2020-10-03 12:55:59
|
||||||
0100B5300B49A000,"Frost",,playable,2022-07-27 12:00:36
|
0100B5300B49A000,"Frost",,playable,2022-07-27 12:00:36
|
||||||
010038A007AA4000,"FruitFall Crush",,playable,2020-10-20 11:33:33
|
010038A007AA4000,"FruitFall Crush",,playable,2020-10-20 11:33:33
|
||||||
@ -1518,6 +1523,7 @@
|
|||||||
010095C016C14000,"Iridium",,playable,2022-08-05 23:19:53
|
010095C016C14000,"Iridium",,playable,2022-08-05 23:19:53
|
||||||
0100AD300B786000,"Iris School of Wizardry -Vinculum Hearts-",,playable,2022-12-05 13:11:15
|
0100AD300B786000,"Iris School of Wizardry -Vinculum Hearts-",,playable,2022-12-05 13:11:15
|
||||||
0100945012168000,"Iris.Fall",nvdec,playable,2022-10-18 13:40:22
|
0100945012168000,"Iris.Fall",nvdec,playable,2022-10-18 13:40:22
|
||||||
|
010059801B736000,"IronFall: Invasion",,playable,2025-07-30 11:42:30
|
||||||
01005270118D6000,"Iron Wings",slow,ingame,2022-08-07 08:32:57
|
01005270118D6000,"Iron Wings",slow,ingame,2022-08-07 08:32:57
|
||||||
01004DB003E6A000,"IRONCAST",,playable,2021-01-13 13:54:29
|
01004DB003E6A000,"IRONCAST",,playable,2021-01-13 13:54:29
|
||||||
0100E5700CD56000,"Irony Curtain: From Matryoshka with Love",,playable,2021-06-04 20:12:37
|
0100E5700CD56000,"Irony Curtain: From Matryoshka with Love",,playable,2021-06-04 20:12:37
|
||||||
@ -2257,6 +2263,7 @@
|
|||||||
010086F0064CE000,"Poi: Explorer Edition",nvdec,playable,2021-01-21 19:32:00
|
010086F0064CE000,"Poi: Explorer Edition",nvdec,playable,2021-01-21 19:32:00
|
||||||
0100EB6012FD2000,"Poison Control",,playable,2021-05-16 14:01:54
|
0100EB6012FD2000,"Poison Control",,playable,2021-05-16 14:01:54
|
||||||
010072400E04A000,"Pokémon Café ReMix",,playable,2021-08-17 20:00:04
|
010072400E04A000,"Pokémon Café ReMix",,playable,2021-08-17 20:00:04
|
||||||
|
010008c01e742000,"Pokémon Friends",crash;services,menus,2025-07-24 13:32:00
|
||||||
01003D200BAA2000,"Pokémon Mystery Dungeon™: Rescue Team DX",mac-bug,playable,2024-01-21 00:16:32
|
01003D200BAA2000,"Pokémon Mystery Dungeon™: Rescue Team DX",mac-bug,playable,2024-01-21 00:16:32
|
||||||
01008DB008C2C000,"Pokémon Shield + Pokémon Shield Expansion Pass",deadlock;crash;online-broken;ldn-works;LAN,ingame,2024-08-12 07:20:22
|
01008DB008C2C000,"Pokémon Shield + Pokémon Shield Expansion Pass",deadlock;crash;online-broken;ldn-works;LAN,ingame,2024-08-12 07:20:22
|
||||||
0100ABF008968000,"Pokémon Sword + Pokémon Sword Expansion Pass",deadlock;crash;online-broken;ldn-works;LAN,ingame,2024-08-26 15:40:37
|
0100ABF008968000,"Pokémon Sword + Pokémon Sword Expansion Pass",deadlock;crash;online-broken;ldn-works;LAN,ingame,2024-08-26 15:40:37
|
||||||
@ -2305,6 +2312,7 @@
|
|||||||
010077B00BDD8000,"Professional Farmer: Nintendo Switch™ Edition",slow,playable,2020-12-16 13:38:19
|
010077B00BDD8000,"Professional Farmer: Nintendo Switch™ Edition",slow,playable,2020-12-16 13:38:19
|
||||||
010018300C83A000,"Professor Lupo and his Horrible Pets",,playable,2020-06-12 00:08:45
|
010018300C83A000,"Professor Lupo and his Horrible Pets",,playable,2020-06-12 00:08:45
|
||||||
0100D1F0132F6000,"Professor Lupo: Ocean",,playable,2021-04-14 16:33:33
|
0100D1F0132F6000,"Professor Lupo: Ocean",,playable,2021-04-14 16:33:33
|
||||||
|
0100c3a017834000,"Prodeus",,playable,2025-07-30 12:07:52
|
||||||
0100BBD00976C000,"Project Highrise: Architect's Edition",,playable,2022-08-10 17:19:12
|
0100BBD00976C000,"Project Highrise: Architect's Edition",,playable,2022-08-10 17:19:12
|
||||||
0100ACE00DAB6000,"Project Nimbus: Complete Edition",nvdec;UE4;vulkan-backend-bug,playable,2022-08-10 17:35:43
|
0100ACE00DAB6000,"Project Nimbus: Complete Edition",nvdec;UE4;vulkan-backend-bug,playable,2022-08-10 17:35:43
|
||||||
01002980140F6000,"Project TRIANGLE STRATEGY™ Debut Demo",UE4;demo,playable,2022-10-24 21:40:27
|
01002980140F6000,"Project TRIANGLE STRATEGY™ Debut Demo",UE4;demo,playable,2022-10-24 21:40:27
|
||||||
@ -2767,7 +2775,7 @@
|
|||||||
0100E6B0115FC000,"Star99",online,menus,2021-11-26 14:18:51
|
0100E6B0115FC000,"Star99",online,menus,2021-11-26 14:18:51
|
||||||
01002100137BA000,"Stardash",,playable,2021-01-21 16:31:19
|
01002100137BA000,"Stardash",,playable,2021-01-21 16:31:19
|
||||||
0100E65002BB8000,"Stardew Valley",online-broken;ldn-untested,playable,2024-02-14 03:11:19
|
0100E65002BB8000,"Stardew Valley",online-broken;ldn-untested,playable,2024-02-14 03:11:19
|
||||||
01002CC003FE6000,"Starlink: Battle for Atlas™ Digital Edition",services-horizon;crash;Needs Update,nothing,2024-05-05 17:25:11
|
01002CC003FE6000,"Starlink: Battle for Atlas™ Digital Edition",,playable,2025-07-30 12:09:37
|
||||||
010098E010FDA000,"Starlit Adventures Golden Stars",,playable,2020-11-21 12:14:43
|
010098E010FDA000,"Starlit Adventures Golden Stars",,playable,2020-11-21 12:14:43
|
||||||
01001BB00AC26000,"STARSHIP AVENGER Operation: Take Back Earth",,playable,2021-01-12 15:52:55
|
01001BB00AC26000,"STARSHIP AVENGER Operation: Take Back Earth",,playable,2021-01-12 15:52:55
|
||||||
010000700A572000,"State of Anarchy: Master of Mayhem",nvdec,playable,2021-01-12 19:00:05
|
010000700A572000,"State of Anarchy: Master of Mayhem",nvdec,playable,2021-01-12 19:00:05
|
||||||
@ -2975,6 +2983,7 @@
|
|||||||
0100C2E0129A6000,"The Executioner",nvdec,playable,2021-01-23 00:31:28
|
0100C2E0129A6000,"The Executioner",nvdec,playable,2021-01-23 00:31:28
|
||||||
01006050114D4000,"The Experiment: Escape Room",gpu,ingame,2022-09-30 13:20:35
|
01006050114D4000,"The Experiment: Escape Room",gpu,ingame,2022-09-30 13:20:35
|
||||||
0100B5900DFB2000,"The Eyes of Ara",,playable,2022-09-16 14:44:06
|
0100B5900DFB2000,"The Eyes of Ara",,playable,2022-09-16 14:44:06
|
||||||
|
0100BA5013E52000,"The Falconeer: Warrior Edition",,playable,2025-07-30 12:04:50
|
||||||
01002DD00AF9E000,"The Fall",gpu,ingame,2020-05-31 23:31:16
|
01002DD00AF9E000,"The Fall",gpu,ingame,2020-05-31 23:31:16
|
||||||
01003E5002320000,"The Fall Part 2: Unbound",,playable,2021-11-06 02:18:08
|
01003E5002320000,"The Fall Part 2: Unbound",,playable,2021-11-06 02:18:08
|
||||||
0100CDC00789E000,"The Final Station",nvdec,playable,2022-08-22 15:54:39
|
0100CDC00789E000,"The Final Station",nvdec,playable,2022-08-22 15:54:39
|
||||||
@ -3197,6 +3206,7 @@
|
|||||||
010000400F582000,"TT Isle of Man Ride on the Edge 2",gpu;nvdec;online-broken,ingame,2022-09-30 22:13:05
|
010000400F582000,"TT Isle of Man Ride on the Edge 2",gpu;nvdec;online-broken,ingame,2022-09-30 22:13:05
|
||||||
0100752011628000,"TTV2",,playable,2020-11-27 13:21:36
|
0100752011628000,"TTV2",,playable,2020-11-27 13:21:36
|
||||||
0100AFE00452E000,"Tumblestone",,playable,2021-01-07 17:49:20
|
0100AFE00452E000,"Tumblestone",,playable,2021-01-07 17:49:20
|
||||||
|
0100D1A01D7BA000,"Turbo Overkill",,playable,2025-07-30 12:08:57
|
||||||
010085500D5F6000,"Turok",gpu,ingame,2021-06-04 13:16:24
|
010085500D5F6000,"Turok",gpu,ingame,2021-06-04 13:16:24
|
||||||
0100CDC00D8D6000,"Turok 2: Seeds of Evil",gpu;vulkan,ingame,2022-09-12 17:50:05
|
0100CDC00D8D6000,"Turok 2: Seeds of Evil",gpu;vulkan,ingame,2022-09-12 17:50:05
|
||||||
010004B0130C8000,"Turrican Flashback",audout,playable,2021-08-30 10:07:56
|
010004B0130C8000,"Turrican Flashback",audout,playable,2021-08-30 10:07:56
|
||||||
@ -3220,6 +3230,8 @@
|
|||||||
0100592005164000,"UNBOX: Newbie's Adventure",UE4,playable,2022-08-29 13:12:56
|
0100592005164000,"UNBOX: Newbie's Adventure",UE4,playable,2022-08-29 13:12:56
|
||||||
01002D900C5E4000,"Uncanny Valley",nvdec,playable,2021-06-04 13:28:45
|
01002D900C5E4000,"Uncanny Valley",nvdec,playable,2021-06-04 13:28:45
|
||||||
010076F011F54000,"Undead & Beyond",nvdec,playable,2022-10-04 09:11:18
|
010076F011F54000,"Undead & Beyond",nvdec,playable,2022-10-04 09:11:18
|
||||||
|
01009B700D0B8000,"Undead Horde",,playable,2025-07-30 12:05:05
|
||||||
|
0100FC301A878000,"Undead Horde 2: Necropolis",,playable,2025-07-30 12:06:07
|
||||||
01008F3013E4E000,"Under Leaves",,playable,2021-05-22 18:13:58
|
01008F3013E4E000,"Under Leaves",,playable,2021-05-22 18:13:58
|
||||||
010080B00AD66000,"Undertale",,playable,2022-08-31 17:31:46
|
010080B00AD66000,"Undertale",,playable,2022-08-31 17:31:46
|
||||||
01008F80049C6000,"Unepic",,playable,2024-01-15 17:03:00
|
01008F80049C6000,"Unepic",,playable,2024-01-15 17:03:00
|
||||||
|
|
@ -3,6 +3,7 @@ using ARMeilleure.State;
|
|||||||
using ARMeilleure.Translation;
|
using ARMeilleure.Translation;
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using ExecutionContext = ARMeilleure.State.ExecutionContext;
|
||||||
|
|
||||||
namespace ARMeilleure.Instructions
|
namespace ARMeilleure.Instructions
|
||||||
{
|
{
|
||||||
@ -200,7 +201,11 @@ namespace ARMeilleure.Instructions
|
|||||||
|
|
||||||
ExecutionContext context = GetContext();
|
ExecutionContext context = GetContext();
|
||||||
|
|
||||||
context.CheckInterrupt();
|
// If debugging, we'll handle interrupts outside
|
||||||
|
if (!Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
context.CheckInterrupt();
|
||||||
|
}
|
||||||
|
|
||||||
Statistics.ResumeTimer();
|
Statistics.ResumeTimer();
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ namespace ARMeilleure
|
|||||||
|
|
||||||
public static bool AllowLcqInFunctionTable { get; set; } = true;
|
public static bool AllowLcqInFunctionTable { get; set; } = true;
|
||||||
public static bool UseUnmanagedDispatchLoop { get; set; } = true;
|
public static bool UseUnmanagedDispatchLoop { get; set; } = true;
|
||||||
|
public static bool EnableDebugging { get; set; } = false;
|
||||||
|
|
||||||
public static bool UseAdvSimdIfAvailable { get; set; } = true;
|
public static bool UseAdvSimdIfAvailable { get; set; } = true;
|
||||||
public static bool UseArm64AesIfAvailable { get; set; } = true;
|
public static bool UseArm64AesIfAvailable { get; set; } = true;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using ARMeilleure.Memory;
|
using ARMeilleure.Memory;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace ARMeilleure.State
|
namespace ARMeilleure.State
|
||||||
{
|
{
|
||||||
@ -10,7 +11,7 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
internal nint NativeContextPtr => _nativeContext.BasePtr;
|
internal nint NativeContextPtr => _nativeContext.BasePtr;
|
||||||
|
|
||||||
private bool _interrupted;
|
internal bool Interrupted { get; private set; }
|
||||||
|
|
||||||
private readonly ICounter _counter;
|
private readonly ICounter _counter;
|
||||||
|
|
||||||
@ -65,6 +66,8 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
public bool IsAarch32 { get; set; }
|
public bool IsAarch32 { get; set; }
|
||||||
|
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
internal ExecutionMode ExecutionMode
|
internal ExecutionMode ExecutionMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -90,14 +93,19 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
private readonly ExceptionCallbackNoArgs _interruptCallback;
|
private readonly ExceptionCallbackNoArgs _interruptCallback;
|
||||||
private readonly ExceptionCallback _breakCallback;
|
private readonly ExceptionCallback _breakCallback;
|
||||||
|
private readonly ExceptionCallbackNoArgs _stepCallback;
|
||||||
private readonly ExceptionCallback _supervisorCallback;
|
private readonly ExceptionCallback _supervisorCallback;
|
||||||
private readonly ExceptionCallback _undefinedCallback;
|
private readonly ExceptionCallback _undefinedCallback;
|
||||||
|
|
||||||
|
internal int ShouldStep;
|
||||||
|
public ulong DebugPc { get; set; }
|
||||||
|
|
||||||
public ExecutionContext(
|
public ExecutionContext(
|
||||||
IJitMemoryAllocator allocator,
|
IJitMemoryAllocator allocator,
|
||||||
ICounter counter,
|
ICounter counter,
|
||||||
ExceptionCallbackNoArgs interruptCallback = null,
|
ExceptionCallbackNoArgs interruptCallback = null,
|
||||||
ExceptionCallback breakCallback = null,
|
ExceptionCallback breakCallback = null,
|
||||||
|
ExceptionCallbackNoArgs stepCallback = null,
|
||||||
ExceptionCallback supervisorCallback = null,
|
ExceptionCallback supervisorCallback = null,
|
||||||
ExceptionCallback undefinedCallback = null)
|
ExceptionCallback undefinedCallback = null)
|
||||||
{
|
{
|
||||||
@ -105,6 +113,7 @@ namespace ARMeilleure.State
|
|||||||
_counter = counter;
|
_counter = counter;
|
||||||
_interruptCallback = interruptCallback;
|
_interruptCallback = interruptCallback;
|
||||||
_breakCallback = breakCallback;
|
_breakCallback = breakCallback;
|
||||||
|
_stepCallback = stepCallback;
|
||||||
_supervisorCallback = supervisorCallback;
|
_supervisorCallback = supervisorCallback;
|
||||||
_undefinedCallback = undefinedCallback;
|
_undefinedCallback = undefinedCallback;
|
||||||
|
|
||||||
@ -127,9 +136,9 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
internal void CheckInterrupt()
|
internal void CheckInterrupt()
|
||||||
{
|
{
|
||||||
if (_interrupted)
|
if (Interrupted)
|
||||||
{
|
{
|
||||||
_interrupted = false;
|
Interrupted = false;
|
||||||
|
|
||||||
_interruptCallback?.Invoke(this);
|
_interruptCallback?.Invoke(this);
|
||||||
}
|
}
|
||||||
@ -139,16 +148,37 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
public void RequestInterrupt()
|
public void RequestInterrupt()
|
||||||
{
|
{
|
||||||
_interrupted = true;
|
Interrupted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StepHandler()
|
||||||
|
{
|
||||||
|
_stepCallback?.Invoke(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestDebugStep()
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref ShouldStep, 1);
|
||||||
|
RequestInterrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void OnBreak(ulong address, int imm)
|
internal void OnBreak(ulong address, int imm)
|
||||||
{
|
{
|
||||||
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
DebugPc = Pc;
|
||||||
|
}
|
||||||
|
|
||||||
_breakCallback?.Invoke(this, address, imm);
|
_breakCallback?.Invoke(this, address, imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void OnSupervisorCall(ulong address, int imm)
|
internal void OnSupervisorCall(ulong address, int imm)
|
||||||
{
|
{
|
||||||
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
DebugPc = Pc;
|
||||||
|
}
|
||||||
|
|
||||||
_supervisorCallback?.Invoke(this, address, imm);
|
_supervisorCallback?.Invoke(this, address, imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,12 @@ namespace ARMeilleure.State
|
|||||||
public ulong ExclusiveValueHigh;
|
public ulong ExclusiveValueHigh;
|
||||||
public int Running;
|
public int Running;
|
||||||
public long Tpidr2El0;
|
public long Tpidr2El0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Precise PC value used for debugging.
|
||||||
|
/// This will only be set when Optimizations.EnableDebugging is true.
|
||||||
|
/// </summary>
|
||||||
|
public ulong DebugPrecisePc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NativeCtxStorage _dummyStorage = new();
|
private static NativeCtxStorage _dummyStorage = new();
|
||||||
@ -39,6 +45,11 @@ namespace ARMeilleure.State
|
|||||||
|
|
||||||
public ulong GetPc()
|
public ulong GetPc()
|
||||||
{
|
{
|
||||||
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
return GetStorage().DebugPrecisePc;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: More precise tracking of PC value.
|
// TODO: More precise tracking of PC value.
|
||||||
return GetStorage().DispatchAddress;
|
return GetStorage().DispatchAddress;
|
||||||
}
|
}
|
||||||
@ -268,6 +279,11 @@ namespace ARMeilleure.State
|
|||||||
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Running);
|
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Running);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetDebugPrecisePcOffset()
|
||||||
|
{
|
||||||
|
return StorageOffset(ref _dummyStorage, ref _dummyStorage.DebugPrecisePc);
|
||||||
|
}
|
||||||
|
|
||||||
private static int StorageOffset<T>(ref NativeCtxStorage storage, ref T target)
|
private static int StorageOffset<T>(ref NativeCtxStorage storage, ref T target)
|
||||||
{
|
{
|
||||||
return (int)Unsafe.ByteOffset(ref Unsafe.As<NativeCtxStorage, T>(ref storage), ref target);
|
return (int)Unsafe.ByteOffset(ref Unsafe.As<NativeCtxStorage, T>(ref storage), ref target);
|
||||||
|
@ -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 = 7009; //! 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";
|
||||||
@ -303,6 +303,13 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outerHeader.DebuggerMode != Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
InvalidateCompressedStream(compressedStream);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
nint intPtr = nint.Zero;
|
nint intPtr = nint.Zero;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -479,6 +486,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
MemoryManagerMode = GetMemoryManagerMode(),
|
MemoryManagerMode = GetMemoryManagerMode(),
|
||||||
OSPlatform = GetOSPlatform(),
|
OSPlatform = GetOSPlatform(),
|
||||||
Architecture = (uint)RuntimeInformation.ProcessArchitecture,
|
Architecture = (uint)RuntimeInformation.ProcessArchitecture,
|
||||||
|
DebuggerMode = Optimizations.EnableDebugging,
|
||||||
|
|
||||||
UncompressedStreamSize =
|
UncompressedStreamSize =
|
||||||
(long)Unsafe.SizeOf<InnerHeader>() +
|
(long)Unsafe.SizeOf<InnerHeader>() +
|
||||||
@ -1068,7 +1076,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
return osPlatform;
|
return osPlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1/*, Size = 86*/)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1/*, Size = 87*/)]
|
||||||
private struct OuterHeader
|
private struct OuterHeader
|
||||||
{
|
{
|
||||||
public ulong Magic;
|
public ulong Magic;
|
||||||
@ -1080,6 +1088,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
public byte MemoryManagerMode;
|
public byte MemoryManagerMode;
|
||||||
public uint OSPlatform;
|
public uint OSPlatform;
|
||||||
public uint Architecture;
|
public uint Architecture;
|
||||||
|
public bool DebuggerMode;
|
||||||
|
|
||||||
public long UncompressedStreamSize;
|
public long UncompressedStreamSize;
|
||||||
|
|
||||||
|
@ -119,7 +119,25 @@ namespace ARMeilleure.Translation
|
|||||||
|
|
||||||
NativeInterface.RegisterThread(context, Memory, this);
|
NativeInterface.RegisterThread(context, Memory, this);
|
||||||
|
|
||||||
if (Optimizations.UseUnmanagedDispatchLoop)
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
context.DebugPc = address;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref context.ShouldStep, 0, 1) == 1)
|
||||||
|
{
|
||||||
|
context.DebugPc = Step(context, context.DebugPc);
|
||||||
|
context.StepHandler();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.DebugPc = ExecuteSingle(context, context.DebugPc);
|
||||||
|
}
|
||||||
|
context.CheckInterrupt();
|
||||||
|
}
|
||||||
|
while (context.Running && context.DebugPc != 0);
|
||||||
|
}
|
||||||
|
else if (Optimizations.UseUnmanagedDispatchLoop)
|
||||||
{
|
{
|
||||||
Stubs.DispatchLoop(context.NativeContextPtr, address);
|
Stubs.DispatchLoop(context.NativeContextPtr, address);
|
||||||
}
|
}
|
||||||
@ -175,8 +193,24 @@ namespace ARMeilleure.Translation
|
|||||||
return nextAddr;
|
return nextAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Step(State.ExecutionContext context, ulong address)
|
private ulong Step(State.ExecutionContext context, ulong address)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OpCode opCode = Decoder.DecodeOpCode(Memory, address, context.ExecutionMode);
|
||||||
|
|
||||||
|
// For branch instructions during single-stepping, we handle them manually
|
||||||
|
// func.Execute() will sometimes execute the entire function call, which is not what we want
|
||||||
|
if (opCode.Instruction.Name is InstName.Bl or InstName.Blr or InstName.Blx or InstName.Br)
|
||||||
|
{
|
||||||
|
return ExecuteBranchInstructionForStepping(context, address, opCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
|
||||||
TranslatedFunction func = Translate(address, context.ExecutionMode, highCq: false, singleStep: true);
|
TranslatedFunction func = Translate(address, context.ExecutionMode, highCq: false, singleStep: true);
|
||||||
|
|
||||||
address = func.Execute(Stubs.ContextWrapper, context);
|
address = func.Execute(Stubs.ContextWrapper, context);
|
||||||
@ -186,6 +220,94 @@ namespace ARMeilleure.Translation
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ulong ExecuteBranchInstructionForStepping(State.ExecutionContext context, ulong address, OpCode opCode)
|
||||||
|
{
|
||||||
|
switch (opCode.Instruction.Name)
|
||||||
|
{
|
||||||
|
case InstName.Bl:
|
||||||
|
if (opCode is IOpCodeBImm opBImm)
|
||||||
|
{
|
||||||
|
// Set link register
|
||||||
|
if (context.ExecutionMode == ExecutionMode.Aarch64)
|
||||||
|
{
|
||||||
|
context.SetX(30, address + (ulong)opCode.OpCodeSizeInBytes); // LR = X30
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// For ARM32, need to set the appropriate return address
|
||||||
|
uint returnAddr = opCode is OpCode32 op32 && op32.IsThumb
|
||||||
|
? (uint)address + (uint)opCode.OpCodeSizeInBytes | 1u // Thumb bit set
|
||||||
|
: (uint)address + (uint)opCode.OpCodeSizeInBytes;
|
||||||
|
context.SetX(14, returnAddr); // LR = R14
|
||||||
|
}
|
||||||
|
return (ulong)opBImm.Immediate;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case InstName.Blr:
|
||||||
|
if (opCode is OpCodeBReg opBReg)
|
||||||
|
{
|
||||||
|
// Set link register
|
||||||
|
if (context.ExecutionMode == ExecutionMode.Aarch64)
|
||||||
|
{
|
||||||
|
context.SetX(30, address + (ulong)opCode.OpCodeSizeInBytes); // LR = X30
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint returnAddr = opCode is OpCode32 op32 && op32.IsThumb
|
||||||
|
? (uint)address + (uint)opCode.OpCodeSizeInBytes | 1u // Thumb bit set
|
||||||
|
: (uint)address + (uint)opCode.OpCodeSizeInBytes;
|
||||||
|
context.SetX(14, returnAddr); // LR = R14
|
||||||
|
}
|
||||||
|
return context.GetX(opBReg.Rn);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case InstName.Blx:
|
||||||
|
if (opCode is IOpCodeBImm opBlxImm)
|
||||||
|
{
|
||||||
|
// Handle mode switching for BLX
|
||||||
|
if (opCode is OpCode32 op32)
|
||||||
|
{
|
||||||
|
uint returnAddr = op32.IsThumb
|
||||||
|
? (uint)address + (uint)opCode.OpCodeSizeInBytes | 1u
|
||||||
|
: (uint)address + (uint)opCode.OpCodeSizeInBytes;
|
||||||
|
context.SetX(14, returnAddr);
|
||||||
|
|
||||||
|
// BLX switches between ARM and Thumb modes
|
||||||
|
context.SetPstateFlag(PState.TFlag, !op32.IsThumb);
|
||||||
|
}
|
||||||
|
return (ulong)opBlxImm.Immediate;
|
||||||
|
}
|
||||||
|
else if (opCode is IOpCode32BReg opBlxReg)
|
||||||
|
{
|
||||||
|
if (opCode is OpCode32 op32)
|
||||||
|
{
|
||||||
|
uint returnAddr = op32.IsThumb
|
||||||
|
? (uint)address + (uint)opCode.OpCodeSizeInBytes | 1u
|
||||||
|
: (uint)address + (uint)opCode.OpCodeSizeInBytes;
|
||||||
|
context.SetX(14, returnAddr);
|
||||||
|
|
||||||
|
// For BLX register, the target address determines the mode
|
||||||
|
ulong targetAddr = context.GetX(opBlxReg.Rm);
|
||||||
|
context.SetPstateFlag(PState.TFlag, (targetAddr & 1) != 0);
|
||||||
|
return targetAddr & ~1UL; // Clear the Thumb bit for the actual address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case InstName.Br:
|
||||||
|
if (opCode is OpCodeBReg opBr)
|
||||||
|
{
|
||||||
|
// BR doesn't set link register, just branches to the target
|
||||||
|
return context.GetX(opBr.Rn);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new InvalidOperationException($"Unhandled branch instruction: {opCode.Instruction.Name}");
|
||||||
|
}
|
||||||
|
|
||||||
internal TranslatedFunction GetOrTranslate(ulong address, ExecutionMode mode)
|
internal TranslatedFunction GetOrTranslate(ulong address, ExecutionMode mode)
|
||||||
{
|
{
|
||||||
if (!Functions.TryGetValue(address, out TranslatedFunction func))
|
if (!Functions.TryGetValue(address, out TranslatedFunction func))
|
||||||
@ -367,9 +489,13 @@ namespace ARMeilleure.Translation
|
|||||||
|
|
||||||
if (block.Exit)
|
if (block.Exit)
|
||||||
{
|
{
|
||||||
// Left option here as it may be useful if we need to return to managed rather than tail call in
|
// Return to managed rather than tail call.
|
||||||
// future. (eg. for debug)
|
bool useReturns = Optimizations.EnableDebugging;
|
||||||
bool useReturns = false;
|
|
||||||
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
EmitDebugPrecisePcUpdate(context, block.Address);
|
||||||
|
}
|
||||||
|
|
||||||
InstEmitFlowHelper.EmitVirtualJump(context, Const(block.Address), isReturn: useReturns);
|
InstEmitFlowHelper.EmitVirtualJump(context, Const(block.Address), isReturn: useReturns);
|
||||||
}
|
}
|
||||||
@ -393,6 +519,11 @@ namespace ARMeilleure.Translation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Optimizations.EnableDebugging)
|
||||||
|
{
|
||||||
|
EmitDebugPrecisePcUpdate(context, opCode.Address);
|
||||||
|
}
|
||||||
|
|
||||||
Operand lblPredicateSkip = default;
|
Operand lblPredicateSkip = default;
|
||||||
|
|
||||||
if (context.IsInIfThenBlock && context.CurrentIfThenBlockCond != Condition.Al)
|
if (context.IsInIfThenBlock && context.CurrentIfThenBlockCond != Condition.Al)
|
||||||
@ -489,6 +620,14 @@ namespace ARMeilleure.Translation
|
|||||||
context.MarkLabel(lblExit);
|
context.MarkLabel(lblExit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void EmitDebugPrecisePcUpdate(EmitterContext context, ulong address)
|
||||||
|
{
|
||||||
|
long debugPrecisePcOffs = NativeContext.GetDebugPrecisePcOffset();
|
||||||
|
|
||||||
|
Operand debugPrecisePcAddr = context.Add(context.LoadArgument(OperandType.I64, 0), Const(debugPrecisePcOffs));
|
||||||
|
context.Store(debugPrecisePcAddr, Const(address));
|
||||||
|
}
|
||||||
|
|
||||||
public void InvalidateJitCacheRegion(ulong address, ulong size)
|
public void InvalidateJitCacheRegion(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
ulong[] overlapAddresses = [];
|
ulong[] overlapAddresses = [];
|
||||||
|
@ -33,7 +33,7 @@ namespace Ryujinx.BuildValidationTasks
|
|||||||
LocalesJson json;
|
LocalesJson json;
|
||||||
|
|
||||||
if (isGitRunner && data.Contains("\r\n"))
|
if (isGitRunner && data.Contains("\r\n"))
|
||||||
throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, build locally to fix...");
|
throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, rebuild locally to fix...");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ namespace Ryujinx.BuildValidationTasks
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isGitRunner && encounteredIssue)
|
if (isGitRunner && encounteredIssue)
|
||||||
throw new JsonException("1 or more locales are invalid!");
|
throw new JsonException("1 or more locales are invalid! Rebuild locally to fix...");
|
||||||
|
|
||||||
string jsonString = JsonSerializer.Serialize(json, _jsonOptions);
|
string jsonString = JsonSerializer.Serialize(json, _jsonOptions);
|
||||||
|
|
||||||
@ -102,6 +102,7 @@ namespace Ryujinx.BuildValidationTasks
|
|||||||
|
|
||||||
struct LocalesJson
|
struct LocalesJson
|
||||||
{
|
{
|
||||||
|
public Dictionary<string, string> Info { get; set; }
|
||||||
public List<string> Languages { get; set; }
|
public List<string> Languages { get; set; }
|
||||||
public List<LocalesEntry> Locales { get; set; }
|
public List<LocalesEntry> Locales { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,17 @@
|
|||||||
Command="dotnet Ryujinx.BuildValidationTasks.dll "$(ProjectDir)..\..\\""
|
Command="dotnet Ryujinx.BuildValidationTasks.dll "$(ProjectDir)..\..\\""
|
||||||
ConsoleToMsBuild="true"
|
ConsoleToMsBuild="true"
|
||||||
Condition="'$(RuntimeIdentifier)' == ''"
|
Condition="'$(RuntimeIdentifier)' == ''"
|
||||||
/>
|
IgnoreExitCode="true">
|
||||||
|
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
|
||||||
|
<Output TaskParameter="ExitCode" PropertyName="BuildExitCode"/>
|
||||||
|
</Exec>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(OutputOfExec.IndexOf(Unhandled exception))' != '-1'">
|
||||||
|
<ErrorOutput>$(OutputOfExec.Substring($(OutputOfExec.IndexOf("Unhandled exception"))))</ErrorOutput>
|
||||||
|
<ErrorOutput>$(ErrorOutput.Substring(0, $(ErrorOutput.IndexOf(';'))))</ErrorOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Error Text="$(ErrorOutput)" Condition=" '$(BuildExitCode)' != '0'"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -13,6 +13,7 @@ namespace Ryujinx.Common.Logging
|
|||||||
Cpu,
|
Cpu,
|
||||||
Emulation,
|
Emulation,
|
||||||
FFmpeg,
|
FFmpeg,
|
||||||
|
GdbStub,
|
||||||
Font,
|
Font,
|
||||||
Gpu,
|
Gpu,
|
||||||
Hid,
|
Hid,
|
||||||
|
@ -93,6 +93,7 @@ namespace Ryujinx.Common
|
|||||||
//The Pokémon Franchise
|
//The Pokémon Franchise
|
||||||
"0100f4300bf2c000", // New Pokémon Snap
|
"0100f4300bf2c000", // New Pokémon Snap
|
||||||
"0100000011d90000", // Pokémon Brilliant Diamond
|
"0100000011d90000", // Pokémon Brilliant Diamond
|
||||||
|
"010008c01e742000", // Pokémon Friends
|
||||||
"01001f5010dfa000", // Pokémon Legends: Arceus
|
"01001f5010dfa000", // Pokémon Legends: Arceus
|
||||||
"01003d200baa2000", // Pokémon Mystery Dungeon - Rescue Team DX
|
"01003d200baa2000", // Pokémon Mystery Dungeon - Rescue Team DX
|
||||||
"0100a3d008c5c000", // Pokémon Scarlet
|
"0100a3d008c5c000", // Pokémon Scarlet
|
||||||
|
10
src/Ryujinx.Cpu/AppleHv/Arm/ExceptionLevel.cs
Normal file
10
src/Ryujinx.Cpu/AppleHv/Arm/ExceptionLevel.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Ryujinx.Cpu.AppleHv.Arm
|
||||||
|
{
|
||||||
|
enum ExceptionLevel : uint
|
||||||
|
{
|
||||||
|
PstateMask = 0xfffffff0,
|
||||||
|
EL1h = 0b0101,
|
||||||
|
El1t = 0b0100,
|
||||||
|
EL0 = 0b0000,
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,18 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
class HvExecutionContext : IExecutionContext
|
class HvExecutionContext : IExecutionContext
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ulong Pc => _impl.ElrEl1;
|
public ulong Pc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
uint currentEl = Pstate & ~((uint)ExceptionLevel.PstateMask);
|
||||||
|
if (currentEl == (uint)ExceptionLevel.EL1h)
|
||||||
|
{
|
||||||
|
return _impl.ElrEl1;
|
||||||
|
}
|
||||||
|
return _impl.Pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public long TpidrEl0
|
public long TpidrEl0
|
||||||
@ -48,6 +59,9 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
set => _impl.Fpsr = value;
|
set => _impl.Fpsr = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool IsAarch32
|
public bool IsAarch32
|
||||||
{
|
{
|
||||||
@ -67,6 +81,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
private readonly ICounter _counter;
|
private readonly ICounter _counter;
|
||||||
private readonly IHvExecutionContext _shadowContext;
|
private readonly IHvExecutionContext _shadowContext;
|
||||||
private IHvExecutionContext _impl;
|
private IHvExecutionContext _impl;
|
||||||
|
private int _shouldStep;
|
||||||
|
|
||||||
private readonly ExceptionCallbacks _exceptionCallbacks;
|
private readonly ExceptionCallbacks _exceptionCallbacks;
|
||||||
|
|
||||||
@ -103,6 +118,11 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
_exceptionCallbacks.BreakCallback?.Invoke(this, address, imm);
|
_exceptionCallbacks.BreakCallback?.Invoke(this, address, imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StepHandler()
|
||||||
|
{
|
||||||
|
_exceptionCallbacks.StepCallback?.Invoke(this);
|
||||||
|
}
|
||||||
|
|
||||||
private void SupervisorCallHandler(ulong address, int imm)
|
private void SupervisorCallHandler(ulong address, int imm)
|
||||||
{
|
{
|
||||||
_exceptionCallbacks.SupervisorCallback?.Invoke(this, address, imm);
|
_exceptionCallbacks.SupervisorCallback?.Invoke(this, address, imm);
|
||||||
@ -127,6 +147,30 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
return Interlocked.Exchange(ref _interruptRequested, 0) != 0;
|
return Interlocked.Exchange(ref _interruptRequested, 0) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public void RequestDebugStep()
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref _shouldStep, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong DebugPc
|
||||||
|
{
|
||||||
|
get => Pc;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
uint currentEl = Pstate & ~((uint)ExceptionLevel.PstateMask);
|
||||||
|
if (currentEl == (uint)ExceptionLevel.EL1h)
|
||||||
|
{
|
||||||
|
_impl.ElrEl1 = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_impl.Pc = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void StopRunning()
|
public void StopRunning()
|
||||||
{
|
{
|
||||||
@ -142,6 +186,22 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
|
|
||||||
while (Running)
|
while (Running)
|
||||||
{
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref _shouldStep, 0, 1) == 1)
|
||||||
|
{
|
||||||
|
uint currentEl = Pstate & ~((uint)ExceptionLevel.PstateMask);
|
||||||
|
if (currentEl == (uint)ExceptionLevel.EL1h)
|
||||||
|
{
|
||||||
|
HvApi.hv_vcpu_get_sys_reg(vcpu.Handle, HvSysReg.SPSR_EL1, out ulong spsr).ThrowOnError();
|
||||||
|
spsr |= (1 << 21);
|
||||||
|
HvApi.hv_vcpu_set_sys_reg(vcpu.Handle, HvSysReg.SPSR_EL1, spsr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Pstate |= (1 << 21);
|
||||||
|
}
|
||||||
|
HvApi.hv_vcpu_set_sys_reg(vcpu.Handle, HvSysReg.MDSCR_EL1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
HvApi.hv_vcpu_run(vcpu.Handle).ThrowOnError();
|
HvApi.hv_vcpu_run(vcpu.Handle).ThrowOnError();
|
||||||
|
|
||||||
HvExitReason reason = vcpu.ExitInfo->Reason;
|
HvExitReason reason = vcpu.ExitInfo->Reason;
|
||||||
@ -209,6 +269,20 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
SupervisorCallHandler(elr - 4UL, id);
|
SupervisorCallHandler(elr - 4UL, id);
|
||||||
vcpu = RentFromPool(memoryManager.AddressSpace, vcpu);
|
vcpu = RentFromPool(memoryManager.AddressSpace, vcpu);
|
||||||
break;
|
break;
|
||||||
|
case ExceptionClass.SoftwareStepLowerEl:
|
||||||
|
HvApi.hv_vcpu_get_sys_reg(vcpuHandle, HvSysReg.SPSR_EL1, out ulong spsr).ThrowOnError();
|
||||||
|
spsr &= ~((ulong)(1 << 21));
|
||||||
|
HvApi.hv_vcpu_set_sys_reg(vcpuHandle, HvSysReg.SPSR_EL1, spsr).ThrowOnError();
|
||||||
|
HvApi.hv_vcpu_set_sys_reg(vcpuHandle, HvSysReg.MDSCR_EL1, 0);
|
||||||
|
ReturnToPool(vcpu);
|
||||||
|
StepHandler();
|
||||||
|
vcpu = RentFromPool(memoryManager.AddressSpace, vcpu);
|
||||||
|
break;
|
||||||
|
case ExceptionClass.BrkAarch64:
|
||||||
|
ReturnToPool(vcpu);
|
||||||
|
BreakHandler(elr, (ushort)esr);
|
||||||
|
vcpu = RentFromPool(memoryManager.AddressSpace, vcpu);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception($"Unhandled guest exception {ec}.");
|
throw new Exception($"Unhandled guest exception {ec}.");
|
||||||
}
|
}
|
||||||
@ -219,10 +293,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
// TODO: Invalidate only the range that was modified?
|
// TODO: Invalidate only the range that was modified?
|
||||||
return HvAddressSpace.KernelRegionTlbiEretAddress;
|
return HvAddressSpace.KernelRegionTlbiEretAddress;
|
||||||
}
|
}
|
||||||
else
|
return HvAddressSpace.KernelRegionEretAddress;
|
||||||
{
|
|
||||||
return HvAddressSpace.KernelRegionEretAddress;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DataAbort(MemoryTracking tracking, ulong vcpu, uint esr)
|
private static void DataAbort(MemoryTracking tracking, ulong vcpu, uint esr)
|
||||||
|
@ -18,6 +18,8 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
|
|
||||||
public bool IsAarch32 { get; set; }
|
public bool IsAarch32 { get; set; }
|
||||||
|
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
private readonly ulong[] _x;
|
private readonly ulong[] _x;
|
||||||
private readonly V128[] _v;
|
private readonly V128[] _v;
|
||||||
|
|
||||||
@ -46,5 +48,14 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
{
|
{
|
||||||
_v[index] = value;
|
_v[index] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RequestInterrupt()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GetAndClearInterruptRequested()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ using ARMeilleure.State;
|
|||||||
using Ryujinx.Memory;
|
using Ryujinx.Memory;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
@ -13,6 +14,8 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
private static readonly SetSimdFpReg _setSimdFpReg;
|
private static readonly SetSimdFpReg _setSimdFpReg;
|
||||||
private static readonly nint _setSimdFpRegNativePtr;
|
private static readonly nint _setSimdFpRegNativePtr;
|
||||||
|
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
static HvExecutionContextVcpu()
|
static HvExecutionContextVcpu()
|
||||||
{
|
{
|
||||||
// .NET does not support passing vectors by value, so we need to pass a pointer and use a native
|
// .NET does not support passing vectors by value, so we need to pass a pointer and use a native
|
||||||
@ -135,6 +138,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
}
|
}
|
||||||
|
|
||||||
private readonly ulong _vcpu;
|
private readonly ulong _vcpu;
|
||||||
|
private int _interruptRequested;
|
||||||
|
|
||||||
public HvExecutionContextVcpu(ulong vcpu)
|
public HvExecutionContextVcpu(ulong vcpu)
|
||||||
{
|
{
|
||||||
@ -180,8 +184,16 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
|
|
||||||
public void RequestInterrupt()
|
public void RequestInterrupt()
|
||||||
{
|
{
|
||||||
ulong vcpu = _vcpu;
|
if (Interlocked.Exchange(ref _interruptRequested, 1) == 0)
|
||||||
HvApi.hv_vcpus_exit(ref vcpu, 1);
|
{
|
||||||
|
ulong vcpu = _vcpu;
|
||||||
|
HvApi.hv_vcpus_exit(ref vcpu, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GetAndClearInterruptRequested()
|
||||||
|
{
|
||||||
|
return Interlocked.Exchange(ref _interruptRequested, 0) != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
|
|
||||||
uint Fpcr { get; set; }
|
uint Fpcr { get; set; }
|
||||||
uint Fpsr { get; set; }
|
uint Fpsr { get; set; }
|
||||||
|
ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
ulong GetX(int index);
|
ulong GetX(int index);
|
||||||
void SetX(int index, ulong value);
|
void SetX(int index, ulong value);
|
||||||
@ -39,5 +40,8 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
SetV(i, context.GetV(i));
|
SetV(i, context.GetV(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestInterrupt();
|
||||||
|
bool GetAndClearInterruptRequested();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,11 @@ namespace Ryujinx.Cpu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly ExceptionCallback BreakCallback;
|
public readonly ExceptionCallback BreakCallback;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handler for CPU software interrupts caused by single-stepping.
|
||||||
|
/// </summary>
|
||||||
|
public readonly ExceptionCallbackNoArgs StepCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for CPU software interrupts caused by the Arm SVC instruction.
|
/// Handler for CPU software interrupts caused by the Arm SVC instruction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -47,16 +52,19 @@ namespace Ryujinx.Cpu
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="interruptCallback">Handler for CPU interrupts triggered using <see cref="IExecutionContext.RequestInterrupt"/></param>
|
/// <param name="interruptCallback">Handler for CPU interrupts triggered using <see cref="IExecutionContext.RequestInterrupt"/></param>
|
||||||
/// <param name="breakCallback">Handler for CPU software interrupts caused by the Arm BRK instruction</param>
|
/// <param name="breakCallback">Handler for CPU software interrupts caused by the Arm BRK instruction</param>
|
||||||
|
/// <param name="stepCallback">Handler for CPU software interrupts caused by single-stepping</param>
|
||||||
/// <param name="supervisorCallback">Handler for CPU software interrupts caused by the Arm SVC instruction</param>
|
/// <param name="supervisorCallback">Handler for CPU software interrupts caused by the Arm SVC instruction</param>
|
||||||
/// <param name="undefinedCallback">Handler for CPU software interrupts caused by any undefined Arm instruction</param>
|
/// <param name="undefinedCallback">Handler for CPU software interrupts caused by any undefined Arm instruction</param>
|
||||||
public ExceptionCallbacks(
|
public ExceptionCallbacks(
|
||||||
ExceptionCallbackNoArgs interruptCallback = null,
|
ExceptionCallbackNoArgs interruptCallback = null,
|
||||||
ExceptionCallback breakCallback = null,
|
ExceptionCallback breakCallback = null,
|
||||||
|
ExceptionCallbackNoArgs stepCallback = null,
|
||||||
ExceptionCallback supervisorCallback = null,
|
ExceptionCallback supervisorCallback = null,
|
||||||
ExceptionCallback undefinedCallback = null)
|
ExceptionCallback undefinedCallback = null)
|
||||||
{
|
{
|
||||||
InterruptCallback = interruptCallback;
|
InterruptCallback = interruptCallback;
|
||||||
BreakCallback = breakCallback;
|
BreakCallback = breakCallback;
|
||||||
|
StepCallback = stepCallback;
|
||||||
SupervisorCallback = supervisorCallback;
|
SupervisorCallback = supervisorCallback;
|
||||||
UndefinedCallback = undefinedCallback;
|
UndefinedCallback = undefinedCallback;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using ARMeilleure.State;
|
using ARMeilleure.State;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.Cpu
|
namespace Ryujinx.Cpu
|
||||||
{
|
{
|
||||||
@ -46,6 +47,11 @@ namespace Ryujinx.Cpu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
bool IsAarch32 { get; set; }
|
bool IsAarch32 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thread UID.
|
||||||
|
/// </summary>
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whenever the CPU is still running code.
|
/// Indicates whenever the CPU is still running code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -108,5 +114,23 @@ namespace Ryujinx.Cpu
|
|||||||
/// If you only need to pause the thread temporarily, use <see cref="RequestInterrupt"/> instead.
|
/// If you only need to pause the thread temporarily, use <see cref="RequestInterrupt"/> instead.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
void StopRunning();
|
void StopRunning();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Requests the thread to stop running temporarily and call <see cref="ExceptionCallbacks.InterruptCallback"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The thread might not pause immediately.
|
||||||
|
/// One must not assume that guest code is no longer being executed by the thread after calling this function.
|
||||||
|
/// After single stepping, the thread should call call <see cref="ExceptionCallbacks.StepCallback"/>.
|
||||||
|
/// </remarks>
|
||||||
|
void RequestDebugStep();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Current Program Counter (for debugging).
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// PC register for the debugger. Must not be accessed while the thread isn't stopped for debugging.
|
||||||
|
/// </remarks>
|
||||||
|
ulong DebugPc { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using ARMeilleure.Memory;
|
using ARMeilleure.Memory;
|
||||||
using ARMeilleure.State;
|
using ARMeilleure.State;
|
||||||
|
using ExecutionContext = ARMeilleure.State.ExecutionContext;
|
||||||
|
|
||||||
namespace Ryujinx.Cpu.Jit
|
namespace Ryujinx.Cpu.Jit
|
||||||
{
|
{
|
||||||
@ -53,6 +54,13 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
set => _impl.IsAarch32 = value;
|
set => _impl.IsAarch32 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong ThreadUid
|
||||||
|
{
|
||||||
|
get => _impl.ThreadUid;
|
||||||
|
set => _impl.ThreadUid = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool Running => _impl.Running;
|
public bool Running => _impl.Running;
|
||||||
|
|
||||||
@ -65,6 +73,7 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
counter,
|
counter,
|
||||||
InterruptHandler,
|
InterruptHandler,
|
||||||
BreakHandler,
|
BreakHandler,
|
||||||
|
StepHandler,
|
||||||
SupervisorCallHandler,
|
SupervisorCallHandler,
|
||||||
UndefinedHandler);
|
UndefinedHandler);
|
||||||
|
|
||||||
@ -93,6 +102,11 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
_exceptionCallbacks.BreakCallback?.Invoke(this, address, imm);
|
_exceptionCallbacks.BreakCallback?.Invoke(this, address, imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StepHandler(ExecutionContext context)
|
||||||
|
{
|
||||||
|
_exceptionCallbacks.StepCallback?.Invoke(this);
|
||||||
|
}
|
||||||
|
|
||||||
private void SupervisorCallHandler(ExecutionContext context, ulong address, int imm)
|
private void SupervisorCallHandler(ExecutionContext context, ulong address, int imm)
|
||||||
{
|
{
|
||||||
_exceptionCallbacks.SupervisorCallback?.Invoke(this, address, imm);
|
_exceptionCallbacks.SupervisorCallback?.Invoke(this, address, imm);
|
||||||
@ -109,6 +123,16 @@ namespace Ryujinx.Cpu.Jit
|
|||||||
_impl.RequestInterrupt();
|
_impl.RequestInterrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public void RequestDebugStep() => _impl.RequestDebugStep();
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong DebugPc
|
||||||
|
{
|
||||||
|
get => _impl.DebugPc;
|
||||||
|
set => _impl.DebugPc = value;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void StopRunning()
|
public void StopRunning()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
using ARMeilleure;
|
||||||
using ARMeilleure.Memory;
|
using ARMeilleure.Memory;
|
||||||
using ARMeilleure.State;
|
using ARMeilleure.State;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.Cpu.LightningJit.State
|
namespace Ryujinx.Cpu.LightningJit.State
|
||||||
{
|
{
|
||||||
@ -52,6 +54,8 @@ namespace Ryujinx.Cpu.LightningJit.State
|
|||||||
|
|
||||||
public bool IsAarch32 { get; set; }
|
public bool IsAarch32 { get; set; }
|
||||||
|
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
internal ExecutionMode ExecutionMode
|
internal ExecutionMode ExecutionMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -77,15 +81,20 @@ namespace Ryujinx.Cpu.LightningJit.State
|
|||||||
|
|
||||||
private readonly ExceptionCallbackNoArgs _interruptCallback;
|
private readonly ExceptionCallbackNoArgs _interruptCallback;
|
||||||
private readonly ExceptionCallback _breakCallback;
|
private readonly ExceptionCallback _breakCallback;
|
||||||
|
private readonly ExceptionCallbackNoArgs _stepCallback;
|
||||||
private readonly ExceptionCallback _supervisorCallback;
|
private readonly ExceptionCallback _supervisorCallback;
|
||||||
private readonly ExceptionCallback _undefinedCallback;
|
private readonly ExceptionCallback _undefinedCallback;
|
||||||
|
|
||||||
|
internal int ShouldStep;
|
||||||
|
public ulong DebugPc { get; set; }
|
||||||
|
|
||||||
public ExecutionContext(IJitMemoryAllocator allocator, ICounter counter, ExceptionCallbacks exceptionCallbacks)
|
public ExecutionContext(IJitMemoryAllocator allocator, ICounter counter, ExceptionCallbacks exceptionCallbacks)
|
||||||
{
|
{
|
||||||
_nativeContext = new NativeContext(allocator);
|
_nativeContext = new NativeContext(allocator);
|
||||||
_counter = counter;
|
_counter = counter;
|
||||||
_interruptCallback = exceptionCallbacks.InterruptCallback;
|
_interruptCallback = exceptionCallbacks.InterruptCallback;
|
||||||
_breakCallback = exceptionCallbacks.BreakCallback;
|
_breakCallback = exceptionCallbacks.BreakCallback;
|
||||||
|
_stepCallback = exceptionCallbacks.StepCallback;
|
||||||
_supervisorCallback = exceptionCallbacks.SupervisorCallback;
|
_supervisorCallback = exceptionCallbacks.SupervisorCallback;
|
||||||
_undefinedCallback = exceptionCallbacks.UndefinedCallback;
|
_undefinedCallback = exceptionCallbacks.UndefinedCallback;
|
||||||
|
|
||||||
@ -117,6 +126,17 @@ namespace Ryujinx.Cpu.LightningJit.State
|
|||||||
_interrupted = true;
|
_interrupted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StepHandler()
|
||||||
|
{
|
||||||
|
_stepCallback?.Invoke(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestDebugStep()
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref ShouldStep, 1);
|
||||||
|
RequestInterrupt();
|
||||||
|
}
|
||||||
|
|
||||||
internal void OnBreak(ulong address, int imm)
|
internal void OnBreak(ulong address, int imm)
|
||||||
{
|
{
|
||||||
_breakCallback?.Invoke(this, address, imm);
|
_breakCallback?.Invoke(this, address, imm);
|
||||||
|
203
src/Ryujinx.HLE/Debugger/BreakpointManager.cs
Normal file
203
src/Ryujinx.HLE/Debugger/BreakpointManager.cs
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
using Ryujinx.Common;
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
|
using Ryujinx.Memory;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
internal class Breakpoint
|
||||||
|
{
|
||||||
|
public byte[] OriginalData { get; }
|
||||||
|
|
||||||
|
public bool IsStep { get; }
|
||||||
|
|
||||||
|
public Breakpoint(byte[] originalData, bool isStep)
|
||||||
|
{
|
||||||
|
OriginalData = originalData;
|
||||||
|
IsStep = isStep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Manages software breakpoints for the debugger.
|
||||||
|
/// </summary>
|
||||||
|
public class BreakpointManager
|
||||||
|
{
|
||||||
|
private readonly Debugger _debugger;
|
||||||
|
private readonly ConcurrentDictionary<ulong, Breakpoint> _breakpoints = new();
|
||||||
|
|
||||||
|
private static readonly byte[] _aarch64BreakInstruction = { 0x00, 0x00, 0x20, 0xD4 }; // BRK #0
|
||||||
|
private static readonly byte[] _aarch32BreakInstruction = { 0xFE, 0xDE, 0xFF, 0xE7 }; // TRAP
|
||||||
|
private static readonly byte[] _aarch32ThumbBreakInstruction = { 0x80, 0xB6 };
|
||||||
|
|
||||||
|
public BreakpointManager(Debugger debugger)
|
||||||
|
{
|
||||||
|
_debugger = debugger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets a software breakpoint at a specified address.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="address">The memory address to set the breakpoint at.</param>
|
||||||
|
/// <param name="length">The length of the instruction to replace.</param>
|
||||||
|
/// <param name="isStep">Indicates if this is a single-step breakpoint.</param>
|
||||||
|
/// <returns>True if the breakpoint was set successfully; otherwise, false.</returns>
|
||||||
|
public bool SetBreakPoint(ulong address, ulong length, bool isStep = false)
|
||||||
|
{
|
||||||
|
if (_breakpoints.ContainsKey(address))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] breakInstruction = GetBreakInstruction(length);
|
||||||
|
if (breakInstruction == null)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Unsupported instruction length for breakpoint: {length}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var originalInstruction = new byte[length];
|
||||||
|
if (!ReadMemory(address, originalInstruction))
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Failed to read memory at 0x{address:X16} to set breakpoint.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteMemory(address, breakInstruction))
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Failed to write breakpoint at 0x{address:X16}.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var breakpoint = new Breakpoint(originalInstruction, isStep);
|
||||||
|
if (_breakpoints.TryAdd(address, breakpoint))
|
||||||
|
{
|
||||||
|
Logger.Debug?.Print(LogClass.GdbStub, $"Breakpoint set at 0x{address:X16}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Failed to add breakpoint at 0x{address:X16}.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears a software breakpoint at a specified address.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="address">The memory address of the breakpoint to clear.</param>
|
||||||
|
/// <param name="length">The length of the instruction (unused).</param>
|
||||||
|
/// <returns>True if the breakpoint was cleared successfully; otherwise, false.</returns>
|
||||||
|
public bool ClearBreakPoint(ulong address, ulong length)
|
||||||
|
{
|
||||||
|
if (_breakpoints.TryGetValue(address, out Breakpoint breakpoint))
|
||||||
|
{
|
||||||
|
if (!WriteMemory(address, breakpoint.OriginalData))
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Failed to restore original instruction at 0x{address:X16} to clear breakpoint.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_breakpoints.TryRemove(address, out _);
|
||||||
|
Logger.Debug?.Print(LogClass.GdbStub, $"Breakpoint cleared at 0x{address:X16}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Warning?.Print(LogClass.GdbStub, $"No breakpoint found at address 0x{address:X16}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears all currently set software breakpoints.
|
||||||
|
/// </summary>
|
||||||
|
public void ClearAll()
|
||||||
|
{
|
||||||
|
foreach (var bp in _breakpoints)
|
||||||
|
{
|
||||||
|
if (!WriteMemory(bp.Key, bp.Value.OriginalData))
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub, $"Failed to restore original instruction at 0x{bp.Key:X16} while clearing all breakpoints.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
_breakpoints.Clear();
|
||||||
|
Logger.Debug?.Print(LogClass.GdbStub, "All breakpoints cleared.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears all currently set single-step software breakpoints.
|
||||||
|
/// </summary>
|
||||||
|
public void ClearAllStepBreakpoints()
|
||||||
|
{
|
||||||
|
var stepBreakpoints = _breakpoints.Where(p => p.Value.IsStep).ToList();
|
||||||
|
|
||||||
|
if (stepBreakpoints.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var bp in stepBreakpoints)
|
||||||
|
{
|
||||||
|
if (_breakpoints.TryRemove(bp.Key, out Breakpoint removedBreakpoint))
|
||||||
|
{
|
||||||
|
WriteMemory(bp.Key, removedBreakpoint.OriginalData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Debug?.Print(LogClass.GdbStub, "All step breakpoints cleared.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private byte[] GetBreakInstruction(ulong length)
|
||||||
|
{
|
||||||
|
if (_debugger.IsProcessAarch32)
|
||||||
|
{
|
||||||
|
if (length == 2)
|
||||||
|
{
|
||||||
|
return _aarch32ThumbBreakInstruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length == 4)
|
||||||
|
{
|
||||||
|
return _aarch32BreakInstruction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (length == 4)
|
||||||
|
{
|
||||||
|
return _aarch64BreakInstruction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ReadMemory(ulong address, byte[] data)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_debugger.DebugProcess.CpuMemory.Read(address, data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (InvalidMemoryRegionException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool WriteMemory(ulong address, byte[] data)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_debugger.DebugProcess.CpuMemory.Write(address, data);
|
||||||
|
_debugger.DebugProcess.InvalidateCacheRegion(address, (ulong)data.Length);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (InvalidMemoryRegionException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
src/Ryujinx.HLE/Debugger/DebugState.cs
Normal file
9
src/Ryujinx.HLE/Debugger/DebugState.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
public enum DebugState
|
||||||
|
{
|
||||||
|
Running,
|
||||||
|
Stopping,
|
||||||
|
Stopped,
|
||||||
|
}
|
||||||
|
}
|
1327
src/Ryujinx.HLE/Debugger/Debugger.cs
Normal file
1327
src/Ryujinx.HLE/Debugger/Debugger.cs
Normal file
File diff suppressed because it is too large
Load Diff
15
src/Ryujinx.HLE/Debugger/GdbSignal.cs
Normal file
15
src/Ryujinx.HLE/Debugger/GdbSignal.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
enum GdbSignal
|
||||||
|
{
|
||||||
|
Zero = 0,
|
||||||
|
Int = 2,
|
||||||
|
Quit = 3,
|
||||||
|
Trap = 5,
|
||||||
|
Abort = 6,
|
||||||
|
Alarm = 14,
|
||||||
|
IO = 23,
|
||||||
|
XCPU = 24,
|
||||||
|
Unknown = 143
|
||||||
|
}
|
||||||
|
}
|
93
src/Ryujinx.HLE/Debugger/GdbXml/aarch64-core.xml
Normal file
93
src/Ryujinx.HLE/Debugger/GdbXml/aarch64-core.xml
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2009-2022 Free Software Foundation, Inc.
|
||||||
|
Contributed by ARM Ltd.
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.aarch64.core">
|
||||||
|
<reg name="x0" bitsize="64"/>
|
||||||
|
<reg name="x1" bitsize="64"/>
|
||||||
|
<reg name="x2" bitsize="64"/>
|
||||||
|
<reg name="x3" bitsize="64"/>
|
||||||
|
<reg name="x4" bitsize="64"/>
|
||||||
|
<reg name="x5" bitsize="64"/>
|
||||||
|
<reg name="x6" bitsize="64"/>
|
||||||
|
<reg name="x7" bitsize="64"/>
|
||||||
|
<reg name="x8" bitsize="64"/>
|
||||||
|
<reg name="x9" bitsize="64"/>
|
||||||
|
<reg name="x10" bitsize="64"/>
|
||||||
|
<reg name="x11" bitsize="64"/>
|
||||||
|
<reg name="x12" bitsize="64"/>
|
||||||
|
<reg name="x13" bitsize="64"/>
|
||||||
|
<reg name="x14" bitsize="64"/>
|
||||||
|
<reg name="x15" bitsize="64"/>
|
||||||
|
<reg name="x16" bitsize="64"/>
|
||||||
|
<reg name="x17" bitsize="64"/>
|
||||||
|
<reg name="x18" bitsize="64"/>
|
||||||
|
<reg name="x19" bitsize="64"/>
|
||||||
|
<reg name="x20" bitsize="64"/>
|
||||||
|
<reg name="x21" bitsize="64"/>
|
||||||
|
<reg name="x22" bitsize="64"/>
|
||||||
|
<reg name="x23" bitsize="64"/>
|
||||||
|
<reg name="x24" bitsize="64"/>
|
||||||
|
<reg name="x25" bitsize="64"/>
|
||||||
|
<reg name="x26" bitsize="64"/>
|
||||||
|
<reg name="x27" bitsize="64"/>
|
||||||
|
<reg name="x28" bitsize="64"/>
|
||||||
|
<reg name="x29" bitsize="64"/>
|
||||||
|
<reg name="x30" bitsize="64"/>
|
||||||
|
<reg name="sp" bitsize="64" type="data_ptr"/>
|
||||||
|
|
||||||
|
<reg name="pc" bitsize="64" type="code_ptr"/>
|
||||||
|
|
||||||
|
<flags id="cpsr_flags" size="4">
|
||||||
|
<!-- Stack Pointer. -->
|
||||||
|
<field name="SP" start="0" end="0"/>
|
||||||
|
|
||||||
|
<!-- Exception Level. -->
|
||||||
|
<field name="EL" start="2" end="3"/>
|
||||||
|
<!-- Execution state. -->
|
||||||
|
<field name="nRW" start="4" end="4"/>
|
||||||
|
|
||||||
|
<!-- FIQ interrupt mask. -->
|
||||||
|
<field name="F" start="6" end="6"/>
|
||||||
|
<!-- IRQ interrupt mask. -->
|
||||||
|
<field name="I" start="7" end="7"/>
|
||||||
|
<!-- SError interrupt mask. -->
|
||||||
|
<field name="A" start="8" end="8"/>
|
||||||
|
<!-- Debug exception mask. -->
|
||||||
|
<field name="D" start="9" end="9"/>
|
||||||
|
|
||||||
|
<!-- ARMv8.5-A: Branch Target Identification BTYPE. -->
|
||||||
|
<field name="BTYPE" start="10" end="11"/>
|
||||||
|
|
||||||
|
<!-- ARMv8.0-A: Speculative Store Bypass. -->
|
||||||
|
<field name="SSBS" start="12" end="12"/>
|
||||||
|
|
||||||
|
<!-- Illegal Execution state. -->
|
||||||
|
<field name="IL" start="20" end="20"/>
|
||||||
|
<!-- Software Step. -->
|
||||||
|
<field name="SS" start="21" end="21"/>
|
||||||
|
<!-- ARMv8.1-A: Privileged Access Never. -->
|
||||||
|
<field name="PAN" start="22" end="22"/>
|
||||||
|
<!-- ARMv8.2-A: User Access Override. -->
|
||||||
|
<field name="UAO" start="23" end="23"/>
|
||||||
|
<!-- ARMv8.4-A: Data Independent Timing. -->
|
||||||
|
<field name="DIT" start="24" end="24"/>
|
||||||
|
<!-- ARMv8.5-A: Tag Check Override. -->
|
||||||
|
<field name="TCO" start="25" end="25"/>
|
||||||
|
|
||||||
|
<!-- Overflow Condition flag. -->
|
||||||
|
<field name="V" start="28" end="28"/>
|
||||||
|
<!-- Carry Condition flag. -->
|
||||||
|
<field name="C" start="29" end="29"/>
|
||||||
|
<!-- Zero Condition flag. -->
|
||||||
|
<field name="Z" start="30" end="30"/>
|
||||||
|
<!-- Negative Condition flag. -->
|
||||||
|
<field name="N" start="31" end="31"/>
|
||||||
|
</flags>
|
||||||
|
<reg name="cpsr" bitsize="32" type="cpsr_flags"/>
|
||||||
|
|
||||||
|
</feature>
|
159
src/Ryujinx.HLE/Debugger/GdbXml/aarch64-fpu.xml
Normal file
159
src/Ryujinx.HLE/Debugger/GdbXml/aarch64-fpu.xml
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2009-2022 Free Software Foundation, Inc.
|
||||||
|
Contributed by ARM Ltd.
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.aarch64.fpu">
|
||||||
|
<vector id="v2d" type="ieee_double" count="2"/>
|
||||||
|
<vector id="v2u" type="uint64" count="2"/>
|
||||||
|
<vector id="v2i" type="int64" count="2"/>
|
||||||
|
<vector id="v4f" type="ieee_single" count="4"/>
|
||||||
|
<vector id="v4u" type="uint32" count="4"/>
|
||||||
|
<vector id="v4i" type="int32" count="4"/>
|
||||||
|
<vector id="v8f" type="ieee_half" count="8"/>
|
||||||
|
<vector id="v8u" type="uint16" count="8"/>
|
||||||
|
<vector id="v8i" type="int16" count="8"/>
|
||||||
|
<vector id="v8bf16" type="bfloat16" count="8"/>
|
||||||
|
<vector id="v16u" type="uint8" count="16"/>
|
||||||
|
<vector id="v16i" type="int8" count="16"/>
|
||||||
|
<vector id="v1u" type="uint128" count="1"/>
|
||||||
|
<vector id="v1i" type="int128" count="1"/>
|
||||||
|
<union id="vnd">
|
||||||
|
<field name="f" type="v2d"/>
|
||||||
|
<field name="u" type="v2u"/>
|
||||||
|
<field name="s" type="v2i"/>
|
||||||
|
</union>
|
||||||
|
<union id="vns">
|
||||||
|
<field name="f" type="v4f"/>
|
||||||
|
<field name="u" type="v4u"/>
|
||||||
|
<field name="s" type="v4i"/>
|
||||||
|
</union>
|
||||||
|
<union id="vnh">
|
||||||
|
<field name="bf" type="v8bf16"/>
|
||||||
|
<field name="f" type="v8f"/>
|
||||||
|
<field name="u" type="v8u"/>
|
||||||
|
<field name="s" type="v8i"/>
|
||||||
|
</union>
|
||||||
|
<union id="vnb">
|
||||||
|
<field name="u" type="v16u"/>
|
||||||
|
<field name="s" type="v16i"/>
|
||||||
|
</union>
|
||||||
|
<union id="vnq">
|
||||||
|
<field name="u" type="v1u"/>
|
||||||
|
<field name="s" type="v1i"/>
|
||||||
|
</union>
|
||||||
|
<union id="aarch64v">
|
||||||
|
<field name="d" type="vnd"/>
|
||||||
|
<field name="s" type="vns"/>
|
||||||
|
<field name="h" type="vnh"/>
|
||||||
|
<field name="b" type="vnb"/>
|
||||||
|
<field name="q" type="vnq"/>
|
||||||
|
</union>
|
||||||
|
<reg name="v0" bitsize="128" type="aarch64v" regnum="34"/>
|
||||||
|
<reg name="v1" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v2" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v3" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v4" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v5" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v6" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v7" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v8" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v9" bitsize="128" type="aarch64v" />
|
||||||
|
<reg name="v10" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v11" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v12" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v13" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v14" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v15" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v16" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v17" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v18" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v19" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v20" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v21" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v22" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v23" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v24" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v25" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v26" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v27" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v28" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v29" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v30" bitsize="128" type="aarch64v"/>
|
||||||
|
<reg name="v31" bitsize="128" type="aarch64v"/>
|
||||||
|
|
||||||
|
<flags id="fpsr_flags" size="4">
|
||||||
|
<!-- Invalid Operation cumulative floating-point exception bit. -->
|
||||||
|
<field name="IOC" start="0" end="0"/>
|
||||||
|
<!-- Divide by Zero cumulative floating-point exception bit. -->
|
||||||
|
<field name="DZC" start="1" end="1"/>
|
||||||
|
<!-- Overflow cumulative floating-point exception bit. -->
|
||||||
|
<field name="OFC" start="2" end="2"/>
|
||||||
|
<!-- Underflow cumulative floating-point exception bit. -->
|
||||||
|
<field name="UFC" start="3" end="3"/>
|
||||||
|
<!-- Inexact cumulative floating-point exception bit.. -->
|
||||||
|
<field name="IXC" start="4" end="4"/>
|
||||||
|
<!-- Input Denormal cumulative floating-point exception bit. -->
|
||||||
|
<field name="IDC" start="7" end="7"/>
|
||||||
|
<!-- Cumulative saturation bit, Advanced SIMD only. -->
|
||||||
|
<field name="QC" start="27" end="27"/>
|
||||||
|
<!-- When AArch32 is supported at any Exception level and AArch32
|
||||||
|
floating-point is implemented: Overflow condition flag for AArch32
|
||||||
|
floating-point comparison operations. -->
|
||||||
|
<field name="V" start="28" end="28"/>
|
||||||
|
<!-- When AArch32 is supported at any Exception level and AArch32
|
||||||
|
floating-point is implemented:
|
||||||
|
Carry condition flag for AArch32 floating-point comparison operations.
|
||||||
|
-->
|
||||||
|
<field name="C" start="29" end="29"/>
|
||||||
|
<!-- When AArch32 is supported at any Exception level and AArch32
|
||||||
|
floating-point is implemented:
|
||||||
|
Zero condition flag for AArch32 floating-point comparison operations.
|
||||||
|
-->
|
||||||
|
<field name="Z" start="30" end="30"/>
|
||||||
|
<!-- When AArch32 is supported at any Exception level and AArch32
|
||||||
|
floating-point is implemented:
|
||||||
|
Negative condition flag for AArch32 floating-point comparison
|
||||||
|
operations. -->
|
||||||
|
<field name="N" start="31" end="31"/>
|
||||||
|
</flags>
|
||||||
|
<reg name="fpsr" bitsize="32" type="fpsr_flags"/>
|
||||||
|
|
||||||
|
<flags id="fpcr_flags" size="4">
|
||||||
|
<!-- Flush Inputs to Zero (part of Armv8.7). -->
|
||||||
|
<field name="FIZ" start="0" end="0"/>
|
||||||
|
<!-- Alternate Handling (part of Armv8.7). -->
|
||||||
|
<field name="AH" start="1" end="1"/>
|
||||||
|
<!-- Controls how the output elements other than the lowest element of the
|
||||||
|
vector are determined for Advanced SIMD scalar instructions (part of
|
||||||
|
Armv8.7). -->
|
||||||
|
<field name="NEP" start="2" end="2"/>
|
||||||
|
<!-- Invalid Operation floating-point exception trap enable. -->
|
||||||
|
<field name="IOE" start="8" end="8"/>
|
||||||
|
<!-- Divide by Zero floating-point exception trap enable. -->
|
||||||
|
<field name="DZE" start="9" end="9"/>
|
||||||
|
<!-- Overflow floating-point exception trap enable. -->
|
||||||
|
<field name="OFE" start="10" end="10"/>
|
||||||
|
<!-- Underflow floating-point exception trap enable. -->
|
||||||
|
<field name="UFE" start="11" end="11"/>
|
||||||
|
<!-- Inexact floating-point exception trap enable. -->
|
||||||
|
<field name="IXE" start="12" end="12"/>
|
||||||
|
<!-- Input Denormal floating-point exception trap enable. -->
|
||||||
|
<field name="IDE" start="15" end="15"/>
|
||||||
|
<!-- Flush-to-zero mode control bit on half-precision data-processing
|
||||||
|
instructions. -->
|
||||||
|
<field name="FZ16" start="19" end="19"/>
|
||||||
|
<!-- Rounding Mode control field. -->
|
||||||
|
<field name="RMode" start="22" end="23"/>
|
||||||
|
<!-- Flush-to-zero mode control bit. -->
|
||||||
|
<field name="FZ" start="24" end="24"/>
|
||||||
|
<!-- Default NaN mode control bit. -->
|
||||||
|
<field name="DN" start="25" end="25"/>
|
||||||
|
<!-- Alternative half-precision control bit. -->
|
||||||
|
<field name="AHP" start="26" end="26"/>
|
||||||
|
</flags>
|
||||||
|
<reg name="fpcr" bitsize="32" type="fpcr_flags"/>
|
||||||
|
</feature>
|
27
src/Ryujinx.HLE/Debugger/GdbXml/arm-core.xml
Normal file
27
src/Ryujinx.HLE/Debugger/GdbXml/arm-core.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.arm.core">
|
||||||
|
<reg name="r0" bitsize="32"/>
|
||||||
|
<reg name="r1" bitsize="32"/>
|
||||||
|
<reg name="r2" bitsize="32"/>
|
||||||
|
<reg name="r3" bitsize="32"/>
|
||||||
|
<reg name="r4" bitsize="32"/>
|
||||||
|
<reg name="r5" bitsize="32"/>
|
||||||
|
<reg name="r6" bitsize="32"/>
|
||||||
|
<reg name="r7" bitsize="32"/>
|
||||||
|
<reg name="r8" bitsize="32"/>
|
||||||
|
<reg name="r9" bitsize="32"/>
|
||||||
|
<reg name="r10" bitsize="32"/>
|
||||||
|
<reg name="r11" bitsize="32"/>
|
||||||
|
<reg name="r12" bitsize="32"/>
|
||||||
|
<reg name="sp" bitsize="32" type="data_ptr"/>
|
||||||
|
<reg name="lr" bitsize="32"/>
|
||||||
|
<reg name="pc" bitsize="32" type="code_ptr"/>
|
||||||
|
<reg name="cpsr" bitsize="32" />
|
||||||
|
</feature>
|
86
src/Ryujinx.HLE/Debugger/GdbXml/arm-neon.xml
Normal file
86
src/Ryujinx.HLE/Debugger/GdbXml/arm-neon.xml
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.arm.vfp">
|
||||||
|
<vector id="neon_uint8x8" type="uint8" count="8"/>
|
||||||
|
<vector id="neon_uint16x4" type="uint16" count="4"/>
|
||||||
|
<vector id="neon_uint32x2" type="uint32" count="2"/>
|
||||||
|
<vector id="neon_float32x2" type="ieee_single" count="2"/>
|
||||||
|
<union id="neon_d">
|
||||||
|
<field name="u8" type="neon_uint8x8"/>
|
||||||
|
<field name="u16" type="neon_uint16x4"/>
|
||||||
|
<field name="u32" type="neon_uint32x2"/>
|
||||||
|
<field name="u64" type="uint64"/>
|
||||||
|
<field name="f32" type="neon_float32x2"/>
|
||||||
|
<field name="f64" type="ieee_double"/>
|
||||||
|
</union>
|
||||||
|
<vector id="neon_uint8x16" type="uint8" count="16"/>
|
||||||
|
<vector id="neon_uint16x8" type="uint16" count="8"/>
|
||||||
|
<vector id="neon_uint32x4" type="uint32" count="4"/>
|
||||||
|
<vector id="neon_uint64x2" type="uint64" count="2"/>
|
||||||
|
<vector id="neon_float32x4" type="ieee_single" count="4"/>
|
||||||
|
<vector id="neon_float64x2" type="ieee_double" count="2"/>
|
||||||
|
<union id="neon_q">
|
||||||
|
<field name="u8" type="neon_uint8x16"/>
|
||||||
|
<field name="u16" type="neon_uint16x8"/>
|
||||||
|
<field name="u32" type="neon_uint32x4"/>
|
||||||
|
<field name="u64" type="neon_uint64x2"/>
|
||||||
|
<field name="f32" type="neon_float32x4"/>
|
||||||
|
<field name="f64" type="neon_float64x2"/>
|
||||||
|
</union>
|
||||||
|
<reg name="d0" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d1" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d2" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d3" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d4" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d5" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d6" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d7" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d8" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d9" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d10" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d11" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d12" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d13" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d14" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d15" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d16" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d17" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d18" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d19" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d20" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d21" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d22" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d23" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d24" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d25" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d26" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d27" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d28" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d29" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d30" bitsize="64" type="neon_d"/>
|
||||||
|
<reg name="d31" bitsize="64" type="neon_d"/>
|
||||||
|
|
||||||
|
<reg name="q0" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q1" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q2" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q3" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q4" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q5" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q6" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q7" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q8" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q9" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q10" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q11" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q12" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q13" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q14" bitsize="128" type="neon_q"/>
|
||||||
|
<reg name="q15" bitsize="128" type="neon_q"/>
|
||||||
|
|
||||||
|
<reg name="fpscr" bitsize="32" type="int" group="float"/>
|
||||||
|
</feature>
|
14
src/Ryujinx.HLE/Debugger/GdbXml/target32.xml
Normal file
14
src/Ryujinx.HLE/Debugger/GdbXml/target32.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||||
|
Contributed by ARM Ltd.
|
||||||
|
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
|
||||||
|
<!DOCTYPE target SYSTEM "gdb-target.dtd">
|
||||||
|
<target>
|
||||||
|
<architecture>arm</architecture>
|
||||||
|
<xi:include href="arm-core.xml"/>
|
||||||
|
<xi:include href="arm-neon.xml"/>
|
||||||
|
</target>
|
14
src/Ryujinx.HLE/Debugger/GdbXml/target64.xml
Normal file
14
src/Ryujinx.HLE/Debugger/GdbXml/target64.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||||
|
Contributed by ARM Ltd.
|
||||||
|
|
||||||
|
Copying and distribution of this file, with or without modification,
|
||||||
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
notice and this notice are preserved. -->
|
||||||
|
|
||||||
|
<!DOCTYPE target SYSTEM "gdb-target.dtd">
|
||||||
|
<target>
|
||||||
|
<architecture>aarch64</architecture>
|
||||||
|
<xi:include href="aarch64-core.xml"/>
|
||||||
|
<xi:include href="aarch64-fpu.xml"/>
|
||||||
|
</target>
|
21
src/Ryujinx.HLE/Debugger/IDebuggableProcess.cs
Normal file
21
src/Ryujinx.HLE/Debugger/IDebuggableProcess.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using Ryujinx.Cpu;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
|
using Ryujinx.Memory;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
internal interface IDebuggableProcess
|
||||||
|
{
|
||||||
|
void DebugStop();
|
||||||
|
void DebugContinue();
|
||||||
|
void DebugContinue(KThread thread);
|
||||||
|
bool DebugStep(KThread thread);
|
||||||
|
KThread GetThread(ulong threadUid);
|
||||||
|
DebugState GetDebugState();
|
||||||
|
bool IsThreadPaused(KThread thread);
|
||||||
|
ulong[] GetThreadUids();
|
||||||
|
public void DebugInterruptHandler(IExecutionContext ctx);
|
||||||
|
IVirtualMemoryManager CpuMemory { get; }
|
||||||
|
void InvalidateCacheRegion(ulong address, ulong size);
|
||||||
|
}
|
||||||
|
}
|
6
src/Ryujinx.HLE/Debugger/Message/BreakInMessage.cs
Normal file
6
src/Ryujinx.HLE/Debugger/Message/BreakInMessage.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
struct BreakInMessage : IMessage
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
12
src/Ryujinx.HLE/Debugger/Message/CommandMessage.cs
Normal file
12
src/Ryujinx.HLE/Debugger/Message/CommandMessage.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
struct CommandMessage : IMessage
|
||||||
|
{
|
||||||
|
public string Command;
|
||||||
|
|
||||||
|
public CommandMessage(string cmd)
|
||||||
|
{
|
||||||
|
Command = cmd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
src/Ryujinx.HLE/Debugger/Message/IMessage.cs
Normal file
6
src/Ryujinx.HLE/Debugger/Message/IMessage.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
interface IMessage
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
6
src/Ryujinx.HLE/Debugger/Message/KillMessage.cs
Normal file
6
src/Ryujinx.HLE/Debugger/Message/KillMessage.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
struct KillMessage : IMessage
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
6
src/Ryujinx.HLE/Debugger/Message/SendNackMessage.cs
Normal file
6
src/Ryujinx.HLE/Debugger/Message/SendNackMessage.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
struct SendNackMessage : IMessage
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
18
src/Ryujinx.HLE/Debugger/Message/ThreadBreakMessage.cs
Normal file
18
src/Ryujinx.HLE/Debugger/Message/ThreadBreakMessage.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using IExecutionContext = Ryujinx.Cpu.IExecutionContext;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
public class ThreadBreakMessage : IMessage
|
||||||
|
{
|
||||||
|
public IExecutionContext Context { get; }
|
||||||
|
public ulong Address { get; }
|
||||||
|
public int Opcode { get; }
|
||||||
|
|
||||||
|
public ThreadBreakMessage(IExecutionContext context, ulong address, int opcode)
|
||||||
|
{
|
||||||
|
Context = context;
|
||||||
|
Address = address;
|
||||||
|
Opcode = opcode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
28
src/Ryujinx.HLE/Debugger/RegisterInformation.cs
Normal file
28
src/Ryujinx.HLE/Debugger/RegisterInformation.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
class RegisterInformation
|
||||||
|
{
|
||||||
|
public static readonly Dictionary<string, string> Features = new()
|
||||||
|
{
|
||||||
|
{ "target64.xml", GetEmbeddedResourceContent("target64.xml") },
|
||||||
|
{ "target32.xml", GetEmbeddedResourceContent("target32.xml") },
|
||||||
|
{ "aarch64-core.xml", GetEmbeddedResourceContent("aarch64-core.xml") },
|
||||||
|
{ "aarch64-fpu.xml", GetEmbeddedResourceContent("aarch64-fpu.xml") },
|
||||||
|
{ "arm-core.xml", GetEmbeddedResourceContent("arm-core.xml") },
|
||||||
|
{ "arm-neon.xml", GetEmbeddedResourceContent("arm-neon.xml") },
|
||||||
|
};
|
||||||
|
|
||||||
|
private static string GetEmbeddedResourceContent(string resourceName)
|
||||||
|
{
|
||||||
|
Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.HLE.Debugger.GdbXml." + resourceName);
|
||||||
|
StreamReader reader = new StreamReader(stream);
|
||||||
|
string result = reader.ReadToEnd();
|
||||||
|
reader.Dispose();
|
||||||
|
stream.Dispose();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
109
src/Ryujinx.HLE/Debugger/StringStream.cs
Normal file
109
src/Ryujinx.HLE/Debugger/StringStream.cs
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.Debugger
|
||||||
|
{
|
||||||
|
class StringStream
|
||||||
|
{
|
||||||
|
private readonly string Data;
|
||||||
|
private int Position;
|
||||||
|
|
||||||
|
public StringStream(string s)
|
||||||
|
{
|
||||||
|
Data = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public char ReadChar()
|
||||||
|
{
|
||||||
|
return Data[Position++];
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ReadUntil(char needle)
|
||||||
|
{
|
||||||
|
int needlePos = Data.IndexOf(needle, Position);
|
||||||
|
|
||||||
|
if (needlePos == -1)
|
||||||
|
{
|
||||||
|
needlePos = Data.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
string result = Data.Substring(Position, needlePos - Position);
|
||||||
|
Position = needlePos + 1;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ReadLength(int len)
|
||||||
|
{
|
||||||
|
string result = Data.Substring(Position, len);
|
||||||
|
Position += len;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ReadRemaining()
|
||||||
|
{
|
||||||
|
string result = Data.Substring(Position);
|
||||||
|
Position = Data.Length;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ReadRemainingAsHex()
|
||||||
|
{
|
||||||
|
return ulong.Parse(ReadRemaining(), NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ReadUntilAsHex(char needle)
|
||||||
|
{
|
||||||
|
return ulong.Parse(ReadUntil(needle), NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ReadLengthAsHex(int len)
|
||||||
|
{
|
||||||
|
return ulong.Parse(ReadLength(len), NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ReadLengthAsLEHex(int len)
|
||||||
|
{
|
||||||
|
Debug.Assert(len % 2 == 0);
|
||||||
|
|
||||||
|
ulong result = 0;
|
||||||
|
int pos = 0;
|
||||||
|
while (pos < len)
|
||||||
|
{
|
||||||
|
result += ReadLengthAsHex(2) << (4 * pos);
|
||||||
|
pos += 2;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong? ReadRemainingAsThreadUid()
|
||||||
|
{
|
||||||
|
string s = ReadRemaining();
|
||||||
|
return s == "-1" ? null : ulong.Parse(s, NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ConsumePrefix(string prefix)
|
||||||
|
{
|
||||||
|
if (Data.Substring(Position).StartsWith(prefix))
|
||||||
|
{
|
||||||
|
Position += prefix.Length;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ConsumeRemaining(string match)
|
||||||
|
{
|
||||||
|
if (Data.Substring(Position) == match)
|
||||||
|
{
|
||||||
|
Position += match.Length;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsEmpty()
|
||||||
|
{
|
||||||
|
return Position >= Data.Length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
mode = MemoryManagerMode.SoftwarePageTable;
|
mode = MemoryManagerMode.SoftwarePageTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
ICpuEngine cpuEngine = isArm64Host && (mode == MemoryManagerMode.HostMapped || mode == MemoryManagerMode.HostMappedUnsafe)
|
ICpuEngine cpuEngine = isArm64Host && (mode == MemoryManagerMode.HostMapped || mode == MemoryManagerMode.HostMappedUnsafe) && !context.Device.Configuration.EnableGdbStub
|
||||||
? new LightningJitEngine(_tickSource)
|
? new LightningJitEngine(_tickSource)
|
||||||
: new JitEngine(_tickSource);
|
: new JitEngine(_tickSource);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using LibHac.Fs.Shim;
|
|||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.Tools.FsSystem;
|
using LibHac.Tools.FsSystem;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
|
using Ryujinx.HLE.Debugger;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.HOS.Kernel;
|
using Ryujinx.HLE.HOS.Kernel;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
@ -500,5 +501,21 @@ namespace Ryujinx.HLE.HOS
|
|||||||
|
|
||||||
IsPaused = pause;
|
IsPaused = pause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal IDebuggableProcess DebugGetApplicationProcessDebugInterface()
|
||||||
|
{
|
||||||
|
lock (KernelContext.Processes)
|
||||||
|
{
|
||||||
|
return KernelContext.Processes.Values.FirstOrDefault(x => x.IsApplication)?.DebugInterface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal KProcess DebugGetApplicationProcess()
|
||||||
|
{
|
||||||
|
lock (KernelContext.Processes)
|
||||||
|
{
|
||||||
|
return KernelContext.Processes.Values.FirstOrDefault(x => x.IsApplication);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ using Ryujinx.HLE.HOS.Kernel.Memory;
|
|||||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
using Ryujinx.HLE.Loaders.Elf;
|
using Ryujinx.HLE.Loaders.Elf;
|
||||||
using Ryujinx.Memory;
|
using Ryujinx.Memory;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -17,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
|
|
||||||
private readonly KProcess _owner;
|
private readonly KProcess _owner;
|
||||||
|
|
||||||
private class Image
|
public class Image
|
||||||
{
|
{
|
||||||
public ulong BaseAddress { get; }
|
public ulong BaseAddress { get; }
|
||||||
public ulong Size { get; }
|
public ulong Size { get; }
|
||||||
@ -54,6 +55,15 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
|
|
||||||
trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}");
|
trace.AppendLine($"Process: {_owner.Name}, PID: {_owner.Pid}");
|
||||||
|
|
||||||
|
string ThreadName = thread.GetThreadName();
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(ThreadName))
|
||||||
|
{
|
||||||
|
trace.AppendLine($"Thread ID: {thread.ThreadUid} ({ThreadName})");
|
||||||
|
} else {
|
||||||
|
trace.AppendLine($"Thread ID: {thread.ThreadUid}");
|
||||||
|
}
|
||||||
|
|
||||||
void AppendTrace(ulong address)
|
void AppendTrace(ulong address)
|
||||||
{
|
{
|
||||||
if (AnalyzePointer(out PointerInfo info, address, thread))
|
if (AnalyzePointer(out PointerInfo info, address, thread))
|
||||||
@ -283,7 +293,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetGuessedNsoNameFromIndex(int index)
|
public string GetGuessedNsoNameFromIndex(int index)
|
||||||
{
|
{
|
||||||
if ((uint)index > 11)
|
if ((uint)index > 11)
|
||||||
{
|
{
|
||||||
@ -316,6 +326,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Image> GetLoadedImages()
|
||||||
|
{
|
||||||
|
EnsureLoaded();
|
||||||
|
|
||||||
|
lock (_images)
|
||||||
|
{
|
||||||
|
return [.. _images];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void EnsureLoaded()
|
private void EnsureLoaded()
|
||||||
{
|
{
|
||||||
if (Interlocked.CompareExchange(ref _loaded, 1, 0) == 0)
|
if (Interlocked.CompareExchange(ref _loaded, 1, 0) == 0)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
|
using Ryujinx.HLE.Debugger;
|
||||||
using Ryujinx.HLE.Exceptions;
|
using Ryujinx.HLE.Exceptions;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||||
@ -11,6 +12,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using ExceptionCallback = Ryujinx.Cpu.ExceptionCallback;
|
||||||
|
using ExceptionCallbackNoArgs = Ryujinx.Cpu.ExceptionCallbackNoArgs;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Process
|
namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
@ -89,6 +92,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
public IVirtualMemoryManager CpuMemory => Context.AddressSpace;
|
public IVirtualMemoryManager CpuMemory => Context.AddressSpace;
|
||||||
|
|
||||||
public HleProcessDebugger Debugger { get; private set; }
|
public HleProcessDebugger Debugger { get; private set; }
|
||||||
|
public IDebuggableProcess DebugInterface { get; private set; }
|
||||||
|
protected int debugState = (int)DebugState.Running;
|
||||||
|
|
||||||
public KProcess(KernelContext context, bool allowCodeMemoryForJit = false) : base(context)
|
public KProcess(KernelContext context, bool allowCodeMemoryForJit = false) : base(context)
|
||||||
{
|
{
|
||||||
@ -110,6 +115,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
_threads = [];
|
_threads = [];
|
||||||
|
|
||||||
Debugger = new HleProcessDebugger(this);
|
Debugger = new HleProcessDebugger(this);
|
||||||
|
DebugInterface = new DebuggerInterface(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result InitializeKip(
|
public Result InitializeKip(
|
||||||
@ -679,6 +685,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
|
|
||||||
SetState(newState);
|
SetState(newState);
|
||||||
|
|
||||||
|
if (KernelContext.Device.Configuration.DebuggerSuspendOnStart && IsApplication)
|
||||||
|
{
|
||||||
|
mainThread.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
debugState = (int)DebugState.Stopped;
|
||||||
|
Logger.Notice.Print(LogClass.Kernel, $"Application is suspended on start for debugging.");
|
||||||
|
}
|
||||||
|
|
||||||
result = mainThread.Start();
|
result = mainThread.Start();
|
||||||
|
|
||||||
if (result != Result.Success)
|
if (result != Result.Success)
|
||||||
@ -727,9 +740,19 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
|
|
||||||
public IExecutionContext CreateExecutionContext()
|
public IExecutionContext CreateExecutionContext()
|
||||||
{
|
{
|
||||||
|
ExceptionCallback breakCallback = null;
|
||||||
|
ExceptionCallbackNoArgs stepCallback = null;
|
||||||
|
|
||||||
|
if (KernelContext.Device.Configuration.EnableGdbStub && KernelContext.Device.Debugger != null)
|
||||||
|
{
|
||||||
|
breakCallback = KernelContext.Device.Debugger.BreakHandler;
|
||||||
|
stepCallback = KernelContext.Device.Debugger.StepHandler;
|
||||||
|
}
|
||||||
|
|
||||||
return Context?.CreateExecutionContext(new ExceptionCallbacks(
|
return Context?.CreateExecutionContext(new ExceptionCallbacks(
|
||||||
InterruptHandler,
|
InterruptHandler,
|
||||||
null,
|
breakCallback,
|
||||||
|
stepCallback,
|
||||||
KernelContext.SyscallHandler.SvcCall,
|
KernelContext.SyscallHandler.SvcCall,
|
||||||
UndefinedInstructionHandler));
|
UndefinedInstructionHandler));
|
||||||
}
|
}
|
||||||
@ -1174,5 +1197,186 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
{
|
{
|
||||||
return Capabilities.IsSvcPermitted(svcId);
|
return Capabilities.IsSvcPermitted(svcId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class DebuggerInterface : IDebuggableProcess
|
||||||
|
{
|
||||||
|
private Barrier StepBarrier;
|
||||||
|
private readonly KProcess _parent;
|
||||||
|
private readonly KernelContext _kernelContext;
|
||||||
|
private KThread steppingThread;
|
||||||
|
|
||||||
|
public DebuggerInterface(KProcess p)
|
||||||
|
{
|
||||||
|
_parent = p;
|
||||||
|
_kernelContext = p.KernelContext;
|
||||||
|
StepBarrier = new(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DebugStop()
|
||||||
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref _parent.debugState, (int)DebugState.Stopping,
|
||||||
|
(int)DebugState.Running) != (int)DebugState.Running)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
foreach (KThread thread in _parent._threads)
|
||||||
|
{
|
||||||
|
thread.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
thread.Context.RequestInterrupt();
|
||||||
|
if (!thread.DebugHalt.WaitOne(TimeSpan.FromMilliseconds(50)))
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, $"Failed to suspend thread {thread.ThreadUid} in time.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_parent.debugState = (int)DebugState.Stopped;
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DebugContinue()
|
||||||
|
{
|
||||||
|
if (Interlocked.CompareExchange(ref _parent.debugState, (int)DebugState.Running,
|
||||||
|
(int)DebugState.Stopped) != (int)DebugState.Stopped)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
foreach (KThread thread in _parent._threads)
|
||||||
|
{
|
||||||
|
thread.Resume(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DebugContinue(KThread target)
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref _parent.debugState, (int)DebugState.Running);
|
||||||
|
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
target.Resume(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool DebugStep(KThread target)
|
||||||
|
{
|
||||||
|
if (!IsThreadPaused(target))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
steppingThread = target;
|
||||||
|
bool waiting = target.MutexOwner != null || target.WaitingSync || target.WaitingInArbitration;
|
||||||
|
target.Context.RequestDebugStep();
|
||||||
|
if (waiting)
|
||||||
|
{
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
foreach (KThread thread in _parent._threads)
|
||||||
|
{
|
||||||
|
thread.Resume(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target.Resume(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
|
||||||
|
bool stepTimedOut = false;
|
||||||
|
if (!StepBarrier.SignalAndWait(TimeSpan.FromMilliseconds(2000)))
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, $"Failed to step thread {target.ThreadUid} in time.");
|
||||||
|
stepTimedOut = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
steppingThread = null;
|
||||||
|
if (waiting)
|
||||||
|
{
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
foreach (KThread thread in _parent._threads)
|
||||||
|
{
|
||||||
|
thread.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||||
|
}
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
|
||||||
|
if (stepTimedOut)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
StepBarrier.SignalAndWait();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DebugState GetDebugState()
|
||||||
|
{
|
||||||
|
return (DebugState)_parent.debugState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsThreadPaused(KThread target)
|
||||||
|
{
|
||||||
|
return (target.SchedFlags & ThreadSchedState.ThreadPauseFlag) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong[] GetThreadUids()
|
||||||
|
{
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
var threads = _parent._threads.Where(x => !x.TerminationRequested).ToArray();
|
||||||
|
return threads.Select(x => x.ThreadUid).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public KThread GetThread(ulong threadUid)
|
||||||
|
{
|
||||||
|
lock (_parent._threadingLock)
|
||||||
|
{
|
||||||
|
var threads = _parent._threads.Where(x => !x.TerminationRequested).ToArray();
|
||||||
|
return threads.FirstOrDefault(x => x.ThreadUid == threadUid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DebugInterruptHandler(IExecutionContext ctx)
|
||||||
|
{
|
||||||
|
_kernelContext.CriticalSection.Enter();
|
||||||
|
bool stepping = steppingThread != null;
|
||||||
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
if (stepping)
|
||||||
|
{
|
||||||
|
StepBarrier.SignalAndWait();
|
||||||
|
StepBarrier.SignalAndWait();
|
||||||
|
}
|
||||||
|
_parent.InterruptHandler(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IVirtualMemoryManager CpuMemory { get { return _parent.CpuMemory; } }
|
||||||
|
|
||||||
|
public void InvalidateCacheRegion(ulong address, ulong size)
|
||||||
|
{
|
||||||
|
_parent.Context.InvalidateCacheRegion(address, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using ARMeilleure.State;
|
using ARMeilleure.State;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Process
|
namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
@ -17,10 +18,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
|
|
||||||
public bool IsAarch32 { get => false; set { } }
|
public bool IsAarch32 { get => false; set { } }
|
||||||
|
|
||||||
|
public ulong ThreadUid { get; set; }
|
||||||
|
|
||||||
public bool Running { get; private set; } = true;
|
public bool Running { get; private set; } = true;
|
||||||
|
|
||||||
private readonly ulong[] _x = new ulong[32];
|
private readonly ulong[] _x = new ulong[32];
|
||||||
|
|
||||||
|
public ulong DebugPc { get; set; }
|
||||||
|
|
||||||
public ulong GetX(int index) => _x[index];
|
public ulong GetX(int index) => _x[index];
|
||||||
public void SetX(int index, ulong value) => _x[index] = value;
|
public void SetX(int index, ulong value) => _x[index] = value;
|
||||||
|
|
||||||
@ -31,6 +36,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RequestDebugStep()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void StopRunning()
|
public void StopRunning()
|
||||||
{
|
{
|
||||||
Running = false;
|
Running = false;
|
||||||
|
@ -301,6 +301,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
|
|
||||||
currentThread.SchedulerWaitEvent.Reset();
|
currentThread.SchedulerWaitEvent.Reset();
|
||||||
currentThread.ThreadContext.Unlock();
|
currentThread.ThreadContext.Unlock();
|
||||||
|
currentThread.DebugHalt.Set();
|
||||||
|
|
||||||
// Wake all the threads that might be waiting until this thread context is unlocked.
|
// Wake all the threads that might be waiting until this thread context is unlocked.
|
||||||
for (int core = 0; core < CpuCoresCount; core++)
|
for (int core = 0; core < CpuCoresCount; core++)
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
|
using Ryujinx.HLE.Debugger;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||||
using Ryujinx.HLE.HOS.Kernel.SupervisorCall;
|
using Ryujinx.HLE.HOS.Kernel.SupervisorCall;
|
||||||
using Ryujinx.Horizon.Common;
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Memory;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||||
@ -16,6 +19,23 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
private const int TlsUserDisableCountOffset = 0x100;
|
private const int TlsUserDisableCountOffset = 0x100;
|
||||||
private const int TlsUserInterruptFlagOffset = 0x102;
|
private const int TlsUserInterruptFlagOffset = 0x102;
|
||||||
|
|
||||||
|
// Tls -> ThreadType
|
||||||
|
private const int TlsThreadTypeOffsetAArch64 = 0x1F8;
|
||||||
|
private const int TlsThreadTypeOffsetAArch32 = 0x1FC;
|
||||||
|
|
||||||
|
// Tls -> ThreadType -> Version
|
||||||
|
private const int TlsThreadTypeVersionOffsetAArch64 = 0x46;
|
||||||
|
private const int TlsThreadTypeVersionOffsetAArch32 = 0x26;
|
||||||
|
|
||||||
|
// Tls -> ThreadType (Version 0) -> ThreadNamePointer
|
||||||
|
private const int TlsThreadTypeVersion0ThreadNamePointerOffsetAArch64 = 0x1A8;
|
||||||
|
private const int TlsThreadTypeVersion0ThreadNamePointerOffsetAArch32 = 0xE8;
|
||||||
|
|
||||||
|
// Tls -> ThreadType (Version 1) -> ThreadNamePointer
|
||||||
|
private const int TlsThreadTypeThreadNamePointerOffsetAArch64 = 0x1A0;
|
||||||
|
private const int TlsThreadTypeThreadNamePointerOffsetAArch32 = 0xE4;
|
||||||
|
|
||||||
|
|
||||||
public const int MaxWaitSyncObjects = 64;
|
public const int MaxWaitSyncObjects = 64;
|
||||||
|
|
||||||
private ManualResetEvent _schedulerWaitEvent;
|
private ManualResetEvent _schedulerWaitEvent;
|
||||||
@ -114,6 +134,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
|
|
||||||
private readonly Lock _activityOperationLock = new();
|
private readonly Lock _activityOperationLock = new();
|
||||||
|
|
||||||
|
internal readonly ManualResetEvent DebugHalt = new(false);
|
||||||
|
|
||||||
public KThread(KernelContext context) : base(context)
|
public KThread(KernelContext context) : base(context)
|
||||||
{
|
{
|
||||||
WaitSyncObjects = new KSynchronizationObject[MaxWaitSyncObjects];
|
WaitSyncObjects = new KSynchronizationObject[MaxWaitSyncObjects];
|
||||||
@ -202,8 +224,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
}
|
}
|
||||||
|
|
||||||
Context.TpidrroEl0 = (long)_tlsAddress;
|
Context.TpidrroEl0 = (long)_tlsAddress;
|
||||||
|
Context.DebugPc = _entrypoint;
|
||||||
|
|
||||||
ThreadUid = KernelContext.NewThreadUid();
|
ThreadUid = KernelContext.NewThreadUid();
|
||||||
|
Context.ThreadUid = ThreadUid;
|
||||||
|
|
||||||
HostThread.Name = customThreadStart != null ? $"HLE.OsThread.{ThreadUid}" : $"HLE.GuestThread.{ThreadUid}";
|
HostThread.Name = customThreadStart != null ? $"HLE.OsThread.{ThreadUid}" : $"HLE.GuestThread.{ThreadUid}";
|
||||||
|
|
||||||
@ -307,7 +331,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
{
|
{
|
||||||
KernelContext.CriticalSection.Enter();
|
KernelContext.CriticalSection.Enter();
|
||||||
|
|
||||||
if (Owner != null && Owner.PinnedThreads[KernelStatic.GetCurrentThread().CurrentCore] == this)
|
KThread currentThread = KernelStatic.GetCurrentThread();
|
||||||
|
|
||||||
|
if (Owner != null && currentThread != null && Owner.PinnedThreads[currentThread.CurrentCore] == this)
|
||||||
{
|
{
|
||||||
Owner.UnpinThread(this);
|
Owner.UnpinThread(this);
|
||||||
}
|
}
|
||||||
@ -362,7 +388,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
{
|
{
|
||||||
ThreadSchedState state = PrepareForTermination();
|
ThreadSchedState state = PrepareForTermination();
|
||||||
|
|
||||||
if (state != ThreadSchedState.TerminationPending)
|
if (KernelStatic.GetCurrentThread() == this && state != ThreadSchedState.TerminationPending)
|
||||||
{
|
{
|
||||||
KernelContext.Synchronization.WaitFor(new KSynchronizationObject[] { this }, -1, out _);
|
KernelContext.Synchronization.WaitFor(new KSynchronizationObject[] { this }, -1, out _);
|
||||||
}
|
}
|
||||||
@ -1248,6 +1274,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
private void ThreadStart()
|
private void ThreadStart()
|
||||||
{
|
{
|
||||||
_schedulerWaitEvent.WaitOne();
|
_schedulerWaitEvent.WaitOne();
|
||||||
|
DebugHalt.Reset();
|
||||||
KernelStatic.SetKernelContext(KernelContext, this);
|
KernelStatic.SetKernelContext(KernelContext, this);
|
||||||
|
|
||||||
if (_customThreadStart != null)
|
if (_customThreadStart != null)
|
||||||
@ -1431,5 +1458,84 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|||||||
{
|
{
|
||||||
Owner.CpuMemory.Write<ushort>(_tlsAddress + TlsUserInterruptFlagOffset, 0);
|
Owner.CpuMemory.Write<ushort>(_tlsAddress + TlsUserInterruptFlagOffset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetThreadName()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ulong threadNamePtr = 0;
|
||||||
|
if (Context.IsAarch32)
|
||||||
|
{
|
||||||
|
uint threadTypePtr32 = Owner.CpuMemory.Read<uint>(_tlsAddress + TlsThreadTypeOffsetAArch32);
|
||||||
|
if (threadTypePtr32 == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
ushort version = Owner.CpuMemory.Read<ushort>(threadTypePtr32 + TlsThreadTypeVersionOffsetAArch32);
|
||||||
|
switch (version)
|
||||||
|
{
|
||||||
|
case 0x0000:
|
||||||
|
case 0xFFFF:
|
||||||
|
threadNamePtr = Owner.CpuMemory.Read<uint>(threadTypePtr32 + TlsThreadTypeVersion0ThreadNamePointerOffsetAArch32);
|
||||||
|
break;
|
||||||
|
case 0x0001:
|
||||||
|
threadNamePtr = Owner.CpuMemory.Read<uint>(threadTypePtr32 + TlsThreadTypeThreadNamePointerOffsetAArch32);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, $"Unknown ThreadType struct version: {version}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ulong threadTypePtr64 = Owner.CpuMemory.Read<ulong>(_tlsAddress + TlsThreadTypeOffsetAArch64);
|
||||||
|
if (threadTypePtr64 == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
ushort version = Owner.CpuMemory.Read<ushort>(threadTypePtr64 + TlsThreadTypeVersionOffsetAArch64);
|
||||||
|
switch (version)
|
||||||
|
{
|
||||||
|
case 0x0000:
|
||||||
|
case 0xFFFF:
|
||||||
|
threadNamePtr = Owner.CpuMemory.Read<ulong>(threadTypePtr64 + TlsThreadTypeVersion0ThreadNamePointerOffsetAArch64);
|
||||||
|
break;
|
||||||
|
case 0x0001:
|
||||||
|
threadNamePtr = Owner.CpuMemory.Read<ulong>(threadTypePtr64 + TlsThreadTypeThreadNamePointerOffsetAArch64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, $"Unknown ThreadType struct version: {version}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (threadNamePtr == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
List<byte> nameBytes = new();
|
||||||
|
for (int i = 0; i < 0x20; i++)
|
||||||
|
{
|
||||||
|
byte b = Owner.CpuMemory.Read<byte>(threadNamePtr + (ulong)i);
|
||||||
|
if (b == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
nameBytes.Add(b);
|
||||||
|
}
|
||||||
|
return Encoding.UTF8.GetString(nameBytes.ToArray());
|
||||||
|
|
||||||
|
} catch (InvalidMemoryRegionException)
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, "Failed to get thread name.");
|
||||||
|
return "";
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.Error?.Print(LogClass.Kernel, $"Error getting thread name: {e.Message}");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,21 @@ namespace Ryujinx.HLE
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Action RefreshInputConfig { internal get; set; }
|
public Action RefreshInputConfig { internal get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables gdbstub to allow for debugging of the guest .
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableGdbStub { internal get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A TCP port to use to expose a gdbstub for a debugger to connect to.
|
||||||
|
/// </summary>
|
||||||
|
public ushort GdbStubPort { internal get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Suspend execution when starting an application
|
||||||
|
/// </summary>
|
||||||
|
public bool DebuggerSuspendOnStart { internal get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The desired hacky workarounds.
|
/// The desired hacky workarounds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -222,6 +237,9 @@ namespace Ryujinx.HLE
|
|||||||
bool multiplayerDisableP2p,
|
bool multiplayerDisableP2p,
|
||||||
string multiplayerLdnPassphrase,
|
string multiplayerLdnPassphrase,
|
||||||
string multiplayerLdnServer,
|
string multiplayerLdnServer,
|
||||||
|
bool enableGdbStub,
|
||||||
|
ushort gdbStubPort,
|
||||||
|
bool debuggerSuspendOnStart,
|
||||||
int customVSyncInterval,
|
int customVSyncInterval,
|
||||||
EnabledDirtyHack[] dirtyHacks = null)
|
EnabledDirtyHack[] dirtyHacks = null)
|
||||||
{
|
{
|
||||||
@ -248,6 +266,9 @@ namespace Ryujinx.HLE
|
|||||||
MultiplayerDisableP2p = multiplayerDisableP2p;
|
MultiplayerDisableP2p = multiplayerDisableP2p;
|
||||||
MultiplayerLdnPassphrase = multiplayerLdnPassphrase;
|
MultiplayerLdnPassphrase = multiplayerLdnPassphrase;
|
||||||
MultiplayerLdnServer = multiplayerLdnServer;
|
MultiplayerLdnServer = multiplayerLdnServer;
|
||||||
|
EnableGdbStub = enableGdbStub;
|
||||||
|
GdbStubPort = gdbStubPort;
|
||||||
|
DebuggerSuspendOnStart = debuggerSuspendOnStart;
|
||||||
Hacks = dirtyHacks ?? [];
|
Hacks = dirtyHacks ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,12 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Remove="Debugger\GdbXml\aarch64-core.xml" />
|
||||||
|
<None Remove="Debugger\GdbXml\aarch64-fpu.xml" />
|
||||||
|
<None Remove="Debugger\GdbXml\arm-core.xml" />
|
||||||
|
<None Remove="Debugger\GdbXml\arm-neon.xml" />
|
||||||
|
<None Remove="Debugger\GdbXml\target64.xml" />
|
||||||
|
<None Remove="Debugger\GdbXml\target32.xml" />
|
||||||
<None Remove="Homebrew.npdm" />
|
<None Remove="Homebrew.npdm" />
|
||||||
<None Remove="HOS\Applets\SoftwareKeyboard\Resources\Logo_Ryujinx.png" />
|
<None Remove="HOS\Applets\SoftwareKeyboard\Resources\Logo_Ryujinx.png" />
|
||||||
<None Remove="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnA.png" />
|
<None Remove="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnA.png" />
|
||||||
@ -42,6 +48,12 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\aarch64-core.xml" />
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\aarch64-fpu.xml" />
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\arm-core.xml" />
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\arm-neon.xml" />
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\target64.xml" />
|
||||||
|
<EmbeddedResource Include="Debugger\GdbXml\target32.xml" />
|
||||||
<EmbeddedResource Include="Homebrew.npdm" />
|
<EmbeddedResource Include="Homebrew.npdm" />
|
||||||
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Logo_Ryujinx.png" />
|
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Logo_Ryujinx.png" />
|
||||||
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnA.png" />
|
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnA.png" />
|
||||||
|
@ -14,6 +14,7 @@ using Ryujinx.HLE.Loaders.Processes;
|
|||||||
using Ryujinx.HLE.UI;
|
using Ryujinx.HLE.UI;
|
||||||
using Ryujinx.Memory;
|
using Ryujinx.Memory;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.HLE
|
namespace Ryujinx.HLE
|
||||||
{
|
{
|
||||||
@ -41,6 +42,7 @@ namespace Ryujinx.HLE
|
|||||||
public Hid Hid { get; }
|
public Hid Hid { get; }
|
||||||
public TamperMachine TamperMachine { get; }
|
public TamperMachine TamperMachine { get; }
|
||||||
public IHostUIHandler UIHandler { get; }
|
public IHostUIHandler UIHandler { get; }
|
||||||
|
public Debugger.Debugger Debugger { get; }
|
||||||
|
|
||||||
public int CpuCoresCount = 4; // Switch has a quad-core Tegra X1 SoC
|
public int CpuCoresCount = 4; // Switch has a quad-core Tegra X1 SoC
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ namespace Ryujinx.HLE
|
|||||||
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
|
||||||
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
|
||||||
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
|
||||||
|
Debugger = Configuration.EnableGdbStub ? new Debugger.Debugger(this, Configuration.GdbStubPort) : null;
|
||||||
System = new HOS.Horizon(this);
|
System = new HOS.Horizon(this);
|
||||||
Statistics = new PerformanceStatistics(this);
|
Statistics = new PerformanceStatistics(this);
|
||||||
Hid = new Hid(this, System.HidStorage);
|
Hid = new Hid(this, System.HidStorage);
|
||||||
@ -173,6 +176,7 @@ namespace Ryujinx.HLE
|
|||||||
AudioDeviceDriver.Dispose();
|
AudioDeviceDriver.Dispose();
|
||||||
FileSystem.Dispose();
|
FileSystem.Dispose();
|
||||||
Memory.Dispose();
|
Memory.Dispose();
|
||||||
|
Debugger?.Dispose();
|
||||||
|
|
||||||
TitleIDs.CurrentApplication.Value = null;
|
TitleIDs.CurrentApplication.Value = null;
|
||||||
Shared = null;
|
Shared = null;
|
||||||
|
@ -338,6 +338,9 @@ namespace Ryujinx.Headless
|
|||||||
false,
|
false,
|
||||||
string.Empty,
|
string.Empty,
|
||||||
string.Empty,
|
string.Empty,
|
||||||
|
options.EnableGdbStub,
|
||||||
|
options.GdbStubPort,
|
||||||
|
options.DebuggerSuspendOnStart,
|
||||||
options.CustomVSyncInterval
|
options.CustomVSyncInterval
|
||||||
)
|
)
|
||||||
.Configure(
|
.Configure(
|
||||||
|
@ -423,6 +423,17 @@ namespace Ryujinx.Headless
|
|||||||
[Option("skip-user-profiles-manager", Required = false, Default = false, HelpText = "Enable skips the Profiles Manager popup during gameplay. Select the desired profile before starting the game")]
|
[Option("skip-user-profiles-manager", Required = false, Default = false, HelpText = "Enable skips the Profiles Manager popup during gameplay. Select the desired profile before starting the game")]
|
||||||
public bool SkipUserProfilesManager { get; set; }
|
public bool SkipUserProfilesManager { get; set; }
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
|
||||||
|
[Option("enable-gdb-stub", Required = false, Default = false, HelpText = "Enables the GDB stub so that a developer can attach a debugger to the emulated process.")]
|
||||||
|
public bool EnableGdbStub { get; set; }
|
||||||
|
|
||||||
|
[Option("gdb-stub-port", Required = false, Default = 55555, HelpText = "Specifies which TCP port the GDB stub listens on.")]
|
||||||
|
public ushort GdbStubPort { get; set; }
|
||||||
|
|
||||||
|
[Option("suspend-on-start", Required = false, Default = false, HelpText = "Suspend execution when starting an application.")]
|
||||||
|
public bool DebuggerSuspendOnStart { get; set; }
|
||||||
|
|
||||||
// Values
|
// Values
|
||||||
|
|
||||||
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
||||||
|
@ -218,6 +218,10 @@ namespace Ryujinx.Ava.Systems
|
|||||||
ConfigurationState.Instance.Multiplayer.LdnServer.Event += UpdateLdnServerState;
|
ConfigurationState.Instance.Multiplayer.LdnServer.Event += UpdateLdnServerState;
|
||||||
ConfigurationState.Instance.Multiplayer.DisableP2p.Event += UpdateDisableP2pState;
|
ConfigurationState.Instance.Multiplayer.DisableP2p.Event += UpdateDisableP2pState;
|
||||||
|
|
||||||
|
ConfigurationState.Instance.Debug.EnableGdbStub.Event += UpdateEnableGdbStubState;
|
||||||
|
ConfigurationState.Instance.Debug.GdbStubPort.Event += UpdateGdbStubPortState;
|
||||||
|
ConfigurationState.Instance.Debug.DebuggerSuspendOnStart.Event += UpdateDebuggerSuspendOnStartState;
|
||||||
|
|
||||||
_gpuCancellationTokenSource = new CancellationTokenSource();
|
_gpuCancellationTokenSource = new CancellationTokenSource();
|
||||||
_gpuDoneEvent = new ManualResetEvent(false);
|
_gpuDoneEvent = new ManualResetEvent(false);
|
||||||
}
|
}
|
||||||
@ -564,6 +568,21 @@ namespace Ryujinx.Ava.Systems
|
|||||||
Device.Configuration.MultiplayerDisableP2p = e.NewValue;
|
Device.Configuration.MultiplayerDisableP2p = e.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateEnableGdbStubState(object sender, ReactiveEventArgs<bool> e)
|
||||||
|
{
|
||||||
|
Device.Configuration.EnableGdbStub = e.NewValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateGdbStubPortState(object sender, ReactiveEventArgs<ushort> e)
|
||||||
|
{
|
||||||
|
Device.Configuration.GdbStubPort = e.NewValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateDebuggerSuspendOnStartState(object sender, ReactiveEventArgs<bool> e)
|
||||||
|
{
|
||||||
|
Device.Configuration.DebuggerSuspendOnStart = e.NewValue;
|
||||||
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
_isActive = false;
|
_isActive = false;
|
||||||
|
@ -464,6 +464,21 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool UseHypervisor { get; set; }
|
public bool UseHypervisor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables or disables the GDB stub
|
||||||
|
/// </summary>
|
||||||
|
public bool EnableGdbStub { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Which TCP port should the GDB stub listen on
|
||||||
|
/// </summary>
|
||||||
|
public ushort GdbStubPort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Suspend execution when starting an application
|
||||||
|
/// </summary>
|
||||||
|
public bool DebuggerSuspendOnStart { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show toggles for dirty hacks in the UI.
|
/// Show toggles for dirty hacks in the UI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -156,6 +156,10 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
Multiplayer.LdnPassphrase.Value = cff.MultiplayerLdnPassphrase;
|
Multiplayer.LdnPassphrase.Value = cff.MultiplayerLdnPassphrase;
|
||||||
Multiplayer.LdnServer.Value = cff.LdnServer;
|
Multiplayer.LdnServer.Value = cff.LdnServer;
|
||||||
|
|
||||||
|
Debug.EnableGdbStub.Value = shouldLoadFromFile ? cff.EnableGdbStub : Debug.EnableGdbStub.Value; // Get from global config only
|
||||||
|
Debug.GdbStubPort.Value = shouldLoadFromFile ? cff.GdbStubPort : Debug.GdbStubPort.Value; // Get from global config only
|
||||||
|
Debug.DebuggerSuspendOnStart.Value = shouldLoadFromFile ? cff.DebuggerSuspendOnStart : Debug.DebuggerSuspendOnStart.Value; // Get from global config only
|
||||||
|
|
||||||
{
|
{
|
||||||
Hacks.ShowDirtyHacks.Value = shouldLoadFromFile ? cff.ShowDirtyHacks : Hacks.ShowDirtyHacks.Value; // Get from global config only
|
Hacks.ShowDirtyHacks.Value = shouldLoadFromFile ? cff.ShowDirtyHacks : Hacks.ShowDirtyHacks.Value; // Get from global config only
|
||||||
|
|
||||||
|
@ -703,6 +703,37 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Debug configuration section
|
||||||
|
/// </summary>
|
||||||
|
public class DebugSection
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enables or disables the GDB stub
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> EnableGdbStub { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Which TCP port should the GDB stub listen on
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<ushort> GdbStubPort { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Suspend execution when starting an application
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> DebuggerSuspendOnStart { get; private set; }
|
||||||
|
|
||||||
|
public DebugSection()
|
||||||
|
{
|
||||||
|
EnableGdbStub = new ReactiveObject<bool>();
|
||||||
|
EnableGdbStub.LogChangesToValue(nameof(EnableGdbStub));
|
||||||
|
GdbStubPort = new ReactiveObject<ushort>();
|
||||||
|
GdbStubPort.LogChangesToValue(nameof(GdbStubPort));
|
||||||
|
DebuggerSuspendOnStart = new ReactiveObject<bool>();
|
||||||
|
DebuggerSuspendOnStart.LogChangesToValue(nameof(DebuggerSuspendOnStart));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class HacksSection
|
public class HacksSection
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -801,6 +832,11 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MultiplayerSection Multiplayer { get; private set; }
|
public MultiplayerSection Multiplayer { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Debug
|
||||||
|
/// </summary>
|
||||||
|
public DebugSection Debug { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Dirty Hacks section
|
/// The Dirty Hacks section
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -854,6 +890,7 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
Graphics = new GraphicsSection();
|
Graphics = new GraphicsSection();
|
||||||
Hid = new HidSection();
|
Hid = new HidSection();
|
||||||
Multiplayer = new MultiplayerSection();
|
Multiplayer = new MultiplayerSection();
|
||||||
|
Debug = new DebugSection();
|
||||||
Hacks = new HacksSection();
|
Hacks = new HacksSection();
|
||||||
UpdateCheckerType = new ReactiveObject<UpdaterType>();
|
UpdateCheckerType = new ReactiveObject<UpdaterType>();
|
||||||
FocusLostActionType = new ReactiveObject<FocusLostType>();
|
FocusLostActionType = new ReactiveObject<FocusLostType>();
|
||||||
@ -893,6 +930,9 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
Multiplayer.DisableP2p,
|
Multiplayer.DisableP2p,
|
||||||
Multiplayer.LdnPassphrase,
|
Multiplayer.LdnPassphrase,
|
||||||
Multiplayer.GetLdnServer(),
|
Multiplayer.GetLdnServer(),
|
||||||
|
Debug.EnableGdbStub,
|
||||||
|
Debug.GdbStubPort,
|
||||||
|
Debug.DebuggerSuspendOnStart,
|
||||||
Graphics.CustomVSyncInterval,
|
Graphics.CustomVSyncInterval,
|
||||||
Hacks.ShowDirtyHacks ? Hacks.EnabledHacks : null);
|
Hacks.ShowDirtyHacks ? Hacks.EnabledHacks : null);
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,9 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
MultiplayerDisableP2p = Multiplayer.DisableP2p,
|
MultiplayerDisableP2p = Multiplayer.DisableP2p,
|
||||||
MultiplayerLdnPassphrase = Multiplayer.LdnPassphrase,
|
MultiplayerLdnPassphrase = Multiplayer.LdnPassphrase,
|
||||||
LdnServer = Multiplayer.LdnServer,
|
LdnServer = Multiplayer.LdnServer,
|
||||||
|
EnableGdbStub = Debug.EnableGdbStub,
|
||||||
|
GdbStubPort = Debug.GdbStubPort,
|
||||||
|
DebuggerSuspendOnStart = Debug.DebuggerSuspendOnStart,
|
||||||
ShowDirtyHacks = Hacks.ShowDirtyHacks,
|
ShowDirtyHacks = Hacks.ShowDirtyHacks,
|
||||||
DirtyHacks = Hacks.EnabledHacks.Select(it => it.Pack()).ToArray(),
|
DirtyHacks = Hacks.EnabledHacks.Select(it => it.Pack()).ToArray(),
|
||||||
};
|
};
|
||||||
@ -324,6 +327,9 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Debug.EnableGdbStub.Value = false;
|
||||||
|
Debug.GdbStubPort.Value = 55555;
|
||||||
|
Debug.DebuggerSuspendOnStart.Value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GraphicsBackend DefaultGraphicsBackend()
|
private static GraphicsBackend DefaultGraphicsBackend()
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
Command="{Binding ToggleFavorite}"
|
Command="{Binding ToggleFavorite}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuToggleFavorite}"
|
Header="{ext:Locale GameListContextMenuToggleFavorite}"
|
||||||
Icon="{ext:Icon fa-solid fa-star}"
|
Icon="{ext:Icon fa-solid fa-star}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuToggleFavoriteToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding CreateApplicationShortcut}"
|
Command="{Binding CreateApplicationShortcut}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
@ -47,62 +46,53 @@
|
|||||||
Command="{Binding OpenApplicationData}"
|
Command="{Binding OpenApplicationData}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuShowGameData}"
|
Header="{ext:Locale GameListContextMenuShowGameData}"
|
||||||
Icon="{ext:Icon fa-solid fa-chart-line}"
|
Icon="{ext:Icon fa-solid fa-chart-line}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuShowGameDataToolTip}"/>
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenUserSaveDirectory}"
|
Command="{Binding OpenUserSaveDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuOpenUserSaveDirectory}"
|
Header="{ext:Locale GameListContextMenuOpenUserSaveDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-sd-card}"
|
Icon="{ext:Icon fa-solid fa-sd-card}"
|
||||||
IsEnabled="{Binding OpenUserSaveDirectoryEnabled}"
|
IsEnabled="{Binding OpenUserSaveDirectoryEnabled}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenDeviceSaveDirectory}"
|
Command="{Binding OpenDeviceSaveDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuOpenDeviceSaveDirectory}"
|
Header="{ext:Locale GameListContextMenuOpenDeviceSaveDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-hard-drive}"
|
Icon="{ext:Icon fa-solid fa-hard-drive}"
|
||||||
IsEnabled="{Binding OpenDeviceSaveDirectoryEnabled}"
|
IsEnabled="{Binding OpenDeviceSaveDirectoryEnabled}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuOpenDeviceSaveDirectoryToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenBcatSaveDirectory}"
|
Command="{Binding OpenBcatSaveDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuOpenBcatSaveDirectory}"
|
Header="{ext:Locale GameListContextMenuOpenBcatSaveDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-box-archive}"
|
Icon="{ext:Icon fa-solid fa-box-archive}"
|
||||||
IsEnabled="{Binding OpenBcatSaveDirectoryEnabled}"
|
IsEnabled="{Binding OpenBcatSaveDirectoryEnabled}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuOpenBcatSaveDirectoryToolTip}" />
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenTitleUpdateManager}"
|
Command="{Binding OpenTitleUpdateManager}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuManageTitleUpdates}"
|
Header="{ext:Locale GameListContextMenuManageTitleUpdates}"
|
||||||
Icon="{ext:Icon fa-solid fa-code-compare}"
|
Icon="{ext:Icon fa-solid fa-code-compare}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuManageTitleUpdatesToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenDownloadableContentManager}"
|
Command="{Binding OpenDownloadableContentManager}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuManageDlc}"
|
Header="{ext:Locale GameListContextMenuManageDlc}"
|
||||||
Icon="{ext:Icon fa-solid fa-download}"
|
Icon="{ext:Icon fa-solid fa-download}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuManageDlcToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenCheatManager}"
|
Command="{Binding OpenCheatManager}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuManageCheat}"
|
Header="{ext:Locale GameListContextMenuManageCheat}"
|
||||||
Icon="{ext:Icon fa-solid fa-code}"
|
Icon="{ext:Icon fa-solid fa-code}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuManageCheatToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenModManager}"
|
Command="{Binding OpenModManager}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuManageMod}"
|
Header="{ext:Locale GameListContextMenuManageMod}"
|
||||||
Icon="{ext:Icon fa-solid fa-sliders}"
|
Icon="{ext:Icon fa-solid fa-sliders}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuManageModToolTip}" />
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenModsDirectory}"
|
Command="{Binding OpenModsDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuOpenModsDirectory}"
|
Header="{ext:Locale GameListContextMenuOpenModsDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-folder}"
|
Icon="{ext:Icon fa-solid fa-folder}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenSdModsDirectory}"
|
Command="{Binding OpenSdModsDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
@ -128,26 +118,22 @@
|
|||||||
Command="{Binding NukePtcCache}"
|
Command="{Binding NukePtcCache}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementNukePptc}"
|
Header="{ext:Locale GameListContextMenuCacheManagementNukePptc}"
|
||||||
Icon="{ext:Icon fa-solid fa-trash-can}"
|
Icon="{ext:Icon fa-solid fa-trash-can}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementNukePptcToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding PurgeShaderCache}"
|
Command="{Binding PurgeShaderCache}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
Header="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
||||||
Icon="{ext:Icon fa-solid fa-trash-can}"
|
Icon="{ext:Icon fa-solid fa-trash-can}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenPtcDirectory}"
|
Command="{Binding OpenPtcDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
|
Header="{ext:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-folder}"
|
Icon="{ext:Icon fa-solid fa-folder}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenShaderCacheDirectory}"
|
Command="{Binding OpenShaderCacheDirectory}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Header="{ext:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
|
Header="{ext:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
|
||||||
Icon="{ext:Icon fa-solid fa-folder}"
|
Icon="{ext:Icon fa-solid fa-folder}" />
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" />
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="{ext:Locale GameListContextMenuExtractData}" Icon="{ext:Icon fa-solid fa-file-export}">
|
<MenuItem Header="{ext:Locale GameListContextMenuExtractData}" Icon="{ext:Icon fa-solid fa-file-export}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
@ -71,6 +71,10 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
private string _ldnPassphrase;
|
private string _ldnPassphrase;
|
||||||
[ObservableProperty] private string _ldnServer;
|
[ObservableProperty] private string _ldnServer;
|
||||||
|
|
||||||
|
private bool _enableGDBStub;
|
||||||
|
private ushort _gdbStubPort;
|
||||||
|
private bool _debuggerSuspendOnStart;
|
||||||
|
|
||||||
public SettingsHacksViewModel DirtyHacks { get; }
|
public SettingsHacksViewModel DirtyHacks { get; }
|
||||||
|
|
||||||
private readonly bool _isGameRunning;
|
private readonly bool _isGameRunning;
|
||||||
@ -387,6 +391,36 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public bool IsInvalidLdnPassphraseVisible { get; set; }
|
public bool IsInvalidLdnPassphraseVisible { get; set; }
|
||||||
|
|
||||||
|
public bool EnableGdbStub
|
||||||
|
{
|
||||||
|
get => _enableGDBStub;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_enableGDBStub = value;
|
||||||
|
ConfigurationState.Instance.Debug.EnableGdbStub.Value = _enableGDBStub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ushort GDBStubPort
|
||||||
|
{
|
||||||
|
get => _gdbStubPort;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_gdbStubPort = value;
|
||||||
|
ConfigurationState.Instance.Debug.GdbStubPort.Value = _gdbStubPort;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool DebuggerSuspendOnStart
|
||||||
|
{
|
||||||
|
get => _debuggerSuspendOnStart;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_debuggerSuspendOnStart = value;
|
||||||
|
ConfigurationState.Instance.Debug.DebuggerSuspendOnStart.Value = _debuggerSuspendOnStart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
||||||
{
|
{
|
||||||
_virtualFileSystem = virtualFileSystem;
|
_virtualFileSystem = virtualFileSystem;
|
||||||
@ -680,10 +714,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
FsGlobalAccessLogMode = config.System.FsGlobalAccessLogMode;
|
FsGlobalAccessLogMode = config.System.FsGlobalAccessLogMode;
|
||||||
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
||||||
DisableP2P = config.Multiplayer.DisableP2p;
|
DisableP2P = config.Multiplayer.DisableP2p;
|
||||||
LdnPassphrase = config.Multiplayer.LdnPassphrase;
|
LdnPassphrase = config.Multiplayer.LdnPassphrase;
|
||||||
LdnServer = config.Multiplayer.LdnServer;
|
LdnServer = config.Multiplayer.LdnServer;
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
EnableGdbStub = config.Debug.EnableGdbStub.Value;
|
||||||
|
GDBStubPort = config.Debug.GdbStubPort.Value;
|
||||||
|
DebuggerSuspendOnStart = config.Debug.DebuggerSuspendOnStart.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveSettings(bool global = false)
|
public void SaveSettings(bool global = false)
|
||||||
@ -800,12 +840,18 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode;
|
config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode;
|
||||||
config.Logger.GraphicsDebugLevel.Value = (GraphicsDebugLevel)OpenglDebugLevel;
|
config.Logger.GraphicsDebugLevel.Value = (GraphicsDebugLevel)OpenglDebugLevel;
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
config.Multiplayer.LanInterfaceId.Value = _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]];
|
config.Multiplayer.LanInterfaceId.Value = _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]];
|
||||||
config.Multiplayer.Mode.Value = (MultiplayerMode)MultiplayerModeIndex;
|
config.Multiplayer.Mode.Value = (MultiplayerMode)MultiplayerModeIndex;
|
||||||
config.Multiplayer.DisableP2p.Value = DisableP2P;
|
config.Multiplayer.DisableP2p.Value = DisableP2P;
|
||||||
config.Multiplayer.LdnPassphrase.Value = LdnPassphrase;
|
config.Multiplayer.LdnPassphrase.Value = LdnPassphrase;
|
||||||
config.Multiplayer.LdnServer.Value = LdnServer;
|
config.Multiplayer.LdnServer.Value = LdnServer;
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
config.Debug.EnableGdbStub.Value = EnableGdbStub;
|
||||||
|
config.Debug.GdbStubPort.Value = GDBStubPort;
|
||||||
|
config.Debug.DebuggerSuspendOnStart.Value = DebuggerSuspendOnStart;
|
||||||
|
|
||||||
// Dirty Hacks
|
// Dirty Hacks
|
||||||
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix;
|
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix;
|
||||||
config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value =
|
config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value =
|
||||||
|
@ -32,26 +32,22 @@
|
|||||||
Command="{Binding OpenFile}"
|
Command="{Binding OpenFile}"
|
||||||
Header="{ext:Locale MenuBarFileOpenFromFile}"
|
Header="{ext:Locale MenuBarFileOpenFromFile}"
|
||||||
Icon="{ext:Icon fa-solid fa-file}"
|
Icon="{ext:Icon fa-solid fa-file}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}" />
|
||||||
ToolTip.Tip="{ext:Locale LoadApplicationFileTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenFolder}"
|
Command="{Binding OpenFolder}"
|
||||||
Header="{ext:Locale MenuBarFileOpenUnpacked}"
|
Header="{ext:Locale MenuBarFileOpenUnpacked}"
|
||||||
Icon="{ext:Icon fa-solid fa-folder-open}"
|
Icon="{ext:Icon fa-solid fa-folder-open}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}" />
|
||||||
ToolTip.Tip="{ext:Locale LoadApplicationFolderTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding LoadDlcFromFolder}"
|
Command="{Binding LoadDlcFromFolder}"
|
||||||
Header="{ext:Locale MenuBarFileLoadDlcFromFolder}"
|
Header="{ext:Locale MenuBarFileLoadDlcFromFolder}"
|
||||||
Icon="{ext:Icon fa-solid fa-download}"
|
Icon="{ext:Icon fa-solid fa-download}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}" />
|
||||||
ToolTip.Tip="{ext:Locale LoadDlcFromFolderTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding LoadTitleUpdatesFromFolder}"
|
Command="{Binding LoadTitleUpdatesFromFolder}"
|
||||||
Header="{ext:Locale MenuBarFileLoadTitleUpdatesFromFolder}"
|
Header="{ext:Locale MenuBarFileLoadTitleUpdatesFromFolder}"
|
||||||
Icon="{ext:Icon fa-solid fa-code-compare}"
|
Icon="{ext:Icon fa-solid fa-code-compare}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}" />
|
||||||
ToolTip.Tip="{ext:Locale LoadTitleUpdatesFromFolderTooltip}" />
|
|
||||||
<MenuItem Header="{ext:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}" Icon="{ext:Icon fa-solid fa-microchip}">
|
<MenuItem Header="{ext:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}" Icon="{ext:Icon fa-solid fa-microchip}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="MiiAppletMenuItem"
|
Name="MiiAppletMenuItem"
|
||||||
@ -63,24 +59,20 @@
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenRyujinxFolder}"
|
Command="{Binding OpenRyujinxFolder}"
|
||||||
Header="{ext:Locale MenuBarFileOpenEmuFolder}"
|
Header="{ext:Locale MenuBarFileOpenEmuFolder}"
|
||||||
Icon="{ext:Icon fa-solid fa-folder-closed}"
|
Icon="{ext:Icon fa-solid fa-folder-closed}" />
|
||||||
ToolTip.Tip="{ext:Locale OpenRyujinxFolderTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenScreenshotsFolder}"
|
Command="{Binding OpenScreenshotsFolder}"
|
||||||
Header="{ext:Locale MenuBarFileOpenScreenshotsFolder}"
|
Header="{ext:Locale MenuBarFileOpenScreenshotsFolder}"
|
||||||
Icon="{ext:Icon fa-solid fa-desktop}"
|
Icon="{ext:Icon fa-solid fa-desktop}" />
|
||||||
ToolTip.Tip="{ext:Locale OpenScreenshotFolderTooltip}"/>
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding OpenLogsFolder}"
|
Command="{Binding OpenLogsFolder}"
|
||||||
Header="{ext:Locale MenuBarFileOpenLogsFolder}"
|
Header="{ext:Locale MenuBarFileOpenLogsFolder}"
|
||||||
Icon="{ext:Icon fa-solid fa-file-lines}"
|
Icon="{ext:Icon fa-solid fa-file-lines}" />
|
||||||
ToolTip.Tip="{ext:Locale OpenRyujinxLogsTooltip}" />
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="CloseRyujinxMenuItem"
|
Name="CloseRyujinxMenuItem"
|
||||||
Header="{ext:Locale MenuBarFileExit}"
|
Header="{ext:Locale MenuBarFileExit}"
|
||||||
Icon="{ext:Icon fa-solid fa-power-off}"
|
Icon="{ext:Icon fa-solid fa-power-off}" />
|
||||||
ToolTip.Tip="{ext:Locale ExitTooltip}" />
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarOptions}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarOptions}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -149,7 +141,6 @@
|
|||||||
Padding="0"
|
Padding="0"
|
||||||
Header="{ext:Locale MenuBarOptionsSettings}"
|
Header="{ext:Locale MenuBarOptionsSettings}"
|
||||||
Icon="{ext:Icon fa-solid fa-gear}"
|
Icon="{ext:Icon fa-solid fa-gear}"
|
||||||
ToolTip.Tip="{ext:Locale OpenSettingsTooltip}"
|
|
||||||
Classes="withCheckbox">
|
Classes="withCheckbox">
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -158,7 +149,6 @@
|
|||||||
Header="{ext:Locale MenuBarOptionsManageUserProfiles}"
|
Header="{ext:Locale MenuBarOptionsManageUserProfiles}"
|
||||||
Icon="{ext:Icon fa-solid fa-user}"
|
Icon="{ext:Icon fa-solid fa-user}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
ToolTip.Tip="{ext:Locale OpenProfileManagerTooltip}"
|
|
||||||
Classes="withCheckbox">
|
Classes="withCheckbox">
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
@ -186,8 +176,7 @@
|
|||||||
Header="{ext:Locale MenuBarOptionsStopEmulation}"
|
Header="{ext:Locale MenuBarOptionsStopEmulation}"
|
||||||
Icon="{ext:Icon fa-solid fa-stop}"
|
Icon="{ext:Icon fa-solid fa-stop}"
|
||||||
InputGesture="Escape"
|
InputGesture="Escape"
|
||||||
IsEnabled="{Binding IsGameRunning}"
|
IsEnabled="{Binding IsGameRunning}" />
|
||||||
ToolTip.Tip="{ext:Locale StopEmulationTooltip}" />
|
|
||||||
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}" Icon="{ext:Icon fa-solid fa-sun}" />
|
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}" Icon="{ext:Icon fa-solid fa-sun}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -251,14 +240,12 @@
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
Name="AboutWindowMenuItem"
|
Name="AboutWindowMenuItem"
|
||||||
Header="{ext:Locale MenuBarHelpAbout}"
|
Header="{ext:Locale MenuBarHelpAbout}"
|
||||||
Icon="{ext:Icon fa-solid fa-circle-info}"
|
Icon="{ext:Icon fa-solid fa-circle-info}" />
|
||||||
ToolTip.Tip="{ext:Locale OpenAboutTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="UpdateMenuItem"
|
Name="UpdateMenuItem"
|
||||||
IsEnabled="{Binding CanUpdate}"
|
IsEnabled="{Binding CanUpdate}"
|
||||||
Header="{ext:Locale MenuBarHelpCheckForUpdates}"
|
Header="{ext:Locale MenuBarHelpCheckForUpdates}"
|
||||||
Icon="{ext:Icon fa-solid fa-rotate}"
|
Icon="{ext:Icon fa-solid fa-rotate}" />
|
||||||
ToolTip.Tip="{ext:Locale CheckUpdatesTooltip}" />
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="CompatibilityListMenuItem"
|
Name="CompatibilityListMenuItem"
|
||||||
Header="{ext:Locale CompatibilityListOpen}"
|
Header="{ext:Locale CompatibilityListOpen}"
|
||||||
|
@ -236,7 +236,6 @@
|
|||||||
Minimum="0"
|
Minimum="0"
|
||||||
SmallChange="0.01"
|
SmallChange="0.01"
|
||||||
TickFrequency="0.05"
|
TickFrequency="0.05"
|
||||||
ToolTip.Tip="{ext:Locale AudioVolumeTooltip}"
|
|
||||||
Value="{Binding Volume}" />
|
Value="{Binding Volume}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
|
@ -49,8 +49,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,0"
|
Margin="10,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale IconSize}"
|
Text="{ext:Locale IconSize}" />
|
||||||
ToolTip.Tip="{ext:Locale IconSizeTooltip}" />
|
|
||||||
<controls:SliderScroll
|
<controls:SliderScroll
|
||||||
Width="150"
|
Width="150"
|
||||||
Height="35"
|
Height="35"
|
||||||
@ -61,7 +60,6 @@
|
|||||||
Maximum="4"
|
Maximum="4"
|
||||||
Minimum="1"
|
Minimum="1"
|
||||||
TickFrequency="1"
|
TickFrequency="1"
|
||||||
ToolTip.Tip="{ext:Locale IconSizeTooltip}"
|
|
||||||
Value="{Binding GridSizeScale}" />
|
Value="{Binding GridSizeScale}" />
|
||||||
<CheckBox
|
<CheckBox
|
||||||
Margin="0"
|
Margin="0"
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
Width="250" />
|
Width="250" />
|
||||||
<ComboBox SelectedIndex="{Binding AudioBackend}"
|
<ComboBox SelectedIndex="{Binding AudioBackend}"
|
||||||
Width="350"
|
Width="350"
|
||||||
|
ToolTip.Tip="{ext:Locale AudioBackendTooltip}"
|
||||||
HorizontalContentAlignment="Left">
|
HorizontalContentAlignment="Left">
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{ext:Locale SettingsTabSystemAudioBackendDummy}" />
|
<TextBlock Text="{ext:Locale SettingsTabSystemAudioBackendDummy}" />
|
||||||
@ -51,10 +52,8 @@
|
|||||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemAudioVolume}"
|
Text="{ext:Locale SettingsTabSystemAudioVolume}"
|
||||||
ToolTip.Tip="{ext:Locale AudioVolumeTooltip}"
|
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<ui:NumberBox Value="{Binding Volume}"
|
<ui:NumberBox Value="{Binding Volume}"
|
||||||
ToolTip.Tip="{ext:Locale AudioVolumeTooltip}"
|
|
||||||
Width="350"
|
Width="350"
|
||||||
SmallChange="1"
|
SmallChange="1"
|
||||||
LargeChange="10"
|
LargeChange="10"
|
||||||
@ -66,7 +65,6 @@
|
|||||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||||
<controls:SliderScroll Value="{Binding Volume}"
|
<controls:SliderScroll Value="{Binding Volume}"
|
||||||
Margin="250,0,0,0"
|
Margin="250,0,0,0"
|
||||||
ToolTip.Tip="{ext:Locale AudioVolumeTooltip}"
|
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
SmallChange="1"
|
SmallChange="1"
|
||||||
|
66
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml
Normal file
66
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsDebugView"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||||
|
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
||||||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
x:DataType="viewModels:SettingsViewModel">
|
||||||
|
<Design.DataContext>
|
||||||
|
<viewModels:SettingsViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<ScrollViewer
|
||||||
|
Name="DebugPage"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
|
VerticalScrollBarVisibility="Auto">
|
||||||
|
<Border Classes="settings">
|
||||||
|
<StackPanel
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="10">
|
||||||
|
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabDebugTitle}" />
|
||||||
|
<TextBlock Foreground="{DynamicResource SecondaryTextColor}" Text="{ext:Locale SettingsTabDebugNote}" />
|
||||||
|
<StackPanel
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<CheckBox IsChecked="{Binding EnableGdbStub}">
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabDebugEnableGDBStub}"
|
||||||
|
ToolTip.Tip="{ext:Locale SettingsTabDebugGDBStubToggleTooltip}" />
|
||||||
|
</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabDebugGDBStubPort}"
|
||||||
|
Width="250" />
|
||||||
|
<ui:NumberBox Value="{Binding GDBStubPort}"
|
||||||
|
Width="350"
|
||||||
|
SmallChange="1"
|
||||||
|
LargeChange="10"
|
||||||
|
SimpleNumberFormat="F0"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Minimum="1024"
|
||||||
|
Maximum="65535" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<CheckBox IsChecked="{Binding DebuggerSuspendOnStart}">
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabDebugSuspendOnStart}"
|
||||||
|
ToolTip.Tip="{ext:Locale SettingsTabDebugSuspendOnStartTooltip}" />
|
||||||
|
</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
13
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml.cs
Normal file
13
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
|
{
|
||||||
|
public partial class SettingsDebugView : UserControl
|
||||||
|
{
|
||||||
|
public SettingsDebugView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -285,12 +285,10 @@
|
|||||||
Spacing="10">
|
Spacing="10">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
ToolTip.Tip="{ext:Locale ShaderDumpPathTooltip}"
|
|
||||||
Text="{ext:Locale SettingsTabGraphicsShaderDumpPath}"
|
Text="{ext:Locale SettingsTabGraphicsShaderDumpPath}"
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<TextBox Text="{Binding ShaderDumpPath}"
|
<TextBox Text="{Binding ShaderDumpPath}"
|
||||||
Width="350"
|
Width="350" />
|
||||||
ToolTip.Tip="{ext:Locale ShaderDumpPathTooltip}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
Width="250" />
|
Width="250" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
SelectedIndex="{Binding Region}"
|
SelectedIndex="{Binding Region}"
|
||||||
ToolTip.Tip="{ext:Locale RegionTooltip}"
|
|
||||||
HorizontalContentAlignment="Left"
|
HorizontalContentAlignment="Left"
|
||||||
Width="350">
|
Width="350">
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
@ -72,11 +71,9 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemSystemLanguage}"
|
Text="{ext:Locale SettingsTabSystemSystemLanguage}"
|
||||||
ToolTip.Tip="{ext:Locale LanguageTooltip}"
|
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
SelectedIndex="{Binding Language}"
|
SelectedIndex="{Binding Language}"
|
||||||
ToolTip.Tip="{ext:Locale LanguageTooltip}"
|
|
||||||
HorizontalContentAlignment="Left"
|
HorizontalContentAlignment="Left"
|
||||||
Width="350">
|
Width="350">
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
@ -141,7 +138,6 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemSystemTimeZone}"
|
Text="{ext:Locale SettingsTabSystemSystemTimeZone}"
|
||||||
ToolTip.Tip="{ext:Locale TimezoneTooltip}"
|
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Name="TimeZoneBox"
|
Name="TimeZoneBox"
|
||||||
@ -152,7 +148,6 @@
|
|||||||
SelectionChanged="TimeZoneBox_OnSelectionChanged"
|
SelectionChanged="TimeZoneBox_OnSelectionChanged"
|
||||||
Text="{Binding Path=TimeZone, Mode=OneWay}"
|
Text="{Binding Path=TimeZone, Mode=OneWay}"
|
||||||
TextChanged="TimeZoneBox_OnTextChanged"
|
TextChanged="TimeZoneBox_OnTextChanged"
|
||||||
ToolTip.Tip="{ext:Locale TimezoneTooltip}"
|
|
||||||
ValueMemberBinding="{Binding Mode=OneWay, Converter={x:Static helpers:TimeZoneConverter.Instance}}" />
|
ValueMemberBinding="{Binding Mode=OneWay, Converter={x:Static helpers:TimeZoneConverter.Instance}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
@ -163,13 +158,11 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemSystemTime}"
|
Text="{ext:Locale SettingsTabSystemSystemTime}"
|
||||||
ToolTip.Tip="{ext:Locale TimeTooltip}"
|
|
||||||
Width="250"/>
|
Width="250"/>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
IsEnabled="{Binding !MatchSystemTime}"
|
IsEnabled="{Binding !MatchSystemTime}"
|
||||||
SelectedDate="{Binding CurrentDate}"
|
SelectedDate="{Binding CurrentDate}"
|
||||||
ToolTip.Tip="{ext:Locale TimeTooltip}"
|
|
||||||
Width="350" />
|
Width="350" />
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@ -183,8 +176,7 @@
|
|||||||
ClockIdentifier="24HourClock"
|
ClockIdentifier="24HourClock"
|
||||||
IsEnabled="{Binding !MatchSystemTime}"
|
IsEnabled="{Binding !MatchSystemTime}"
|
||||||
SelectedTime="{Binding CurrentTime}"
|
SelectedTime="{Binding CurrentTime}"
|
||||||
Width="350"
|
Width="350" />
|
||||||
ToolTip.Tip="{ext:Locale TimeTooltip}" />
|
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
@ -289,6 +281,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemDramSize}"
|
Text="{ext:Locale SettingsTabSystemDramSize}"
|
||||||
|
ToolTip.Tip="{ext:Locale DRamTooltip}"
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
SelectedIndex="{Binding DramSize}"
|
SelectedIndex="{Binding DramSize}"
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
<settings:SettingsAudioView Name="AudioPage" />
|
<settings:SettingsAudioView Name="AudioPage" />
|
||||||
<settings:SettingsNetworkView Name="NetworkPage" />
|
<settings:SettingsNetworkView Name="NetworkPage" />
|
||||||
<settings:SettingsLoggingView Name="LoggingPage" />
|
<settings:SettingsLoggingView Name="LoggingPage" />
|
||||||
|
<settings:SettingsDebugView Name="DebugPage" />
|
||||||
<settings:SettingsHacksView Name="HacksPage" />
|
<settings:SettingsHacksView Name="HacksPage" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<ui:NavigationView
|
<ui:NavigationView
|
||||||
@ -100,6 +101,10 @@
|
|||||||
Content="{ext:Locale SettingsTabLogging}"
|
Content="{ext:Locale SettingsTabLogging}"
|
||||||
Tag="LoggingPage"
|
Tag="LoggingPage"
|
||||||
IconSource="Document" />
|
IconSource="Document" />
|
||||||
|
<ui:NavigationViewItem
|
||||||
|
Content="{ext:Locale SettingsTabDebug}"
|
||||||
|
Tag="DebugPage"
|
||||||
|
IconSource="Star" />
|
||||||
<ui:NavigationViewItem
|
<ui:NavigationViewItem
|
||||||
IsVisible="{Binding ShowDirtyHacks}"
|
IsVisible="{Binding ShowDirtyHacks}"
|
||||||
Content="Dirty Hacks"
|
Content="Dirty Hacks"
|
||||||
|
@ -98,6 +98,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
case "LoggingPage":
|
case "LoggingPage":
|
||||||
NavPanel.Content = LoggingPage;
|
NavPanel.Content = LoggingPage;
|
||||||
break;
|
break;
|
||||||
|
case "DebugPage":
|
||||||
|
NavPanel.Content = DebugPage;
|
||||||
|
break;
|
||||||
case nameof(HacksPage):
|
case nameof(HacksPage):
|
||||||
HacksPage.DataContext = ViewModel;
|
HacksPage.DataContext = ViewModel;
|
||||||
NavPanel.Content = HacksPage;
|
NavPanel.Content = HacksPage;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user