diff options
| author | 2014-04-10 21:30:00 -0400 | |
|---|---|---|
| committer | 2014-04-10 21:30:00 -0400 | |
| commit | 2a7d7ce55d51a1cf893d14e893b87941df4a2f03 (patch) | |
| tree | d9e4d6d2dfe28d0ddc32de6775d79ef002eea62e /src | |
| parent | Merge branch 'master' into hle-interface (diff) | |
| download | yuzu-2a7d7ce55d51a1cf893d14e893b87941df4a2f03.tar.gz yuzu-2a7d7ce55d51a1cf893d14e893b87941df4a2f03.tar.xz yuzu-2a7d7ce55d51a1cf893d14e893b87941df4a2f03.zip | |
- 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.vcxproj | 1 | ||||
| -rw-r--r-- | src/core/core.vcxproj.filters | 3 | ||||
| -rw-r--r-- | src/core/hle.cpp | 33 | ||||
| -rw-r--r-- | src/core/hle/hle.h | 18 | ||||
| -rw-r--r-- | src/core/hle/hle_syscall.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/hle_syscall.h | 4 |
6 files changed, 54 insertions, 15 deletions
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index 55ce508a6..8097a47d3 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj | |||
| @@ -152,6 +152,7 @@ | |||
| 152 | <ClCompile Include="elf\elf_reader.cpp" /> | 152 | <ClCompile Include="elf\elf_reader.cpp" /> |
| 153 | <ClCompile Include="file_sys\directory_file_system.cpp" /> | 153 | <ClCompile Include="file_sys\directory_file_system.cpp" /> |
| 154 | <ClCompile Include="file_sys\meta_file_system.cpp" /> | 154 | <ClCompile Include="file_sys\meta_file_system.cpp" /> |
| 155 | <ClCompile Include="hle.cpp" /> | ||
| 155 | <ClCompile Include="hle\hle_syscall.cpp" /> | 156 | <ClCompile Include="hle\hle_syscall.cpp" /> |
| 156 | <ClCompile Include="hw\hw.cpp" /> | 157 | <ClCompile Include="hw\hw.cpp" /> |
| 157 | <ClCompile Include="hw\hw_lcd.cpp" /> | 158 | <ClCompile Include="hw\hw_lcd.cpp" /> |
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters index 7bac04a2d..79bddf09a 100644 --- a/src/core/core.vcxproj.filters +++ b/src/core/core.vcxproj.filters | |||
| @@ -81,6 +81,9 @@ | |||
| 81 | <ClCompile Include="hle\hle_syscall.cpp"> | 81 | <ClCompile Include="hle\hle_syscall.cpp"> |
| 82 | <Filter>hle</Filter> | 82 | <Filter>hle</Filter> |
| 83 | </ClCompile> | 83 | </ClCompile> |
| 84 | <ClCompile Include="hle.cpp"> | ||
| 85 | <Filter>hle</Filter> | ||
| 86 | </ClCompile> | ||
| 84 | </ItemGroup> | 87 | </ItemGroup> |
| 85 | <ItemGroup> | 88 | <ItemGroup> |
| 86 | <ClInclude Include="arm\disassembler\arm_disasm.h"> | 89 | <ClInclude Include="arm\disassembler\arm_disasm.h"> |
diff --git a/src/core/hle.cpp b/src/core/hle.cpp new file mode 100644 index 000000000..f0c7d2178 --- /dev/null +++ b/src/core/hle.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "core/hle/hle.h" | ||
| 8 | #include "core/hle/hle_syscall.h" | ||
| 9 | |||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 11 | |||
| 12 | namespace HLE { | ||
| 13 | |||
| 14 | static std::vector<HLEModule> g_module_db; | ||
| 15 | |||
| 16 | void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table) { | ||
| 17 | HLEModule module = {name, num_functions, func_table}; | ||
| 18 | g_module_db.push_back(module); | ||
| 19 | } | ||
| 20 | |||
| 21 | void RegisterAllModules() { | ||
| 22 | Register_SysCall(); | ||
| 23 | } | ||
| 24 | |||
| 25 | void Init() { | ||
| 26 | RegisterAllModules(); | ||
| 27 | } | ||
| 28 | |||
| 29 | void Shutdown() { | ||
| 30 | g_module_db.clear(); | ||
| 31 | } | ||
| 32 | |||
| 33 | } // namespace | ||
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index 6780b52c4..6648c787f 100644 --- a/src/core/hle/hle.h +++ b/src/core/hle/hle.h | |||
| @@ -10,13 +10,11 @@ | |||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 11 | 11 | ||
| 12 | typedef void (*HLEFunc)(); | 12 | typedef void (*HLEFunc)(); |
| 13 | typedef void (*SysCallFunc)(); | ||
| 14 | 13 | ||
| 15 | struct HLEFunction { | 14 | struct HLEFunction { |
| 16 | u32 id; | 15 | u32 id; |
| 17 | HLEFunc func; | 16 | HLEFunc func; |
| 18 | const char* name; | 17 | const char* name; |
| 19 | u32 flags; | ||
| 20 | }; | 18 | }; |
| 21 | 19 | ||
| 22 | struct HLEModule { | 20 | struct HLEModule { |
| @@ -25,11 +23,15 @@ struct HLEModule { | |||
| 25 | const HLEFunction* func_table; | 23 | const HLEFunction* func_table; |
| 26 | }; | 24 | }; |
| 27 | 25 | ||
| 28 | struct SysCall { | ||
| 29 | u8 id; | ||
| 30 | SysCallFunc func; | ||
| 31 | const char* name; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #define PARAM(n) Core::g_app_core->GetReg(n) | 26 | #define PARAM(n) Core::g_app_core->GetReg(n) |
| 35 | #define RETURN(n) Core::g_app_core->SetReg(0, n) | 27 | #define RETURN(n) Core::g_app_core->SetReg(0, n) |
| 28 | |||
| 29 | namespace HLE { | ||
| 30 | |||
| 31 | void Init(); | ||
| 32 | |||
| 33 | void Shutdown(); | ||
| 34 | |||
| 35 | void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table); | ||
| 36 | |||
| 37 | } // namespace | ||
diff --git a/src/core/hle/hle_syscall.cpp b/src/core/hle/hle_syscall.cpp index c8a516848..b17a2e220 100644 --- a/src/core/hle/hle_syscall.cpp +++ b/src/core/hle/hle_syscall.cpp | |||
| @@ -7,16 +7,18 @@ | |||
| 7 | 7 | ||
| 8 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 8 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 9 | 9 | ||
| 10 | 10 | typedef u32 Handle; | |
| 11 | typedef s32 Result; | ||
| 11 | 12 | ||
| 12 | Result SVC_ConnectToPort(void* out, const char* port_name) { | 13 | Result SVC_ConnectToPort(void* out, const char* port_name) { |
| 13 | NOTICE_LOG(OSHLE, "SVC_ConnectToPort called, port_name: %s", port_name); | 14 | NOTICE_LOG(OSHLE, "svcConnectToPort called, port_name: %s", port_name); |
| 14 | return 0; | 15 | return 0; |
| 15 | } | 16 | } |
| 16 | 17 | ||
| 17 | const SysCall SysCallTable[] = { | 18 | const HLEFunction SysCallTable[] = { |
| 18 | {0x2D, WrapI_VC<SVC_ConnectToPort>, "svcConnectToPort"}, | 19 | {0x2D, WrapI_VC<SVC_ConnectToPort>, "svcConnectToPort"}, |
| 19 | }; | 20 | }; |
| 20 | 21 | ||
| 21 | void Register_SysCalls() { | 22 | void Register_SysCall() { |
| 23 | HLE::RegisterModule("SysCallTable", ARRAY_SIZE(SysCallTable), SysCallTable); | ||
| 22 | } | 24 | } |
diff --git a/src/core/hle/hle_syscall.h b/src/core/hle/hle_syscall.h index 506dcfc78..643af0bf4 100644 --- a/src/core/hle/hle_syscall.h +++ b/src/core/hle/hle_syscall.h | |||
| @@ -35,8 +35,6 @@ | |||
| 35 | //}; | 35 | //}; |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | typedef u32 Handle; | ||
| 39 | typedef s32 Result; | ||
| 40 | 38 | ||
| 41 | 39 | ||
| 42 | Result ConnectToPort(Handle* out, const char* port_name); | 40 | void Register_SysCall(); |