mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
DiscIO: Add a Volume::ReadSwappedAndShifted function
This is a fairly common operation, so let's make a utility function for it to cut down on code duplication.
This commit is contained in:
@ -136,9 +136,9 @@ bool DiscScrubber::ReadFromVolume(u64 offset, u32& buffer, const Partition& part
|
||||
|
||||
bool DiscScrubber::ReadFromVolume(u64 offset, u64& buffer, const Partition& partition)
|
||||
{
|
||||
std::optional<u32> value = m_disc->ReadSwapped<u32>(offset, partition);
|
||||
std::optional<u64> value = m_disc->ReadSwappedAndShifted(offset, partition);
|
||||
if (value)
|
||||
buffer = static_cast<u64>(*value) << 2;
|
||||
buffer = *value;
|
||||
return value.has_value();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user