diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/mem_map.h | 9 | ||||
| -rw-r--r-- | src/core/mem_map_funcs.cpp | 14 |
2 files changed, 3 insertions, 20 deletions
diff --git a/src/core/mem_map.h b/src/core/mem_map.h index 71f90cb8a..b6944deb4 100644 --- a/src/core/mem_map.h +++ b/src/core/mem_map.h | |||
| @@ -134,20 +134,11 @@ extern u8* g_tls_mem; ///< TLS memory | |||
| 134 | void Init(); | 134 | void Init(); |
| 135 | void Shutdown(); | 135 | void Shutdown(); |
| 136 | 136 | ||
| 137 | template <typename T> | ||
| 138 | inline void Read(T &var, VAddr addr); | ||
| 139 | |||
| 140 | template <typename T> | ||
| 141 | inline void Write(VAddr addr, T data); | ||
| 142 | |||
| 143 | u8 Read8(VAddr addr); | 137 | u8 Read8(VAddr addr); |
| 144 | u16 Read16(VAddr addr); | 138 | u16 Read16(VAddr addr); |
| 145 | u32 Read32(VAddr addr); | 139 | u32 Read32(VAddr addr); |
| 146 | u64 Read64(VAddr addr); | 140 | u64 Read64(VAddr addr); |
| 147 | 141 | ||
| 148 | u32 Read8_ZX(VAddr addr); | ||
| 149 | u32 Read16_ZX(VAddr addr); | ||
| 150 | |||
| 151 | void Write8(VAddr addr, u8 data); | 142 | void Write8(VAddr addr, u8 data); |
| 152 | void Write16(VAddr addr, u16 data); | 143 | void Write16(VAddr addr, u16 data); |
| 153 | void Write32(VAddr addr, u32 data); | 144 | void Write32(VAddr addr, u32 data); |
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index a8e0fed07..f2da60cc6 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp | |||
| @@ -225,27 +225,19 @@ u8 Read8(const VAddr addr) { | |||
| 225 | u16 Read16(const VAddr addr) { | 225 | u16 Read16(const VAddr addr) { |
| 226 | u16_le data = 0; | 226 | u16_le data = 0; |
| 227 | Read<u16_le>(data, addr); | 227 | Read<u16_le>(data, addr); |
| 228 | return (u16)data; | 228 | return data; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | u32 Read32(const VAddr addr) { | 231 | u32 Read32(const VAddr addr) { |
| 232 | u32_le data = 0; | 232 | u32_le data = 0; |
| 233 | Read<u32_le>(data, addr); | 233 | Read<u32_le>(data, addr); |
| 234 | return (u32)data; | 234 | return data; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | u64 Read64(const VAddr addr) { | 237 | u64 Read64(const VAddr addr) { |
| 238 | u64_le data = 0; | 238 | u64_le data = 0; |
| 239 | Read<u64_le>(data, addr); | 239 | Read<u64_le>(data, addr); |
| 240 | return (u64)data; | 240 | return data; |
| 241 | } | ||
| 242 | |||
| 243 | u32 Read8_ZX(const VAddr addr) { | ||
| 244 | return (u32)Read8(addr); | ||
| 245 | } | ||
| 246 | |||
| 247 | u32 Read16_ZX(const VAddr addr) { | ||
| 248 | return (u32)Read16(addr); | ||
| 249 | } | 241 | } |
| 250 | 242 | ||
| 251 | void Write8(const VAddr addr, const u8 data) { | 243 | void Write8(const VAddr addr, const u8 data) { |