Mostly cleanup and some better crash messages. Also enabled partial block linking (see JitCache.cpp), should give a small speedup but may cause problems, please report!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@12 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-07-16 20:50:16 +00:00
parent cb5072c3e4
commit ea934759e1
28 changed files with 419 additions and 344 deletions

View File

@ -69,7 +69,9 @@ typedef signed __int16 s16;
typedef signed __int8 s8;
#define GC_ALIGNED16(x) __declspec(align(16)) x
#define GC_ALIGNED64(x) __declspec(align(64)) x
#define GC_ALIGNED16_DECL(x) __declspec(align(16)) x
#define GC_ALIGNED64_DECL(x) __declspec(align(64)) x
#else

View File

@ -0,0 +1,11 @@
#include "Common.h"
#include "FileUtil.h"
bool File::Exists(const std::string &filename)
{
#ifdef _WIN32
return GetFileAttributes(filename.c_str()) != INVALID_FILE_ATTRIBUTES;
#else
return true; //TODO
#endif
}

View File

@ -0,0 +1,12 @@
#ifndef _FILEUTIL_H
#define _FILEUTIL_H
#include <string>
class File
{
public:
static bool Exists(const std::string &filename);
};
#endif

View File

@ -104,11 +104,10 @@ u64 MemArena::Find4GBBase()
{
#ifdef _M_X64
#ifdef _WIN32
// The highest thing in any 1GB section of memory space is the locked cache. We only need to fit it.
// 64 bit
u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(base, 0, MEM_RELEASE);
return((u64)base);
#else
// Very precarious - mmap cannot return an error when trying to map already used pages.
// This makes the Windows approach above unusable on Linux, so we will simply pray...
@ -116,12 +115,13 @@ u64 MemArena::Find4GBBase()
#endif
#else
// Only grab a bit less than 1GB
// 32 bit
// 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, 0x31000000, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(base, 0, MEM_RELEASE);
if (base) {
VirtualFree(base, 0, MEM_RELEASE);
}
return((u64)base);
#endif
}