diff options
Diffstat (limited to 'src/core/hle/hle.cpp')
| -rw-r--r-- | src/core/hle/hle.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index 080c36abf..53cda4a61 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "core/mem_map.h" | 7 | #include "core/mem_map.h" |
| 8 | #include "core/hle/hle.h" | 8 | #include "core/hle/hle.h" |
| 9 | #include "core/hle/svc.h" | 9 | #include "core/hle/svc.h" |
| 10 | #include "core/hle/kernel/thread.h" | ||
| 10 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 11 | 12 | ||
| 12 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 13 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -15,11 +16,13 @@ namespace HLE { | |||
| 15 | 16 | ||
| 16 | static std::vector<ModuleDef> g_module_db; | 17 | static std::vector<ModuleDef> g_module_db; |
| 17 | 18 | ||
| 19 | bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread | ||
| 20 | |||
| 18 | const FunctionDef* GetSVCInfo(u32 opcode) { | 21 | const FunctionDef* GetSVCInfo(u32 opcode) { |
| 19 | u32 func_num = opcode & 0xFFFFFF; // 8 bits | 22 | u32 func_num = opcode & 0xFFFFFF; // 8 bits |
| 20 | if (func_num > 0xFF) { | 23 | if (func_num > 0xFF) { |
| 21 | ERROR_LOG(HLE,"Unknown SVC: 0x%02X", func_num); | 24 | ERROR_LOG(HLE,"unknown svc=0x%02X", func_num); |
| 22 | return NULL; | 25 | return nullptr; |
| 23 | } | 26 | } |
| 24 | return &g_module_db[0].func_table[func_num]; | 27 | return &g_module_db[0].func_table[func_num]; |
| 25 | } | 28 | } |
| @@ -33,19 +36,16 @@ void CallSVC(u32 opcode) { | |||
| 33 | if (info->func) { | 36 | if (info->func) { |
| 34 | info->func(); | 37 | info->func(); |
| 35 | } else { | 38 | } else { |
| 36 | ERROR_LOG(HLE, "Unimplemented SVC function %s(..)", info->name.c_str()); | 39 | ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name.c_str()); |
| 37 | } | 40 | } |
| 38 | } | 41 | } |
| 39 | 42 | ||
| 40 | void EatCycles(u32 cycles) { | 43 | void Reschedule(const char *reason) { |
| 41 | // TODO: ImplementMe | ||
| 42 | } | ||
| 43 | |||
| 44 | void ReSchedule(const char *reason) { | ||
| 45 | #ifdef _DEBUG | 44 | #ifdef _DEBUG |
| 46 | _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "ReSchedule: Invalid or too long reason."); | 45 | _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); |
| 47 | #endif | 46 | #endif |
| 48 | // TODO: ImplementMe | 47 | Core::g_app_core->PrepareReschedule(); |
| 48 | g_reschedule = true; | ||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | void RegisterModule(std::string name, int num_functions, const FunctionDef* func_table) { | 51 | void RegisterModule(std::string name, int num_functions, const FunctionDef* func_table) { |