summaryrefslogtreecommitdiff
path: root/src/core/hle/hle.cpp
diff options
context:
space:
mode:
authorGravatar darkf2014-12-29 19:47:41 -0800
committerGravatar darkf2014-12-29 19:47:41 -0800
commit8ba9ac0f74abb0408a26207a76a0c1808bad8de0 (patch)
treef1c7c3393fa726435b5b90bf335567c93e528ef1 /src/core/hle/hle.cpp
parentAdd comment regarding __WIN32__ in SkyEye code (diff)
parentMerge pull request #367 from bunnei/usat_ssat (diff)
downloadyuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.gz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.xz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.zip
Fix merge conflicts
Diffstat (limited to 'src/core/hle/hle.cpp')
-rw-r--r--src/core/hle/hle.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index b8ac186f6..33ac12507 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -1,5 +1,5 @@
1// Copyright 2014 Citra Emulator Project 1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <vector> 5#include <vector>
@@ -8,6 +8,8 @@
8#include "core/hle/hle.h" 8#include "core/hle/hle.h"
9#include "core/hle/kernel/thread.h" 9#include "core/hle/kernel/thread.h"
10#include "core/hle/service/service.h" 10#include "core/hle/service/service.h"
11#include "core/hle/service/fs/archive.h"
12#include "core/hle/service/cfg/cfg.h"
11 13
12//////////////////////////////////////////////////////////////////////////////////////////////////// 14////////////////////////////////////////////////////////////////////////////////////////////////////
13 15
@@ -20,7 +22,7 @@ bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a n
20const FunctionDef* GetSVCInfo(u32 opcode) { 22const FunctionDef* GetSVCInfo(u32 opcode) {
21 u32 func_num = opcode & 0xFFFFFF; // 8 bits 23 u32 func_num = opcode & 0xFFFFFF; // 8 bits
22 if (func_num > 0xFF) { 24 if (func_num > 0xFF) {
23 ERROR_LOG(HLE,"unknown svc=0x%02X", func_num); 25 LOG_ERROR(Kernel_SVC,"unknown svc=0x%02X", func_num);
24 return nullptr; 26 return nullptr;
25 } 27 }
26 return &g_module_db[0].func_table[func_num]; 28 return &g_module_db[0].func_table[func_num];
@@ -35,15 +37,21 @@ void CallSVC(u32 opcode) {
35 if (info->func) { 37 if (info->func) {
36 info->func(); 38 info->func();
37 } else { 39 } else {
38 ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name.c_str()); 40 LOG_ERROR(Kernel_SVC, "unimplemented SVC function %s(..)", info->name.c_str());
39 } 41 }
40} 42}
41 43
42void Reschedule(const char *reason) { 44void Reschedule(const char *reason) {
43#ifdef _DEBUG 45 _dbg_assert_msg_(Kernel, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
44 _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); 46
45#endif 47 // TODO(bunnei): It seems that games depend on some CPU execution time elapsing during HLE
48 // routines. This simulates that time by artificially advancing the number of CPU "ticks".
49 // The value was chosen empirically, it seems to work well enough for everything tested, but
50 // is likely not ideal. We should find a more accurate way to simulate timing with HLE.
51 Core::g_app_core->AddTicks(4000);
52
46 Core::g_app_core->PrepareReschedule(); 53 Core::g_app_core->PrepareReschedule();
54
47 g_reschedule = true; 55 g_reschedule = true;
48} 56}
49 57
@@ -58,18 +66,22 @@ void RegisterAllModules() {
58 66
59void Init() { 67void Init() {
60 Service::Init(); 68 Service::Init();
69 Service::FS::ArchiveInit();
70 Service::CFG::CFGInit();
61 71
62 RegisterAllModules(); 72 RegisterAllModules();
63 73
64 NOTICE_LOG(HLE, "initialized OK"); 74 LOG_DEBUG(Kernel, "initialized OK");
65} 75}
66 76
67void Shutdown() { 77void Shutdown() {
78 Service::CFG::CFGShutdown();
79 Service::FS::ArchiveShutdown();
68 Service::Shutdown(); 80 Service::Shutdown();
69 81
70 g_module_db.clear(); 82 g_module_db.clear();
71 83
72 NOTICE_LOG(HLE, "shutdown OK"); 84 LOG_DEBUG(Kernel, "shutdown OK");
73} 85}
74 86
75} // namespace 87} // namespace