From d4281b56bf872f37d40df85ddf4658dba4e76a47 Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 21 Dec 2011 22:59:49 +0100 Subject: [PATCH] Get rid of Sys_GetProcessorString() This was only used for a printf() and not implemented for all the platforms we can now run on. We also don't want to force a CPU type on Windows. --- neo/TypeInfo/main.cpp | 1 - neo/renderer/RenderSystem_init.cpp | 1 - neo/sys/linux/main.cpp | 20 -------- neo/sys/osx/DOOMController.mm | 16 ------- neo/sys/sys_local.cpp | 4 -- neo/sys/sys_local.h | 1 - neo/sys/sys_public.h | 2 - neo/sys/win32/win_local.h | 1 - neo/sys/win32/win_main.cpp | 74 ------------------------------ 9 files changed, 120 deletions(-) diff --git a/neo/TypeInfo/main.cpp b/neo/TypeInfo/main.cpp index a9195328..d1ca4bc0 100644 --- a/neo/TypeInfo/main.cpp +++ b/neo/TypeInfo/main.cpp @@ -208,7 +208,6 @@ void idSysLocal::DebugVPrintf( const char *fmt, va_list arg ) {} double idSysLocal::GetClockTicks( void ) { return 0.0; } double idSysLocal::ClockTicksPerSecond( void ) { return 1.0; } int idSysLocal::GetProcessorId( void ) { return 0; } -const char * idSysLocal::GetProcessorString( void ) { return ""; } const char * idSysLocal::FPU_GetState( void ) { return ""; } bool idSysLocal::FPU_StackIsEmpty( void ) { return true; } void idSysLocal::FPU_SetFTZ( bool enable ) {} diff --git a/neo/renderer/RenderSystem_init.cpp b/neo/renderer/RenderSystem_init.cpp index b0c99948..1618f712 100644 --- a/neo/renderer/RenderSystem_init.cpp +++ b/neo/renderer/RenderSystem_init.cpp @@ -1800,7 +1800,6 @@ static void GfxInfo_f( const idCmdArgs &args ) { } else { common->Printf( "N/A\n" ); } - common->Printf( "CPU: %s\n", Sys_GetProcessorString() ); const char *active[2] = { "", " (ACTIVE)" }; common->Printf( "ARB path ENABLED%s\n", active[tr.backEndRenderer == BE_ARB] ); diff --git a/neo/sys/linux/main.cpp b/neo/sys/linux/main.cpp index dab00b7d..6a243dc7 100644 --- a/neo/sys/linux/main.cpp +++ b/neo/sys/linux/main.cpp @@ -153,8 +153,6 @@ void Sys_Shutdown( void ) { Sys_GetProcessorId =============== */ -static char cpustring[13] = "generic\0"; - #if defined(__x86_64__) || defined(__i386__) #if __x86_64__ # define REG_b "rbx" @@ -176,19 +174,10 @@ static char cpustring[13] = "generic\0"; int Sys_GetProcessorId( void ) { int eax, ebx, ecx, edx; int max_std_level, max_ext_level, std_caps=0, ext_caps=0; - union { int i[3]; char c[12]; } vendor; int i = CPUID_GENERIC; cpuid(0, max_std_level, ebx, ecx, edx); - vendor.i[0] = ebx; - vendor.i[1] = edx; - vendor.i[2] = ecx; - - strncpy(cpustring, vendor.c, 12); - cpustring[12] = 0; - - Sys_Printf("Detected '%s' CPU with", cpustring); if (max_std_level >= 1) { cpuid(1, eax, ebx, ecx, std_caps); @@ -249,15 +238,6 @@ int Sys_GetProcessorId( void ) { } #endif -/* -=============== -Sys_GetProcessorString -=============== -*/ -const char *Sys_GetProcessorString( void ) { - return cpustring; -} - /* =============== Sys_FPU_EnableExceptions diff --git a/neo/sys/osx/DOOMController.mm b/neo/sys/osx/DOOMController.mm index f2d81260..4ad4a39c 100644 --- a/neo/sys/osx/DOOMController.mm +++ b/neo/sys/osx/DOOMController.mm @@ -480,22 +480,6 @@ int Sys_GetProcessorId( void ) { return cpuid; } -/* -=============== -Sys_GetProcessorString -=============== -*/ -const char *Sys_GetProcessorString( void ) { -#if defined(__ppc__) - return "ppc CPU with AltiVec extensions"; -#elif defined(__i386__) - return "x86 CPU with MMX/SSE/SSE2/SSE3 extensions"; -#else - #error - return NULL; -#endif -} - /* =============== Sys_FPU_EnableExceptions diff --git a/neo/sys/sys_local.cpp b/neo/sys/sys_local.cpp index 4a47fa1d..09d0cfbc 100644 --- a/neo/sys/sys_local.cpp +++ b/neo/sys/sys_local.cpp @@ -61,10 +61,6 @@ int idSysLocal::GetProcessorId( void ) { return Sys_GetProcessorId(); } -const char *idSysLocal::GetProcessorString( void ) { - return Sys_GetProcessorString(); -} - const char *idSysLocal::FPU_GetState( void ) { return Sys_FPU_GetState(); } diff --git a/neo/sys/sys_local.h b/neo/sys/sys_local.h index c245abad..02c71065 100644 --- a/neo/sys/sys_local.h +++ b/neo/sys/sys_local.h @@ -48,7 +48,6 @@ public: virtual unsigned int GetMilliseconds( void ); virtual int GetProcessorId( void ); - virtual const char * GetProcessorString( void ); virtual const char * FPU_GetState( void ); virtual bool FPU_StackIsEmpty( void ); virtual void FPU_SetFTZ( bool enable ); diff --git a/neo/sys/sys_public.h b/neo/sys/sys_public.h index 49ad389d..86e81667 100644 --- a/neo/sys/sys_public.h +++ b/neo/sys/sys_public.h @@ -147,7 +147,6 @@ unsigned int Sys_Milliseconds( void ); // returns a selection of the CPUID_* flags int Sys_GetProcessorId( void ); -const char * Sys_GetProcessorString( void ); // returns true if the FPU stack is empty bool Sys_FPU_StackIsEmpty( void ); @@ -405,7 +404,6 @@ public: virtual unsigned int GetMilliseconds( void ) = 0; virtual int GetProcessorId( void ) = 0; - virtual const char * GetProcessorString( void ) = 0; virtual const char * FPU_GetState( void ) = 0; virtual bool FPU_StackIsEmpty( void ) = 0; virtual void FPU_SetFTZ( bool enable ) = 0; diff --git a/neo/sys/win32/win_local.h b/neo/sys/win32/win_local.h index 30bcda3b..2d117d39 100644 --- a/neo/sys/win32/win_local.h +++ b/neo/sys/win32/win_local.h @@ -152,7 +152,6 @@ struct Win32Vars_t { // desktop gamma is saved here for restoration at exit static idCVar sys_arch; - static idCVar sys_cpustring; static idCVar in_mouse; static idCVar win_allowAltTab; static idCVar win_notaskkeys; diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index f947794c..8a3a8441 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -53,7 +53,6 @@ If you have questions concerning this license or the applicable additional terms #include idCVar Win32Vars_t::sys_arch( "sys_arch", "", CVAR_SYSTEM | CVAR_INIT, "" ); -idCVar Win32Vars_t::sys_cpustring( "sys_cpustring", "detect", CVAR_SYSTEM | CVAR_INIT, "" ); idCVar Win32Vars_t::in_mouse( "in_mouse", "1", CVAR_SYSTEM | CVAR_BOOL, "enable mouse input" ); idCVar Win32Vars_t::win_allowAltTab( "win_allowAltTab", "0", CVAR_SYSTEM | CVAR_BOOL, "allow Alt-Tab when fullscreen" ); idCVar Win32Vars_t::win_notaskkeys( "win_notaskkeys", "0", CVAR_SYSTEM | CVAR_INTEGER, "disable windows task keys" ); @@ -846,70 +845,6 @@ void Sys_Init( void ) { win32.sys_arch.SetString( "unknown Windows variant" ); } - // - // CPU type - // - if ( !idStr::Icmp( win32.sys_cpustring.GetString(), "detect" ) ) { - idStr string; - - win32.cpuid = Sys_GetCPUId(); - - string.Clear(); - - if ( win32.cpuid & CPUID_UNSUPPORTED ) { - string += "unsupported CPU"; - } else { - string += "CPU"; - } - - string += " with "; - if ( win32.cpuid & CPUID_MMX ) { - string += "MMX & "; - } - if ( win32.cpuid & CPUID_3DNOW ) { - string += "3DNow! & "; - } - if ( win32.cpuid & CPUID_SSE ) { - string += "SSE & "; - } - if ( win32.cpuid & CPUID_SSE2 ) { - string += "SSE2 & "; - } - if ( win32.cpuid & CPUID_SSE3 ) { - string += "SSE3 & "; - } - string.StripTrailing( " & " ); - string.StripTrailing( " with " ); - win32.sys_cpustring.SetString( string ); - } else { - common->Printf( "forcing CPU type to " ); - idLexer src( win32.sys_cpustring.GetString(), idStr::Length( win32.sys_cpustring.GetString() ), "sys_cpustring" ); - idToken token; - - int id = CPUID_NONE; - while( src.ReadToken( &token ) ) { - if ( token.Icmp( "generic" ) == 0 ) { - id |= CPUID_GENERIC; - } else if ( token.Icmp( "mmx" ) == 0 ) { - id |= CPUID_MMX; - } else if ( token.Icmp( "3dnow" ) == 0 ) { - id |= CPUID_3DNOW; - } else if ( token.Icmp( "sse" ) == 0 ) { - id |= CPUID_SSE; - } else if ( token.Icmp( "sse2" ) == 0 ) { - id |= CPUID_SSE2; - } else if ( token.Icmp( "sse3" ) == 0 ) { - id |= CPUID_SSE3; - } - } - if ( id == CPUID_NONE ) { - common->Printf( "WARNING: unknown sys_cpustring '%s'\n", win32.sys_cpustring.GetString() ); - id = CPUID_GENERIC; - } - win32.cpuid = id; - } - - common->Printf( "%s\n", win32.sys_cpustring.GetString() ); common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() ); common->Printf( "%d MB Video Memory\n", Sys_GetVideoRam() ); } @@ -932,15 +867,6 @@ int Sys_GetProcessorId( void ) { return win32.cpuid; } -/* -================ -Sys_GetProcessorString -================ -*/ -const char *Sys_GetProcessorString( void ) { - return win32.sys_cpustring.GetString(); -} - //======================================================================= //#define SET_THREAD_AFFINITY