Merge pull request #8599 from Pokechu22/di-interrupt-mask-ioctls

Fix DI interrupt mask ioctl names
This commit is contained in:
Léo Lam 2020-02-02 16:49:27 +01:00 committed by GitHub
commit 4c9b1f3e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 8 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

@ -240,22 +240,29 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
INFO_LOG(IOS_DI, "DVDLowGetImmBuf 0x%08x", diimmbuf); INFO_LOG(IOS_DI, "DVDLowGetImmBuf 0x%08x", diimmbuf);
return WriteIfFits(request, diimmbuf); return WriteIfFits(request, diimmbuf);
} }
case DIIoctl::DVDLowUnmaskCoverInterrupt: case DIIoctl::DVDLowMaskCoverInterrupt:
INFO_LOG(IOS_DI, "DVDLowUnmaskCoverInterrupt"); 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");
DVDInterface::ClearInterrupt(DVDInterface::DIInterruptType::CVRINT); DVDInterface::ClearInterrupt(DVDInterface::DIInterruptType::CVRINT);
return DIResult::Success; return DIResult::Success;
case DIIoctl::DVDLowUnmaskStatusInterrupts:
INFO_LOG(IOS_DI, "DVDLowUnmaskStatusInterrupts");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DI_INTERRUPT_MASK_COMMAND);
// Dummied out
return DIResult::Success;
case DIIoctl::DVDLowGetCoverStatus: case DIIoctl::DVDLowGetCoverStatus:
// TODO: handle resetting case // TODO: handle resetting case
INFO_LOG(IOS_DI, "DVDLowGetCoverStatus: Disc %sInserted", INFO_LOG(IOS_DI, "DVDLowGetCoverStatus: Disc %sInserted",
DVDInterface::IsDiscInside() ? "" : "Not "); DVDInterface::IsDiscInside() ? "" : "Not ");
return WriteIfFits(request, DVDInterface::IsDiscInside() ? 2 : 1); return WriteIfFits(request, DVDInterface::IsDiscInside() ? 2 : 1);
case DIIoctl::DVDLowEnableCoverInterrupt: case DIIoctl::DVDLowUnmaskCoverInterrupt:
INFO_LOG(IOS_DI, "DVDLowEnableCoverInterrupt"); 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:
{ {

View File

@ -60,11 +60,11 @@ public:
DVDLowReadDvdDiscKey = 0x82, DVDLowReadDvdDiscKey = 0x82,
DVDLowGetLength = 0x83, DVDLowGetLength = 0x83,
DVDLowGetImmBuf = 0x84, // Unconfirmed name DVDLowGetImmBuf = 0x84, // Unconfirmed name
DVDLowUnmaskCoverInterrupt = 0x85, DVDLowMaskCoverInterrupt = 0x85,
DVDLowClearCoverInterrupt = 0x86, DVDLowClearCoverInterrupt = 0x86,
// 0x87 is a dummied out command DVDLowUnmaskStatusInterrupts = 0x87, // Dummied out, ID is educated guess
DVDLowGetCoverStatus = 0x88, DVDLowGetCoverStatus = 0x88,
DVDLowEnableCoverInterrupt = 0x89, // Unconfirmed name DVDLowUnmaskCoverInterrupt = 0x89,
DVDLowReset = 0x8a, DVDLowReset = 0x8a,
DVDLowOpenPartition = 0x8b, // ioctlv only DVDLowOpenPartition = 0x8b, // ioctlv only
DVDLowClosePartition = 0x8c, DVDLowClosePartition = 0x8c,