summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-20 17:36:01 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:53 +0200
commit87c49aa7be4b7277f8ae929058633827d339a052 (patch)
tree4ecd25f5570a7e86349b076eb67006d515deefd8
parentSingleCore: Move Host Timing from a sepparate thread to main cpu thread. (diff)
downloadyuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar.gz
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar.bz2
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar.lz
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar.xz
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.tar.zst
yuzu-87c49aa7be4b7277f8ae929058633827d339a052.zip
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp11
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.cpp12
-rw-r--r--src/core/hle/kernel/svc.cpp2
3 files changed, 20 insertions, 5 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index 618f02f30..c8a1ce6e7 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -72,17 +72,23 @@ public:
}
void AddTicks(u64 ticks) override {
- /// We are using host timing, NOP
+ this->ticks -= ticks;
}
+
u64 GetTicksRemaining() override {
if (!parent.interrupt_handler.IsInterrupted()) {
- return 1000ULL;
+ return std::max<s64>(ticks, 0);
}
return 0ULL;
}
+ void ResetTicks() {
+ ticks = 1000LL;
+ }
+
ARM_Dynarmic_32& parent;
std::size_t num_interpreted_instructions{};
+ s64 ticks{};
};
std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& page_table,
@@ -97,6 +103,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable&
}
void ARM_Dynarmic_32::Run() {
+ cb->ResetTicks();
jit->Run();
}
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
index 2e664cfa8..547a6e07e 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
@@ -124,22 +124,29 @@ public:
}
void AddTicks(u64 ticks) override {
- /// We are using host timing, NOP
+ this->ticks -= ticks;
}
+
u64 GetTicksRemaining() override {
if (!parent.interrupt_handler.IsInterrupted()) {
- return 1000ULL;
+ return std::max<s64>(ticks, 0);
}
return 0ULL;
}
+
u64 GetCNTPCT() override {
return parent.system.CoreTiming().GetClockTicks();
}
+ void ResetTicks() {
+ ticks = 1000LL;
+ }
+
ARM_Dynarmic_64& parent;
std::size_t num_interpreted_instructions = 0;
u64 tpidrro_el0 = 0;
u64 tpidr_el0 = 0;
+ s64 ticks{};
};
std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& page_table,
@@ -181,6 +188,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable&
}
void ARM_Dynarmic_64::Run() {
+ cb->ResetTicks();
jit->Run();
}
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 36e9c48f9..f08745226 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -342,7 +342,7 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) {
thread->InvokeHLECallback(SharedFrom(thread));
}
- return RESULT_SUCCESS;
+ return thread->GetSignalingResult();
}
static ResultCode SendSyncRequest32(Core::System& system, Handle handle) {