summaryrefslogtreecommitdiff
path: root/src/core/hle/hle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/hle.cpp')
-rw-r--r--src/core/hle/hle.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index aae9a3943..be151665b 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -15,49 +15,6 @@ namespace HLE {
15 15
16static std::vector<ModuleDef> g_module_db; 16static std::vector<ModuleDef> g_module_db;
17 17
18u8* g_command_buffer = NULL; ///< Command buffer used for sharing between appcore and syscore
19
20// Read from memory used by CTROS HLE functions
21template <typename T>
22inline void Read(T &var, const u32 addr) {
23 if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) {
24 var = *((const T*)&g_command_buffer[addr & CMD_BUFFER_MASK]);
25 } else {
26 ERROR_LOG(HLE, "unknown read from address %08X", addr);
27 }
28}
29
30// Write to memory used by CTROS HLE functions
31template <typename T>
32inline void Write(u32 addr, const T data) {
33 if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) {
34 *(T*)&g_command_buffer[addr & CMD_BUFFER_MASK] = data;
35 } else {
36 ERROR_LOG(HLE, "unknown write to address %08X", addr);
37 }
38}
39
40u8 *GetPointer(const u32 addr) {
41 if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) {
42 return g_command_buffer + (addr & CMD_BUFFER_MASK);
43 } else {
44 ERROR_LOG(HLE, "unknown pointer from address %08X", addr);
45 return 0;
46 }
47}
48
49// Explicitly instantiate template functions because we aren't defining this in the header:
50
51template void Read<u64>(u64 &var, const u32 addr);
52template void Read<u32>(u32 &var, const u32 addr);
53template void Read<u16>(u16 &var, const u32 addr);
54template void Read<u8>(u8 &var, const u32 addr);
55
56template void Write<u64>(u32 addr, const u64 data);
57template void Write<u32>(u32 addr, const u32 data);
58template void Write<u16>(u32 addr, const u16 data);
59template void Write<u8>(u32 addr, const u8 data);
60
61const FunctionDef* GetSyscallInfo(u32 opcode) { 18const FunctionDef* GetSyscallInfo(u32 opcode) {
62 u32 func_num = opcode & 0xFFFFFF; // 8 bits 19 u32 func_num = opcode & 0xFFFFFF; // 8 bits
63 if (func_num > 0xFF) { 20 if (func_num > 0xFF) {
@@ -91,8 +48,6 @@ void RegisterAllModules() {
91 48
92void Init() { 49void Init() {
93 Service::Init(); 50 Service::Init();
94
95 g_command_buffer = new u8[CMD_BUFFER_SIZE];
96 51
97 RegisterAllModules(); 52 RegisterAllModules();
98 53
@@ -102,8 +57,6 @@ void Init() {
102void Shutdown() { 57void Shutdown() {
103 Service::Shutdown(); 58 Service::Shutdown();
104 59
105 delete g_command_buffer;
106
107 g_module_db.clear(); 60 g_module_db.clear();
108 61
109 NOTICE_LOG(HLE, "shutdown OK"); 62 NOTICE_LOG(HLE, "shutdown OK");