diff options
| author | 2015-05-01 19:05:18 -0400 | |
|---|---|---|
| committer | 2015-05-01 19:05:18 -0400 | |
| commit | 6a2d8c46f21e8813e0472dba28932ed461ce1a66 (patch) | |
| tree | d7057cf9926c822c12cc7d82814a252db79ca600 /src/core/mem_map.cpp | |
| parent | Merge pull request #717 from linkmauve/useless-auto (diff) | |
| parent | Qt: Shutdown game on emulator close event. (diff) | |
| download | yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.gz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.xz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.zip | |
Merge pull request #713 from bunnei/qt-emuthread-fixes
Fix emulation state resetting to support multiple emulation sessions
Diffstat (limited to 'src/core/mem_map.cpp')
| -rw-r--r-- | src/core/mem_map.cpp | 71 |
1 files changed, 46 insertions, 25 deletions
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp index a14e8303e..22e359b3e 100644 --- a/src/core/mem_map.cpp +++ b/src/core/mem_map.cpp | |||
| @@ -11,30 +11,30 @@ | |||
| 11 | 11 | ||
| 12 | namespace Memory { | 12 | namespace Memory { |
| 13 | 13 | ||
| 14 | u8* g_base = nullptr; ///< The base pointer to the auto-mirrored arena. | 14 | u8* g_base; ///< The base pointer to the auto-mirrored arena. |
| 15 | 15 | ||
| 16 | static MemArena arena; ///< The MemArena class | 16 | static MemArena arena; ///< The MemArena class |
| 17 | 17 | ||
| 18 | u8* g_exefs_code = nullptr; ///< ExeFS:/.code is loaded here | 18 | u8* g_exefs_code; ///< ExeFS:/.code is loaded here |
| 19 | u8* g_system_mem = nullptr; ///< System memory | 19 | u8* g_system_mem; ///< System memory |
| 20 | u8* g_heap = nullptr; ///< Application heap (main memory) | 20 | u8* g_heap; ///< Application heap (main memory) |
| 21 | u8* g_heap_linear = nullptr; ///< Linear heap | 21 | u8* g_heap_linear; ///< Linear heap |
| 22 | u8* g_vram = nullptr; ///< Video memory (VRAM) pointer | 22 | u8* g_vram; ///< Video memory (VRAM) pointer |
| 23 | u8* g_shared_mem = nullptr; ///< Shared memory | 23 | u8* g_shared_mem; ///< Shared memory |
| 24 | u8* g_dsp_mem = nullptr; ///< DSP memory | 24 | u8* g_dsp_mem; ///< DSP memory |
| 25 | u8* g_kernel_mem; ///< Kernel memory | 25 | u8* g_kernel_mem; ///< Kernel memory |
| 26 | 26 | ||
| 27 | static u8* physical_bootrom = nullptr; ///< Bootrom physical memory | 27 | static u8* physical_bootrom; ///< Bootrom physical memory |
| 28 | static u8* uncached_bootrom = nullptr; | 28 | static u8* uncached_bootrom; |
| 29 | 29 | ||
| 30 | static u8* physical_exefs_code = nullptr; ///< Phsical ExeFS:/.code is loaded here | 30 | static u8* physical_exefs_code; ///< Phsical ExeFS:/.code is loaded here |
| 31 | static u8* physical_system_mem = nullptr; ///< System physical memory | 31 | static u8* physical_system_mem; ///< System physical memory |
| 32 | static u8* physical_fcram = nullptr; ///< Main physical memory (FCRAM) | 32 | static u8* physical_fcram; ///< Main physical memory (FCRAM) |
| 33 | static u8* physical_heap_gsp = nullptr; ///< GSP heap physical memory | 33 | static u8* physical_heap_gsp; ///< GSP heap physical memory |
| 34 | static u8* physical_vram = nullptr; ///< Video physical memory (VRAM) | 34 | static u8* physical_vram; ///< Video physical memory (VRAM) |
| 35 | static u8* physical_shared_mem = nullptr; ///< Physical shared memory | 35 | static u8* physical_shared_mem; ///< Physical shared memory |
| 36 | static u8* physical_dsp_mem = nullptr; ///< Physical DSP memory | 36 | static u8* physical_dsp_mem; ///< Physical DSP memory |
| 37 | static u8* physical_kernel_mem; ///< Kernel memory | 37 | static u8* physical_kernel_mem; ///< Kernel memory |
| 38 | 38 | ||
| 39 | // 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. |
| 40 | static MemoryView g_views[] = { | 40 | static MemoryView g_views[] = { |
| @@ -73,6 +73,7 @@ void Init() { | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | g_base = MemoryMap_Setup(g_views, kNumMemViews, flags, &arena); | 75 | g_base = MemoryMap_Setup(g_views, kNumMemViews, flags, &arena); |
| 76 | MemBlock_Init(); | ||
| 76 | 77 | ||
| 77 | LOG_DEBUG(HW_Memory, "initialized OK, RAM at %p (mirror at 0 @ %p)", g_heap, | 78 | LOG_DEBUG(HW_Memory, "initialized OK, RAM at %p (mirror at 0 @ %p)", g_heap, |
| 78 | physical_fcram); | 79 | physical_fcram); |
| @@ -81,9 +82,29 @@ void Init() { | |||
| 81 | void Shutdown() { | 82 | void Shutdown() { |
| 82 | u32 flags = 0; | 83 | u32 flags = 0; |
| 83 | MemoryMap_Shutdown(g_views, kNumMemViews, flags, &arena); | 84 | MemoryMap_Shutdown(g_views, kNumMemViews, flags, &arena); |
| 84 | |||
| 85 | arena.ReleaseSpace(); | 85 | arena.ReleaseSpace(); |
| 86 | MemBlock_Shutdown(); | ||
| 87 | |||
| 86 | g_base = nullptr; | 88 | g_base = nullptr; |
| 89 | g_exefs_code = nullptr; | ||
| 90 | g_system_mem = nullptr; | ||
| 91 | g_heap = nullptr; | ||
| 92 | g_heap_linear = nullptr; | ||
| 93 | g_vram = nullptr; | ||
| 94 | g_shared_mem = nullptr; | ||
| 95 | g_dsp_mem = nullptr; | ||
| 96 | g_kernel_mem = nullptr; | ||
| 97 | |||
| 98 | physical_bootrom = nullptr; | ||
| 99 | uncached_bootrom = nullptr; | ||
| 100 | physical_exefs_code = nullptr; | ||
| 101 | physical_system_mem = nullptr; | ||
| 102 | physical_fcram = nullptr; | ||
| 103 | physical_heap_gsp = nullptr; | ||
| 104 | physical_vram = nullptr; | ||
| 105 | physical_shared_mem = nullptr; | ||
| 106 | physical_dsp_mem = nullptr; | ||
| 107 | physical_kernel_mem = nullptr; | ||
| 87 | 108 | ||
| 88 | LOG_DEBUG(HW_Memory, "shutdown OK"); | 109 | LOG_DEBUG(HW_Memory, "shutdown OK"); |
| 89 | } | 110 | } |