DiscIO: Replace "raw" functions with "decrypt" parameters

This is intended to make decryption look less implicit in the code.
This commit is contained in:
JosJuice
2014-12-28 10:35:48 +01:00
parent 72f8f243c7
commit bb93336ecf
19 changed files with 174 additions and 195 deletions

View File

@ -64,16 +64,23 @@ bool CVolumeDirectory::IsValidDirectory(const std::string& _rDirectory)
return File::IsDirectory(directoryName);
}
bool CVolumeDirectory::RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const
bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const
{
if (VolumeHandler::IsWii())
return false;
else
return Read(_Offset, _Length, _pBuffer);
}
bool wii = VolumeHandler::IsWii();
if (!decrypt && (_Offset + _Length >= 0x400) && wii)
{
// Fully supporting this would require re-encrypting every file that's read.
// Only supporting the areas that IOS allows software to read could be more feasible.
// Currently, only the header (up to 0x400) is supported, though we're cheating a bit
// with it by reading the header inside the current partition instead. Supporting the
// header is enough for booting games, but not for running things like the Disc Channel.
return false;
}
if (decrypt && !wii)
PanicAlertT("Tried to decrypt data from a non-Wii volume");
bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
{
// header
if (_Offset < DISKHEADERINFO_ADDRESS)
{