From 5b4bac440b2e87fa1c570565e25f3c34ca4e6068 Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Tue, 23 Sep 2008 15:59:32 +0000 Subject: [PATCH] - fix for compiling with Intel C++; win port: - add Intel C++ project (fastest builds on Intel CPU). --- desmume/src/GPU_osd.cpp | 4 +- desmume/src/NDSSystem.cpp | 2 +- desmume/src/OGLRender.cpp | 2 +- desmume/src/fat.h | 2 +- desmume/src/matrix.h | 15 +- desmume/src/types.h | 10 +- desmume/src/windows/DeSmuME_Intel.icproj | 679 +++++++++++++++++++++++ 7 files changed, 690 insertions(+), 24 deletions(-) create mode 100644 desmume/src/windows/DeSmuME_Intel.icproj diff --git a/desmume/src/GPU_osd.cpp b/desmume/src/GPU_osd.cpp index f978a45a9..9e0501f70 100644 --- a/desmume/src/GPU_osd.cpp +++ b/desmume/src/GPU_osd.cpp @@ -95,7 +95,7 @@ void INLINE OSDCLASS::printChar(u16 x, u16 y, u8 c) { int i, j; int ofs=c*OSD_FONT_HEIGHT; - unsigned char bits[9]={256, 128, 64, 32, 16, 8, 4, 2, 1}; + unsigned char bits[9]={255, 128, 64, 32, 16, 8, 4, 2, 1}; u8 *dst=screen; dst+=(y*256)+x; @@ -138,7 +138,7 @@ void OSDCLASS::addFixed(u16 x, u16 y, const char *fmt, ...) // memset(msg,0,512); va_start(list,fmt); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) _vsnprintf(msg,511,fmt,list); #else vsnprintf(msg,511,fmt,list); diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 754f451ed..b4c77ceb6 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -573,7 +573,7 @@ typedef struct u32 numimpcol; } bmpimgheader_struct; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) #pragma pack(push, 1) typedef struct { diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 2a88af401..c77bcab4d 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -374,7 +374,7 @@ void Close() //I think this is slower than the regular memcmp.. doesnt make sense to me, but my //asm optimization knowlege is 15 years old.. -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) int memcmp_slow(const void* src, const void* dst, u32 count) { int retval; __asm { diff --git a/desmume/src/fat.h b/desmume/src/fat.h index 49ecb20b8..cdb8890cb 100644 --- a/desmume/src/fat.h +++ b/desmume/src/fat.h @@ -18,7 +18,7 @@ #define EXT_LEN 3 // Boot Sector - must be packed -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) #pragma pack(push, 1) #define DIR_SEP "\\" typedef struct diff --git a/desmume/src/matrix.h b/desmume/src/matrix.h index a104a8c68..f49c484d2 100644 --- a/desmume/src/matrix.h +++ b/desmume/src/matrix.h @@ -25,29 +25,16 @@ extern "C" { -#ifdef SSE2 - #include - #include - //typedef __declspec(align(16)) float gMatrix[4][4]; - //typedef float gMatrix[4][4]; - typedef float gMatrix[16]; -#endif - typedef struct MatrixStack { -#ifdef SSE2 - //gMatrix *matrix; float *matrix; -#else - float *matrix; -#endif int position; int size; } MatrixStack; void MatrixInit (float *matrix); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) #define MATRIXFASTCALL __fastcall #else #define MATRIXFASTCALL diff --git a/desmume/src/types.h b/desmume/src/types.h index ba987e592..0597f2453 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -31,7 +31,7 @@ #define WINAPI #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) #define ALIGN(X) __declspec(align(X)) #elif __GNUC__ #define ALIGN(X) __attribute__ ((aligned (X))) @@ -46,7 +46,7 @@ #define FASTCALL __attribute__((fastcall)) #elif defined (__i386__) #define FASTCALL __attribute__((regparm(3))) -#elif defined _MSC_VER +#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) #define FASTCALL #else #define FASTCALL @@ -54,7 +54,7 @@ #endif #ifndef INLINE -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) #define INLINE _inline #else #define INLINE inline @@ -84,7 +84,7 @@ typedef signed long s64; typedef unsigned char u8; typedef unsigned short u16; typedef unsigned long u32; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) typedef unsigned __int64 u64; #else typedef unsigned long long u64; @@ -94,7 +94,7 @@ typedef unsigned long pointer; typedef signed char s8; typedef signed short s16; typedef signed long s32; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) typedef __int64 s64; #else typedef signed long long s64; diff --git a/desmume/src/windows/DeSmuME_Intel.icproj b/desmume/src/windows/DeSmuME_Intel.icproj new file mode 100644 index 000000000..72ca9d2da --- /dev/null +++ b/desmume/src/windows/DeSmuME_Intel.icproj @@ -0,0 +1,679 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +