Compare commits

..
34 Commits
Author SHA1 Message Date
refractionpcsx2 66a13d4c3a GS-TC: Only stop checking for RT's if whole read is inside that RT. 2023-03-26 15:28:14 +01:00
JordanTheToaster 87c76ad010 GameDB: Various fixes
Helps alleviate some issues in Shrek 2 and removes round sprite and merge sprite from Driv3r as they cause issues
2023-03-25 06:16:25 +00:00
Dreadmoth 822d292e2f GameDB: Ratchet & Clank 1&2
Fixes broken pause menu.
2023-03-25 06:06:24 +00:00
KamFretoZ 42155dd11b Qt: Add a New Light Theme and Cobalt Theme Fix (#8471) 2023-03-24 12:03:05 +00:00
Stenzek 9b1a2d9eaf GS/DX11: Fix incorrect UBO for P8 conversion 2023-03-24 11:43:51 +00:00
TellowKrinkle 8d0307cedd UI: Fix build with achievements disabled 2023-03-23 23:48:40 -05:00
refractionpcsx2 72b38ce712 CDVD: Don't auto mount disc again if game ejects it. 2023-03-23 20:40:45 +00:00
refractionpcsx2 caf8eedd76 CDVD: Correct SCMD error states and init SCMD result 2023-03-23 20:40:45 +00:00
refractionpcsx2 181b05daf0 CDVD: Don't let it try to close the tray if it isn't open 2023-03-23 20:40:45 +00:00
refractionpcsx2 92b21ac9c2 CDVD: Correct status sequence during disc swap. 2023-03-23 20:40:45 +00:00
Berylskid ad12a3f735 UI: Correct Recommended Values for a few items (#8465) 2023-03-22 13:25:31 +00:00
Stenzek badca7c20b GS/HW: Fix texture replacement precaching option 2023-03-22 10:03:31 +00:00
Stenzek 7cdcfd4b1a Qt: Remove backup AppImage on next launch 2023-03-21 13:48:50 +00:00
Stenzek b02af117f8 CMake: Swap -g for -g1 in Linux Release builds
-g tends to blow the AppImage sizes up a bit too much...
2023-03-21 13:48:16 +00:00
Stenzek 87d269512e GS/HW: Compiler warning fixes 2023-03-21 13:15:31 +00:00
Stenzek 3346349bba GS: Remove GSDeviceNull
It hasn't been used in a while, we just use a normal device
and null renderer instead.
2023-03-21 13:15:31 +00:00
Mrlinkwii 280a41806f GameDB: fixes for Metal Gear Solid 3 Snake Eater 2023-03-20 21:27:03 +00:00
Ikko Eltociear Ashimine 134937082d Counters: fix typo
recieve -> receive
2023-03-20 15:46:56 +00:00
Stenzek 1499994143 CI: Update Linux to Qt 6.4.3 and SDL2 2.26.4 2023-03-20 15:46:32 +00:00
Stenzek 5805142fd7 CrashHandler: Print backtrace on Linux 2023-03-20 15:46:32 +00:00
Stenzek 5fc855e519 CMake: Add libbacktrace module 2023-03-20 15:46:32 +00:00
Stenzek 8c8bf22892 CI: Build libbacktrace in Linux deps 2023-03-20 15:46:32 +00:00
Stenzek ec927e5dd9 CMake: Force debug symbols in Linux Release builds 2023-03-20 15:46:32 +00:00
refractionpcsx2 3a042d8c14 GS: Compensate for misaligned 24bit partial local->host transfers 2023-03-20 14:35:31 +00:00
JordanTheToaster fc88d1de85 GameDB: From Soft game fixes
Adds partial target invalidation to every From Soft game because they used way too much glue.
2023-03-20 11:19:49 +00:00
JordanTheToaster 6cf48e9e2b GameDB: Various fixes
Fixes R&C 3 broken pause menu and broken textures in AC Last Raven.
2023-03-20 10:05:00 +00:00
refractionpcsx2 db22377a0d GS: Remove ExpandTarget on EE Write 2023-03-19 23:32:17 +00:00
Silent 443cc08229 VMManager: Fix "X widescreen patches loaded" text when loading from files 2023-03-19 23:31:52 +00:00
Stenzek 6ad222117d GS: Reduce MAD buffering draw size
It's silly to draw to the whole double-sized render target, but discard
half the pixels.

Also centralizes the constant setup, get rid of the duplication.
2023-03-19 23:31:37 +00:00
Stenzek b26acad721 GS: Sample LOD 0 explicitly in interlace shaders
Can't use normal sampling because the derivates are undefined in
non-uniform control flow (in MAD).
2023-03-19 23:31:37 +00:00
refractionpcsx2 76e8bfe42f GS-TC: Make sure drawn/target coords match for adjusting drawn rect 2023-03-19 15:18:54 +00:00
refractionpcsx2 1f6704dbda GS-TC: mask target rect with drawn area before download. 2023-03-19 15:18:54 +00:00
Toastarrr 33ea4e6225 Debugger: fix memory search crash 2023-03-19 13:44:11 +00:00
Toastarrr d9cecbde7d Debugger: use unsigned long long for memory search 2023-03-19 13:44:11 +00:00
57 changed files with 835 additions and 526 deletions
@@ -4,23 +4,26 @@ set -e
INSTALLDIR="$HOME/deps"
NPROCS="$(getconf _NPROCESSORS_ONLN)"
SDL=SDL2-2.26.0
QT=6.3.1
SDL=SDL2-2.26.4
QT=6.4.3
LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
mkdir -p deps-build
cd deps-build
cat > SHASUMS <<EOF
8000d7169febce93c84b6bdf376631f8179132fd69f7015d4dadb8b9c2bdb295 $SDL.tar.gz
0a64421d9c2469c2c48490a032ab91d547017c9cc171f3f8070bc31888f24e03 qtbase-everywhere-src-$QT.tar.xz
7b19f418e6f7b8e23344082dd04440aacf5da23c5a73980ba22ae4eba4f87df7 qtsvg-everywhere-src-$QT.tar.xz
c412750f2aa3beb93fce5f30517c607f55daaeb7d0407af206a8adf917e126c1 qttools-everywhere-src-$QT.tar.xz
d7bdd55e2908ded901dcc262157100af2a490bf04d31e32995f6d91d78dfdb97 qttranslations-everywhere-src-$QT.tar.xz
6f14fea2d172a5b4170be3efcb0e58535f6605b61bcd823f6d5c9d165bb8c0f0 qtwayland-everywhere-src-$QT.tar.xz
1a0f686498fb768ad9f3f80b39037a7d006eac093aad39cb4ebcc832a8887231 $SDL.tar.gz
fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.zip
5087c9e5b0165e7bc3c1a4ab176b35d0cd8f52636aea903fa377bdba00891a60 qtbase-everywhere-src-$QT.tar.xz
88315f886cf81898705e487cedba6e6160724359d23c518c92c333c098879a4a qtsvg-everywhere-src-$QT.tar.xz
867df829cd5cd3ae8efe62e825503123542764b13c96953511e567df70c5a091 qttools-everywhere-src-$QT.tar.xz
79e56b7800d49649a8a8010818538c367a829e0b7a09d5f60bd3aecf5abe972c qttranslations-everywhere-src-$QT.tar.xz
c6b161da8f4c01e48c10b7b558a0a01ac07dba9b907b13a98ff5d89f46bc4789 qtwayland-everywhere-src-$QT.tar.xz
EOF
curl -L \
-O "https://libsdl.org/release/$SDL.tar.gz" \
-O "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE.zip" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
@@ -37,6 +40,14 @@ make "-j$NPROCS"
make install
cd ..
echo "Building libbacktrace..."
unzip "$LIBBACKTRACE.zip"
cd "libbacktrace-$LIBBACKTRACE"
./configure --prefix="$HOME/deps"
make
make install
cd ..
# Couple notes:
# -fontconfig is needed otherwise Qt Widgets render only boxes.
# -qt-doubleconversion avoids a dependency on libdouble-conversion.
@@ -65,19 +76,6 @@ cd ../../
echo "Building Qt Wayland..."
tar xf "qtwayland-everywhere-src-$QT.tar.xz"
cd "qtwayland-everywhere-src-$QT"
# qtwayland does not build without qml/qtdeclarative in 6.3.1. Work around it.
patch -u src/compositor/CMakeLists.txt <<EOF
--- src/compositor/CMakeLists.txt 2022-06-08 13:44:30.000000000 +1000
+++ src/compositor/CMakeLists.txt 2022-07-17 20:05:25.461881785 +1000
@@ -46,7 +46,6 @@
global/qtwaylandcompositorglobal.h
global/qtwaylandqmlinclude.h
global/qwaylandcompositorextension.cpp global/qwaylandcompositorextension.h global/qwaylandcompositorextension_p.h
- global/qwaylandquickextension.cpp global/qwaylandquickextension.h
global/qwaylandutils_p.h
hardware_integration/qwlclientbufferintegration.cpp hardware_integration/qwlclientbufferintegration_p.h
wayland_wrapper/qwlbuffermanager.cpp wayland_wrapper/qwlbuffermanager_p.h
EOF
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
@@ -103,6 +101,30 @@ patch -u src/linguist/CMakeLists.txt <<EOF
add_subdirectory(linguist)
endif()
EOF
# Also force disable clang scanning, it gets very confused.
patch -u configure.cmake <<EOF
--- configure.cmake
+++ configure.cmake
@@ -14,12 +14,12 @@
# Presumably because 6.0 ClangConfig.cmake files are not good enough?
# In any case explicitly request a minimum version of 8.x for now, otherwise
# building with CMake will fail at compilation time.
-qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang)
+#qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang)
# special case end
-if(TARGET WrapLibClang::WrapLibClang)
- set(TEST_libclang "ON" CACHE BOOL "Required libclang version found." FORCE)
-endif()
+#if(TARGET WrapLibClang::WrapLibClang)
+# set(TEST_libclang "ON" CACHE BOOL "Required libclang version found." FORCE)
+#endif()
EOF
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF ..
+189 -26
View File
@@ -293,6 +293,7 @@ PBPX-95516:
eeRoundMode: 0 # Fixes Hydrodisplacer behaviour.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
PBPX-95517:
name: "Network Adapter Start-Up Disc"
region: "NTSC-U"
@@ -401,6 +402,7 @@ PCPX-98017:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
PDPX-99109:
@@ -472,6 +474,7 @@ SCAJ-20001:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCAJ-20002:
name: "Gallop Racer 6 - Revolution"
region: "NTSC-Unk"
@@ -665,6 +668,8 @@ SCAJ-20044:
SCAJ-20045:
name: "Shadow Tower Abyss"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20046:
name: "Siren"
region: "NTSC-Unk"
@@ -720,6 +725,8 @@ SCAJ-20063:
SCAJ-20064:
name: "Nebula - Echo Night"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20065:
name: "EyeToy - Play [with Camera]"
region: "NTSC-Unk"
@@ -792,6 +799,8 @@ SCAJ-20075:
SCAJ-20076:
name: "Armored Core - Nexus [Disc 1]"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -802,6 +811,8 @@ SCAJ-20076:
SCAJ-20077:
name: "Armored Core - Nexus [Disc 2]"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -820,6 +831,7 @@ SCAJ-20078:
gsHWFixes:
halfPixelOffset: 2 # Reduces ghosting.
preloadFrameData: 1 # Fixes red cracklines on walls.
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20079:
name: "Katamari Damacy"
region: "NTSC-Unk"
@@ -945,6 +957,8 @@ SCAJ-20104:
SCAJ-20105:
name: "Armored Core - Nine breaker"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20107:
name: "Bakufuu Slash! Kizna Arashi"
region: "NTSC-Unk"
@@ -959,6 +973,7 @@ SCAJ-20109:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
SCAJ-20110:
@@ -986,6 +1001,8 @@ SCAJ-20114:
SCAJ-20115:
name: "Yoshitsune Eiyuuden"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20116:
name: "Death by Degrees - Tekken - Nina Williams"
region: "NTSC-Ch-J"
@@ -1025,6 +1042,8 @@ SCAJ-20120:
SCAJ-20121:
name: "Armored Core - Formula Front"
region: "NTSC-Unk"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20122:
name: "Swords of Destiny"
region: "NTSC-Unk"
@@ -1157,6 +1176,7 @@ SCAJ-20143:
region: "NTSC-Unk"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SCAJ-20144:
name: "Zhuo Hou La 3"
region: "NTSC-Ch"
@@ -1651,6 +1671,8 @@ SCCS-40010:
SCCS-40011:
name: "Armored Core 2 - Another Age"
region: "NTSC-C"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SCCS-40014:
name: "World Soccer Winning Eleven 7 - International"
region: "NTSC-C"
@@ -1924,6 +1946,7 @@ SCED-51075:
eeRoundMode: 0 # Fixes Hydrodisplacer behaviour.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCED-51140:
name: "PS2 Bonus Demo 03"
region: "PAL-M5"
@@ -3189,6 +3212,7 @@ SCES-50916:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCES-50917:
name: "Sly Raccoon"
region: "PAL-M5"
@@ -3413,6 +3437,7 @@ SCES-51607:
gsHWFixes:
mipmap: 1
autoFlush: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
dynaPatches:
- pattern:
- { offset: 0x0, value: 0x0280202d }
@@ -3728,6 +3753,7 @@ SCES-52456:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
memcardFilters: # Reads Ratchet 1 & 2 data.
@@ -4922,6 +4948,7 @@ SCKA-20011:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCKA-20012:
name: "Arc the Lad - Jeong Ryeo Hui Hwang Ho"
region: "NTSC-K"
@@ -5063,6 +5090,7 @@ SCKA-20037:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
memcardFilters:
@@ -5106,6 +5134,8 @@ SCKA-20045:
SCKA-20047:
name: "Armored Core Nine Breaker"
region: "NTSC-K"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCKA-20047"
- "SLKA-25201"
@@ -5774,6 +5804,7 @@ SCPS-15037:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCPS-15038:
name: "Operator's Side"
region: "NTSC-J"
@@ -5865,6 +5896,7 @@ SCPS-15056:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
memcardFilters:
- "SCPS-15056"
- "SCPS-15037"
@@ -6013,6 +6045,7 @@ SCPS-15084:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
memcardFilters:
@@ -6390,6 +6423,7 @@ SCPS-19211:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCPS-19213:
name: "Operator's Side [PlayStation 2 The Best] [with Microphone]"
region: "NTSC-J"
@@ -6449,6 +6483,7 @@ SCPS-19302:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCPS-19303:
name: "Boku no Natsuyasumi 2 [PlayStation 2 The Best]"
region: "NTSC-J"
@@ -6497,6 +6532,7 @@ SCPS-19309:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
SCPS-19310:
@@ -6506,6 +6542,7 @@ SCPS-19310:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCPS-19311:
name: "Saru Get You 3 [PlayStation 2 The Best]"
region: "NTSC-J"
@@ -6547,6 +6584,7 @@ SCPS-19316:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCPS-19317:
name: "Ratchet & Clank 2 - Going Commando [PlayStation 2 The Best]"
region: "NTSC-J"
@@ -6554,6 +6592,7 @@ SCPS-19317:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
autoFlush: 1
memcardFilters:
- "SCAJ-20001"
@@ -6846,6 +6885,7 @@ SCPS-55024:
eeClampMode: 2 # Fixes Abnormal AI behavior.
gsHWFixes:
halfPixelOffset: 1 # Corrects positioning of reflections on player's AC.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCPS-55024"
- "SLPS-25007"
@@ -7469,6 +7509,7 @@ SCUS-97199:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCUS-97200:
name: "Kiosk Demo Disc 2.05"
region: "NTSC-U"
@@ -7509,6 +7550,7 @@ SCUS-97209:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCUS-97210:
name: "Sly Cooper and the Thievius Raccoonus [Demo]"
region: "NTSC-U"
@@ -7632,6 +7674,7 @@ SCUS-97240:
eeRoundMode: 0 # Fixes Hydrodisplacer behaviour.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
SCUS-97241:
name: "Official U.S. PlayStation Magazine Demo Disc 066"
region: "NTSC-U"
@@ -7737,6 +7780,7 @@ SCUS-97268:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
autoFlush: 1
memcardFilters:
- "SCUS-97268"
@@ -7836,6 +7880,7 @@ SCUS-97322:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
autoFlush: 1
SCUS-97323:
name: "Ratchet & Clank 2 - Going Commando [Retail Employees Demo]"
@@ -7844,6 +7889,7 @@ SCUS-97323:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
autoFlush: 1
SCUS-97324:
name: "Kiosk Demo Disc 2.11"
@@ -7942,6 +7988,7 @@ SCUS-97353:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
memcardFilters:
@@ -8124,6 +8171,7 @@ SCUS-97411:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
SCUS-97412:
@@ -8143,6 +8191,7 @@ SCUS-97413:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
SCUS-97414:
@@ -8610,6 +8659,7 @@ SCUS-97513:
- EETimingHack # Fixes SPR errors while going in-game.
gsHWFixes:
mipmap: 1
partialTargetInvalidation: 1 # Fixes broken pause screen.
autoFlush: 1
SCUS-97514:
name: "ATV Offroad Fury 3 [Greatest Hits]"
@@ -8646,6 +8696,7 @@ SCUS-97518:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
SCUS-97519:
@@ -10182,6 +10233,8 @@ SLES-50224:
compat: 5
speedHacks:
MTVUSpeedHack: 0 # Prevents broken textures and graphics.
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLES-50225:
name: "Escape from Monkey Island"
region: "PAL-E"
@@ -11620,9 +11673,6 @@ SLES-50876:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLES-50877:
@@ -11687,6 +11737,7 @@ SLES-50905:
eeClampMode: 2 # Fixes Abnormal AI behavior.
gsHWFixes:
halfPixelOffset: 1 # Corrects positioning of reflections on player's AC.
partialTargetInvalidation: 1 # Fixes broken textures.
# Save import option was removed from PAL release.
SLES-50906:
name: "Master Rally"
@@ -11708,6 +11759,7 @@ SLES-50920:
gsHWFixes:
preloadFrameData: 1 # Fixes invisible lava, there is another issue that needs skipdraw 1 for blurry font but it removes much brightness.
halfPixelOffset: 2 # Fixes font rendering.
partialTargetInvalidation: 1 # Fixes broken textures.
patches:
401F4726:
content: |-
@@ -14381,9 +14433,6 @@ SLES-52153:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLES-52155:
@@ -14820,27 +14869,32 @@ SLES-52379:
region: "PAL-E"
compat: 5
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52380:
name: "Shrek 2"
region: "PAL-F"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52381:
name: "Shrek 2"
region: "PAL-G"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52382:
name: "Shrek 2"
region: "PAL-S"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52383:
name: "Shrek 2"
region: "PAL-I"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52384:
name: "Project Zero 2 - Crimson Butterfly"
region: "PAL-M5"
@@ -14986,7 +15040,8 @@ SLES-52457:
name: "Shrek 2"
region: "PAL-SW"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLES-52458:
name: "Disgaea - Hour of Darkness"
region: "PAL-E"
@@ -17349,6 +17404,7 @@ SLES-53411:
gsHWFixes:
halfPixelOffset: 2 # Reduces ghosting.
preloadFrameData: 1 # Fixes red cracklines on walls.
partialTargetInvalidation: 1 # Fixes broken textures.
SLES-53413:
name: "Rebel Raiders - Operation Nighthawk"
region: "PAL-M5"
@@ -17356,6 +17412,8 @@ SLES-53414:
name: "Echo Night - Beyond"
region: "PAL-E"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLES-53415:
name: "Call of Duty 2 - Big Red One"
region: "PAL-E"
@@ -18623,6 +18681,8 @@ SLES-53813:
SLES-53819:
name: "Armored Core - Nine Breaker"
region: "PAL-E"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLES-53819"
- "SLES-82036"
@@ -18632,6 +18692,7 @@ SLES-53820:
region: "PAL-E"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SLES-53821:
name: "Radio Helicopter II"
region: "PAL-E"
@@ -23235,6 +23296,7 @@ SLES-82013:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurry characters.
autoFlush: 1 # Fixes lens flare.
SLES-82018:
name: "Cy Girls [Ice Disc]"
region: "PAL-E-F-S"
@@ -23258,6 +23320,7 @@ SLES-82024:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurry characters.
autoFlush: 1 # Fixes lens flare.
SLES-82026:
name: "Metal Gear Solid 3 - Snake Eater"
region: "PAL-S"
@@ -23265,6 +23328,7 @@ SLES-82026:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurry characters.
autoFlush: 1 # Fixes lens flare.
SLES-82028:
name: "Star Ocean 3 - Till the End of Time [Disc 1 of 2]"
region: "PAL-E"
@@ -23312,6 +23376,7 @@ SLES-82032:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurry characters.
autoFlush: 1 # Fixes lens flare.
SLES-82034:
name: "Xenosaga Episode II [Disc 1 of 2]"
region: "PAL-M3"
@@ -23335,12 +23400,16 @@ SLES-82035:
SLES-82036:
name: "Armored Core - Nexus [Disc 1 of 2 - Evolution Disc]"
region: "PAL-M5"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLES-82036"
- "SLES-82037"
SLES-82037:
name: "Armored Core - Nexus [Disc 2 of 2 - Revolution Disc]"
region: "PAL-M5"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLES-82036"
- "SLES-82037"
@@ -24064,6 +24133,7 @@ SLKA-25171:
gsHWFixes:
halfPixelOffset: 2 # Reduces ghosting.
preloadFrameData: 1 # Fixes red cracklines on walls.
partialTargetInvalidation: 1 # Fixes broken textures.
SLKA-25172:
name: "Harry Potter and the Prisoner of Azkaban"
region: "NTSC-K"
@@ -24119,9 +24189,6 @@ SLKA-25196:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLKA-25198:
@@ -24141,12 +24208,16 @@ SLKA-25200:
SLKA-25201:
name: "Armored Core Nexus Evolution [Disc 1]"
region: "NTSC-K"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLKA-25201"
- "SLKA-25202"
SLKA-25202:
name: "Armored Core Nexus Revolution [Disc 2]"
region: "NTSC-K"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLKA-25201"
- "SLKA-25202"
@@ -24316,6 +24387,7 @@ SLKA-25251:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLKA-25252:
name: "Forgotten Realms - Demon Stone"
region: "NTSC-K"
@@ -24340,6 +24412,8 @@ SLKA-25258:
name: "Story of the Hero Yoshitsune, The"
region: "NTSC-K"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLKA-25259:
name: "Swords of Destiny"
region: "NTSC-K"
@@ -24375,6 +24449,8 @@ SLKA-25268:
SLKA-25270:
name: "Armored Core - Formula Front"
region: "NTSC-K"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLKA-25274:
name: "Princess Maker 4"
region: "NTSC-K"
@@ -25387,6 +25463,13 @@ SLPM-60125:
SLPM-60126:
name: "Hajime no Ippo - Victorious Boxers [Trial]"
region: "NTSC-J"
SLPM-60127:
name: "Kurikuri Mix [Taikenban trial]"
region: "NTSC-J"
speedHacks:
MTVUSpeedHack: 0 # Prevents broken textures and graphics.
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPM-60138:
name: "Klonoa 2 - Lunatea's Veil [Trial]"
region: "NTSC-J"
@@ -25622,9 +25705,6 @@ SLPM-61092:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLPM-61117:
@@ -25632,6 +25712,18 @@ SLPM-61117:
region: "NTSC-J"
gameFixes:
- EETimingHack # Fixes garbled character animation.
SLPM-61118:
name: "Armored Core - Last Raven [Famitsu Special Trial Version]"
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SLPM-61119:
name: "Armored Core - Last Raven [Trial]"
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SLPM-61120:
name: "Drag-on Dragoon 2 - Fuuin no Aka, Haitoku no Kuro [Trial Version]"
region: "NTSC-J"
@@ -30366,7 +30458,8 @@ SLPM-65697:
name: "Shrek 2"
region: "NTSC-J"
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLPM-65698:
name: "Love Songs - ADV Futaba Riho 14-sai Natsu"
region: "NTSC-J"
@@ -30524,9 +30617,6 @@ SLPM-65741:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLPM-65742:
@@ -30689,6 +30779,7 @@ SLPM-65789:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLPM-65790:
name: "Metal Gear Solid 3 - Snake Eater"
region: "NTSC-J"
@@ -30696,6 +30787,7 @@ SLPM-65790:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLPM-65791:
name: "S.L.A.I. - Steel Lancer Arena International"
region: "NTSC-J"
@@ -34597,6 +34689,7 @@ SLPM-66794:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLPM-66796:
name: "Metal Gear Solid - 20th Anniversary Collection"
region: "NTSC-J"
@@ -35496,6 +35589,13 @@ SLPM-68516:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLPM-68520:
name: "Armored Core - Last Raven [Monthly Champion magazine Special Edition]"
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SLPM-68521:
name: "Dot Hack Fraegment [Senkou Release-ban]"
region: "NTSC-J"
@@ -37296,6 +37396,8 @@ SLPS-25013:
region: "NTSC-J"
speedHacks:
MTVUSpeedHack: 0 # Prevents broken textures and graphics.
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25014:
name: "Choro Q HG [Jenny Hi-Grade Box]"
region: "NTSC-J"
@@ -37418,6 +37520,7 @@ SLPS-25040:
eeClampMode: 2 # Fixes Abnormal AI behavior.
gsHWFixes:
halfPixelOffset: 1 # Corrects positioning of reflections on player's AC.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCPS-55024"
- "SLPS-25007"
@@ -37448,6 +37551,7 @@ SLPS-25044:
textureInsideRT: 1 # Fixes missing effects.
mipmap: 2 # Fixes shimmering noisy textures
trilinearFiltering: 1 # Fixes shimmering noisy textures
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25045:
name: "Lilie no Atelier - Salburg no Renkinjutsushi 3"
region: "NTSC-J"
@@ -37499,6 +37603,7 @@ SLPS-25057:
gsHWFixes:
preloadFrameData: 1 # Fixes invisible lava, there is another issue that needs skipdraw 1 for blurry font but it removes much brightness.
halfPixelOffset: 2 # Fixes font rendering.
partialTargetInvalidation: 1 # Fixes broken textures.
patches:
04C3765E:
content: |-
@@ -38045,6 +38150,8 @@ SLPS-25217:
name: "Shadow Tower Abyss"
region: "NTSC-J"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25219:
name: "Canary"
region: "NTSC-J"
@@ -38344,6 +38451,8 @@ SLPS-25314:
name: "Nebula - Echo Night"
region: "NTSC-J"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25315:
name: "One Piece - Grand Battle 3"
region: "NTSC-J"
@@ -38400,6 +38509,7 @@ SLPS-25329:
gsHWFixes:
halfPixelOffset: 2 # Reduces ghosting.
preloadFrameData: 1 # Fixes red cracklines on walls.
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25330:
name: "Dragon Ball Z - Budokai 2"
region: "NTSC-J"
@@ -38436,6 +38546,8 @@ SLPS-25337:
SLPS-25338:
name: "Armored Core - Nexus [Disc 1]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -38446,6 +38558,8 @@ SLPS-25338:
SLPS-25339:
name: "Armored Core - Nexus [Disc 2]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -38676,6 +38790,8 @@ SLPS-25393:
SLPS-25394:
name: "Another Century's Episode"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25395:
name: "Sentimental Prelude"
region: "NTSC-J"
@@ -38731,6 +38847,8 @@ SLPS-25407:
SLPS-25408:
name: "Armored Core - Nine Breaker"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLPS-25408"
- "SCAJ-20076"
@@ -38899,6 +39017,8 @@ SLPS-25453:
SLPS-25454:
name: "Daisenryaku VII Exceed"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25455:
name: "Sanyo Pachinko Paradise 11"
region: "NTSC-J"
@@ -38927,11 +39047,14 @@ SLPS-25460:
SLPS-25461:
name: "Armored Core - Formula Front"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25462:
name: "Armored Core - Last Raven"
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLPS-25338"
- "SLPS-25339"
@@ -39481,6 +39604,8 @@ SLPS-25623:
name: "Another Century's Episode 2"
region: "NTSC-J"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25624:
name: "Futakoi-Futakoi Island Collection"
region: "NTSC-J"
@@ -39941,6 +40066,18 @@ SLPS-25729:
SLPS-25730:
name: "Armored Core [Machine Side Box]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25731:
name: "Armored Core 2 [Machine Side Box]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25732:
name: "Armored Core 3 [Machine Side Box]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25733:
name: "Super Robot Taisen OG - Original Generations"
region: "NTSC-J"
@@ -40114,6 +40251,8 @@ SLPS-25784:
region: "NTSC-J"
clampModes:
vuClampMode: 3 # Was used to fix game crash, but not sure it's required anymore.
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25786:
name: "Hisshou Pachinko-Pachislot Kouryaku Series Vol.10 - CR Shinseiki Evangelion - Kiseki no kachi Ha"
region: "NTSC-J"
@@ -40265,6 +40404,8 @@ SLPS-25828:
SLPS-25829:
name: "Another Century's Episode 2 [Special Vocal Version]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-25830:
name: "Zero no Tsukaima - Muma ga Tsumugu Yokaze no Gensoukyoku [Limited Edition]"
region: "NTSC-J"
@@ -40785,6 +40926,8 @@ SLPS-73201:
SLPS-73202:
name: "Armored Core - Nexus [PlayStation 2 The Best] [Disc 1]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -40795,6 +40938,8 @@ SLPS-73202:
SLPS-73203:
name: "Armored Core - Nexus [PlayStation 2 The Best] [Disc 2]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCAJ-20076"
- "SCAJ-20077"
@@ -40941,6 +41086,8 @@ SLPS-73226:
SLPS-73227:
name: "Another Century's Episode [PlayStation 2 The Best]"
region: "NTSC-J"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLPS-73228:
name: "Fuuun Bakumatsuden [PlayStation 2 The Best]"
region: "NTSC-J"
@@ -41078,6 +41225,7 @@ SLPS-73247:
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLPS-25338"
- "SLPS-25339"
@@ -41222,6 +41370,7 @@ SLPS-73411:
eeClampMode: 2 # Fixes Abnormal AI behavior.
gsHWFixes:
halfPixelOffset: 1 # Corrects positioning of reflections on player's AC.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SCPS-55024"
- "SLPS-25007"
@@ -42292,6 +42441,7 @@ SLUS-20249:
eeClampMode: 2 # Fixes Abnormal AI behavior.
gsHWFixes:
halfPixelOffset: 1 # Corrects positioning of reflections on player's AC.
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters: # Can import data from regular Armored Core 2.
- "SLUS-20249"
- "SLUS-20014"
@@ -42589,6 +42739,7 @@ SLUS-20318:
gsHWFixes:
preloadFrameData: 1 # Fixes invisible lava, there is another issue that needs skipdraw 1 for blurry font but it removes much brightness.
halfPixelOffset: 2 # Fixes font rendering.
partialTargetInvalidation: 1 # Fixes broken textures.
patches:
36E02E91:
content: |-
@@ -42704,6 +42855,7 @@ SLUS-20343:
textureInsideRT: 1 # Fixes missing effects.
mipmap: 2 # Fixes shimmering noisy textures
trilinearFiltering: 1 # Fixes shimmering noisy textures
partialTargetInvalidation: 1 # Fixes broken textures.
SLUS-20344:
name: "Rez"
region: "NTSC-U"
@@ -42745,6 +42897,7 @@ SLUS-20353:
gsHWFixes:
preloadFrameData: 1 # Fixes invisible lava, there is another issue that needs skipdraw 1 for blurry font but it removes much brightness.
halfPixelOffset: 2 # Fixes font rendering.
partialTargetInvalidation: 1 # Fixes broken textures.
SLUS-20354:
name: "Red Card Soccer 2003"
region: "NTSC-U"
@@ -43906,9 +44059,6 @@ SLUS-20587:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
autoFlush: 1
roundSprite: 2 # Fixes misaligned lighting.
mergeSprite: 1 # Fixes misaligned lighting.
cpuCLUTRender: 1 # Fixes janky coloured cars.
gpuTargetCLUT: 1 # Fixes janky coloured cars.
textureInsideRT: 1 # Fixes car textures.
SLUS-20588:
@@ -44651,7 +44801,8 @@ SLUS-20745:
region: "NTSC-U"
compat: 5
gsHWFixes:
mipmap: 1 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
mipmap: 2 # Partially fixes the sun effects, but the game suffers from depth/blending issues.
trilinearFiltering: 1
SLUS-20746:
name: "Rogue Ops"
region: "NTSC-U"
@@ -45486,6 +45637,7 @@ SLUS-20915:
- BlitInternalFPSHack # Fixes internal FPS detection.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
autoFlush: 1 # Fixes lens flare.
SLUS-20916:
name: "Dance Dance Revolution EXTREME"
region: "NTSC-U"
@@ -45571,6 +45723,8 @@ SLUS-20928:
name: "Echo Night - Beyond"
region: "NTSC-U"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
SLUS-20929:
name: "Battle Assault 3 featuring Gundam Seed"
region: "NTSC-U"
@@ -45885,6 +46039,8 @@ SLUS-20986:
name: "Armored Core Nexus [Evolution Disc]"
region: "NTSC-U"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLUS-20986"
- "SLUS-21079"
@@ -46020,6 +46176,7 @@ SLUS-21007:
gsHWFixes:
halfPixelOffset: 2 # Reduces ghosting.
preloadFrameData: 1 # Fixes red cracklines on walls.
partialTargetInvalidation: 1 # Fixes broken textures.
SLUS-21008:
name: "Katamari Damacy"
region: "NTSC-U"
@@ -46392,6 +46549,8 @@ SLUS-21078:
SLUS-21079:
name: "Armored Core Nexus [Revolution Disc]"
region: "NTSC-U"
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters:
- "SLUS-20986"
- "SLUS-21079"
@@ -46985,6 +47144,8 @@ SLUS-21200:
name: "Armored Core - Nine Breaker"
region: "NTSC-U"
compat: 5
gsHWFixes:
partialTargetInvalidation: 1 # Fixes broken textures.
memcardFilters: # Can import data from AC:Nexus.
- "SLUS-21200"
- "SLUS-20986"
@@ -47828,6 +47989,7 @@ SLUS-21338:
compat: 5
gsHWFixes:
halfPixelOffset: 2 # Corrects shadow alignment and reduces blurriness.
partialTargetInvalidation: 1 # Fixes broken textures.
SLUS-21339:
name: "Puzzle Collection - Crosswords & More!"
region: "NTSC-U"
@@ -51690,6 +51852,7 @@ TCES-52456:
gsHWFixes:
mipmap: 1 # Fixes garbage textures in the distance.
disablePartialInvalidation: 1 # Prevents the situation that a level (Aquatos) doesn't render characters and geometry.
partialTargetInvalidation: 1 # Fixes broken pause screen.
halfPixelOffset: 2 # Fixes misaligned bloom.
autoFlush: 1 # Helps fix misaligned bloom.
TCES-52582:
+14 -18
View File
@@ -23,7 +23,7 @@ float4 ps_main0(PS_INPUT input) : SV_Target0
const int vpos = int(input.p.y); // vertical position of destination texture
if ((vpos & 1) == field)
return Texture.Sample(Sampler, input.t);
return Texture.SampleLevel(Sampler, input.t, 0);
else
discard;
@@ -34,7 +34,7 @@ float4 ps_main0(PS_INPUT input) : SV_Target0
// Bob shader
float4 ps_main1(PS_INPUT input) : SV_Target0
{
return Texture.Sample(Sampler, input.t);
return Texture.SampleLevel(Sampler, input.t, 0);
}
@@ -42,9 +42,9 @@ float4 ps_main1(PS_INPUT input) : SV_Target0
float4 ps_main2(PS_INPUT input) : SV_Target0
{
float2 vstep = float2(0.0f, ZrH.y);
float4 c0 = Texture.Sample(Sampler, input.t - vstep);
float4 c1 = Texture.Sample(Sampler, input.t);
float4 c2 = Texture.Sample(Sampler, input.t + vstep);
float4 c0 = Texture.SampleLevel(Sampler, input.t - vstep, 0);
float4 c1 = Texture.SampleLevel(Sampler, input.t, 0);
float4 c2 = Texture.SampleLevel(Sampler, input.t + vstep, 0);
return (c0 + c1 * 2 + c2) / 4;
}
@@ -66,15 +66,11 @@ float4 ps_main3(PS_INPUT input) : SV_Target0
const int vres = int(ZrH.z) >> 1; // vertical resolution of source texture
const int lofs = ((((vres + 1) >> 1) << 1) - vres) & bank; // line alignment offset for bank 1
const int vpos = int(input.p.y) + lofs; // vertical position of destination texture
const float2 bofs = float2(0.0f, 0.5f * bank); // vertical offset of the current bank relative to source texture size
const float2 vscale = float2(1.0f, 2.0f); // scaling factor from source to destination texture
const float2 optr = input.t - bofs; // used to check if the current destination line is within the current bank
const float2 iptr = optr * vscale; // pointer to the current pixel in the source texture
// if the index of current destination line belongs to the current fiels we update it, otherwise
// we leave the old line in the destination buffer
if ((optr.y >= 0.0f) && (optr.y < 0.5f) && ((vpos & 1) == field))
return Texture.Sample(Sampler, iptr);
if ((vpos & 1) == field)
return Texture.SampleLevel(Sampler, input.t, 0);
else
discard;
@@ -133,13 +129,13 @@ float4 ps_main4(PS_INPUT input) : SV_Target0
// calculating motion, only relevant for missing lines where the "center line" is pointed by p_t1
float4 hn = Texture.Sample(Sampler, p_t0 - lofs); // new high pixel
float4 cn = Texture.Sample(Sampler, p_t1); // new center pixel
float4 ln = Texture.Sample(Sampler, p_t0 + lofs); // new low pixel
float4 hn = Texture.SampleLevel(Sampler, p_t0 - lofs, 0); // new high pixel
float4 cn = Texture.SampleLevel(Sampler, p_t1, 0); // new center pixel
float4 ln = Texture.SampleLevel(Sampler, p_t0 + lofs, 0); // new low pixel
float4 ho = Texture.Sample(Sampler, p_t2 - lofs); // old high pixel
float4 co = Texture.Sample(Sampler, p_t3); // old center pixel
float4 lo = Texture.Sample(Sampler, p_t2 + lofs); // old low pixel
float4 ho = Texture.SampleLevel(Sampler, p_t2 - lofs, 0); // old high pixel
float4 co = Texture.SampleLevel(Sampler, p_t3, 0); // old center pixel
float4 lo = Texture.SampleLevel(Sampler, p_t2 + lofs, 0); // old low pixel
float3 mh = hn.rgb - ho.rgb; // high pixel motion
float3 mc = cn.rgb - co.rgb; // center pixel motion
@@ -164,7 +160,7 @@ float4 ps_main4(PS_INPUT input) : SV_Target0
if ((vpos & 1) == field)
{
// output coordinate present on current field
return Texture.Sample(Sampler, p_t0);
return Texture.SampleLevel(Sampler, p_t0, 0);
}
else if ((iptr.y > 0.5f - lofs.y) || (iptr.y < 0.0 + lofs.y))
{
+14 -18
View File
@@ -19,7 +19,7 @@ void ps_main0()
int vpos = int(gl_FragCoord.y); // vertical position of destination texture
if ((vpos & 1) == field)
SV_Target0 = texture(TextureSampler, PSin_t);
SV_Target0 = textureLod(TextureSampler, PSin_t, 0);
else
discard;
}
@@ -28,7 +28,7 @@ void ps_main0()
// Bob shader
void ps_main1()
{
SV_Target0 = texture(TextureSampler, PSin_t);
SV_Target0 = textureLod(TextureSampler, PSin_t, 0);
}
@@ -36,9 +36,9 @@ void ps_main1()
void ps_main2()
{
vec2 vstep = vec2(0.0f, ZrH.y);
vec4 c0 = texture(TextureSampler, PSin_t - vstep);
vec4 c1 = texture(TextureSampler, PSin_t);
vec4 c2 = texture(TextureSampler, PSin_t + vstep);
vec4 c0 = textureLod(TextureSampler, PSin_t - vstep, 0);
vec4 c1 = textureLod(TextureSampler, PSin_t, 0);
vec4 c2 = textureLod(TextureSampler, PSin_t + vstep, 0);
SV_Target0 = (c0 + c1 * 2.0f + c2) / 4.0f;
}
@@ -60,15 +60,11 @@ void ps_main3()
int vres = int(ZrH.z) >> 1; // vertical resolution of source texture
int lofs = ((((vres + 1) >> 1) << 1) - vres) & bank; // line alignment offset for bank 1
int vpos = int(gl_FragCoord.y) + lofs; // vertical position of destination texture
vec2 bofs = vec2(0.0f, 0.5f * float(bank)); // vertical offset of the current bank relative to source texture size
vec2 vscale = vec2(1.0f, 2.0f); // scaling factor from source to destination texture
vec2 optr = PSin_t - bofs; // used to check if the current destination line is within the current bank
vec2 iptr = optr * vscale; // pointer to the current pixel in the source texture
// if the index of current destination line belongs to the current fiels we update it, otherwise
// we leave the old line in the destination buffer
if ((optr.y >= 0.0f) && (optr.y < 0.5f) && ((vpos & 1) == field))
SV_Target0 = texture(TextureSampler, iptr);
if ((vpos & 1) == field)
SV_Target0 = textureLod(TextureSampler, PSin_t, 0);
else
discard;
}
@@ -126,13 +122,13 @@ void ps_main4()
// calculating motion, only relevant for missing lines where the "center line" is pointed
// by p_t1
vec4 hn = texture(TextureSampler, p_t0 - lofs); // new high pixel
vec4 cn = texture(TextureSampler, p_t1); // new center pixel
vec4 ln = texture(TextureSampler, p_t0 + lofs); // new low pixel
vec4 hn = textureLod(TextureSampler, p_t0 - lofs, 0); // new high pixel
vec4 cn = textureLod(TextureSampler, p_t1, 0); // new center pixel
vec4 ln = textureLod(TextureSampler, p_t0 + lofs, 0); // new low pixel
vec4 ho = texture(TextureSampler, p_t2 - lofs); // old high pixel
vec4 co = texture(TextureSampler, p_t3); // old center pixel
vec4 lo = texture(TextureSampler, p_t2 + lofs); // old low pixel
vec4 ho = textureLod(TextureSampler, p_t2 - lofs, 0); // old high pixel
vec4 co = textureLod(TextureSampler, p_t3, 0); // old center pixel
vec4 lo = textureLod(TextureSampler, p_t2 + lofs, 0); // old low pixel
vec3 mh = hn.rgb - ho.rgb; // high pixel motion
vec3 mc = cn.rgb - co.rgb; // center pixel motion
@@ -158,7 +154,7 @@ void ps_main4()
if ((vpos & 1) == field)
{
// output coordinate present on current field
SV_Target0 = texture(TextureSampler, p_t0);
SV_Target0 = textureLod(TextureSampler, p_t0, 0);
}
else if ((iptr.y > 0.5f - lofs.y) || (iptr.y < 0.0 + lofs.y))
{
+14 -18
View File
@@ -35,7 +35,7 @@ void ps_main0()
const int vpos = int(gl_FragCoord.y); // vertical position of destination texture
if ((vpos & 1) == field)
o_col0 = texture(samp0, v_tex);
o_col0 = textureLod(samp0, v_tex, 0);
else
discard;
}
@@ -46,7 +46,7 @@ void ps_main0()
#ifdef ps_main1
void ps_main1()
{
o_col0 = texture(samp0, v_tex);
o_col0 = textureLod(samp0, v_tex, 0);
}
#endif
@@ -56,9 +56,9 @@ void ps_main1()
void ps_main2()
{
vec2 vstep = vec2(0.0f, ZrH.y);
vec4 c0 = texture(samp0, v_tex - vstep);
vec4 c1 = texture(samp0, v_tex);
vec4 c2 = texture(samp0, v_tex + vstep);
vec4 c0 = textureLod(samp0, v_tex - vstep, 0);
vec4 c1 = textureLod(samp0, v_tex, 0);
vec4 c2 = textureLod(samp0, v_tex + vstep, 0);
o_col0 = (c0 + c1 * 2.0f + c2) / 4.0f;
}
@@ -82,15 +82,11 @@ void ps_main3()
const int vres = int(ZrH.z) >> 1; // vertical resolution of source texture
const int lofs = ((((vres + 1) >> 1) << 1) - vres) & bank; // line alignment offset for bank 1
const int vpos = int(gl_FragCoord.y) + lofs; // vertical position of destination texture
const vec2 bofs = vec2(0.0f, 0.5f * bank); // vertical offset of the current bank relative to source texture size
const vec2 vscale = vec2(1.0f, 2.0f); // scaling factor from source to destination texture
const vec2 optr = v_tex - bofs; // used to check if the current destination line is within the current bank
const vec2 iptr = optr * vscale; // pointer to the current pixel in the source texture
// if the index of current destination line belongs to the current fiels we update it, otherwise
// we leave the old line in the destination buffer
if ((optr.y >= 0.0f) && (optr.y < 0.5f) && ((vpos & 1) == field))
o_col0 = texture(samp0, iptr);
if ((vpos & 1) == field)
o_col0 = textureLod(samp0, v_tex, 0);
else
discard;
}
@@ -150,13 +146,13 @@ void ps_main4()
// calculating motion, only relevant for missing lines where the "center line" is pointed by p_t1
vec4 hn = texture(samp0, p_t0 - lofs); // new high pixel
vec4 cn = texture(samp0, p_t1); // new center pixel
vec4 ln = texture(samp0, p_t0 + lofs); // new low pixel
vec4 hn = textureLod(samp0, p_t0 - lofs, 0); // new high pixel
vec4 cn = textureLod(samp0, p_t1, 0); // new center pixel
vec4 ln = textureLod(samp0, p_t0 + lofs, 0); // new low pixel
vec4 ho = texture(samp0, p_t2 - lofs); // old high pixel
vec4 co = texture(samp0, p_t3); // old center pixel
vec4 lo = texture(samp0, p_t2 + lofs); // old low pixel
vec4 ho = textureLod(samp0, p_t2 - lofs, 0); // old high pixel
vec4 co = textureLod(samp0, p_t3, 0); // old center pixel
vec4 lo = textureLod(samp0, p_t2 + lofs, 0); // old low pixel
vec3 mh = hn.rgb - ho.rgb; // high pixel motion
vec3 mc = cn.rgb - co.rgb; // center pixel motion
@@ -181,7 +177,7 @@ void ps_main4()
if ((vpos & 1) == field) // output coordinate present on current field
{
// output coordinate present on current field
o_col0 = texture(samp0, p_t0);
o_col0 = textureLod(samp0, p_t0, 0);
}
else if ((iptr.y > 0.5f - lofs.y) || (iptr.y < 0.0 + lofs.y))
{
+6
View File
@@ -169,6 +169,12 @@ if(WIN32)
list(APPEND PCSX2_DEFS TIXML_USE_STL _SCL_SECURE_NO_WARNINGS _UNICODE UNICODE)
endif()
# Enable debug information in release builds for Linux.
# Makes the backtrace actually meaningful.
if(UNIX AND NOT APPLE)
add_compile_options($<$<CONFIG:Release>:-g1>)
endif()
if(MSVC)
# Enable PDB generation in release builds
add_compile_options(
+31
View File
@@ -0,0 +1,31 @@
# - Try to find libbacktrace
# Once done this will define
# LIBBACKTRACE_FOUND - System has libbacktrace
# LIBBACKTRACE_INCLUDE_DIRS - The libbacktrace include directories
# LIBBACKTRACE_LIBRARIES - The libraries needed to use libbacktrace
FIND_PATH(
LIBBACKTRACE_INCLUDE_DIR backtrace.h
HINTS /usr/include /usr/local/include
${LIBBACKTRACE_PATH_INCLUDES}
)
FIND_LIBRARY(
LIBBACKTRACE_LIBRARY
NAMES backtrace
PATHS ${ADDITIONAL_LIBRARY_PATHS} ${LIBBACKTRACE_PATH_LIB}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libbacktrace DEFAULT_MSG
LIBBACKTRACE_LIBRARY LIBBACKTRACE_INCLUDE_DIR)
if(LIBBACKTRACE_FOUND)
add_library(libbacktrace::libbacktrace UNKNOWN IMPORTED)
set_target_properties(libbacktrace::libbacktrace PROPERTIES
IMPORTED_LOCATION ${LIBBACKTRACE_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${LIBBACKTRACE_INCLUDE_DIR}
)
endif()
mark_as_advanced(LIBBACKTRACE_INCLUDE_DIR LIBBACKTRACE_LIBRARY)
+2
View File
@@ -86,6 +86,8 @@ else()
if(WAYLAND_API)
find_package(Wayland REQUIRED)
endif()
find_package(Libbacktrace)
endif()
endif(WIN32)
+5
View File
@@ -288,6 +288,11 @@ if(NOT WIN32 AND (QT_BUILD OR NOGUI_BUILD))
target_link_libraries(common PRIVATE CURL::libcurl)
endif()
if(UNIX AND NOT APPLE AND TARGET libbacktrace::libbacktrace)
target_compile_definitions(common PRIVATE "HAS_LIBBACKTRACE=1")
target_link_libraries(common PRIVATE libbacktrace::libbacktrace)
endif()
target_link_libraries(common PRIVATE
${LIBC_LIBRARIES}
PNG::PNG
+194 -1
View File
@@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2022 PCSX2 Dev Team
* Copyright (C) 2002-2023 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@@ -215,6 +215,199 @@ void CrashHandler::Uninstall()
}
}
#elif defined(HAS_LIBBACKTRACE)
#include "FileSystem.h"
#include <backtrace.h>
#include <signal.h>
#include <sys/mman.h>
#include <unistd.h>
#include <cstdarg>
#include <cstdio>
#include <mutex>
namespace CrashHandler
{
struct BacktraceBuffer
{
char* buffer;
size_t used;
size_t size;
};
static const char* GetSignalName(int signal_no);
static void AllocateBuffer(BacktraceBuffer* buf);
static void FreeBuffer(BacktraceBuffer* buf);
static void AppendToBuffer(BacktraceBuffer* buf, const char* format, ...);
static int BacktraceFullCallback(void* data, uintptr_t pc, const char* filename, int lineno, const char* function);
static void CallExistingSignalHandler(int signal, siginfo_t* siginfo, void* ctx);
static void CrashSignalHandler(int signal, siginfo_t* siginfo, void* ctx);
static std::recursive_mutex s_crash_mutex;
static bool s_in_signal_handler = false;
static backtrace_state* s_backtrace_state = nullptr;
static struct sigaction s_old_sigbus_action;
static struct sigaction s_old_sigsegv_action;
}
const char* CrashHandler::GetSignalName(int signal_no)
{
switch (signal_no)
{
// Don't need to list all of them, there's only a couple we register.
// clang-format off
case SIGSEGV: return "SIGSEGV";
case SIGBUS: return "SIGBUS";
default: return "UNKNOWN";
// clang-format on
}
}
void CrashHandler::AllocateBuffer(BacktraceBuffer* buf)
{
buf->used = 0;
buf->size = __pagesize;
buf->buffer = static_cast<char*>(mmap(nullptr, buf->size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0));
if (buf->buffer == static_cast<char*>(MAP_FAILED))
{
buf->buffer = nullptr;
buf->size = 0;
}
}
void CrashHandler::FreeBuffer(BacktraceBuffer* buf)
{
if (buf->buffer)
munmap(buf->buffer, buf->size);
}
void CrashHandler::AppendToBuffer(BacktraceBuffer* buf, const char* format, ...)
{
std::va_list ap;
va_start(ap, format);
// Hope this doesn't allocate memory... it *can*, but hopefully unlikely since
// it won't be the first call, and we're providing the buffer.
if (buf->size > 0 && buf->used < (buf->size - 1))
{
const int written = std::vsnprintf(buf->buffer + buf->used, buf->size - buf->used, format, ap);
if (written > 0)
buf->used += static_cast<size_t>(written);
}
va_end(ap);
}
int CrashHandler::BacktraceFullCallback(void* data, uintptr_t pc, const char* filename, int lineno, const char* function)
{
BacktraceBuffer* buf = static_cast<BacktraceBuffer*>(data);
AppendToBuffer(buf, " %016p", pc);
if (function)
AppendToBuffer(buf, " %s", function);
if (filename)
AppendToBuffer(buf, " [%s:%d]", filename, lineno);
AppendToBuffer(buf, "\n");
return 0;
}
void CrashHandler::CallExistingSignalHandler(int signal, siginfo_t* siginfo, void* ctx)
{
const struct sigaction& sa = (signal == SIGBUS) ? s_old_sigbus_action : s_old_sigsegv_action;
if (sa.sa_flags & SA_SIGINFO)
{
sa.sa_sigaction(signal, siginfo, ctx);
}
else if (sa.sa_handler == SIG_DFL)
{
// Re-raising the signal would just queue it, and since we'd restore the handler back to us,
// we'd end up right back here again. So just abort, because that's probably what it'd do anyway.
abort();
}
else if (sa.sa_handler != SIG_IGN)
{
sa.sa_handler(signal);
}
}
void CrashHandler::CrashSignalHandler(int signal, siginfo_t* siginfo, void* ctx)
{
std::unique_lock lock(s_crash_mutex);
// If we crash somewhere in libbacktrace, don't bother trying again.
if (!s_in_signal_handler)
{
s_in_signal_handler = true;
#if defined(__APPLE__) && defined(__x86_64__)
void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext->__ss.__rip);
#elif defined(__FreeBSD__) && defined(__x86_64__)
void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_rip);
#elif defined(__x86_64__)
void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.gregs[REG_RIP]);
#else
void* const exception_pc = nullptr;
#endif
BacktraceBuffer buf;
AllocateBuffer(&buf);
AppendToBuffer(&buf, "*************** Unhandled %s at %p ***************\n", GetSignalName(signal), exception_pc);
const int rc = backtrace_full(s_backtrace_state, 0, BacktraceFullCallback, nullptr, &buf);
if (rc != 0)
AppendToBuffer(&buf, " backtrace_full() failed: %d\n");
AppendToBuffer(&buf, "*******************************************************************\n");
if (buf.used > 0)
write(STDERR_FILENO, buf.buffer, buf.used);
FreeBuffer(&buf);
s_in_signal_handler = false;
}
// Chances are we're not going to have anything else to call, but just in case.
lock.unlock();
CallExistingSignalHandler(signal, siginfo, ctx);
}
bool CrashHandler::Install()
{
const std::string progpath = FileSystem::GetProgramPath();
s_backtrace_state = backtrace_create_state(progpath.empty() ? nullptr : progpath.c_str(), 0, nullptr, nullptr);
if (!s_backtrace_state)
return false;
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO | SA_NODEFER;
sa.sa_sigaction = CrashSignalHandler;
if (sigaction(SIGBUS, &sa, &s_old_sigbus_action) != 0)
return false;
if (sigaction(SIGSEGV, &sa, &s_old_sigsegv_action) != 0)
return false;
return true;
}
void CrashHandler::SetWriteDirectory(const std::string_view& dump_directory)
{
}
void CrashHandler::WriteDumpForCaller()
{
}
void CrashHandler::Uninstall()
{
// We can't really unchain the signal handlers... so, YOLO.
}
#else
bool CrashHandler::Install()
+6
View File
@@ -89,6 +89,7 @@ static void SysPageFaultSignalFilter(int signal, siginfo_t* siginfo, void* ctx)
// Prevent recursive exception filtering.
if (s_in_exception_handler)
{
lock.unlock();
CallExistingSignalHandler(signal, siginfo, ctx);
return;
}
@@ -121,6 +122,7 @@ static void SysPageFaultSignalFilter(int signal, siginfo_t* siginfo, void* ctx)
return;
// Call old signal handler, which will likely dump core.
lock.unlock();
CallExistingSignalHandler(signal, siginfo, ctx);
}
@@ -135,6 +137,10 @@ bool HostSys::InstallPageFaultHandler(PageFaultHandler handler)
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = SysPageFaultSignalFilter;
#ifdef __linux__
// Don't block the signal from executing recursively, we want to fire the original handler.
sa.sa_flags |= SA_NODEFER;
#endif
#ifdef __APPLE__
// MacOS uses SIGBUS for memory permission violations
if (sigaction(SIGBUS, &sa, &s_old_sigbus_action) != 0)
+31
View File
@@ -595,6 +595,11 @@ bool AutoUpdaterDialog::doUpdate(const QString& zip_path, const QString& updater
return true;
}
void AutoUpdaterDialog::cleanupAfterUpdate()
{
// Nothing to do on Windows for now, the updater stub cleans everything up.
}
#elif defined(__linux__)
bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDialog&)
@@ -663,6 +668,7 @@ bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDi
// Execute new appimage.
QProcess* new_process = new QProcess();
new_process->setProgram(qappimage_path);
new_process->setArguments(QStringList{QStringLiteral("-updatecleanup")});
if (!new_process->startDetached())
{
reportError("Failed to execute new AppImage.");
@@ -673,6 +679,23 @@ bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDi
return true;
}
void AutoUpdaterDialog::cleanupAfterUpdate()
{
// Remove old/backup AppImage.
const char* appimage_path = std::getenv("APPIMAGE");
if (!appimage_path)
return;
const QString qappimage_path(QString::fromUtf8(appimage_path));
const QString backup_appimage_path(qappimage_path + QStringLiteral(".backup"));
if (!QFile::exists(backup_appimage_path))
return;
Console.WriteLn(Color_StrongOrange, QStringLiteral("Removing backup AppImage %1").arg(backup_appimage_path).toStdString());
if (!QFile::remove(backup_appimage_path))
Console.Error(QStringLiteral("Failed to remove backup AppImage %1").arg(backup_appimage_path).toStdString());
}
#elif defined(__APPLE__)
static QString UpdateVersionNumberInName(QString name, QStringView new_version)
@@ -789,6 +812,10 @@ bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDi
return true;
}
void AutoUpdaterDialog::cleanupAfterUpdate()
{
}
#else
bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDialog& progress)
@@ -796,4 +823,8 @@ bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data, QProgressDi
return false;
}
void AutoUpdaterDialog::cleanupAfterUpdate()
{
}
#endif
+1
View File
@@ -37,6 +37,7 @@ public:
static std::string getDefaultTag();
static QString getCurrentVersion();
static QString getCurrentVersionDate();
static void cleanupAfterUpdate();
Q_SIGNALS:
void updateCheckCompleted();
+26 -1
View File
@@ -665,9 +665,11 @@ void CpuWidget::onSearchButtonClicked()
const QString searchValue = m_ui.txtSearchValue->text();
unsigned long long value;
if (searchType < 4)
{
searchValue.toLong(&ok, searchHex ? 16 : 10);
value = searchValue.toULongLong(&ok, searchHex ? 16 : 10);
}
else if (searchType != 6)
{
@@ -680,6 +682,29 @@ void CpuWidget::onSearchButtonClicked()
return;
}
switch (searchType)
{
case 6:
case 5:
case 4:
break;
case 3:
if (value <= std::numeric_limits<unsigned long long>::max())
break;
case 2:
if (value <= std::numeric_limits<unsigned long>::max())
break;
case 1:
if (value <= std::numeric_limits<unsigned short>::max())
break;
case 0:
if (value <= std::numeric_limits<unsigned char>::max())
break;
default:
QMessageBox::critical(this, tr("Debugger"), tr("Value is larger than type"));
return;
}
QFutureWatcher<std::vector<u32>>* workerWatcher = new QFutureWatcher<std::vector<u32>>;
connect(workerWatcher, &QFutureWatcher<std::vector<u32>>::finished, [this, workerWatcher] {
+38 -1
View File
@@ -672,6 +672,43 @@ void MainWindow::setStyleFromSettings()
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");
}
else if (theme == "PizzaBrown")
{
// Custom palette by KamFretoZ, a Pizza Tower Reference!
// With a mixtures of Light Brown, Peachy/Creamy White, Latte-like Color.
// Thanks to Jordan for the idea :P
// Alternative light theme.
qApp->setStyle(QStyleFactory::create("Fusion"));
const QColor gray(192, 192, 192);
const QColor extr(248, 192, 88);
const QColor main(233, 187, 147);
const QColor comp(248, 230, 213);
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, main);
darkPalette.setColor(QPalette::WindowText, Qt::black);
darkPalette.setColor(QPalette::Base, comp);
darkPalette.setColor(QPalette::AlternateBase, extr);
darkPalette.setColor(QPalette::ToolTipBase, comp);
darkPalette.setColor(QPalette::ToolTipText, Qt::black);
darkPalette.setColor(QPalette::Text, Qt::black);
darkPalette.setColor(QPalette::Button, extr);
darkPalette.setColor(QPalette::ButtonText, Qt::black);
darkPalette.setColor(QPalette::Link, Qt::black);
darkPalette.setColor(QPalette::Highlight, extr);
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
darkPalette.setColor(QPalette::Active, QPalette::Button, extr);
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray.darker());
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray.darker());
darkPalette.setColor(QPalette::Disabled, QPalette::Text, Qt::gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Light, gray.lighter());
qApp->setPalette(darkPalette);
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #cc3f18; border: 1px solid white; }");
}
else if (theme == "PCSX2Blue")
{
// Custom palette by RedDevilus, White as main color and Blue as complimentary.
@@ -761,7 +798,7 @@ void MainWindow::setStyleFromSettings()
darkPalette.setColor(QPalette::ToolTipBase, darkishBlue);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Button, royalBlue.darker());
darkPalette.setColor(QPalette::Button, darkishBlue);
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::Link, Qt::white);
darkPalette.setColor(QPalette::Highlight, darkishBlue.lighter());
+8
View File
@@ -56,6 +56,7 @@
#include "fmt/core.h"
#include "AutoUpdaterDialog.h"
#include "DisplayWidget.h"
#include "GameList/GameListWidget.h"
#include "MainWindow.h"
@@ -1755,6 +1756,13 @@ bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptr<VM
s_boot_and_debug = true;
continue;
}
else if (CHECK_ARG(QStringLiteral("-updatecleanup")))
{
if (AutoUpdaterDialog::isSupported())
AutoUpdaterDialog::cleanupAfterUpdate();
continue;
}
#ifdef ENABLE_RAINTEGRATION
else if (CHECK_ARG(QStringLiteral("-raintegration")))
{
@@ -34,6 +34,8 @@ static const char* THEME_NAMES[] = {
//: Ignore what Crowdin says in this string about "[Light]/[Dark]" being untouchable here, these are not variables in this case and must be translated.
QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Baby Pastel (Pink) [Light]"),
//: Ignore what Crowdin says in this string about "[Light]/[Dark]" being untouchable here, these are not variables in this case and must be translated.
QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Pizza Time! (Brownish/Peachy White) [Light]"),
//: Ignore what Crowdin says in this string about "[Light]/[Dark]" being untouchable here, these are not variables in this case and must be translated.
QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "PCSX2 (White/Blue) [Light]"),
//: Ignore what Crowdin says in this string about "[Light]/[Dark]" being untouchable here, these are not variables in this case and must be translated.
QT_TRANSLATE_NOOP("InterfaceSettingsWidget", "Scarlet Devil (Red/Purple) [Dark]"),
@@ -56,6 +58,7 @@ static const char* THEME_VALUES[] = {
"darkfusionblue",
"UntouchedLagoon",
"BabyPastel",
"PizzaBrown",
"PCSX2Blue",
"ScarletDevilRed",
"VioletAngelPurple",
@@ -76,7 +79,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.confirmShutdown, "UI", "ConfirmShutdown", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "UI", "StartFullscreen", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "UI", "DoubleClickTogglesFullscreen",
@@ -152,12 +155,12 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
dialog->registerWidgetHelp(m_ui.pauseOnFocusLoss, tr("Pause On Focus Loss"), tr("Unchecked"),
tr("Pauses the emulator when you minimize the window or switch to another application, "
"and unpauses when you switch back."));
dialog->registerWidgetHelp(m_ui.backupSaveStates, tr("Create Save State Backups"), tr("Unchecked"),
dialog->registerWidgetHelp(m_ui.backupSaveStates, tr("Create Save State Backups"), tr("Checked"),
//: Do not translate the ".backup" extension.
tr("Creates a backup copy of a save state if it already exists when the save is created. The backup copy has a .backup suffix."));
dialog->registerWidgetHelp(m_ui.startFullscreen, tr("Start Fullscreen"), tr("Unchecked"),
tr("Automatically switches to fullscreen mode when a game is started."));
dialog->registerWidgetHelp(m_ui.hideMouseCursor, tr("Hide Cursor In Fullscreen"), tr("Checked"),
dialog->registerWidgetHelp(m_ui.hideMouseCursor, tr("Hide Cursor In Fullscreen"), tr("Unchecked"),
tr("Hides the mouse pointer/cursor when the emulator is in fullscreen mode."));
dialog->registerWidgetHelp(
m_ui.renderToSeparateWindow, tr("Render To Separate Window"), tr("Unchecked"),
@@ -170,7 +173,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
dialog->registerWidgetHelp(
m_ui.discordPresence, tr("Enable Discord Presence"), tr("Unchecked"),
tr("Shows the game you are currently playing as part of your profile in Discord."));
dialog->registerWidgetHelp(m_ui.doubleClickTogglesFullscreen, tr("Double-Click Toggles Fullscreen"), tr("Unchecked"), tr(""));
dialog->registerWidgetHelp(m_ui.doubleClickTogglesFullscreen, tr("Double-Click Toggles Fullscreen"), tr("Checked"), tr(""));
dialog->registerWidgetHelp(m_ui.disableWindowResizing, tr("Disable Window Resizing"), tr("Unchecked"), tr(""));
// Not yet used, disable the options
+29 -24
View File
@@ -58,6 +58,7 @@ static __fi void SetSCMDResultSize(u8 size)
cdvd.SCMDResultC = size;
cdvd.SCMDResultP = 0;
cdvd.sDataIn &= ~0x40;
memset(cdvd.SCMDResult, 0, size);
}
static void CDVDSECTORREADY_INT(u32 eCycle)
@@ -667,6 +668,9 @@ static void cdvdUpdateReady(u8 NewReadyStatus)
s32 cdvdCtrlTrayOpen()
{
if (cdvd.Status & CDVD_STATUS_TRAY_OPEN)
return 0x80;
DevCon.WriteLn(Color_Green, "Open virtual disk tray");
// If we switch using a source change we need to pretend it's a new disc
@@ -677,25 +681,19 @@ s32 cdvdCtrlTrayOpen()
}
cdvdDetectDisk();
DiscSwapTimerSeconds = cdvd.RTC.second; // remember the PS2 time when this happened
cdvdUpdateStatus(CDVD_STATUS_TRAY_OPEN);
cdvdUpdateReady(0);
cdvd.Spinning = false;
cdvdSetIrq(1 << Irq_Eject);
if (cdvd.Type > 0 || CDVDsys_GetSourceType() == CDVD_SourceType::NoDisc)
{
cdvd.Tray.cdvdActionSeconds = 3;
cdvd.Tray.trayState = CDVD_DISC_EJECT;
DevCon.WriteLn(Color_Green, "Simulating ejected media");
}
return 0; // needs to be 0 for success according to homebrew test "CDVD"
}
s32 cdvdCtrlTrayClose()
{
if (!(cdvd.Status & CDVD_STATUS_TRAY_OPEN))
return 0x80;
DevCon.WriteLn(Color_Green, "Close virtual disk tray");
if (!g_GameStarted && g_SkipBiosHack)
@@ -703,6 +701,7 @@ s32 cdvdCtrlTrayClose()
DevCon.WriteLn(Color_Green, "Media already loaded (fast boot)");
cdvdUpdateReady(CDVD_DRIVE_READY);
cdvdUpdateStatus(CDVD_STATUS_PAUSE);
cdvd.Spinning = true;
cdvd.Tray.trayState = CDVD_DISC_ENGAGED;
cdvd.Tray.cdvdActionSeconds = 0;
}
@@ -710,7 +709,8 @@ s32 cdvdCtrlTrayClose()
{
DevCon.WriteLn(Color_Green, "Detecting media");
cdvdUpdateReady(CDVD_DRIVE_BUSY);
cdvdUpdateStatus(CDVD_STATUS_SEEK);
cdvdUpdateStatus(CDVD_STATUS_STOP);
cdvd.Spinning = false;
cdvd.Tray.trayState = CDVD_DISC_DETECTING;
cdvd.Tray.cdvdActionSeconds = 3;
}
@@ -860,7 +860,7 @@ void cdvdReset()
cdvd.sDataIn = 0x40;
cdvdUpdateReady(CDVD_DRIVE_READY);
cdvdUpdateStatus(CDVD_STATUS_PAUSE);
cdvdUpdateStatus(CDVD_STATUS_TRAY_OPEN);
cdvd.Speed = 4;
cdvd.BlockSize = 2064;
cdvd.Action = cdvdAction_None;
@@ -1437,28 +1437,34 @@ void cdvdUpdateTrayState()
{
switch (cdvd.Tray.trayState)
{
case CDVD_DISC_OPEN:
cdvdCtrlTrayOpen();
if (cdvd.Type > 0 || CDVDsys_GetSourceType() == CDVD_SourceType::NoDisc)
{
cdvd.Tray.cdvdActionSeconds = 3;
cdvd.Tray.trayState = CDVD_DISC_EJECT;
DevCon.WriteLn(Color_Green, "Simulating ejected media");
}
break;
case CDVD_DISC_EJECT:
cdvdCtrlTrayClose();
break;
case CDVD_DISC_DETECTING:
DevCon.WriteLn(Color_Green, "Seeking new disc");
cdvd.Tray.trayState = CDVD_DISC_SEEKING;
cdvdUpdateStatus(CDVD_STATUS_SEEK);
cdvd.Tray.cdvdActionSeconds = 2;
cdvd.Spinning = true;
break;
case CDVD_DISC_SEEKING:
cdvd.Spinning = true;
case CDVD_DISC_ENGAGED:
cdvd.Tray.trayState = CDVD_DISC_ENGAGED;
cdvdUpdateReady(CDVD_DRIVE_READY);
cdvdUpdateStatus(CDVD_STATUS_PAUSE);
if (CDVDsys_GetSourceType() != CDVD_SourceType::NoDisc)
{
DevCon.WriteLn(Color_Green, "Media ready to read");
cdvdUpdateStatus(CDVD_STATUS_PAUSE);
}
else
{
cdvd.Spinning = false;
cdvdUpdateStatus(CDVD_STATUS_STOP);
DevCon.WriteLn(Color_Green, "Media ready to use");
}
break;
}
@@ -2340,8 +2346,8 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
default:
SetSCMDResultSize(1);
cdvd.SCMDResult[0] = 0x80;
Console.Warning("*Unknown Mecacon Command param[0]=%02X", cdvd.SCMDParam[0]);
cdvd.SCMDResult[0] = 0x81;
Console.Warning("*Unknown Mecacon Command param Test2 subparams - param[0]=%02X", cdvd.SCMDParam[0]);
break;
}
break;
@@ -2357,7 +2363,7 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
case 0x06: // CdTrayCtrl (1:1)
SetSCMDResultSize(1);
//Console.Warning( "CdTrayCtrl, param = %d", cdvd.Param[0]);
//Console.Warning( "CdTrayCtrl, param = %d", cdvd.SCMDParam[0]);
if (cdvd.SCMDParam[0] == 0)
cdvd.SCMDResult[0] = cdvdCtrlTrayOpen();
else
@@ -2906,9 +2912,8 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
break;
default:
// fake a 'correct' command
SetSCMDResultSize(1); //in:0
cdvd.SCMDResult[0] = 0; // 0 complete ; 1 busy ; 0x80 error
cdvd.SCMDResult[0] = 0x80; // 0 complete ; 1 busy ; 0x80 error
Console.WriteLn("SCMD Unknown %x", rt);
break;
} // end switch
+2 -1
View File
@@ -81,7 +81,8 @@ enum TrayStates
CDVD_DISC_ENGAGED,
CDVD_DISC_DETECTING,
CDVD_DISC_SEEKING,
CDVD_DISC_EJECT
CDVD_DISC_EJECT,
CDVD_DISC_OPEN
};
struct cdvdTrayTimer
-1
View File
@@ -170,7 +170,6 @@ static const uint DVD_MAX_ROTATION_X1 = 1515;
static const uint Cdvd_FullSeek_Cycles = (PSXCLK * 100) / 1000; // average number of cycles per fullseek (100ms)
static const uint Cdvd_FastSeek_Cycles = (PSXCLK * 30) / 1000; // average number of cycles per fastseek (37ms)
short DiscSwapTimerSeconds = 0;
bool trayState = 0; // Used to check if the CD tray status has changed since the last time
static const char* mg_zones[8] = {"Japan", "USA", "Europe", "Oceania", "Asia", "Russia", "China", "Mexico"};
-4
View File
@@ -518,9 +518,7 @@ set(pcsx2GSSources
GS/Renderers/Common/GSRenderer.cpp
GS/Renderers/Common/GSTexture.cpp
GS/Renderers/Common/GSVertexTrace.cpp
GS/Renderers/Null/GSDeviceNull.cpp
GS/Renderers/Null/GSRendererNull.cpp
GS/Renderers/Null/GSTextureNull.cpp
GS/Renderers/HW/GSHwHack.cpp
GS/Renderers/HW/GSRendererHW.cpp
GS/Renderers/HW/GSTextureCache.cpp
@@ -572,9 +570,7 @@ set(pcsx2GSHeaders
GS/Renderers/Common/GSVertex.h
GS/Renderers/Common/GSVertexList.h
GS/Renderers/Common/GSVertexTrace.h
GS/Renderers/Null/GSDeviceNull.h
GS/Renderers/Null/GSRendererNull.h
GS/Renderers/Null/GSTextureNull.h
GS/Renderers/HW/GSHwHack.h
GS/Renderers/HW/GSRendererHW.h
GS/Renderers/HW/GSTextureCache.h
+1 -1
View File
@@ -876,7 +876,7 @@ static __fi void rcntStartGate(bool isVblank, u32 sCycle)
{
// Update counters using the hblank as the clock. This keeps the hblank source
// nicely in sync with the counters and serves as an optimization also, since these
// counter won't recieve special rcntUpdate scheduling.
// counter won't receive special rcntUpdate scheduling.
// Note: Target and overflow tests must be done here since they won't be done
// currectly by rcntUpdate (since it's not being scheduled for these counters)
+2 -1
View File
@@ -17,6 +17,7 @@
#include "common/Assertions.h"
#include "common/FileSystem.h"
#include "common/Path.h"
#include "pcsx2/Achievements.h"
#include "Frontend/CommonHost.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/InputManager.h"
@@ -286,4 +287,4 @@ DEFINE_HOTKEY_SAVESTATE_X(10)
DEFINE_HOTKEY_LOADSTATE_X(10)
#undef DEFINE_HOTKEY_SAVESTATE_X
#undef DEFINE_HOTKEY_LOADSTATE_X
END_HOTKEY_LIST()
END_HOTKEY_LIST()
+3 -17
View File
@@ -4093,18 +4093,6 @@ void FullscreenUI::DrawFoldersSettingsPage()
EndMenuButtons();
}
#ifndef ENABLE_ACHIEVEMENTS
void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& settings_lock)
{
BeginMenuButtons();
ActiveButton(ICON_FA_BAN " This build was not compiled with Achievements support.", false, false,
ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
EndMenuButtons();
}
#endif
void FullscreenUI::DrawAdvancedSettingsPage()
{
static constexpr const char* ee_rounding_mode_settings[] = {"Nearest", "Negative", "Positive", "Chop/Zero (Default)"};
@@ -6959,17 +6947,15 @@ void FullscreenUI::DrawAchievementsLoginWindow()
#else
bool FullscreenUI::OpenAchievementsWindow()
void FullscreenUI::OpenAchievementsWindow()
{
return false;
}
bool FullscreenUI::OpenLeaderboardsWindow()
void FullscreenUI::OpenLeaderboardsWindow()
{
return false;
}
void FullscreenUI::DrawAchievementsSettingsPage()
void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& settings_lock)
{
BeginMenuButtons();
ActiveButton(ICON_FA_BAN " This build was not compiled with RetroAchievements support.", false, false,
-1
View File
@@ -21,7 +21,6 @@
#include "GSUtil.h"
#include "GSExtra.h"
#include "Renderers/Null/GSRendererNull.h"
#include "Renderers/Null/GSDeviceNull.h"
#include "Renderers/HW/GSRendererHW.h"
#include "Renderers/HW/GSTextureReplacements.h"
#include "GSLzma.h"
+3 -3
View File
@@ -460,7 +460,7 @@ public:
typedef u32 (GSLocalMemory::*readPixelAddr)(u32 addr) const;
typedef u32 (GSLocalMemory::*readTexelAddr)(u32 addr, const GIFRegTEXA& TEXA) const;
typedef void (*writeImage)(GSLocalMemory& mem, int& tx, int& ty, const u8* src, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG);
typedef void (*readImage)(const GSLocalMemory& mem, int& tx, int& ty, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG);
typedef void (*readImage)(const GSLocalMemory& mem, int& tx, int& ty, int& offset, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG);
typedef void (*readTexture)(GSLocalMemory& mem, const GSOffset& off, const GSVector4i& r, u8* dst, int dstpitch, const GIFRegTEXA& TEXA);
typedef void (*readTextureBlock)(const GSLocalMemory& mem, u32 bp, u8* dst, int dstpitch, const GIFRegTEXA& TEXA);
@@ -1123,9 +1123,9 @@ public:
return ReadTexel16(PixelAddress16SZ(x, y, TEX0.TBP0, TEX0.TBW), TEXA);
}
__forceinline void ReadImageX(int& tx, int& ty, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG) const
__forceinline void ReadImageX(int& tx, int& ty, int& offset, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG) const
{
m_readImageX(*this, tx, ty, dst, len, BITBLTBUF, TRXPOS, TRXREG);
m_readImageX(*this, tx, ty, offset, dst, len, BITBLTBUF, TRXPOS, TRXREG);
}
void ReadTexture(const GSOffset& off, const GSVector4i& r, u8* dst, int dstpitch, const GIFRegTEXA& TEXA);
+17 -10
View File
@@ -87,7 +87,7 @@ class CURRENT_ISA::GSLocalMemoryFunctions
static void ReadTexture(GSLocalMemory& mem, const GSOffset& off, const GSVector4i& r, u8* dst, int dstpitch, const GIFRegTEXA& TEXA);
public:
static void ReadImageX(const GSLocalMemory& mem, int& tx, int& ty, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG);
static void ReadImageX(const GSLocalMemory& mem, int& tx, int& ty, int& offset, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG);
static void PopulateFunctions(GSLocalMemory& mem);
};
@@ -931,7 +931,7 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c
//
void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& ty, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG)
void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& ty, int& offset, u8* dst, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG)
{
if (len <= 0)
return;
@@ -1005,16 +1005,23 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int&
case PSM_PSMCT24:
case PSM_PSMZ24:
readWriteHelper(mem.vm32(), tx, ty, len / 3, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle32), [&](auto& pa, int x)
{
const int length = len / 3;
const int aligned_length = (len + 2) / 3;
if (length != aligned_length)
{
u32 c = *pa.value(x);
pb[0] = (u8)(c);
pb[1] = (u8)(c >> 8);
pb[2] = (u8)(c >> 16);
pb += 3;
});
offset = 3 - (len - (length * 3));
}
readWriteHelper(mem.vm32(), tx, ty, aligned_length, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle32), [&](auto& pa, int x)
{
u32 c = *pa.value(x);
pb[0] = (u8)(c);
pb[1] = (u8)(c >> 8);
pb[2] = (u8)(c >> 16);
pb += 3;
});
break;
}
case PSM_PSMCT16:
case PSM_PSMCT16S:
case PSM_PSMZ16:
+7 -4
View File
@@ -1512,7 +1512,6 @@ void GSState::FlushWrite()
r.top = m_env.TRXPOS.DSAY;
r.right = r.left + m_env.TRXREG.RRW;
r.bottom = r.top + m_env.TRXREG.RRH;
ExpandTarget(m_env.BITBLTBUF, r);
InvalidateVideoMem(m_env.BITBLTBUF, r, true);
const GSLocalMemory::writeImage wi = GSLocalMemory::m_psm[m_env.BITBLTBUF.DPSM].wi;
@@ -1789,7 +1788,6 @@ void GSState::Write(const u8* mem, int len)
if (m_tr.end == 0 && len >= m_tr.total)
{
// received all data in one piece, no need to buffer it
ExpandTarget(m_env.BITBLTBUF, r);
InvalidateVideoMem(blit, r, true);
psm.wi(m_mem, m_tr.x, m_tr.y, mem, m_tr.total, blit, m_env.TRXPOS, m_env.TRXREG);
@@ -1847,7 +1845,9 @@ void GSState::Read(u8* mem, int len)
if (!m_tr.Update(w, h, bpp, len))
return;
m_mem.ReadImageX(m_tr.x, m_tr.y, mem, len, m_env.BITBLTBUF, m_env.TRXPOS, m_env.TRXREG);
mem += m_tr.offset;
len -= m_tr.offset;
m_mem.ReadImageX(m_tr.x, m_tr.y, m_tr.offset, mem, len, m_env.BITBLTBUF, m_env.TRXPOS, m_env.TRXREG);
if (GSConfig.DumpGSData && GSConfig.SaveRT && s_n >= GSConfig.SaveN)
{
@@ -2138,7 +2138,9 @@ void GSState::ReadLocalMemoryUnsync(u8* mem, int qwc, GIFRegBITBLTBUF BITBLTBUF,
if (!tb.Update(w, h, bpp, len))
return;
m_mem.ReadImageX(tb.x, tb.y, mem, len, BITBLTBUF, TRXPOS, TRXREG);
mem += tb.offset;
len -= tb.offset;
m_mem.ReadImageX(tb.x, tb.y, tb.offset, mem, len, BITBLTBUF, TRXPOS, TRXREG);
}
void GSState::PurgePool()
@@ -3902,6 +3904,7 @@ void GSState::GSTransferBuffer::Init(int tx, int ty, const GIFRegBITBLTBUF& blit
x = tx;
y = ty;
total = 0;
offset = 0;
m_blit = blit;
}
+1 -1
View File
@@ -123,6 +123,7 @@ private:
{
int x = 0, y = 0;
int start = 0, end = 0, total = 0;
int offset = 0;
u8* buff = nullptr;
GIFRegBITBLTBUF m_blit = {};
@@ -891,7 +892,6 @@ public:
virtual void ReadbackTextureCache();
virtual void InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool eewrite = false) {}
virtual void InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut = false) {}
virtual void ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r) {}
virtual void Move();
+31 -6
View File
@@ -322,24 +322,49 @@ void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffse
float offset = yoffset * static_cast<float>(field);
offset = GSConfig.DisableInterlaceOffset ? 0.0f : offset;
auto do_interlace = [this](GSTexture* sTex, GSTexture* dTex, ShaderInterlace shader, bool linear, float yoffset, int bufIdx) {
const GSVector2i ds_i = dTex->GetSize();
const GSVector2 ds = GSVector2(static_cast<float>(ds_i.x), static_cast<float>(ds_i.y));
GSVector4 sRect = GSVector4(0.0f, 0.0f, 1.0f, 1.0f);
GSVector4 dRect = GSVector4(0.0f, yoffset, ds.x, ds.y + yoffset);
// Select the top or bottom half for MAD buffering.
if (shader == ShaderInterlace::MAD_BUFFER)
{
const float half_size = ds.y * 0.5f;
if ((bufIdx >> 1) == 1)
dRect.y += half_size;
else
dRect.w -= half_size;
}
const InterlaceConstantBuffer cb = {
GSVector4(static_cast<float>(bufIdx), 1.0f / ds.y, ds.y, MAD_SENSITIVITY)
};
GL_PUSH("DoInterlace %dx%d Shader:%d Linear:%d", ds_i.x, ds_i.y, static_cast<int>(shader), linear);
DoInterlace(sTex, sRect, dTex, dRect, shader, linear, cb);
};
switch (mode)
{
case 0: // Weave
ResizeTarget(&m_weavebob, ds.x, ds.y);
DoInterlace(m_merge, m_weavebob, 0, false, offset, field);
do_interlace(m_merge, m_weavebob, ShaderInterlace::WEAVE, false, offset, field);
m_current = m_weavebob;
break;
case 1: // Bob
// Field is reversed here as we are countering the bounce.
ResizeTarget(&m_weavebob, ds.x, ds.y);
DoInterlace(m_merge, m_weavebob, 1, true, yoffset * (1 - field), 0);
do_interlace(m_merge, m_weavebob, ShaderInterlace::BOB, true, yoffset * (1 - field), 0);
m_current = m_weavebob;
break;
case 2: // Blend
ResizeTarget(&m_weavebob, ds.x, ds.y);
DoInterlace(m_merge, m_weavebob, 0, false, offset, field);
do_interlace(m_merge, m_weavebob, ShaderInterlace::WEAVE, false, offset, field);
ResizeTarget(&m_blend, ds.x, ds.y);
DoInterlace(m_weavebob, m_blend, 2, false, 0, 0);
do_interlace(m_weavebob, m_blend, ShaderInterlace::BLEND, false, 0, 0);
m_current = m_blend;
break;
case 3: // FastMAD Motion Adaptive Deinterlacing
@@ -348,9 +373,9 @@ void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffse
bufIdx |= field;
bufIdx &= 3;
ResizeTarget(&m_mad, ds.x, ds.y * 2.0f);
DoInterlace(m_merge, m_mad, 3, false, offset, bufIdx);
do_interlace(m_merge, m_mad, ShaderInterlace::MAD_BUFFER, false, offset, bufIdx);
ResizeTarget(&m_weavebob, ds.x, ds.y);
DoInterlace(m_mad, m_weavebob, 4, false, 0, bufIdx);
do_interlace(m_mad, m_weavebob, ShaderInterlace::MAD_RECONSTRUCT, false, 0, bufIdx);
m_current = m_weavebob;
break;
default:
+11 -2
View File
@@ -55,6 +55,16 @@ enum class ShaderConvert
Count
};
enum class ShaderInterlace
{
WEAVE = 0,
BOB = 1,
BLEND = 2,
MAD_BUFFER = 3,
MAD_RECONSTRUCT = 4,
Count
};
static inline bool HasDepthOutput(ShaderConvert shader)
{
switch (shader)
@@ -192,7 +202,6 @@ class InterlaceConstantBuffer
{
public:
GSVector4 ZrH; // data passed to the shader
InterlaceConstantBuffer() { memset(this, 0, sizeof(*this)); }
};
#pragma pack(pop)
@@ -773,7 +782,7 @@ protected:
GSTexture* FetchSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format, bool clear, bool prefer_reuse);
virtual void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) = 0;
virtual void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx) = 0;
virtual void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) = 0;
virtual void DoFXAA(GSTexture* sTex, GSTexture* dTex) {}
virtual void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) {}
+3 -11
View File
@@ -789,6 +789,7 @@ void GSDevice11::ConvertToIndexedTexture(GSTexture* sTex, float sScale, u32 offs
struct Uniforms
{
float scale;
float pad1[3];
u32 SBW, DBW, pad3;
};
@@ -935,20 +936,11 @@ void GSDevice11::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
}
}
void GSDevice11::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx)
void GSDevice11::DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb)
{
const GSVector4 ds = GSVector4(dTex->GetSize());
const GSVector4 sRect(0, 0, 1, 1);
const GSVector4 dRect(0.0f, yoffset, ds.x, ds.y + yoffset);
InterlaceConstantBuffer cb;
cb.ZrH = GSVector4(static_cast<float>(bufIdx), 1.0f / ds.y, ds.y, MAD_SENSITIVITY);
m_ctx->UpdateSubresource(m_interlace.cb.get(), 0, nullptr, &cb, 0, 0);
StretchRect(sTex, sRect, dTex, dRect, m_interlace.ps[shader].get(), m_interlace.cb.get(), linear);
StretchRect(sTex, sRect, dTex, dRect, m_interlace.ps[static_cast<int>(shader)].get(), m_interlace.cb.get(), linear);
}
void GSDevice11::DoFXAA(GSTexture* sTex, GSTexture* dTex)
+1 -1
View File
@@ -127,7 +127,7 @@ private:
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) final;
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) final;
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0, int bufIdx = 0) final;
void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) final;
void DoFXAA(GSTexture* sTex, GSTexture* dTex) final;
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) final;
+4 -17
View File
@@ -823,30 +823,17 @@ void GSDevice12::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
static_cast<GSTexture12*>(dTex)->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
}
void GSDevice12::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx)
void GSDevice12::DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb)
{
const GSVector2i ds_i = dTex->GetSize();
const GSVector4 ds = GSVector4(ds_i);
const GSVector4 sRect(0, 0, 1, 1);
const GSVector4 dRect(0.0f, yoffset, ds.x, ds.y + yoffset);
InterlaceConstantBuffer cb;
cb.ZrH = GSVector4(static_cast<float>(bufIdx), 1.0f / ds.y, ds.y, MAD_SENSITIVITY);
GL_PUSH("DoInterlace %dx%d Shader:%d Linear:%d", ds_i.x, ds_i.y, shader, linear);
static_cast<GSTexture12*>(dTex)->TransitionToState(D3D12_RESOURCE_STATE_RENDER_TARGET);
const GSVector4i rc(0, 0, ds_i.x, ds_i.y);
const GSVector4i rc = GSVector4i(dRect);
EndRenderPass();
OMSetRenderTargets(dTex, nullptr, rc);
SetUtilityRootSignature();
SetUtilityTexture(sTex, linear ? m_linear_sampler_cpu : m_point_sampler_cpu);
BeginRenderPassForStretchRect(static_cast<GSTexture12*>(dTex), rc, rc, false);
SetPipeline(m_interlace[shader].get());
BeginRenderPassForStretchRect(static_cast<GSTexture12*>(dTex), dTex->GetRect(), rc, false);
SetPipeline(m_interlace[static_cast<int>(shader)].get());
SetUtilityPushConstants(&cb, sizeof(cb));
DrawStretchRect(sRect, dRect, dTex->GetSize());
EndRenderPass();
+1 -1
View File
@@ -184,7 +184,7 @@ private:
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE,
const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) final;
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0, int bufIdx = 0) final;
void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) final;
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) final;
void DoFXAA(GSTexture* sTex, GSTexture* dTex) final;
-7
View File
@@ -923,11 +923,6 @@ GSVector4i GSRendererHW::GetSplitTextureShuffleDrawRect() const
return r.insert64<0>(0).ralign<Align_Outside>(frame_psm.pgs);
}
void GSRendererHW::ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r)
{
m_tc->ExpandTarget(BITBLTBUF, r);
}
void GSRendererHW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool eewrite)
{
// printf("[%d] InvalidateVideoMem %d,%d - %d,%d %05x (%d)\n", static_cast<int>(g_perfmon.GetFrame()), r.left, r.top, r.right, r.bottom, static_cast<int>(BITBLTBUF.DBP), static_cast<int>(BITBLTBUF.DPSM));
@@ -3673,8 +3668,6 @@ void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Source* tex)
const float scale = tex->GetScale();
const GSVector2i unscaled_size = tex->GetUnscaledSize();
const int w = tex->m_texture->GetWidth();
const int h = tex->m_texture->GetHeight();
const int tw = static_cast<int>(1 << m_context->TEX0.TW);
const int th = static_cast<int>(1 << m_context->TEX0.TH);
-1
View File
@@ -167,7 +167,6 @@ public:
GSTexture* GetOutput(int i, float& scale, int& y_offset) override;
GSTexture* GetFeedbackOutput(float& scale) override;
void ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r) override;
void InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool eewrite = false) override;
void InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut = false) override;
void Move() override;
+22 -71
View File
@@ -213,11 +213,11 @@ GSVector4i GSTextureCache::TranslateAlignedRectByPage(u32 sbp, u32 spsm, u32 sbw
new_rect.w = in_rect.w;
}
}
else if (src_bw == rect_pages.width())
else if (static_cast<int>(src_bw) == rect_pages.width())
{
const u32 totalpages = rect_pages.width() * rect_pages.height();
const bool full_rows = in_rect.width() == (src_bw * src_page_size.x);
const bool full_rows = in_rect.width() == (static_cast<int>(src_bw) * src_page_size.x);
const bool single_row = in_rect.x == 0 && in_rect.y == 0 && totalpages <= dst_bw;
bool uneven_pages = (horizontal_offset || (totalpages % dst_bw) != 0) && !single_row;
@@ -356,11 +356,11 @@ void GSTextureCache::DirtyRectByPage(u32 sbp, u32 spsm, u32 sbw, Target* t, GSVe
new_rect.w = in_rect.w;
}
}
else if (src_bw == rect_pages.width())
else if (static_cast<int>(src_bw) == rect_pages.width())
{
const u32 totalpages = rect_pages.width() * rect_pages.height();
const bool full_rows = in_rect.width() == (src_bw * src_page_size.x);
const bool full_rows = in_rect.width() == (static_cast<int>(src_bw) * src_page_size.x);
const bool single_row = in_rect.x == 0 && in_rect.y == 0 && totalpages <= dst_bw;
bool uneven_pages = (horizontal_offset || (totalpages % dst_bw) != 0) && !single_row;
@@ -1554,62 +1554,6 @@ bool GSTextureCache::PrepareDownloadTexture(u32 width, u32 height, GSTexture::Fo
return true;
}
// Expands targets where the write from the EE overlaps the edge of a render target and uses the same base pointer.
void GSTextureCache::ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r)
{
GIFRegTEX0 TEX0;
TEX0.TBP0 = BITBLTBUF.DBP;
TEX0.TBW = BITBLTBUF.DBW;
TEX0.PSM = BITBLTBUF.DPSM;
Target* dst = nullptr;
auto& list = m_dst[RenderTarget];
RGBAMask rgba;
rgba._u32 = GSUtil::GetChannelMask(TEX0.PSM);
for (auto i = list.begin(); i != list.end(); ++i)
{
Target* t = *i;
if (TEX0.TBP0 == t->m_TEX0.TBP0 && GSLocalMemory::m_psm[TEX0.PSM].bpp == GSLocalMemory::m_psm[t->m_TEX0.PSM].bpp && t->Overlaps(TEX0.TBP0, TEX0.TBW, TEX0.PSM, r))
{
list.MoveFront(i.Index());
dst = t;
break;
}
}
if (!dst)
return;
// Only expand the target when the FBW matches. Otherwise, games like GT4 will end up with the main render target
// being 2000+ due to unrelated EE writes.
if (TEX0.TBW == dst->m_TEX0.TBW)
{
// Round up to the nearest even height, like the draw target allocator.
const s32 aligned_height = Common::AlignUpPow2(r.w, 2);
if (r.z > dst->m_unscaled_size.x || aligned_height > dst->m_unscaled_size.y)
{
// We don't recycle here, because most of the time when this happens it's strange-sized textures
// which are being expanded one-line-at-a-time.
if (dst->ResizeTexture(std::max(r.z, dst->m_unscaled_size.x),
std::max(aligned_height, dst->m_unscaled_size.y), false))
{
AddDirtyRectTarget(dst, r, TEX0.PSM, TEX0.TBW, rgba);
GetTargetHeight(TEX0.TBP0, TEX0.TBW, TEX0.PSM, aligned_height);
dst->UpdateValidity(r);
dst->UpdateValidBits(GSLocalMemory::m_psm[TEX0.PSM].fmsk);
}
}
}
else
{
const GSVector4i clamped_r(r.rintersect(dst->GetUnscaledRect()));
AddDirtyRectTarget(dst, clamped_r, TEX0.PSM, TEX0.TBW, rgba);
dst->UpdateValidity(clamped_r);
dst->UpdateValidBits(GSLocalMemory::m_psm[TEX0.PSM].fmsk);
}
}
// Goal: Depth And Target at the same address is not possible. On GS it is
// the same memory but not on the Dx/GL. Therefore a write to the Depth/Target
// must invalidate the Target/Depth respectively
@@ -2168,8 +2112,6 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
r.z,
r.w);
const bool read_is_depth = (psm & 0x30) == 0x30;
// Could be reading Z24/32 back as CT32 (Gundam Battle Assault 3)
if (GSLocalMemory::m_psm[psm].bpp >= 16)
{
@@ -2199,8 +2141,6 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
if (!expecting_this_tex)
continue;
z_found = true;
t->readbacks_since_draw++;
GSVector2i page_size = GSLocalMemory::m_psm[t->m_TEX0.PSM].pgs;
@@ -2273,9 +2213,15 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
continue;
}
Read(t, draw_rect);
if (draw_rect.rintersect(t->m_drawn_since_read).eq(t->m_drawn_since_read))
t->m_drawn_since_read = GSVector4i::zero();
if (!draw_rect.rempty())
{
Read(t, draw_rect);
z_found = read_start >= t->m_TEX0.TBP0 && read_end <= t->m_end_block;
if (draw_rect.rintersect(t->m_drawn_since_read).eq(t->m_drawn_since_read))
t->m_drawn_since_read = GSVector4i::zero();
}
}
}
if (z_found)
@@ -2393,6 +2339,11 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
if (targetr.rintersect(t->m_dirty.GetTotalRect(t->m_TEX0, t->m_unscaled_size)).eq(targetr))
return;
// Need to check the drawn area first.
// Shadow Hearts From the New World tries to double buffer, then because we don't support rendering inside an RT, it makes a new one.
// This makes sure any misdetection doesn't accidentally break the drawn area or skip download completely.
targetr = targetr.rintersect(t->m_drawn_since_read);
if (!targetr.rempty())
{
if (GSConfig.HWDownloadMode != GSHardwareDownloadMode::Enabled)
@@ -2401,7 +2352,7 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
continue;
}
Read(t, targetr.rintersect(t->m_drawn_since_read));
Read(t, targetr);
// Try to cut down how much we read next, if we can.
// Fatal Frame reads in vertical strips, SOCOM 2 does horizontal, so we can handle that below.
@@ -2409,7 +2360,7 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
{
t->m_drawn_since_read = GSVector4i::zero();
}
else if (targetr.width() == t->m_drawn_since_read.width()
else if (targetr.xzxz().eq(t->m_drawn_since_read.xzxz())
&& targetr.w >= t->m_drawn_since_read.y)
{
if (targetr.y <= t->m_drawn_since_read.y)
@@ -2417,7 +2368,7 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
else if (targetr.w >= t->m_drawn_since_read.w)
t->m_drawn_since_read.w = targetr.y;
}
else if (targetr.height() == t->m_drawn_since_read.height()
else if (targetr.ywyw().eq(t->m_drawn_since_read.ywyw())
&& targetr.z >= t->m_drawn_since_read.x)
{
if (targetr.x <= t->m_drawn_since_read.x)
@@ -2426,7 +2377,7 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r
t->m_drawn_since_read.z = targetr.x;
}
if (targetr.rintersect(t->m_valid).eq(targetr))
if (read_start >= t->m_TEX0.TBP0 && read_end <= t->m_end_block)
return;
}
}
-1
View File
@@ -444,7 +444,6 @@ public:
u32 GetTargetHeight(u32 fbp, u32 fbw, u32 psm, u32 min_height);
bool Has32BitTarget(u32 bp);
void ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r);
void InvalidateVideoMemType(int type, u32 bp);
void InvalidateVideoMemSubTarget(GSTextureCache::Target* rt);
void InvalidateVideoMem(const GSOffset& off, const GSVector4i& r, bool eewrite = false, bool target = true);
+31 -10
View File
@@ -117,7 +117,7 @@ namespace GSTextureReplacements
static std::string GetGameTextureDirectory();
static std::string GetDumpFilename(const TextureName& name, u32 level);
static std::optional<ReplacementTexture> LoadReplacementTexture(const TextureName& name, const std::string& filename, bool only_base_image);
static void QueueAsyncReplacementTextureLoad(const TextureName& name, const std::string& filename, bool mipmap);
static void QueueAsyncReplacementTextureLoad(const TextureName& name, const std::string& filename, bool mipmap, bool cache_only);
static void PrecacheReplacementTextures();
static void ClearReplacementTextures();
@@ -146,8 +146,8 @@ namespace GSTextureReplacements
static std::unordered_map<TextureName, ReplacementTexture> s_replacement_texture_cache;
static std::mutex s_replacement_texture_cache_mutex;
/// List of textures that are pending asynchronous load.
static std::unordered_set<TextureName> s_pending_async_load_textures;
/// List of textures that are pending asynchronous load. Second element is whether we're only precaching.
static std::unordered_map<TextureName, bool> s_pending_async_load_textures;
/// List of textures that we have asynchronously loaded and can now be injected back into the TC.
/// Second element is whether the texture should be created with mipmaps.
@@ -465,7 +465,7 @@ GSTexture* GSTextureReplacements::LookupReplacementTexture(const GSTextureCache:
{
// replacement will be injected into the TC later on
std::unique_lock<std::mutex> lock(s_replacement_texture_cache_mutex);
QueueAsyncReplacementTextureLoad(name, fnit->second, mipmap);
QueueAsyncReplacementTextureLoad(name, fnit->second, mipmap, false);
*pending = true;
return nullptr;
@@ -499,21 +499,33 @@ std::optional<GSTextureReplacements::ReplacementTexture> GSTextureReplacements::
return rtex;
}
void GSTextureReplacements::QueueAsyncReplacementTextureLoad(const TextureName& name, const std::string& filename, bool mipmap)
void GSTextureReplacements::QueueAsyncReplacementTextureLoad(const TextureName& name, const std::string& filename, bool mipmap, bool cache_only)
{
// check the pending list, so we don't queue it up multiple times
if (s_pending_async_load_textures.find(name) != s_pending_async_load_textures.end())
auto it = s_pending_async_load_textures.find(name);
if (it != s_pending_async_load_textures.end())
{
it->second &= cache_only;
return;
}
s_pending_async_load_textures.insert(name);
s_pending_async_load_textures.emplace(name, cache_only);
QueueWorkerThreadItem([name, filename, mipmap]() {
// actually load the file, this is what will take the time
std::optional<ReplacementTexture> replacement(LoadReplacementTexture(name, filename, !mipmap));
// check the pending set, there's a race here if we disable replacements while loading otherwise
// also check the full replacement list, if async loading is off, it might already be in there
std::unique_lock<std::mutex> lock(s_replacement_texture_cache_mutex);
if (s_pending_async_load_textures.find(name) == s_pending_async_load_textures.end())
auto it = s_pending_async_load_textures.find(name);
if (it == s_pending_async_load_textures.end() ||
s_replacement_texture_cache.find(name) != s_replacement_texture_cache.end())
{
if (it != s_pending_async_load_textures.end())
s_pending_async_load_textures.erase(it);
return;
}
// insert into the cache and queue for later injection
if (replacement.has_value())
@@ -545,7 +557,7 @@ void GSTextureReplacements::PrecacheReplacementTextures()
continue;
// precaching always goes async.. for now
QueueAsyncReplacementTextureLoad(it.first, it.second, mipmap);
QueueAsyncReplacementTextureLoad(it.first, it.second, mipmap, true);
}
}
@@ -606,7 +618,16 @@ void GSTextureReplacements::ProcessAsyncLoadedTextures()
for (const auto& [name, mipmap] : s_async_loaded_textures)
{
// no longer pending!
s_pending_async_load_textures.erase(name);
const auto pit = s_pending_async_load_textures.find(name);
if (pit != s_pending_async_load_textures.end())
{
const bool cache_only = pit->second;
s_pending_async_load_textures.erase(pit);
// if we were precaching, don't inject into the TC if we didn't actually get requested
if (cache_only)
continue;
}
// we should be in the cache now, lock and loaded
auto it = s_replacement_texture_cache.find(name);
+2 -2
View File
@@ -352,7 +352,7 @@ public:
GSTexture* CreateSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format) override;
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) override;
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx) override;
void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) override;
void DoFXAA(GSTexture* sTex, GSTexture* dTex) override;
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) override;
@@ -371,7 +371,7 @@ public:
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r, u32 destX, u32 destY) override;
void DoStretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, id<MTLRenderPipelineState> pipeline, bool linear, LoadAction load_action, void* frag_uniform, size_t frag_uniform_len);
void DoStretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, id<MTLRenderPipelineState> pipeline, bool linear, LoadAction load_action, const void* frag_uniform, size_t frag_uniform_len);
void DrawStretchRect(const GSVector4& sRect, const GSVector4& dRect, const GSVector2i& ds);
/// Copy from a position in sTex to the same position in the currently active render encoder using the given fs pipeline and rect
void RenderCopy(GSTexture* sTex, id<MTLRenderPipelineState> pipeline, const GSVector4i& rect);
+4 -12
View File
@@ -595,21 +595,13 @@ void GSDeviceMTL::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
StretchRect(dTex, full_r, sTex[2], dRect[0], ShaderConvert::YUV, linear);
}}
void GSDeviceMTL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx)
void GSDeviceMTL::DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb)
{ @autoreleasepool {
id<MTLCommandBuffer> cmdbuf = GetRenderCmdBuf();
GSScopedDebugGroupMTL dbg(cmdbuf, @"DoInterlace");
GSVector4 ds = GSVector4(dTex->GetSize());
GSVector4 sRect(0, 0, 1, 1);
GSVector4 dRect(0.f, yoffset, ds.x, ds.y + yoffset);
GSMTLInterlacePSUniform cb = {};
cb.ZrH = {static_cast<float>(bufIdx), 1.0f / ds.y, ds.y, MAD_SENSITIVITY};
const bool can_discard = shader == 0 || shader == 3;
DoStretchRect(sTex, sRect, dTex, dRect, m_interlace_pipeline[shader], linear, !can_discard ? LoadAction::DontCareIfFull : LoadAction::Load, &cb, sizeof(cb));
const bool can_discard = shader == ShaderInterlace::WEAVE || shader == ShaderInterlace::MAD_BUFFER;
DoStretchRect(sTex, sRect, dTex, dRect, m_interlace_pipeline[static_cast<int>(shader)], linear, !can_discard ? LoadAction::DontCareIfFull : LoadAction::Load, &cb, sizeof(cb));
}}
void GSDeviceMTL::DoFXAA(GSTexture* sTex, GSTexture* dTex)
@@ -1124,7 +1116,7 @@ void GSDeviceMTL::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r
[encoder endEncoding];
}}
void GSDeviceMTL::DoStretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, id<MTLRenderPipelineState> pipeline, bool linear, LoadAction load_action, void* frag_uniform, size_t frag_uniform_len)
void GSDeviceMTL::DoStretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, id<MTLRenderPipelineState> pipeline, bool linear, LoadAction load_action, const void* frag_uniform, size_t frag_uniform_len)
{
FlushClears(sTex);
@@ -33,6 +33,10 @@ struct ConvertPSRes
{
return texture.sample(s, coord);
}
float4 sample_level(float2 coord, float lod)
{
return texture.sample(s, coord, level(lod));
}
};
struct ConvertPSDepthRes
+14 -18
View File
@@ -27,7 +27,7 @@ fragment float4 ps_interlace0(ConvertShaderData data [[stage_in]], ConvertPSRes
const int vpos = int(data.p.y); // vertical position of destination texture
if ((vpos & 1) == field)
return res.sample(data.t);
return res.sample_level(data.t, 0);
else
discard_fragment();
@@ -38,7 +38,7 @@ fragment float4 ps_interlace0(ConvertShaderData data [[stage_in]], ConvertPSRes
// Bob shader
fragment float4 ps_interlace1(ConvertShaderData data [[stage_in]], ConvertPSRes res)
{
return res.sample(data.t);
return res.sample_level(data.t, 0);
}
@@ -47,9 +47,9 @@ fragment float4 ps_interlace2(ConvertShaderData data [[stage_in]], ConvertPSRes
constant GSMTLInterlacePSUniform& uniform [[buffer(GSMTLBufferIndexUniforms)]])
{
float2 vstep = float2(0.0f, uniform.ZrH.y);
float4 c0 = res.sample(data.t - vstep);
float4 c1 = res.sample(data.t);
float4 c2 = res.sample(data.t + vstep);
float4 c0 = res.sample_level(data.t - vstep, 0);
float4 c1 = res.sample_level(data.t, 0);
float4 c2 = res.sample_level(data.t + vstep, 0);
return (c0 + c1 * 2.f + c2) / 4.f;
}
@@ -71,15 +71,11 @@ fragment float4 ps_interlace3(ConvertShaderData data [[stage_in]], ConvertPSRes
const int vres = int(uniform.ZrH.z) >> 1; // vertical resolution of source texture
const int lofs = ((((vres + 1) >> 1) << 1) - vres) & bank; // line alignment offset for bank 1
const int vpos = int(data.p.y) + lofs; // vertical position of destination texture
const float2 bofs = float2(0.0f, 0.5f * bank); // vertical offset of the current bank relative to source texture size
const float2 vscale = float2(1.0f, 2.0f); // scaling factor from source to destination texture
const float2 optr = data.t - bofs; // used to check if the current destination line is within the current bank
const float2 iptr = optr * vscale; // pointer to the current pixel in the source texture
// if the index of current destination line belongs to the current fiels we update it, otherwise
// we leave the old line in the destination buffer
if ((optr.y >= 0.0f) && (optr.y < 0.5f) && ((vpos & 1) == field))
return res.sample(iptr);
if ((vpos & 1) == field)
return res.sample_level(data.t, 0);
else
discard_fragment();
@@ -137,13 +133,13 @@ fragment float4 ps_interlace4(ConvertShaderData data [[stage_in]], ConvertPSRes
// calculating motion, only relevant for missing lines where the "center line" is pointed by p_t1
float4 hn = res.sample(p_t0 - lofs); // new high pixel
float4 cn = res.sample(p_t1); // new center pixel
float4 ln = res.sample(p_t0 + lofs); // new low pixel
float4 hn = res.sample_level(p_t0 - lofs, 0); // new high pixel
float4 cn = res.sample_level(p_t1, 0); // new center pixel
float4 ln = res.sample_level(p_t0 + lofs, 0); // new low pixel
float4 ho = res.sample(p_t2 - lofs); // old high pixel
float4 co = res.sample(p_t3); // old center pixel
float4 lo = res.sample(p_t2 + lofs); // old low pixel
float4 ho = res.sample_level(p_t2 - lofs, 0); // old high pixel
float4 co = res.sample_level(p_t3, 0); // old center pixel
float4 lo = res.sample_level(p_t2 + lofs, 0); // old low pixel
float3 mh = hn.rgb - ho.rgb;
float3 mc = cn.rgb - co.rgb;
@@ -168,7 +164,7 @@ fragment float4 ps_interlace4(ConvertShaderData data [[stage_in]], ConvertPSRes
if ((vpos & 1) == field)
{
// output coordinate present on current field
return res.sample(p_t0);
return res.sample_level(p_t0, 0);
}
else if ((iptr.y > 0.5f - lofs.y) || (iptr.y < 0.0 + lofs.y))
{
-22
View File
@@ -1,22 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "GSDeviceNull.h"
GSTexture* GSDeviceNull::CreateSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format)
{
return new GSTextureNull(type, width, height, levels, format);
}
-32
View File
@@ -1,32 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "GS/Renderers/Common/GSDevice.h"
#include "GSTextureNull.h"
class GSDeviceNull : public GSDevice
{
private:
GSTexture* CreateSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format);
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) {}
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0, int bufIdx = 0) {}
u16 ConvertBlendEnum(u16 generic) { return 0xFFFF; }
public:
GSDeviceNull() {}
};
-42
View File
@@ -1,42 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "GSTextureNull.h"
GSTextureNull::GSTextureNull()
{
memset(&m_desc, 0, sizeof(m_desc));
}
GSTextureNull::GSTextureNull(Type type, int w, int h, int levels, GSTexture::Format format)
{
m_desc.type = type;
m_desc.w = w;
m_desc.h = h;
m_desc.levels = levels;
m_desc.format = format;
}
void GSTextureNull::Swap(GSTexture* tex)
{
GSTexture::Swap(tex);
std::swap(m_desc, static_cast<GSTextureNull*>(tex)->m_desc);
}
void* GSTextureNull::GetNativeHandle() const
{
return nullptr;
}
-42
View File
@@ -1,42 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "GS/Renderers/Common/GSTexture.h"
class GSTextureNull final : public GSTexture
{
struct
{
Type type;
Format format;
int w, h, levels;
} m_desc;
public:
GSTextureNull();
GSTextureNull(Type type, int w, int h, int levels, Format format);
Type GetType() const { return m_desc.type; }
Format GetFormat() const { return m_desc.format; }
bool Update(const GSVector4i& r, const void* data, int pitch, int layer = 0) override { return true; }
bool Map(GSMap& m, const GSVector4i* r = NULL, int layer = 0) override { return false; }
void Unmap() override {}
bool Save(const std::string& fn) override { return false; }
void Swap(GSTexture* tex) override;
void* GetNativeHandle() const override;
};
+4 -11
View File
@@ -1453,21 +1453,14 @@ void GSDeviceOGL::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
StretchRect(dTex, full_r, sTex[2], dRect[2], ShaderConvert::YUV, linear);
}
void GSDeviceOGL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx)
void GSDeviceOGL::DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb)
{
GL_PUSH("DoInterlace");
OMSetColorMaskState();
const GSVector4 ds = GSVector4(dTex->GetSize());
m_interlace.ps[static_cast<int>(shader)].Bind();
m_interlace.ps[static_cast<int>(shader)].Uniform4fv(0, cb.ZrH.F32);
const GSVector4 sRect(0, 0, 1, 1);
const GSVector4 dRect(0.0f, yoffset, ds.x, ds.y + yoffset);
m_interlace.ps[shader].Bind();
m_interlace.ps[shader].Uniform4f(0, bufIdx, 1.0f / ds.y, ds.y, MAD_SENSITIVITY);
StretchRect(sTex, sRect, dTex, dRect, m_interlace.ps[shader], linear);
StretchRect(sTex, sRect, dTex, dRect, m_interlace.ps[static_cast<int>(shader)], linear);
}
void GSDeviceOGL::DoFXAA(GSTexture* sTex, GSTexture* dTex)
+1 -1
View File
@@ -277,7 +277,7 @@ private:
GSTexture* CreateSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format) final;
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) final;
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0, int bufIdx = 0) final;
void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) final;
void DoFXAA(GSTexture* sTex, GSTexture* dTex) final;
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) final;
-2
View File
@@ -617,8 +617,6 @@ void GSRendererSW::Sync(int reason)
g_perfmon.Put(GSPerfMon::Fillrate, pixels);
}
void GSRendererSW::ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r) {}
void GSRendererSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool eewrite)
{
if (LOG)
-1
View File
@@ -78,7 +78,6 @@ protected:
void Draw() override;
void Queue(GSRingHeap::SharedPtr<GSRasterizerData>& item);
void Sync(int reason);
void ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r) override;
void InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool eewrite = false) override;
void InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& r, bool clut = false) override;
+4 -17
View File
@@ -939,29 +939,16 @@ void GSDeviceVK::DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex,
static_cast<GSTextureVK*>(dTex)->TransitionToLayout(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
}
void GSDeviceVK::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset, int bufIdx)
void GSDeviceVK::DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb)
{
const GSVector2i ds_i = dTex->GetSize();
const GSVector4 ds = GSVector4(ds_i);
const GSVector4 sRect(0, 0, 1, 1);
const GSVector4 dRect(0.0f, yoffset, ds.x, ds.y + yoffset);
InterlaceConstantBuffer cb;
cb.ZrH = GSVector4(static_cast<float>(bufIdx), 1.0f / ds.y, ds.y, MAD_SENSITIVITY);
GL_PUSH("DoInterlace %dx%d Shader:%d Linear:%d", ds_i.x, ds_i.y, shader, linear);
static_cast<GSTextureVK*>(dTex)->TransitionToLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
const GSVector4i rc(0, 0, ds_i.x, ds_i.y);
const GSVector4i rc = GSVector4i(dRect);
EndRenderPass();
OMSetRenderTargets(dTex, nullptr, rc, false);
SetUtilityTexture(sTex, linear ? m_linear_sampler : m_point_sampler);
BeginRenderPassForStretchRect(static_cast<GSTextureVK*>(dTex), rc, rc, false);
SetPipeline(m_interlace[shader]);
BeginRenderPassForStretchRect(static_cast<GSTextureVK*>(dTex), dTex->GetRect(), rc, false);
SetPipeline(m_interlace[static_cast<int>(shader)]);
SetUtilityPushConstants(&cb, sizeof(cb));
DrawStretchRect(sRect, dRect, dTex->GetSize());
EndRenderPass();
+1 -1
View File
@@ -155,7 +155,7 @@ private:
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE,
const GSRegEXTBUF& EXTBUF, const GSVector4& c, const bool linear) final;
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0, int bufIdx = 0) final;
void DoInterlace(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderInterlace shader, bool linear, const InterlaceConstantBuffer& cb) final;
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float params[4]) final;
void DoFXAA(GSTexture* sTex, GSTexture* dTex) final;
+3 -3
View File
@@ -591,7 +591,7 @@ void VMManager::LoadPatches(const std::string& serial, u32 crc, bool show_messag
// wide screen patches
if (EmuConfig.EnableWideScreenPatches && crc != 0)
{
if (!Achievements::ChallengeModeActive() && (s_active_widescreen_patches = LoadPatchesFromDir(crc_string, EmuFolders::CheatsWS, "Widescreen hacks", false) > 0))
if (!Achievements::ChallengeModeActive() && (s_active_widescreen_patches = LoadPatchesFromDir(crc_string, EmuFolders::CheatsWS, "Widescreen hacks", false)) > 0)
{
Console.WriteLn(Color_Gray, "Found widescreen patches in the cheats_ws folder --> skipping cheats_ws.zip");
}
@@ -1522,8 +1522,8 @@ bool VMManager::ChangeDisc(CDVD_SourceType source, std::string path)
DoCDVDopen();
}
}
cdvdCtrlTrayOpen();
cdvd.Tray.cdvdActionSeconds = 1;
cdvd.Tray.trayState = CDVD_DISC_OPEN;
return result;
}
-4
View File
@@ -285,7 +285,6 @@
<ClCompile Include="GS\GSCrc.cpp" />
<ClCompile Include="GS\Renderers\Common\GSDevice.cpp" />
<ClCompile Include="GS\Renderers\DX11\GSDevice11.cpp" />
<ClCompile Include="GS\Renderers\Null\GSDeviceNull.cpp" />
<ClCompile Include="GS\Renderers\OpenGL\GSDeviceOGL.cpp" />
<ClCompile Include="GS\Renderers\Common\GSDirtyRect.cpp" />
<ClCompile Include="GS\GSDrawingContext.cpp" />
@@ -318,7 +317,6 @@
<ClCompile Include="GS\Renderers\HW\GSTextureCache.cpp" />
<ClCompile Include="GS\Renderers\SW\GSTextureCacheSW.cpp" />
<ClCompile Include="GS\Renderers\DX11\GSTextureFX11.cpp" />
<ClCompile Include="GS\Renderers\Null\GSTextureNull.cpp" />
<ClCompile Include="GS\Renderers\SW\GSTextureSW.cpp" />
<ClCompile Include="GS\GSUtil.cpp" />
<ClCompile Include="GS\GSVector.cpp" />
@@ -624,7 +622,6 @@
<ClInclude Include="GS\GSCrc.h" />
<ClInclude Include="GS\Renderers\Common\GSDevice.h" />
<ClInclude Include="GS\Renderers\DX11\GSDevice11.h" />
<ClInclude Include="GS\Renderers\Null\GSDeviceNull.h" />
<ClInclude Include="GS\Renderers\OpenGL\GSDeviceOGL.h" />
<ClInclude Include="GS\Renderers\Common\GSDirtyRect.h" />
<ClInclude Include="GS\GSDrawingContext.h" />
@@ -656,7 +653,6 @@
<ClInclude Include="GS\Renderers\OpenGL\GSTextureOGL.h" />
<ClInclude Include="GS\Renderers\HW\GSTextureCache.h" />
<ClInclude Include="GS\Renderers\SW\GSTextureCacheSW.h" />
<ClInclude Include="GS\Renderers\Null\GSTextureNull.h" />
<ClInclude Include="GS\Renderers\SW\GSTextureSW.h" />
<ClInclude Include="GS\GSThread.h" />
<ClInclude Include="GS\GSThread_CXX11.h" />
-12
View File
@@ -1100,15 +1100,9 @@
<ClCompile Include="GS\Renderers\SW\GSRasterizer.cpp">
<Filter>System\Ps2\GS\Renderers\Software</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\Null\GSDeviceNull.cpp">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\Null\GSRendererNull.cpp">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\Null\GSTextureNull.cpp">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClCompile>
<ClCompile Include="GS\Renderers\HW\GSRendererHW.cpp">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClCompile>
@@ -2026,15 +2020,9 @@
<ClInclude Include="GS\Renderers\SW\GSRasterizer.h">
<Filter>System\Ps2\GS\Renderers\Software</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\Null\GSDeviceNull.h">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\Null\GSRendererNull.h">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\Null\GSTextureNull.h">
<Filter>System\Ps2\GS\Renderers\Null</Filter>
</ClInclude>
<ClInclude Include="GS\Renderers\HW\GSRendererHW.h">
<Filter>System\Ps2\GS\Renderers\Hardware</Filter>
</ClInclude>