summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-11-03 21:21:54 +0100
committerCharles Lombardo <clombardo169@gmail.com>2023-11-03 21:21:54 +0100
commit4b321c003caed15a23d6f221da871980ceed72c2 (patch)
treeac354f142cc41c7c257d7b617515ad88b8548ceb /src
parentMerge pull request #11953 from t895/surface-tweak (diff)
downloadyuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar.gz
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar.bz2
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar.lz
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar.xz
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.tar.zst
yuzu-4b321c003caed15a23d6f221da871980ceed72c2.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/arm64/native_clock.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/common/arm64/native_clock.cpp b/src/common/arm64/native_clock.cpp
index 88fdba527..f437d7187 100644
--- a/src/common/arm64/native_clock.cpp
+++ b/src/common/arm64/native_clock.cpp
@@ -1,6 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#ifdef ANDROID
+#include <sys/system_properties.h>
+#endif
#include "common/arm64/native_clock.h"
namespace Common::Arm64 {
@@ -65,7 +68,23 @@ bool NativeClock::IsNative() const {
u64 NativeClock::GetHostCNTFRQ() {
u64 cntfrq_el0 = 0;
- asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0));
+ std::string_view board{""};
+#ifdef ANDROID
+ char buffer[PROP_VALUE_MAX];
+ int len{__system_property_get("ro.product.board", buffer)};
+ board = std::string_view(buffer, static_cast<size_t>(len));
+#endif
+ if (board == "s5e9925") { // Exynos 2200
+ cntfrq_el0 = 25600000;
+ } else if (board == "exynos2100") { // Exynos 2100
+ cntfrq_el0 = 26000000;
+ } else if (board == "exynos9810") { // Exynos 9810
+ cntfrq_el0 = 26000000;
+ } else if (board == "s5e8825") { // Exynos 1280
+ cntfrq_el0 = 26000000;
+ } else {
+ asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0));
+ }
return cntfrq_el0;
}