mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 09:39:13 +00: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:
parent
a8e4a3c915
commit
5e3c98af1d
7 changed files with 42 additions and 39 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue