From fe9794ba534c17fbd5d4d427ee14b5cc106eb4ea Mon Sep 17 00:00:00 2001 From: SternXD Date: Wed, 2 Jul 2025 15:45:31 -0400 Subject: [PATCH] GS: Add hotkey for cycling TV shaders --- pcsx2/GS/GS.cpp | 25 +++++++++++++++++++++++++ pcsx2/SIO/Pad/Pad.cpp | 1 + 2 files changed, 26 insertions(+) diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index 43f88e826d..b413f53be9 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -1213,6 +1213,31 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphic MTGS::RunOnGSThread([new_mode]() { GSConfig.InterlaceMode = new_mode; }); }}, + {"CycleTVShader", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Cycle TV Shader"), + [](s32 pressed) { + if (pressed) + return; + + static constexpr std::array option_names = {{ + TRANSLATE_NOOP("Hotkeys", "None (Default)"), + TRANSLATE_NOOP("Hotkeys", "Scanline Filter"), + TRANSLATE_NOOP("Hotkeys", "Diagonal Filter"), + TRANSLATE_NOOP("Hotkeys", "Triangular Filter"), + TRANSLATE_NOOP("Hotkeys", "Wave Filter"), + TRANSLATE_NOOP("Hotkeys", "Lottes CRT"), + TRANSLATE_NOOP("Hotkeys", "4xRGSS"), + TRANSLATE_NOOP("Hotkeys", "NxAGSS"), + }}; + + const u32 new_shader = (EmuConfig.GS.TVShader + 1) % 8; + Host::AddKeyedOSDMessage("CycleTVShader", + fmt::format( + TRANSLATE_FS("Hotkeys", "TV shader set to '{}'."), option_names[new_shader]), + Host::OSD_QUICK_DURATION); + EmuConfig.GS.TVShader = new_shader; + + MTGS::RunOnGSThread([new_shader]() { GSConfig.TVShader = new_shader; }); + }}, {"ToggleTextureDumping", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Toggle Texture Dumping"), [](s32 pressed) { if (!pressed) diff --git a/pcsx2/SIO/Pad/Pad.cpp b/pcsx2/SIO/Pad/Pad.cpp index 30818bda81..0a50fac234 100644 --- a/pcsx2/SIO/Pad/Pad.cpp +++ b/pcsx2/SIO/Pad/Pad.cpp @@ -223,6 +223,7 @@ void Pad::SetDefaultHotkeyConfig(SettingsInterface& si) // PCSX2 Controller Settings - Hotkeys - Graphics si.SetStringValue("Hotkeys", "CycleAspectRatio", "Keyboard/F6"); si.SetStringValue("Hotkeys", "CycleInterlaceMode", "Keyboard/F5"); + // si.SetStringValue("Hotkeys", "CycleTVShader", "Keyboard/"); TBD si.SetStringValue("Hotkeys", "ToggleMipmapMode", "Keyboard/Insert"); // si.SetStringValue("Hotkeys", "DecreaseUpscaleMultiplier", "Keyboard"); TBD // si.SetStringValue("Hotkeys", "IncreaseUpscaleMultiplier", "Keyboard"); TBD