From c6ce380042c71ff43fa9b7e630c2a9ea2195b9a6 Mon Sep 17 00:00:00 2001
From: RedDevilus <martensregis@gmail.com>
Date: Thu, 17 Mar 2022 02:18:40 +0100
Subject: [PATCH] GameDB: More GS HW Fixes

Some extra comments for Monster Lab and SSX Tricky.

New entries:

- Alter Echo
- Beyond Good and Evil
- Dragon Ball Z - Budokai Tenkaichi 2
- Fatal Frame 1 / 3
- Ghost in the Shell - Stand Alone Complex
- Global Defence Force
- Xenosaga 1 / 2 / 3
---
 bin/resources/GameIndex.yaml | 130 +++++++++++++++++++++++++++--------
 1 file changed, 102 insertions(+), 28 deletions(-)

diff --git a/bin/resources/GameIndex.yaml b/bin/resources/GameIndex.yaml
index f17f0ffa88..caa57ed5e5 100644
--- a/bin/resources/GameIndex.yaml
+++ b/bin/resources/GameIndex.yaml
@@ -492,6 +492,9 @@ SCAJ-20070:
 SCAJ-20072:
   name: "Ghost in the Shell - Stand Alone Complex"
   region: "NTSC-Unk"
+  gsHWFixes:
+    halfPixelOffset: 1 # Fixes texture and lighting misalignment.
+    mergeSprite: 1 # Fixes most vertical lines and lighting misalignment.
 SCAJ-20073:
   name: "Jak and Daxter II"
   region: "NTSC-Unk"
@@ -563,7 +566,9 @@ SCAJ-20086:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Disc1of2]"
   region: "NTSC-Unk"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -575,7 +580,9 @@ SCAJ-20087:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Disc2of2]"
   region: "NTSC-Unk"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -814,6 +821,8 @@ SCAJ-20138:
 SCAJ-20139:
   name: "Zero - Shisei no Koe" # Fatal Frame - Rei - Irezumi no Sei
   region: "NTSC-Unk"
+  gsHWFixes:
+    halfPixelOffset: 1 # Reduces blurriness.
 SCAJ-20140:
   name: "Bleach - Erabareshi Tamashi"
   region: "NTSC-Unk"
@@ -990,13 +999,17 @@ SCAJ-20179:
   region: "NTSC-Unk"
   gsHWFixes:
     textureInsideRT: 1
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 1 # Fixes lighting misalignment and reduces ground shadows (probably texture cache issue).
+    roundSprite: 2 # Fixes font artifacts.
 SCAJ-20180:
   name: "Xenosaga Episode III - Also Sprach Zarathustra [Disc2of2]"
   region: "NTSC-Unk"
   gsHWFixes:
     textureInsideRT: 1
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 1 # Fixes lighting misalignment and reduces ground shadows (probably texture cache issue).
+    roundSprite: 2 # Fixes font artifacts.
 SCAJ-20181:
   name: "Minna no Tennis"
   region: "NTSC-Unk"
@@ -1111,7 +1124,9 @@ SCAJ-30001:
   region: "NTSC-Unk"
   compat: 5
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Removes puppet lines shadows.
+    roundSprite: 2 # Fixes font artifacts.
 SCAJ-30002:
   name: "Wild ARMs - Alter Code F"
   region: "NTSC-J"
@@ -4162,6 +4177,9 @@ SCKA-20027:
   name: "Ghost in the Shell - Stand Alone Complex"
   region: "NTSC-K"
   compat: 5
+  gsHWFixes:
+    halfPixelOffset: 1 # Fixes texture and lighting misalignment.
+    mergeSprite: 1 # Fixes most vertical lines and lighting misalignment.
 SCKA-20028:
   name: "Ico [PlayStation2 Big Hit Series]"
   region: "NTSC-K"
@@ -5787,7 +5805,9 @@ SCPS-55901:
   name: "Xenosaga Episode I - Der Wille zur Macht"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Removes puppet lines shadows.
+    roundSprite: 2 # Fixes font artifacts.
   patches:
     A3D63039:
       content: |-
@@ -9131,7 +9151,7 @@ SLES-50545:
   name: "SSX Tricky"
   region: "PAL-M3"
   roundModes:
-    eeRoundMode: 0 # Fixes riders vanish into the floor
+    eeRoundMode: 0 # Fixes riders vanish into the floor.
 SLES-50546:
   name: "LMA Manager 2002"
   region: "PAL-E"
@@ -11332,9 +11352,13 @@ SLES-51668:
 SLES-51670:
   name: "Alter Echo"
   region: "PAL-E"
+  gsHWFixes:
+    halfPixelOffset: 2 # Fixes side borders.
 SLES-51671:
   name: "Alter Echo"
   region: "PAL-M5"
+  gsHWFixes:
+    halfPixelOffset: 2 # Fixes side borders.
 SLES-51675:
   name: "Psyvariar - Complete Edition"
   region: "PAL-M4"
@@ -11891,8 +11915,9 @@ SLES-51917:
   roundModes:
     eeRoundMode: 0  # Fixes SPS with water in some places.
   gsHWFixes:
-    textureInsideRT: 1
-    autoFlush: 1
+    textureInsideRT: 1 # Fixes the shape of shadows.
+    autoFlush: 1 # Fixes water rendering.
+    halfPixelOffset: 3 # Fixes bloom misalignment, needs this harsh offset for autoflush.
 SLES-51918:
   name: "Prince of Persia - The Sands of Time"
   region: "PAL-M5"
@@ -14163,6 +14188,9 @@ SLES-53017:
 SLES-53020:
   name: "Ghost in the Shell - Stand Alone Complex"
   region: "PAL-M5"
+  gsHWFixes:
+    halfPixelOffset: 1 # Fixes texture and lighting misalignment.
+    mergeSprite: 1 # Fixes most vertical lines and lighting misalignment.
   patches:
     BF6F101F:
       content: |-
@@ -16019,6 +16047,8 @@ SLES-53825:
   name: "Project Zero 3 - The Tormented"
   region: "PAL-M5"
   compat: 5
+  gsHWFixes:
+    halfPixelOffset: 1 # Reduces blurriness.
 SLES-53826:
   name: "Tom Clancy's Splinter Cell - Double Agent"
   region: "PAL-M5"
@@ -16708,6 +16738,8 @@ SLES-54164:
   name: "DragonBall Z Budokai - Tenkaichi 2"
   region: "PAL-M6"
   compat: 5
+  gsHWFixes:
+    roundSprite: 2 # Fixes font artifacts.
 SLES-54165:
   name: "One Piece - Grand Adventure"
   region: "PAL-E"
@@ -17459,6 +17491,7 @@ SLES-54464:
   region: "PAL-E"
   compat: 5
   gsHWFixes:
+    roundSprite: 1 # Fixes HUD artifacts.
     wildArmsHack: 1 # Lessens the bloom misalignment but still an issue.
 SLES-54465:
   name: "CSI: 3 Dimensions of Murder"
@@ -19027,7 +19060,7 @@ SLES-55169:
   name: "Monster Lab"
   region: "PAL-M5"
   gsHWFixes:
-    cpuFramebufferConversion: 1
+    cpuFramebufferConversion: 1 # Fixes black with rainbow screen.
 SLES-55170:
   name: "Margot's Word Brain"
   region: "PAL-M5"
@@ -20078,7 +20111,9 @@ SLES-82034:
   name: "Xenosaga Episode II [Disc1of2]"
   region: "PAL-M3"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLES-82034"
     - "SCES-82034"
@@ -20086,7 +20121,9 @@ SLES-82035:
   name: "Xenosaga Episode II [Disc2of2]"
   region: "PAL-M3"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLES-82034"
     - "SCES-82034"
@@ -21312,7 +21349,9 @@ SLPM-61147:
   region: "NTSC-J"
   gsHWFixes:
     textureInsideRT: 1
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 1 # Fixes lighting misalignment and reduces ground shadows (probably texture cache issue).
+    roundSprite: 2 # Fixes font artifacts.
 SLPM-62001:
   name: "Drum Mania"
   region: "NTSC-J"
@@ -22948,6 +22987,7 @@ SLPM-62652:
   region: "NTSC-J"
   compat: 5
   gsHWFixes:
+    roundSprite: 1 # Fixes HUD artifacts.
     wildArmsHack: 1 # Lessens the bloom misalignment but still an issue.
 SLPM-62653:
   name: "Psikyo Shooting Collection Vol.1 - Strikers 1945 1&2 [Taito The Best]"
@@ -31569,7 +31609,7 @@ SLPS-25078:
   name: "SSX Tricky"
   region: "NTSC-J"
   roundModes:
-    eeRoundMode: 0 # Fixes riders vanish into the floor
+    eeRoundMode: 0 # Fixes riders vanish into the floor.
 SLPS-25079:
   name: "Madden NFL 2002"
   region: "NTSC-J"
@@ -32434,7 +32474,9 @@ SLPS-25366:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Premium Box] [Disc1of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -32446,7 +32488,9 @@ SLPS-25367:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Premium Box] [Disc2of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -32458,7 +32502,9 @@ SLPS-25368:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Disc1of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters: # Allows import of Xenosaga I, Xenosaga I Reloaded, and Xenosaga Freaks data.
     - "SLPS-29001"
     - "SLPS-29002"
@@ -32470,7 +32516,9 @@ SLPS-25369:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [Disc2of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -33406,7 +33454,9 @@ SLPS-25640:
   compat: 5
   gsHWFixes:
     textureInsideRT: 1
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 1 # Fixes lighting misalignment and reduces ground shadows (probably texture cache issue).
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters: # Allows import of Xenosaga II save data.
     - "SLPS-25640"
     - "SLPS-25368"
@@ -33416,7 +33466,9 @@ SLPS-25641:
   compat: 5
   gsHWFixes:
     textureInsideRT: 1
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 1 # Fixes lighting misalignment and reduces ground shadows (probably texture cache issue).
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-25640"
     - "SLPS-25368"
@@ -34597,7 +34649,9 @@ SLPS-73224:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [PlayStation 2 The Best] [Disc1of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -34609,7 +34663,9 @@ SLPS-73225:
   name: "Xenosaga Episode II - Jenseits von Gut und Bose [PlayStation 2 The Best] [Disc2of2]"
   region: "NTSC-J"
   gsHWFixes:
-    autoFlush: 1
+    autoFlush: 1 # Fixes shadows in cutscenes.
+    halfPixelOffset: 2 # Fixes lighting misalignment and shadows.
+    roundSprite: 2 # Fixes font artifacts.
   memcardFilters:
     - "SLPS-29001"
     - "SLPS-29002"
@@ -34849,6 +34905,8 @@ SLPS-73404:
 SLPS-73405:
   name: "Zero [PlayStation 2 The Best]"
   region: "NTSC-J"
+  gsHWFixes:
+    halfPixelOffset: 2 # Reduces blurriness.
 SLPS-73406:
   name: "Dead or Alive 2 - Hardcore [PlayStation 2 The Best]"
   region: "NTSC-J"
@@ -36160,7 +36218,7 @@ SLUS-20326:
   region: "NTSC-U"
   compat: 5
   roundModes:
-    eeRoundMode: 0 # Fixes riders vanish into the floor
+    eeRoundMode: 0 # Fixes riders vanish into the floor.
 SLUS-20327:
   name: "Aggressive Inline"
   region: "NTSC-U"
@@ -36767,6 +36825,8 @@ SLUS-20465:
   name: "Alter Echo"
   region: "NTSC-U"
   compat: 5
+  gsHWFixes:
+    halfPixelOffset: 2 # Fixes side borders.
 SLUS-20466:
   name: "Gravenville - Ghost Master"
   region: "NTSC-U"
@@ -38079,8 +38139,9 @@ SLUS-20763:
   roundModes:
     eeRoundMode: 0  # Fixes SPS with water in some places.
   gsHWFixes:
-    textureInsideRT: 1
-    autoFlush: 1
+    textureInsideRT: 1 # Fixes the shape of shadows.
+    autoFlush: 1 # Fixes water rendering.
+    halfPixelOffset: 3 # Fixes bloom misalignment, needs this harsh offset for autoflush.
 SLUS-20764:
   name: "Bombastic"
   region: "NTSC-U"
@@ -39173,6 +39234,9 @@ SLUS-21006:
   name: "Ghost in the Shell - Stand Alone Complex"
   region: "NTSC-U"
   compat: 5
+  gsHWFixes:
+    halfPixelOffset: 1 # Fixes texture and lighting misalignment.
+    mergeSprite: 1 # Fixes most vertical lines and lighting misalignment.
   patches:
     default:
       content: |-
@@ -40327,6 +40391,8 @@ SLUS-21244:
   name: "Fatal Frame 3 - The Tormented"
   region: "NTSC-U"
   compat: 5
+  gsHWFixes:
+    halfPixelOffset: 1 # Reduces blurriness.
 SLUS-21245:
   name: "Suikoden Tactics"
   region: "NTSC-U"
@@ -41335,6 +41401,8 @@ SLUS-21441:
   name: "Dragon Ball Z - Budokai Tenkaichi 2"
   region: "NTSC-U"
   compat: 5
+  gsHWFixes:
+    roundSprite: 2 # Fixes font artifacts.
 SLUS-21442:
   name: "Super Dragon Ball Z"
   region: "NTSC-U"
@@ -42969,7 +43037,7 @@ SLUS-21838:
   region: "NTSC-U"
   compat: 5
   gsHWFixes:
-    cpuFramebufferConversion: 1
+    cpuFramebufferConversion: 1 # Fixes black with rainbow screen.
 SLUS-21839:
   name: "Ski and Shoot"
   region: "NTSC-U"
@@ -43740,6 +43808,8 @@ SLUS-29055:
 SLUS-29056:
   name: "Alter Echo [Demo]"
   region: "NTSC-U"
+  gsHWFixes:
+    halfPixelOffset: 2 # Fixes side borders.
 SLUS-29057:
   name: "Sphinx and the Shadow of Set [Demo]"
   region: "NTSC-U"
@@ -43812,8 +43882,9 @@ SLUS-29082:
   roundModes:
     eeRoundMode: 0  # Fixes SPS with water in some places.
   gsHWFixes:
-    textureInsideRT: 1
-    autoFlush: 1
+    textureInsideRT: 1 # Fixes the shape of shadows.
+    autoFlush: 1 # Fixes water rendering.
+    halfPixelOffset: 3 # Fixes bloom misalignment, needs this harsh offset for autoflush.
 SLUS-29083:
   name: "Maximo vs. The Army of Zin [Demo]"
   region: "NTSC-U"
@@ -43901,6 +43972,9 @@ SLUS-29118:
 SLUS-29123:
   name: "Ghost in the Shell - Stand Alone Complex [Demo]"
   region: "NTSC-U"
+  gsHWFixes:
+    halfPixelOffset: 1 # Fixes texture and lighting misalignment.
+    mergeSprite: 1 # Fixes most vertical lines and lighting misalignment.
 SLUS-29124:
   name: "Fight Club [Demo]"
   region: "NTSC-U"