DiscIO/DirectoryBlob: Add a content source representing a run of padding bytes.
This commit is contained in:
parent
f8611f7139
commit
b1802f6daa
|
@ -132,6 +132,11 @@ bool DiscContent::Read(u64* offset, u64* length, u8** buffer) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (std::holds_alternative<ContentFixedByte>(m_content_source))
|
||||||
|
{
|
||||||
|
const ContentFixedByte& source = std::get<ContentFixedByte>(m_content_source);
|
||||||
|
std::fill_n(*buffer, bytes_to_read, source.m_byte);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PanicAlertFmt("DirectoryBlob: Invalid content source in DiscContent.");
|
PanicAlertFmt("DirectoryBlob: Invalid content source in DiscContent.");
|
||||||
|
|
|
@ -71,10 +71,18 @@ struct ContentVolume
|
||||||
Partition m_partition;
|
Partition m_partition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Content chunk representing a run of identical bytes.
|
||||||
|
// Useful for padding between chunks within a file.
|
||||||
|
struct ContentFixedByte
|
||||||
|
{
|
||||||
|
u8 m_byte;
|
||||||
|
};
|
||||||
|
|
||||||
using ContentSource = std::variant<ContentFile, // File
|
using ContentSource = std::variant<ContentFile, // File
|
||||||
const u8*, // Memory
|
const u8*, // Memory
|
||||||
ContentPartition, // Partition
|
ContentPartition, // Partition
|
||||||
ContentVolume // Volume
|
ContentVolume, // Volume
|
||||||
|
ContentFixedByte // Fixed value padding
|
||||||
>;
|
>;
|
||||||
|
|
||||||
class DiscContent
|
class DiscContent
|
||||||
|
|
Loading…
Reference in New Issue