CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/FakeCPUDetect.cpp
Views: 1401
1
// Copyright (C) 2003 Dolphin Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official SVN repository and contact information can be found at
16
// http://code.google.com/p/dolphin-emu/
17
18
#include "ppsspp_config.h"
19
#if PPSSPP_ARCH(ARM) || PPSSPP_ARCH(ARM64)
20
#define REAL_CPUDETECT_AVAIL 1
21
#elif (PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)) && !defined(__EMSCRIPTEN__)
22
#define REAL_CPUDETECT_AVAIL 1
23
#elif PPSSPP_ARCH(MIPS) || PPSSPP_ARCH(MIPS64)
24
#define REAL_CPUDETECT_AVAIL 1
25
#elif PPSSPP_ARCH(RISCV64)
26
#define REAL_CPUDETECT_AVAIL 1
27
#elif PPSSPP_ARCH(LOONGARCH64)
28
#define REAL_CPUDETECT_AVAIL 1
29
#endif
30
31
#ifndef REAL_CPUDETECT_AVAIL
32
#include <cstdint>
33
#include <cstring>
34
#include <memory>
35
36
#include "Common/CommonTypes.h"
37
#include "CPUDetect.h"
38
#include "StringUtils.h"
39
40
CPUInfo cpu_info;
41
42
CPUInfo::CPUInfo() {
43
Detect();
44
}
45
46
// Detects the various cpu features
47
void CPUInfo::Detect()
48
{
49
memset(this, 0, sizeof(*this));
50
num_cores = 1;
51
strcpy(cpu_string, "Unknown");
52
strcpy(brand_string, "Unknown");
53
54
HTT = false;
55
logical_cpu_count = 2;
56
}
57
58
std::vector<std::string> CPUInfo::Features() {
59
std::vector<std::string> features;
60
return features;
61
}
62
63
// Turn the cpu info into a string we can show
64
std::string CPUInfo::Summarize() {
65
std::string sum;
66
sum = StringFromFormat("%s, %i core", cpu_string, num_cores);
67
68
auto features = Features();
69
for (std::string &feature : features) {
70
sum += ", " + feature;
71
}
72
return sum;
73
}
74
#endif
75
76