summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/svc.cpp2
-rw-r--r--src/core/mem_map.cpp16
-rw-r--r--src/core/mem_map.h14
-rw-r--r--src/core/mem_map_funcs.cpp32
-rw-r--r--src/video_core/pica.h4
5 files changed, 34 insertions, 34 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index a5805ed05..b99c301d4 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -43,7 +43,7 @@ static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1,
43 43
44 // Map GSP heap memory 44 // Map GSP heap memory
45 case MEMORY_OPERATION_GSP_HEAP: 45 case MEMORY_OPERATION_GSP_HEAP:
46 *out_addr = Memory::MapBlock_HeapGSP(size, operation, permissions); 46 *out_addr = Memory::MapBlock_HeapLinear(size, operation, permissions);
47 break; 47 break;
48 48
49 // Unknown ControlMemory operation 49 // Unknown ControlMemory operation
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp
index 74a93b1d9..e1c2580ff 100644
--- a/src/core/mem_map.cpp
+++ b/src/core/mem_map.cpp
@@ -18,7 +18,7 @@ static MemArena arena; ///< The MemArena class
18u8* g_exefs_code = nullptr; ///< ExeFS:/.code is loaded here 18u8* g_exefs_code = nullptr; ///< ExeFS:/.code is loaded here
19u8* g_system_mem = nullptr; ///< System memory 19u8* g_system_mem = nullptr; ///< System memory
20u8* g_heap = nullptr; ///< Application heap (main memory) 20u8* g_heap = nullptr; ///< Application heap (main memory)
21u8* g_heap_gsp = nullptr; ///< GSP heap (main memory) 21u8* g_heap_linear = nullptr; ///< Linear heap
22u8* g_vram = nullptr; ///< Video memory (VRAM) pointer 22u8* g_vram = nullptr; ///< Video memory (VRAM) pointer
23u8* g_shared_mem = nullptr; ///< Shared memory 23u8* g_shared_mem = nullptr; ///< Shared memory
24u8* g_kernel_mem; ///< Kernel memory 24u8* g_kernel_mem; ///< Kernel memory
@@ -36,13 +36,13 @@ static u8* physical_kernel_mem; ///< Kernel memory
36 36
37// We don't declare the IO region in here since its handled by other means. 37// We don't declare the IO region in here since its handled by other means.
38static MemoryView g_views[] = { 38static MemoryView g_views[] = {
39 {&g_exefs_code, &physical_exefs_code, EXEFS_CODE_VADDR, EXEFS_CODE_SIZE, 0}, 39 {&g_exefs_code, &physical_exefs_code, EXEFS_CODE_VADDR, EXEFS_CODE_SIZE, 0},
40 {&g_vram, &physical_vram, VRAM_VADDR, VRAM_SIZE, 0}, 40 {&g_vram, &physical_vram, VRAM_VADDR, VRAM_SIZE, 0},
41 {&g_heap, &physical_fcram, HEAP_VADDR, HEAP_SIZE, MV_IS_PRIMARY_RAM}, 41 {&g_heap, &physical_fcram, HEAP_VADDR, HEAP_SIZE, MV_IS_PRIMARY_RAM},
42 {&g_shared_mem, &physical_shared_mem, SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, 0}, 42 {&g_shared_mem, &physical_shared_mem, SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, 0},
43 {&g_system_mem, &physical_system_mem, SYSTEM_MEMORY_VADDR, SYSTEM_MEMORY_SIZE, 0}, 43 {&g_system_mem, &physical_system_mem, SYSTEM_MEMORY_VADDR, SYSTEM_MEMORY_SIZE, 0},
44 {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0}, 44 {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0},
45 {&g_heap_gsp, &physical_heap_gsp, HEAP_GSP_VADDR, HEAP_GSP_SIZE, 0}, 45 {&g_heap_linear, &physical_heap_gsp, HEAP_LINEAR_VADDR, HEAP_LINEAR_SIZE, 0},
46}; 46};
47 47
48/*static MemoryView views[] = 48/*static MemoryView views[] =
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index f17afb60d..7b750f848 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -57,11 +57,11 @@ enum : u32 {
57 HEAP_VADDR = 0x08000000, 57 HEAP_VADDR = 0x08000000,
58 HEAP_VADDR_END = (HEAP_VADDR + HEAP_SIZE), 58 HEAP_VADDR_END = (HEAP_VADDR + HEAP_SIZE),
59 59
60 HEAP_GSP_SIZE = 0x02000000, ///< GSP heap size... TODO: Define correctly? 60 HEAP_LINEAR_SIZE = 0x08000000, ///< Linear heap size... TODO: Define correctly?
61 HEAP_GSP_VADDR = 0x14000000, 61 HEAP_LINEAR_VADDR = 0x14000000,
62 HEAP_GSP_VADDR_END = (HEAP_GSP_VADDR + HEAP_GSP_SIZE), 62 HEAP_LINEAR_VADDR_END = (HEAP_LINEAR_VADDR + HEAP_LINEAR_SIZE),
63 HEAP_GSP_PADDR = 0x00000000, 63 HEAP_LINEAR_PADDR = 0x00000000,
64 HEAP_GSP_PADDR_END = (HEAP_GSP_PADDR + HEAP_GSP_SIZE), 64 HEAP_LINEAR_PADDR_END = (HEAP_LINEAR_PADDR + HEAP_LINEAR_SIZE),
65 65
66 HARDWARE_IO_SIZE = 0x01000000, 66 HARDWARE_IO_SIZE = 0x01000000,
67 HARDWARE_IO_PADDR = 0x10000000, ///< IO physical address start 67 HARDWARE_IO_PADDR = 0x10000000, ///< IO physical address start
@@ -112,7 +112,7 @@ extern u8 *g_base;
112// These are guaranteed to point to "low memory" addresses (sub-32-bit). 112// These are guaranteed to point to "low memory" addresses (sub-32-bit).
113// 64-bit: Pointers to low-mem (sub-0x10000000) mirror 113// 64-bit: Pointers to low-mem (sub-0x10000000) mirror
114// 32-bit: Same as the corresponding physical/virtual pointers. 114// 32-bit: Same as the corresponding physical/virtual pointers.
115extern u8* g_heap_gsp; ///< GSP heap (main memory) 115extern u8* g_heap_linear; ///< Linear heap (main memory)
116extern u8* g_heap; ///< Application heap (main memory) 116extern u8* g_heap; ///< Application heap (main memory)
117extern u8* g_vram; ///< Video memory (VRAM) 117extern u8* g_vram; ///< Video memory (VRAM)
118extern u8* g_shared_mem; ///< Shared memory 118extern u8* g_shared_mem; ///< Shared memory
@@ -159,7 +159,7 @@ u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions);
159 * @param operation Memory map operation type 159 * @param operation Memory map operation type
160 * @param permissions Control memory permissions 160 * @param permissions Control memory permissions
161 */ 161 */
162u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions); 162u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions);
163 163
164inline const char* GetCharPointer(const VAddr address) { 164inline const char* GetCharPointer(const VAddr address) {
165 return (const char *)GetPointer(address); 165 return (const char *)GetPointer(address);
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index 1887bcedb..b78821a3b 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -13,7 +13,7 @@
13namespace Memory { 13namespace Memory {
14 14
15static std::map<u32, MemoryBlock> heap_map; 15static std::map<u32, MemoryBlock> heap_map;
16static std::map<u32, MemoryBlock> heap_gsp_map; 16static std::map<u32, MemoryBlock> heap_linear_map;
17static std::map<u32, MemoryBlock> shared_map; 17static std::map<u32, MemoryBlock> shared_map;
18 18
19/// Convert a physical address to virtual address 19/// Convert a physical address to virtual address
@@ -67,9 +67,9 @@ inline void Read(T &var, const VAddr vaddr) {
67 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { 67 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) {
68 var = *((const T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR]); 68 var = *((const T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR]);
69 69
70 // FCRAM - GSP heap 70 // FCRAM - linear heap
71 } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { 71 } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) {
72 var = *((const T*)&g_heap_gsp[vaddr - HEAP_GSP_VADDR]); 72 var = *((const T*)&g_heap_linear[vaddr - HEAP_LINEAR_VADDR]);
73 73
74 // FCRAM - application heap 74 // FCRAM - application heap
75 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { 75 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) {
@@ -112,9 +112,9 @@ inline void Write(const VAddr vaddr, const T data) {
112 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { 112 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) {
113 *(T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR] = data; 113 *(T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR] = data;
114 114
115 // FCRAM - GSP heap 115 // FCRAM - linear heap
116 } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { 116 } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) {
117 *(T*)&g_heap_gsp[vaddr - HEAP_GSP_VADDR] = data; 117 *(T*)&g_heap_linear[vaddr - HEAP_LINEAR_VADDR] = data;
118 118
119 // FCRAM - application heap 119 // FCRAM - application heap
120 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { 120 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) {
@@ -154,9 +154,9 @@ u8 *GetPointer(const VAddr vaddr) {
154 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { 154 } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) {
155 return g_exefs_code + (vaddr - EXEFS_CODE_VADDR); 155 return g_exefs_code + (vaddr - EXEFS_CODE_VADDR);
156 156
157 // FCRAM - GSP heap 157 // FCRAM - linear heap
158 } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { 158 } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) {
159 return g_heap_gsp + (vaddr - HEAP_GSP_VADDR); 159 return g_heap_linear + (vaddr - HEAP_LINEAR_VADDR);
160 160
161 // FCRAM - application heap 161 // FCRAM - application heap
162 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { 162 } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) {
@@ -204,24 +204,24 @@ u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions) {
204} 204}
205 205
206/** 206/**
207 * Maps a block of memory on the GSP heap 207 * Maps a block of memory on the linear heap
208 * @param size Size of block in bytes 208 * @param size Size of block in bytes
209 * @param operation Memory map operation type 209 * @param operation Memory map operation type
210 * @param flags Memory allocation flags 210 * @param flags Memory allocation flags
211 */ 211 */
212u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions) { 212u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions) {
213 MemoryBlock block; 213 MemoryBlock block;
214 214
215 block.base_address = HEAP_GSP_VADDR; 215 block.base_address = HEAP_LINEAR_VADDR;
216 block.size = size; 216 block.size = size;
217 block.operation = operation; 217 block.operation = operation;
218 block.permissions = permissions; 218 block.permissions = permissions;
219 219
220 if (heap_gsp_map.size() > 0) { 220 if (heap_linear_map.size() > 0) {
221 const MemoryBlock last_block = heap_gsp_map.rbegin()->second; 221 const MemoryBlock last_block = heap_linear_map.rbegin()->second;
222 block.address = last_block.address + last_block.size; 222 block.address = last_block.address + last_block.size;
223 } 223 }
224 heap_gsp_map[block.GetVirtualAddress()] = block; 224 heap_linear_map[block.GetVirtualAddress()] = block;
225 225
226 return block.GetVirtualAddress(); 226 return block.GetVirtualAddress();
227} 227}
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 8bac178ca..4c3791ad9 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -116,7 +116,7 @@ struct Regs {
116 u32 address; 116 u32 address;
117 117
118 u32 GetPhysicalAddress() const { 118 u32 GetPhysicalAddress() const {
119 return DecodeAddressRegister(address) - Memory::FCRAM_PADDR + Memory::HEAP_GSP_VADDR; 119 return DecodeAddressRegister(address) - Memory::FCRAM_PADDR + Memory::HEAP_LINEAR_VADDR;
120 } 120 }
121 121
122 // texture1 and texture2 store the texture format directly after the address 122 // texture1 and texture2 store the texture format directly after the address
@@ -312,7 +312,7 @@ struct Regs {
312 312
313 inline u32 GetBaseAddress() const { 313 inline u32 GetBaseAddress() const {
314 // TODO: Ugly, should fix PhysicalToVirtualAddress instead 314 // TODO: Ugly, should fix PhysicalToVirtualAddress instead
315 return DecodeAddressRegister(base_address) - Memory::FCRAM_PADDR + Memory::HEAP_GSP_VADDR; 315 return DecodeAddressRegister(base_address) - Memory::FCRAM_PADDR + Memory::HEAP_LINEAR_VADDR;
316 } 316 }
317 317
318 // Descriptor for internal vertex attributes 318 // Descriptor for internal vertex attributes