VolumeWiiCrypted: Replace ChangePartition with a partition parameter

By removing mutable state in VolumeWiiCrypted, this change makes
partition-related code simpler. It also gets rid of other ugly things,
like ISOProperties's "over 9000" loop that creates a list of
partitions by trying possible combinations, and DiscScrubber's
volume swapping that recreates the entire volume when it needs to
change partition.
This commit is contained in:
JosJuice committed 2017-05-16 22:58:15 +02:00
1 parent 74d84c5af2
commit 19b8f1c10a
35 files changed
+622 -639

No files matched your search

+6 -4
View File
@@ -101,16 +101,18 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request)
_dbg_assert_msg_(IOS_DI, request.in_vectors[2].address == 0,
"DVDLowOpenPartition with cert chain");
u64 const partition_offset = ((u64)Memory::Read_U32(request.in_vectors[0].address + 4) << 2);
DVDInterface::ChangePartition(partition_offset);
const u64 partition_offset =
static_cast<u64>(Memory::Read_U32(request.in_vectors[0].address + 4)) << 2;
const DiscIO::Partition partition(partition_offset);
DVDInterface::ChangePartition(partition);
INFO_LOG(IOS_DI, "DVDLowOpenPartition: partition_offset 0x%016" PRIx64, partition_offset);
// Read TMD to the buffer
const IOS::ES::TMDReader tmd = DVDThread::GetTMD();
const IOS::ES::TMDReader tmd = DVDThread::GetTMD(partition);
const std::vector<u8> raw_tmd = tmd.GetRawTMD();
Memory::CopyToEmu(request.io_vectors[0].address, raw_tmd.data(), raw_tmd.size());
ES::DIVerify(tmd, DVDThread::GetTicket());
ES::DIVerify(tmd, DVDThread::GetTicket(partition));
return_value = 1;
break;