From 1c301ec8899c84c4657232f779f03834feb8026b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 3 Mar 2022 23:55:27 +1000 Subject: [PATCH] GS: Move point list palette to gamedb --- bin/resources/GameIndex.yaml | 23 +++++++++++++++++++++++ pcsx2/Config.h | 1 + pcsx2/GS/GS.cpp | 4 +++- pcsx2/GS/GSCrc.cpp | 18 +++++++++--------- pcsx2/GS/GSCrc.h | 5 ----- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 5 +++-- pcsx2/GameDatabase.cpp | 6 ++++++ pcsx2/GameDatabase.h | 1 + pcsx2/Pcsx2Config.cpp | 1 + 9 files changed, 47 insertions(+), 17 deletions(-) diff --git a/bin/resources/GameIndex.yaml b/bin/resources/GameIndex.yaml index 451a570209..f17429379d 100644 --- a/bin/resources/GameIndex.yaml +++ b/bin/resources/GameIndex.yaml @@ -20196,6 +20196,11 @@ SLPM-55096: name: "ThunderForce VI" region: "NTSC-J" compat: 5 +SLPM-55102: + name: "Pia Carrot e Youkoso!! G.P. Gakuen Princess" + region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-55108: name: "Fate - Unlimited Codes" region: "NTSC-J" @@ -25054,6 +25059,8 @@ SLPM-65842: SLPM-65843: name: "120 Yen no Haru - 120 Yen Stories" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-65844: name: "Air [Best]" region: "NTSC-J" @@ -25186,6 +25193,8 @@ SLPM-65888: SLPM-65889: name: "Kazoku Keikaku - Kokoro no Kizuna" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-65890: name: "Shin Sangoku Musou 4" region: "NTSC-J" @@ -25784,9 +25793,13 @@ SLPM-66082: SLPM-66083: name: "Ramune - Garasu-Bin ni Utsuru Umi [Limited Edition]" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66084: name: "Ramune - Garasu-Bin ni Utsuru Umi" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66085: name: "Rumble Roses [Konami The Best]" region: "NTSC-J" @@ -25935,6 +25948,8 @@ SLPM-66138: SLPM-66139: name: "Duel Savior Destiny" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66140: name: "Atelier Marie + Elie: Salburg no Renkinjutsushi 1&2" region: "NTSC-J" @@ -26487,6 +26502,8 @@ SLPM-66301: SLPM-66302: name: "Clannad" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66307: name: "Sengoku Musou 2" region: "NTSC-J" @@ -27497,6 +27514,8 @@ SLPM-66610: SLPM-66611: name: "Tomoyo After - It's Wonderful Life [CS Edition]" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66612: name: "School Love [Limited Edition]" region: "NTSC-J" @@ -28466,6 +28485,8 @@ SLPM-66918: SLPM-66919: name: "Kyuuketsu Kitan Moonties" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66920: name: "Hoshi Furu" region: "NTSC-J" @@ -28638,6 +28659,8 @@ SLPM-66989: SLPM-66990: name: "Majo-musume A La Mode II [Best Version]" region: "NTSC-J" + gsHWFixes: + pointListPalette: 1 SLPM-66991: name: "Fuuuraiki [Best Version]" region: "NTSC-J" diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 9b96b663ba..3bc32ac782 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -442,6 +442,7 @@ struct Pcsx2Config WrapGSMem : 1, Mipmap : 1, AA1 : 1, + PointListPalette : 1, ManualUserHacks : 1, UserHacks_AlignSpriteX : 1, UserHacks_AutoFlush : 1, diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index c52ad3ffcd..3e601d51ce 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -804,7 +804,8 @@ void GSUpdateConfig(const Pcsx2Config::GSOptions& new_config) // This is where we would do finer-grained checks in the future. // For example, flushing the texture cache when mipmap settings change. - if (GSConfig.CRCHack != old_config.CRCHack) + if (GSConfig.CRCHack != old_config.CRCHack || + GSConfig.PointListPalette != old_config.PointListPalette) { // for automatic mipmaps, we need to reload the crc s_gs->SetGameCRC(s_gs->GetGameCRC(), s_gs->GetGameCRCOptions()); @@ -1356,6 +1357,7 @@ void GSApp::Init() m_default_configuration["override_GL_ARB_texture_barrier"] = "-1"; m_default_configuration["paltex"] = "0"; m_default_configuration["png_compression_level"] = std::to_string(Z_BEST_SPEED); + m_default_configuration["PointListPalette"] = "0"; m_default_configuration["PrecacheTextureReplacements"] = "0"; m_default_configuration["preload_frame_with_gs_data"] = "0"; m_default_configuration["Renderer"] = std::to_string(static_cast(GSRendererType::Auto)); diff --git a/pcsx2/GS/GSCrc.cpp b/pcsx2/GS/GSCrc.cpp index 2b8cac8167..1a3174d989 100644 --- a/pcsx2/GS/GSCrc.cpp +++ b/pcsx2/GS/GSCrc.cpp @@ -26,14 +26,14 @@ const CRC::Game CRC::m_games[] = {0x68CE6801, ArTonelico2, JP, 0}, {0xCE2C1DBF, ArTonelico2, EU, 0}, {0x2113EA2E, MetalSlug6, JP, 0}, - {0x42E05BAF, TomoyoAfter, JP, PointListPalette}, - {0x7800DC84, Clannad, JP, PointListPalette}, - {0xA6167B59, Lamune, JP, PointListPalette}, - {0xDDB59F46, KyuuketsuKitanMoonties, JP, PointListPalette}, - {0xC8EE2562, PiaCarroteYoukosoGPGakuenPrincess, JP, PointListPalette}, - {0x6CF94A43, KazokuKeikakuKokoroNoKizuna, JP, PointListPalette}, - {0xEDAF602D, DuelSaviorDestiny, JP, PointListPalette}, - {0xBB63D785, OneTwentyYenStories, JP, PointListPalette}, // no Haru: 120 Yen Stories + {0x42E05BAF, TomoyoAfter, JP, 0}, + {0x7800DC84, Clannad, JP, 0}, + {0xA6167B59, Lamune, JP, 0}, + {0xDDB59F46, KyuuketsuKitanMoonties, JP, 0}, + {0xC8EE2562, PiaCarroteYoukosoGPGakuenPrincess, JP, 0}, + {0x6CF94A43, KazokuKeikakuKokoroNoKizuna, JP, 0}, + {0xEDAF602D, DuelSaviorDestiny, JP, 0}, + {0xBB63D785, OneTwentyYenStories, JP, 0}, // no Haru: 120 Yen Stories {0xA39517AB, FFX, EU, 0}, {0x78D83FD5, FFX, EU, 0}, // Demo {0xA39517AE, FFX, FR, 0}, @@ -206,7 +206,7 @@ const CRC::Game CRC::m_games[] = {0xA3643EB1, GiTS, KO, 0}, {0x28557423, GiTS, RU, 0}, {0xBF6F101F, GiTS, EU, 0}, // same CRC as another US disc - {0xF442260C, MajokkoALaMode2, JP, PointListPalette}, + {0xF442260C, MajokkoALaMode2, JP, 0}, {0xA616A6C2, TalesOfAbyss, US, 0}, {0x14FE77F7, TalesOfAbyss, US, 0}, {0xAA5EC3A3, TalesOfAbyss, JP, 0}, diff --git a/pcsx2/GS/GSCrc.h b/pcsx2/GS/GSCrc.h index 29c1ddbfc5..a8f71ccd1c 100644 --- a/pcsx2/GS/GSCrc.h +++ b/pcsx2/GS/GSCrc.h @@ -156,11 +156,6 @@ public: RegionCount, }; - enum Flags - { - PointListPalette = 1, - }; - struct Game { u32 crc; diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 67de48a2b6..1e87956785 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -1827,9 +1827,10 @@ void GSRendererHW::Hacks::SetGameCRC(const CRC::Game& game) m_oo = m_oo_map[hash]; m_cu = m_cu_map[hash]; - if (game.flags & CRC::PointListPalette) + if (GSConfig.PointListPalette) { - ASSERT(m_oi == NULL); + if (m_oi) + Console.Warning("Overriding m_oi with PointListPalette"); m_oi = &GSRendererHW::OI_PointListPalette; } diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index 8a7461d232..9ec1bad3b6 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -276,6 +276,7 @@ static const char* s_gs_hw_fix_names[] = { "alignSprite", "mergeSprite", "wildArmsHack", + "pointListPalette", "mipmap", "trilinearFiltering", "skipDrawStart", @@ -310,6 +311,7 @@ bool GameDatabaseSchema::isUserHackHWFix(GSHWFixId id) case GSHWFixId::Mipmap: case GSHWFixId::TexturePreloading: case GSHWFixId::ConservativeFramebuffer: + case GSHWFixId::PointListPalette: return false; #ifdef PCSX2_CORE @@ -385,6 +387,10 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& config.UserHacks_WildHack = (value > 0); break; + case GSHWFixId::PointListPalette: + config.PointListPalette = (value > 0); + break; + case GSHWFixId::Mipmap: { if (value >= 0 && value <= static_cast(HWMipmapLevel::Full)) diff --git a/pcsx2/GameDatabase.h b/pcsx2/GameDatabase.h index 7b6331c06e..dea1ed2b83 100644 --- a/pcsx2/GameDatabase.h +++ b/pcsx2/GameDatabase.h @@ -70,6 +70,7 @@ namespace GameDatabaseSchema AlignSprite, MergeSprite, WildArmsHack, + PointListPalette, // integer settings Mipmap, diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 6ce60d6224..1db0afa9d2 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -313,6 +313,7 @@ Pcsx2Config::GSOptions::GSOptions() WrapGSMem = false; Mipmap = true; AA1 = true; + PointListPalette = false; ManualUserHacks = false; UserHacks_AlignSpriteX = false;