mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
748f232976 | ||
|
|
a33612cf7d | ||
|
|
5c123f3183 | ||
|
|
d30a7fb991 | ||
|
|
d4f661c27c | ||
|
|
6d05d0220d | ||
|
|
7fab935c2d | ||
|
|
cd120c3cfd | ||
|
|
0180ec060b |
@ -17,7 +17,7 @@ jobs:
|
||||
run: ./.github/workflows/scripts/common/update_base_translation.sh
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: "Qt: Update Base Translation"
|
||||
commit-message: "[ci skip] Qt: Update Base Translation."
|
||||
|
||||
@ -19,7 +19,7 @@ jobs:
|
||||
mv ./game_controller_db.txt ${{github.workspace}}/bin/resources/game_controller_db.txt
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
|
||||
with:
|
||||
title: "PAD: Update to latest controller database"
|
||||
commit-message: "[ci skip] PAD: Update to latest controller database."
|
||||
|
||||
2
.github/workflows/linux_build_flatpak.yml
vendored
2
.github/workflows/linux_build_flatpak.yml
vendored
@ -153,7 +153,7 @@ jobs:
|
||||
mv "./${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak" "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: ci-artifacts
|
||||
|
||||
6
.github/workflows/linux_build_qt.yml
vendored
6
.github/workflows/linux_build_qt.yml
vendored
@ -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@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
@ -114,7 +114,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh', '.github/workflows/scripts/common/*.patch') }}
|
||||
@ -174,7 +174,7 @@ jobs:
|
||||
|
||||
- name: Upload artifact
|
||||
if: inputs.buildAppImage == true
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: ci-artifacts
|
||||
|
||||
6
.github/workflows/macos_build.yml
vendored
6
.github/workflows/macos_build.yml
vendored
@ -91,7 +91,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/macos/*', '.github/workflows/scripts/common/*.patch') }}
|
||||
@ -112,7 +112,7 @@ jobs:
|
||||
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache ccache cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
@ -197,7 +197,7 @@ jobs:
|
||||
cp "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.xz" ci-artifacts/macOS.tar.xz
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: "*.tar.xz"
|
||||
|
||||
2
.github/workflows/release_cut_new.yml
vendored
2
.github/workflows/release_cut_new.yml
vendored
@ -168,7 +168,7 @@ jobs:
|
||||
- name: Prepare Artifact Folder
|
||||
run: mkdir ./ci-artifacts/
|
||||
|
||||
- uses: actions/download-artifact@v6
|
||||
- uses: actions/download-artifact@v7
|
||||
name: Download all Artifacts
|
||||
with:
|
||||
path: ./ci-artifacts/
|
||||
|
||||
6
.github/workflows/windows_build_qt.yml
vendored
6
.github/workflows/windows_build_qt.yml
vendored
@ -115,7 +115,7 @@ jobs:
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat', '.github/workflows/scripts/common/*.patch') }}
|
||||
@ -154,7 +154,7 @@ jobs:
|
||||
cmake --build build --config Release --target unittests
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: |
|
||||
@ -186,7 +186,7 @@ jobs:
|
||||
}
|
||||
|
||||
- name: Upload artifact - with symbols
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
|
||||
path: |
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
03000000c82d00001230000000000000,8BitDo Ultimate,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001260000000000000,8BitDo Ultimate 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001b30000000000000,8BitDo Ultimate 2C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001c30000000000000,8BitDo Ultimate 2C,a:b0,b:b1,x:b3,y:b4,back:b10,guide:b12,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b8,righttrigger:b9,paddle1:b2,paddle2:b5,platform:Windows,
|
||||
03000000c82d00001c30000000000000,8BitDo Ultimate 2C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001d30000000000000,8BitDo Ultimate 2C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001530000000000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
03000000c82d00001630000000000000,8BitDo Ultimate C,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
|
||||
@ -985,6 +985,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X,
|
||||
03000000242f00002d00000007010000,JYS Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
|
||||
030000006d04000019c2000000000000,Logitech Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d04000019c2000000020000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
@ -993,7 +994,6 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d0400001fc2000000000000,Logitech F710,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
|
||||
030000006d04000018c2000000010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
030000006d04000019c2000000020000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
03000000380700005032000000010000,Mad Catz PS3 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
03000000380700008433000000010000,Mad Catz PS3 Fightstick TE S Plus,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
|
||||
03000000380700005082000000010000,Mad Catz PS4 Fightpad Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Mac OS X,
|
||||
@ -1395,6 +1395,10 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
03000000242e00008816000001010000,Hyperkin X91,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
|
||||
03000000f00300008d03000011010000,HyperX Clutch,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||
03000000830500006020000010010000,iBuffalo Super Famicom Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
|
||||
03000000d80400004bea000011010000,icedragon.io STAC Dance Pad,a:b0,b:b1,x:b2,y:b3,back:b4,platform:Linux,
|
||||
03000000d80400004aea000011010000,icedragon.io STAC Dance Pad,a:b0,b:b1,x:b2,y:b3,back:b4,platform:Linux,
|
||||
030000008a2e0000d910000011010000,icedragon.io STAC2 Dance Pad,a:b0,b:b1,x:b2,y:b3,back:b4,platform:Linux,
|
||||
030000008a2e0000e910000011010000,icedragon.io STAC2 Dance Pad,a:b8,b:b9,x:b10,y:b11,back:b12,platform:Linux,
|
||||
030000008f0e00001330000001010000,iCode Retro Adapter,b:b3,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b1,start:b7,x:b2,y:b0,platform:Linux,
|
||||
050000006964726f69643a636f6e0000,idroidcon Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000b50700001503000010010000,Impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
|
||||
@ -1591,6 +1595,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000250900000017000010010000,PS/SS/N64 Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b5,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2~,righty:a3,start:b8,platform:Linux,
|
||||
03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
|
||||
03000000120c0000160e000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
|
||||
030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
|
||||
030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
|
||||
@ -1701,7 +1706,6 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
03000000952e00004e43000011010000,Scuf Envision,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Linux,
|
||||
03000000a30c00002500000011010000,Sega Genesis Mini 3B Controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,righttrigger:b5,start:b9,platform:Linux,
|
||||
03000000790000001100000011010000,Sega Saturn,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b4,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000790000002201000011010000,Sega Saturn,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b5,rightshoulder:b6,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux,
|
||||
03000000b40400000a01000000010000,Sega Saturn,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Linux,
|
||||
03000000632500002305000010010000,ShanWan Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
|
||||
03000000632500002605000010010000,ShanWan Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
|
||||
@ -1858,4 +1862,5 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
|
||||
03000000120c0000100e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000120c0000101e000011010000,Zeroplus P4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000120c0000182e000011010000,Zeroplus PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
|
||||
03000000790000002201000011010000,ZhiXu GuliKit D,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
|
||||
|
||||
|
||||
@ -1148,7 +1148,7 @@ bool BMPBufferLoader(RGBA8Image* image, const void* buffer, size_t buffer_size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (width > 65536 || height > 65536)
|
||||
if (width >= 65536 || height >= 65536)
|
||||
{
|
||||
Console.Error("BMP dimensions too large: %ux%u", width, height);
|
||||
return false;
|
||||
|
||||
@ -220,6 +220,8 @@ void GameListWidget::initialize()
|
||||
m_sort_model->setSourceModel(m_model);
|
||||
|
||||
m_ui.setupUi(this);
|
||||
m_ui.stack->installEventFilter(this);
|
||||
m_ui.stack->setAutoFillBackground(false);
|
||||
|
||||
for (u32 type = 0; type < static_cast<u32>(GameList::EntryType::Count); type++)
|
||||
{
|
||||
@ -353,6 +355,7 @@ void GameListWidget::setCustomBackground()
|
||||
m_background_movie = nullptr;
|
||||
}
|
||||
|
||||
// Get the path to the custom background
|
||||
std::string path = Host::GetBaseStringSettingValue("UI", "GameListBackgroundPath");
|
||||
if (!Path::IsAbsolute(path))
|
||||
path = Path::Combine(EmuFolders::DataRoot, path);
|
||||
@ -360,27 +363,26 @@ void GameListWidget::setCustomBackground()
|
||||
// Only try to create background if path are valid
|
||||
if (!path.empty() && FileSystem::FileExists(path.c_str()))
|
||||
{
|
||||
QMovie* new_movie;
|
||||
QString img_path = QString::fromStdString(path);
|
||||
if (img_path.endsWith(".png", Qt::CaseInsensitive))
|
||||
// Use apng plugin
|
||||
new_movie = new QMovie(img_path, "apng", this);
|
||||
else
|
||||
new_movie = new QMovie(img_path, QByteArray(), this);
|
||||
|
||||
if (new_movie->isValid())
|
||||
m_background_movie = new_movie;
|
||||
else
|
||||
const QByteArray format = (img_path.endsWith(".png", Qt::CaseInsensitive)) ? QByteArray("apng") : QByteArray();
|
||||
m_background_movie = new QMovie(img_path, format, this);
|
||||
if (!m_background_movie->isValid())
|
||||
{
|
||||
Console.Warning("Failed to load background movie from: %s", path.c_str());
|
||||
delete new_movie;
|
||||
delete m_background_movie;
|
||||
m_background_movie = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no valid background then reset fallback to default UI state
|
||||
if (!m_background_movie)
|
||||
{
|
||||
m_ui.stack->setPalette(QApplication::palette());
|
||||
m_background_pixmap = QPixmap();
|
||||
m_ui.stack->setAutoFillBackground(true);
|
||||
m_table_view->viewport()->setAutoFillBackground(true);
|
||||
m_list_view->viewport()->setAutoFillBackground(true);
|
||||
|
||||
m_ui.stack->update();
|
||||
m_table_view->setAlternatingRowColors(true);
|
||||
return;
|
||||
}
|
||||
@ -390,7 +392,7 @@ void GameListWidget::setCustomBackground()
|
||||
const std::string ar_value = Host::GetBaseStringSettingValue("UI", "GameListBackgroundMode", InterfaceSettingsWidget::BACKGROUND_SCALE_NAMES[static_cast<u8>(QtUtils::ScalingMode::Fit)]);
|
||||
for (u8 i = 0; i < static_cast<u8>(QtUtils::ScalingMode::MaxCount); i++)
|
||||
{
|
||||
if (!(InterfaceSettingsWidget::BACKGROUND_SCALE_NAMES[i] == nullptr))
|
||||
if (InterfaceSettingsWidget::BACKGROUND_SCALE_NAMES[i] != nullptr)
|
||||
{
|
||||
if (ar_value == InterfaceSettingsWidget::BACKGROUND_SCALE_NAMES[i])
|
||||
{
|
||||
@ -405,8 +407,13 @@ void GameListWidget::setCustomBackground()
|
||||
|
||||
// Selected Custom background is valid, connect the signals and start animation in gamelist
|
||||
connect(m_background_movie, &QMovie::frameChanged, this, &GameListWidget::processBackgroundFrames, Qt::UniqueConnection);
|
||||
m_ui.stack->setAutoFillBackground(false);
|
||||
|
||||
m_table_view->viewport()->setAutoFillBackground(false);
|
||||
m_list_view->viewport()->setAutoFillBackground(false);
|
||||
updateCustomBackgroundState(true);
|
||||
m_table_view->setAlternatingRowColors(false);
|
||||
processBackgroundFrames();
|
||||
}
|
||||
|
||||
void GameListWidget::updateCustomBackgroundState(const bool force_start)
|
||||
@ -422,7 +429,7 @@ void GameListWidget::updateCustomBackgroundState(const bool force_start)
|
||||
|
||||
void GameListWidget::processBackgroundFrames()
|
||||
{
|
||||
if (m_background_movie && m_background_movie->isValid())
|
||||
if (m_background_movie && m_background_movie->isValid() && isVisible())
|
||||
{
|
||||
const int widget_width = m_ui.stack->width();
|
||||
const int widget_height = m_ui.stack->height();
|
||||
@ -435,9 +442,8 @@ void GameListWidget::processBackgroundFrames()
|
||||
|
||||
QtUtils::resizeAndScalePixmap(&pm, widget_width, widget_height, dpr, m_background_scaling, m_background_opacity);
|
||||
|
||||
QPalette bg_palette(m_ui.stack->palette());
|
||||
bg_palette.setBrush(QPalette::Base, pm);
|
||||
m_ui.stack->setPalette(bg_palette);
|
||||
m_background_pixmap = std::move(pm);
|
||||
m_ui.stack->update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -725,6 +731,7 @@ bool GameListWidget::event(QEvent* event)
|
||||
if (event->type() == QEvent::DevicePixelRatioChange)
|
||||
{
|
||||
m_model->setDevicePixelRatio(devicePixelRatioF());
|
||||
processBackgroundFrames();
|
||||
QWidget::event(event);
|
||||
return true;
|
||||
}
|
||||
@ -732,6 +739,25 @@ bool GameListWidget::event(QEvent* event)
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
bool GameListWidget::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
if (watched == m_ui.stack && event->type() == QEvent::Paint)
|
||||
{
|
||||
if (!m_background_pixmap.isNull())
|
||||
{
|
||||
QPainter painter(m_ui.stack);
|
||||
const auto* paint_event = static_cast<QPaintEvent*>(event);
|
||||
painter.save();
|
||||
painter.setClipRect(paint_event->rect());
|
||||
painter.drawTiledPixmap(m_ui.stack->rect(), m_background_pixmap);
|
||||
painter.restore();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void GameListWidget::resizeTableViewColumnsToFit()
|
||||
{
|
||||
QtUtils::ResizeColumnsForTableView(m_table_view, {
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
#include "pcsx2/GameList.h"
|
||||
|
||||
#include <QtGui/QMovie>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtWidgets/QListView>
|
||||
#include <QtWidgets/QStackedWidget>
|
||||
#include <QtWidgets/QTableView>
|
||||
|
||||
Q_DECLARE_METATYPE(const GameList::Entry*);
|
||||
@ -101,6 +103,7 @@ protected:
|
||||
void hideEvent(QHideEvent* event) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
bool event(QEvent* event) override;
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
private:
|
||||
void loadTableHeaderState();
|
||||
@ -123,6 +126,7 @@ private:
|
||||
GameListRefreshThread* m_refresh_thread = nullptr;
|
||||
|
||||
QMovie* m_background_movie = nullptr;
|
||||
QPixmap m_background_pixmap;
|
||||
QtUtils::ScalingMode m_background_scaling = QtUtils::ScalingMode::Fit;
|
||||
float m_background_opacity = 100.0f;
|
||||
};
|
||||
|
||||
@ -1193,6 +1193,12 @@ void MainWindow::cancelGameListRefresh()
|
||||
m_game_list_widget->cancelRefresh();
|
||||
}
|
||||
|
||||
void MainWindow::updateGameListBackground()
|
||||
{
|
||||
if (m_game_list_widget)
|
||||
m_game_list_widget->setCustomBackground();
|
||||
}
|
||||
|
||||
void MainWindow::reportInfo(const QString& title, const QString& message)
|
||||
{
|
||||
QMessageBox::information(this, title, message);
|
||||
|
||||
@ -116,6 +116,7 @@ public Q_SLOTS:
|
||||
void checkForUpdates(bool display_message, bool force_check);
|
||||
void refreshGameList(bool invalidate_cache, bool popup_on_error);
|
||||
void cancelGameListRefresh();
|
||||
void updateGameListBackground();
|
||||
void reportInfo(const QString& title, const QString& message);
|
||||
void reportError(const QString& title, const QString& message);
|
||||
bool confirmMessage(const QString& title, const QString& message);
|
||||
|
||||
@ -194,6 +194,9 @@ void EmuThread::stopFullscreenUI()
|
||||
{
|
||||
m_run_fullscreen_ui.store(false, std::memory_order_release);
|
||||
emit onFullscreenUIStateChange(false);
|
||||
|
||||
// Resume and refresh background when FullscreenUI exits
|
||||
QMetaObject::invokeMethod(g_main_window, "updateGameListBackground", Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -141,9 +141,16 @@ namespace QtUtils
|
||||
|
||||
void resizeAndScalePixmap(QPixmap* pm, const int expected_width, const int expected_height, const qreal dpr, const ScalingMode scaling_mode, const float opacity)
|
||||
{
|
||||
if (!pm || pm->isNull() || pm->width() <= 0 || pm->height() <= 0)
|
||||
if (!pm || pm->width() <= 0 || pm->height() <= 0)
|
||||
return;
|
||||
|
||||
if (dpr <= 0.0)
|
||||
{
|
||||
Console.ErrorFmt("resizeAndScalePixmap: Invalid device pixel ratio ({}) - pixmap will be null", dpr);
|
||||
*pm = QPixmap();
|
||||
return;
|
||||
}
|
||||
|
||||
const int dpr_expected_width = qRound(expected_width * dpr);
|
||||
const int dpr_expected_height = qRound(expected_height * dpr);
|
||||
|
||||
@ -196,8 +203,7 @@ namespace QtUtils
|
||||
qRound(scaledSize.width()),
|
||||
qRound(scaledSize.height()),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation
|
||||
);
|
||||
Qt::SmoothTransformation);
|
||||
|
||||
const QRectF scaledSrcRect(0, 0, pm->width(), pm->height());
|
||||
|
||||
@ -211,16 +217,7 @@ namespace QtUtils
|
||||
}
|
||||
case ScalingMode::Stretch:
|
||||
{
|
||||
*pm = pm->scaled(
|
||||
dpr_expected_width,
|
||||
dpr_expected_height,
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation
|
||||
);
|
||||
|
||||
const QRectF scaledSrcRect(0, 0, pm->width(), pm->height());
|
||||
|
||||
painter.drawPixmap(painterRect, *pm, scaledSrcRect);
|
||||
painter.drawPixmap(painterRect, *pm, srcRect);
|
||||
break;
|
||||
}
|
||||
case ScalingMode::Center:
|
||||
@ -229,7 +226,6 @@ namespace QtUtils
|
||||
const qreal pmHeight = pm->height() / dpr;
|
||||
|
||||
QRectF destRect(0, 0, pmWidth, pmHeight);
|
||||
|
||||
destRect.moveCenter(painterRect.center());
|
||||
|
||||
painter.drawPixmap(destRect, *pm, srcRect);
|
||||
@ -243,13 +239,19 @@ namespace QtUtils
|
||||
if (tileWidth <= 0 || tileHeight <= 0)
|
||||
break;
|
||||
|
||||
QPixmap tileSource = pm->scaled(tileWidth, tileHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
tileSource.setDevicePixelRatio(dpr);
|
||||
|
||||
QBrush tileBrush(tileSource);
|
||||
tileBrush.setTextureImage(tileSource.toImage());
|
||||
|
||||
painter.fillRect(painterRect, tileBrush);
|
||||
if (pm->devicePixelRatio() == dpr)
|
||||
{
|
||||
QBrush tileBrush(*pm);
|
||||
painter.fillRect(painterRect, tileBrush);
|
||||
}
|
||||
else
|
||||
{
|
||||
QPixmap tileSource = pm->scaled(tileWidth, tileHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
tileSource.setDevicePixelRatio(dpr);
|
||||
QBrush tileBrush(tileSource);
|
||||
tileBrush.setTextureImage(tileSource.toImage());
|
||||
painter.fillRect(painterRect, tileBrush);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -39,6 +39,8 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* settings_dialog, QWidget*
|
||||
connect(m_ui.refresh, &QPushButton::clicked, this, &BIOSSettingsWidget::refreshList);
|
||||
connect(m_ui.fileList, &QTreeWidget::currentItemChanged, this, &BIOSSettingsWidget::listItemChanged);
|
||||
connect(m_ui.fastBoot, &QCheckBox::checkStateChanged, this, &BIOSSettingsWidget::fastBootChanged);
|
||||
|
||||
fastBootChanged();
|
||||
}
|
||||
|
||||
BIOSSettingsWidget::~BIOSSettingsWidget() = default;
|
||||
|
||||
@ -40,6 +40,9 @@ GameCheatSettingsWidget::GameCheatSettingsWidget(SettingsWindow* settings_dialog
|
||||
|
||||
m_ui.cheatList->expandAll();
|
||||
|
||||
m_ui.cheatList->viewport()->installEventFilter(this);
|
||||
m_ui.cheatList->viewport()->setMouseTracking(true);
|
||||
|
||||
SettingsInterface* sif = dialog()->getSettingsInterface();
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableCheats, "EmuCore", "EnableCheats", false);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.allCRCsCheckbox, "EmuCore", "ShowCheatsForAllCRCs", false);
|
||||
@ -83,7 +86,7 @@ void GameCheatSettingsWidget::onCheatListItemDoubleClicked(const QModelIndex& in
|
||||
return;
|
||||
}
|
||||
|
||||
QVariant data = item->data(Qt::UserRole);
|
||||
QVariant data = item->data(NAME_ROLE);
|
||||
if (!data.isValid())
|
||||
return;
|
||||
|
||||
@ -95,7 +98,7 @@ void GameCheatSettingsWidget::onCheatListItemDoubleClicked(const QModelIndex& in
|
||||
|
||||
void GameCheatSettingsWidget::onCheatListItemChanged(QStandardItem* item)
|
||||
{
|
||||
QVariant data = item->data(Qt::UserRole);
|
||||
QVariant data = item->data(NAME_ROLE);
|
||||
if (!data.isValid())
|
||||
return;
|
||||
|
||||
@ -109,6 +112,31 @@ void GameCheatSettingsWidget::onCheatListItemChanged(QStandardItem* item)
|
||||
setCheatEnabled(std::move(cheat_name), current_checked, true);
|
||||
}
|
||||
|
||||
void GameCheatSettingsWidget::onCheatListItemHovered(const QModelIndex& index)
|
||||
{
|
||||
const QModelIndex source_index = m_model_proxy->mapToSource(index);
|
||||
const QModelIndex sibling_index = source_index.siblingAtColumn(0);
|
||||
QStandardItem* item = m_model->itemFromIndex(sibling_index);
|
||||
if (!item)
|
||||
{
|
||||
// No item is selected.
|
||||
m_ui.appliedLabel->clear();
|
||||
return;
|
||||
}
|
||||
|
||||
std::optional<Patch::patch_place_type> place;
|
||||
|
||||
bool ok;
|
||||
int place_value = item->data(PLACE_ROLE).toInt(&ok);
|
||||
if (ok)
|
||||
{
|
||||
// The patch commands in the group are all applied at the same time.
|
||||
place = static_cast<Patch::patch_place_type>(place_value);
|
||||
}
|
||||
|
||||
m_ui.appliedLabel->setText(tr("<strong>Applied:</strong> %1").arg(Patch::PlaceToString(place)));
|
||||
}
|
||||
|
||||
void GameCheatSettingsWidget::onReloadClicked()
|
||||
{
|
||||
reloadList();
|
||||
@ -136,6 +164,32 @@ void GameCheatSettingsWidget::disableAllCheats()
|
||||
si->Save();
|
||||
}
|
||||
|
||||
bool GameCheatSettingsWidget::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
if (watched == m_ui.cheatList->viewport())
|
||||
{
|
||||
switch (event->type())
|
||||
{
|
||||
case QEvent::MouseMove:
|
||||
{
|
||||
QMouseEvent* mouse_event = static_cast<QMouseEvent*>(event);
|
||||
onCheatListItemHovered(m_ui.cheatList->indexAt(mouse_event->position().toPoint()));
|
||||
return true;
|
||||
}
|
||||
case QEvent::Leave:
|
||||
{
|
||||
onCheatListItemHovered(QModelIndex());
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SettingsWidget::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void GameCheatSettingsWidget::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
@ -185,7 +239,7 @@ void GameCheatSettingsWidget::setStateRecursively(QStandardItem* parent, bool en
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
QStandardItem* item = parent ? parent->child(i, 0) : m_model->item(i, 0);
|
||||
QVariant data = item->data(Qt::UserRole);
|
||||
QVariant data = item->data(NAME_ROLE);
|
||||
if (data.isValid())
|
||||
{
|
||||
if ((item->checkState() == Qt::Checked) != enabled)
|
||||
@ -277,7 +331,9 @@ QList<QStandardItem*> GameCheatSettingsWidget::populateTreeViewRow(const Patch::
|
||||
const std::string_view name_part = pi.GetNamePart();
|
||||
nameItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren | Qt::ItemIsEnabled);
|
||||
nameItem->setCheckState(enabled ? Qt::Checked : Qt::Unchecked);
|
||||
nameItem->setData(QString::fromStdString(pi.name), Qt::UserRole);
|
||||
nameItem->setData(QString::fromStdString(pi.name), NAME_ROLE);
|
||||
if (pi.place.has_value())
|
||||
nameItem->setData(static_cast<int>(*pi.place), PLACE_ROLE);
|
||||
if (!name_part.empty())
|
||||
nameItem->setText(QString::fromUtf8(name_part.data(), name_part.length()));
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ public:
|
||||
~GameCheatSettingsWidget();
|
||||
|
||||
void disableAllCheats();
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
@ -39,6 +40,7 @@ protected:
|
||||
private Q_SLOTS:
|
||||
void onCheatListItemDoubleClicked(const QModelIndex& index);
|
||||
void onCheatListItemChanged(QStandardItem* item);
|
||||
void onCheatListItemHovered(const QModelIndex& index);
|
||||
void onReloadClicked();
|
||||
void updateListEnabled();
|
||||
void reloadList();
|
||||
@ -50,6 +52,12 @@ private:
|
||||
void setStateForAll(bool enabled);
|
||||
void setStateRecursively(QStandardItem* parent, bool enabled);
|
||||
|
||||
enum Roles
|
||||
{
|
||||
NAME_ROLE = Qt::UserRole,
|
||||
PLACE_ROLE = Qt::UserRole + 1
|
||||
};
|
||||
|
||||
Ui::GameCheatSettingsWidget m_ui;
|
||||
QStandardItemModel* m_model = nullptr;
|
||||
QSortFilterProxyModel* m_model_proxy = nullptr;
|
||||
|
||||
@ -90,6 +90,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="appliedLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
@ -15,19 +15,23 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::string& author,
|
||||
const std::string& description, bool tristate, Qt::CheckState checkState, SettingsWindow* dialog, QWidget* parent)
|
||||
GamePatchDetailsWidget::GamePatchDetailsWidget(const Patch::PatchInfo& info, bool tristate, Qt::CheckState checkState, SettingsWindow* dialog, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_dialog(dialog)
|
||||
, m_name(name)
|
||||
, m_name(info.name)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
m_ui.name->setText(QString::fromStdString(name));
|
||||
const QString name = QString::fromStdString(info.name);
|
||||
const QString author = !info.author.empty() ? QString::fromStdString(info.author) : tr("Unknown");
|
||||
const QString place = QString::fromUtf8(PlaceToString(info.place));
|
||||
const QString description = !info.description.empty() ? QString::fromStdString(info.description) : tr("No description provided.");
|
||||
m_ui.name->setText(name);
|
||||
m_ui.description->setText(
|
||||
tr("<strong>Author: </strong>%1<br>%2")
|
||||
.arg(author.empty() ? tr("Unknown") : QString::fromStdString(author))
|
||||
.arg(description.empty() ? tr("No description provided.") : QString::fromStdString(description)));
|
||||
tr("<strong>Author:</strong> %1<br><strong>Applied:</strong> %2<br>%3")
|
||||
.arg(author)
|
||||
.arg(place)
|
||||
.arg(description));
|
||||
|
||||
pxAssert(dialog->getSettingsInterface());
|
||||
m_ui.enabled->setTristate(tristate);
|
||||
@ -178,7 +182,7 @@ void GamePatchSettingsWidget::reloadList()
|
||||
}
|
||||
|
||||
GamePatchDetailsWidget* it =
|
||||
new GamePatchDetailsWidget(std::move(pi.name), pi.author, pi.description, globally_toggleable_option, check_state, dialog(), container);
|
||||
new GamePatchDetailsWidget(pi, globally_toggleable_option, check_state, dialog(), container);
|
||||
layout->addWidget(it);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ class GamePatchDetailsWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GamePatchDetailsWidget(std::string name, const std::string& author, const std::string& description, bool tristate, Qt::CheckState checkState,
|
||||
GamePatchDetailsWidget(const Patch::PatchInfo& info, bool tristate, Qt::CheckState checkState,
|
||||
SettingsWindow* dialog, QWidget* parent);
|
||||
~GamePatchDetailsWidget();
|
||||
|
||||
|
||||
@ -275,7 +275,7 @@ void InterfaceSettingsWidget::onSetGameListBackgroundTriggered()
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
std::string relative_path = Path::MakeRelative(QDir::toNativeSeparators(path).toStdString(), EmuFolders::DataRoot);
|
||||
std::string relative_path = Path::MakeRelative(path.toStdString(), EmuFolders::DataRoot);
|
||||
Host::SetBaseStringSettingValue("UI", "GameListBackgroundPath", relative_path.c_str());
|
||||
|
||||
Host::CommitBaseSettingChanges();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -630,9 +630,9 @@ namespace FullscreenUI
|
||||
static std::unique_ptr<GameList::Entry> s_game_settings_entry;
|
||||
static std::vector<std::pair<std::string, bool>> s_game_list_directories_cache;
|
||||
static std::vector<GSAdapterInfo> s_graphics_adapter_list_cache;
|
||||
static Patch::PatchInfoList s_game_patch_list;
|
||||
static std::vector<Patch::PatchInfo> s_game_patch_list;
|
||||
static std::vector<std::string> s_enabled_game_patch_cache;
|
||||
static Patch::PatchInfoList s_game_cheats_list;
|
||||
static std::vector<Patch::PatchInfo> s_game_cheats_list;
|
||||
static std::vector<std::string> s_enabled_game_cheat_cache;
|
||||
static u32 s_game_cheat_unlabelled_count = 0;
|
||||
static std::vector<const HotkeyInfo*> s_hotkey_list_cache;
|
||||
@ -1221,7 +1221,7 @@ void FullscreenUI::Render()
|
||||
|
||||
// see if background setting changed
|
||||
static std::string s_last_background_path;
|
||||
std::string current_path = Host::GetBaseStringSettingValue("UI", "GameListBackgroundPath");
|
||||
std::string current_path = Host::GetBaseStringSettingValue("UI", "FSUIBackgroundPath");
|
||||
if (s_last_background_path != current_path)
|
||||
{
|
||||
s_last_background_path = current_path;
|
||||
@ -1240,7 +1240,8 @@ void FullscreenUI::Render()
|
||||
s_current_main_window == MainWindowType::Exit ||
|
||||
s_current_main_window == MainWindowType::GameList ||
|
||||
s_current_main_window == MainWindowType::GameListSettings ||
|
||||
s_current_main_window == MainWindowType::Settings) && s_custom_background_enabled && s_custom_background_texture;
|
||||
s_current_main_window == MainWindowType::Settings) &&
|
||||
!VMManager::HasValidVM() && s_custom_background_enabled && s_custom_background_texture;
|
||||
|
||||
ImVec4 original_background_color;
|
||||
if (should_draw_background)
|
||||
@ -1691,7 +1692,7 @@ bool FullscreenUI::ShouldDefaultToGameList()
|
||||
|
||||
void FullscreenUI::LoadCustomBackground()
|
||||
{
|
||||
std::string path = Host::GetBaseStringSettingValue("UI", "GameListBackgroundPath");
|
||||
std::string path = Host::GetBaseStringSettingValue("UI", "FSUIBackgroundPath");
|
||||
|
||||
if (path.empty())
|
||||
{
|
||||
@ -1759,19 +1760,25 @@ void FullscreenUI::DrawCustomBackground()
|
||||
const ImGuiIO& io = ImGui::GetIO();
|
||||
const ImVec2 display_size = io.DisplaySize;
|
||||
|
||||
const float opacity = Host::GetBaseFloatSettingValue("UI", "GameListBackgroundOpacity", 100.0f) / 100.0f;
|
||||
const std::string mode = Host::GetBaseStringSettingValue("UI", "GameListBackgroundMode", "fit");
|
||||
const u8 alpha = static_cast<u8>(Host::GetBaseFloatSettingValue("UI", "FSUIBackgroundOpacity", 100.0f) * 2.55f);
|
||||
const std::string mode = Host::GetBaseStringSettingValue("UI", "FSUIBackgroundMode", "fit");
|
||||
|
||||
const float tex_width = static_cast<float>(s_custom_background_texture->GetWidth());
|
||||
const float tex_height = static_cast<float>(s_custom_background_texture->GetHeight());
|
||||
|
||||
ImVec2 img_min, img_max;
|
||||
// Override the UIBackgroundColor that windows use
|
||||
// We need to make windows transparent so our background image shows through
|
||||
const ImVec4 transparent_bg = ImVec4(UIBackgroundColor.x, UIBackgroundColor.y, UIBackgroundColor.z, 0.0f);
|
||||
ImGuiFullscreen::UIBackgroundColor = transparent_bg;
|
||||
|
||||
ImDrawList* bg_draw_list = ImGui::GetBackgroundDrawList();
|
||||
const ImU32 col = IM_COL32(255, 255, 255, alpha);
|
||||
const ImTextureID tex_id = reinterpret_cast<ImTextureID>(s_custom_background_texture->GetNativeHandle());
|
||||
|
||||
if (mode == "stretch")
|
||||
{
|
||||
// stretch to fill entire display (ignores aspect ratio)
|
||||
img_min = ImVec2(0.0f, 0.0f);
|
||||
img_max = display_size;
|
||||
bg_draw_list->AddImage(tex_id, ImVec2(0.0f, 0.0f), display_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||
}
|
||||
else if (mode == "fill")
|
||||
{
|
||||
@ -1796,8 +1803,64 @@ void FullscreenUI::DrawCustomBackground()
|
||||
const float offset_x = (display_size.x - scaled_width) * 0.5f;
|
||||
const float offset_y = (display_size.y - scaled_height) * 0.5f;
|
||||
|
||||
img_min = ImVec2(offset_x, offset_y);
|
||||
img_max = ImVec2(offset_x + scaled_width, offset_y + scaled_height);
|
||||
bg_draw_list->AddImage(tex_id,
|
||||
ImVec2(offset_x, offset_y),
|
||||
ImVec2(offset_x + scaled_width, offset_y + scaled_height),
|
||||
ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||
}
|
||||
else if (mode == "center")
|
||||
{
|
||||
// Center image at original size
|
||||
const float offset_x = (display_size.x - tex_width) * 0.5f;
|
||||
const float offset_y = (display_size.y - tex_height) * 0.5f;
|
||||
|
||||
bg_draw_list->AddImage(tex_id,
|
||||
ImVec2(offset_x, offset_y),
|
||||
ImVec2(offset_x + tex_width, offset_y + tex_height),
|
||||
ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||
}
|
||||
else if (mode == "tile")
|
||||
{
|
||||
// Tile image across entire display
|
||||
// If the image is extremely small, this approach can generate millions of quads
|
||||
// and overflow the backend stream buffer (e.g. Vulkan assertion in VKStreamBuffer).
|
||||
// Since we cannot switch ImGui's sampler to wrap (yet), clamp the maximum number of quads
|
||||
constexpr int MAX_TILE_QUADS = 16384;
|
||||
|
||||
float tile_width = tex_width;
|
||||
float tile_height = tex_height;
|
||||
int tiles_x = static_cast<int>(std::ceil(display_size.x / tile_width));
|
||||
int tiles_y = static_cast<int>(std::ceil(display_size.y / tile_height));
|
||||
|
||||
const int total_tiles = tiles_x * tiles_y;
|
||||
if (total_tiles > MAX_TILE_QUADS)
|
||||
{
|
||||
const float scale = std::sqrt(static_cast<float>(total_tiles) / static_cast<float>(MAX_TILE_QUADS));
|
||||
tile_width *= scale;
|
||||
tile_height *= scale;
|
||||
tiles_x = static_cast<int>(std::ceil(display_size.x / tile_width));
|
||||
tiles_y = static_cast<int>(std::ceil(display_size.y / tile_height));
|
||||
}
|
||||
|
||||
for (int y = 0; y < tiles_y; y++)
|
||||
{
|
||||
for (int x = 0; x < tiles_x; x++)
|
||||
{
|
||||
const float tile_x = static_cast<float>(x) * tile_width;
|
||||
const float tile_y = static_cast<float>(y) * tile_height;
|
||||
const float tile_max_x = std::min(tile_x + tile_width, display_size.x);
|
||||
const float tile_max_y = std::min(tile_y + tile_height, display_size.y);
|
||||
|
||||
// get uvs for partial tiles at edges
|
||||
const float uv_max_x = (tile_max_x - tile_x) / tile_width;
|
||||
const float uv_max_y = (tile_max_y - tile_y) / tile_height;
|
||||
|
||||
bg_draw_list->AddImage(tex_id,
|
||||
ImVec2(tile_x, tile_y),
|
||||
ImVec2(tile_max_x, tile_max_y),
|
||||
ImVec2(0.0f, 0.0f), ImVec2(uv_max_x, uv_max_y), col);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // "fit" or default
|
||||
{
|
||||
@ -1822,19 +1885,11 @@ void FullscreenUI::DrawCustomBackground()
|
||||
const float offset_x = (display_size.x - scaled_width) * 0.5f;
|
||||
const float offset_y = (display_size.y - scaled_height) * 0.5f;
|
||||
|
||||
img_min = ImVec2(offset_x, offset_y);
|
||||
img_max = ImVec2(offset_x + scaled_width, offset_y + scaled_height);
|
||||
bg_draw_list->AddImage(tex_id,
|
||||
ImVec2(offset_x, offset_y),
|
||||
ImVec2(offset_x + scaled_width, offset_y + scaled_height),
|
||||
ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||
}
|
||||
|
||||
// Override the UIBackgroundColor that windows use
|
||||
// We need to make windows transparent so our background image shows through
|
||||
const ImVec4 transparent_bg = ImVec4(UIBackgroundColor.x, UIBackgroundColor.y, UIBackgroundColor.z, 0.0f);
|
||||
ImGuiFullscreen::UIBackgroundColor = transparent_bg;
|
||||
|
||||
ImDrawList* bg_draw_list = ImGui::GetBackgroundDrawList();
|
||||
const ImU32 col = IM_COL32(255, 255, 255, static_cast<u8>(opacity * 255.0f));
|
||||
bg_draw_list->AddImage(reinterpret_cast<ImTextureID>(s_custom_background_texture->GetNativeHandle()),
|
||||
img_min, img_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -3582,7 +3637,7 @@ void FullscreenUI::PopulateGameListDirectoryCache(SettingsInterface* si)
|
||||
|
||||
void FullscreenUI::PopulatePatchesAndCheatsList(const std::string_view serial, u32 crc)
|
||||
{
|
||||
constexpr auto sort_patches = [](Patch::PatchInfoList& list) {
|
||||
constexpr auto sort_patches = [](std::vector<Patch::PatchInfo>& list) {
|
||||
std::sort(list.begin(), list.end(), [](const Patch::PatchInfo& lhs, const Patch::PatchInfo& rhs) { return lhs.name < rhs.name; });
|
||||
};
|
||||
|
||||
@ -3630,7 +3685,7 @@ void FullscreenUI::DrawSettingsWindow()
|
||||
ImVec2(io.DisplaySize.x, LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY) +
|
||||
(LayoutScale(LAYOUT_MENU_BUTTON_Y_PADDING) * 2.0f) + LayoutScale(2.0f));
|
||||
|
||||
const bool using_custom_bg = s_custom_background_enabled && s_custom_background_texture;
|
||||
const bool using_custom_bg = !VMManager::HasValidVM() && s_custom_background_enabled && s_custom_background_texture;
|
||||
const float header_bg_alpha = VMManager::HasValidVM() ? 0.90f : 1.0f;
|
||||
const float content_bg_alpha = using_custom_bg ? 0.0f : (VMManager::HasValidVM() ? 0.90f : 1.0f);
|
||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||
@ -4053,21 +4108,19 @@ void FullscreenUI::DrawInterfaceSettingsPage()
|
||||
|
||||
MenuHeading(FSUI_CSTR("Background"));
|
||||
|
||||
std::string background_path = bsi->GetStringValue("UI", "GameListBackgroundPath", "");
|
||||
const bool background_enabled = bsi->GetBoolValue("UI", "GameListBackgroundEnabled", false);
|
||||
std::string background_path = bsi->GetStringValue("UI", "FSUIBackgroundPath", "");
|
||||
|
||||
std::string background_display = FSUI_STR("None");
|
||||
if (!background_path.empty() && background_enabled)
|
||||
if (!background_path.empty())
|
||||
{
|
||||
background_display = Path::GetFileName(background_path);
|
||||
}
|
||||
|
||||
if (MenuButtonWithValue(FSUI_ICONSTR(ICON_FA_IMAGE, "Background Image"),
|
||||
FSUI_CSTR("Select a custom background image to use in Big Picture Mode menus."),
|
||||
FSUI_CSTR("Select a custom background image to use in Big Picture Mode menus.\n\nSupported formats: PNG, JPG, JPEG, BMP."),
|
||||
background_display.c_str()))
|
||||
{
|
||||
OpenFileSelector(FSUI_ICONSTR(ICON_FA_IMAGE, "Select Background Image"), false,
|
||||
[](const std::string& path) {
|
||||
OpenFileSelector(FSUI_ICONSTR(ICON_FA_IMAGE, "Select Background Image"), false, [](const std::string& path) {
|
||||
if (!path.empty())
|
||||
{
|
||||
{
|
||||
@ -4075,23 +4128,20 @@ void FullscreenUI::DrawInterfaceSettingsPage()
|
||||
SettingsInterface* bsi = GetEditingSettingsInterface(false);
|
||||
|
||||
std::string relative_path = Path::MakeRelative(path, EmuFolders::DataRoot);
|
||||
bsi->SetStringValue("UI", "GameListBackgroundPath", relative_path.c_str());
|
||||
bsi->SetBoolValue("UI", "GameListBackgroundEnabled", true);
|
||||
bsi->SetStringValue("UI", "FSUIBackgroundPath", relative_path.c_str());
|
||||
bsi->SetBoolValue("UI", "FSUIBackgroundEnabled", true);
|
||||
SetSettingsChanged(bsi);
|
||||
}
|
||||
|
||||
LoadCustomBackground();
|
||||
}
|
||||
CloseFileSelector();
|
||||
},
|
||||
GetImageFileFilters());
|
||||
CloseFileSelector(); }, GetImageFileFilters());
|
||||
}
|
||||
|
||||
if (MenuButton(FSUI_ICONSTR(ICON_FA_XMARK, "Clear Background Image"),
|
||||
FSUI_CSTR("Removes the custom background image.")))
|
||||
{
|
||||
bsi->DeleteValue("UI", "GameListBackgroundPath");
|
||||
bsi->SetBoolValue("UI", "GameListBackgroundEnabled", false);
|
||||
bsi->DeleteValue("UI", "FSUIBackgroundPath");
|
||||
SetSettingsChanged(bsi);
|
||||
|
||||
s_custom_background_texture.reset();
|
||||
@ -4101,21 +4151,25 @@ void FullscreenUI::DrawInterfaceSettingsPage()
|
||||
|
||||
DrawIntRangeSetting(bsi, FSUI_ICONSTR(ICON_FA_DROPLET, "Background Opacity"),
|
||||
FSUI_CSTR("Sets the transparency of the custom background image."),
|
||||
"UI", "GameListBackgroundOpacity", 100, 0, 100, "%d%%");
|
||||
"UI", "FSUIBackgroundOpacity", 100, 0, 100, "%d%%");
|
||||
|
||||
static constexpr const char* s_background_mode_names[] = {
|
||||
FSUI_NSTR("Fit"),
|
||||
FSUI_NSTR("Fill"),
|
||||
FSUI_NSTR("Stretch"),
|
||||
FSUI_NSTR("Center"),
|
||||
FSUI_NSTR("Tile"),
|
||||
};
|
||||
static constexpr const char* s_background_mode_values[] = {
|
||||
"fit",
|
||||
"fill",
|
||||
"stretch",
|
||||
"center",
|
||||
"tile",
|
||||
};
|
||||
DrawStringListSetting(bsi, FSUI_ICONSTR(ICON_FA_EXPAND, "Background Mode"),
|
||||
FSUI_CSTR("Select how to display the background image."),
|
||||
"UI", "GameListBackgroundMode", "fit", s_background_mode_names, s_background_mode_values, std::size(s_background_mode_names), true);
|
||||
"UI", "FSUIBackgroundMode", "fit", s_background_mode_names, s_background_mode_values, std::size(s_background_mode_names), true);
|
||||
|
||||
MenuHeading(FSUI_CSTR("Behaviour"));
|
||||
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_PF_SNOOZE, "Inhibit Screensaver"),
|
||||
@ -6636,7 +6690,7 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats)
|
||||
{
|
||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||
|
||||
const Patch::PatchInfoList& patch_list = cheats ? s_game_cheats_list : s_game_patch_list;
|
||||
const std::vector<Patch::PatchInfo>& patch_list = cheats ? s_game_cheats_list : s_game_patch_list;
|
||||
std::vector<std::string>& enable_list = cheats ? s_enabled_game_cheat_cache : s_enabled_game_patch_cache;
|
||||
const char* section = cheats ? Patch::CHEATS_CONFIG_SECTION : Patch::PATCHES_CONFIG_SECTION;
|
||||
const bool master_enable = cheats ? GetEffectiveBoolSetting(bsi, "EmuCore", "EnableCheats", false) : true;
|
||||
@ -9306,6 +9360,8 @@ TRANSLATE_NOOP("FullscreenUI", "Reset System");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Hardcore mode will not be enabled until the system is reset. Do you want to reset the system now?");
|
||||
TRANSLATE_NOOP("FullscreenUI", "This game has no achievements.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "This game has no leaderboards.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Load State");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Save State");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Game List");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Launch a game from images scanned from your game directories.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Start Game");
|
||||
@ -9351,7 +9407,7 @@ TRANSLATE_NOOP("FullscreenUI", "Selects the color style to be used for Big Pictu
|
||||
TRANSLATE_NOOP("FullscreenUI", "When Big Picture mode is started, the game list will be displayed instead of the main menu.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Show a save state selector UI when switching slots instead of showing a notification bubble.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Background");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Select a custom background image to use in Big Picture Mode menus.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Select a custom background image to use in Big Picture Mode menus.\n\nSupported formats: PNG, JPG, JPEG, BMP.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Removes the custom background image.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Sets the transparency of the custom background image.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Select how to display the background image.");
|
||||
@ -9361,6 +9417,7 @@ TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when a game is started.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when you minimize the window or switch to another application, and unpauses when you switch back.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when a controller with bindings is disconnected.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when you open the quick menu, and unpauses when you close it.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Display a modal dialog when a save state load/save operation fails.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Determines whether a prompt will be displayed to confirm shutting down the emulator/game when the hotkey is pressed.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically saves the emulator state when powering down or exiting. You can then resume directly from where you left off next time.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Creates a backup copy of a save state if it already exists when the save is created. The backup copy has a .backup suffix");
|
||||
@ -9370,6 +9427,7 @@ TRANSLATE_NOOP("FullscreenUI", "Game Display");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically switches to fullscreen mode when a game is started.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Switches between full screen and windowed when the window is double-clicked.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Hides the mouse pointer/cursor when the emulator is in fullscreen mode.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Automatically starts Big Picture Mode instead of the regular Qt interface when PCSX2 launches.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "On-Screen Display");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Determines how large the on-screen messages and monitors are.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "%d%%");
|
||||
@ -9795,6 +9853,9 @@ TRANSLATE_NOOP("FullscreenUI", "Last Played: {}");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Size: {:.2f} MB");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Are you sure you want to reset the play time for '{}' ({})?\n\nYour current play time is {}.\n\nThis action cannot be undone.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Login failed.\nError: {}\n\nPlease check your username and password, and try again.");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Load State From Backup Slot {}");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Load State From Slot {}");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Save State To Slot {}");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Left: ");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Top: ");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Right: ");
|
||||
@ -9828,13 +9889,14 @@ TRANSLATE_NOOP("FullscreenUI", "AMOLED");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Fit");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Fill");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Stretch");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Center");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Tile");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Enabled");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Disabled");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Top Left");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Top Center");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Top Right");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Center Left");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Center");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Center Right");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Bottom Left");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Bottom Center");
|
||||
@ -10054,6 +10116,7 @@ TRANSLATE_NOOP("FullscreenUI", "Pause On Start");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pause On Focus Loss");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pause On Controller Disconnection");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Pause On Menu");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Prompt On State Load/Save Failure");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Confirm Shutdown");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Save State On Shutdown");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Create Save State Backups");
|
||||
@ -10063,6 +10126,7 @@ TRANSLATE_NOOP("FullscreenUI", "Enable Discord Presence");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Start Fullscreen");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Double-Click Toggles Fullscreen");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Hide Cursor In Fullscreen");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Start Big Picture UI");
|
||||
TRANSLATE_NOOP("FullscreenUI", "OSD Scale");
|
||||
TRANSLATE_NOOP("FullscreenUI", "OSD Messages Position");
|
||||
TRANSLATE_NOOP("FullscreenUI", "OSD Performance Position");
|
||||
@ -10243,7 +10307,6 @@ TRANSLATE_NOOP("FullscreenUI", "Delete Save");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Close Menu");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Default Boot");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Delete State");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Failed to Load State");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Full Boot");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Reset Play Time");
|
||||
TRANSLATE_NOOP("FullscreenUI", "Confirm Reset");
|
||||
|
||||
@ -2396,6 +2396,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);
|
||||
|
||||
const float width = LayoutScale(600.0f);
|
||||
const float title_height = g_large_font.second + ImGui::GetStyle().FramePadding.y * 2.0f + ImGui::GetStyle().WindowPadding.y * 2.0f;
|
||||
@ -2464,7 +2465,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
is_open = false;
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopFont();
|
||||
|
||||
@ -2523,7 +2524,7 @@ void ImGuiFullscreen::DrawInputDialog()
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIBackgroundColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(s_input_dialog_title.c_str(), &is_open,
|
||||
@ -2715,6 +2716,7 @@ void ImGuiFullscreen::DrawMessageDialog()
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
|
||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);
|
||||
|
||||
bool is_open = true;
|
||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
|
||||
@ -2745,7 +2747,7 @@ void ImGuiFullscreen::DrawMessageDialog()
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(4);
|
||||
ImGui::PopFont();
|
||||
|
||||
|
||||
187
pcsx2/Patch.cpp
187
pcsx2/Patch.cpp
@ -51,7 +51,7 @@ namespace Patch
|
||||
BYTES_T
|
||||
};
|
||||
|
||||
static constexpr std::array<const char*, 3> s_place_to_string = {{"0", "1", "2"}};
|
||||
static constexpr std::array<const char*, 4> s_place_to_string = {{"0", "1", "2", "3"}};
|
||||
static constexpr std::array<const char*, 2> s_cpu_to_string = {{"EE", "IOP"}};
|
||||
static constexpr std::array<const char*, 9> s_type_to_string = {
|
||||
{"byte", "short", "word", "double", "extended", "beshort", "beword", "bedouble", "bytes"}};
|
||||
@ -125,10 +125,6 @@ namespace Patch
|
||||
void (*func)(PatchGroup* group, const std::string_view cmd, const std::string_view param);
|
||||
};
|
||||
|
||||
using PatchList = std::vector<PatchGroup>;
|
||||
using ActivePatchList = std::vector<const PatchCommand*>;
|
||||
using EnablePatchList = std::vector<std::string>;
|
||||
|
||||
namespace PatchFunc
|
||||
{
|
||||
static void patch(PatchGroup* group, const std::string_view cmd, const std::string_view param);
|
||||
@ -141,23 +137,23 @@ namespace Patch
|
||||
static int PatchTableExecute(PatchGroup* group, const std::string_view lhs, const std::string_view rhs,
|
||||
const std::span<const PatchTextTable>& Table);
|
||||
static void LoadPatchLine(PatchGroup* group, const std::string_view line);
|
||||
static u32 LoadPatchesFromString(PatchList* patch_list, const std::string& patch_file);
|
||||
static u32 LoadPatchesFromString(std::vector<PatchGroup>* patch_list, const std::string& patch_file);
|
||||
static bool OpenPatchesZip();
|
||||
static std::string GetPnachTemplate(
|
||||
const std::string_view serial, u32 crc, bool include_serial, bool add_wildcard, bool all_crcs);
|
||||
static std::vector<std::string> FindPatchFilesOnDisk(
|
||||
const std::string_view serial, u32 crc, bool cheats, bool all_crcs);
|
||||
|
||||
static bool ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName);
|
||||
static bool ContainsPatchName(const PatchList& patches, const std::string_view patchName);
|
||||
static bool ContainsPatchName(const std::vector<PatchInfo>& patches, const std::string_view patchName);
|
||||
static bool ContainsPatchName(const std::vector<PatchGroup>& patches, const std::string_view patchName);
|
||||
|
||||
template <typename F>
|
||||
static void EnumeratePnachFiles(const std::string_view serial, u32 crc, bool cheats, bool for_ui, const F& f);
|
||||
|
||||
static bool PatchStringHasUnlabelledPatch(const std::string& pnach_data);
|
||||
static void ExtractPatchInfo(PatchInfoList* dst, const std::string& pnach_data, u32* num_unlabelled_patches);
|
||||
static void ExtractPatchInfo(std::vector<PatchInfo>* dst, const std::string& pnach_data, u32* num_unlabelled_patches);
|
||||
static void ReloadEnabledLists();
|
||||
static u32 EnablePatches(const PatchList& patches, const EnablePatchList& enable_list, const EnablePatchList& enable_immediately_list);
|
||||
static u32 EnablePatches(const std::vector<PatchGroup>* patches, const std::vector<std::string>& enable_list, const std::vector<std::string>* enable_immediately_list);
|
||||
|
||||
static void ApplyPatch(const PatchCommand* p);
|
||||
static void ApplyDynaPatch(const DynamicPatch& patch, u32 address);
|
||||
@ -175,21 +171,21 @@ namespace Patch
|
||||
const char* PATCH_DISABLE_CONFIG_KEY = "Disable";
|
||||
|
||||
static zip_t* s_patches_zip;
|
||||
static PatchList s_gamedb_patches;
|
||||
static PatchList s_game_patches;
|
||||
static PatchList s_cheat_patches;
|
||||
static std::vector<PatchGroup> s_gamedb_patches;
|
||||
static std::vector<PatchGroup> s_game_patches;
|
||||
static std::vector<PatchGroup> s_cheat_patches;
|
||||
|
||||
static u32 s_gamedb_counts = 0;
|
||||
static u32 s_patches_counts = 0;
|
||||
static u32 s_cheats_counts = 0;
|
||||
|
||||
static ActivePatchList s_active_patches;
|
||||
static std::vector<const PatchCommand*> s_active_patches;
|
||||
static std::vector<DynamicPatch> s_active_gamedb_dynamic_patches;
|
||||
static std::vector<DynamicPatch> s_active_pnach_dynamic_patches;
|
||||
static EnablePatchList s_enabled_cheats;
|
||||
static EnablePatchList s_enabled_patches;
|
||||
static EnablePatchList s_just_enabled_cheats;
|
||||
static EnablePatchList s_just_enabled_patches;
|
||||
static std::vector<std::string> s_enabled_cheats;
|
||||
static std::vector<std::string> s_enabled_patches;
|
||||
static std::vector<std::string> s_just_enabled_cheats;
|
||||
static std::vector<std::string> s_just_enabled_patches;
|
||||
static u32 s_patches_crc;
|
||||
static std::optional<float> s_override_aspect_ratio;
|
||||
static std::optional<GSInterlaceMode> s_override_interlace_mode;
|
||||
@ -218,7 +214,7 @@ void Patch::TrimPatchLine(std::string& buffer)
|
||||
buffer.erase(pos);
|
||||
}
|
||||
|
||||
bool Patch::ContainsPatchName(const PatchList& patch_list, const std::string_view patch_name)
|
||||
bool Patch::ContainsPatchName(const std::vector<PatchGroup>& patch_list, const std::string_view patch_name)
|
||||
{
|
||||
return std::find_if(patch_list.begin(), patch_list.end(), [&patch_name](const PatchGroup& patch) {
|
||||
return patch.name == patch_name;
|
||||
@ -253,7 +249,7 @@ void Patch::LoadPatchLine(PatchGroup* group, const std::string_view line)
|
||||
PatchTableExecute(group, key, value, s_patch_commands);
|
||||
}
|
||||
|
||||
u32 Patch::LoadPatchesFromString(PatchList* patch_list, const std::string& patch_file)
|
||||
u32 Patch::LoadPatchesFromString(std::vector<PatchGroup>* patch_list, const std::string& patch_file)
|
||||
{
|
||||
const size_t before = patch_list->size();
|
||||
|
||||
@ -264,7 +260,7 @@ u32 Patch::LoadPatchesFromString(PatchList* patch_list, const std::string& patch
|
||||
// Ungrouped/legacy patches should merge with other ungrouped patches.
|
||||
if (current_patch_group.name.empty())
|
||||
{
|
||||
const PatchList::iterator ungrouped_patch = std::find_if(patch_list->begin(), patch_list->end(),
|
||||
const std::vector<PatchGroup>::iterator ungrouped_patch = std::find_if(patch_list->begin(), patch_list->end(),
|
||||
[](const PatchGroup& pg) { return pg.name.empty(); });
|
||||
if (ungrouped_patch != patch_list->end())
|
||||
{
|
||||
@ -407,7 +403,7 @@ std::vector<std::string> Patch::FindPatchFilesOnDisk(const std::string_view seri
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Patch::ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName)
|
||||
bool Patch::ContainsPatchName(const std::vector<PatchInfo>& patches, const std::string_view patchName)
|
||||
{
|
||||
return std::find_if(patches.begin(), patches.end(), [&patchName](const PatchInfo& patch) {
|
||||
return patch.name == patchName;
|
||||
@ -491,11 +487,15 @@ bool Patch::PatchStringHasUnlabelledPatch(const std::string& pnach_data)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Patch::ExtractPatchInfo(PatchInfoList* dst, const std::string& pnach_data, u32* num_unlabelled_patches)
|
||||
void Patch::ExtractPatchInfo(std::vector<PatchInfo>* dst, const std::string& pnach_data, u32* num_unlabelled_patches)
|
||||
{
|
||||
std::istringstream ss(pnach_data);
|
||||
std::string line;
|
||||
PatchInfo current_patch;
|
||||
|
||||
std::optional<patch_place_type> last_place;
|
||||
bool unknown_place = false;
|
||||
|
||||
while (std::getline(ss, line))
|
||||
{
|
||||
TrimPatchLine(line);
|
||||
@ -522,6 +522,8 @@ void Patch::ExtractPatchInfo(PatchInfoList* dst, const std::string& pnach_data,
|
||||
}
|
||||
}
|
||||
current_patch = {};
|
||||
last_place = std::nullopt;
|
||||
unknown_place = false;
|
||||
}
|
||||
|
||||
current_patch.name = line.substr(1, line.length() - 2);
|
||||
@ -534,13 +536,52 @@ void Patch::ExtractPatchInfo(PatchInfoList* dst, const std::string& pnach_data,
|
||||
// Just ignore other directives, who knows what rubbish people have in here.
|
||||
// Use comment for description if it hasn't been otherwise specified.
|
||||
if (key == "author")
|
||||
{
|
||||
current_patch.author = value;
|
||||
}
|
||||
else if (key == "description")
|
||||
{
|
||||
current_patch.description = value;
|
||||
}
|
||||
else if (key == "comment" && current_patch.description.empty())
|
||||
{
|
||||
current_patch.description = value;
|
||||
else if (key == "patch" && !has_patch && num_unlabelled_patches)
|
||||
(*num_unlabelled_patches)++;
|
||||
}
|
||||
else if (key == "patch")
|
||||
{
|
||||
if (!has_patch && num_unlabelled_patches)
|
||||
(*num_unlabelled_patches)++;
|
||||
|
||||
// Try to extract the place value of the patch lines so we can
|
||||
// display it in the GUI if they all match. TODO: Don't duplicate
|
||||
// all this parsing logic twice.
|
||||
if (unknown_place)
|
||||
continue;
|
||||
|
||||
std::string::size_type comma_pos = value.find(",");
|
||||
if (comma_pos == std::string::npos)
|
||||
comma_pos = 0;
|
||||
const std::string_view padded_place = value.substr(0, comma_pos);
|
||||
const std::string_view place_string = StringUtil::StripWhitespace(padded_place);
|
||||
const std::optional<patch_place_type> place = LookupEnumName<patch_place_type>(
|
||||
place_string, s_place_to_string);
|
||||
if (!place.has_value() || (last_place.has_value() && place != last_place))
|
||||
{
|
||||
// This group contains patch lines with different or invalid
|
||||
// place values.
|
||||
current_patch.place = std::nullopt;
|
||||
unknown_place = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
current_patch.place = place;
|
||||
last_place = place;
|
||||
}
|
||||
else if (key == "dpatch")
|
||||
{
|
||||
current_patch.place = std::nullopt;
|
||||
unknown_place = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Last one.
|
||||
@ -570,9 +611,9 @@ std::string_view Patch::PatchInfo::GetNameParentPart() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
Patch::PatchInfoList Patch::GetPatchInfo(const std::string_view serial, u32 crc, bool cheats, bool showAllCRCS, u32* num_unlabelled_patches)
|
||||
std::vector<Patch::PatchInfo> Patch::GetPatchInfo(const std::string_view serial, u32 crc, bool cheats, bool showAllCRCS, u32* num_unlabelled_patches)
|
||||
{
|
||||
PatchInfoList ret;
|
||||
std::vector<PatchInfo> ret;
|
||||
|
||||
if (num_unlabelled_patches)
|
||||
*num_unlabelled_patches = 0;
|
||||
@ -592,14 +633,14 @@ std::string Patch::GetPnachFilename(const std::string_view serial, u32 crc, bool
|
||||
|
||||
void Patch::ReloadEnabledLists()
|
||||
{
|
||||
const EnablePatchList prev_enabled_cheats = std::move(s_enabled_cheats);
|
||||
const std::vector<std::string> prev_enabled_cheats = std::move(s_enabled_cheats);
|
||||
if (EmuConfig.EnableCheats && !Achievements::IsHardcoreModeActive())
|
||||
s_enabled_cheats = Host::GetStringListSetting(CHEATS_CONFIG_SECTION, PATCH_ENABLE_CONFIG_KEY);
|
||||
else
|
||||
s_enabled_cheats = {};
|
||||
|
||||
const EnablePatchList prev_enabled_patches = std::exchange(s_enabled_patches, Host::GetStringListSetting(PATCHES_CONFIG_SECTION, PATCH_ENABLE_CONFIG_KEY));
|
||||
const EnablePatchList disabled_patches = Host::GetStringListSetting(PATCHES_CONFIG_SECTION, PATCH_DISABLE_CONFIG_KEY);
|
||||
const std::vector<std::string> prev_enabled_patches = std::exchange(s_enabled_patches, Host::GetStringListSetting(PATCHES_CONFIG_SECTION, PATCH_ENABLE_CONFIG_KEY));
|
||||
const std::vector<std::string> disabled_patches = Host::GetStringListSetting(PATCHES_CONFIG_SECTION, PATCH_DISABLE_CONFIG_KEY);
|
||||
|
||||
// Name based matching for widescreen/NI settings.
|
||||
if (EmuConfig.EnableWideScreenPatches)
|
||||
@ -649,12 +690,10 @@ void Patch::ReloadEnabledLists()
|
||||
}
|
||||
}
|
||||
|
||||
u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable_list, const EnablePatchList& enable_immediately_list)
|
||||
u32 Patch::EnablePatches(const std::vector<PatchGroup>* patches, const std::vector<std::string>& enable_list, const std::vector<std::string>* enable_immediately_list)
|
||||
{
|
||||
ActivePatchList patches_to_apply_immediately;
|
||||
|
||||
u32 count = 0;
|
||||
for (const PatchGroup& p : patches)
|
||||
for (const PatchGroup& p : *patches)
|
||||
{
|
||||
// For compatibility, we auto enable anything that's not labelled.
|
||||
// Also for gamedb patches.
|
||||
@ -664,7 +703,6 @@ u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable
|
||||
Console.WriteLn(Color_Green, fmt::format("Enabled patch: {}",
|
||||
p.name.empty() ? std::string_view("<unknown>") : std::string_view(p.name)));
|
||||
|
||||
const bool apply_immediately = std::find(enable_immediately_list.begin(), enable_immediately_list.end(), p.name) != enable_immediately_list.end();
|
||||
for (const PatchCommand& ip : p.patches)
|
||||
{
|
||||
// print the actual patch lines only in verbose mode (even in devel)
|
||||
@ -672,8 +710,6 @@ u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable
|
||||
DevCon.WriteLnFmt(" {}", ip.ToString());
|
||||
|
||||
s_active_patches.push_back(&ip);
|
||||
if (apply_immediately && ip.placetopatch == PPT_ONCE_ON_LOAD)
|
||||
patches_to_apply_immediately.push_back(&ip);
|
||||
}
|
||||
|
||||
for (const DynamicPatch& dp : p.dpatches)
|
||||
@ -690,12 +726,28 @@ u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable
|
||||
count += p.name.empty() ? (static_cast<u32>(p.patches.size()) + static_cast<u32>(p.dpatches.size())) : 1;
|
||||
}
|
||||
|
||||
if (!patches_to_apply_immediately.empty())
|
||||
// Apply PPT_ON_LOAD_OR_WHEN_ENABLED patches immediately.
|
||||
if (enable_immediately_list && !enable_immediately_list->empty())
|
||||
{
|
||||
Host::RunOnCPUThread([patches = std::move(patches_to_apply_immediately)]() {
|
||||
for (const PatchCommand* i : patches)
|
||||
// Don't pass pointers to patch objects themselves here just in case the
|
||||
// patches are reloaded twice in a row before this event makes it.
|
||||
Host::RunOnCPUThread([patches, enable_immediately_list]() {
|
||||
for (const PatchGroup& group : *patches)
|
||||
{
|
||||
ApplyPatch(i);
|
||||
const bool apply_immediately = std::find(
|
||||
enable_immediately_list->begin(),
|
||||
enable_immediately_list->end(),
|
||||
group.name) != enable_immediately_list->end();
|
||||
if (!apply_immediately)
|
||||
continue;
|
||||
|
||||
for (const PatchCommand& command : group.patches)
|
||||
{
|
||||
if (command.placetopatch != PPT_ON_LOAD_OR_WHEN_ENABLED)
|
||||
continue;
|
||||
|
||||
ApplyPatch(&command);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -762,19 +814,23 @@ void Patch::UpdateActivePatches(bool reload_enabled_list, bool verbose, bool ver
|
||||
u32 gp_count = 0;
|
||||
if (EmuConfig.EnablePatches)
|
||||
{
|
||||
gp_count = EnablePatches(s_gamedb_patches, EnablePatchList(), EnablePatchList());
|
||||
gp_count = EnablePatches(&s_gamedb_patches, std::vector<std::string>(), nullptr);
|
||||
s_gamedb_counts = gp_count;
|
||||
if (gp_count > 0)
|
||||
message.append(TRANSLATE_PLURAL_STR("Patch", "%n GameDB patches are active.", "OSD Message", gp_count));
|
||||
}
|
||||
|
||||
const u32 p_count = EnablePatches(s_game_patches, s_enabled_patches, apply_new_patches ? s_just_enabled_patches : EnablePatchList());
|
||||
const u32 p_count = EnablePatches(
|
||||
&s_game_patches, s_enabled_patches, apply_new_patches ? &s_just_enabled_patches : nullptr);
|
||||
s_patches_counts = p_count;
|
||||
if (p_count > 0)
|
||||
message.append_format("{}{}", message.empty() ? "" : "\n",
|
||||
TRANSLATE_PLURAL_STR("Patch", "%n game patches are active.", "OSD Message", p_count));
|
||||
|
||||
const u32 c_count = EmuConfig.EnableCheats ? EnablePatches(s_cheat_patches, s_enabled_cheats, apply_new_patches ? s_just_enabled_cheats : EnablePatchList()) : 0;
|
||||
u32 c_count = 0;
|
||||
if (EmuConfig.EnableCheats)
|
||||
c_count = EnablePatches(
|
||||
&s_cheat_patches, s_enabled_cheats, apply_new_patches ? &s_just_enabled_cheats : nullptr);
|
||||
s_cheats_counts = c_count;
|
||||
if (c_count > 0)
|
||||
message.append_format("{}{}", message.empty() ? "" : "\n",
|
||||
@ -892,7 +948,7 @@ void Patch::PatchFunc::patch(PatchGroup* group, const std::string_view cmd, cons
|
||||
|
||||
if (!placetopatch.has_value())
|
||||
{
|
||||
PATCH_ERROR("Invalid 'place' value '{}' (0 - once on startup, 1: continuously)", pieces[0]);
|
||||
PATCH_ERROR("Invalid 'place' value '{}' (0: on boot only, 1: continuously, 2: on boot and continuously, 3: on boot and when enabled in the GUI)", pieces[0]);
|
||||
return;
|
||||
}
|
||||
if (!addr.has_value() || !addr_end.empty())
|
||||
@ -1083,6 +1139,19 @@ void Patch::PatchFunc::dpatch(PatchGroup* group, const std::string_view cmd, con
|
||||
group->dpatches.push_back(dpatch);
|
||||
}
|
||||
|
||||
void Patch::ApplyBootPatches()
|
||||
{
|
||||
ApplyLoadedPatches(PPT_ONCE_ON_LOAD);
|
||||
ApplyLoadedPatches(PPT_COMBINED_0_1);
|
||||
ApplyLoadedPatches(PPT_ON_LOAD_OR_WHEN_ENABLED);
|
||||
}
|
||||
|
||||
void Patch::ApplyVsyncPatches()
|
||||
{
|
||||
ApplyLoadedPatches(PPT_CONTINUOUSLY);
|
||||
ApplyLoadedPatches(PPT_COMBINED_0_1);
|
||||
}
|
||||
|
||||
// This is for applying patches directly to memory
|
||||
void Patch::ApplyLoadedPatches(patch_place_type place)
|
||||
{
|
||||
@ -1731,3 +1800,31 @@ void Patch::ApplyDynaPatch(const DynamicPatch& patch, u32 address)
|
||||
memWrite32(address + replacement.offset, replacement.value);
|
||||
}
|
||||
}
|
||||
|
||||
const char* Patch::PlaceToString(std::optional<patch_place_type> place)
|
||||
{
|
||||
if (!place.has_value())
|
||||
//: Time when a patch is applied.
|
||||
return TRANSLATE("Patch", "Unknown");
|
||||
|
||||
switch (*place)
|
||||
{
|
||||
case Patch::PPT_ONCE_ON_LOAD:
|
||||
//: Time when a patch is applied.
|
||||
return TRANSLATE("Patch", "Only On Startup");
|
||||
case Patch::PPT_CONTINUOUSLY:
|
||||
//: Time when a patch is applied.
|
||||
return TRANSLATE("Patch", "Every Frame");
|
||||
case Patch::PPT_COMBINED_0_1:
|
||||
//: Time when a patch is applied.
|
||||
return TRANSLATE("Patch", "On Startup & Every Frame");
|
||||
case Patch::PPT_ON_LOAD_OR_WHEN_ENABLED:
|
||||
//: Time when a patch is applied.
|
||||
return TRANSLATE("Patch", "On Startup & When Enabled");
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -29,23 +29,22 @@ namespace Patch
|
||||
// In PCSX2 it indicates how/when/where the patch line should be applied. If
|
||||
// place is not one of the supported values then the patch line is never applied.
|
||||
// PCSX2 currently supports the following values:
|
||||
// 0 - apply the patch line once on game boot/startup
|
||||
// 0 - apply the patch line once on game boot only
|
||||
// 1 - apply the patch line continuously (technically - on every vsync)
|
||||
// 2 - effect of 0 and 1 combined, see below
|
||||
// 3 - apply the patch line once on game boot or when enabled in the GUI
|
||||
// Note:
|
||||
// - while it may seem that a value of 1 does the same as 0, but also later
|
||||
// continues to apply the patch on every vsync - it's not.
|
||||
// The current (and past) behavior is that these patches are applied at different
|
||||
// places at the code, and it's possible, depending on circumstances, that 0 patches
|
||||
// will get applied before the first vsync and therefore earlier than 1 patches.
|
||||
// - There's no "place" value which indicates to apply both once on startup
|
||||
// and then also continuously, however such behavior can be achieved by
|
||||
// duplicating the line where one has a 0 place and the other has a 1 place.
|
||||
enum patch_place_type : u8
|
||||
{
|
||||
PPT_ONCE_ON_LOAD = 0,
|
||||
PPT_CONTINUOUSLY = 1,
|
||||
PPT_COMBINED_0_1 = 2,
|
||||
PPT_ON_LOAD_OR_WHEN_ENABLED = 3,
|
||||
|
||||
PPT_END_MARKER
|
||||
};
|
||||
@ -56,12 +55,14 @@ namespace Patch
|
||||
std::string description;
|
||||
std::string author;
|
||||
|
||||
// This is only populated if all the patch lines in a given group have
|
||||
// the same place value.
|
||||
std::optional<patch_place_type> place;
|
||||
|
||||
std::string_view GetNamePart() const;
|
||||
std::string_view GetNameParentPart() const;
|
||||
};
|
||||
|
||||
using PatchInfoList = std::vector<PatchInfo>;
|
||||
|
||||
struct DynamicPatchEntry
|
||||
{
|
||||
u32 offset;
|
||||
@ -80,7 +81,7 @@ namespace Patch
|
||||
extern const char* PATCH_ENABLE_CONFIG_KEY;
|
||||
extern const char* PATCH_DISABLE_CONFIG_KEY;
|
||||
|
||||
extern PatchInfoList GetPatchInfo(const std::string_view serial, u32 crc, bool cheats, bool showAllCRCS, u32* num_unlabelled_patches);
|
||||
extern std::vector<PatchInfo> GetPatchInfo(const std::string_view serial, u32 crc, bool cheats, bool showAllCRCS, u32* num_unlabelled_patches);
|
||||
|
||||
/// Returns the path to a new cheat/patch pnach for the specified serial and CRC.
|
||||
extern std::string GetPnachFilename(const std::string_view serial, u32 crc, bool cheats);
|
||||
@ -97,6 +98,13 @@ namespace Patch
|
||||
extern void LoadDynamicPatches(const std::vector<DynamicPatch>& patches);
|
||||
extern void ApplyDynamicPatches(u32 pc);
|
||||
|
||||
// Apply all loaded patches that should be applied when the entry point is
|
||||
// being recompiled.
|
||||
extern void ApplyBootPatches();
|
||||
|
||||
// Apply all loaded patches that should be applied during vsync.
|
||||
extern void ApplyVsyncPatches();
|
||||
|
||||
// Patches the emulation memory by applying all the loaded patches with a specific place value.
|
||||
// Note: unless you know better, there's no need to check whether or not different patch sources
|
||||
// are enabled (e.g. ws patches, auto game fixes, etc) before calling ApplyLoadedPatches,
|
||||
@ -112,4 +120,6 @@ namespace Patch
|
||||
extern u32 GetAllActivePatchesCount();
|
||||
|
||||
extern bool IsGloballyToggleablePatch(const PatchInfo& patch_info);
|
||||
|
||||
extern const char* PlaceToString(std::optional<patch_place_type> place);
|
||||
} // namespace Patch
|
||||
|
||||
@ -1252,10 +1252,10 @@ void SaveState_ReportLoadErrorOSD(const std::string& message, std::optional<s32>
|
||||
{
|
||||
if (backup)
|
||||
full_message = fmt::format(
|
||||
TRANSLATE_FS("SaveState", "Failed to load state from slot {}: {}"), *slot, message);
|
||||
TRANSLATE_FS("SaveState", "Failed to load state from backup slot {}: {}"), *slot, message);
|
||||
else
|
||||
full_message = fmt::format(
|
||||
TRANSLATE_FS("SaveState", "Failed to load state from backup slot {}: {}"), *slot, message);
|
||||
TRANSLATE_FS("SaveState", "Failed to load state from slot {}: {}"), *slot, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2832,8 +2832,8 @@ void VMManager::Internal::EntryPointCompilingOnCPUThread()
|
||||
|
||||
HandleELFChange(true);
|
||||
|
||||
Patch::ApplyLoadedPatches(Patch::PPT_ONCE_ON_LOAD);
|
||||
Patch::ApplyLoadedPatches(Patch::PPT_COMBINED_0_1);
|
||||
Patch::ApplyBootPatches();
|
||||
|
||||
// If the config changes at this point, it's a reset, so the game doesn't currently know about the memcard
|
||||
// so there's no need to leave the eject running.
|
||||
FileMcd_CancelEject();
|
||||
@ -2849,8 +2849,7 @@ void VMManager::Internal::VSyncOnCPUThread()
|
||||
{
|
||||
Pad::UpdateMacroButtons();
|
||||
|
||||
Patch::ApplyLoadedPatches(Patch::PPT_CONTINUOUSLY);
|
||||
Patch::ApplyLoadedPatches(Patch::PPT_COMBINED_0_1);
|
||||
Patch::ApplyVsyncPatches();
|
||||
|
||||
// Frame advance must be done *before* pumping messages, because otherwise
|
||||
// we'll immediately reduce the counter we just set.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user