From af5f0b20bbc5441c2a5787480ecd3749ce5e61b5 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Fri, 4 Oct 2019 12:55:57 -0700 Subject: [PATCH] Report use of various unimplemented DI commands as game quirks --- Source/Core/Core/Analytics.cpp | 9 ++++++++- Source/Core/Core/Analytics.h | 12 ++++++++++++ Source/Core/Core/HW/DVD/DVDInterface.cpp | 7 +++++++ Source/Core/Core/IOS/DI/DI.cpp | 14 ++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp index c5349fe28e..3b49173ed2 100644 --- a/Source/Core/Core/Analytics.cpp +++ b/Source/Core/Core/Analytics.cpp @@ -132,9 +132,16 @@ void DolphinAnalytics::ReportGameStart() } // Keep in sync with enum class GameQuirk definition. -constexpr std::array GAME_QUIRKS_NAMES{ +constexpr std::array 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", }; static_assert(GAME_QUIRKS_NAMES.size() == static_cast(GameQuirk::COUNT), "Game quirks names and enum definition are out of sync."); diff --git a/Source/Core/Core/Analytics.h b/Source/Core/Core/Analytics.h index 98f26900b0..2d35029a46 100644 --- a/Source/Core/Core/Analytics.h +++ b/Source/Core/Core/Analytics.h @@ -29,6 +29,18 @@ enum class GameQuirk // "read" extension or IR data. This would break our current TAS/NetPlay implementation. 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, }; diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp index fbb58b48d5..e5cfe77387 100644 --- a/Source/Core/Core/HW/DVD/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp @@ -19,6 +19,7 @@ #include "Common/Config/Config.h" #include "Common/Logging/Log.h" +#include "Core/Analytics.h" #include "Core/Config/MainSettings.h" #include "Core/ConfigManager.h" #include "Core/CoreTiming.h" @@ -874,14 +875,17 @@ void ExecuteCommand(ReplyType reply_type) // Wii-exclusive case DICommand::StopLaser: ERROR_LOG(DVDINTERFACE, "DVDLowStopLaser"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_STOP_LASER); break; // Wii-exclusive case DICommand::Offset: ERROR_LOG(DVDINTERFACE, "DVDLowOffset"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_OFFSET); break; // Wii-exclusive case DICommand::ReadBCA: 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. // 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?) @@ -894,10 +898,12 @@ void ExecuteCommand(ReplyType reply_type) // Wii-exclusive case DICommand::RequestDiscStatus: ERROR_LOG(DVDINTERFACE, "DVDLowRequestDiscStatus"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_REQUEST_DISC_STATUS); break; // Wii-exclusive case DICommand::RequestRetryNumber: ERROR_LOG(DVDINTERFACE, "DVDLowRequestRetryNumber"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_REQUEST_RETRY_NUMBER); break; // Wii-exclusive case DICommand::SetMaximumRotation: @@ -906,6 +912,7 @@ void ExecuteCommand(ReplyType reply_type) // Wii-exclusive case DICommand::SerMeasControl: ERROR_LOG(DVDINTERFACE, "DVDLowSerMeasControl"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DVD_LOW_SER_MEAS_CONTROL); break; // Used by both GC and Wii diff --git a/Source/Core/Core/IOS/DI/DI.cpp b/Source/Core/Core/IOS/DI/DI.cpp index 7dc2f714e4..5a53e76446 100644 --- a/Source/Core/Core/IOS/DI/DI.cpp +++ b/Source/Core/Core/IOS/DI/DI.cpp @@ -13,6 +13,7 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" +#include "Core/Analytics.h" #include "Core/CoreTiming.h" #include "Core/HW/DVD/DVDInterface.h" #include "Core/HW/DVD/DVDThread.h" @@ -266,6 +267,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) } case DIIoctl::DVDLowOpenPartition: ERROR_LOG(IOS_DI, "DVDLowOpenPartition as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowClosePartition: INFO_LOG(IOS_DI, "DVDLowClosePartition"); @@ -307,18 +309,23 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) // Dolphin as games are unlikely to use them. case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowNoDiscOpenPartition: ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowGetNoDiscBufferSizes: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView as an ioctl - rejecting"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); return DIResult::SecurityError; case DIIoctl::DVDLowGetStatusRegister: { @@ -621,11 +628,13 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) { ERROR_LOG(IOS_DI, "DVDLowOpenPartition with ticket - not implemented, ignoring ticket parameter"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); } if (request.in_vectors[2].address != 0) { ERROR_LOG(IOS_DI, "DVDLowOpenPartition with cert chain - not implemented, ignoring certs parameter"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); } const u64 partition_offset = @@ -647,21 +656,26 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) } case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams - dummied out"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); break; case DIIoctl::DVDLowNoDiscOpenPartition: ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition - dummied out"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); break; case DIIoctl::DVDLowGetNoDiscBufferSizes: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes - dummied out"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), Common::Log::IOS_DI); break; case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket - not implemented"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); break; case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView - not implemented"); + DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); break; default: ERROR_LOG(IOS_DI, "Unknown ioctlv 0x%02x", request.request);