summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/mem_map.cpp3
-rw-r--r--src/core/mem_map.h1
-rw-r--r--src/core/mem_map_funcs.cpp10
3 files changed, 12 insertions, 2 deletions
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp
index eea6c5bf1..a14e8303e 100644
--- a/src/core/mem_map.cpp
+++ b/src/core/mem_map.cpp
@@ -21,6 +21,7 @@ u8* g_heap = nullptr; ///< Application heap (main memory)
21u8* g_heap_linear = nullptr; ///< Linear heap 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_dsp_mem = nullptr; ///< DSP memory
24u8* g_kernel_mem; ///< Kernel memory 25u8* g_kernel_mem; ///< Kernel memory
25 26
26static u8* physical_bootrom = nullptr; ///< Bootrom physical memory 27static u8* physical_bootrom = nullptr; ///< Bootrom physical memory
@@ -32,6 +33,7 @@ static u8* physical_fcram = nullptr; ///< Main physical memory (FCRAM)
32static u8* physical_heap_gsp = nullptr; ///< GSP heap physical memory 33static u8* physical_heap_gsp = nullptr; ///< GSP heap physical memory
33static u8* physical_vram = nullptr; ///< Video physical memory (VRAM) 34static u8* physical_vram = nullptr; ///< Video physical memory (VRAM)
34static u8* physical_shared_mem = nullptr; ///< Physical shared memory 35static u8* physical_shared_mem = nullptr; ///< Physical shared memory
36static u8* physical_dsp_mem = nullptr; ///< Physical DSP memory
35static u8* physical_kernel_mem; ///< Kernel memory 37static u8* physical_kernel_mem; ///< Kernel memory
36 38
37// We don't declare the IO region in here since its handled by other means. 39// We don't declare the IO region in here since its handled by other means.
@@ -41,6 +43,7 @@ static MemoryView g_views[] = {
41 {&g_heap, &physical_fcram, HEAP_VADDR, HEAP_SIZE, MV_IS_PRIMARY_RAM}, 43 {&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}, 44 {&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}, 45 {&g_system_mem, &physical_system_mem, SYSTEM_MEMORY_VADDR, SYSTEM_MEMORY_SIZE, 0},
46 {&g_dsp_mem, &physical_dsp_mem, DSP_MEMORY_VADDR, DSP_MEMORY_SIZE, 0},
44 {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0}, 47 {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0},
45 {&g_heap_linear, &physical_heap_gsp, HEAP_LINEAR_VADDR, HEAP_LINEAR_SIZE, 0}, 48 {&g_heap_linear, &physical_heap_gsp, HEAP_LINEAR_VADDR, HEAP_LINEAR_SIZE, 0},
46}; 49};
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index a2ef9d3af..fad40ae0c 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -134,6 +134,7 @@ extern u8* g_heap; ///< Application heap (main memory)
134extern u8* g_vram; ///< Video memory (VRAM) 134extern u8* g_vram; ///< Video memory (VRAM)
135extern u8* g_shared_mem; ///< Shared memory 135extern u8* g_shared_mem; ///< Shared memory
136extern u8* g_kernel_mem; ///< Kernel memory 136extern u8* g_kernel_mem; ///< Kernel memory
137extern u8* g_dsp_mem; ///< DSP memory
137extern u8* g_system_mem; ///< System memory 138extern u8* g_system_mem; ///< System memory
138extern u8* g_exefs_code; ///< ExeFS:/.code is loaded here 139extern u8* g_exefs_code; ///< ExeFS:/.code is loaded here
139 140
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index fdf382ed6..97ef1c5a3 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -82,6 +82,10 @@ inline void Read(T &var, const VAddr vaddr) {
82 } else if ((vaddr >= CONFIG_MEMORY_VADDR) && (vaddr < CONFIG_MEMORY_VADDR_END)) { 82 } else if ((vaddr >= CONFIG_MEMORY_VADDR) && (vaddr < CONFIG_MEMORY_VADDR_END)) {
83 ConfigMem::Read<T>(var, vaddr); 83 ConfigMem::Read<T>(var, vaddr);
84 84
85 // DSP memory
86 } else if ((vaddr >= DSP_MEMORY_VADDR) && (vaddr < DSP_MEMORY_VADDR_END)) {
87 var = *((const T*)&g_dsp_mem[vaddr - DSP_MEMORY_VADDR]);
88
85 // VRAM 89 // VRAM
86 } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) { 90 } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) {
87 var = *((const T*)&g_vram[vaddr - VRAM_VADDR]); 91 var = *((const T*)&g_vram[vaddr - VRAM_VADDR]);
@@ -122,8 +126,10 @@ inline void Write(const VAddr vaddr, const T data) {
122 } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) { 126 } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) {
123 *(T*)&g_vram[vaddr - VRAM_VADDR] = data; 127 *(T*)&g_vram[vaddr - VRAM_VADDR] = data;
124 128
125 //} else if ((vaddr & 0xFFF00000) == 0x1FF00000) { 129 // DSP memory
126 // _assert_msg_(MEMMAP, false, "umimplemented write to DSP memory"); 130 } else if ((vaddr >= DSP_MEMORY_VADDR) && (vaddr < DSP_MEMORY_VADDR_END)) {
131 *(T*)&g_dsp_mem[vaddr - DSP_MEMORY_VADDR] = data;
132
127 //} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) { 133 //} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) {
128 // _assert_msg_(MEMMAP, false, "umimplemented write to Configuration Memory"); 134 // _assert_msg_(MEMMAP, false, "umimplemented write to Configuration Memory");
129 //} else if ((vaddr & 0xFFFFF000) == 0x1FF81000) { 135 //} else if ((vaddr & 0xFFFFF000) == 0x1FF81000) {