diff options
Diffstat (limited to 'src/core/hle/hle.cpp')
| -rw-r--r-- | src/core/hle/hle.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index be151665b..080c36abf 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 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/syscall.h" | 9 | #include "core/hle/svc.h" |
| 10 | #include "core/hle/service/service.h" | 10 | #include "core/hle/service/service.h" |
| 11 | 11 | ||
| 12 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 12 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -15,17 +15,17 @@ namespace HLE { | |||
| 15 | 15 | ||
| 16 | static std::vector<ModuleDef> g_module_db; | 16 | static std::vector<ModuleDef> g_module_db; |
| 17 | 17 | ||
| 18 | const FunctionDef* GetSyscallInfo(u32 opcode) { | 18 | const FunctionDef* GetSVCInfo(u32 opcode) { |
| 19 | u32 func_num = opcode & 0xFFFFFF; // 8 bits | 19 | u32 func_num = opcode & 0xFFFFFF; // 8 bits |
| 20 | if (func_num > 0xFF) { | 20 | if (func_num > 0xFF) { |
| 21 | ERROR_LOG(HLE,"Unknown syscall: 0x%02X", func_num); | 21 | ERROR_LOG(HLE,"Unknown SVC: 0x%02X", func_num); |
| 22 | return NULL; | 22 | return NULL; |
| 23 | } | 23 | } |
| 24 | return &g_module_db[0].func_table[func_num]; | 24 | return &g_module_db[0].func_table[func_num]; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | void CallSyscall(u32 opcode) { | 27 | void CallSVC(u32 opcode) { |
| 28 | const FunctionDef *info = GetSyscallInfo(opcode); | 28 | const FunctionDef *info = GetSVCInfo(opcode); |
| 29 | 29 | ||
| 30 | if (!info) { | 30 | if (!info) { |
| 31 | return; | 31 | return; |
| @@ -33,17 +33,28 @@ void CallSyscall(u32 opcode) { | |||
| 33 | if (info->func) { | 33 | if (info->func) { |
| 34 | info->func(); | 34 | info->func(); |
| 35 | } else { | 35 | } else { |
| 36 | ERROR_LOG(HLE, "Unimplemented SysCall function %s(..)", info->name.c_str()); | 36 | ERROR_LOG(HLE, "Unimplemented SVC function %s(..)", info->name.c_str()); |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void EatCycles(u32 cycles) { | ||
| 41 | // TODO: ImplementMe | ||
| 42 | } | ||
| 43 | |||
| 44 | void ReSchedule(const char *reason) { | ||
| 45 | #ifdef _DEBUG | ||
| 46 | _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "ReSchedule: Invalid or too long reason."); | ||
| 47 | #endif | ||
| 48 | // TODO: ImplementMe | ||
| 49 | } | ||
| 50 | |||
| 40 | 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) { |
| 41 | ModuleDef module = {name, num_functions, func_table}; | 52 | ModuleDef module = {name, num_functions, func_table}; |
| 42 | g_module_db.push_back(module); | 53 | g_module_db.push_back(module); |
| 43 | } | 54 | } |
| 44 | 55 | ||
| 45 | void RegisterAllModules() { | 56 | void RegisterAllModules() { |
| 46 | Syscall::Register(); | 57 | SVC::Register(); |
| 47 | } | 58 | } |
| 48 | 59 | ||
| 49 | void Init() { | 60 | void Init() { |