diff options
| author | 2013-09-05 23:04:04 -0400 | |
|---|---|---|
| committer | 2013-09-05 23:04:04 -0400 | |
| commit | 62d873da3ec77044d0135dbb2c6492eca29482fa (patch) | |
| tree | 3a21f3df2e1784af68f2df5ac98ced6a73f43c20 /src/common | |
| parent | added core and mem_map files to the project (diff) | |
| download | yuzu-62d873da3ec77044d0135dbb2c6492eca29482fa.tar.gz yuzu-62d873da3ec77044d0135dbb2c6492eca29482fa.tar.xz yuzu-62d873da3ec77044d0135dbb2c6492eca29482fa.zip | |
start of 3DS memory map
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/src/common_funcs.h | 2 | ||||
| -rw-r--r-- | src/common/src/mem_arena.cpp | 10 | ||||
| -rw-r--r-- | src/common/src/mem_arena.h | 3 |
3 files changed, 3 insertions, 12 deletions
diff --git a/src/common/src/common_funcs.h b/src/common/src/common_funcs.h index 73320a3ac..9fa44c894 100644 --- a/src/common/src/common_funcs.h +++ b/src/common/src/common_funcs.h | |||
| @@ -22,6 +22,8 @@ template<> struct CompileTimeAssert<true> {}; | |||
| 22 | #define b32(x) (b16(x) | (b16(x) >>16) ) | 22 | #define b32(x) (b16(x) | (b16(x) >>16) ) |
| 23 | #define ROUND_UP_POW2(x) (b32(x - 1) + 1) | 23 | #define ROUND_UP_POW2(x) (b32(x - 1) + 1) |
| 24 | 24 | ||
| 25 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) | ||
| 26 | |||
| 25 | #if defined __GNUC__ && !defined __SSSE3__ && !defined _M_GENERIC | 27 | #if defined __GNUC__ && !defined __SSSE3__ && !defined _M_GENERIC |
| 26 | #include <emmintrin.h> | 28 | #include <emmintrin.h> |
| 27 | static __inline __m128i __attribute__((__always_inline__)) | 29 | static __inline __m128i __attribute__((__always_inline__)) |
diff --git a/src/common/src/mem_arena.cpp b/src/common/src/mem_arena.cpp index 13cd00fd3..291103be7 100644 --- a/src/common/src/mem_arena.cpp +++ b/src/common/src/mem_arena.cpp | |||
| @@ -163,14 +163,6 @@ u8* MemArena::Find4GBBase() | |||
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | 165 | ||
| 166 | // yeah, this could also be done in like two bitwise ops... | ||
| 167 | #define SKIP(a_flags, b_flags) \ | ||
| 168 | if (!(a_flags & MV_WII_ONLY) && (b_flags & MV_WII_ONLY)) \ | ||
| 169 | continue; \ | ||
| 170 | if (!(a_flags & MV_FAKE_VMEM) && (b_flags & MV_FAKE_VMEM)) \ | ||
| 171 | continue; \ | ||
| 172 | |||
| 173 | |||
| 174 | static bool Memory_TryBase(u8 *base, const MemoryView *views, int num_views, u32 flags, MemArena *arena) { | 166 | static bool Memory_TryBase(u8 *base, const MemoryView *views, int num_views, u32 flags, MemArena *arena) { |
| 175 | // OK, we know where to find free space. Now grab it! | 167 | // OK, we know where to find free space. Now grab it! |
| 176 | // We just mimic the popular BAT setup. | 168 | // We just mimic the popular BAT setup. |
| @@ -189,7 +181,6 @@ static bool Memory_TryBase(u8 *base, const MemoryView *views, int num_views, u32 | |||
| 189 | int i; | 181 | int i; |
| 190 | for (i = 0; i < num_views; i++) | 182 | for (i = 0; i < num_views; i++) |
| 191 | { | 183 | { |
| 192 | SKIP(flags, views[i].flags); | ||
| 193 | if (views[i].flags & MV_MIRROR_PREVIOUS) { | 184 | if (views[i].flags & MV_MIRROR_PREVIOUS) { |
| 194 | position = last_position; | 185 | position = last_position; |
| 195 | } else { | 186 | } else { |
| @@ -230,7 +221,6 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena | |||
| 230 | 221 | ||
| 231 | for (int i = 0; i < num_views; i++) | 222 | for (int i = 0; i < num_views; i++) |
| 232 | { | 223 | { |
| 233 | SKIP(flags, views[i].flags); | ||
| 234 | if ((views[i].flags & MV_MIRROR_PREVIOUS) == 0) | 224 | if ((views[i].flags & MV_MIRROR_PREVIOUS) == 0) |
| 235 | total_mem += views[i].size; | 225 | total_mem += views[i].size; |
| 236 | } | 226 | } |
diff --git a/src/common/src/mem_arena.h b/src/common/src/mem_arena.h index 4c3ded0df..3c14756db 100644 --- a/src/common/src/mem_arena.h +++ b/src/common/src/mem_arena.h | |||
| @@ -37,8 +37,7 @@ private: | |||
| 37 | 37 | ||
| 38 | enum { | 38 | enum { |
| 39 | MV_MIRROR_PREVIOUS = 1, | 39 | MV_MIRROR_PREVIOUS = 1, |
| 40 | MV_FAKE_VMEM = 2, | 40 | MV_IS_PRIMARY_RAM = 0x100, |
| 41 | MV_WII_ONLY = 4, | ||
| 42 | }; | 41 | }; |
| 43 | 42 | ||
| 44 | struct MemoryView | 43 | struct MemoryView |