diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-10-13 21:20:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 21:20:44 +0200 |
commit | c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88 (patch) | |
tree | 9565ff464bbb9e5a0aa66e6e310098314e88d019 /src/core/memory.cpp | |
parent | Merge pull request #3929 from FearlessTobi/ticket-keys (diff) | |
parent | core/CMakeLists: Make some warnings errors (diff) | |
download | yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.gz yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.bz2 yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.lz yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.xz yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.zst yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/memory.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index c3f4829d7..b88aa5c40 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -120,9 +120,9 @@ struct Memory::Impl { if ((addr & 1) == 0) { return Read<u16_le>(addr); } else { - const u8 a{Read<u8>(addr)}; - const u8 b{Read<u8>(addr + sizeof(u8))}; - return (static_cast<u16>(b) << 8) | a; + const u32 a{Read<u8>(addr)}; + const u32 b{Read<u8>(addr + sizeof(u8))}; + return static_cast<u16>((b << 8) | a); } } @@ -130,9 +130,9 @@ struct Memory::Impl { if ((addr & 3) == 0) { return Read<u32_le>(addr); } else { - const u16 a{Read16(addr)}; - const u16 b{Read16(addr + sizeof(u16))}; - return (static_cast<u32>(b) << 16) | a; + const u32 a{Read16(addr)}; + const u32 b{Read16(addr + sizeof(u16))}; + return (b << 16) | a; } } |