Index: code/q3_ui/ui_main.c =================================================================== --- code/q3_ui/ui_main.c (revision 670) +++ code/q3_ui/ui_main.c (working copy) @@ -40,7 +40,7 @@ This must be the very first function compiled into the .qvm file ================ */ -intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) { +intptr_t vmMain( long command, long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long arg8, long arg9, long arg10, long arg11 ) { switch ( command ) { case UI_GETAPIVERSION: return UI_API_VERSION; Index: code/unix/unix_main.c =================================================================== --- code/unix/unix_main.c (revision 670) +++ code/unix/unix_main.c (working copy) @@ -766,11 +766,11 @@ } void *Sys_LoadDll( const char *name, char *fqpath , - intptr_t (**entryPoint)(int, ...), - intptr_t (*systemcalls)(intptr_t, ...) ) + long (**entryPoint)(long, ...), + long (*systemcalls)(long, ...) ) { void *libHandle; - void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) ); + void (*dllEntry)( long (*syscallptr)(long, ...) ); char curpath[MAX_OSPATH]; char fname[MAX_OSPATH]; char *basepath; Index: code/win32/win_qgl.c =================================================================== --- code/win32/win_qgl.c (revision 670) +++ code/win32/win_qgl.c (working copy) @@ -3227,7 +3227,7 @@ } #ifdef _MSC_VER -# pragma warning (disable : 4113 4133 4047 ) +# pragma warning (disable : 4113 4133 4047 4090) # define GPA( a ) GetProcAddress( glw_state.hinstOpenGL, a ) #else # define GPA( a ) (void *)GetProcAddress( glw_state.hinstOpenGL, a ) Index: code/win32/win_main.c =================================================================== --- code/win32/win_main.c (revision 670) +++ code/win32/win_main.c (working copy) @@ -33,6 +33,12 @@ #include #include +#ifdef _MSC_VER +#define open _open +#define close _close +#define write _write +#endif + #define CD_BASEDIR "quake3" #define CD_EXE "quake3.exe" #define CD_BASEDIR_LINUX "bin\\x86\\glibc-2.1" @@ -526,10 +532,10 @@ // fqpath param added 7/20/02 by T.Ray - Sys_LoadDll is only called in vm.c at this time // fqpath will be empty if dll not loaded, otherwise will hold fully qualified path of dll module loaded // fqpath buffersize must be at least MAX_QPATH+1 bytes long -void * QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(intptr_t, ...), - intptr_t (QDECL *systemcalls)(intptr_t, ...) ) { +void * QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(long, ...), + intptr_t (QDECL *systemcalls)(long, ...) ) { HINSTANCE libHandle; - void (QDECL *dllEntry)( intptr_t (QDECL *syscallptr)(intptr_t, ...) ); + void (QDECL *dllEntry)( intptr_t (QDECL *syscallptr)(long, ...) ); char *basepath; char *cdpath; char *gamedir; @@ -606,8 +612,8 @@ } #endif - dllEntry = ( void (QDECL *)(intptr_t (QDECL *)( intptr_t, ... ) ) )GetProcAddress( libHandle, "dllEntry" ); - *entryPoint = (intptr_t (QDECL *)(intptr_t,...))GetProcAddress( libHandle, "vmMain" ); + dllEntry = ( void (QDECL *)(intptr_t (QDECL *)( long, ... ) ) )GetProcAddress( libHandle, "dllEntry" ); + *entryPoint = (intptr_t (QDECL *)(long,...))GetProcAddress( libHandle, "vmMain" ); if ( !*entryPoint || !dllEntry ) { FreeLibrary( libHandle ); return NULL; @@ -1089,8 +1095,8 @@ } // save out a couple things in rom cvars for the renderer to access - Cvar_Get( "win_hinstance", va("%i", (int)g_wv.hInstance), CVAR_ROM ); - Cvar_Get( "win_wndproc", va("%i", (int)MainWndProc), CVAR_ROM ); + Cvar_Get( "win_hinstance", va("%i", (intptr_t)g_wv.hInstance), CVAR_ROM ); + Cvar_Get( "win_wndproc", va("%i", (intptr_t)MainWndProc), CVAR_ROM ); // // figure out our CPU @@ -1126,6 +1132,9 @@ case CPUID_AMD_3DNOW: Cvar_Set( "sys_cpustring", "AMD w/ 3DNow!" ); break; + case CPUID_AMD64_EM64T: + Cvar_Set( "sys_cpustring", "x86_64 (AMD64, Intel EM64T)" ); + break; case CPUID_AXP: Cvar_Set( "sys_cpustring", "Alpha AXP" ); break; Index: code/win32/win_input.c =================================================================== --- code/win32/win_input.c (revision 670) +++ code/win32/win_input.c (working copy) @@ -1126,8 +1126,8 @@ // if ( midiInOpen( &s_midiInfo.hMidiIn, in_mididevice->integer, - ( unsigned long ) MidiInProc, - ( unsigned long ) NULL, + ( DWORD_PTR ) MidiInProc, + ( DWORD_PTR ) NULL, CALLBACK_FUNCTION ) != MMSYSERR_NOERROR ) { Com_Printf( "WARNING: could not open MIDI device %d: '%s'\n", in_mididevice->integer , s_midiInfo.caps[( int ) in_mididevice->value] ); Index: code/win32/win_shared.c =================================================================== --- code/win32/win_shared.c (revision 670) +++ code/win32/win_shared.c (working copy) @@ -33,6 +33,14 @@ #include #include +#ifdef _MSC_VER +#pragma warning ( push ) +#pragma warning ( disable : 4748 ) +#ifdef _M_X64 +#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) +#endif +#endif + /* ================ Sys_Milliseconds @@ -59,12 +67,25 @@ Sys_SnapVector ================ */ + void Sys_SnapVector( float *v ) { int i; float f; - +#if defined _M_X64 f = *v; + i = round(f); + *v = i; + v++; + f = *v; + i = round(f); + *v = i; + v++; + f = *v; + i = round(f); + *v = i; +#elif defined _M_X86 + f = *v; __asm fld f; __asm fistp i; *v = i; @@ -78,6 +99,7 @@ __asm fld f; __asm fistp i; *v = i; +#endif } #endif @@ -101,6 +123,8 @@ ** ** -------------------------------------------------------------------------------- */ + +#ifndef _M_X64 static void CPUID( int func, unsigned regs[4] ) { unsigned regEAX, regEBX, regECX, regEDX; @@ -217,10 +241,13 @@ return qtrue; return qfalse; } +#endif int Sys_GetProcessorId( void ) { -#if defined _M_ALPHA +#if defined _M_X64 + return CPUID_AMD64_EM64T; +#elif defined _M_ALPHA return CPUID_AXP; #elif !defined _M_IX86 return CPUID_GENERIC; @@ -293,3 +320,6 @@ return Sys_Cwd(); } +#ifdef _MSC_VER +#pragma warning ( pop ) +#endif \ No newline at end of file