Reduce contiguous memory space requirement in 32-bit mode slightly. Could help some people who get the error message.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-07-14 19:02:05 +00:00
parent e0d8d0a001
commit 8248a8d137
3 changed files with 7 additions and 2 deletions

View File

@ -104,7 +104,8 @@ u64 MemArena::Find4GBBase()
{ {
#ifdef _M_X64 #ifdef _M_X64
#ifdef _WIN32 #ifdef _WIN32
u8* base = (u8*)VirtualAlloc(0, 0x100000000, MEM_RESERVE, PAGE_READWRITE); // The highest thing in any 1GB section of memory space is the locked cache. We only need to fit it.
u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(base, 0, MEM_RELEASE); VirtualFree(base, 0, MEM_RELEASE);
return((u64)base); return((u64)base);

View File

@ -470,7 +470,10 @@ bool Init()
// Do a poor mans version - just grab 1GB, possibly discontiguous, and use &0x3FFFFFFF as the mask whenever it is accessed. // Do a poor mans version - just grab 1GB, possibly discontiguous, and use &0x3FFFFFFF as the mask whenever it is accessed.
base = (u8*)MemArena::Find4GBBase(); base = (u8*)MemArena::Find4GBBase();
if (!base) { if (!base) {
PanicAlert("Failed to grab 1 GB of contiguous memory!"); PanicAlert("Failed to grab 1 GB of contiguous memory!\nDo you have an antivirus program or any other program\n"
"that injects itself into every process, consuming address space?\nOr simply a bad graphics driver?\n\n"
"Dolphin will handle this better in the future by falling back to slow memory emulation.\n"
"For now, sorry, but it won't work. Try the 64-bit build if you can.");
} }
position = 0; position = 0;
m_pPhysicalRAM = (u8*)g_arena.CreateViewAt(position, RAM_SIZE, base + (0x00000000 & MEMVIEW32_MASK)); m_pPhysicalRAM = (u8*)g_arena.CreateViewAt(position, RAM_SIZE, base + (0x00000000 & MEMVIEW32_MASK));

View File

@ -569,6 +569,7 @@ namespace Jit64
MOV(16, R(EAX), MComplex(RBX, gpr.R(inst.RA).GetSimpleReg(), 1, offset)); MOV(16, R(EAX), MComplex(RBX, gpr.R(inst.RA).GetSimpleReg(), 1, offset));
MOV(32, M(&temp64), R(EAX)); MOV(32, M(&temp64), R(EAX));
MOVD_xmm(XMM0, M(&temp64)); MOVD_xmm(XMM0, M(&temp64));
// SSE4 optimization opportunity here.
PXOR(XMM1, R(XMM1)); PXOR(XMM1, R(XMM1));
PUNPCKLBW(XMM0, R(XMM1)); PUNPCKLBW(XMM0, R(XMM1));
PUNPCKLWD(XMM0, R(XMM1)); PUNPCKLWD(XMM0, R(XMM1));