diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index bf425a38c7..81d1e914ce 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -85,7 +85,9 @@ #include #include #endif - +#ifdef SDL_PLATFORM_3DS +#include <3ds.h> +#endif #ifdef SDL_PLATFORM_PS2 #include #endif @@ -642,6 +644,15 @@ int SDL_GetNumLogicalCPUCores(void) GetSystemInfo(&info); SDL_NumLogicalCPUCores = info.dwNumberOfProcessors; } +#endif +#ifdef SDL_PLATFORM_3DS + if (SDL_NumLogicalCPUCores <= 0) { + bool isNew3DS = false; + APT_CheckNew3DS(&isNew3DS); + // 1 core is always dedicated to the OS + // Meaning that the New3DS has 3 available core, and the Old3DS only one. + SDL_NumLogicalCPUCores = isNew3DS ? 4 : 2; + } #endif // There has to be at least 1, right? :) if (SDL_NumLogicalCPUCores <= 0) { @@ -1156,6 +1167,12 @@ int SDL_GetSystemRAM(void) } } #endif +#ifdef SDL_PLATFORM_3DS + if (SDL_SystemRAM <= 0) { + // The New3DS has 255MiB, the Old3DS 127MiB + SDL_SystemRAM = (int)(osGetMemRegionSize(MEMREGION_ALL) / (1024 * 1024)); + } +#endif #ifdef SDL_PLATFORM_VITA if (SDL_SystemRAM <= 0) { /* Vita has 512MiB on SoC, that's split into 256MiB(+109MiB in extended memory mode) for app