summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-06-05 06:26:48 +0200
committerbunnei <ericbunnie@gmail.com>2014-06-05 06:26:48 +0200
commit174cc9a0ed023ca89420fbc999ed82337cc94b8b (patch)
tree77880fcb4200aea1921919dc850f1f90897a9657
parentarm: fixed a bug where ARM_Interpreter::ExecuteInstructions was actually executing one more instruction than expected (diff)
downloadyuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.gz
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.bz2
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.lz
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.xz
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.zst
yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/hle/hle.cpp3
-rw-r--r--src/core/hle/hle.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 070f92ed5..0500394b3 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -13,6 +13,7 @@
#include "core/arm/disassembler/arm_disasm.h"
#include "core/arm/interpreter/arm_interpreter.h"
+#include "core/hle/hle.h"
#include "core/hle/kernel/thread.h"
namespace Core {
@@ -36,7 +37,7 @@ void SingleStep() {
g_app_core->Step();
- if (ticks >= LCD::kFrameTicks / 2) {
+ if ((ticks >= LCD::kFrameTicks / 2) || HLE::g_reschedule) {
HW::Update();
Kernel::Reschedule();
ticks = 0;
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index 08b0685c9..e49395f56 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -16,6 +16,8 @@ namespace HLE {
static std::vector<ModuleDef> g_module_db;
+bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread
+
const FunctionDef* GetSVCInfo(u32 opcode) {
u32 func_num = opcode & 0xFFFFFF; // 8 bits
if (func_num > 0xFF) {
@@ -47,6 +49,7 @@ void Reschedule(const char *reason) {
_dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
#endif
Core::g_app_core->PrepareReschedule();
+ g_reschedule = true;
}
void RegisterModule(std::string name, int num_functions, const FunctionDef* func_table) {
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h
index 9bc4bfd2c..8a59020c2 100644
--- a/src/core/hle/hle.h
+++ b/src/core/hle/hle.h
@@ -16,6 +16,8 @@
namespace HLE {
+extern bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread
+
typedef u32 Addr;
typedef void (*Func)();