Report use of various unimplemented DI commands as game quirks

This commit is contained in:
Pokechu22 2019-10-04 12:55:57 -07:00
parent f1dc908883
commit af5f0b20bb
4 changed files with 41 additions and 1 deletions

View File

@ -132,9 +132,16 @@ void DolphinAnalytics::ReportGameStart()
} }
// Keep in sync with enum class GameQuirk definition. // Keep in sync with enum class GameQuirk definition.
constexpr std::array<const char*, 2> GAME_QUIRKS_NAMES{ constexpr std::array<const char*, 9> GAME_QUIRKS_NAMES{
"icache-matters", "icache-matters",
"directly-reads-wiimote-input", "directly-reads-wiimote-input",
"uses-DVDLowStopLaser",
"uses-DVDLowOffset",
"uses-DVDLowReadDiskBca",
"uses-DVDLowRequestDiscStatus",
"uses-DVDLowRequestRetryNumber",
"uses-DVDLowSerMeasControl",
"uses-different-partition-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

@ -29,6 +29,18 @@ enum class GameQuirk
// "read" extension or IR data. This would break our current TAS/NetPlay implementation. // "read" extension or IR data. This would break our current TAS/NetPlay implementation.
DIRECTLY_READS_WIIMOTE_INPUT, DIRECTLY_READS_WIIMOTE_INPUT,
// Several Wii DI commands that are rarely/never used and not implemented by Dolphin
USES_DVD_LOW_STOP_LASER,
USES_DVD_LOW_OFFSET,
USES_DVD_LOW_READ_DISK_BCA, // NSMBW known to use this
USES_DVD_LOW_REQUEST_DISC_STATUS,
USES_DVD_LOW_REQUEST_RETRY_NUMBER,
USES_DVD_LOW_SER_MEAS_CONTROL,
// Dolphin only implements the simple DVDLowOpenPartition, not any of the variants where some
// already-read data is provided
USES_DIFFERENT_PARTITION_COMMAND,
COUNT, COUNT,
}; };

View File

@ -19,6 +19,7 @@
#include "Common/Config/Config.h" #include "Common/Config/Config.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/Analytics.h"
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
@ -874,14 +875,17 @@ void ExecuteCommand(ReplyType reply_type)
// Wii-exclusive // Wii-exclusive
case DICommand::StopLaser: case DICommand::StopLaser:
ERROR_LOG(DVDINTERFACE, "DVDLowStopLaser"); ERROR_LOG(DVDINTERFACE, "DVDLowStopLaser");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_STOP_LASER);
break; break;
// Wii-exclusive // Wii-exclusive
case DICommand::Offset: case DICommand::Offset:
ERROR_LOG(DVDINTERFACE, "DVDLowOffset"); ERROR_LOG(DVDINTERFACE, "DVDLowOffset");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_OFFSET);
break; break;
// Wii-exclusive // Wii-exclusive
case DICommand::ReadBCA: case DICommand::ReadBCA:
WARN_LOG(DVDINTERFACE, "DVDLowReadDiskBca - supplying dummy data to appease NSMBW"); WARN_LOG(DVDINTERFACE, "DVDLowReadDiskBca - supplying dummy data to appease NSMBW");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_READ_DISK_BCA);
// NSMBW checks that the first 0x33 bytes of the BCA are 0, then it expects a 1. // NSMBW checks that the first 0x33 bytes of the BCA are 0, then it expects a 1.
// Most (all?) other games have 0x34 0's at the start of the BCA, but don't actually // Most (all?) other games have 0x34 0's at the start of the BCA, but don't actually
// read it. NSMBW doesn't care about the other 12 bytes (which contain manufacturing data?) // read it. NSMBW doesn't care about the other 12 bytes (which contain manufacturing data?)
@ -894,10 +898,12 @@ void ExecuteCommand(ReplyType reply_type)
// Wii-exclusive // Wii-exclusive
case DICommand::RequestDiscStatus: case DICommand::RequestDiscStatus:
ERROR_LOG(DVDINTERFACE, "DVDLowRequestDiscStatus"); ERROR_LOG(DVDINTERFACE, "DVDLowRequestDiscStatus");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_REQUEST_DISC_STATUS);
break; break;
// Wii-exclusive // Wii-exclusive
case DICommand::RequestRetryNumber: case DICommand::RequestRetryNumber:
ERROR_LOG(DVDINTERFACE, "DVDLowRequestRetryNumber"); ERROR_LOG(DVDINTERFACE, "DVDLowRequestRetryNumber");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_REQUEST_RETRY_NUMBER);
break; break;
// Wii-exclusive // Wii-exclusive
case DICommand::SetMaximumRotation: case DICommand::SetMaximumRotation:
@ -906,6 +912,7 @@ void ExecuteCommand(ReplyType reply_type)
// Wii-exclusive // Wii-exclusive
case DICommand::SerMeasControl: case DICommand::SerMeasControl:
ERROR_LOG(DVDINTERFACE, "DVDLowSerMeasControl"); ERROR_LOG(DVDINTERFACE, "DVDLowSerMeasControl");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_SER_MEAS_CONTROL);
break; break;
// Used by both GC and Wii // Used by both GC and Wii

View File

@ -13,6 +13,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Core/Analytics.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/HW/DVD/DVDInterface.h" #include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/DVD/DVDThread.h" #include "Core/HW/DVD/DVDThread.h"
@ -266,6 +267,7 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
} }
case DIIoctl::DVDLowOpenPartition: case DIIoctl::DVDLowOpenPartition:
ERROR_LOG(IOS_DI, "DVDLowOpenPartition as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowOpenPartition as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowClosePartition: case DIIoctl::DVDLowClosePartition:
INFO_LOG(IOS_DI, "DVDLowClosePartition"); INFO_LOG(IOS_DI, "DVDLowClosePartition");
@ -307,18 +309,23 @@ std::optional<DI::DIResult> DI::StartIOCtl(const IOCtlRequest& request)
// Dolphin as games are unlikely to use them. // Dolphin as games are unlikely to use them.
case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: case DIIoctl::DVDLowGetNoDiscOpenPartitionParams:
ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowNoDiscOpenPartition: case DIIoctl::DVDLowNoDiscOpenPartition:
ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowGetNoDiscBufferSizes: case DIIoctl::DVDLowGetNoDiscBufferSizes:
ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket:
ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView:
ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView as an ioctl - rejecting"); ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView as an ioctl - rejecting");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
return DIResult::SecurityError; return DIResult::SecurityError;
case DIIoctl::DVDLowGetStatusRegister: case DIIoctl::DVDLowGetStatusRegister:
{ {
@ -621,11 +628,13 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request)
{ {
ERROR_LOG(IOS_DI, ERROR_LOG(IOS_DI,
"DVDLowOpenPartition with ticket - not implemented, ignoring ticket parameter"); "DVDLowOpenPartition with ticket - not implemented, ignoring ticket parameter");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
} }
if (request.in_vectors[2].address != 0) if (request.in_vectors[2].address != 0)
{ {
ERROR_LOG(IOS_DI, ERROR_LOG(IOS_DI,
"DVDLowOpenPartition with cert chain - not implemented, ignoring certs parameter"); "DVDLowOpenPartition with cert chain - not implemented, ignoring certs parameter");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
} }
const u64 partition_offset = const u64 partition_offset =
@ -647,21 +656,26 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request)
} }
case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: case DIIoctl::DVDLowGetNoDiscOpenPartitionParams:
ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams - dummied out"); ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams - dummied out");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI);
break; break;
case DIIoctl::DVDLowNoDiscOpenPartition: case DIIoctl::DVDLowNoDiscOpenPartition:
ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition - dummied out"); ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition - dummied out");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI);
break; break;
case DIIoctl::DVDLowGetNoDiscBufferSizes: case DIIoctl::DVDLowGetNoDiscBufferSizes:
ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes - dummied out"); ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes - dummied out");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI);
break; break;
case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket:
ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket - not implemented"); ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket - not implemented");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
break; break;
case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView:
ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView - not implemented"); ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView - not implemented");
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND);
break; break;
default: default:
ERROR_LOG(IOS_DI, "Unknown ioctlv 0x%02x", request.request); ERROR_LOG(IOS_DI, "Unknown ioctlv 0x%02x", request.request);