aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-04-10 21:30:00 -0400
committerGravatar bunnei <ericbunnie@gmail.com>2014-04-10 21:30:00 -0400
commit2a7d7ce55d51a1cf893d14e893b87941df4a2f03 (patch)
treed9e4d6d2dfe28d0ddc32de6775d79ef002eea62e /src
parent95f237a086ec4a9c95f673c96dde72e87eb616c2 (diff)
- removed syscall classes (will just use HLEFunction)
- added hle.cpp and module registration - removed unused code
Diffstat (limited to 'src')
-rw-r--r--src/core/core.vcxproj1
-rw-r--r--src/core/core.vcxproj.filters3
-rw-r--r--src/core/hle.cpp33
-rw-r--r--src/core/hle/hle.h18
-rw-r--r--src/core/hle/hle_syscall.cpp10
-rw-r--r--src/core/hle/hle_syscall.h4
6 files changed, 54 insertions, 15 deletions
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj
index 55ce508a..8097a47d 100644
--- a/src/core/core.vcxproj
+++ b/src/core/core.vcxproj
@@ -152,6 +152,7 @@
<ClCompile Include="elf\elf_reader.cpp" />
<ClCompile Include="file_sys\directory_file_system.cpp" />
<ClCompile Include="file_sys\meta_file_system.cpp" />
+ <ClCompile Include="hle.cpp" />
<ClCompile Include="hle\hle_syscall.cpp" />
<ClCompile Include="hw\hw.cpp" />
<ClCompile Include="hw\hw_lcd.cpp" />
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters
index 7bac04a2..79bddf09 100644
--- a/src/core/core.vcxproj.filters
+++ b/src/core/core.vcxproj.filters
@@ -81,6 +81,9 @@
<ClCompile Include="hle\hle_syscall.cpp">
<Filter>hle</Filter>
</ClCompile>
+ <ClCompile Include="hle.cpp">
+ <Filter>hle</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="arm\disassembler\arm_disasm.h">
diff --git a/src/core/hle.cpp b/src/core/hle.cpp
new file mode 100644
index 00000000..f0c7d217
--- /dev/null
+++ b/src/core/hle.cpp
@@ -0,0 +1,33 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include <vector>
+
+#include "core/hle/hle.h"
+#include "core/hle/hle_syscall.h"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace HLE {
+
+static std::vector<HLEModule> g_module_db;
+
+void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table) {
+ HLEModule module = {name, num_functions, func_table};
+ g_module_db.push_back(module);
+}
+
+void RegisterAllModules() {
+ Register_SysCall();
+}
+
+void Init() {
+ RegisterAllModules();
+}
+
+void Shutdown() {
+ g_module_db.clear();
+}
+
+} // namespace
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h
index 6780b52c..6648c787 100644
--- a/src/core/hle/hle.h
+++ b/src/core/hle/hle.h
@@ -10,13 +10,11 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
typedef void (*HLEFunc)();
-typedef void (*SysCallFunc)();
struct HLEFunction {
u32 id;
HLEFunc func;
const char* name;
- u32 flags;
};
struct HLEModule {
@@ -25,11 +23,15 @@ struct HLEModule {
const HLEFunction* func_table;
};
-struct SysCall {
- u8 id;
- SysCallFunc func;
- const char* name;
-};
-
#define PARAM(n) Core::g_app_core->GetReg(n)
#define RETURN(n) Core::g_app_core->SetReg(0, n)
+
+namespace HLE {
+
+void Init();
+
+void Shutdown();
+
+void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table);
+
+} // namespace
diff --git a/src/core/hle/hle_syscall.cpp b/src/core/hle/hle_syscall.cpp
index c8a51684..b17a2e22 100644
--- a/src/core/hle/hle_syscall.cpp
+++ b/src/core/hle/hle_syscall.cpp
@@ -7,16 +7,18 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
-
+typedef u32 Handle;
+typedef s32 Result;
Result SVC_ConnectToPort(void* out, const char* port_name) {
- NOTICE_LOG(OSHLE, "SVC_ConnectToPort called, port_name: %s", port_name);
+ NOTICE_LOG(OSHLE, "svcConnectToPort called, port_name: %s", port_name);
return 0;
}
-const SysCall SysCallTable[] = {
+const HLEFunction SysCallTable[] = {
{0x2D, WrapI_VC<SVC_ConnectToPort>, "svcConnectToPort"},
};
-void Register_SysCalls() {
+void Register_SysCall() {
+ HLE::RegisterModule("SysCallTable", ARRAY_SIZE(SysCallTable), SysCallTable);
}
diff --git a/src/core/hle/hle_syscall.h b/src/core/hle/hle_syscall.h
index 506dcfc7..643af0bf 100644
--- a/src/core/hle/hle_syscall.h
+++ b/src/core/hle/hle_syscall.h
@@ -35,8 +35,6 @@
//};
-typedef u32 Handle;
-typedef s32 Result;
-Result ConnectToPort(Handle* out, const char* port_name);
+void Register_SysCall();