diff options
| author | magumagu <magumagu9@gmail.com> | 2015-02-16 19:13:14 -0800 |
|---|---|---|
| committer | magumagu <magumagu9@gmail.com> | 2015-02-16 19:13:14 -0800 |
| commit | 77a0bfdd8f2b65d50709fe99718d6587eccf3729 (patch) | |
| tree | de27a72edbb21e9c16d2e5d09f67aa0f0b158d04 /Source/Core | |
| parent | 5b6a947e8ff8256ed5253d39a806d4d3ca47b31d (diff) | |
| parent | 001bf9152ea513649518a14293406d2b2eb57b3c (diff) | |
Merge pull request #2055 from magumagu/fakevmem-code
Allow executing code out of FakeVMEM.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/MMU.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/MMU.cpp b/Source/Core/Core/PowerPC/MMU.cpp index 657d7cfa15..718f93e45c 100644 --- a/Source/Core/Core/PowerPC/MMU.cpp +++ b/Source/Core/Core/PowerPC/MMU.cpp @@ -397,11 +397,22 @@ TryReadInstResult TryReadInstruction(u32 address) { int segment = address >> 28; if ((segment == 0x8 || segment == 0x0) && (address & 0x0FFFFFFF) < Memory::REALRAM_SIZE) + { address = address & 0x3FFFFFFF; + } else if (segment == 0x9 && (address & 0x0FFFFFFF) < Memory::EXRAM_SIZE) + { address = address & 0x3FFFFFFF; + } + else if (Memory::bFakeVMEM && (segment == 0x7 || segment == 0x4)) + { + u32 hex = bswap((*(const u32*)&Memory::m_pFakeVMEM[address & Memory::FAKEVMEM_MASK])); + return TryReadInstResult{ true, true, hex }; + } else + { return TryReadInstResult{ false, false, 0 }; + } } } else |
