diff options
| author | 2015-02-22 12:48:28 -0500 | |
|---|---|---|
| committer | 2015-02-22 12:48:28 -0500 | |
| commit | dfe807b2cd824caeb495382e2aff307ae75a5fc9 (patch) | |
| tree | 08eaa6f752ad36cdc9ec43b1473424d68edbd05a /src/core/mem_map_funcs.cpp | |
| parent | Merge pull request #594 from Subv/display_transfer (diff) | |
| parent | Cleaned up unaligned access. (diff) | |
| download | yuzu-dfe807b2cd824caeb495382e2aff307ae75a5fc9.tar.gz yuzu-dfe807b2cd824caeb495382e2aff307ae75a5fc9.tar.xz yuzu-dfe807b2cd824caeb495382e2aff307ae75a5fc9.zip | |
Merge pull request #596 from kevinhartman/unaligned-cleanup
Clean up unaligned 32-bit memory reads
Diffstat (limited to 'src/core/mem_map_funcs.cpp')
| -rw-r--r-- | src/core/mem_map_funcs.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index 4f93c0e64..48f61db4e 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp | |||
| @@ -236,30 +236,12 @@ u8 Read8(const VAddr addr) { | |||
| 236 | u16 Read16(const VAddr addr) { | 236 | u16 Read16(const VAddr addr) { |
| 237 | u16_le data = 0; | 237 | u16_le data = 0; |
| 238 | Read<u16_le>(data, addr); | 238 | Read<u16_le>(data, addr); |
| 239 | |||
| 240 | // Check for 16-bit unaligned memory reads... | ||
| 241 | if (addr & 1) { | ||
| 242 | // TODO(bunnei): Implement 16-bit unaligned memory reads | ||
| 243 | LOG_ERROR(HW_Memory, "16-bit unaligned memory reads are not implemented!"); | ||
| 244 | } | ||
| 245 | |||
| 246 | return (u16)data; | 239 | return (u16)data; |
| 247 | } | 240 | } |
| 248 | 241 | ||
| 249 | u32 Read32(const VAddr addr) { | 242 | u32 Read32(const VAddr addr) { |
| 250 | u32_le data = 0; | 243 | u32_le data = 0; |
| 251 | Read<u32_le>(data, addr); | 244 | Read<u32_le>(data, addr); |
| 252 | |||
| 253 | // Check for 32-bit unaligned memory reads... | ||
| 254 | if (addr & 3) { | ||
| 255 | // ARM allows for unaligned memory reads, however older ARM architectures read out memory | ||
| 256 | // from unaligned addresses in a shifted way. Our ARM CPU core (SkyEye) corrects for this, | ||
| 257 | // so therefore expects the memory to be read out in this manner. | ||
| 258 | // TODO(bunnei): Determine if this is necessary - perhaps it is OK to remove this from both | ||
| 259 | // SkyEye and here? | ||
| 260 | int shift = (addr & 3) * 8; | ||
| 261 | data = (data << shift) | (data >> (32 - shift)); | ||
| 262 | } | ||
| 263 | return (u32)data; | 245 | return (u32)data; |
| 264 | } | 246 | } |
| 265 | 247 | ||