aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ARMJIT_Memory.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ARMJIT_Memory.cpp b/src/ARMJIT_Memory.cpp
index 5a011f3..063437e 100644
--- a/src/ARMJIT_Memory.cpp
+++ b/src/ARMJIT_Memory.cpp
@@ -713,9 +713,15 @@ void Init()
MemoryBase = (u8*)VirtualAlloc(NULL, AddrSpaceSize*4, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(MemoryBase, 0, MEM_RELEASE);
- FastMem9Start = MemoryBase;
- FastMem7Start = MemoryBase + AddrSpaceSize;
- MemoryBase = MemoryBase + AddrSpaceSize*2;
+ // this is incredible hacky
+ // but someone else is trying to go into our address space!
+ // Windows will very likely give them virtual memory starting at the same address
+ // as it is giving us now.
+ // That's why we don't use this address, but instead 4gb inwards
+ // I know this is terrible
+ FastMem9Start = MemoryBase + AddrSpaceSize;
+ FastMem7Start = MemoryBase + AddrSpaceSize*2;
+ MemoryBase = MemoryBase + AddrSpaceSize*3;
MapViewOfFileEx(MemoryFile, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, MemoryTotalSize, MemoryBase);