aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT_Memory.cpp
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2021-02-09 23:36:46 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2021-02-09 23:36:46 +0100
commit891427c75c6c617bf61b2e7f2a3f0d79872f7f3c (patch)
tree73a3b2c69277782316d01b203581ee563c2aeef7 /src/ARMJIT_Memory.cpp
parente7ee3b7bc84e583fbfbe7c9896db53d3e808edcc (diff)
fix #994
Diffstat (limited to 'src/ARMJIT_Memory.cpp')
-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);