Skip to content

Commit

Permalink
Log a warning for inexact uses of MATINDEX or VCD commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokechu22 committed Apr 6, 2021
1 parent 7fe1292 commit 193f6a6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Source/Core/VideoCommon/VertexLoaderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,41 @@ void LoadCPReg(u32 sub_cmd, u32 value, bool is_preprocess)
{
case MATINDEX_A:
if (sub_cmd != MATINDEX_A)
{
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_MAYBE_INVALID_CP_COMMAND);
WARN_LOG_FMT(VIDEO,
"CP MATINDEX_A: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
MATINDEX_A, sub_cmd);
}

if (update_global_state)
VertexShaderManager::SetTexMatrixChangedA(value);
break;

case MATINDEX_B:
if (sub_cmd != MATINDEX_B)
{
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_MAYBE_INVALID_CP_COMMAND);
WARN_LOG_FMT(VIDEO,
"CP MATINDEX_B: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
MATINDEX_B, sub_cmd);
}

if (update_global_state)
VertexShaderManager::SetTexMatrixChangedB(value);
break;

case VCD_LO:
if (sub_cmd != VCD_LO) // Stricter than YAGCD
{
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_MAYBE_INVALID_CP_COMMAND);
WARN_LOG_FMT(VIDEO,
"CP VCD_LO: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
VCD_LO, sub_cmd);
}

state->vtx_desc.low.Hex = value;
state->attr_dirty = BitSet32::AllTrue(CP_NUM_VAT_REG);
Expand All @@ -350,7 +368,13 @@ void LoadCPReg(u32 sub_cmd, u32 value, bool is_preprocess)

case VCD_HI:
if (sub_cmd != VCD_HI) // Stricter than YAGCD
{
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_MAYBE_INVALID_CP_COMMAND);
WARN_LOG_FMT(VIDEO,
"CP VCD_HI: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
VCD_HI, sub_cmd);
}

state->vtx_desc.high.Hex = value;
state->attr_dirty = BitSet32::AllTrue(CP_NUM_VAT_REG);
Expand Down

0 comments on commit 193f6a6

Please sign in to comment.