summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-07-16 20:50:16 +0000
committerhrydgard <hrydgard@gmail.com>2008-07-16 20:50:16 +0000
commitea934759e15c94ad2fa67e76e11f5d469ebfccf4 (patch)
tree43dd6f2fa6a3e747e0d81c602d5490d02b10b087 /Source/Core/Common
parentcb5072c3e4cf66d33d30697984a9179534334b38 (diff)
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
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Common.vcproj10
-rw-r--r--Source/Core/Common/Src/Common.h2
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp11
-rw-r--r--Source/Core/Common/Src/FileUtil.h12
-rw-r--r--Source/Core/Common/Src/MemArena.cpp12
5 files changed, 40 insertions, 7 deletions
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index 02688ff4fe..7344e39587 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="Common"
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
RootNamespace="Common"
@@ -472,6 +472,14 @@
>
</File>
<File
+ RelativePath=".\Src\FileUtil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\FileUtil.h"
+ >
+ </File>
+ <File
RelativePath=".\Src\Hash.cpp"
>
</File>
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index d3f0fa481f..8281703c10 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -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
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
new file mode 100644
index 0000000000..1eb5540486
--- /dev/null
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -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
+} \ No newline at end of file
diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h
new file mode 100644
index 0000000000..b170d45ba7
--- /dev/null
+++ b/Source/Core/Common/Src/FileUtil.h
@@ -0,0 +1,12 @@
+#ifndef _FILEUTIL_H
+#define _FILEUTIL_H
+
+#include <string>
+
+class File
+{
+public:
+ static bool Exists(const std::string &filename);
+};
+
+#endif
diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp
index f577373fdd..4455f99004 100644
--- a/Source/Core/Common/Src/MemArena.cpp
+++ b/Source/Core/Common/Src/MemArena.cpp
@@ -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
}
-
-