mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DiscIO: Replace "raw" functions with "decrypt" parameters
This is intended to make decryption look less implicit in the code.
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user