mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-07-15 11:44:28 +02:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a80b3144bb | |||
| 9f0206966b | |||
| dcae14398a | |||
| 14164e6592 | |||
| 873977d0b8 | |||
| 78319ef0ba | |||
| d1beb6be9a | |||
| 5df1662c1b | |||
| 45b8338f6d | |||
| 92914cee40 | |||
| 44079ebbe2 | |||
| 8d2d9ebb1d | |||
| 4f62bff866 | |||
| 8510ec29ba | |||
| cde272055f | |||
| 5e3ad282a8 | |||
| 091b3a8694 | |||
| 42ce97aca5 | |||
| a4df5c300e | |||
| 4bf51e735a | |||
| d7e7c8164c | |||
| eb5e3fcd13 | |||
| 8f8968cbb1 | |||
| ac83e93426 | |||
| 78d0cf4a4f | |||
| 2444c6090b | |||
| 7e49bc5a50 | |||
| 457719d0cc | |||
| c3e63d5a0e | |||
| 8c1b3f8ce3 | |||
| 55b37b794c | |||
| 1aca396e34 | |||
| cb000a5101 | |||
| 1ae2a96747 | |||
| 6834086c37 | |||
| b33b493c6e | |||
| 437fe1e442 |
@@ -6,6 +6,9 @@ updates:
|
||||
schedule:
|
||||
# Check for updates to GitHub Actions every week
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
# Prefix all commit messages with "Deps/gha: "
|
||||
prefix: "Deps/gha"
|
||||
groups:
|
||||
ci-deps:
|
||||
patterns:
|
||||
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.arch }} deps ${{ hashFiles('.github/workflows/scripts/macos/*', '.github/workflows/scripts/common/*.patch') }}
|
||||
@@ -120,7 +120,7 @@ jobs:
|
||||
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache ccache cache
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ${{ inputs.arch }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
|
||||
- name: Sign the Application
|
||||
if: ${{ inputs.sign_and_notarize == true && env.SIGN_KEY }}
|
||||
uses: indygreg/apple-code-sign-action@44d0985b7f4363198e80b6fea63ac3e9dd3e9957
|
||||
uses: indygreg/apple-code-sign-action@5e7a4a01fe4dffe948ef3bcf1f4538d963cb0c72
|
||||
with:
|
||||
input_path: 'PCSX2.app'
|
||||
p12_file: cert.p12
|
||||
|
||||
@@ -23,7 +23,7 @@ QTAPNG=1.3.0
|
||||
|
||||
FFMPEG=8.1
|
||||
LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
|
||||
LIBJPEGTURBO=3.1.4.1
|
||||
LIBJPEGTURBO=3.2.0
|
||||
LIBPNG=1.6.58
|
||||
LIBWEBP=1.6.0
|
||||
NVENC=13.0.19.0
|
||||
@@ -57,7 +57,7 @@ f1d3be3489f758efe1a8f12118a212febbe611aa670af32e0159fa3c1feab2a6 QtApng-$QTAPNG
|
||||
|
||||
b072aed6871998cce9b36e7774033105ca29e33632be5b6347f3206898e0756a ffmpeg-$FFMPEG.tar.xz
|
||||
96e5c2d7f2c482a60d5804da48a2eb9a0db0719b2c65dcc169fbfdcf37f3a45d libbacktrace-$LIBBACKTRACE.tar.gz
|
||||
ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022 libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
28eb403f51f0f7405249132cecfe82ea5c0ef97f1b32c5a65828814ae0d34775 libpng-$LIBPNG.tar.xz
|
||||
e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 libwebp-$LIBWEBP.tar.gz
|
||||
f07b958a9ac5020fb7a44cadb957f658b2149c3c8abb4f63145fac9303249db7 $SDL.tar.gz
|
||||
|
||||
@@ -3,7 +3,7 @@ Version=1.0
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Name=PCSX2
|
||||
StartupWMClass=PCSX2
|
||||
StartupWMClass=pcsx2-qt
|
||||
GenericName=PlayStation 2 Emulator
|
||||
Comment=Sony PlayStation 2 emulator
|
||||
Exec=pcsx2-qt
|
||||
|
||||
@@ -52,7 +52,7 @@ HARFBUZZ=14.2.0
|
||||
ZSTD=1.5.7
|
||||
LZ4=1.10.0
|
||||
LIBPNG=1.6.58
|
||||
LIBJPEGTURBO=3.1.4.1
|
||||
LIBJPEGTURBO=3.2.0
|
||||
LIBWEBP=1.6.0
|
||||
FFMPEG=8.1
|
||||
MOLTENVK=1.4.1
|
||||
@@ -100,7 +100,7 @@ eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar
|
||||
28eb403f51f0f7405249132cecfe82ea5c0ef97f1b32c5a65828814ae0d34775 libpng-$LIBPNG.tar.xz
|
||||
e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 libwebp-$LIBWEBP.tar.gz
|
||||
eee7dea22ed502868017971c86c63c4ed1e6085de0baebfdcc3d3322f00f3eb0 libpng-$LIBPNG-apng.patch.gz
|
||||
ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022 libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
b072aed6871998cce9b36e7774033105ca29e33632be5b6347f3206898e0756a ffmpeg-$FFMPEG.tar.xz
|
||||
9985f141902a17de818e264d17c1ce334b748e499ee02fcb4703e4dc0038f89c MoltenVK-$MOLTENVK.tar.gz
|
||||
51dbf24fe72e43dd7cb9a289d3cab47112010f1a2ed69b6fc8ac0dff31991ed2 KDDockWidgets-$KDDOCKWIDGETS.tar.gz
|
||||
|
||||
@@ -29,7 +29,7 @@ HARFBUZZ=14.2.0
|
||||
ZSTD=1.5.7
|
||||
LZ4=1.10.0
|
||||
LIBPNG=1.6.58
|
||||
LIBJPEGTURBO=3.1.4.1
|
||||
LIBJPEGTURBO=3.2.0
|
||||
LIBWEBP=1.6.0
|
||||
FFMPEG=8.1
|
||||
MOLTENVK=1.4.1
|
||||
@@ -76,7 +76,7 @@ eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar
|
||||
28eb403f51f0f7405249132cecfe82ea5c0ef97f1b32c5a65828814ae0d34775 libpng-$LIBPNG.tar.xz
|
||||
e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 libwebp-$LIBWEBP.tar.gz
|
||||
eee7dea22ed502868017971c86c63c4ed1e6085de0baebfdcc3d3322f00f3eb0 libpng-$LIBPNG-apng.patch.gz
|
||||
ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022 libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e libjpeg-turbo-$LIBJPEGTURBO.tar.gz
|
||||
b072aed6871998cce9b36e7774033105ca29e33632be5b6347f3206898e0756a ffmpeg-$FFMPEG.tar.xz
|
||||
9985f141902a17de818e264d17c1ce334b748e499ee02fcb4703e4dc0038f89c v$MOLTENVK.tar.gz
|
||||
51dbf24fe72e43dd7cb9a289d3cab47112010f1a2ed69b6fc8ac0dff31991ed2 KDDockWidgets-$KDDOCKWIDGETS.tar.gz
|
||||
|
||||
Regular → Executable
+2
-2
@@ -61,7 +61,7 @@ set QTAPNG=1.3.0
|
||||
set FREETYPE=2.14.3
|
||||
set HARFBUZZ=14.2.0
|
||||
set SDL=SDL3-3.4.12
|
||||
set LIBJPEGTURBO=3.1.4.1
|
||||
set LIBJPEGTURBO=3.2.0
|
||||
set LIBPNG=1658
|
||||
set LIBPNGLONG=1.6.58
|
||||
set LZ4=1.10.0
|
||||
@@ -92,7 +92,7 @@ call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip bb2f83255706b1c92d731541c7cefaf98bb5b93e8f76d16f6deda05225ff20ee || goto error
|
||||
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1658.zip b32f170855dbbe3e6d9e645af40b538137041773672c3ba3e02db5816c82d376 || goto error
|
||||
call :downloadfile "lpng%LIBPNG%-apng.patch.gz" https://download.sourceforge.net/libpng-apng/libpng-%LIBPNGLONG%-apng.patch.gz eee7dea22ed502868017971c86c63c4ed1e6085de0baebfdcc3d3322f00f3eb0 || goto error
|
||||
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022 || goto error
|
||||
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" 6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 3d4de8967a49c0451e775a0c1e9022092c19fdef41ba38a83fcf031c5a6496e2 || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/refs/tags/v%LZ4%.zip" 3224b4c80f351f194984526ef396f6079bd6332dd9825c72ac0d7a37b3cdc565 || goto error
|
||||
|
||||
Regular → Executable
+2
-3
@@ -78,7 +78,7 @@ set LIBX264=b35605ace3ddf7c1a5d67a2eb553f034aef41d55
|
||||
set FREETYPE=2.14.3
|
||||
set HARFBUZZ=14.2.0
|
||||
set SDL=SDL3-3.4.12
|
||||
set LIBJPEGTURBO=3.1.4.1
|
||||
set LIBJPEGTURBO=3.2.0
|
||||
set LIBPNG=1658
|
||||
set LIBPNGLONG=1.6.58
|
||||
set LZ4=1.10.0
|
||||
@@ -120,7 +120,7 @@ call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip bb2f83255706b1c92d731541c7cefaf98bb5b93e8f76d16f6deda05225ff20ee || goto error
|
||||
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1658.zip b32f170855dbbe3e6d9e645af40b538137041773672c3ba3e02db5816c82d376 || goto error
|
||||
call :downloadfile "lpng%LIBPNG%-apng.patch.gz" https://download.sourceforge.net/libpng-apng/libpng-%LIBPNGLONG%-apng.patch.gz eee7dea22ed502868017971c86c63c4ed1e6085de0baebfdcc3d3322f00f3eb0 || goto error
|
||||
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022 || goto error
|
||||
call :downloadfile "libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO%/libjpeg-turbo-%LIBJPEGTURBO%.tar.gz" 6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 3d4de8967a49c0451e775a0c1e9022092c19fdef41ba38a83fcf031c5a6496e2 || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/refs/tags/v%LZ4%.zip" 3224b4c80f351f194984526ef396f6079bd6332dd9825c72ac0d7a37b3cdc565 || goto error
|
||||
@@ -471,7 +471,6 @@ echo "Building PlutoVG..."
|
||||
rmdir /S /Q "plutovg-%PLUTOVG%"
|
||||
%SEVENZIP% x "plutovg-%PLUTOVG%.zip" || goto error
|
||||
cd "plutovg-%PLUTOVG%" || goto error
|
||||
%PATCH% -p1 < "%SCRIPTDIR%\plutovg-workaround-msvc-ice.patch" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DPLUTOVG_BUILD_EXAMPLES=OFF -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
diff --git a/source/plutovg-font.c b/source/plutovg-font.c
|
||||
index 0ad89b1..110de7f 100644
|
||||
--- a/source/plutovg-font.c
|
||||
+++ b/source/plutovg-font.c
|
||||
@@ -836,7 +836,8 @@ int plutovg_font_face_cache_load_file(plutovg_font_face_cache_t* cache, const ch
|
||||
size_t family_index = 0;
|
||||
if(unicode_family_name) {
|
||||
const stbtt_uint8* family_name = unicode_family_name;
|
||||
- while(family_length) {
|
||||
+ //while(family_length) {
|
||||
+ for (int i = family_length; i > 0; i -= 2) {
|
||||
stbtt_uint16 ch = family_name[0] * 256 + family_name[1];
|
||||
if(ch < 0x80) {
|
||||
entry->family[family_index++] = ch;
|
||||
@@ -853,7 +854,8 @@ int plutovg_font_face_cache_load_file(plutovg_font_face_cache_t* cache, const ch
|
||||
entry->family[family_index++] = (0x80 + ((c) & 0x3f));
|
||||
|
||||
family_name += 2;
|
||||
- family_length -= 2;
|
||||
+ //family_length -= 2;
|
||||
+ i -= 2;
|
||||
} else {
|
||||
entry->family[family_index++] = (0xe0 + (ch >> 12));
|
||||
entry->family[family_index++] = (0x80 + ((ch >> 6) & 0x3f));
|
||||
@@ -861,7 +863,7 @@ int plutovg_font_face_cache_load_file(plutovg_font_face_cache_t* cache, const ch
|
||||
}
|
||||
|
||||
family_name += 2;
|
||||
- family_length -= 2;
|
||||
+ //family_length -= 2;
|
||||
}
|
||||
|
||||
entry->family[family_index] = '\0';
|
||||
@@ -902,7 +904,8 @@ int plutovg_font_face_cache_load_file(plutovg_font_face_cache_t* cache, const ch
|
||||
};
|
||||
|
||||
const stbtt_uint8* family_name = roman_family_name;
|
||||
- while(family_length) {
|
||||
+ //while(family_length) {
|
||||
+ for (int i2 = family_length; i2 > 0; i2--) {
|
||||
stbtt_uint16 ch = MAC_ROMAN_TABLE[family_name[0]];
|
||||
if(ch < 0x80) {
|
||||
entry->family[family_index++] = ch;
|
||||
@@ -916,7 +919,7 @@ int plutovg_font_face_cache_load_file(plutovg_font_face_cache_t* cache, const ch
|
||||
}
|
||||
|
||||
family_name += 1;
|
||||
- family_length -= 1;
|
||||
+ //family_length -= 1;
|
||||
}
|
||||
|
||||
entry->family[family_index] = '\0';
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
@@ -63,6 +63,9 @@ oprofile_data/
|
||||
*.kdev4
|
||||
/.kdev4*
|
||||
|
||||
# Kate Projects
|
||||
.kateproject*
|
||||
|
||||
# Resources and docs in /bin are tracked
|
||||
/bin/**/*.dll
|
||||
/bin/**/*.dmp
|
||||
|
||||
Vendored
+2
@@ -361,6 +361,8 @@ enum cpuinfo_uarch {
|
||||
cpuinfo_uarch_raptor_cove = 0x0010020F,
|
||||
/** Intel Redwood Cove microarchitecture (Granite Rapids). */
|
||||
cpuinfo_uarch_redwood_cove = 0x00100210,
|
||||
/** Intel Coyote Cove microarchitecture. */
|
||||
cpuinfo_uarch_coyote_cove = 0x00100211,
|
||||
|
||||
/** Pentium 4 with Willamette, Northwood, or Foster cores. */
|
||||
cpuinfo_uarch_willamette = 0x00100300,
|
||||
|
||||
Vendored
+3
@@ -1,3 +1,6 @@
|
||||
/* for syscall() */
|
||||
#define _DEFAULT_SOURCE
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
Vendored
+2
@@ -36,6 +36,7 @@ enum cpuinfo_arm_chipset_vendor {
|
||||
cpuinfo_arm_chipset_vendor_texas_instruments,
|
||||
cpuinfo_arm_chipset_vendor_unisoc,
|
||||
cpuinfo_arm_chipset_vendor_wondermedia,
|
||||
cpuinfo_arm_chipset_vendor_google,
|
||||
cpuinfo_arm_chipset_vendor_max,
|
||||
};
|
||||
|
||||
@@ -73,6 +74,7 @@ enum cpuinfo_arm_chipset_series {
|
||||
cpuinfo_arm_chipset_series_unisoc_t,
|
||||
cpuinfo_arm_chipset_series_unisoc_ums,
|
||||
cpuinfo_arm_chipset_series_wondermedia_wm,
|
||||
cpuinfo_arm_chipset_series_google_tensor,
|
||||
cpuinfo_arm_chipset_series_max,
|
||||
};
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -366,7 +366,7 @@ CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_f
|
||||
CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_hardware_chipname(
|
||||
const char ro_hardware_chipname[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
|
||||
CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_soc_model(
|
||||
const char ro_soc_model[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
|
||||
const char soc_model[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
|
||||
#else
|
||||
CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_revision(
|
||||
const char proc_cpuinfo_revision[restrict static CPUINFO_REVISION_VALUE_MAX]);
|
||||
|
||||
+61
-10
@@ -3492,9 +3492,20 @@ struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_chipname(
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Decodes chipset name from ro.soc.model Android system property.
|
||||
*
|
||||
* @param[in] soc_model - ro.soc.model value.
|
||||
*
|
||||
* @returns Decoded chipset name. If chipset could not be decoded, the resulting
|
||||
* structure would use `unknown` vendor and series identifiers.
|
||||
*/
|
||||
struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_soc_model(
|
||||
const char soc_model[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]) {
|
||||
struct cpuinfo_arm_chipset chipset;
|
||||
struct cpuinfo_arm_chipset chipset = {
|
||||
.vendor = cpuinfo_arm_chipset_vendor_unknown,
|
||||
.series = cpuinfo_arm_chipset_series_unknown,
|
||||
};
|
||||
const size_t soc_model_length = strnlen(soc_model, CPUINFO_BUILD_PROP_VALUE_MAX);
|
||||
const char* soc_model_end = soc_model + soc_model_length;
|
||||
|
||||
@@ -3516,10 +3527,28 @@ struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_soc_model(
|
||||
return chipset;
|
||||
}
|
||||
|
||||
return (struct cpuinfo_arm_chipset){
|
||||
.vendor = cpuinfo_arm_chipset_vendor_unknown,
|
||||
.series = cpuinfo_arm_chipset_series_unknown,
|
||||
};
|
||||
if (soc_model[0] != '\0') {
|
||||
if (strncmp(soc_model, "Tensor", 6) == 0) {
|
||||
chipset.vendor = cpuinfo_arm_chipset_vendor_google;
|
||||
chipset.series = cpuinfo_arm_chipset_series_google_tensor;
|
||||
const char* suffix_start = soc_model + 6;
|
||||
while (*suffix_start == ' ') {
|
||||
suffix_start++;
|
||||
}
|
||||
const size_t suffix_length = strnlen(suffix_start, CPUINFO_ARM_CHIPSET_SUFFIX_MAX);
|
||||
if (suffix_length > 0) {
|
||||
strncpy(chipset.suffix, suffix_start, suffix_length);
|
||||
}
|
||||
return chipset;
|
||||
} else if (strncmp(soc_model, "GS201", 5) == 0) {
|
||||
chipset.vendor = cpuinfo_arm_chipset_vendor_google;
|
||||
chipset.series = cpuinfo_arm_chipset_series_google_tensor;
|
||||
strncpy(chipset.suffix, "G2", 2);
|
||||
return chipset;
|
||||
}
|
||||
}
|
||||
|
||||
return chipset;
|
||||
}
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
@@ -3858,6 +3887,7 @@ static const char* chipset_vendor_string[cpuinfo_arm_chipset_vendor_max] = {
|
||||
[cpuinfo_arm_chipset_vendor_texas_instruments] = "Texas Instruments",
|
||||
[cpuinfo_arm_chipset_vendor_unisoc] = "Unisoc",
|
||||
[cpuinfo_arm_chipset_vendor_wondermedia] = "WonderMedia",
|
||||
[cpuinfo_arm_chipset_vendor_google] = "Google",
|
||||
};
|
||||
|
||||
/* Map from ARM chipset series ID to its string representation */
|
||||
@@ -3895,6 +3925,7 @@ static const char* chipset_series_string[cpuinfo_arm_chipset_series_max] = {
|
||||
[cpuinfo_arm_chipset_series_unisoc_t] = "T",
|
||||
[cpuinfo_arm_chipset_series_unisoc_ums] = "UMS",
|
||||
[cpuinfo_arm_chipset_series_wondermedia_wm] = "WM",
|
||||
[cpuinfo_arm_chipset_series_google_tensor] = "Tensor",
|
||||
};
|
||||
|
||||
/* Convert chipset name represented by cpuinfo_arm_chipset structure to a string
|
||||
@@ -3913,14 +3944,35 @@ void cpuinfo_arm_chipset_to_string(
|
||||
const char* vendor_string = chipset_vendor_string[vendor];
|
||||
const char* series_string = chipset_series_string[series];
|
||||
const uint32_t model = chipset->model;
|
||||
const size_t suffix_length = strnlen(chipset->suffix, CPUINFO_ARM_CHIPSET_SUFFIX_MAX);
|
||||
if (model == 0) {
|
||||
if (series == cpuinfo_arm_chipset_series_unknown) {
|
||||
strncpy(name, vendor_string, CPUINFO_ARM_CHIPSET_NAME_MAX);
|
||||
if (suffix_length > 0) {
|
||||
if (series == cpuinfo_arm_chipset_series_unknown) {
|
||||
snprintf(
|
||||
name,
|
||||
CPUINFO_ARM_CHIPSET_NAME_MAX,
|
||||
"%s %.*s",
|
||||
vendor_string,
|
||||
(int)suffix_length,
|
||||
chipset->suffix);
|
||||
} else {
|
||||
snprintf(
|
||||
name,
|
||||
CPUINFO_ARM_CHIPSET_NAME_MAX,
|
||||
"%s %s %.*s",
|
||||
vendor_string,
|
||||
series_string,
|
||||
(int)suffix_length,
|
||||
chipset->suffix);
|
||||
}
|
||||
} else {
|
||||
snprintf(name, CPUINFO_ARM_CHIPSET_NAME_MAX, "%s %s", vendor_string, series_string);
|
||||
if (series == cpuinfo_arm_chipset_series_unknown) {
|
||||
strncpy(name, vendor_string, CPUINFO_ARM_CHIPSET_NAME_MAX);
|
||||
} else {
|
||||
snprintf(name, CPUINFO_ARM_CHIPSET_NAME_MAX, "%s %s", vendor_string, series_string);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const size_t suffix_length = strnlen(chipset->suffix, CPUINFO_ARM_CHIPSET_SUFFIX_MAX);
|
||||
snprintf(
|
||||
name,
|
||||
CPUINFO_ARM_CHIPSET_NAME_MAX,
|
||||
@@ -4051,7 +4103,6 @@ static enum cpuinfo_arm_chipset_vendor disambiguate_chipset_vendor(
|
||||
(vendor_a == cpuinfo_arm_chipset_vendor_spreadtrum && vendor_b == cpuinfo_arm_chipset_vendor_unisoc)) {
|
||||
return cpuinfo_arm_chipset_vendor_unisoc;
|
||||
}
|
||||
|
||||
return cpuinfo_arm_chipset_vendor_unknown;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -256,12 +256,12 @@ void cpuinfo_arm_linux_init(void) {
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
struct cpuinfo_android_properties android_properties;
|
||||
struct cpuinfo_android_properties android_properties = {0};
|
||||
cpuinfo_arm_android_parse_properties(&android_properties);
|
||||
#else
|
||||
char proc_cpuinfo_hardware[CPUINFO_HARDWARE_VALUE_MAX];
|
||||
char proc_cpuinfo_hardware[CPUINFO_HARDWARE_VALUE_MAX] = {0};
|
||||
#endif
|
||||
char proc_cpuinfo_revision[CPUINFO_REVISION_VALUE_MAX];
|
||||
char proc_cpuinfo_revision[CPUINFO_REVISION_VALUE_MAX] = {0};
|
||||
|
||||
if (!cpuinfo_arm_linux_parse_proc_cpuinfo(
|
||||
#if defined(__ANDROID__)
|
||||
|
||||
Vendored
+49
@@ -11,6 +11,11 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
#endif /* CPUINFO_ARCH_ARM */
|
||||
enum cpuinfo_vendor vendor[RESTRICT_STATIC 1],
|
||||
enum cpuinfo_uarch uarch[RESTRICT_STATIC 1]) {
|
||||
/* Ensure the out-parameters are always initialized, including for
|
||||
* implementers that are not handled in the switch below. */
|
||||
*vendor = cpuinfo_vendor_unknown;
|
||||
*uarch = cpuinfo_uarch_unknown;
|
||||
|
||||
switch (midr_get_implementer(midr)) {
|
||||
case 'A':
|
||||
*vendor = cpuinfo_vendor_arm;
|
||||
@@ -438,6 +443,50 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
case 'a':
|
||||
*vendor = cpuinfo_vendor_apple;
|
||||
switch (midr_get_part(midr)) {
|
||||
case 0x022:
|
||||
case 0x024:
|
||||
case 0x028:
|
||||
*uarch = cpuinfo_uarch_icestorm;
|
||||
break;
|
||||
case 0x023:
|
||||
case 0x025:
|
||||
case 0x029:
|
||||
*uarch = cpuinfo_uarch_firestorm;
|
||||
break;
|
||||
case 0x032:
|
||||
case 0x034:
|
||||
case 0x038:
|
||||
*uarch = cpuinfo_uarch_blizzard;
|
||||
break;
|
||||
case 0x033:
|
||||
case 0x035:
|
||||
case 0x039:
|
||||
*uarch = cpuinfo_uarch_avalanche;
|
||||
break;
|
||||
case 0x042:
|
||||
case 0x044:
|
||||
case 0x048:
|
||||
*uarch = cpuinfo_uarch_coll_sawtooth;
|
||||
break;
|
||||
case 0x043:
|
||||
case 0x045:
|
||||
case 0x049:
|
||||
*uarch = cpuinfo_uarch_coll_everest;
|
||||
break;
|
||||
case 0x052:
|
||||
*uarch = cpuinfo_uarch_donan_sawtooth;
|
||||
break;
|
||||
case 0x053:
|
||||
*uarch = cpuinfo_uarch_donan_everest;
|
||||
break;
|
||||
default:
|
||||
cpuinfo_log_warning(
|
||||
"unknown Apple CPU part 0x%03" PRIx32 " ignored", midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM
|
||||
case 'V':
|
||||
*vendor = cpuinfo_vendor_marvell;
|
||||
|
||||
Vendored
+9
@@ -307,6 +307,15 @@ static bool transform_token(char* token_start, char* token_end, struct parser_st
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
/*
|
||||
* Erase everything starting with "with" on AMD
|
||||
* processors, e.g. "AMD Ryzen 5 PRO 6650U with Radeon
|
||||
* Graphics"
|
||||
*/
|
||||
if (erase_matching(token_start, token_length, "with")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Remember to erase "Dual Core" in "AMD Athlon(tm) 64
|
||||
* X2 Dual Core Processor 3800+" */
|
||||
if (memcmp(token_start, "Dual", token_length) == 0) {
|
||||
|
||||
Vendored
+7
@@ -270,8 +270,15 @@ enum cpuinfo_uarch cpuinfo_x86_decode_uarch(
|
||||
return cpuinfo_uarch_prescott;
|
||||
}
|
||||
break;
|
||||
case 0x12:
|
||||
switch (model_info->model) {
|
||||
case 0x01: // Nova Lake P-core (Coyote Cove)
|
||||
return cpuinfo_uarch_coyote_cove;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case cpuinfo_vendor_amd:
|
||||
switch (model_info->family) {
|
||||
#if CPUINFO_ARCH_X86
|
||||
|
||||
-2
@@ -265,8 +265,6 @@ BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PV
|
||||
* APIC order */
|
||||
const uint32_t core_id = cores_count++;
|
||||
uint32_t smt_id = 0;
|
||||
/* Reconstruct core part of APIC ID */
|
||||
const uint32_t core_apic_id = (core_id & core_bits_mask) << x86_processor.topology.core_bits_offset;
|
||||
/* Iterate processor groups and set the core & SMT parts of APIC
|
||||
* ID */
|
||||
for (uint32_t i = 0; i < core_info->Processor.GroupCount; i++) {
|
||||
|
||||
Vendored
+4
-3
@@ -1,12 +1,13 @@
|
||||
Copyright 2015-2023 The Khronos Group Inc.
|
||||
Copyright 2015-2026 The Khronos Group Inc.
|
||||
|
||||
Files in this repository fall under one of these licenses:
|
||||
|
||||
- `Apache-2.0`
|
||||
- `MIT`
|
||||
|
||||
Note: With the exception of `parse_dependency.py` the files using `MIT` license
|
||||
also fall under `Apache-2.0`. Example:
|
||||
Note: With the exception of `parse_dependency.py`, which is based on an
|
||||
external file, files using the `MIT` license also fall under `Apache-2.0`.
|
||||
Example:
|
||||
|
||||
```
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
* Copyright 2015-2023 The Khronos Group Inc.
|
||||
* Copyright 2015-2023 Valve Corporation
|
||||
* Copyright 2015-2023 LunarG, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
* Copyright 2015-2023 The Khronos Group Inc.
|
||||
* Copyright 2015-2023 Valve Corporation
|
||||
* Copyright 2015-2023 LunarG, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
//
|
||||
/*
|
||||
** Copyright 2014-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@
|
||||
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
#include "vk_platform.h"
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+994
-43
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
** Copyright 2015-2026 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
** SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+104
-370
@@ -200,7 +200,7 @@ PAPX-90203:
|
||||
name-sort: "ぐらんつーりすも 2000 [たいけんばん]"
|
||||
name-en: "Gran Turismo 2000 [Trial]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
gsHWFixes: &gran-turismo-3-gs-fixes
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Fixes missing lens flare and intensity.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
@@ -226,28 +226,19 @@ PAPX-90207:
|
||||
name-sort: "ぐらんつーりすも 3 A-Spec おーとばっくすげんていりぷれいしあたー"
|
||||
name-en: "Gran Turismo 3 - A-Spec - Autobacs Gentei Replay Theater"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90208:
|
||||
name: "GRAN TURISMO 3 - A-Spec - リプレイシアター"
|
||||
name-sort: "ぐらんつーりすも 3 A-Spec りぷれいしあたー"
|
||||
name-en: "Gran Turismo 3 - A-Spec - Replay Theater"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90209:
|
||||
name: "GRAN TURISMO 3 - A-Spec - Netz TOYOTA - リプレイシアターディスク"
|
||||
name-sort: "ぐらんつーりすも 3 A-Spec ねっつとよたりぷれいしあたーでぃすく"
|
||||
name-en: "Gran Turismo 3 - A-Spec - Netz TOYOTA - Replay Theater Disc"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90210:
|
||||
name: "やっぱ RPGでしょ。 [オリジナルムービーディスク]"
|
||||
name-sort: "やっぱ あーるぴーじーでしょ [おりじなるむーびーでぃすく]"
|
||||
@@ -421,10 +412,7 @@ PAPX-90504:
|
||||
name-sort: "ぐらんつーりすも こんせぷと えあとれっく たーぼ すぺしゃるえでぃしょん [たいけんばん]"
|
||||
name-en: "Gran Turismo Concept - Airtrek Turbo Special Edition [Trial]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90505:
|
||||
name: "2002 夏のオススメソフト おためしDisc"
|
||||
name-sort: "2002 なつのおすすめそふと おためしでぃすく"
|
||||
@@ -454,19 +442,13 @@ PAPX-90508:
|
||||
name-sort: "ぐらんつーりすも こんせぷと るぽ かっぷ とれいにんぐ ばーじょん"
|
||||
name-en: "Gran Turismo Concept - LUPO CUP Training Version"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90509:
|
||||
name: "GRAN TURISMO Concept - LUPO CUP Training Version 2"
|
||||
name-sort: "ぐらんつーりすも こんせぷと るぽ かっぷ とれいにんぐ ばーじょん 2"
|
||||
name-en: "Gran Turismo Concept - LUPO CUP Training Version 2"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PAPX-90511:
|
||||
name: "SIREN [体験版]"
|
||||
name-sort: "さいれん [たいけんばん]"
|
||||
@@ -481,11 +463,9 @@ PAPX-90512:
|
||||
name-sort: "ぐらんつーりすも 4 - とよた ぷりうす [たいけんばん]"
|
||||
name-en: "Gran Turismo 4 - TOYOTA Prius [Trial]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
gsHWFixes: &gran-turismo-4-prologue-gs-fixes
|
||||
<<: *gran-turismo-3-gs-fixes
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
PAPX-90514:
|
||||
name: "冬のオススメソフト おためしDISC"
|
||||
name-sort: "ふゆのおすすめそふとおためしでぃすく"
|
||||
@@ -538,13 +518,11 @@ PAPX-90523:
|
||||
name-sort: "ぐらんつーりすも 4 - おんらいんじっけんばーじょん"
|
||||
name-en: "Gran Turismo 4 - Online Test Version"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
clampModes: &gran-turismo-4-clamp-modes
|
||||
vuClampMode: 2 # In GT4, text in GT mode works. In TT, fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes: &gran-turismo-4-gs-fixes
|
||||
<<: *gran-turismo-4-prologue-gs-fixes
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
PAPX-90524:
|
||||
name: "ワイルドアームズ ザ フィフスヴァンガード [体験版]"
|
||||
name-sort: "わいるどあーむず ざ ふぃふすゔぁんがーど [たいけんばん]"
|
||||
@@ -691,20 +669,14 @@ PBPX-95502:
|
||||
name-sort: "ぐらんつーりすも 3 - A-Spec [ほんたいどうこんばん]"
|
||||
name-en: "Gran Turismo 3 - A-Spec [PS2 Bundle]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCPS-15009"
|
||||
PBPX-95503:
|
||||
name: "Gran Turismo 3 - A-Spec [PS2 Bundle]"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95503"
|
||||
- "SCUS-97102"
|
||||
@@ -765,20 +737,12 @@ PBPX-95523:
|
||||
name-sort: "ぐらんつーりすも 4 ぷろろーぐ [ほんたいどうこんばん]"
|
||||
name-en: "Gran Turismo 4 Prologue [PS2 Bundle]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
PBPX-95524:
|
||||
name: "Gran Turismo 4 Prologue [PlayStation 2 Racing Pack]"
|
||||
region: "NTSC-C"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
PBPX-95525:
|
||||
name: "ファイナルファンタジーⅫ [本体同梱版]"
|
||||
name-sort: "ふぁいなるふぁんたじー 12 [ほんたいどうこんばん]"
|
||||
@@ -790,13 +754,8 @@ PBPX-95601:
|
||||
name-en: "Gran Turismo 4 [PS2 Bundle]"
|
||||
region: "NTSC-J"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -844,10 +803,7 @@ PCPX-96309:
|
||||
name-sort: "ぐらんつーりすも 3 ねっつ とよた [Demo]"
|
||||
name-en: "Gran Turismo 3 Netz TOYOTA [Demo]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Fixes missing lens flare and intensity.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96310:
|
||||
name: "エクストリーム・レーシング SSX [体験版]"
|
||||
name-sort: "えくすとりーむ れーしんぐ SSX [たいけんばん]"
|
||||
@@ -862,19 +818,13 @@ PCPX-96311:
|
||||
name-sort: "ぐらんつーりすも 3 てんとうしゆうでぃすくVol.1"
|
||||
name-en: "Gran Turismo 3 Trial Disk Volume 1"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Fixes missing lens flare and intensity.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96312:
|
||||
name: "GRAN TURISMO 3 - A-Spec - [オートバックス店頭試遊ディスク]"
|
||||
name-sort: "ぐらんつーりすも 3 A-Spec おーとばっくすてんとうしゆうでぃすく"
|
||||
name-en: "Gran Turismo 3 - A-Spec - Autobacs Tentou Shiyuu Disc"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes edge bleed and lines.
|
||||
autoFlush: 1 # Fixes missing lens flare and intensity.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96314:
|
||||
name: "スカイオデッセイ [体験版]"
|
||||
name-sort: "すかいおでっせい [たいけんばん]"
|
||||
@@ -1005,10 +955,7 @@ PCPX-96609:
|
||||
name-sort: "ぐらんつーりすも 3 - A-Spec - てんとうしゆう Disc Vol. 2"
|
||||
name-en: "Gran Turismo 3 - A-Spec - Tentou Shiyuu Disc Vol. 2"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96610:
|
||||
name: "見る見る 2001年2月度受注号"
|
||||
name-sort: "みるみる 2001ねん 2がつどじゅちゅうごう"
|
||||
@@ -1082,10 +1029,7 @@ PCPX-96624:
|
||||
name-sort: "ぐらんつーりすも こんせぷと 2001 Tokyo"
|
||||
name-en: "Gran Turismo - Concept 2001 Tokyo"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96625:
|
||||
name: "プレプレ2 VOLUME.4"
|
||||
name-sort: "ぷれぷれ2 VOLUME. 4"
|
||||
@@ -1136,10 +1080,7 @@ PCPX-96634:
|
||||
name-sort: "ぐらんつーりすも すばるどらいびんぐしみゅれーたーばーじょん"
|
||||
name-en: "Gran Turismo - SUBARU Driving Simulator Version"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
PCPX-96635:
|
||||
name: "プレプレ2 VOLUME.8"
|
||||
name-sort: "ぷれぷれ2 VOLUME. 8"
|
||||
@@ -1176,13 +1117,8 @@ PCPX-96649:
|
||||
name-en: "Gran Turismo 4 [Trial]"
|
||||
region: "NTSC-J"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
PCPX-96653:
|
||||
name: "ラチェット&クランク3 突撃!ガラクチック★レンジャーズ [店頭体験版]"
|
||||
name-sort: "らちぇっとあんどくらんく3 とつげき!がらくちっくれんじゃーず [てんとうたいけんばん]"
|
||||
@@ -1223,13 +1159,8 @@ PCPX-96660:
|
||||
name-sort: "つーりすと とろふぃー [Demo]"
|
||||
name-en: "Tourist Trophy [Demo]"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
PCPX-98017:
|
||||
name: "ラチェット&クランク4th ギリギリ銀河のギガバトル [体験版]"
|
||||
name-sort: "らちぇっとあんどくらんく4th ぎりぎりぎんがのぎがばとる [たいけんばん]"
|
||||
@@ -1691,11 +1622,7 @@ SCAJ-20066:
|
||||
name: "Gran Turismo 4 Prologue"
|
||||
region: "NTSC-Unk"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -1708,7 +1635,6 @@ SCAJ-20066:
|
||||
- "SCPS-19304"
|
||||
- "SCPS-15009"
|
||||
- "SCPS-55007"
|
||||
# vuClampMode = 2 Text in GT mode works.
|
||||
SCAJ-20067:
|
||||
name: "Gungrave O.D."
|
||||
region: "NTSC-Unk"
|
||||
@@ -2446,13 +2372,8 @@ SCAJ-20170:
|
||||
name: "Tourist Trophy"
|
||||
region: "NTSC-C"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCAJ-20171:
|
||||
name: "絶体絶命都市2 - 凍てついた記憶たち"
|
||||
name-sort: "ぜったいぜつめいとし いてついたきおくたち"
|
||||
@@ -2743,14 +2664,11 @@ SCAJ-30006:
|
||||
name-sort: "ぐらんつーりすも 4"
|
||||
name-en: "Gran Turismo 4"
|
||||
region: "NTSC-J"
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
roundModes:
|
||||
eeRoundMode: 3 # Using chop for both normal+div fixes crash in B5 license test.
|
||||
eeDivRoundMode: 3 # See above.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -2767,25 +2685,19 @@ SCAJ-30007:
|
||||
name: "Gran Turismo 4"
|
||||
region: "NTSC-C"
|
||||
compat: 5
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
roundModes:
|
||||
eeRoundMode: 3 # Using chop for both normal+div fixes crash in B5 license test.
|
||||
eeDivRoundMode: 3 # See above.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCAJ-30008:
|
||||
name: "Gran Turismo 4 [PlayStation2 the Best]"
|
||||
region: "NTSC-C"
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
roundModes:
|
||||
eeRoundMode: 3 # Using chop for both normal+div fixes crash in B5 license test.
|
||||
eeDivRoundMode: 3 # See above.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -2949,11 +2861,8 @@ SCCS-60002:
|
||||
name-sort: "Paoche Langmanlu 4"
|
||||
name-en: "Gran Turismo 4 [Review Copy]"
|
||||
region: "NTSC-C"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCED-50041:
|
||||
name: "Tekken Tag Tournament [Demo]"
|
||||
region: "PAL-E"
|
||||
@@ -3353,10 +3262,7 @@ SCED-51351:
|
||||
SCED-51352:
|
||||
name: "Gran Turismo - Nissan Micra Edition [Demo]"
|
||||
region: "PAL-E"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCED-51359:
|
||||
name: "Official PlayStation 2 Magazine Demo 27"
|
||||
region: "PAL-M5"
|
||||
@@ -3920,11 +3826,7 @@ SCED-52452:
|
||||
SCED-52455:
|
||||
name: "Gran Turismo Special Edition 2004 Geneva Version"
|
||||
region: "PAL-E"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
SCED-52461:
|
||||
name: "SingStar [Press Kit]"
|
||||
region: "PAL-E"
|
||||
@@ -3947,11 +3849,7 @@ SCED-52549:
|
||||
SCED-52578:
|
||||
name: "Gran Turismo 4 BMW 1 Series Virtual Drive Dealership [Demo]"
|
||||
region: "PAL-M5"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCED-52580:
|
||||
name: "Magazine Ufficiale PlayStation 2 Italia 06/04"
|
||||
region: "PAL-I"
|
||||
@@ -3964,11 +3862,7 @@ SCED-52619:
|
||||
SCED-52681:
|
||||
name: "Gran Turismo 4 BMW 1 Series Virtual Drive [Demo]"
|
||||
region: "PAL-M11"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCED-52687:
|
||||
name: "Formula One 04 [Demo]"
|
||||
region: "PAL-M11"
|
||||
@@ -4903,10 +4797,7 @@ SCES-50294:
|
||||
name: "Gran Turismo 3 - A-Spec"
|
||||
region: "PAL-M5"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCES-50295:
|
||||
name: "Dark Cloud"
|
||||
region: "PAL-M5"
|
||||
@@ -5174,10 +5065,7 @@ SCES-50858:
|
||||
name: "Gran Turismo - Concept 2002 Tokyo-Geneva"
|
||||
region: "PAL-M6"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "SCES-50858"
|
||||
- "SCES-50294"
|
||||
@@ -5607,13 +5495,8 @@ SCES-51719:
|
||||
name: "Gran Turismo 4"
|
||||
region: "PAL-M5"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "SCES-51719"
|
||||
- "SCES-52438"
|
||||
@@ -5871,16 +5754,11 @@ SCES-52438:
|
||||
name: "Gran Turismo 4 Prologue"
|
||||
region: "PAL-M5"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
memcardFilters:
|
||||
- "SCES-51719"
|
||||
- "SCES-52438"
|
||||
- "SCES-50294"
|
||||
# vuClampMode = 2 Text in GT mode works.
|
||||
SCES-52456:
|
||||
name: "Ratchet & Clank 3"
|
||||
region: "PAL-M5"
|
||||
@@ -6229,13 +6107,8 @@ SCES-53372:
|
||||
name: "Tourist Trophy - The Real Riding Simulator"
|
||||
region: "PAL-M5"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCES-53397:
|
||||
name: "SingStar - Popworld Events Code"
|
||||
region: "PAL-Unk"
|
||||
@@ -7418,11 +7291,7 @@ SCKA-20020:
|
||||
SCKA-20022:
|
||||
name: "Gran Turismo 4 - Prologue" # No listed Korean name on ReDump
|
||||
region: "NTSC-K"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
# vuClampMode = 2 Text in GT mode works.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
SCKA-20023:
|
||||
name: "제로 ~붉은 나비~"
|
||||
name-sort: "Zero: Bulgeun Nabi"
|
||||
@@ -7481,10 +7350,7 @@ SCKA-20028:
|
||||
SCKA-20029:
|
||||
name: "Gran Turismo Concept - 2002 Tokyo-Seoul [PlayStation 2 BigHit Series]" # No listed Korean name on ReDump
|
||||
region: "NTSC-K"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCKA-20030:
|
||||
name: "슬라이 쿠퍼 - 전설의 비법서를 찾아서 [PlayStation 2 BigHit Series]"
|
||||
name-sort: "Sly Cooper - Jeonseolui Bibeobseoreul Chajaseo [PlayStation 2 BigHit Series]"
|
||||
@@ -8355,13 +8221,8 @@ SCKA-24012:
|
||||
SCKA-30001:
|
||||
name: "Gran Turismo 4" # No listed Korean name on ReDump
|
||||
region: "NTSC-K"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCKA-30002:
|
||||
name: "GOD OF WAR 영혼의 반역자"
|
||||
name-sort: "God of War: Yeonghonui Banyeokja"
|
||||
@@ -8382,13 +8243,8 @@ SCKA-30003:
|
||||
SCKA-30004:
|
||||
name: "Gran Turismo 4 [PlayStation 2 BigHit Series]" # No listed Korean name on ReDump
|
||||
region: "NTSC-K"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCKA-30005:
|
||||
name: "로그 갤럭시"
|
||||
name-en: "Rogue Galaxy"
|
||||
@@ -8488,10 +8344,7 @@ SCPM-85301:
|
||||
name-sort: "ぐらんつーりすも こんせぷと こぺん すぺしゃるえでぃしょん [Demo]"
|
||||
name-en: "Gran Turismo Concept - Copen Special Edition [Demo]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPM-85302:
|
||||
name: "みんなのGOLF オンライン"
|
||||
name-sort: "みんなのごるふ おんらいん"
|
||||
@@ -8507,11 +8360,7 @@ SCPM-85304:
|
||||
name-sort: "ぐらんつーりすも 4 ふぁーすとぷれびゅー"
|
||||
name-en: "Gran Turismo 4 - First Preview -"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPN-60101:
|
||||
name: "PlayStation BB Navigator - Version 0.10 [Prerelease] [Disc 1]"
|
||||
name-sort: "ぷれいすてーしょん BB なびげーたー - Version 0.10 [Prerelease] [Disc 1]"
|
||||
@@ -8824,10 +8673,7 @@ SCPS-15009:
|
||||
name-sort: "ぐらんつーりすも3 A-spec"
|
||||
name-en: "Gran Turismo 3 - A-Spec"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCPS-15009"
|
||||
@@ -8837,10 +8683,7 @@ SCPS-15010:
|
||||
name-en: "Gran Turismo - Concept 2001 Tokyo"
|
||||
region: "NTSC-J"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-15011:
|
||||
name: "EXTERMINATION"
|
||||
name-sort: "エクスターミネーション"
|
||||
@@ -9177,11 +9020,7 @@ SCPS-15055:
|
||||
name-sort: "ぐらんつーりすも 4 ぷろろーぐ"
|
||||
name-en: "Gran Turismo 4 Prologue"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -9194,7 +9033,6 @@ SCPS-15055:
|
||||
- "SCPS-19304"
|
||||
- "SCPS-15009"
|
||||
- "SCPS-55007"
|
||||
# vuClampMode = 2 Text in GT mode works.
|
||||
SCPS-15056:
|
||||
name: "ラチェット&クランク2 ガガガ!銀河のコマンドーっす"
|
||||
name-sort: "らちぇっとあんどくらんく2 ががが!ぎんがのこまんどーっす"
|
||||
@@ -9650,13 +9488,8 @@ SCPS-15105:
|
||||
name-sort: "つーりすと とろふぃー"
|
||||
name-en: "Tourist Trophy - The Real Riding Simulator"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-15106:
|
||||
name: "SIREN2"
|
||||
name-sort: "さいれん2"
|
||||
@@ -9811,16 +9644,11 @@ SCPS-17001:
|
||||
name-en: "Gran Turismo 4"
|
||||
region: "NTSC-J"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
roundModes:
|
||||
eeRoundMode: 3 # Using chop for both normal+div fixes crash in B5 license test.
|
||||
eeDivRoundMode: 3 # See above.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -9847,41 +9675,29 @@ SCPS-17008:
|
||||
name-sort: "ぐらんつーりすも ないき りみてっどえでぃしょん [8inch]"
|
||||
name-en: "Nike - Gran Turismo [Limited Edition - 8 inch]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-17009:
|
||||
name: "NIKE/ GRAN TURISMO Limited Edition [9inch]"
|
||||
name-sort: "ぐらんつーりすも ないき りみてっどえでぃしょん [9inch]"
|
||||
name-en: "Nike - Gran Turismo [Limited Edition - 9 inch]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-17010:
|
||||
name: "NIKE/ GRAN TURISMO Limited Edition [10inch]"
|
||||
name-sort: "ぐらんつーりすも ないき りみてっどえでぃしょん [10inch]"
|
||||
name-en: "Nike - Gran Turismo [Limited Edition - 10 inch]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-17011:
|
||||
name: "NIKE/ GRAN TURISMO Limited Edition [11inch]"
|
||||
name-sort: "ぐらんつーりすも ないき りみてっどえでぃしょん [11inch]"
|
||||
name-en: "Nike - Gran Turismo [Limited Edition - 11 inch]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-17013:
|
||||
name: "ローグギャラクシー ディレクターズカット"
|
||||
name-sort: "ろーぐぎゃらくしー でぃれくたーずかっと"
|
||||
@@ -10037,10 +9853,7 @@ SCPS-19208:
|
||||
name-sort: "ぐらんつーりすも Concept 2001 Tokyo [PlayStation2 the Best]"
|
||||
name-en: "Gran Turismo - Concept 2001 Tokyo [PlayStation2 the Best]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-19209:
|
||||
name: "ぼくのなつやすみ2 海の冒険篇 [PlayStation2 the Best]"
|
||||
name-sort: "ぼくのなつやすみ2 うみのぼうけんへん [PlayStation2 the Best]"
|
||||
@@ -10107,13 +9920,8 @@ SCPS-19252:
|
||||
name-sort: "ぐらんつーりすも 4 [PlayStation2 the Best]"
|
||||
name-en: "Gran Turismo 4 [PlayStation2 the Best]"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -10178,11 +9986,7 @@ SCPS-19304:
|
||||
name-sort: "ぐらんつーりすも 4 ぷろろーぐ [PlayStation2 the Best]"
|
||||
name-en: "Gran Turismo 4 Prologue [PlayStation2 the Best]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95502"
|
||||
- "SCAJ-20066"
|
||||
@@ -10195,7 +9999,6 @@ SCPS-19304:
|
||||
- "SCPS-19304"
|
||||
- "SCPS-15009"
|
||||
- "SCPS-55007"
|
||||
# vuClampMode = 2 Text in GT mode works.
|
||||
SCPS-19305:
|
||||
name: "SIREN [PlayStation2 the Best]"
|
||||
name-sort: "さいれん [PlayStation2 the Best]"
|
||||
@@ -10424,13 +10227,8 @@ SCPS-19324:
|
||||
name-sort: "つーりすと とろふぃー [PlayStation2 the Best]"
|
||||
name-en: "Tourist Trophy - The Real Riding Simulator [PlayStation2 the Best]"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCPS-19325:
|
||||
name: "サルゲッチュ ミリオンモンキーズ [PlayStation2 the Best]"
|
||||
name-sort: "さるげっちゅ みりおんもんきーず [PlayStation2 the Best]"
|
||||
@@ -10650,10 +10448,7 @@ SCPS-55005:
|
||||
name-sort: "ぐらんつーりすも こんせぷと 2001 Tokyo"
|
||||
name-en: "Gran Turismo - Concept 2001 Tokyo"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-55006:
|
||||
name: "ワイルドアームズ アドヴァンスドサード"
|
||||
name-sort: "わいるどあーむず あどゔぁんすどさーど"
|
||||
@@ -10667,10 +10462,7 @@ SCPS-55007:
|
||||
name-sort: "ぐらんつーりすも 3 - A-Spec"
|
||||
name-en: "Gran Turismo 3 - A-Spec"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-55008:
|
||||
name: "サンダーストライカー"
|
||||
name-sort: "さんだーすとらいかー"
|
||||
@@ -11001,19 +10793,13 @@ SCPS-55902:
|
||||
name-sort: "ぐらんつーりすも - こんせぷと 2002 Tokyo-Geneva"
|
||||
name-en: "Gran Turismo - Concept 2002 Tokyo-Geneva"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-55903:
|
||||
name: "GRAN TURISMO - Concept 2002 Tokyo-Geneva"
|
||||
name-sort: "ぐらんつーりすも - こんせぷと 2002 Tokyo-Geneva"
|
||||
name-en: "Gran Turismo - Concept 2002 Tokyo-Geneva"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-56001:
|
||||
name: "이코"
|
||||
name-en: "Ico"
|
||||
@@ -11049,10 +10835,7 @@ SCPS-56004:
|
||||
SCPS-56005:
|
||||
name: "Gran Turismo Concept - 2002 Tokyo-Seoul" # No listed Korean name on ReDump
|
||||
region: "NTSC-K"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-56006:
|
||||
name: "철권 4"
|
||||
name-en: "Tekken 4"
|
||||
@@ -11131,10 +10914,7 @@ SCPS-72001:
|
||||
name-sort: "ぐらんつーりすも3 A-spec [MEGA HITS!]"
|
||||
name-en: "Gran Turismo 3 - A-Spec [MEGA HITS!]"
|
||||
region: "NTSC-J"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCPS-72002:
|
||||
name: "みんなのGOLF 3 [MEGA HITS!]"
|
||||
name-sort: "みんなのごるふ 3 [MEGA HITS!]"
|
||||
@@ -11170,13 +10950,8 @@ SCUS-90174:
|
||||
SCUS-90682:
|
||||
name: "Gran Turismo 4"
|
||||
region: "NTSC-U"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCUS-94346:
|
||||
name: "SingStar - Latino"
|
||||
region: "NTSC-U"
|
||||
@@ -11200,10 +10975,7 @@ SCUS-97102:
|
||||
name: "Gran Turismo 3 - A-Spec"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95503"
|
||||
- "SCUS-97102"
|
||||
@@ -11267,10 +11039,7 @@ SCUS-97114:
|
||||
SCUS-97115:
|
||||
name: "Gran Turismo 3 - A-Spec [Demo]"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCUS-97116:
|
||||
name: "Kiosk Disc 2.1"
|
||||
region: "NTSC-U"
|
||||
@@ -11701,12 +11470,9 @@ SCUS-97218:
|
||||
name: "Kiosk Demo Disc 2.6"
|
||||
region: "NTSC-U"
|
||||
SCUS-97219:
|
||||
name: "Gran Turismo 3 - A-Spec - Nissan 350Z Edition"
|
||||
name: "Gran Turismo Concept - Nissan 350Z Edition"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
memcardFilters:
|
||||
- "SCUS-97219"
|
||||
- "SCUS-97102"
|
||||
@@ -12063,13 +11829,8 @@ SCUS-97328:
|
||||
name: "Gran Turismo 4"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters: # Allows car imports from GT3 or something.
|
||||
- "PBPX-95503"
|
||||
- "SCUS-97328"
|
||||
@@ -12274,11 +12035,7 @@ SCUS-97383:
|
||||
SCUS-97384:
|
||||
name: "Gran Turismo Special Edition 2004 Toyota [Demo]"
|
||||
region: "NTSC-U"
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-4-prologue-gs-fixes
|
||||
SCUS-97392:
|
||||
name: "NBA '06 featuring The Life Vol.1 [Demo]"
|
||||
region: "NTSC-U"
|
||||
@@ -12507,13 +12264,8 @@ SCUS-97432:
|
||||
SCUS-97436:
|
||||
name: "Gran Turismo 4 [Online Public Beta]"
|
||||
region: "NTSC-U"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
memcardFilters:
|
||||
- "PBPX-95503"
|
||||
- "SCUS-97328"
|
||||
@@ -12731,13 +12483,8 @@ SCUS-97482:
|
||||
SCUS-97483:
|
||||
name: "Gran Turismo 4 MX-5 Edition [Demo]"
|
||||
region: "NTSC-U"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCUS-97484:
|
||||
name: "Sly 3 - Honor Among Thieves [E3 Demo]"
|
||||
region: "NTSC-U"
|
||||
@@ -12860,13 +12607,8 @@ SCUS-97502:
|
||||
name: "Tourist Trophy"
|
||||
region: "NTSC-U"
|
||||
compat: 5
|
||||
clampModes:
|
||||
vuClampMode: 2 # Fixes SPS in TT Mode menu caused by the moving tooltips.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCUS-97503:
|
||||
name: "MLB '06 - The Show [Demo]"
|
||||
region: "NTSC-U"
|
||||
@@ -12920,10 +12662,7 @@ SCUS-97512:
|
||||
- "PBPX-95503"
|
||||
- "SCUS-97102"
|
||||
- "SCUS-97512"
|
||||
gsHWFixes:
|
||||
halfPixelOffset: 5 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Partially fixes the sun occlusion and lens flare.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
gsHWFixes: *gran-turismo-3-gs-fixes
|
||||
SCUS-97513:
|
||||
name: "Ratchet & Clank 2 - Going Commando [Greatest Hits]"
|
||||
region: "NTSC-U"
|
||||
@@ -13126,13 +12865,8 @@ SCUS-97560:
|
||||
SCUS-97563:
|
||||
name: "Gran Turismo 4"
|
||||
region: "NTSC-U"
|
||||
clampModes:
|
||||
vuClampMode: 2 # Text in GT mode works.
|
||||
gsHWFixes:
|
||||
recommendedBlendingLevel: 3 # Improves banding in car showcase as well as car brightness and sheen.
|
||||
halfPixelOffset: 4 # Fixes weird edge shadows and depth bleed which happens on the edge as well.
|
||||
autoFlush: 1 # Helps lens flare and sun occlusion somewhat but doesn't full fix it.
|
||||
getSkipCount: "GSC_PolyphonyDigitalGames" # Fixes post-processing.
|
||||
clampModes: *gran-turismo-4-clamp-modes
|
||||
gsHWFixes: *gran-turismo-4-gs-fixes
|
||||
SCUS-97564:
|
||||
name: "Jampack Demo Disc Vol.15 [T-Rated]"
|
||||
region: "NTSC-U"
|
||||
|
||||
@@ -198,7 +198,7 @@ struct PS_OUTPUT
|
||||
|
||||
#if PS_RETURN_COLOR
|
||||
#if PS_DATE == 1 || PS_DATE == 2
|
||||
float c : SV_Target;
|
||||
float c0 : SV_Target;
|
||||
#else
|
||||
|
||||
float4 c0 : SV_Target0;
|
||||
@@ -2014,11 +2014,6 @@ VS_OUTPUT vs_main_expand(uint vid : SV_VertexID)
|
||||
vtx.inv_cov = is_near_corner ? 0.0f : 1.0f; // Full coverage at near corner, otherwise none.
|
||||
|
||||
vtx.interior = 0;
|
||||
|
||||
#if !VS_IIP
|
||||
// Get the provoking vertex color (first vertex in DX)
|
||||
vtx.c = i0 == 0 ? vtx.c : (i1 == 0 ? other.c : opposite.c);
|
||||
#endif
|
||||
}
|
||||
|
||||
return vtx;
|
||||
|
||||
@@ -455,11 +455,6 @@ void main()
|
||||
VSout.inv_cov = is_near_corner ? 0.0f : 1.0f; // Full coverage at near corner, otherwise none.
|
||||
|
||||
VSout.interior = 0;
|
||||
|
||||
#if !VS_IIP
|
||||
// Get the provoking vertex color (last vertex in GL)
|
||||
vtx.c = i0 == 2 ? vtx.c : (i1 == 2 ? other.c : opposite.c);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -450,11 +450,6 @@ void main()
|
||||
vsOut.inv_cov = is_near_corner ? 0.0f : 1.0f; // Full coverage at near corner, otherwise none.
|
||||
|
||||
vsOut.interior = 0;
|
||||
|
||||
#if !VS_IIP
|
||||
// Get the provoking vertex color (last vertex in VK)
|
||||
vtx.c = i0 == 2 ? vtx.c : (i1 == 2 ? other.c : opposite.c);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,34 @@ Value MemoryInterface::Read(u32 address, bool* valid)
|
||||
return Value(0);
|
||||
}
|
||||
|
||||
std::optional<std::string> MemoryInterface::ReadString(u32 address, u32 max_size, ReadStringFlags flags)
|
||||
{
|
||||
std::string string;
|
||||
|
||||
for (u32 i = 0; i < max_size; i++)
|
||||
{
|
||||
bool valid;
|
||||
char c = Read8(address + i, &valid);
|
||||
if (!valid)
|
||||
return std::nullopt;
|
||||
|
||||
if (c == '\0')
|
||||
return string;
|
||||
else if (!(flags & ALLOW_NON_PRINTABLE_CHARACTERS) && (c < ' ' || c > '~'))
|
||||
return std::nullopt;
|
||||
|
||||
string += c;
|
||||
}
|
||||
|
||||
if (flags & ALLOW_LONG_STRINGS)
|
||||
{
|
||||
string += '~';
|
||||
return string;
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
template <MemoryAccessType Value>
|
||||
bool MemoryInterface::Write(u32 address, Value value)
|
||||
{
|
||||
@@ -62,6 +90,17 @@ bool MemoryInterface::Write(u32 address, Value value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MemoryInterface::WriteString(u32 address, std::string_view string)
|
||||
{
|
||||
if (!WriteBytes(address, string.data(), static_cast<u32>(string.size())))
|
||||
return false;
|
||||
|
||||
if (!Write8(address + static_cast<u32>(string.size()), '\0'))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemoryInterface::IdempotentWrite8(u32 address, u8 value)
|
||||
{
|
||||
bool valid;
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "Pcsx2Types.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
template <typename Value>
|
||||
@@ -31,16 +34,27 @@ public:
|
||||
template <MemoryAccessType Value>
|
||||
Value Read(u32 address, bool* valid = nullptr);
|
||||
|
||||
enum ReadStringFlags
|
||||
{
|
||||
NO_FLAGS = 0,
|
||||
ALLOW_LONG_STRINGS = 1 << 0,
|
||||
ALLOW_NON_PRINTABLE_CHARACTERS = 1 << 1
|
||||
};
|
||||
|
||||
std::optional<std::string> ReadString(u32 address, u32 max_size = 256, ReadStringFlags flags = NO_FLAGS);
|
||||
|
||||
virtual bool Write8(u32 address, u8 value) = 0;
|
||||
virtual bool Write16(u32 address, u16 value) = 0;
|
||||
virtual bool Write32(u32 address, u32 value) = 0;
|
||||
virtual bool Write64(u32 address, u64 value) = 0;
|
||||
virtual bool Write128(u32 address, u128 value) = 0;
|
||||
virtual bool WriteBytes(u32 address, void* src, u32 size) = 0;
|
||||
virtual bool WriteBytes(u32 address, const void* src, u32 size) = 0;
|
||||
|
||||
template <MemoryAccessType Value>
|
||||
bool Write(u32 address, Value value);
|
||||
|
||||
bool WriteString(u32 address, std::string_view string);
|
||||
|
||||
bool IdempotentWrite8(u32 address, u8 value);
|
||||
bool IdempotentWrite16(u32 address, u16 value);
|
||||
bool IdempotentWrite32(u32 address, u32 value);
|
||||
@@ -51,5 +65,5 @@ public:
|
||||
template <MemoryAccessType Value>
|
||||
bool IdempotentWrite(u32 address, Value value);
|
||||
|
||||
virtual bool CompareBytes(u32 address, void* src, u32 size) = 0;
|
||||
virtual bool CompareBytes(u32 address, const void* src, u32 size) = 0;
|
||||
};
|
||||
|
||||
+102
-30
@@ -17,7 +17,7 @@ struct RapidYAMLContext
|
||||
Error* error = nullptr;
|
||||
};
|
||||
|
||||
std::optional<ryml::Tree> ParseYAMLFromString(ryml::csubstr yaml, ryml::csubstr file_name, Error* error)
|
||||
std::optional<ryml::Tree> ParseYAMLFromString(ryml::csubstr yaml, ryml::csubstr file_name, Error* error, bool resolve_anchors)
|
||||
{
|
||||
RapidYAMLContext context;
|
||||
context.error = error;
|
||||
@@ -28,63 +28,135 @@ std::optional<ryml::Tree> ParseYAMLFromString(ryml::csubstr yaml, ryml::csubstr
|
||||
callbacks.set_user_data(static_cast<void*>(&context));
|
||||
|
||||
callbacks.set_error_basic([](ryml::csubstr msg, const ryml::ErrorDataBasic& errdata, void* user_data) {
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_basic_format(std::move(callback), msg, errdata);
|
||||
RapidYAMLContext* context = static_cast<RapidYAMLContext*>(user_data);
|
||||
// This scope needs to stay, so all objects destruct before std::longjump
|
||||
{
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_basic_format(std::move(callback), msg, errdata);
|
||||
|
||||
// We might have already returned, so don't try to recover.
|
||||
pxFailRel(description.c_str());
|
||||
std::abort();
|
||||
if (context != nullptr)
|
||||
{
|
||||
Error::SetString(context->error, std::move(description));
|
||||
}
|
||||
else
|
||||
{
|
||||
pxFailRel(description.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (context != nullptr)
|
||||
{
|
||||
std::longjmp(context->env, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::terminate();
|
||||
}
|
||||
});
|
||||
|
||||
callbacks.set_error_parse([](ryml::csubstr msg, const ryml::ErrorDataParse& errdata, void* user_data) {
|
||||
RapidYAMLContext* context = static_cast<RapidYAMLContext*>(user_data);
|
||||
// This scope needs to stay, so all objects destruct before std::longjump
|
||||
{
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_parse_format(std::move(callback), msg, errdata);
|
||||
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_parse_format(std::move(callback), msg, errdata);
|
||||
if (context != nullptr)
|
||||
{
|
||||
Error::SetString(context->error, std::move(description));
|
||||
}
|
||||
else
|
||||
{
|
||||
pxFailRel(description.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Error::SetString(context->error, std::move(description));
|
||||
std::longjmp(context->env, 1);
|
||||
if (context != nullptr)
|
||||
{
|
||||
std::longjmp(context->env, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::terminate();
|
||||
}
|
||||
});
|
||||
|
||||
callbacks.set_error_visit([](ryml::csubstr msg, const ryml::ErrorDataVisit& errdata, void* user_data) {
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_visit_format(std::move(callback), msg, errdata);
|
||||
RapidYAMLContext* context = static_cast<RapidYAMLContext*>(user_data);
|
||||
// This scope needs to stay, so all objects destruct before std::longjump
|
||||
{
|
||||
std::string description;
|
||||
auto callback = [&description](ryml::csubstr string) {
|
||||
description.append(string.str, string.len);
|
||||
};
|
||||
ryml::err_visit_format(std::move(callback), msg, errdata);
|
||||
|
||||
// We've probably already returned, so don't try to recover.
|
||||
pxFailRel(description.c_str());
|
||||
std::abort();
|
||||
if (context != nullptr)
|
||||
{
|
||||
Error::SetString(context->error, std::move(description));
|
||||
}
|
||||
else
|
||||
{
|
||||
pxFailRel(description.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (context != nullptr)
|
||||
{
|
||||
std::longjmp(context->env, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::terminate();
|
||||
}
|
||||
});
|
||||
#else
|
||||
callbacks.m_user_data = static_cast<void*>(&context);
|
||||
callbacks.m_error = [](const char* msg, size_t msg_len, ryml::Location location, void* user_data) {
|
||||
RapidYAMLContext* context = static_cast<RapidYAMLContext*>(user_data);
|
||||
|
||||
Error::SetString(context->error, std::string(msg, msg_len));
|
||||
std::longjmp(context->env, 1);
|
||||
if (RapidYAMLContext* context = static_cast<RapidYAMLContext*>(user_data))
|
||||
{
|
||||
Error::SetString(context->error, std::string(msg, msg_len));
|
||||
std::longjmp(context->env, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string description(msg, msg_len);
|
||||
pxFailRel(description.c_str());
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
ryml::EventHandlerTree event_handler(callbacks);
|
||||
ryml::Parser parser(&event_handler);
|
||||
|
||||
ryml::Tree tree;
|
||||
ryml::Tree tree(callbacks);
|
||||
|
||||
// The only options RapidYAML provides for recovering from errors are
|
||||
// throwing an exception or using setjmp/longjmp. Since we have exceptions
|
||||
// disabled we have to use the latter option.
|
||||
if (setjmp(context.env))
|
||||
if (setjmp(context.env) != 0)
|
||||
return std::nullopt;
|
||||
|
||||
ryml::parse_in_arena(&parser, file_name, yaml, &tree);
|
||||
if (resolve_anchors)
|
||||
{
|
||||
tree.resolve();
|
||||
}
|
||||
|
||||
// Callbacks passed to ryml::Tree are used for value parsing errors later,
|
||||
// so we need to clear the context before it goes out of scope.
|
||||
#if RYML_VERSION_MAJOR > 0 || RYML_VERSION_MINOR >= 11
|
||||
callbacks.set_user_data(nullptr);
|
||||
#else
|
||||
callbacks.m_user_data = nullptr;
|
||||
#endif
|
||||
tree.callbacks(callbacks);
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
+3
-1
@@ -14,4 +14,6 @@
|
||||
/// parsing errors (as is recommended by the documentation for cases where
|
||||
/// exceptions are disabled). The file_name parameter is only used for error
|
||||
/// messages, which are returned via the error parameter.
|
||||
std::optional<ryml::Tree> ParseYAMLFromString(ryml::csubstr yaml, ryml::csubstr file_name, Error* error);
|
||||
/// If resolve_anchors is set to true, YAML anchors and aliases will be resolved.
|
||||
/// It's a potentially slow operation, so it's opt-in.
|
||||
std::optional<ryml::Tree> ParseYAMLFromString(ryml::csubstr yaml, ryml::csubstr file_name, Error* error, bool resolve_anchors = false);
|
||||
|
||||
@@ -196,6 +196,7 @@ target_sources(pcsx2-qt PRIVATE
|
||||
Debugger/ModuleModel.h
|
||||
Debugger/ModuleView.cpp
|
||||
Debugger/ModuleView.h
|
||||
Debugger/NavigationHistoryStack.h
|
||||
Debugger/RegisterView.cpp
|
||||
Debugger/RegisterView.h
|
||||
Debugger/RegisterView.ui
|
||||
|
||||
@@ -206,6 +206,29 @@ void DebuggerView::updateStyleSheet()
|
||||
setStyleSheet(stylesheet);
|
||||
}
|
||||
|
||||
bool DebuggerView::supportsNavigation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerView::canNavigateBack()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DebuggerView::canNavigateForward()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void DebuggerView::navigateBack()
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerView::navigateForward()
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerView::goToInDisassembler(u32 address, bool switch_to_tab)
|
||||
{
|
||||
DebuggerEvents::GoToAddress event;
|
||||
@@ -268,7 +291,7 @@ std::vector<QAction*> DebuggerView::createEventActionsImplementation(
|
||||
if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix())
|
||||
return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber();
|
||||
|
||||
return lhs->displayNameWithoutSuffix() < rhs->displayNameWithoutSuffix();
|
||||
return QtHost::LocaleSensitiveCompare(lhs->displayNameWithoutSuffix(), rhs->displayNameWithoutSuffix()) < 0;
|
||||
});
|
||||
|
||||
QMenu* submenu = nullptr;
|
||||
|
||||
@@ -153,6 +153,12 @@ public:
|
||||
|
||||
void updateStyleSheet();
|
||||
|
||||
virtual bool supportsNavigation();
|
||||
virtual bool canNavigateBack();
|
||||
virtual bool canNavigateForward();
|
||||
virtual void navigateBack();
|
||||
virtual void navigateForward();
|
||||
|
||||
static void goToInDisassembler(u32 address, bool switch_to_tab);
|
||||
static void goToInMemoryView(u32 address, bool switch_to_tab);
|
||||
|
||||
|
||||
@@ -115,6 +115,28 @@ DebuggerWindow::DebuggerWindow(QWidget* parent)
|
||||
|
||||
setMenuWidget(m_dock_manager->createMenuBar(menu_bar));
|
||||
|
||||
connect(m_dock_manager, &DockManager::focusedViewForNavigationChanged,
|
||||
this, &DebuggerWindow::updateNavigationButtons);
|
||||
|
||||
m_ui.actionNavigateBack->setEnabled(false);
|
||||
m_ui.actionNavigateForward->setEnabled(false);
|
||||
|
||||
connect(m_ui.actionNavigateBack, &QAction::triggered, this, [this]() {
|
||||
DebuggerView* view = m_dock_manager->focusedViewForNavigation();
|
||||
if (!view)
|
||||
return;
|
||||
|
||||
view->navigateBack();
|
||||
});
|
||||
|
||||
connect(m_ui.actionNavigateForward, &QAction::triggered, this, [this]() {
|
||||
DebuggerView* view = m_dock_manager->focusedViewForNavigation();
|
||||
if (!view)
|
||||
return;
|
||||
|
||||
view->navigateForward();
|
||||
});
|
||||
|
||||
updateTheme();
|
||||
|
||||
Host::RunOnCPUThread([]() {
|
||||
@@ -307,6 +329,21 @@ void DebuggerWindow::updateFromSettings()
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerWindow::updateNavigationButtons()
|
||||
{
|
||||
DebuggerView* view = m_dock_manager->focusedViewForNavigation();
|
||||
if (view)
|
||||
{
|
||||
m_ui.actionNavigateBack->setEnabled(view->canNavigateBack());
|
||||
m_ui.actionNavigateForward->setEnabled(view->canNavigateForward());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui.actionNavigateBack->setEnabled(false);
|
||||
m_ui.actionNavigateForward->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerWindow::onVMStarting()
|
||||
{
|
||||
m_ui.actionRun->setEnabled(true);
|
||||
|
||||
@@ -40,7 +40,9 @@ public:
|
||||
|
||||
void updateFromSettings();
|
||||
|
||||
public slots:
|
||||
void updateNavigationButtons();
|
||||
|
||||
private slots:
|
||||
void onVMStarting();
|
||||
void onVMPaused();
|
||||
void onVMResumed();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1000</width>
|
||||
<height>750</height>
|
||||
<width>1322</width>
|
||||
<height>974</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -23,8 +23,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1000</width>
|
||||
<height>21</height>
|
||||
<width>1322</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
@@ -58,6 +58,9 @@
|
||||
</property>
|
||||
<addaction name="actionOnTop"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionNavigateBack"/>
|
||||
<addaction name="actionNavigateForward"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionIncreaseFontSize"/>
|
||||
<addaction name="actionDecreaseFontSize"/>
|
||||
<addaction name="actionResetFontSize"/>
|
||||
@@ -82,12 +85,25 @@
|
||||
<addaction name="menuWindows"/>
|
||||
<addaction name="menuLayouts"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBarNavigation">
|
||||
<property name="windowTitle">
|
||||
<string>Navigation</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionNavigateBack"/>
|
||||
<addaction name="actionNavigateForward"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBarDebug">
|
||||
<property name="windowTitle">
|
||||
<string>Debug</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
@@ -105,7 +121,7 @@
|
||||
<string>File</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
@@ -122,7 +138,7 @@
|
||||
<string>System</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
@@ -138,7 +154,7 @@
|
||||
<string>View</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
@@ -237,7 +253,7 @@
|
||||
<string>Shut Down</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReset">
|
||||
@@ -248,7 +264,7 @@
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClose">
|
||||
@@ -259,7 +275,7 @@
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionIncreaseFontSize">
|
||||
@@ -270,7 +286,7 @@
|
||||
<string>Increase Font Size</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDecreaseFontSize">
|
||||
@@ -284,7 +300,7 @@
|
||||
<string>Ctrl+-</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetFontSize">
|
||||
@@ -295,7 +311,7 @@
|
||||
<string>Reset Font Size</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSettings">
|
||||
@@ -306,7 +322,7 @@
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGameSettings">
|
||||
@@ -317,7 +333,7 @@
|
||||
<string>Game Settings</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionToolsDummy">
|
||||
@@ -330,6 +346,37 @@
|
||||
<string/>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNavigateBack">
|
||||
<property name="icon">
|
||||
<iconset theme="arrow-left-line"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Navigate Back</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Navigate Back</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Alt+Left</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNavigateForward">
|
||||
<property name="icon">
|
||||
<iconset theme="arrow-right-line"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Navigate Forward</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Alt+Right</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -76,7 +76,11 @@ bool DisassemblyView::fromJson(const JsonValueWrapper& json)
|
||||
|
||||
auto start_address = json.value().FindMember("startAddress");
|
||||
if (start_address != json.value().MemberEnd() && start_address->value.IsUint())
|
||||
{
|
||||
m_visibleStart = start_address->value.GetUint() & ~3;
|
||||
m_navigation_history.clear();
|
||||
m_navigation_history.pushInstantly(m_visibleStart);
|
||||
}
|
||||
|
||||
auto go_to_pc_on_pause = json.value().FindMember("goToPCOnPause");
|
||||
if (go_to_pc_on_pause != json.value().MemberEnd() && go_to_pc_on_pause->value.IsBool())
|
||||
@@ -388,6 +392,41 @@ QString DisassemblyView::GetLineDisasm(u32 address)
|
||||
return QString("%1 %2").arg(lineInfo.name.c_str()).arg(lineInfo.params.c_str());
|
||||
};
|
||||
|
||||
bool DisassemblyView::supportsNavigation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DisassemblyView::canNavigateBack()
|
||||
{
|
||||
return m_navigation_history.canGoBack();
|
||||
}
|
||||
|
||||
bool DisassemblyView::canNavigateForward()
|
||||
{
|
||||
return m_navigation_history.canGoForward();
|
||||
}
|
||||
|
||||
void DisassemblyView::navigateBack()
|
||||
{
|
||||
std::optional<u32> address = m_navigation_history.back();
|
||||
if (!address.has_value())
|
||||
return;
|
||||
|
||||
m_visibleStart = *address;
|
||||
update();
|
||||
}
|
||||
|
||||
void DisassemblyView::navigateForward()
|
||||
{
|
||||
std::optional<u32> address = m_navigation_history.forward();
|
||||
if (!address.has_value())
|
||||
return;
|
||||
|
||||
m_visibleStart = *address;
|
||||
update();
|
||||
}
|
||||
|
||||
// Here we go!
|
||||
void DisassemblyView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
@@ -629,19 +668,21 @@ void DisassemblyView::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
|
||||
void DisassemblyView::wheelEvent(QWheelEvent* event)
|
||||
{
|
||||
if (event->angleDelta().y() < 0) // todo: max address bounds check?
|
||||
{
|
||||
if (event->angleDelta().y() < 0)
|
||||
m_visibleStart += 4;
|
||||
}
|
||||
else if (event->angleDelta().y() && m_visibleStart > 0)
|
||||
{
|
||||
m_visibleStart -= 4;
|
||||
}
|
||||
|
||||
m_navigation_history.pushWithDelay(m_visibleStart);
|
||||
update();
|
||||
}
|
||||
|
||||
void DisassemblyView::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
// Alt is used for the global navigation shortcuts.
|
||||
if (event->modifiers() & Qt::AltModifier)
|
||||
return;
|
||||
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_Up:
|
||||
@@ -653,15 +694,19 @@ void DisassemblyView::keyPressEvent(QKeyEvent* event)
|
||||
// Auto scroll
|
||||
if (m_visibleStart > m_selectedAddressStart)
|
||||
m_visibleStart -= 4;
|
||||
|
||||
m_navigation_history.pushWithDelay(m_visibleStart);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_PageUp:
|
||||
{
|
||||
m_selectedAddressStart -= m_visibleRows * 4;
|
||||
m_selectedAddressEnd = m_selectedAddressStart;
|
||||
m_visibleStart -= m_visibleRows * 4;
|
||||
|
||||
m_navigation_history.pushWithDelay(m_visibleStart);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_Down:
|
||||
{
|
||||
m_selectedAddressEnd += 4;
|
||||
@@ -673,6 +718,7 @@ void DisassemblyView::keyPressEvent(QKeyEvent* event)
|
||||
if (m_visibleStart + ((m_visibleRows - 1) * 4) < m_selectedAddressEnd)
|
||||
m_visibleStart += 4;
|
||||
|
||||
m_navigation_history.pushWithDelay(m_visibleStart);
|
||||
break;
|
||||
}
|
||||
case Qt::Key_PageDown:
|
||||
@@ -680,6 +726,7 @@ void DisassemblyView::keyPressEvent(QKeyEvent* event)
|
||||
m_selectedAddressStart += m_visibleRows * 4;
|
||||
m_selectedAddressEnd = m_selectedAddressStart;
|
||||
m_visibleStart += m_visibleRows * 4;
|
||||
m_navigation_history.pushWithDelay(m_visibleStart);
|
||||
break;
|
||||
}
|
||||
case Qt::Key_G:
|
||||
@@ -1014,6 +1061,8 @@ void DisassemblyView::gotoAddress(u32 address, bool should_set_focus)
|
||||
m_selectedAddressStart = destAddress;
|
||||
m_selectedAddressEnd = destAddress;
|
||||
|
||||
m_navigation_history.pushInstantly(m_visibleStart);
|
||||
|
||||
update();
|
||||
if (should_set_focus)
|
||||
setFocus();
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
#include "ui_DisassemblyView.h"
|
||||
|
||||
#include "DebuggerView.h"
|
||||
#include "Debugger/DebuggerView.h"
|
||||
#include "Debugger/NavigationHistoryStack.h"
|
||||
|
||||
#include "pcsx2/DebugTools/DisassemblyManager.h"
|
||||
|
||||
@@ -26,6 +27,12 @@ public:
|
||||
// Required for the breakpoint list (ugh wtf)
|
||||
QString GetLineDisasm(u32 address);
|
||||
|
||||
bool supportsNavigation() override;
|
||||
bool canNavigateBack() override;
|
||||
bool canNavigateForward() override;
|
||||
void navigateBack() override;
|
||||
void navigateForward() override;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
@@ -68,7 +75,7 @@ public slots:
|
||||
private:
|
||||
Ui::DisassemblyView m_ui;
|
||||
|
||||
u32 m_visibleStart = 0x100000; // The address of the first instruction shown.
|
||||
u32 m_visibleStart = STARTING_ADDRESS; // The address of the first instruction shown.
|
||||
u32 m_visibleRows;
|
||||
u32 m_selectedAddressStart = 0;
|
||||
u32 m_selectedAddressEnd = 0;
|
||||
@@ -81,6 +88,8 @@ private:
|
||||
bool m_goToProgramCounterOnPause = true;
|
||||
DisassemblyManager m_disassemblyManager;
|
||||
|
||||
NavigationHistoryStack<u32> m_navigation_history{STARTING_ADDRESS};
|
||||
|
||||
QString GetDisassemblyTitleLine();
|
||||
QColor GetDisassemblyTitleLineColor();
|
||||
inline QString DisassemblyStringFromAddress(u32 address, QFont font, u32 pc, bool selected);
|
||||
@@ -96,4 +105,6 @@ private:
|
||||
void setInstructions(u32 start, u32 end, u32 value);
|
||||
bool AddressCanRestore(u32 start, u32 end);
|
||||
bool FunctionCanRestore(u32 address);
|
||||
|
||||
static constexpr u32 STARTING_ADDRESS = 0x100000;
|
||||
};
|
||||
|
||||
@@ -339,15 +339,28 @@ void DockManager::createToolsMenu(QMenu* menu)
|
||||
if (m_current_layout == DockLayout::INVALID_INDEX || !g_debugger_window)
|
||||
return;
|
||||
|
||||
for (QToolBar* widget : g_debugger_window->findChildren<QToolBar*>())
|
||||
std::vector<QToolBar*> toolbars;
|
||||
for (QToolBar* toolbar : g_debugger_window->findChildren<QToolBar*>())
|
||||
toolbars.emplace_back(toolbar);
|
||||
|
||||
std::sort(toolbars.begin(), toolbars.end(), [](QToolBar* lhs, QToolBar* rhs) {
|
||||
return QtHost::LocaleSensitiveCompare(lhs->windowTitle(), rhs->windowTitle()) < 0;
|
||||
});
|
||||
|
||||
for (QToolBar* toolbar : toolbars)
|
||||
{
|
||||
QAction* action = menu->addAction(widget->windowTitle());
|
||||
action->setText(widget->windowTitle());
|
||||
QAction* action = menu->addAction(toolbar->windowTitle());
|
||||
action->setText(toolbar->windowTitle());
|
||||
action->setCheckable(true);
|
||||
action->setChecked(widget->isVisible());
|
||||
connect(action, &QAction::triggered, this, [widget]() {
|
||||
widget->setVisible(!widget->isVisible());
|
||||
action->setChecked(toolbar->isVisible());
|
||||
|
||||
connect(action, &QAction::triggered, this, [toolbar = QPointer<QToolBar>(toolbar)]() {
|
||||
if (!toolbar)
|
||||
return;
|
||||
|
||||
toolbar->setVisible(!toolbar->isVisible());
|
||||
});
|
||||
|
||||
menu->addAction(action);
|
||||
}
|
||||
}
|
||||
@@ -383,7 +396,7 @@ void DockManager::createWindowsMenu(QMenu* menu)
|
||||
if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix())
|
||||
return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber();
|
||||
|
||||
return lhs->displayNameWithoutSuffix() < rhs->displayNameWithoutSuffix();
|
||||
return QtHost::LocaleSensitiveCompare(lhs->displayNameWithoutSuffix(), rhs->displayNameWithoutSuffix()) < 0;
|
||||
});
|
||||
|
||||
for (DebuggerView* widget : add_another_widgets)
|
||||
@@ -472,7 +485,7 @@ void DockManager::createWindowsMenu(QMenu* menu)
|
||||
if (lhs.display_name == rhs.display_name)
|
||||
return lhs.suffix_number < rhs.suffix_number;
|
||||
|
||||
return lhs.display_name < rhs.display_name;
|
||||
return QtHost::LocaleSensitiveCompare(lhs.display_name, rhs.display_name) < 0;
|
||||
});
|
||||
|
||||
for (const DebuggerViewToggle& toggle : toggles)
|
||||
@@ -862,6 +875,24 @@ std::optional<BreakPointCpu> DockManager::cpu()
|
||||
return m_layouts.at(m_current_layout).cpu();
|
||||
}
|
||||
|
||||
DebuggerView* DockManager::focusedViewForNavigation()
|
||||
{
|
||||
if (!m_focused_view_for_navigation)
|
||||
return nullptr;
|
||||
|
||||
return m_focused_view_for_navigation;
|
||||
}
|
||||
|
||||
void DockManager::onFocusedDockWidgetChanged(KDDockWidgets::QtWidgets::DockWidget* widget)
|
||||
{
|
||||
DebuggerView* view = qobject_cast<DebuggerView*>(widget->widget());
|
||||
if (view && view->supportsNavigation() && view != m_focused_view_for_navigation)
|
||||
{
|
||||
m_focused_view_for_navigation = view;
|
||||
emit focusedViewForNavigationChanged();
|
||||
}
|
||||
}
|
||||
|
||||
KDDockWidgets::Core::DockWidget* DockManager::dockWidgetFactory(const QString& name)
|
||||
{
|
||||
if (!g_debugger_window)
|
||||
|
||||
@@ -98,6 +98,14 @@ public:
|
||||
|
||||
std::optional<BreakPointCpu> cpu();
|
||||
|
||||
/// Returns the last focused view that supports back/forward navigation.
|
||||
DebuggerView* focusedViewForNavigation();
|
||||
|
||||
void onFocusedDockWidgetChanged(KDDockWidgets::QtWidgets::DockWidget* widget);
|
||||
|
||||
Q_SIGNALS:
|
||||
void focusedViewForNavigationChanged();
|
||||
|
||||
private:
|
||||
static KDDockWidgets::Core::DockWidget* dockWidgetFactory(const QString& name);
|
||||
static bool dragAboutToStart(KDDockWidgets::Core::Draggable* draggable);
|
||||
@@ -108,4 +116,6 @@ private:
|
||||
DockMenuBar* m_menu_bar = nullptr;
|
||||
|
||||
bool m_layout_locked = true;
|
||||
|
||||
QPointer<DebuggerView> m_focused_view_for_navigation;
|
||||
};
|
||||
|
||||
@@ -82,6 +82,7 @@ const std::vector<DockTables::DefaultDockLayout> DockTables::DEFAULT_DOCK_LAYOUT
|
||||
{"MemorySearchView", DefaultDockGroup::TOP_LEFT},
|
||||
},
|
||||
.toolbars = {
|
||||
"toolBarNavigation",
|
||||
"toolBarDebug",
|
||||
"toolBarFile",
|
||||
},
|
||||
@@ -113,6 +114,7 @@ const std::vector<DockTables::DefaultDockLayout> DockTables::DEFAULT_DOCK_LAYOUT
|
||||
{"MemorySearchView", DefaultDockGroup::TOP_LEFT},
|
||||
},
|
||||
.toolbars = {
|
||||
"toolBarNavigation",
|
||||
"toolBarDebug",
|
||||
"toolBarFile",
|
||||
},
|
||||
|
||||
@@ -82,6 +82,7 @@ DockWidget::DockWidget(
|
||||
: KDDockWidgets::QtWidgets::DockWidget(unique_name, options, layout_saver_options, window_flags)
|
||||
{
|
||||
connect(this, &DockWidget::isOpenChanged, this, &DockWidget::openStateChanged);
|
||||
connect(this, &DockWidget::isFocusedChanged, this, &DockWidget::focusStateChanged);
|
||||
}
|
||||
|
||||
void DockWidget::openStateChanged(bool open)
|
||||
@@ -95,6 +96,12 @@ void DockWidget::openStateChanged(bool open)
|
||||
g_debugger_window->dockManager().destroyDebuggerView(uniqueName());
|
||||
}
|
||||
|
||||
void DockWidget::focusStateChanged(bool focused)
|
||||
{
|
||||
if (focused && g_debugger_window)
|
||||
g_debugger_window->dockManager().onFocusedDockWidgetChanged(this);
|
||||
}
|
||||
|
||||
// *****************************************************************************
|
||||
|
||||
DockTitleBar::DockTitleBar(KDDockWidgets::Core::TitleBar* controller, KDDockWidgets::Core::View* parent)
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
|
||||
protected:
|
||||
void openStateChanged(bool open);
|
||||
void focusStateChanged(bool focused);
|
||||
};
|
||||
|
||||
class DockTitleBar : public KDDockWidgets::QtWidgets::TitleBar
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -19,7 +25,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>nameEditor</cstring>
|
||||
@@ -29,7 +35,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="cpuLabel">
|
||||
<property name="text">
|
||||
<string>Target</string>
|
||||
<string>Target:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cpuEditor</cstring>
|
||||
@@ -39,7 +45,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="initialStateLabel">
|
||||
<property name="text">
|
||||
<string>Initial State</string>
|
||||
<string>Initial State:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>initialStateEditor</cstring>
|
||||
|
||||
@@ -19,9 +19,11 @@ using namespace QtUtils;
|
||||
/*
|
||||
MemoryViewTable
|
||||
*/
|
||||
void MemoryViewTable::UpdateStartAddress(u32 start)
|
||||
void MemoryViewTable::UpdateStartAddress(u32 start, NavigationHistoryOperation history_operation)
|
||||
{
|
||||
startAddress = start & ~0xF;
|
||||
navigation_history.push(startAddress, history_operation);
|
||||
parent->update();
|
||||
}
|
||||
|
||||
void MemoryViewTable::UpdateSelectedAddress(u32 selected, bool page)
|
||||
@@ -41,6 +43,13 @@ void MemoryViewTable::UpdateSelectedAddress(u32 selected, bool page)
|
||||
else
|
||||
startAddress += 0x10;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
navigation_history.pushWithDelay(startAddress);
|
||||
parent->update();
|
||||
}
|
||||
|
||||
void MemoryViewTable::DrawTable(QPainter& painter, const QPalette& palette, s32 height, DebugInterface& cpu)
|
||||
@@ -684,7 +693,7 @@ MemoryView::MemoryView(const DebuggerViewParameters& parameters)
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, &MemoryView::customContextMenuRequested, this, &MemoryView::openContextMenu);
|
||||
|
||||
m_table.UpdateStartAddress(0x100000);
|
||||
m_table.UpdateStartAddress(0x100000, NavigationHistoryOperation::INSTANT_PUSH);
|
||||
|
||||
receiveEvent<DebuggerEvents::Refresh>([this](const DebuggerEvents::Refresh& event) -> bool {
|
||||
update();
|
||||
@@ -723,7 +732,10 @@ bool MemoryView::fromJson(const JsonValueWrapper& json)
|
||||
|
||||
auto start_address = json.value().FindMember("startAddress");
|
||||
if (start_address != json.value().MemberEnd() && start_address->value.IsUint())
|
||||
m_table.UpdateStartAddress(start_address->value.GetUint());
|
||||
{
|
||||
m_table.navigation_history.clear();
|
||||
m_table.UpdateStartAddress(start_address->value.GetUint(), NavigationHistoryOperation::INSTANT_PUSH);
|
||||
}
|
||||
|
||||
auto view_type = json.value().FindMember("viewType");
|
||||
if (view_type != json.value().MemberEnd() && view_type->value.IsInt())
|
||||
@@ -746,6 +758,40 @@ bool MemoryView::fromJson(const JsonValueWrapper& json)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemoryView::supportsNavigation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemoryView::canNavigateBack()
|
||||
{
|
||||
return m_table.navigation_history.canGoBack();
|
||||
}
|
||||
|
||||
bool MemoryView::canNavigateForward()
|
||||
{
|
||||
return m_table.navigation_history.canGoForward();
|
||||
}
|
||||
|
||||
void MemoryView::navigateBack()
|
||||
{
|
||||
std::optional<u32> address = m_table.navigation_history.back();
|
||||
if (!address.has_value())
|
||||
return;
|
||||
|
||||
m_table.UpdateStartAddress(*address, NavigationHistoryOperation::NO_PUSH);
|
||||
}
|
||||
|
||||
void MemoryView::navigateForward()
|
||||
{
|
||||
std::optional<u32> address = m_table.navigation_history.forward();
|
||||
if (!address.has_value())
|
||||
return;
|
||||
|
||||
m_table.UpdateStartAddress(*address, NavigationHistoryOperation::NO_PUSH);
|
||||
}
|
||||
|
||||
|
||||
void MemoryView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
@@ -928,17 +974,20 @@ void MemoryView::wheelEvent(QWheelEvent* event)
|
||||
{
|
||||
if (event->angleDelta().y() < 0)
|
||||
{
|
||||
m_table.UpdateStartAddress(m_table.startAddress + 0x10);
|
||||
m_table.UpdateStartAddress(m_table.startAddress + 0x10, NavigationHistoryOperation::DELAYED_PUSH);
|
||||
}
|
||||
else if (event->angleDelta().y() > 0)
|
||||
{
|
||||
m_table.UpdateStartAddress(m_table.startAddress - 0x10);
|
||||
m_table.UpdateStartAddress(m_table.startAddress - 0x10, NavigationHistoryOperation::DELAYED_PUSH);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void MemoryView::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
// Alt is used for the global navigation shortcuts.
|
||||
if (event->modifiers() & Qt::AltModifier)
|
||||
return;
|
||||
|
||||
if (!m_table.KeyPress(event->key(), event->text().size() ? event->text()[0] : '\0', cpu()))
|
||||
{
|
||||
switch (event->key())
|
||||
@@ -960,9 +1009,8 @@ void MemoryView::keyPressEvent(QKeyEvent* event)
|
||||
|
||||
void MemoryView::gotoAddress(u32 address)
|
||||
{
|
||||
m_table.UpdateStartAddress(address & ~0xF);
|
||||
m_table.UpdateStartAddress(address & ~0xF, NavigationHistoryOperation::INSTANT_PUSH);
|
||||
m_table.selectedAddress = address;
|
||||
update();
|
||||
setFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "ui_MemoryView.h"
|
||||
|
||||
#include "Debugger/DebuggerView.h"
|
||||
#include "Debugger/NavigationHistoryStack.h"
|
||||
|
||||
#include "DebugTools/DebugInterface.h"
|
||||
#include "DebugTools/DisassemblyManager.h"
|
||||
@@ -93,7 +94,9 @@ public:
|
||||
u32 selectedAddress = 0;
|
||||
s32 selectedIndex = 0;
|
||||
|
||||
void UpdateStartAddress(u32 start);
|
||||
NavigationHistoryStack<u32> navigation_history;
|
||||
|
||||
void UpdateStartAddress(u32 start, NavigationHistoryOperation history_operation);
|
||||
void UpdateSelectedAddress(u32 selected, bool page = false);
|
||||
void DrawTable(QPainter& painter, const QPalette& palette, s32 height, DebugInterface& cpu);
|
||||
void SelectAt(QPoint pos);
|
||||
@@ -136,6 +139,12 @@ public:
|
||||
void toJson(JsonValueWrapper& json) override;
|
||||
bool fromJson(const JsonValueWrapper& json) override;
|
||||
|
||||
bool supportsNavigation() override;
|
||||
bool canNavigateBack() override;
|
||||
bool canNavigateForward() override;
|
||||
void navigateBack() override;
|
||||
void navigateForward() override;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
// SPDX-FileCopyrightText: 2002-2026 PCSX2 Dev Team
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Debugger/DebuggerWindow.h"
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <deque>
|
||||
|
||||
enum class NavigationHistoryOperation
|
||||
{
|
||||
INSTANT_PUSH,
|
||||
DELAYED_PUSH,
|
||||
NO_PUSH
|
||||
};
|
||||
|
||||
/// Data structure for storing navigation history, to be used for the back and
|
||||
/// forward buttons.
|
||||
template <typename Element>
|
||||
class NavigationHistoryStack
|
||||
{
|
||||
public:
|
||||
NavigationHistoryStack()
|
||||
: m_position(m_elements.end())
|
||||
{
|
||||
m_timer.setInterval(DELAY_MILLISECONDS);
|
||||
|
||||
QObject::connect(&m_timer, &QTimer::timeout, [this]() {
|
||||
pushInstantly(std::move(m_pending));
|
||||
m_timer.stop();
|
||||
});
|
||||
}
|
||||
|
||||
NavigationHistoryStack(Element element)
|
||||
: NavigationHistoryStack()
|
||||
{
|
||||
pushInstantly(std::move(element));
|
||||
}
|
||||
|
||||
NavigationHistoryStack(const NavigationHistoryStack<Element>&) = delete;
|
||||
NavigationHistoryStack<Element>& operator=(const NavigationHistoryStack<Element>&) = delete;
|
||||
|
||||
NavigationHistoryStack(NavigationHistoryStack<Element>&&) = delete;
|
||||
NavigationHistoryStack<Element>& operator=(NavigationHistoryStack<Element>&&) = delete;
|
||||
|
||||
/// Push an element onto the stack.
|
||||
void push(Element element, NavigationHistoryOperation operation)
|
||||
{
|
||||
switch (operation)
|
||||
{
|
||||
case NavigationHistoryOperation::INSTANT_PUSH:
|
||||
pushInstantly(std::move(element));
|
||||
break;
|
||||
case NavigationHistoryOperation::DELAYED_PUSH:
|
||||
pushWithDelay(std::move(element));
|
||||
break;
|
||||
case NavigationHistoryOperation::NO_PUSH:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// Wait a second, and then push an element onto the stack. If another
|
||||
/// element is pushed, then that will take priority. This is useful if we're
|
||||
/// storing a scroll position, and don't want the stack to be spammed with
|
||||
/// new values when the user scrolls, for example.
|
||||
void pushWithDelay(Element element)
|
||||
{
|
||||
m_pending = std::move(element);
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
/// Push an element onto the stack instantly.
|
||||
void pushInstantly(Element element)
|
||||
{
|
||||
m_timer.stop();
|
||||
|
||||
if (m_position != m_elements.end() && element == *(m_position - 1))
|
||||
return;
|
||||
|
||||
updateNavigationButtons();
|
||||
|
||||
m_elements.erase(m_position, m_elements.end());
|
||||
m_elements.push_back(std::move(element));
|
||||
|
||||
if (m_elements.size() > MAX_ELEMENTS)
|
||||
m_elements.pop_front();
|
||||
|
||||
m_position = m_elements.end();
|
||||
}
|
||||
|
||||
/// Should to user have an option to go back?
|
||||
bool canGoBack() const
|
||||
{
|
||||
return m_elements.begin() != m_elements.end() && m_position > m_elements.begin() + 1;
|
||||
}
|
||||
|
||||
/// Should the user have an option to go forward?
|
||||
bool canGoForward() const
|
||||
{
|
||||
return m_position != m_elements.end();
|
||||
}
|
||||
|
||||
// Retrieve the current element.
|
||||
std::optional<Element> current() const
|
||||
{
|
||||
if (m_position == m_elements.begin())
|
||||
return std::nullopt;
|
||||
|
||||
return *(m_position - 1);
|
||||
}
|
||||
|
||||
/// Go back one.
|
||||
std::optional<Element> back()
|
||||
{
|
||||
updateNavigationButtons();
|
||||
|
||||
if (!canGoBack())
|
||||
return std::nullopt;
|
||||
|
||||
m_position--;
|
||||
return *(m_position - 1);
|
||||
}
|
||||
|
||||
/// Go forward one.
|
||||
std::optional<Element> forward()
|
||||
{
|
||||
updateNavigationButtons();
|
||||
|
||||
if (!canGoForward())
|
||||
return std::nullopt;
|
||||
|
||||
Element element = *m_position;
|
||||
m_position++;
|
||||
return element;
|
||||
}
|
||||
|
||||
/// Remove all elements.
|
||||
void clear()
|
||||
{
|
||||
m_elements.clear();
|
||||
m_position = m_elements.end();
|
||||
m_timer.stop();
|
||||
}
|
||||
|
||||
private:
|
||||
void updateNavigationButtons()
|
||||
{
|
||||
QTimer::singleShot(0, []() {
|
||||
if (g_debugger_window)
|
||||
g_debugger_window->updateNavigationButtons();
|
||||
});
|
||||
}
|
||||
|
||||
std::deque<Element> m_elements;
|
||||
std::deque<Element>::iterator m_position;
|
||||
|
||||
QTimer m_timer;
|
||||
Element m_pending;
|
||||
|
||||
static constexpr int DELAY_MILLISECONDS = 1000;
|
||||
static constexpr size_t MAX_ELEMENTS = 1000;
|
||||
};
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Debugger/SymbolTree/SymbolTreeModel.h"
|
||||
#include "Debugger/SymbolTree/TypeString.h"
|
||||
|
||||
#include "common/StringUtil.h"
|
||||
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtWidgets/QDoubleSpinBox>
|
||||
@@ -44,12 +46,28 @@ QWidget* SymbolTreeValueDelegate::createEditor(QWidget* parent, const QStyleOpti
|
||||
const ccc::ast::Node& physical_type = *logical_type->physical_type(database).first;
|
||||
QVariant value = node->readValueAsVariant(physical_type, m_cpu, database);
|
||||
|
||||
const ccc::ast::Node& type = *logical_type->physical_type(database).first;
|
||||
switch (type.descriptor)
|
||||
switch (physical_type.descriptor)
|
||||
{
|
||||
case ccc::ast::ARRAY:
|
||||
{
|
||||
const ccc::ast::Array& array = physical_type.as<ccc::ast::Array>();
|
||||
const ccc::ast::Node& element_type = *array.element_type->physical_type(database).first;;
|
||||
|
||||
if (array.element_count > 0 &&
|
||||
element_type.name == "char" &&
|
||||
node->location.type == SymbolTreeLocation::MEMORY &&
|
||||
!value.isNull())
|
||||
{
|
||||
QLineEdit* editor = new QLineEdit(parent);
|
||||
editor->setText(value.toString());
|
||||
result = editor;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ccc::ast::BUILTIN:
|
||||
{
|
||||
const ccc::ast::BuiltIn& builtin = type.as<ccc::ast::BuiltIn>();
|
||||
const ccc::ast::BuiltIn& builtin = physical_type.as<ccc::ast::BuiltIn>();
|
||||
|
||||
switch (builtin.bclass)
|
||||
{
|
||||
@@ -111,7 +129,7 @@ QWidget* SymbolTreeValueDelegate::createEditor(QWidget* parent, const QStyleOpti
|
||||
}
|
||||
case ccc::ast::ENUM:
|
||||
{
|
||||
const ccc::ast::Enum& enumeration = type.as<ccc::ast::Enum>();
|
||||
const ccc::ast::Enum& enumeration = physical_type.as<ccc::ast::Enum>();
|
||||
|
||||
QComboBox* combo_box = new QComboBox(parent);
|
||||
bool named = false;
|
||||
@@ -186,12 +204,30 @@ void SymbolTreeValueDelegate::setModelData(QWidget* editor, QAbstractItemModel*
|
||||
if (!logical_type)
|
||||
return;
|
||||
|
||||
const ccc::ast::Node& type = *logical_type->physical_type(database).first;
|
||||
switch (type.descriptor)
|
||||
const ccc::ast::Node& physical_type = *logical_type->physical_type(database).first;
|
||||
|
||||
switch (physical_type.descriptor)
|
||||
{
|
||||
case ccc::ast::ARRAY:
|
||||
{
|
||||
const ccc::ast::Array& array = physical_type.as<ccc::ast::Array>();
|
||||
const ccc::ast::Node& element_type = *array.element_type->physical_type(database).first;
|
||||
|
||||
QLineEdit* line_edit = qobject_cast<QLineEdit*>(editor);
|
||||
|
||||
if (array.element_count > 0 &&
|
||||
element_type.name == "char" &&
|
||||
node->location.type == SymbolTreeLocation::MEMORY &&
|
||||
line_edit)
|
||||
{
|
||||
value = line_edit->text();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ccc::ast::BUILTIN:
|
||||
{
|
||||
const ccc::ast::BuiltIn& builtin = type.as<ccc::ast::BuiltIn>();
|
||||
const ccc::ast::BuiltIn& builtin = physical_type.as<ccc::ast::BuiltIn>();
|
||||
|
||||
switch (builtin.bclass)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ bool SymbolTreeNode::writeToVM(
|
||||
if (logical_type)
|
||||
{
|
||||
const ccc::ast::Node& physical_type = *logical_type->physical_type(database).first;
|
||||
writeValueFromVariant(m_value, physical_type, cpu);
|
||||
writeValueFromVariant(m_value, physical_type, cpu, database);
|
||||
}
|
||||
|
||||
data_changed |= updateDisplayString(cpu, database, display_options);
|
||||
@@ -76,10 +76,29 @@ bool SymbolTreeNode::writeToVM(
|
||||
return data_changed;
|
||||
}
|
||||
|
||||
QVariant SymbolTreeNode::readValueAsVariant(const ccc::ast::Node& physical_type, DebugInterface& cpu, const ccc::SymbolDatabase& database) const
|
||||
QVariant SymbolTreeNode::readValueAsVariant(
|
||||
const ccc::ast::Node& physical_type,
|
||||
DebugInterface& cpu,
|
||||
const ccc::SymbolDatabase& database) const
|
||||
{
|
||||
switch (physical_type.descriptor)
|
||||
{
|
||||
case ccc::ast::ARRAY:
|
||||
{
|
||||
const ccc::ast::Array& array = physical_type.as<ccc::ast::Array>();
|
||||
const ccc::ast::Node& element_type = *array.element_type->physical_type(database).first;
|
||||
|
||||
if (array.element_count > 0 &&
|
||||
element_type.name == "char" &&
|
||||
location.type == SymbolTreeLocation::MEMORY)
|
||||
{
|
||||
std::optional<std::string> string = cpu.ReadString(location.address, 256);
|
||||
if (string.has_value())
|
||||
return QString::fromStdString(*string);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ccc::ast::BUILTIN:
|
||||
{
|
||||
const ccc::ast::BuiltIn& builtIn = physical_type.as<ccc::ast::BuiltIn>();
|
||||
@@ -134,10 +153,36 @@ QVariant SymbolTreeNode::readValueAsVariant(const ccc::ast::Node& physical_type,
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool SymbolTreeNode::writeValueFromVariant(QVariant value, const ccc::ast::Node& physical_type, DebugInterface& cpu) const
|
||||
bool SymbolTreeNode::writeValueFromVariant(
|
||||
QVariant value,
|
||||
const ccc::ast::Node& physical_type,
|
||||
DebugInterface& cpu,
|
||||
const ccc::SymbolDatabase& database) const
|
||||
{
|
||||
if (value.isNull())
|
||||
return false;
|
||||
|
||||
switch (physical_type.descriptor)
|
||||
{
|
||||
case ccc::ast::ARRAY:
|
||||
{
|
||||
const ccc::ast::Array& array = physical_type.as<ccc::ast::Array>();
|
||||
const ccc::ast::Node& element_type = *array.element_type->physical_type(database).first;
|
||||
|
||||
if (array.element_count > 0 &&
|
||||
element_type.name == "char" &&
|
||||
location.type == SymbolTreeLocation::MEMORY)
|
||||
{
|
||||
QByteArray byte_array = value.toString().toLatin1();
|
||||
std::string_view view(
|
||||
byte_array.data(),
|
||||
std::min(static_cast<s32>(byte_array.size()), array.element_count - 1));
|
||||
cpu.WriteString(location.address, view);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
case ccc::ast::BUILTIN:
|
||||
{
|
||||
const ccc::ast::BuiltIn& built_in = physical_type.as<ccc::ast::BuiltIn>();
|
||||
@@ -191,6 +236,7 @@ bool SymbolTreeNode::writeValueFromVariant(QVariant value, const ccc::ast::Node&
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ccc::ast::ENUM:
|
||||
@@ -266,11 +312,14 @@ QString SymbolTreeNode::generateDisplayString(
|
||||
const ccc::ast::Array& array = physical_type.as<ccc::ast::Array>();
|
||||
const ccc::ast::Node& element_type = *array.element_type->physical_type(database).first;
|
||||
|
||||
if (element_type.name == "char" && location.type == SymbolTreeLocation::MEMORY)
|
||||
if (array.element_count > 0 &&
|
||||
element_type.name == "char" &&
|
||||
location.type == SymbolTreeLocation::MEMORY)
|
||||
{
|
||||
char* string = cpu.stringFromPointer(location.address);
|
||||
if (string)
|
||||
return QString("\"%1\"").arg(string);
|
||||
std::optional<std::string> string = cpu.ReadString(
|
||||
location.address, 256, MemoryInterface::ALLOW_LONG_STRINGS);
|
||||
if (string.has_value())
|
||||
return QString("\"%1\"").arg(*string);
|
||||
}
|
||||
|
||||
QString result;
|
||||
@@ -412,9 +461,10 @@ QString SymbolTreeNode::generateDisplayString(
|
||||
|
||||
if (pointer_or_reference.is_pointer && value_type.name == "char")
|
||||
{
|
||||
const char* string = cpu.stringFromPointer(address);
|
||||
if (string)
|
||||
result += QString(" \"%1\"").arg(string);
|
||||
std::optional<std::string> string = cpu.ReadString(
|
||||
address, 256, MemoryInterface::ALLOW_LONG_STRINGS);
|
||||
if (string.has_value())
|
||||
result += QString(" \"%1\"").arg(*string);
|
||||
}
|
||||
else if (depth == 0)
|
||||
{
|
||||
|
||||
@@ -62,11 +62,20 @@ public:
|
||||
const ccc::SymbolDatabase& database,
|
||||
const SymbolTreeDisplayOptions& display_options);
|
||||
|
||||
QVariant readValueAsVariant(const ccc::ast::Node& physical_type, DebugInterface& cpu, const ccc::SymbolDatabase& database) const;
|
||||
bool writeValueFromVariant(QVariant value, const ccc::ast::Node& physical_type, DebugInterface& cpu) const;
|
||||
QVariant readValueAsVariant(
|
||||
const ccc::ast::Node& physical_type,
|
||||
DebugInterface& cpu,
|
||||
const ccc::SymbolDatabase& database) const;
|
||||
|
||||
bool writeValueFromVariant(
|
||||
QVariant value,
|
||||
const ccc::ast::Node& physical_type,
|
||||
DebugInterface& cpu,
|
||||
const ccc::SymbolDatabase& database) const;
|
||||
|
||||
bool updateDisplayString(
|
||||
DebugInterface& cpu, const ccc::SymbolDatabase& database, const SymbolTreeDisplayOptions& display);
|
||||
|
||||
QString generateDisplayString(
|
||||
const ccc::ast::Node& physical_type,
|
||||
DebugInterface& cpu,
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
#include "QtUtils.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QtGlobal>
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QStandardPaths>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QDesktopServices>
|
||||
#include <QtGui/QIcon>
|
||||
@@ -15,6 +17,7 @@
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QInputDialog>
|
||||
@@ -27,21 +30,35 @@
|
||||
#include <QtWidgets/QTableView>
|
||||
#include <QtWidgets/QTreeView>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <QtGui/private/qtx11extras_p.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <map>
|
||||
|
||||
#include "common/CocoaTools.h"
|
||||
#include "common/Console.h"
|
||||
#include "common/FileSystem.h"
|
||||
#include "common/Path.h"
|
||||
#include "common/StringUtil.h"
|
||||
#include "pcsx2/Config.h"
|
||||
#include "QtHost.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "common/RedtapeWindows.h"
|
||||
#include "common/RedtapeWilCom.h"
|
||||
#include <Shlobj.h>
|
||||
#include <shobjidl.h>
|
||||
#include <comdef.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
namespace QtUtils
|
||||
@@ -549,4 +566,453 @@ namespace QtUtils
|
||||
const QString flag_path = QStringLiteral("%1/icons/flags/%2.svg").arg(QtHost::GetResourcesBasePath()).arg(country_code.toLower());
|
||||
return QIcon(flag_path);
|
||||
}
|
||||
|
||||
bool IsRunningInFlatpak()
|
||||
{
|
||||
// Checks for the existence of the `.flatpak-info` file which seems to be always present inside flatpak sandboxes.
|
||||
return FileSystem::FileExists("/.flatpak-info");
|
||||
}
|
||||
|
||||
bool IsRunningInAppImage()
|
||||
{
|
||||
// The AppImage runtime sets APPIMAGE environment variable so we can check for that.
|
||||
return std::getenv("APPIMAGE") != nullptr;
|
||||
}
|
||||
|
||||
void CreateShortcut(QWidget* parent, const std::string& name, const std::string& game_path,
|
||||
std::vector<std::string> passed_cli_args, const std::string& custom_args,
|
||||
const std::string& icon_path, bool is_desktop, bool prompt_for_destination)
|
||||
{
|
||||
const auto tr_msg = [](const char* str) {
|
||||
return QCoreApplication::translate("CreateShortcut", str);
|
||||
};
|
||||
|
||||
#if defined(_WIN32)
|
||||
if (name.empty())
|
||||
{
|
||||
Console.Error("Cannot create shortcuts without a name.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Sanitize filename
|
||||
const std::string clean_name = Path::SanitizeFileName(name);
|
||||
std::string clean_path = game_path.empty() ? std::string() : Path::ToNativePath(Path::RealPath(game_path));
|
||||
if (!Path::IsValidFileName(clean_name))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Filename contains illegal character."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get path to Desktop or per-user Start Menu\Programs directory
|
||||
// https://superuser.com/questions/1489874/how-can-i-get-the-real-path-of-desktop-in-windows-explorer/1789849#1789849
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
|
||||
// https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid
|
||||
std::string link_file;
|
||||
if (wil::unique_cotaskmem_string directory; SUCCEEDED(SHGetKnownFolderPath(is_desktop ? FOLDERID_Desktop : FOLDERID_Programs, 0, NULL, &directory)))
|
||||
{
|
||||
std::string directory_utf8 = StringUtil::WideStringToUTF8String(directory.get());
|
||||
|
||||
if (is_desktop)
|
||||
link_file = Path::ToNativePath(fmt::format("{}/{}.lnk", directory_utf8, clean_name));
|
||||
else
|
||||
{
|
||||
const std::string pcsx2_start_menu_dir = Path::ToNativePath(fmt::format("{}/PCSX2", directory_utf8));
|
||||
if (!FileSystem::EnsureDirectoryExists(pcsx2_start_menu_dir.c_str(), false))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Could not create start menu directory."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
link_file = Path::ToNativePath(fmt::format("{}/{}.lnk", pcsx2_start_menu_dir, clean_name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), is_desktop ? tr_msg("'Desktop' directory not found") : tr_msg("User's 'Start Menu\\Programs' directory not found"), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the same shortcut already exists
|
||||
if (prompt_for_destination && FileSystem::FileExists(link_file.c_str()))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("A shortcut with the same name already exists."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Shortcut CmdLine Args
|
||||
bool lossless = true;
|
||||
for (std::string& arg : passed_cli_args)
|
||||
lossless &= EscapeShortcutCommandLine(&arg);
|
||||
if (!clean_path.empty())
|
||||
lossless &= EscapeShortcutCommandLine(&clean_path);
|
||||
|
||||
if (!lossless)
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("File path contains invalid character(s)."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string final_args = StringUtil::JoinString(passed_cli_args.begin(), passed_cli_args.end(), " ");
|
||||
if (!custom_args.empty())
|
||||
{
|
||||
if (!final_args.empty())
|
||||
final_args += ' ';
|
||||
final_args += custom_args;
|
||||
}
|
||||
if (!clean_path.empty())
|
||||
{
|
||||
if (!final_args.empty())
|
||||
final_args += ' ';
|
||||
final_args += fmt::format("-- {}", clean_path);
|
||||
}
|
||||
|
||||
Console.WriteLnFmt("Creating a shortcut '{}' with arguments '{}'", link_file, final_args);
|
||||
|
||||
const auto str_error = [](HRESULT hr) -> std::string {
|
||||
_com_error err(hr);
|
||||
const TCHAR* errMsg = err.ErrorMessage();
|
||||
return fmt::format("{} [{}]", StringUtil::WideStringToUTF8String(errMsg), hr);
|
||||
};
|
||||
|
||||
// Construct the shortcut
|
||||
// https://stackoverflow.com/questions/3906974/how-to-programmatically-create-a-shortcut-using-win32
|
||||
HRESULT res = CoInitialize(NULL);
|
||||
if (FAILED(res))
|
||||
{
|
||||
Console.ErrorFmt("Failed to create shortcut: CoInitialize failed ({})", str_error(res));
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("CoInitialize failed (%1)").arg(QString::fromStdString(str_error(res))), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
wil::unique_couninitialize_call co_cleanup;
|
||||
|
||||
const auto report_error = [&](const QString& reason) {
|
||||
Console.ErrorFmt("Failed to create shortcut: {}", reason.toStdString());
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), reason, QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
};
|
||||
|
||||
wil::com_ptr_nothrow<IShellLink> pShellLink = wil::CoCreateInstanceNoThrow<IShellLink>(CLSID_ShellLink);
|
||||
wil::com_ptr_nothrow<IPersistFile> pPersistFile;
|
||||
|
||||
if (!pShellLink)
|
||||
{
|
||||
report_error(tr_msg("CoCreateInstance failed"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set path to the executable
|
||||
const std::wstring target_file = StringUtil::UTF8StringToWideString(FileSystem::GetProgramPath());
|
||||
res = pShellLink->SetPath(target_file.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("SetPath failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the working directory
|
||||
const std::wstring working_dir = StringUtil::UTF8StringToWideString(Path::GetDirectory(FileSystem::GetProgramPath()));
|
||||
res = pShellLink->SetWorkingDirectory(working_dir.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("SetWorkingDirectory failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the description (shown as the shortcut's tooltip)
|
||||
const std::wstring description = tr_msg("PlayStation 2 Emulator").toStdWString();
|
||||
res = pShellLink->SetDescription(description.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("SetDescription failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the launch arguments
|
||||
if (!final_args.empty())
|
||||
{
|
||||
const std::wstring target_cli_args = StringUtil::UTF8StringToWideString(final_args);
|
||||
res = pShellLink->SetArguments(target_cli_args.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("SetArguments failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon
|
||||
std::string final_icon_path;
|
||||
if (!icon_path.empty())
|
||||
{
|
||||
final_icon_path = Path::ToNativePath(icon_path);
|
||||
if (!FileSystem::FileExists(final_icon_path.c_str()))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("The selected icon file does not exist."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final_icon_path = Path::ToNativePath(Path::Combine(Path::GetDirectory(FileSystem::GetProgramPath()), "resources/icons/AppIconLarge.ico"));
|
||||
}
|
||||
|
||||
const std::wstring w_icon_path = StringUtil::UTF8StringToWideString(final_icon_path);
|
||||
res = pShellLink->SetIconLocation(w_icon_path.c_str(), 0);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("SetIconLocation failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Use the IPersistFile object to save the shell link
|
||||
res = pShellLink.query_to(&pPersistFile);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("QueryInterface failed (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
// Save shortcut link to disk
|
||||
const std::wstring w_link_file = StringUtil::UTF8StringToWideString(link_file);
|
||||
res = pPersistFile->Save(w_link_file.c_str(), TRUE);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr_msg("Failed to save the shortcut (%1)").arg(QString::fromStdString(str_error(res))));
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Cannot create a shortcut without a title."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
const bool is_flatpak = IsRunningInFlatpak();
|
||||
|
||||
// Sanitize filename and game path
|
||||
const std::string clean_name = Path::SanitizeFileName(name);
|
||||
std::string clean_path = game_path.empty() ? std::string() : Path::Canonicalize(Path::RealPath(game_path));
|
||||
if (!Path::IsValidFileName(clean_name))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Filename contains illegal character."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the executable path
|
||||
std::string executable_path = FileSystem::GetPackagePath();
|
||||
if (executable_path.empty())
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Executable path is empty."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the destination directory
|
||||
const QString link_dir = QStandardPaths::writableLocation(is_desktop ? QStandardPaths::DesktopLocation : QStandardPaths::ApplicationsLocation);
|
||||
if (link_dir.isEmpty())
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Could not determine the shortcut destination directory."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
const std::string link_path = fmt::format("{}/{}.desktop", link_dir.toStdString(), clean_name);
|
||||
|
||||
std::string icon_name;
|
||||
if (!icon_path.empty())
|
||||
{
|
||||
if (!FileSystem::FileExists(icon_path.c_str()))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("The selected icon file does not exist."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
icon_name = icon_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_flatpak) // Flatpak
|
||||
{
|
||||
executable_path = "flatpak run net.pcsx2.PCSX2";
|
||||
icon_name = "net.pcsx2.PCSX2";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy PCSX2 icon
|
||||
icon_name = "PCSX2";
|
||||
const std::string icon_dest = fmt::format("{}/icons/hicolor/512x512/apps/", QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).toStdString());
|
||||
const std::string icon_path_dest = fmt::format("{}/{}.png", icon_dest, icon_name);
|
||||
if (FileSystem::EnsureDirectoryExists(icon_dest.c_str(), true))
|
||||
FileSystem::CopyFilePath(Path::Combine(EmuFolders::Resources, "icons/AppIconLarge.png").c_str(), icon_path_dest.c_str(), true);
|
||||
}
|
||||
}
|
||||
|
||||
// Shortcut CmdLine Args
|
||||
bool lossless = true;
|
||||
for (std::string& arg : passed_cli_args)
|
||||
lossless &= EscapeShortcutCommandLine(&arg);
|
||||
if (!is_flatpak)
|
||||
lossless &= EscapeShortcutCommandLine(&executable_path);
|
||||
if (!clean_path.empty())
|
||||
lossless &= EscapeShortcutCommandLine(&clean_path);
|
||||
|
||||
if (!lossless)
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("File path contains invalid character(s)."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string cmdline = StringUtil::JoinString(passed_cli_args.begin(), passed_cli_args.end(), " ");
|
||||
|
||||
// Assembling the .desktop file
|
||||
std::string final_args = executable_path;
|
||||
if (!cmdline.empty())
|
||||
final_args += fmt::format(" {}", cmdline);
|
||||
if (!custom_args.empty())
|
||||
final_args += fmt::format(" {}", custom_args);
|
||||
if (!clean_path.empty())
|
||||
final_args += fmt::format(" -- {}", clean_path);
|
||||
std::string file_content =
|
||||
"[Desktop Entry]\n"
|
||||
"Version=1.0\n"
|
||||
"Type=Application\n"
|
||||
"Terminal=false\n"
|
||||
"StartupWMClass=pcsx2-qt\n"
|
||||
"Exec=" +
|
||||
final_args + "\n" +
|
||||
"Name=" +
|
||||
name + "\n" +
|
||||
"GenericName=PlayStation 2 Emulator\n"
|
||||
"Icon=" +
|
||||
icon_name + "\n" +
|
||||
"Comment=Sony PlayStation 2 Emulator\n"
|
||||
"Keywords=game;emulator;\n"
|
||||
"Categories=Game;Emulator;\n";
|
||||
std::string_view sv(file_content);
|
||||
|
||||
QString final_path = QString::fromStdString(link_path);
|
||||
if (prompt_for_destination)
|
||||
{
|
||||
const QString filter(tr_msg("Desktop Shortcut Files (*.desktop)"));
|
||||
final_path = QDir::toNativeSeparators(QFileDialog::getSaveFileName(parent, tr_msg("Select Shortcut Save Destination"), final_path, filter));
|
||||
if (final_path.isEmpty())
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::string link_dir(Path::GetDirectory(link_path));
|
||||
if (!link_dir.empty() && !FileSystem::EnsureDirectoryExists(link_dir.c_str(), true))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Could not create the shortcut directory."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Write to .desktop file
|
||||
if (!FileSystem::WriteStringToFile(final_path.toStdString().c_str(), sv))
|
||||
{
|
||||
QMessageBox::critical(parent, tr_msg("Failed to create shortcut"), tr_msg("Failed to create .desktop file"), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (chmod(final_path.toStdString().c_str(), S_IRWXU) != 0) // enables user to execute file
|
||||
Console.ErrorFmt("Failed to change file permissions for .desktop file: {} ({})", strerror(errno), errno);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool EscapeShortcutCommandLine(std::string* arg)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (!arg->empty() && arg->find_first_of(" \t\n\v\"") == std::string::npos)
|
||||
return true;
|
||||
|
||||
std::string temp;
|
||||
temp.reserve(arg->length() + 10);
|
||||
temp += '"';
|
||||
|
||||
for (auto it = arg->begin();; ++it)
|
||||
{
|
||||
int backslash_count = 0;
|
||||
while (it != arg->end() && *it == '\\')
|
||||
{
|
||||
++it;
|
||||
++backslash_count;
|
||||
}
|
||||
|
||||
if (it == arg->end())
|
||||
{
|
||||
temp.append(backslash_count * 2, '\\');
|
||||
break;
|
||||
}
|
||||
|
||||
if (*it == '"')
|
||||
{
|
||||
temp.append(backslash_count * 2 + 1, '\\');
|
||||
temp += '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.append(backslash_count, '\\');
|
||||
temp += *it;
|
||||
}
|
||||
}
|
||||
|
||||
temp += '"';
|
||||
*arg = std::move(temp);
|
||||
return true;
|
||||
#else
|
||||
const char* carg = arg->c_str();
|
||||
const char* cend = carg + arg->size();
|
||||
const char* RESERVED_CHARS = " \t\n\\\"'\\\\><~|%&;$*?#()`"
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0d\x0e\x0f"
|
||||
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f";
|
||||
const char* next = carg + std::strcspn(carg, RESERVED_CHARS);
|
||||
|
||||
if (next == cend)
|
||||
return true; // No escaping needed, don't modify
|
||||
|
||||
bool lossless = true;
|
||||
std::string temp = "\"";
|
||||
const char* NOT_VALID_IN_QUOTE = "%`$\"\\\n"
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0d\x0e\x0f"
|
||||
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f";
|
||||
|
||||
while (true)
|
||||
{
|
||||
next = carg + std::strcspn(carg, NOT_VALID_IN_QUOTE);
|
||||
temp.append(carg, next);
|
||||
carg = next;
|
||||
|
||||
if (carg == cend)
|
||||
break;
|
||||
|
||||
switch (*carg)
|
||||
{
|
||||
case '"':
|
||||
case '`':
|
||||
temp.push_back('\\');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
case '\\':
|
||||
temp.append("\\\\\\\\");
|
||||
break;
|
||||
case '$':
|
||||
temp.push_back('\\');
|
||||
temp.push_back('\\');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
case '%':
|
||||
temp.push_back('%');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
default:
|
||||
temp.push_back(' ');
|
||||
lossless = false;
|
||||
break;
|
||||
}
|
||||
++carg;
|
||||
}
|
||||
|
||||
temp.push_back('"');
|
||||
*arg = std::move(temp);
|
||||
return lossless;
|
||||
#endif
|
||||
}
|
||||
} // namespace QtUtils
|
||||
|
||||
@@ -17,9 +17,11 @@
|
||||
#include <QtGui/QScreen>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "common/Console.h"
|
||||
|
||||
@@ -209,4 +211,19 @@ namespace QtUtils
|
||||
/// Gets a flag icon for a given language code
|
||||
/// Returns an empty QIcon if no flag is available for the language
|
||||
QIcon GetFlagIconForLanguage(const QString& language_code);
|
||||
|
||||
/// Returns true if PCSX2 is running inside a Flatpak sandbox.
|
||||
bool IsRunningInFlatpak();
|
||||
|
||||
/// Returns true if PCSX2 is running from an AppImage.
|
||||
bool IsRunningInAppImage();
|
||||
|
||||
/// Creates a desktop or launcher (Start Menu / applications) shortcuts
|
||||
void CreateShortcut(QWidget* parent, const std::string& name, const std::string& game_path,
|
||||
std::vector<std::string> passed_cli_args, const std::string& custom_args,
|
||||
const std::string& icon_path, bool is_desktop, bool prompt_for_destination = true);
|
||||
|
||||
/// Escapes the given string for use as a shortcut command line argument.
|
||||
/// Returns whether the escaping operation was lossless.
|
||||
bool EscapeShortcutCommandLine(std::string* arg);
|
||||
} // namespace QtUtils
|
||||
|
||||
@@ -365,7 +365,6 @@
|
||||
<tabstop>gsDumpCompression</tabstop>
|
||||
<tabstop>texturePreloading</tabstop>
|
||||
<tabstop>exclusiveFullscreenControl</tabstop>
|
||||
<tabstop>rov</tabstop>
|
||||
<tabstop>extendedUpscales</tabstop>
|
||||
<tabstop>spinGPUDuringReadbacks</tabstop>
|
||||
<tabstop>spinCPUDuringReadbacks</tabstop>
|
||||
|
||||
@@ -88,6 +88,11 @@ void SetupWizardDialog::nextPage()
|
||||
const int current_page = m_ui.pages->currentIndex();
|
||||
if (current_page == Page_Complete)
|
||||
{
|
||||
if (m_ui.createDesktopShortcut->isChecked())
|
||||
QtUtils::CreateShortcut(this, "PCSX2", std::string(), {}, std::string(), std::string(), true, false);
|
||||
if (m_ui.addToApplicationMenu->isChecked())
|
||||
QtUtils::CreateShortcut(this, "PCSX2", std::string(), {}, std::string(), std::string(), false, false);
|
||||
|
||||
accept();
|
||||
return;
|
||||
}
|
||||
@@ -177,6 +182,7 @@ void SetupWizardDialog::setupUi()
|
||||
setupGameListPage();
|
||||
setupControllerPage();
|
||||
setupRetroAchievementsPage();
|
||||
setupCompletePage();
|
||||
}
|
||||
|
||||
void SetupWizardDialog::setupLanguagePage()
|
||||
@@ -435,6 +441,22 @@ void SetupWizardDialog::setupRetroAchievementsPage()
|
||||
refreshRetroAchievementsLoginState();
|
||||
}
|
||||
|
||||
void SetupWizardDialog::setupCompletePage()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
const bool can_create_shortcuts = true;
|
||||
m_ui.addToApplicationMenu->setText(tr("Add PCSX2 to the Start Menu"));
|
||||
#elif defined(__linux__)
|
||||
// Only offer shortcuts for the AppImage since Flatpak creates its own launcher, and
|
||||
// third-party builds (AUR, COPR, etc.) ship their own .desktop file.
|
||||
const bool can_create_shortcuts = QtUtils::IsRunningInAppImage();
|
||||
#else
|
||||
const bool can_create_shortcuts = false;
|
||||
#endif
|
||||
m_ui.createDesktopShortcut->setVisible(can_create_shortcuts);
|
||||
m_ui.addToApplicationMenu->setVisible(can_create_shortcuts);
|
||||
}
|
||||
|
||||
void SetupWizardDialog::refreshRetroAchievementsLoginState()
|
||||
{
|
||||
const std::string username(Host::GetBaseStringSettingValue("Achievements", "Username"));
|
||||
|
||||
@@ -66,6 +66,7 @@ private:
|
||||
void setupGameListPage();
|
||||
void setupControllerPage();
|
||||
void setupRetroAchievementsPage();
|
||||
void setupCompletePage();
|
||||
void refreshRetroAchievementsLoginState();
|
||||
|
||||
void pageChangedTo(int page);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="pagesLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="logo">
|
||||
<property name="sizePolicy">
|
||||
@@ -61,7 +61,6 @@
|
||||
<widget class="QLabel" name="labelLanguage">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -127,7 +126,7 @@
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<widget class="QWidget" name="SetupWizardPages">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
@@ -145,7 +144,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="IntroLabel">
|
||||
<property name="text">
|
||||
<string><html><head/><body><h1 style=" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:700;">Welcome to PCSX2!</span></h1><p>This wizard will help guide you through the configuration steps required to use the application. It is recommended if this is your first time installing PCSX2 that you view the setup guide <a href="https://pcsx2.net/docs/">here</a>.</p><p>By default, PCSX2 will connect to the server at <a href="https://pcsx2.net/">pcsx2.net</a> to check for updates, and if available and confirmed, download update packages from <a href="https://github.com/">github.com</a>. If you do not wish for PCSX2 to make any network connections on startup, you should uncheck the Automatic Updates option now. The Automatic Update setting can be changed later at any time in Interface Settings.</p><p>Please choose a language and theme to begin.</p></body></html></string>
|
||||
</property>
|
||||
@@ -164,7 +163,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<layout class="QFormLayout" name="languageLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="languageLabel">
|
||||
<property name="text">
|
||||
@@ -222,7 +221,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<widget class="QWidget" name="pageBios">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@@ -237,7 +236,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<widget class="QLabel" name="biosIntro">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>PCSX2 requires a PS2 BIOS in order to run.</p><p>For legal reasons, you must obtain a BIOS <strong>from an actual PS2 unit that you own</strong> (borrowing doesn't count).</p><p>Once dumped, this BIOS image should be placed in the bios folder within the data directory shown below, or you can instruct PCSX2 to scan an alternative directory.</p><p>A guide for dumping your BIOS can be found <a href="https://pcsx2.net/docs/setup/bios/">here</a>.</p></body></html></string>
|
||||
</property>
|
||||
@@ -256,7 +255,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<layout class="QHBoxLayout" name="biosPathLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="biosSearchDirectoryLabel">
|
||||
<property name="text">
|
||||
@@ -310,7 +309,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QHBoxLayout" name="biosActions">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
@@ -342,7 +341,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_3">
|
||||
<widget class="QWidget" name="pageDumps">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@@ -357,7 +356,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<widget class="QLabel" name="dumpsIntro">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>PCSX2 will automatically scan and identify games from the selected directories below, and populate the game list.<br>These games should be dumped from discs you own. Guides for dumping discs can be found <a href="https://pcsx2.net/docs/setup/dumping">here</a>.</p><p>Supported formats for dumps include:</p><p><ul><li>.bin/.iso (ISO Disc Images)</li><li>.mdf (Media Descriptor File)</li><li>.chd (Compressed Hunks of Data)</li><li>.cso (Compressed ISO)</li><li>.zso (Compressed ISO)</li><li>.gz (Gzip Compressed ISO)</li></ul></p></p></body></html></string>
|
||||
</property>
|
||||
@@ -376,7 +375,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QHBoxLayout" name="dumpsLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="searchDirectoryListLabel">
|
||||
<property name="text">
|
||||
@@ -474,7 +473,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<widget class="QLabel" name="controllerIntro">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>By default, PCSX2 will map your keyboard to the virtual PS2 controller.</p><p><span style=" font-weight:704;">To use an external controller, you must map it first. </span>On this screen, you can automatically map any controller which is currently connected. If your controller is not currently connected, you can plug it in now.</p><p>To change controller bindings in more detail, or use multi-tap, open the Settings menu and choose Controllers once you have completed the Setup Wizard.</p><p>Guides for configuring controllers can be found <a href="https://pcsx2.net/docs/post/controllers/"><span style="">here</span></a>.</p></body></html></string>
|
||||
</property>
|
||||
@@ -487,7 +486,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<widget class="QGroupBox" name="controller1Group">
|
||||
<property name="title">
|
||||
<string>Controller Port 1</string>
|
||||
</property>
|
||||
@@ -496,14 +495,14 @@
|
||||
<widget class="QComboBox" name="controller1Type"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<widget class="QLabel" name="controllerMappedLabel">
|
||||
<property name="text">
|
||||
<string>Controller Mapped To:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<widget class="QLabel" name="controller1Label">
|
||||
<property name="text">
|
||||
<string>Controller Type:</string>
|
||||
</property>
|
||||
@@ -513,12 +512,15 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<layout class="QHBoxLayout" name="controller1MappingLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="controller1Mapping">
|
||||
<property name="text">
|
||||
<string>Default (Keyboard)</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>controller1Type</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -554,13 +556,13 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<widget class="QGroupBox" name="controller2Group">
|
||||
<property name="title">
|
||||
<string>Controller Port 2</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<widget class="QLabel" name="controller2Label">
|
||||
<property name="text">
|
||||
<string>Controller Type:</string>
|
||||
</property>
|
||||
@@ -573,19 +575,22 @@
|
||||
<widget class="QComboBox" name="controller2Type"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<widget class="QLabel" name="controller2MappedLabel">
|
||||
<property name="text">
|
||||
<string>Controller Mapped To:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<layout class="QHBoxLayout" name="controller2MappingLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="controller2Mapping">
|
||||
<property name="text">
|
||||
<string>Default (Keyboard)</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>controller2Type</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -653,7 +658,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<layout class="QHBoxLayout" name="raLogoLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="raLogo">
|
||||
<property name="sizePolicy">
|
||||
@@ -736,6 +741,9 @@
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>raEnableAchievements</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -885,7 +893,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_5">
|
||||
<widget class="QWidget" name="pageComplete">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@@ -900,7 +908,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<widget class="QLabel" name="completeIntro">
|
||||
<property name="text">
|
||||
<string><html><head/><body><h1 style=" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:700;">Setup Complete!</span></h1><p>You are now ready to run games.</p><p><span style=" font-weight:700;">Warning: Do not run untrusted programs in PCSX2. It is not a sandbox and cannot protect your computer from malicious software.</span></p><p>Further options are available under the settings menu. You can also use the Big Picture UI for navigation entirely with a gamepad.</p><p>We hope you enjoy using PCSX2.</p></body></html></string>
|
||||
</property>
|
||||
@@ -912,12 +920,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="createDesktopShortcut">
|
||||
<property name="text">
|
||||
<string>Create Desktop shortcut</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="addToApplicationMenu">
|
||||
<property name="text">
|
||||
<string>Add PCSX2 to the Application Menu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="navigationLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
|
||||
@@ -3,23 +3,14 @@
|
||||
|
||||
#include "ShortcutCreationDialog.h"
|
||||
#include "QtHost.h"
|
||||
#include <fmt/format.h>
|
||||
#include "QtUtils.h"
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include "common/Console.h"
|
||||
#include "common/FileSystem.h"
|
||||
#include "common/Path.h"
|
||||
#include "common/StringUtil.h"
|
||||
#include "VMManager.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "common/RedtapeWilCom.h"
|
||||
#include <shlobj.h>
|
||||
#include <shobjidl.h>
|
||||
#include <comdef.h>
|
||||
#endif
|
||||
|
||||
ShortcutCreationDialog::ShortcutCreationDialog(QWidget* parent, const QString& title, const QString& path)
|
||||
: QDialog(parent)
|
||||
, m_title(title)
|
||||
@@ -100,7 +91,7 @@ ShortcutCreationDialog::ShortcutCreationDialog(QWidget* parent, const QString& t
|
||||
m_ui.resetIconButton->setEnabled(false);
|
||||
});
|
||||
|
||||
if (std::getenv("container"))
|
||||
if (QtUtils::IsRunningInFlatpak())
|
||||
{
|
||||
m_ui.portableModeToggle->setEnabled(false);
|
||||
m_ui.shortcutDesktop->setEnabled(false);
|
||||
@@ -108,7 +99,7 @@ ShortcutCreationDialog::ShortcutCreationDialog(QWidget* parent, const QString& t
|
||||
}
|
||||
|
||||
connect(m_ui.dialogButtons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
connect(m_ui.dialogButtons, &QDialogButtonBox::accepted, this, [&]() {
|
||||
connect(m_ui.dialogButtons, &QDialogButtonBox::accepted, this, [this]() {
|
||||
std::vector<std::string> args;
|
||||
|
||||
if (m_ui.portableModeToggle->isChecked())
|
||||
@@ -162,430 +153,10 @@ ShortcutCreationDialog::ShortcutCreationDialog(QWidget* parent, const QString& t
|
||||
std::string custom_args = m_ui.customArgsInput->text().toStdString();
|
||||
std::string icon_path = m_ui.iconPath->text().toStdString();
|
||||
|
||||
ShortcutCreationDialog::CreateShortcut(title.toStdString(), path.toStdString(), args, custom_args, icon_path, m_ui.shortcutDesktop->isChecked());
|
||||
QtUtils::CreateShortcut(this, m_title.toStdString(), m_path.toStdString(), std::move(args), custom_args, icon_path, m_ui.shortcutDesktop->isChecked());
|
||||
|
||||
accept();
|
||||
});
|
||||
}
|
||||
|
||||
void ShortcutCreationDialog::CreateShortcut(const std::string name, const std::string game_path, std::vector<std::string> passed_cli_args, std::string custom_args, const std::string icon_path, bool is_desktop)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if (name.empty())
|
||||
{
|
||||
Console.Error("Cannot create shortcuts without a name.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Sanitize filename
|
||||
const std::string clean_name = Path::SanitizeFileName(name).c_str();
|
||||
std::string clean_path = Path::ToNativePath(Path::RealPath(game_path)).c_str();
|
||||
if (!Path::IsValidFileName(clean_name))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Filename contains illegal character."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get path to Desktop or per-user Start Menu\Programs directory
|
||||
// https://superuser.com/questions/1489874/how-can-i-get-the-real-path-of-desktop-in-windows-explorer/1789849#1789849
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
|
||||
// https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid
|
||||
std::string link_file;
|
||||
if (wil::unique_cotaskmem_string directory; SUCCEEDED(SHGetKnownFolderPath(is_desktop ? FOLDERID_Desktop : FOLDERID_Programs, 0, NULL, &directory)))
|
||||
{
|
||||
std::string directory_utf8 = StringUtil::WideStringToUTF8String(directory.get());
|
||||
|
||||
if (is_desktop)
|
||||
link_file = Path::ToNativePath(fmt::format("{}/{}.lnk", directory_utf8, clean_name));
|
||||
else
|
||||
{
|
||||
const std::string pcsx2_start_menu_dir = Path::ToNativePath(fmt::format("{}/PCSX2", directory_utf8));
|
||||
if (!FileSystem::EnsureDirectoryExists(pcsx2_start_menu_dir.c_str(), false))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Could not create start menu directory."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
link_file = Path::ToNativePath(fmt::format("{}/{}.lnk", pcsx2_start_menu_dir, clean_name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), is_desktop ? tr("'Desktop' directory not found") : tr("User's 'Start Menu\\Programs' directory not found"), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the same shortcut already exists
|
||||
if (FileSystem::FileExists(link_file.c_str()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("A shortcut with the same name already exists."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Shortcut CmdLine Args
|
||||
bool lossless = true;
|
||||
for (std::string& arg : passed_cli_args)
|
||||
lossless &= ShortcutCreationDialog::EscapeShortcutCommandLine(&arg);
|
||||
|
||||
if (!lossless)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("File path contains invalid character(s)."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
ShortcutCreationDialog::EscapeShortcutCommandLine(&clean_path);
|
||||
std::string combined_args = StringUtil::JoinString(passed_cli_args.begin(), passed_cli_args.end(), " ");
|
||||
std::string final_args = fmt::format("{} {} -- {}", combined_args, custom_args, clean_path);
|
||||
|
||||
Console.WriteLnFmt("Creating a shortcut '{}' with arguments '{}'", link_file, final_args);
|
||||
|
||||
const auto str_error = [](HRESULT hr) -> std::string {
|
||||
_com_error err(hr);
|
||||
const TCHAR* errMsg = err.ErrorMessage();
|
||||
return fmt::format("{} [{}]", StringUtil::WideStringToUTF8String(errMsg), hr);
|
||||
};
|
||||
|
||||
// Construct the shortcut
|
||||
// https://stackoverflow.com/questions/3906974/how-to-programmatically-create-a-shortcut-using-win32
|
||||
HRESULT res = CoInitialize(NULL);
|
||||
if (FAILED(res))
|
||||
{
|
||||
Console.ErrorFmt("Failed to create shortcut: CoInitialize failed ({})", str_error(res));
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("CoInitialize failed (%1)").arg(str_error(res)), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
wil::unique_couninitialize_call co_cleanup;
|
||||
|
||||
const auto report_error = [&](const QString& reason) {
|
||||
Console.ErrorFmt("Failed to create shortcut: {}", reason.toStdString());
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), reason, QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
};
|
||||
|
||||
wil::com_ptr_nothrow<IShellLink> pShellLink = wil::CoCreateInstanceNoThrow<IShellLink>(CLSID_ShellLink);
|
||||
wil::com_ptr_nothrow<IPersistFile> pPersistFile;
|
||||
|
||||
if (!pShellLink)
|
||||
{
|
||||
report_error(tr("CoCreateInstance failed"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set path to the executable
|
||||
const std::wstring target_file = StringUtil::UTF8StringToWideString(FileSystem::GetProgramPath());
|
||||
res = pShellLink->SetPath(target_file.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("SetPath failed (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the working directory
|
||||
const std::wstring working_dir = StringUtil::UTF8StringToWideString(FileSystem::GetWorkingDirectory());
|
||||
res = pShellLink->SetWorkingDirectory(working_dir.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("SetWorkingDirectory failed (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the launch arguments
|
||||
if (!final_args.empty())
|
||||
{
|
||||
const std::wstring target_cli_args = StringUtil::UTF8StringToWideString(final_args);
|
||||
res = pShellLink->SetArguments(target_cli_args.c_str());
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("SetArguments failed (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon
|
||||
std::string final_icon_path;
|
||||
if (!icon_path.empty())
|
||||
{
|
||||
final_icon_path = Path::ToNativePath(icon_path);
|
||||
if (!FileSystem::FileExists(final_icon_path.c_str()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("The selected icon file does not exist."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final_icon_path = Path::ToNativePath(Path::Combine(Path::GetDirectory(FileSystem::GetProgramPath()), "resources/icons/AppIconLarge.ico"));
|
||||
}
|
||||
|
||||
const std::wstring w_icon_path = StringUtil::UTF8StringToWideString(final_icon_path);
|
||||
res = pShellLink->SetIconLocation(w_icon_path.c_str(), 0);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("SetIconLocation failed (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Use the IPersistFile object to save the shell link
|
||||
res = pShellLink.query_to(&pPersistFile);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("QueryInterface failed (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Save shortcut link to disk
|
||||
const std::wstring w_link_file = StringUtil::UTF8StringToWideString(link_file);
|
||||
res = pPersistFile->Save(w_link_file.c_str(), TRUE);
|
||||
if (FAILED(res))
|
||||
{
|
||||
report_error(tr("Failed to save the shortcut (%1)").arg(str_error(res)));
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Cannot create a shortcut without a title."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_flatpak = (std::getenv("container"));
|
||||
|
||||
// Sanitize filename and game path
|
||||
const std::string clean_name = Path::SanitizeFileName(name);
|
||||
std::string clean_path = Path::Canonicalize(Path::RealPath(game_path));
|
||||
if (!Path::IsValidFileName(clean_name))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Filename contains illegal character."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the executable path
|
||||
std::string executable_path = FileSystem::GetPackagePath();
|
||||
if (executable_path.empty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Executable path is empty."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find home directory
|
||||
std::string link_path;
|
||||
const char* home = std::getenv("HOME");
|
||||
const char* xdg_desktop_dir = std::getenv("XDG_DESKTOP_DIR");
|
||||
const char* xdg_data_home = std::getenv("XDG_DATA_HOME");
|
||||
if (home)
|
||||
{
|
||||
if (is_desktop)
|
||||
{
|
||||
if (xdg_desktop_dir)
|
||||
link_path = fmt::format("{}/{}.desktop", xdg_desktop_dir, clean_name);
|
||||
else
|
||||
link_path = fmt::format("{}/Desktop/{}.desktop", home, clean_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xdg_data_home)
|
||||
link_path = fmt::format("{}/applications/{}.desktop", xdg_data_home, clean_name);
|
||||
else
|
||||
link_path = fmt::format("{}/.local/share/applications/{}.desktop", home, clean_name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Path to the Home directory is empty."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string icon_name;
|
||||
if (!icon_path.empty())
|
||||
{
|
||||
if (!FileSystem::FileExists(icon_path.c_str()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("The selected icon file does not exist."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
icon_name = icon_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy PCSX2 icon
|
||||
std::string icon_dest;
|
||||
if (xdg_data_home)
|
||||
icon_dest = fmt::format("{}/icons/hicolor/512x512/apps/", xdg_data_home);
|
||||
else
|
||||
icon_dest = fmt::format("{}/.local/share/icons/hicolor/512x512/apps/", home);
|
||||
|
||||
if (is_flatpak) // Flatpak
|
||||
{
|
||||
executable_path = "flatpak run net.pcsx2.PCSX2";
|
||||
icon_name = "net.pcsx2.PCSX2";
|
||||
}
|
||||
else
|
||||
{
|
||||
icon_name = "PCSX2";
|
||||
std::string icon_path_dest = fmt::format("{}/{}.png", icon_dest, icon_name).c_str();
|
||||
if (FileSystem::EnsureDirectoryExists(icon_dest.c_str(), true))
|
||||
if (!FileSystem::FileExists(icon_path_dest.c_str()))
|
||||
FileSystem::CopyFilePath(Path::Combine(EmuFolders::Resources, "icons/AppIconLarge.png").c_str(), icon_path_dest.c_str(), false);
|
||||
}
|
||||
}
|
||||
|
||||
// Shortcut CmdLine Args
|
||||
bool lossless = true;
|
||||
for (std::string& arg : passed_cli_args)
|
||||
lossless &= ShortcutCreationDialog::EscapeShortcutCommandLine(&arg);
|
||||
|
||||
if (!lossless)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("File path contains invalid character(s)."), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string cmdline = StringUtil::JoinString(passed_cli_args.begin(), passed_cli_args.end(), " ");
|
||||
|
||||
// Further string sanitization
|
||||
if (!is_flatpak)
|
||||
ShortcutCreationDialog::EscapeShortcutCommandLine(&executable_path);
|
||||
ShortcutCreationDialog::EscapeShortcutCommandLine(&clean_path);
|
||||
|
||||
// Assembling the .desktop file
|
||||
std::string final_args;
|
||||
final_args = fmt::format("{} {} {} -- {}", executable_path, cmdline, custom_args, clean_path);
|
||||
std::string file_content =
|
||||
"[Desktop Entry]\n"
|
||||
"Encoding=UTF-8\n"
|
||||
"Version=1.0\n"
|
||||
"Type=Application\n"
|
||||
"Terminal=false\n"
|
||||
"StartupWMClass=PCSX2\n"
|
||||
"Exec=" +
|
||||
final_args + "\n" +
|
||||
"Name=" +
|
||||
clean_name + "\n" +
|
||||
"Icon=" +
|
||||
icon_name + "\n" +
|
||||
"Categories=Game;Emulator;\n";
|
||||
std::string_view sv(file_content);
|
||||
|
||||
// Prompt user for shortcut saving destination
|
||||
QString final_path(QStringLiteral("%1").arg(QString::fromStdString(link_path)));
|
||||
const QString filter(tr("Desktop Shortcut Files (*.desktop)"));
|
||||
|
||||
final_path = QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Select Shortcut Save Destination"), final_path, filter));
|
||||
|
||||
if (final_path.isEmpty())
|
||||
return;
|
||||
|
||||
// Write to .desktop file
|
||||
if (!FileSystem::WriteStringToFile(final_path.toStdString().c_str(), sv))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Failed to create shortcut"), tr("Failed to create .desktop file"), QMessageBox::StandardButton::Ok, QMessageBox::StandardButton::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (chmod(final_path.toStdString().c_str(), S_IRWXU) != 0) // enables user to execute file
|
||||
Console.ErrorFmt("Failed to change file permissions for .desktop file: {} ({})", strerror(errno), errno);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ShortcutCreationDialog::EscapeShortcutCommandLine(std::string* arg)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (!arg->empty() && arg->find_first_of(" \t\n\v\"") == std::string::npos)
|
||||
return true;
|
||||
|
||||
std::string temp;
|
||||
temp.reserve(arg->length() + 10);
|
||||
temp += '"';
|
||||
|
||||
for (auto it = arg->begin();; ++it)
|
||||
{
|
||||
int backslash_count = 0;
|
||||
while (it != arg->end() && *it == '\\')
|
||||
{
|
||||
++it;
|
||||
++backslash_count;
|
||||
}
|
||||
|
||||
if (it == arg->end())
|
||||
{
|
||||
temp.append(backslash_count * 2, '\\');
|
||||
break;
|
||||
}
|
||||
|
||||
if (*it == '"')
|
||||
{
|
||||
temp.append(backslash_count * 2 + 1, '\\');
|
||||
temp += '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.append(backslash_count, '\\');
|
||||
temp += *it;
|
||||
}
|
||||
}
|
||||
|
||||
temp += '"';
|
||||
*arg = std::move(temp);
|
||||
return true;
|
||||
#else
|
||||
const char* carg = arg->c_str();
|
||||
const char* cend = carg + arg->size();
|
||||
const char* RESERVED_CHARS = " \t\n\\\"'\\\\><~|%&;$*?#()`"
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0d\x0e\x0f"
|
||||
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f";
|
||||
const char* next = carg + std::strcspn(carg, RESERVED_CHARS);
|
||||
|
||||
if (next == cend)
|
||||
return true; // No escaping needed, don't modify
|
||||
|
||||
bool lossless = true;
|
||||
std::string temp = "\"";
|
||||
const char* NOT_VALID_IN_QUOTE = "%`$\"\\\n"
|
||||
"\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0d\x0e\x0f"
|
||||
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f";
|
||||
|
||||
while (true)
|
||||
{
|
||||
next = carg + std::strcspn(carg, NOT_VALID_IN_QUOTE);
|
||||
temp.append(carg, next);
|
||||
carg = next;
|
||||
|
||||
if (carg == cend)
|
||||
break;
|
||||
|
||||
switch (*carg)
|
||||
{
|
||||
case '"':
|
||||
case '`':
|
||||
temp.push_back('\\');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
case '\\':
|
||||
temp.append("\\\\\\\\");
|
||||
break;
|
||||
case '$':
|
||||
temp.push_back('\\');
|
||||
temp.push_back('\\');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
case '%':
|
||||
temp.push_back('%');
|
||||
temp.push_back(*carg);
|
||||
break;
|
||||
default:
|
||||
temp.push_back(' ');
|
||||
lossless = false;
|
||||
break;
|
||||
}
|
||||
++carg;
|
||||
}
|
||||
|
||||
temp.push_back('"');
|
||||
*arg = std::move(temp);
|
||||
return lossless;
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_ShortcutCreationDialog.cpp"
|
||||
|
||||
@@ -14,13 +14,6 @@ public:
|
||||
ShortcutCreationDialog(QWidget* parent, const QString& title, const QString& path);
|
||||
~ShortcutCreationDialog() = default;
|
||||
|
||||
/// Create desktop shortcut for games
|
||||
void CreateShortcut(const std::string name, const std::string game_path, std::vector<std::string> passed_cli_args, std::string custom_args, const std::string icon_path, bool is_desktop);
|
||||
|
||||
/// Escapes the given string for use with command line arguments.
|
||||
/// Returns a bool that indicates whether the escaping operation are lossless or not.
|
||||
bool EscapeShortcutCommandLine(std::string* cmdline);
|
||||
|
||||
protected:
|
||||
const QString m_title;
|
||||
const QString m_path;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -246,6 +246,7 @@
|
||||
<QtMoc Include="Debugger\StackView.h" />
|
||||
<QtMoc Include="Debugger\ModuleModel.h" />
|
||||
<QtMoc Include="Debugger\ModuleView.h" />
|
||||
<QtMoc Include="Debugger\NavigationHistoryStack.h" />
|
||||
<QtMoc Include="Debugger\ThreadModel.h" />
|
||||
<QtMoc Include="Debugger\ThreadView.h" />
|
||||
<ClInclude Include="Debugger\DebuggerSettingsManager.h" />
|
||||
|
||||
@@ -529,6 +529,9 @@
|
||||
<QtMoc Include="Debugger\ModuleView.h">
|
||||
<Filter>Debugger</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="Debugger\NavigationHistoryStack.h">
|
||||
<Filter>Debugger</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="Debugger\ModuleModel.h">
|
||||
<Filter>Debugger</Filter>
|
||||
</QtMoc>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 222 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 222 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"><path d="M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 222 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"><path d="M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 222 B |
@@ -2,12 +2,14 @@
|
||||
<qresource>
|
||||
<file>icons/AppIcon64.png</file>
|
||||
<file>icons/black/index.theme</file>
|
||||
<file>icons/black/svg/arrow-left-line.svg</file>
|
||||
<file>icons/black/svg/arrow-left-right-line.svg</file>
|
||||
<file>icons/black/svg/arrow-right-line.svg</file>
|
||||
<file>icons/black/svg/artboard-2-line.svg</file>
|
||||
<file>icons/black/svg/at.svg</file>
|
||||
<file>icons/black/svg/band-aid-line.svg</file>
|
||||
<file>icons/black/svg/booklet.svg</file>
|
||||
<file>icons/black/svg/book.svg</file>
|
||||
<file>icons/black/svg/booklet.svg</file>
|
||||
<file>icons/black/svg/brush-line.svg</file>
|
||||
<file>icons/black/svg/bug-line.svg</file>
|
||||
<file>icons/black/svg/buzz-controller-line.svg</file>
|
||||
@@ -113,12 +115,14 @@
|
||||
<file>icons/QT.png</file>
|
||||
<file>icons/update.png</file>
|
||||
<file>icons/white/index.theme</file>
|
||||
<file>icons/white/svg/arrow-left-line.svg</file>
|
||||
<file>icons/white/svg/arrow-left-right-line.svg</file>
|
||||
<file>icons/white/svg/arrow-right-line.svg</file>
|
||||
<file>icons/white/svg/artboard-2-line.svg</file>
|
||||
<file>icons/white/svg/at.svg</file>
|
||||
<file>icons/white/svg/band-aid-line.svg</file>
|
||||
<file>icons/white/svg/booklet.svg</file>
|
||||
<file>icons/white/svg/book.svg</file>
|
||||
<file>icons/white/svg/booklet.svg</file>
|
||||
<file>icons/white/svg/brush-line.svg</file>
|
||||
<file>icons/white/svg/bug-line.svg</file>
|
||||
<file>icons/white/svg/buzz-controller-line.svg</file>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user