Merge pull request #9576 from Pokechu22/invalid-gfx-reg-quirk
Add game quirks for unknown BP/CP/XF commands
This commit is contained in:
9 files changed
+137
-25
No files matched your search
@@ -133,20 +133,27 @@ void DolphinAnalytics::ReportGameStart()
|
||||
}
|
||||
|
||||
// Keep in sync with enum class GameQuirk definition.
|
||||
constexpr std::array<const char*, 14> GAME_QUIRKS_NAMES{"icache-matters",
|
||||
"directly-reads-wiimote-input",
|
||||
"uses-DVDLowStopLaser",
|
||||
"uses-DVDLowOffset",
|
||||
"uses-DVDLowReadDiskBca",
|
||||
"uses-DVDLowRequestDiscStatus",
|
||||
"uses-DVDLowRequestRetryNumber",
|
||||
"uses-DVDLowSerMeasControl",
|
||||
"uses-different-partition-command",
|
||||
"uses-di-interrupt-command",
|
||||
"mismatched-gpu-texgens-between-xf-and-bp",
|
||||
"mismatched-gpu-colors-between-xf-and-bp",
|
||||
"uses-uncommon-wd-mode",
|
||||
"uses-wd-unimplemented-ioctl"};
|
||||
constexpr std::array<const char*, 19> GAME_QUIRKS_NAMES{
|
||||
"icache-matters",
|
||||
"directly-reads-wiimote-input",
|
||||
"uses-DVDLowStopLaser",
|
||||
"uses-DVDLowOffset",
|
||||
"uses-DVDLowReadDiskBca",
|
||||
"uses-DVDLowRequestDiscStatus",
|
||||
"uses-DVDLowRequestRetryNumber",
|
||||
"uses-DVDLowSerMeasControl",
|
||||
"uses-different-partition-command",
|
||||
"uses-di-interrupt-command",
|
||||
"mismatched-gpu-texgens-between-xf-and-bp",
|
||||
"mismatched-gpu-colors-between-xf-and-bp",
|
||||
"uses-uncommon-wd-mode",
|
||||
"uses-wd-unimplemented-ioctl",
|
||||
"uses-unknown-bp-command",
|
||||
"uses-unknown-cp-command",
|
||||
"uses-unknown-xf-command",
|
||||
"uses-maybe-invalid-cp-command",
|
||||
"uses-cp-perf-command",
|
||||
};
|
||||
static_assert(GAME_QUIRKS_NAMES.size() == static_cast<u32>(GameQuirk::COUNT),
|
||||
"Game quirks names and enum definition are out of sync.");
|
||||
|
||||
|
||||
@@ -61,6 +61,18 @@ enum class GameQuirk
|
||||
|
||||
USES_WD_UNIMPLEMENTED_IOCTL,
|
||||
|
||||
// Some games use invalid/unknown graphics commands (see e.g. bug 10931).
|
||||
// These are different from unknown opcodes: it is known that a BP/CP/XF command is being used,
|
||||
// but the command itself is not understood.
|
||||
USES_UNKNOWN_BP_COMMAND,
|
||||
USES_UNKNOWN_CP_COMMAND,
|
||||
USES_UNKNOWN_XF_COMMAND,
|
||||
// YAGCD and Dolphin's implementation disagree about what is valid in some cases
|
||||
USES_MAYBE_INVALID_CP_COMMAND,
|
||||
// These commands are used by a few games (e.g. bug 12461), and seem to relate to perf queries.
|
||||
// Track them separately.
|
||||
USES_CP_PERF_COMMAND,
|
||||
|
||||
COUNT,
|
||||
};
|
||||
|
||||
|
||||
@@ -491,7 +491,10 @@ void FifoPlayer::LoadRegisters()
|
||||
|
||||
regs = m_File->GetXFRegs();
|
||||
for (int i = 0; i < FifoDataFile::XF_REGS_SIZE; ++i)
|
||||
LoadXFReg(i, regs[i]);
|
||||
{
|
||||
if (ShouldLoadXF(i))
|
||||
LoadXFReg(i, regs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void FifoPlayer::LoadTextureMemory()
|
||||
@@ -571,6 +574,16 @@ bool FifoPlayer::ShouldLoadBP(u8 address)
|
||||
}
|
||||
}
|
||||
|
||||
bool FifoPlayer::ShouldLoadXF(u8 reg)
|
||||
{
|
||||
// Ignore unknown addresses
|
||||
u16 address = reg + 0x1000;
|
||||
return !(address == XFMEM_UNKNOWN_1007 ||
|
||||
(address >= XFMEM_UNKNOWN_GROUP_1_START && address <= XFMEM_UNKNOWN_GROUP_1_END) ||
|
||||
(address >= XFMEM_UNKNOWN_GROUP_2_START && address <= XFMEM_UNKNOWN_GROUP_2_END) ||
|
||||
(address >= XFMEM_UNKNOWN_GROUP_3_START && address <= XFMEM_UNKNOWN_GROUP_3_END));
|
||||
}
|
||||
|
||||
bool FifoPlayer::IsIdleSet()
|
||||
{
|
||||
CommandProcessor::UCPStatusReg status =
|
||||
|
||||
@@ -134,6 +134,7 @@ private:
|
||||
void LoadXFMem16(u16 address, const u32* data);
|
||||
|
||||
bool ShouldLoadBP(u8 address);
|
||||
bool ShouldLoadXF(u8 address);
|
||||
|
||||
static bool IsIdleSet();
|
||||
static bool IsHighWatermarkSet();
|
||||
|
||||
Reference in new issue
Block a user