diff options
| author | 2014-06-05 00:26:48 -0400 | |
|---|---|---|
| committer | 2014-06-05 00:26:48 -0400 | |
| commit | 174cc9a0ed023ca89420fbc999ed82337cc94b8b (patch) | |
| tree | 77880fcb4200aea1921919dc850f1f90897a9657 | |
| parent | arm: fixed a bug where ARM_Interpreter::ExecuteInstructions was actually exec... (diff) | |
| download | yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.gz yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.tar.xz yuzu-174cc9a0ed023ca89420fbc999ed82337cc94b8b.zip | |
hle: added a hokey way to force a thread reschedule during CPU single step mode (as used by the debugger)
| -rw-r--r-- | src/core/core.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/hle.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/hle.h | 2 |
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 @@ | |||
| 13 | #include "core/arm/disassembler/arm_disasm.h" | 13 | #include "core/arm/disassembler/arm_disasm.h" |
| 14 | #include "core/arm/interpreter/arm_interpreter.h" | 14 | #include "core/arm/interpreter/arm_interpreter.h" |
| 15 | 15 | ||
| 16 | #include "core/hle/hle.h" | ||
| 16 | #include "core/hle/kernel/thread.h" | 17 | #include "core/hle/kernel/thread.h" |
| 17 | 18 | ||
| 18 | namespace Core { | 19 | namespace Core { |
| @@ -36,7 +37,7 @@ void SingleStep() { | |||
| 36 | 37 | ||
| 37 | g_app_core->Step(); | 38 | g_app_core->Step(); |
| 38 | 39 | ||
| 39 | if (ticks >= LCD::kFrameTicks / 2) { | 40 | if ((ticks >= LCD::kFrameTicks / 2) || HLE::g_reschedule) { |
| 40 | HW::Update(); | 41 | HW::Update(); |
| 41 | Kernel::Reschedule(); | 42 | Kernel::Reschedule(); |
| 42 | ticks = 0; | 43 | 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 { | |||
| 16 | 16 | ||
| 17 | static std::vector<ModuleDef> g_module_db; | 17 | static std::vector<ModuleDef> g_module_db; |
| 18 | 18 | ||
| 19 | bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread | ||
| 20 | |||
| 19 | const FunctionDef* GetSVCInfo(u32 opcode) { | 21 | const FunctionDef* GetSVCInfo(u32 opcode) { |
| 20 | u32 func_num = opcode & 0xFFFFFF; // 8 bits | 22 | u32 func_num = opcode & 0xFFFFFF; // 8 bits |
| 21 | if (func_num > 0xFF) { | 23 | if (func_num > 0xFF) { |
| @@ -47,6 +49,7 @@ void Reschedule(const char *reason) { | |||
| 47 | _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); | 49 | _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); |
| 48 | #endif | 50 | #endif |
| 49 | Core::g_app_core->PrepareReschedule(); | 51 | Core::g_app_core->PrepareReschedule(); |
| 52 | g_reschedule = true; | ||
| 50 | } | 53 | } |
| 51 | 54 | ||
| 52 | void RegisterModule(std::string name, int num_functions, const FunctionDef* func_table) { | 55 | 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 @@ | |||
| 16 | 16 | ||
| 17 | namespace HLE { | 17 | namespace HLE { |
| 18 | 18 | ||
| 19 | extern bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread | ||
| 20 | |||
| 19 | typedef u32 Addr; | 21 | typedef u32 Addr; |
| 20 | typedef void (*Func)(); | 22 | typedef void (*Func)(); |
| 21 | 23 | ||