diff --git a/bin/resources/GameIndex.yaml b/bin/resources/GameIndex.yaml index 1f6a2eb97d..b1d6f05e76 100644 --- a/bin/resources/GameIndex.yaml +++ b/bin/resources/GameIndex.yaml @@ -2744,6 +2744,8 @@ SCES-51159: SCES-51164: name: "Mark of Kri, The" region: "PAL-M5" + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SCES-51176: name: "Disney's Treasure Planet" region: "PAL-M4" @@ -6179,6 +6181,8 @@ SCUS-97140: name: "Mark of Kri, The" region: "NTSC-U" compat: 5 + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto patches: DBD09DD4: content: |- @@ -6399,6 +6403,8 @@ SCUS-97200: SCUS-97201: name: "Mark of Kri, The" region: "NTSC-U" + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SCUS-97203: name: "Wild ARMs 3" region: "NTSC-U" @@ -6477,6 +6483,8 @@ SCUS-97220: SCUS-97222: name: "Mark of Kri [Demo]" region: "NTSC-U" + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SCUS-97223: name: "NFL GameDay 2003 [Demo]" region: "NTSC-U" @@ -15808,6 +15816,8 @@ SLES-53621: name: "Wallace & Grommit - The Curse of the Were Rabbit" region: "PAL-M5" compat: 5 + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SLES-53623: name: "Spongebob SquarePants - Battle for Bikini Bottom" region: "PAL-F" @@ -24763,6 +24773,8 @@ SLPM-65309: SLPM-65310: name: "Mark of Kri, The" region: "NTSC-J" + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SLPM-65311: name: "Violet no Atelier - Gramnad no Renkinjutsushi" region: "NTSC-J" @@ -28059,6 +28071,8 @@ SLPM-66325: SLPM-66327: name: "Wallace and Gromit - The Curse of the Were-Rabbit" region: "NTSC-J" + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SLPM-66328: name: "Call of Duty 2 - Big Red One" region: "NTSC-J" @@ -41417,6 +41431,8 @@ SLUS-21312: name: "Wallace & Gromit - The Curse of the Were-Rabbit" region: "NTSC-U" compat: 5 + gsHWFixes: + interlace: 3 # Game requires bob delinterlacing when auto SLUS-21313: name: "Friends - The One with all the Trivia" region: "NTSC-U" diff --git a/pcsx2/GS/Renderers/Common/GSRenderer.cpp b/pcsx2/GS/Renderers/Common/GSRenderer.cpp index 34489815a2..88f9ce6673 100644 --- a/pcsx2/GS/Renderers/Common/GSRenderer.cpp +++ b/pcsx2/GS/Renderers/Common/GSRenderer.cpp @@ -276,15 +276,7 @@ bool GSRenderer::Merge(int field) { const int field2 = scanmask ? 0 : 1 - ((static_cast(GSConfig.InterlaceMode) - 1) & 1); const int offset = tex[1] ? tex[1]->GetScale().y : tex[0]->GetScale().y; - // -1 = None - // 0 = Weave - // 1 = Bob - // 2 = Blend - int mode = scanmask ? 2 : std::clamp((static_cast(GSConfig.InterlaceMode) - 1) >> 1, -1, 2); - - // If we're on auto, prefer no interlacing (bob, kinda), unless there is an offset or scanmsk, then retain blend - if (GSConfig.InterlaceMode == GSInterlaceMode::Automatic && !(m_regs->SMODE2.FFMD) && !scanmask && !offset) - mode = -1; + int mode = scanmask ? 2 : (static_cast(GSConfig.InterlaceMode) - 1) >> 1; g_gs_device->Interlace(ds, field ^ field2, mode, offset); } diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index 14d0e66cbc..c46d1bd74c 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -285,6 +285,7 @@ static const char* s_gs_hw_fix_names[] = { "halfPixelOffset", "roundSprite", "texturePreloading", + "interlace", }; static_assert(std::size(s_gs_hw_fix_names) == static_cast(GameDatabaseSchema::GSHWFixId::Count), "HW fix name lookup is correct size"); @@ -308,6 +309,7 @@ bool GameDatabaseSchema::isUserHackHWFix(GSHWFixId id) { switch (id) { + case GSHWFixId::Interlace: case GSHWFixId::Mipmap: case GSHWFixId::TexturePreloading: case GSHWFixId::ConservativeFramebuffer: @@ -437,6 +439,16 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& } break; + case GSHWFixId::Interlace: + if (value >= 0 && value <= static_cast(GSInterlaceMode::Automatic)) + { + if (config.InterlaceMode == GSInterlaceMode::Automatic) + config.InterlaceMode = static_cast(value); + else + Console.Warning("[GameDB] Game requires different interlace mode but it has been overridden by user setting."); + } + break; + default: break; } diff --git a/pcsx2/GameDatabase.h b/pcsx2/GameDatabase.h index 462e8c1f72..faa25cd523 100644 --- a/pcsx2/GameDatabase.h +++ b/pcsx2/GameDatabase.h @@ -81,6 +81,7 @@ namespace GameDatabaseSchema HalfPixelOffset, RoundSprite, TexturePreloading, + Interlace, Count };