diff --git a/Source/Core/Core/IOS/DI/DI.cpp b/Source/Core/Core/IOS/DI/DI.cpp index 74cf2fdbabd2..c8e8ccf57684 100644 --- a/Source/Core/Core/IOS/DI/DI.cpp +++ b/Source/Core/Core/IOS/DI/DI.cpp @@ -103,7 +103,7 @@ void DI::ProcessQueuedIOCtl() if (finished) { CoreTiming::ScheduleEvent(2700 * SystemTimers::TIMER_RATIO, s_finish_executing_di_command, - finished.value()); + (u64)finished.value()); return; } } @@ -113,12 +113,12 @@ std::optional DI::WriteIfFits(const IOCtlRequest& request, u32 val if (request.buffer_out_size < 4) { WARN_LOG(IOS_DI, "Output buffer is too small to contain result; returning security error"); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } else { Memory::Write_U32(value, request.buffer_out); - return std::make_optional(SUCCESS); + return std::make_optional(DIResult::SUCCESS); } } @@ -128,109 +128,109 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) { ERROR_LOG(IOS_DI, "IOCtl: Received bad input buffer size 0x%02x, should be 0x20", request.buffer_in_size); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } // Commands that don't interact directly with DVDInterface: - switch (request.request) + switch ((DIIoctl)request.request) { - case DVDLowWaitForCoverClose: + case DIIoctl::DVDLowWaitForCoverClose: // This is a bit awkward to implement, as it doesn't return for a long time, so just act as if // the cover was immediately closed INFO_LOG(IOS_DI, "DVDLowWaitForCoverClose - skipping"); - return std::make_optional(COVER_CLOSED); - case DVDLowGetCoverRegister: + return std::make_optional(DIResult::COVER_CLOSED); + case DIIoctl::DVDLowGetCoverRegister: DEBUG_LOG(IOS_DI, "DVDLowGetCoverRegister 0x%08x", DVDInterface::s_DICVR.Hex); return WriteIfFits(request, DVDInterface::s_DICVR.Hex); - case DVDLowNotifyReset: + case DIIoctl::DVDLowNotifyReset: INFO_LOG(IOS_DI, "DVDLowNotifyReset"); ResetDIRegisters(); // Should also reset current partition and such - return std::make_optional(SUCCESS); - case DVDLowSetSpinupFlag: + return std::make_optional(DIResult::SUCCESS); + case DIIoctl::DVDLowSetSpinupFlag: ERROR_LOG(IOS_DI, "DVDLowSetSpinupFlag - not a valid command, rejecting"); - return std::make_optional(BAD_ARGUMENT); - case DVDLowGetLength: + return std::make_optional(DIResult::BAD_ARGUMENT); + case DIIoctl::DVDLowGetLength: INFO_LOG(IOS_DI, "DVDLowGetLength 0x%08x", m_last_length); return WriteIfFits(request, m_last_length); - case DVDLowGetImmBuf: + case DIIoctl::DVDLowGetImmBuf: INFO_LOG(IOS_DI, "DVDLowGetImmBuf 0x%08x", DVDInterface::s_DIIMMBUF.Hex); return WriteIfFits(request, DVDInterface::s_DIIMMBUF.Hex); - case DVDLowUnmaskCoverInterrupt: + case DIIoctl::DVDLowUnmaskCoverInterrupt: INFO_LOG(IOS_DI, "DVDLowUnmaskCoverInterrupt"); DVDInterface::s_DICVR.CVRINTMASK = false; - return std::make_optional(SUCCESS); - case DVDLowClearCoverInterrupt: + return std::make_optional(DIResult::SUCCESS); + case DIIoctl::DVDLowClearCoverInterrupt: DEBUG_LOG(IOS_DI, "DVDLowClearCoverInterrupt"); DVDInterface::s_DICVR.CVRINT = false; // The actual register is read/zero - return std::make_optional(SUCCESS); - case DVDLowGetCoverStatus: + return std::make_optional(DIResult::SUCCESS); + case DIIoctl::DVDLowGetCoverStatus: // TODO: handle resetting case INFO_LOG(IOS_DI, "DVDLowGetCoverStatus: Disc %sInserted", DVDInterface::IsDiscInside() ? "" : "Not "); return WriteIfFits(request, DVDInterface::IsDiscInside() ? 2 : 1); - case DVDLowEnableCoverInterrupt: + case DIIoctl::DVDLowEnableCoverInterrupt: INFO_LOG(IOS_DI, "DVDLowEnableCoverInterrupt"); DVDInterface::s_DICVR.CVRINTMASK = true; - return std::make_optional(SUCCESS); - case DVDLowReset: + return std::make_optional(DIResult::SUCCESS); + case DIIoctl::DVDLowReset: { const bool spinup = Memory::Read_U32(request.address + 4); INFO_LOG(IOS_DI, "DVDLowReset %s spinup", spinup ? "with" : "without"); DVDInterface::Reset(spinup); ResetDIRegisters(); // Should also reset current partition and such - return std::make_optional(SUCCESS); + return std::make_optional(DIResult::SUCCESS); } - case DVDLowOpenPartition: + case DIIoctl::DVDLowOpenPartition: ERROR_LOG(IOS_DI, "DVDLowOpenPartition as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowClosePartition: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowClosePartition: INFO_LOG(IOS_DI, "DVDLowClosePartition"); ChangePartition(DiscIO::PARTITION_NONE); - return std::make_optional(SUCCESS); - case DVDLowEnableDvdVideo: + return std::make_optional(DIResult::SUCCESS); + case DIIoctl::DVDLowEnableDvdVideo: ERROR_LOG(IOS_DI, "DVDLowEnableDvdVideo - rejecting"); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); // There are a bunch of ioctlvs that are also (unintentionally) usable as ioctls; reject these in // Dolphin as games are unlikely to use them. - case DVDLowGetNoDiscOpenPartitionParams: + case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowNoDiscOpenPartition: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowNoDiscOpenPartition: ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowGetNoDiscBufferSizes: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowGetNoDiscBufferSizes: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowOpenPartitionWithTmdAndTicket: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowOpenPartitionWithTmdAndTicketView: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView as an ioctl - rejecting"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); - return std::make_optional(SECURITY_ERROR); - case DVDLowGetStatusRegister: + return std::make_optional(DIResult::SECURITY_ERROR); + case DIIoctl::DVDLowGetStatusRegister: INFO_LOG(IOS_DI, "DVDLowGetStatusRegister: 0x%08x", DVDInterface::s_DISR.Hex); return WriteIfFits(request, DVDInterface::s_DISR.Hex); - case DVDLowGetControlRegister: + case DIIoctl::DVDLowGetControlRegister: INFO_LOG(IOS_DI, "DVDLowGetControlRegister: 0x%08x", DVDInterface::s_DICR.Hex); return WriteIfFits(request, DVDInterface::s_DICR.Hex); } // DVDInterface's ExecuteCommand handles most of the work. // The IOCtl callback is used to generate a reply afterwards. - switch (request.request) + switch ((DIIoctl)request.request) { - case DVDLowInquiry: + case DIIoctl::DVDLowInquiry: INFO_LOG(IOS_DI, "DVDLowInquiry"); return StartDMATransfer(0x12000000, 0, 0, 0x20, request); - case DVDLowReadDiskID: + case DIIoctl::DVDLowReadDiskID: INFO_LOG(IOS_DI, "DVDLowReadDiskID"); return StartDMATransfer(0xA8000040, 0, 0, 0x20, request); // TODO: Include an additional read that happens on Wii discs, or at least @@ -241,7 +241,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) // // byte 0x60 is disable hashing and byte 0x61 is disable encryption // } // } - case DVDLowRead: + case DIIoctl::DVDLowRead: { // TODO. Needs to include decryption. const u32 length = Memory::Read_U32(request.buffer_in + 4); @@ -251,7 +251,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) if (m_current_partition == DiscIO::PARTITION_NONE) { ERROR_LOG(IOS_DI, "Attempted to perform a decrypting read when no partition is open!"); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } if (request.buffer_out_size < length) { @@ -259,32 +259,32 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) "Output buffer is too small for the result of the read (%d bytes given, needed at " "least %d); returning security error", request.buffer_out_size, length); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } m_last_length = position; // An actual mistake in IOS DVDInterface::PerformDecryptingRead(position, length, request.buffer_out, m_current_partition, true); return {}; } - case DVDLowReadDvdPhysical: + case DIIoctl::DVDLowReadDvdPhysical: { const u8 position = Memory::Read_U8(request.buffer_in + 7); INFO_LOG(IOS_DI, "DVDLowReadDvdPhysical: position 0x%02x", position); return StartDMATransfer(0xAD000000 | (position << 8), 0, 0, 0x800, request); } - case DVDLowReadDvdCopyright: + case DIIoctl::DVDLowReadDvdCopyright: { const u8 position = Memory::Read_U8(request.buffer_in + 7); INFO_LOG(IOS_DI, "DVDLowReadDvdCopyright: position 0x%02x", position); return StartImmediateTransfer(0xAD010000 | (position << 8), 0, 0, request); } - case DVDLowReadDvdDiscKey: + case DIIoctl::DVDLowReadDvdDiscKey: { const u8 position = Memory::Read_U8(request.buffer_in + 7); INFO_LOG(IOS_DI, "DVDLowReadDvdDiscKey: position 0x%02x", position); return StartDMATransfer(0xAD020000 | (position << 8), 0, 0, 0x800, request); } - case DVDLowUnencryptedRead: + case DIIoctl::DVDLowUnencryptedRead: { const u32 length = Memory::Read_U32(request.buffer_in + 4); const u32 position = Memory::Read_U32(request.buffer_in + 8); @@ -308,23 +308,23 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) } } WARN_LOG(IOS_DI, "DVDLowUnencryptedRead: trying to read from an illegal region!"); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } - case DVDLowReportKey: + case DIIoctl::DVDLowReportKey: { const u8 param1 = Memory::Read_U8(request.buffer_in + 7); const u32 param2 = Memory::Read_U32(request.buffer_in + 8); INFO_LOG(IOS_DI, "DVDLowReportKey: param1 0x%02x, param2 0x%06x", param1, param2); return StartDMATransfer(0xA4000000 | (param1 << 16), param2 & 0xFFFFFF, 0, 0x20, request); } - case DVDLowSeek: + case DIIoctl::DVDLowSeek: { const u32 position = Memory::Read_U32(request.buffer_in + 4); // 32-bit offset INFO_LOG(IOS_DI, "DVDLowSeek: position 0x%08x, translated to 0x%08x", position, position); // TODO: do partition translation! return StartImmediateTransfer(0xAB000000, position, 0, request, false); } - case DVDLowReadDvd: + case DIIoctl::DVDLowReadDvd: { const u8 flag1 = Memory::Read_U8(request.buffer_in + 7); const u8 flag2 = Memory::Read_U8(request.buffer_in + 11); @@ -335,7 +335,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) return StartDMATransfer(0xD0000000 | ((flag1 & 1) << 7) | ((flag2 & 1) << 6), position & 0xFFFFFF, length & 0xFFFFFF, 0x800 * length, request); } - case DVDLowReadDvdConfig: + case DIIoctl::DVDLowReadDvdConfig: { const u8 flag1 = Memory::Read_U8(request.buffer_in + 7); const u8 param2 = Memory::Read_U8(request.buffer_in + 11); @@ -344,32 +344,32 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) return StartImmediateTransfer(0xD1000000 | ((flag1 & 1) << 16) | param2, position & 0xFFFFFF, 0, request); } - case DVDLowStopLaser: + case DIIoctl::DVDLowStopLaser: INFO_LOG(IOS_DI, "DVDLowStopLaser"); return StartImmediateTransfer(0xD2000000, 0, 0, request); - case DVDLowOffset: + case DIIoctl::DVDLowOffset: { const u8 flag = Memory::Read_U8(request.buffer_in + 7); const u32 offset = Memory::Read_U32(request.buffer_in + 8); INFO_LOG(IOS_DI, "DVDLowOffset(%d): offset 0x%08x", flag, offset); return StartImmediateTransfer(0xD9000000 | ((flag & 1) << 16), offset, 0, request); } - case DVDLowReadDiskBca: + case DIIoctl::DVDLowReadDiskBca: INFO_LOG(IOS_DI, "DVDLowReadDiskBca"); return StartDMATransfer(0xDA000000, 0, 0, 0x40, request); - case DVDLowRequestDiscStatus: + case DIIoctl::DVDLowRequestDiscStatus: INFO_LOG(IOS_DI, "DVDLowRequestDiscStatus"); return StartImmediateTransfer(0xDB000000, 0, 0, request); - case DVDLowRequestRetryNumber: + case DIIoctl::DVDLowRequestRetryNumber: INFO_LOG(IOS_DI, "DVDLowRequestRetryNumber"); return StartImmediateTransfer(0xDC000000, 0, 0, request); - case DVDLowSetMaximumRotation: + case DIIoctl::DVDLowSetMaximumRotation: { const u8 speed = Memory::Read_U8(request.buffer_in + 7); INFO_LOG(IOS_DI, "DVDLowSetMaximumRotation: speed %d", speed); return StartImmediateTransfer(0xDD000000 | ((speed & 3) << 16), 0, 0, request, false); } - case DVDLowSerMeasControl: + case DIIoctl::DVDLowSerMeasControl: { const u8 flag1 = Memory::Read_U8(request.buffer_in + 7); const u8 flag2 = Memory::Read_U8(request.buffer_in + 11); @@ -377,10 +377,10 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) return StartDMATransfer(0xDF000000 | ((flag1 & 1) << 17) | ((flag2 & 1) << 16), 0, 0, 0x20, request); } - case DVDLowRequestError: + case DIIoctl::DVDLowRequestError: INFO_LOG(IOS_DI, "DVDLowRequestError"); return StartImmediateTransfer(0xE0000000, 0, 0, request); - case DVDLowPlayAudioStream: + case DIIoctl::DVDLowPlayAudioStream: { const u8 mode = Memory::Read_U8(request.buffer_in + 7); const u32 length = Memory::Read_U32(request.buffer_in + 8); @@ -390,7 +390,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) return StartImmediateTransfer(0xE1000000 | ((mode & 3) << 16), position, length, request, false); } - case DVDLowRequestAudioStatus: + case DIIoctl::DVDLowRequestAudioStatus: { const u8 mode = Memory::Read_U8(request.buffer_in + 7); INFO_LOG(IOS_DI, "DVDLowRequestAudioStatus(%d)", mode); @@ -398,7 +398,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) // (to actually use it, DVDLowGetImmBuf would need to be used afterwards) return StartImmediateTransfer(0xE2000000 | ((mode & 3) << 16), 0, 0, request, false); } - case DVDLowStopMotor: + case DIIoctl::DVDLowStopMotor: { const u8 eject = Memory::Read_U8(request.buffer_in + 7); const u8 kill = Memory::Read_U8(request.buffer_in + 11); @@ -406,7 +406,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) return StartImmediateTransfer(0xE3000000 | ((eject & 1) << 17) | ((kill & 1) << 20), 0, 0, request); } - case DVDLowAudioBufferConfig: + case DIIoctl::DVDLowAudioBufferConfig: { const u8 enable = Memory::Read_U8(request.buffer_in + 7); const u8 buffer_size = Memory::Read_U8(request.buffer_in + 11); @@ -417,7 +417,7 @@ std::optional DI::StartIOCtl(const IOCtlRequest& request) } default: ERROR_LOG(IOS_DI, "Unknown ioctl 0x%02x", request.request); - return std::make_optional(SECURITY_ERROR); + return std::make_optional(DIResult::SECURITY_ERROR); } } @@ -433,7 +433,7 @@ std::optional DI::StartDMATransfer(u32 command_0, u32 command_1, u "Output buffer is too small for the result of the command (%d bytes given, needed at " "least %d); returning read timed out (immediately, instead of waiting)", request.buffer_out_size, command_length); - return std::make_optional(READ_TIMED_OUT); + return std::make_optional(DIResult::READ_TIMED_OUT); } if ((command_length & 0x1f) != 0 || (request.buffer_out & 0x1f) != 0) @@ -444,7 +444,7 @@ std::optional DI::StartDMATransfer(u32 command_0, u32 command_1, u "Output buffer or length is incorrectly aligned (buffer 0x%08x, buffer length %x, " "command length %x)", request.buffer_out, request.buffer_out_size, command_length); - return std::make_optional(BAD_ARGUMENT); + return std::make_optional(DIResult::BAD_ARGUMENT); } m_last_length = command_length; @@ -477,14 +477,14 @@ void DI::InterruptFromDVDInterface(DVDInterface::DIInterruptType interrupt_type) switch (interrupt_type) { case DVDInterface::INT_TCINT: - result = SUCCESS; + result = DIResult::SUCCESS; break; case DVDInterface::INT_DEINT: - result = DRIVE_ERROR; + result = DIResult::DRIVE_ERROR; break; default: PanicAlert("IOS::HLE::Device::DI: Unexpected DVDInterface interrupt %d!", interrupt_type); - result = DRIVE_ERROR; + result = DIResult::DRIVE_ERROR; break; } @@ -522,7 +522,7 @@ void DI::FinishDICommand(DIResult result) // This command has been executed, so it's removed from the queue const u32 command_address = m_commands_to_execute.front(); m_commands_to_execute.pop_front(); - m_ios.EnqueueIPCReply(IOCtlRequest{command_address}, result); + m_ios.EnqueueIPCReply(IOCtlRequest{command_address}, (s32)result); // DVDInterface is now ready to execute another command, // so we start executing a command from the queue if there is one @@ -544,7 +544,7 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) { ERROR_LOG(IOS_DI, "IOCtlV: Received bad input buffer size 0x%02x, should be 0x20", request.in_vectors[0].size); - return GetDefaultReply(BAD_ARGUMENT); + return GetDefaultReply((s32)DIResult::BAD_ARGUMENT); } const u8 command = Memory::Read_U8(request.in_vectors[0].address); if (request.request != command) @@ -555,10 +555,10 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) request.request, command); } - s32 return_value = BAD_ARGUMENT; - switch (request.request) + DIResult return_value = DIResult::BAD_ARGUMENT; + switch ((DIIoctl)request.request) { - case DVDLowOpenPartition: + case DIIoctl::DVDLowOpenPartition: { if (request.in_vectors.size() != 3 || request.io_vectors.size() != 2) { @@ -593,29 +593,29 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) ReturnCode es_result = m_ios.GetES()->DIVerify(tmd, DVDThread::GetTicket(m_current_partition)); Memory::Write_U32(es_result, request.io_vectors[1].address); - return_value = SUCCESS; + return_value = DIResult::SUCCESS; break; } - case DVDLowGetNoDiscOpenPartitionParams: + case DIIoctl::DVDLowGetNoDiscOpenPartitionParams: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscOpenPartitionParams - dummied out"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), LogTypes::IOS_DI); break; - case DVDLowNoDiscOpenPartition: + case DIIoctl::DVDLowNoDiscOpenPartition: ERROR_LOG(IOS_DI, "DVDLowNoDiscOpenPartition - dummied out"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), LogTypes::IOS_DI); break; - case DVDLowGetNoDiscBufferSizes: + case DIIoctl::DVDLowGetNoDiscBufferSizes: ERROR_LOG(IOS_DI, "DVDLowGetNoDiscBufferSizes - dummied out"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); request.DumpUnknown(GetDeviceName(), LogTypes::IOS_DI); break; - case DVDLowOpenPartitionWithTmdAndTicket: + case DIIoctl::DVDLowOpenPartitionWithTmdAndTicket: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicket - not implemented"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); break; - case DVDLowOpenPartitionWithTmdAndTicketView: + case DIIoctl::DVDLowOpenPartitionWithTmdAndTicketView: ERROR_LOG(IOS_DI, "DVDLowOpenPartitionWithTmdAndTicketView - not implemented"); DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::USES_DIFFERENT_PARTITION_COMMAND); break; @@ -623,7 +623,7 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request) ERROR_LOG(IOS_DI, "Unknown ioctlv 0x%02x", request.request); request.DumpUnknown(GetDeviceName(), LogTypes::IOS_DI); } - return GetDefaultReply(return_value); + return GetDefaultReply((s32)return_value); } void DI::ChangePartition(const DiscIO::Partition& partition) diff --git a/Source/Core/Core/IOS/DI/DI.h b/Source/Core/Core/IOS/DI/DI.h index 33e6da391ef2..81cb96907f14 100644 --- a/Source/Core/Core/IOS/DI/DI.h +++ b/Source/Core/Core/IOS/DI/DI.h @@ -40,7 +40,7 @@ class DI : public Device IPCCommandResult IOCtl(const IOCtlRequest& request) override; IPCCommandResult IOCtlV(const IOCtlVRequest& request) override; - enum DIIoctl : u8 + enum class DIIoctl : u32 { DVDLowInquiry = 0x12, DVDLowReadDiskID = 0x70, @@ -90,15 +90,7 @@ class DI : public Device DVDLowAudioBufferConfig = 0xe4 }; - struct DICommand - { - DIIoctl command; - u8 padding[3]; - std::array args; - }; - static_assert(sizeof(DICommand) == 0x20); - - enum DIResult : s32 + enum class DIResult : s32 { SUCCESS = 1, DRIVE_ERROR = 2,