diff options
author | bunnei <ericbunnie@gmail.com> | 2014-03-25 15:50:34 +0100 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-03-25 15:50:34 +0100 |
commit | 20807c4d5aad14f45df9944ed0b8c62a05b42143 (patch) | |
tree | a6c78fd0589ec841b57ab6b0c38164023814f962 | |
parent | updated Windows project files to include ELF files (diff) | |
download | yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar.gz yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar.bz2 yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar.lz yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar.xz yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.tar.zst yuzu-20807c4d5aad14f45df9944ed0b8c62a05b42143.zip |
-rw-r--r-- | src/core/src/mem_map.cpp | 2 | ||||
-rw-r--r-- | src/core/src/mem_map.h | 5 | ||||
-rw-r--r-- | src/core/src/mem_map_funcs.cpp | 56 |
3 files changed, 33 insertions, 30 deletions
diff --git a/src/core/src/mem_map.cpp b/src/core/src/mem_map.cpp index eab4051ec..e7b508574 100644 --- a/src/core/src/mem_map.cpp +++ b/src/core/src/mem_map.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013 Citrus Emulator + * Copyright (C) 2014 Citra Emulator * * @file mem_map.cpp * @author ShizZy <shizzy247@gmail.com> diff --git a/src/core/src/mem_map.h b/src/core/src/mem_map.h index 38004042e..48137a19b 100644 --- a/src/core/src/mem_map.h +++ b/src/core/src/mem_map.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013 Citrus Emulator + * Copyright (C) 2014 Citra Emulator * * @file mem_map.h * @author ShizZy <shizzy247@gmail.com> @@ -39,6 +39,7 @@ #define MEM_AXI_WRAM_SIZE 0x00080000 ///< AXI WRAM size #define MEM_FCRAM_SIZE 0x08000000 ///< FCRAM size +#define MEM_VRAM_MASK 0x007FFFFF #define MEM_FCRAM_MASK (MEM_FCRAM_SIZE - 1) ///< FCRAm mask //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -74,6 +75,8 @@ void Write8(const u32 addr, const u32 data); void Write16(const u32 addr, const u32 data); void Write32(const u32 addr, const u32 data); +u8* GetPointer(const u32 Address); + } // namespace //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/src/mem_map_funcs.cpp b/src/core/src/mem_map_funcs.cpp index d1739d726..f00d10f87 100644 --- a/src/core/src/mem_map_funcs.cpp +++ b/src/core/src/mem_map_funcs.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013 Citrus Emulator + * Copyright (C) 2014 Citra Emulator * * @file mem_map_funcs.cpp * @author ShizZy <shizzy247@gmail.com> @@ -28,33 +28,6 @@ namespace Memory { -/* -u8 *GetPointer(const u32 addr) -{ - if ((addr & 0x3E000000) == 0x08000000) { - return g_fcram + (addr & MEM_FCRAM_MASK); - } - else if ((addr & 0x3F800000) == 0x04000000) { - return m_pVRAM + (addr & VRAM_MASK); - } - else if ((addr & 0x3F000000) >= 0x08000000 && (addr & 0x3F000000) < 0x08000000 + g_MemorySize) { - return m_pRAM + (addr & g_MemoryMask); - } - else { - ERROR_LOG(MEMMAP, "Unknown GetPointer %08x PC %08x LR %08x", addr, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]); - static bool reported = false; - if (!reported) { - Reporting::ReportMessage("Unknown GetPointer %08x PC %08x LR %08x", addr, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]); - reported = true; - } - if (!g_Config.bIgnoreBadMemAccess) { - Core_EnableStepping(true); - host->SetDebugMode(true); - } - return 0; - } -}*/ - template <typename T> inline void ReadFromHardware(T &var, const u32 addr) { @@ -125,6 +98,33 @@ bool IsValidAddress(const u32 addr) { } } +u8 *GetPointer(const u32 addr) { + // TODO(bunnei): Just a stub for now... ImplementMe! + if ((addr & 0x3E000000) == 0x08000000) { + return g_fcram + (addr & MEM_FCRAM_MASK); + } + //else if ((addr & 0x3F800000) == 0x04000000) { + // return g_vram + (addr & MEM_VRAM_MASK); + //} + //else if ((addr & 0x3F000000) >= 0x08000000 && (addr & 0x3F000000) < 0x08000000 + g_MemorySize) { + // return m_pRAM + (addr & g_MemoryMask); + //} + else { + //ERROR_LOG(MEMMAP, "Unknown GetPointer %08x PC %08x LR %08x", addr, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]); + ERROR_LOG(MEMMAP, "Unknown GetPointer %08x", addr); + static bool reported = false; + //if (!reported) { + // Reporting::ReportMessage("Unknown GetPointer %08x PC %08x LR %08x", addr, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]); + // reported = true; + //} + //if (!g_Config.bIgnoreBadMemAccess) { + // Core_EnableStepping(true); + // host->SetDebugMode(true); + //} + return 0; + } +} + u8 Read8(const u32 addr) { u8 _var = 0; ReadFromHardware<u8>(_var, addr); |