diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 41a8bb95a..a61c8227f 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -102,6 +102,8 @@ libdesmume_a_SOURCES = \ desmume_config.cpp desmume_config.h \ libretro-common/compat/compat_getopt.c \ libretro-common/file/file_path.c \ + libretro-common/compat/compat_strl.c \ + libretro-common/features/features_cpu.c \ libretro-common/file/retro_dirent.c \ libretro-common/file/retro_stat.c \ libretro-common/rthreads/async_job.c \ diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 018ccda2d..bbc998d0b 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include "utils/decrypt/decrypt.h" #include "utils/decrypt/crc.h" #include "utils/decrypt/header.h" @@ -116,7 +118,8 @@ void Desmume_InitOnce() int NDS_GetCPUCoreCount() { - return getOnlineCores(); + int amount = cpu_features_get_core_amount(); + return amount; } void NDS_SetupDefaultFirmware() diff --git a/desmume/src/utils/task.cpp b/desmume/src/utils/task.cpp index bc51c26b7..b6f22b46e 100644 --- a/desmume/src/utils/task.cpp +++ b/desmume/src/utils/task.cpp @@ -21,36 +21,6 @@ #include "task.h" #include -#ifdef HOST_WINDOWS - #include -#else - #if defined HOST_LINUX - #include - #elif defined HOST_BSD || defined HOST_DARWIN - #include - #endif -#endif // HOST_WINDOWS - -// http://stackoverflow.com/questions/150355/programmatically-find-the-number-of-cores-on-a-machine -int getOnlineCores (void) -{ -#ifdef HOST_WINDOWS - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - return sysinfo.dwNumberOfProcessors; -#elif defined HOST_LINUX - return sysconf(_SC_NPROCESSORS_ONLN); -#elif defined HOST_BSD || defined HOST_DARWIN - int cores; - int mib[4] = { CTL_HW, HW_NCPU, 0, 0 }; - size_t len = sizeof(cores); //don't make this const, i guess sysctl can't take a const * - sysctl(mib, 2, &cores, &len, NULL, 0); - return (cores < 1) ? 1 : cores; -#else - return 1; -#endif -} - class Task::Impl { private: sthread_t* _thread; diff --git a/desmume/src/utils/task.h b/desmume/src/utils/task.h index b5b5f6f46..db8ad5639 100644 --- a/desmume/src/utils/task.h +++ b/desmume/src/utils/task.h @@ -45,6 +45,4 @@ public: }; -int getOnlineCores (void); - #endif diff --git a/desmume/src/windows/DeSmuME.vcxproj b/desmume/src/windows/DeSmuME.vcxproj index 5354571f2..ee30d47d6 100644 --- a/desmume/src/windows/DeSmuME.vcxproj +++ b/desmume/src/windows/DeSmuME.vcxproj @@ -119,6 +119,7 @@ + @@ -368,7 +369,6 @@ - @@ -694,4 +694,4 @@ - \ No newline at end of file +