Report use of DI interrupt mask commands as a game quirk

This commit is contained in:
Pokechu22 2020-02-01 13:41:20 -08:00
parent bb5e5fd8f2
commit f527f382e8
3 changed files with 11 additions and 1 deletions

View File

@ -132,7 +132,7 @@ void DolphinAnalytics::ReportGameStart()
} }
// Keep in sync with enum class GameQuirk definition. // Keep in sync with enum class GameQuirk definition.
constexpr std::array<const char*, 9> GAME_QUIRKS_NAMES{ constexpr std::array<const char*, 10> GAME_QUIRKS_NAMES{
"icache-matters", "icache-matters",
"directly-reads-wiimote-input", "directly-reads-wiimote-input",
"uses-DVDLowStopLaser", "uses-DVDLowStopLaser",
@ -142,6 +142,7 @@ constexpr std::array<const char*, 9> GAME_QUIRKS_NAMES{
"uses-DVDLowRequestRetryNumber", "uses-DVDLowRequestRetryNumber",
"uses-DVDLowSerMeasControl", "uses-DVDLowSerMeasControl",
"uses-different-partition-command", "uses-different-partition-command",
"uses-di-interrupt-command",
}; };
static_assert(GAME_QUIRKS_NAMES.size() == static_cast<u32>(GameQuirk::COUNT), static_assert(GAME_QUIRKS_NAMES.size() == static_cast<u32>(GameQuirk::COUNT),
"Game quirks names and enum definition are out of sync."); "Game quirks names and enum definition are out of sync.");

View File

@ -41,6 +41,12 @@ enum class GameQuirk
// already-read data is provided // already-read data is provided
USES_DIFFERENT_PARTITION_COMMAND, USES_DIFFERENT_PARTITION_COMMAND,
// IOS has implementations for ioctls 0x85 and 0x89 and a stub for 0x87, but
// DVDLowMaskCoverInterrupt/DVDLowUnmaskCoverInterrupt/DVDLowUnmaskStatusInterrupts
// are all stubbed on the PPC side so they presumably will never be used.
// (DVDLowClearCoverInterrupt is used, though)
USES_DI_INTERRUPT_MASK_COMMAND,
COUNT, COUNT,
}; };

View File

@ -243,6 +243,7 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
case DIIoctl::DVDLowMaskCoverInterrupt: case DIIoctl::DVDLowMaskCoverInterrupt:
INFO_LOG(IOS_DI, "DVDLowMaskCoverInterrupt"); INFO_LOG(IOS_DI, "DVDLowMaskCoverInterrupt");
DVDInterface::SetInterruptEnabled(DVDInterface::DIInterruptType::CVRINT, false); DVDInterface::SetInterruptEnabled(DVDInterface::DIInterruptType::CVRINT, false);
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DI_INTERRUPT_MASK_COMMAND);
return DIResult::Success; return DIResult::Success;
case DIIoctl::DVDLowClearCoverInterrupt: case DIIoctl::DVDLowClearCoverInterrupt:
DEBUG_LOG(IOS_DI, "DVDLowClearCoverInterrupt"); DEBUG_LOG(IOS_DI, "DVDLowClearCoverInterrupt");
@ -250,6 +251,7 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
return DIResult::Success; return DIResult::Success;
case DIIoctl::DVDLowUnmaskStatusInterrupts: case DIIoctl::DVDLowUnmaskStatusInterrupts:
INFO_LOG(IOS_DI, "DVDLowUnmaskStatusInterrupts"); INFO_LOG(IOS_DI, "DVDLowUnmaskStatusInterrupts");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DI_INTERRUPT_MASK_COMMAND);
// Dummied out // Dummied out
return DIResult::Success; return DIResult::Success;
case DIIoctl::DVDLowGetCoverStatus: case DIIoctl::DVDLowGetCoverStatus:
@ -260,6 +262,7 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
case DIIoctl::DVDLowUnmaskCoverInterrupt: case DIIoctl::DVDLowUnmaskCoverInterrupt:
INFO_LOG(IOS_DI, "DVDLowUnmaskCoverInterrupt"); INFO_LOG(IOS_DI, "DVDLowUnmaskCoverInterrupt");
DVDInterface::SetInterruptEnabled(DVDInterface::DIInterruptType::CVRINT, true); DVDInterface::SetInterruptEnabled(DVDInterface::DIInterruptType::CVRINT, true);
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DI_INTERRUPT_MASK_COMMAND);
return DIResult::Success; return DIResult::Success;
case DIIoctl::DVDLowReset: case DIIoctl::DVDLowReset:
{ {