Merge pull request #10932 from JosJuice/nfs

DiscIO: Add support for the NFS format
This commit is contained in:
Admiral H. Curtiss
2022-08-04 22:20:08 +02:00
committed by GitHub
44 changed files with 637 additions and 143 deletions

View File

@ -231,7 +231,7 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(std::vector<std
#endif
static const std::unordered_set<std::string> disc_image_extensions = {
{".gcm", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz", ".wia", ".rvz", ".dol", ".elf"}};
{".gcm", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz", ".wia", ".rvz", ".nfs", ".dol", ".elf"}};
if (disc_image_extensions.find(extension) != disc_image_extensions.end() || is_drive)
{
std::unique_ptr<DiscIO::VolumeDisc> disc = DiscIO::CreateDisc(path);

View File

@ -430,9 +430,9 @@ void Shutdown()
static u64 GetDiscEndOffset(const DiscIO::VolumeDisc& disc)
{
u64 size = disc.GetSize();
u64 size = disc.GetDataSize();
if (disc.IsSizeAccurate())
if (disc.GetDataSizeType() == DiscIO::DataSizeType::Accurate)
{
if (size == DiscIO::MINI_DVD_SIZE)
return DiscIO::MINI_DVD_SIZE;
@ -464,7 +464,7 @@ void SetDisc(std::unique_ptr<DiscIO::VolumeDisc> disc,
if (has_disc)
{
s_disc_end_offset = GetDiscEndOffset(*disc);
if (!disc->IsSizeAccurate())
if (disc->GetDataSizeType() != DiscIO::DataSizeType::Accurate)
WARN_LOG_FMT(DVDINTERFACE, "Unknown disc size, guessing {0} bytes", s_disc_end_offset);
const DiscIO::BlobReader& blob = disc->GetBlobReader();
@ -1482,10 +1482,9 @@ static void ScheduleReads(u64 offset, u32 length, const DiscIO::Partition& parti
u32 buffered_blocks = 0;
u32 unbuffered_blocks = 0;
const u32 bytes_per_chunk =
partition != DiscIO::PARTITION_NONE && DVDThread::IsEncryptedAndHashed() ?
DiscIO::VolumeWii::BLOCK_DATA_SIZE :
DVD_ECC_BLOCK_SIZE;
const u32 bytes_per_chunk = partition != DiscIO::PARTITION_NONE && DVDThread::HasWiiHashes() ?
DiscIO::VolumeWii::BLOCK_DATA_SIZE :
DVD_ECC_BLOCK_SIZE;
do
{

View File

@ -184,10 +184,10 @@ bool HasDisc()
return s_disc != nullptr;
}
bool IsEncryptedAndHashed()
bool HasWiiHashes()
{
// IsEncryptedAndHashed is thread-safe, so calling WaitUntilIdle isn't necessary.
return s_disc->IsEncryptedAndHashed();
// HasWiiHashes is thread-safe, so calling WaitUntilIdle isn't necessary.
return s_disc->HasWiiHashes();
}
DiscIO::Platform GetDiscType()

View File

@ -41,7 +41,7 @@ void DoState(PointerWrap& p);
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
bool HasDisc();
bool IsEncryptedAndHashed();
bool HasWiiHashes();
DiscIO::Platform GetDiscType();
u64 PartitionOffsetToRawOffset(u64 offset, const DiscIO::Partition& partition);
IOS::ES::TMDReader GetTMD(const DiscIO::Partition& partition);