Game Development Community

cpu detect bug

by Ace · in Torque Game Engine · 10/08/2001 (5:09 pm) · 4 replies

this is probaly trvial but i just got a new 1.7 p4

and this is what the console says

Processor Init:
Intel (unknown), 1700 Mhz

on other restarts ive see the 1700 Mhz decrease

is there a way to fix it so it knows the cumputer is a p4?

#1
10/08/2001 (9:11 pm)
Not sure if this is right, and I can't test it, but try this:

Open up engine/platform.h, line 149. Change enum to the following:
enum ProcessorType
{  // x86
   CPU_X86Compatible,
   CPU_Intel_Unknown,
   CPU_Intel_Pentium,
   CPU_Intel_PentiumII,
   CPU_Intel_PentiumIII,
   CPU_Intel_PentiumIV,
   CPU_AMD_K6,
   CPU_AMD_K6_2,
   CPU_AMD_K6_3,
   CPU_AMD_K7,
   CPU_AMD_Unknown,
   CPU_Cyrix_6x86,
   CPU_Cyrix_MediaGX,
   CPU_Cyrix_6x86MX,
   CPU_Cyrix_GXm,        // Media GX w/ MMX
   CPU_Cyrix_Unknown,
   // PowerPC
	CPU_PowerPC_603,
	CPU_PowerPC_604,
   CPU_PowerPC_G3,
   CPU_PowerPC_G4
};

Now open up platformWin32/winCPUInfo.cc. On line 138, add the following case to the switch:
case 0xf00:
	Platform::SystemInfo.processor.type = CPU_Intel_PentiumIV;
	Platform::SystemInfo.processor.name = StringTable->insert("Intel Pentium IV");
	break;

That should do it.

(Edit: Fixed tabs. =p)
#2
10/09/2001 (6:29 am)
yup! workes like a charm :) thanks:)
#3
10/09/2001 (12:35 pm)
Just preformed a major update of the CPU detection code. Now properly detects Athlon and Pentium4 CPU's as well as many sub-flavors previously not distinguished.

--Rick
#4
10/09/2001 (1:40 pm)
Cool, Rick. I'd already added in code to detect my Duron...oh well. =)