From f9d2d42a4c44459d391d5e48060f6b0aa303c5e9 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 15 Aug 2021 04:36:08 +0100 Subject: [PATCH] VideoCommon: report games that set bits in XFMEM_CLIPDISABLE The SDK only exposes the lowest bit. The Nintendo Channel intro is currently broken because we don't implement this (see issue 12562). --- Source/Core/Core/DolphinAnalytics.cpp | 5 ++++- Source/Core/Core/DolphinAnalytics.h | 5 +++++ Source/Core/VideoCommon/XFStructs.cpp | 12 +++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/DolphinAnalytics.cpp b/Source/Core/Core/DolphinAnalytics.cpp index fe7dfa4ab5..3689e158be 100644 --- a/Source/Core/Core/DolphinAnalytics.cpp +++ b/Source/Core/Core/DolphinAnalytics.cpp @@ -133,7 +133,7 @@ void DolphinAnalytics::ReportGameStart() } // Keep in sync with enum class GameQuirk definition. -constexpr std::array GAME_QUIRKS_NAMES{ +constexpr std::array GAME_QUIRKS_NAMES{ "icache-matters", "directly-reads-wiimote-input", "uses-DVDLowStopLaser", @@ -155,6 +155,9 @@ constexpr std::array GAME_QUIRKS_NAMES{ "uses-cp-perf-command", "uses-unimplemented-ax-command", "uses-ax-initial-time-delay", + "sets-xf-clipdisable-bit-0", + "sets-xf-clipdisable-bit-1", + "sets-xf-clipdisable-bit-2", }; static_assert(GAME_QUIRKS_NAMES.size() == static_cast(GameQuirk::COUNT), "Game quirks names and enum definition are out of sync."); diff --git a/Source/Core/Core/DolphinAnalytics.h b/Source/Core/Core/DolphinAnalytics.h index 9286072c2e..2d61adae82 100644 --- a/Source/Core/Core/DolphinAnalytics.h +++ b/Source/Core/Core/DolphinAnalytics.h @@ -76,6 +76,11 @@ enum class GameQuirk USES_UNIMPLEMENTED_AX_COMMAND, USES_AX_INITIAL_TIME_DELAY, + // We don't implement XFMEM_CLIPDISABLE yet. + SETS_XF_CLIPDISABLE_BIT_0, + SETS_XF_CLIPDISABLE_BIT_1, + SETS_XF_CLIPDISABLE_BIT_2, + COUNT, }; diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index ce763ada69..ebf9e8efab 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -48,10 +48,16 @@ static void XFRegWritten(int transferSize, u32 baseAddress, DataReader src) break; case XFMEM_CLIPDISABLE: - // if (data & 1) {} // disable clipping detection - // if (data & 2) {} // disable trivial rejection - // if (data & 4) {} // disable cpoly clipping acceleration + { + ClipDisable setting{.hex = newValue}; + if (setting.disable_clipping_detection) + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::SETS_XF_CLIPDISABLE_BIT_0); + if (setting.disable_trivial_rejection) + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::SETS_XF_CLIPDISABLE_BIT_1); + if (setting.disable_cpoly_clipping_acceleration) + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::SETS_XF_CLIPDISABLE_BIT_2); break; + } case XFMEM_VTXSPECS: //__GXXfVtxSpecs, wrote 0004 break;