summaryrefslogtreecommitdiffstats
path: root/src/core/mem_map_funcs.cpp
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-28 04:32:51 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-28 04:32:51 +0200
commitaf921daa4c4bb9c02b53dfcaa35e3f4158b6bf21 (patch)
treecd08857a31878aa55d97d1d2e3a36f8bbfe942ec /src/core/mem_map_funcs.cpp
parentfix for issue Linux build #9, not sure why this is broken but its unused code I'm just getting rid of it (diff)
downloadyuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar.gz
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar.bz2
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar.lz
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar.xz
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.tar.zst
yuzu-af921daa4c4bb9c02b53dfcaa35e3f4158b6bf21.zip
Diffstat (limited to '')
-rw-r--r--src/core/mem_map_funcs.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index c8daf0df5..c057a8114 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -16,14 +16,18 @@ std::map<u32, MemoryBlock> g_heap_map;
std::map<u32, MemoryBlock> g_heap_gsp_map;
std::map<u32, MemoryBlock> g_shared_map;
-/// Convert a physical address to virtual address
-u32 _AddressPhysicalToVirtual(const u32 addr) {
+/// Convert a physical address (or firmware-specific virtual address) to primary virtual address
+u32 _VirtualAddress(const u32 addr) {
// Our memory interface read/write functions assume virtual addresses. Put any physical address
// to virtual address translations here. This is obviously quite hacky... But we're not doing
// any MMU emulation yet or anything
if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) {
return VirtualAddressFromPhysical_FCRAM(addr);
+ // Virtual address mapping FW0B
+ } else if ((addr >= FRAM_VADDR_FW0B) && (addr < FRAM_VADDR_FW0B_END)) {
+ return VirtualAddressFromPhysical_FCRAM(addr);
+
// Hardware IO
// TODO(bunnei): FixMe
// This isn't going to work... The physical address of HARDWARE_IO conflicts with the virtual
@@ -41,7 +45,7 @@ inline void _Read(T &var, const u32 addr) {
// TODO: Make sure this represents the mirrors in a correct way.
// Could just do a base-relative read, too.... TODO
- const u32 vaddr = _AddressPhysicalToVirtual(addr);
+ const u32 vaddr = _VirtualAddress(addr);
// Memory allocated for HLE use that can be addressed from the emulated application
// The primary use of this is sharing a commandbuffer between the HLE OS (syscore) and the LLE
@@ -77,7 +81,7 @@ inline void _Read(T &var, const u32 addr) {
template <typename T>
inline void _Write(u32 addr, const T data) {
- u32 vaddr = _AddressPhysicalToVirtual(addr);
+ u32 vaddr = _VirtualAddress(addr);
// Memory allocated for HLE use that can be addressed from the emulated application
// The primary use of this is sharing a commandbuffer between the HLE OS (syscore) and the LLE
@@ -121,7 +125,7 @@ inline void _Write(u32 addr, const T data) {
}
u8 *GetPointer(const u32 addr) {
- const u32 vaddr = _AddressPhysicalToVirtual(addr);
+ const u32 vaddr = _VirtualAddress(addr);
// FCRAM - GSP heap
if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) {