FIXED: Wrong detection of CPU cores crashes emu.

ADDED: D3D will not use more than 16 cores.
This commit is contained in:
spacy51 2008-03-30 13:26:17 +00:00
parent f4170784b3
commit 97a9be1c7c
2 changed files with 7 additions and 1 deletions

View File

@ -21,7 +21,7 @@
#ifndef NO_D3D
// The number of pixel-filter threads to be created
#define NTHREADS ( theApp.maxCpuCores )
#define NTHREADS ( nThreads )
#pragma comment( lib, "d3d9" )
#pragma comment( lib, "d3dx9" )
@ -114,6 +114,7 @@ private:
bool rectangleFillsScreen;
PFTHREAD_DATA *pfthread_data;
HANDLE *hThreads;
int nThreads;
struct VERTEX {
FLOAT x, y, z, rhw; // screen coordinates
@ -174,6 +175,8 @@ Direct3DDisplay::Direct3DDisplay()
rectangleFillsScreen = false;
pfthread_data = NULL;
hThreads = NULL;
nThreads = theApp.maxCpuCores;
if( nThreads > 16 ) nThreads = 16;
}

View File

@ -2597,6 +2597,9 @@ int VBA::detectCpuCores()
int processor_count = ( CPUInfo[1] & 0x00FF0000 ) >> 16;
// some CPUs probably do not support this instruction properly
if( processor_count < 1 ) processor_count = 1;
return processor_count;
}