Skip to content
Permalink
Browse files
Merge pull request #10029 from Tilka/clipdisable
VideoCommon: report games that set bits in XFMEM_CLIPDISABLE
  • Loading branch information
Tilka committed Aug 15, 2021
2 parents 99490cb + f9d2d42 commit 4c179fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
@@ -133,7 +133,7 @@ void DolphinAnalytics::ReportGameStart()
}

// Keep in sync with enum class GameQuirk definition.
constexpr std::array<const char*, 21> GAME_QUIRKS_NAMES{
constexpr std::array<const char*, 24> GAME_QUIRKS_NAMES{
"icache-matters",
"directly-reads-wiimote-input",
"uses-DVDLowStopLaser",
@@ -155,6 +155,9 @@ constexpr std::array<const char*, 21> 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<u32>(GameQuirk::COUNT),
"Game quirks names and enum definition are out of sync.");
@@ -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,
};

@@ -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;

0 comments on commit 4c179fe

Please sign in to comment.