summaryrefslogtreecommitdiffstats
path: root/src/core/mem_map_funcs.cpp
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-26 07:27:25 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-26 07:27:25 +0200
commit86a515e5acd7e5fa3abd3a012ce4771d3b920754 (patch)
treea62d85e829424208c08930b6fe6e6f4b7492c312 /src/core/mem_map_funcs.cpp
parentmoved HLE::MRC to its own module, added support for catching data synchronization barrier command (diff)
downloadyuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar.gz
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar.bz2
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar.lz
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar.xz
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.tar.zst
yuzu-86a515e5acd7e5fa3abd3a012ce4771d3b920754.zip
Diffstat (limited to '')
-rw-r--r--src/core/mem_map_funcs.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index 832957cb1..875821adb 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -58,8 +58,12 @@ inline void _Read(T &var, const u32 addr) {
} else if ((vaddr >= SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) {
var = *((const T*)&g_shared_mem[vaddr & SHARED_MEMORY_MASK]);
+ // VRAM
+ } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) {
+ var = *((const T*)&g_vram[vaddr & VRAM_MASK]);
+
} else {
- _assert_msg_(MEMMAP, false, "unknown Read%d @ 0x%08X", sizeof(var) * 8, vaddr);
+ //_assert_msg_(MEMMAP, false, "unknown Read%d @ 0x%08X", sizeof(var) * 8, vaddr);
}
}
@@ -90,12 +94,10 @@ inline void _Write(u32 addr, const T data) {
} else if ((vaddr >= SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) {
*(T*)&g_shared_mem[vaddr & SHARED_MEMORY_MASK] = data;
- } else if ((vaddr & 0xFF000000) == 0x14000000) {
- _assert_msg_(MEMMAP, false, "umimplemented write to GSP heap");
- } else if ((vaddr & 0xFFF00000) == 0x1EC00000) {
- _assert_msg_(MEMMAP, false, "umimplemented write to IO registers");
- } else if ((vaddr & 0xFF000000) == 0x1F000000) {
- _assert_msg_(MEMMAP, false, "umimplemented write to VRAM");
+ // VRAM
+ } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) {
+ *(T*)&g_vram[vaddr & VRAM_MASK] = data;
+
} else if ((vaddr & 0xFFF00000) == 0x1FF00000) {
_assert_msg_(MEMMAP, false, "umimplemented write to DSP memory");
} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) {
@@ -125,6 +127,10 @@ u8 *GetPointer(const u32 addr) {
} else if ((vaddr > SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) {
return g_shared_mem + (vaddr & SHARED_MEMORY_MASK);
+ // VRAM
+ } else if ((vaddr > VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) {
+ return g_vram + (vaddr & VRAM_MASK);
+
} else {
ERROR_LOG(MEMMAP, "Unknown GetPointer @ 0x%08x", vaddr);
return 0;