diff options
author | bunnei <ericbunnie@gmail.com> | 2014-06-26 00:15:35 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-06-27 22:58:30 +0200 |
commit | 8b8c8f4c13c8959853aadf931161f2b867158068 (patch) | |
tree | bc7b20495507fdcde69a1ec37d59f3545eca4428 | |
parent | Core: Removed unused directory_file_system and meta_file_system modules. (diff) | |
download | yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar.gz yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar.bz2 yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar.lz yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar.xz yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.tar.zst yuzu-8b8c8f4c13c8959853aadf931161f2b867158068.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/core.vcxproj | 2 | ||||
-rw-r--r-- | src/core/core.vcxproj.filters | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/archive.cpp | 61 | ||||
-rw-r--r-- | src/core/hle/kernel/archive.h | 23 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.h | 1 |
6 files changed, 95 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e534f07c4..204c5d45a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -33,6 +33,7 @@ set(SRCS core.cpp hle/config_mem.cpp hle/coprocessor.cpp hle/svc.cpp + hle/kernel/archive.cpp hle/kernel/event.cpp hle/kernel/kernel.cpp hle/kernel/mutex.cpp @@ -78,6 +79,7 @@ set(HEADERS core.h hle/coprocessor.h hle/hle.h hle/svc.h + hle/kernel/archive.h hle/kernel/kernel.h hle/kernel/mutex.h hle/kernel/thread.h diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index d92825a0e..85ac50818 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj @@ -165,6 +165,7 @@ <ClCompile Include="hle\config_mem.cpp" /> <ClCompile Include="hle\coprocessor.cpp" /> <ClCompile Include="hle\hle.cpp" /> + <ClCompile Include="hle\kernel\archive.cpp" /> <ClCompile Include="hle\kernel\event.cpp" /> <ClCompile Include="hle\kernel\kernel.cpp" /> <ClCompile Include="hle\kernel\mutex.cpp" /> @@ -214,6 +215,7 @@ <ClInclude Include="hle\coprocessor.h" /> <ClInclude Include="hle\function_wrappers.h" /> <ClInclude Include="hle\hle.h" /> + <ClInclude Include="hle\kernel\archive.h" /> <ClInclude Include="hle\kernel\event.h" /> <ClInclude Include="hle\kernel\kernel.h" /> <ClInclude Include="hle\kernel\mutex.h" /> diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters index 8f1751c5d..37c550d56 100644 --- a/src/core/core.vcxproj.filters +++ b/src/core/core.vcxproj.filters @@ -170,6 +170,9 @@ <ClCompile Include="loader\elf.cpp"> <Filter>loader</Filter> </ClCompile> + <ClCompile Include="hle\kernel\archive.cpp"> + <Filter>hle\kernel</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="arm\disassembler\arm_disasm.h"> @@ -302,6 +305,9 @@ <ClInclude Include="loader\elf.h"> <Filter>loader</Filter> </ClInclude> + <ClInclude Include="hle\kernel\archive.h"> + <Filter>hle\kernel</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <Text Include="CMakeLists.txt" /> diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp new file mode 100644 index 000000000..d7351e702 --- /dev/null +++ b/src/core/hle/kernel/archive.cpp @@ -0,0 +1,61 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "common/common_types.h" + +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/archive.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Kernel namespace + +namespace Kernel { + +class Archive : public Object { +public: + const char* GetTypeName() const { return "Archive"; } + const char* GetName() const { return name.c_str(); } + + static Kernel::HandleType GetStaticHandleType() { return HandleType::Archive; } + Kernel::HandleType GetHandleType() const { return HandleType::Archive; } + + std::string name; ///< Name of archive (optional) + + /** + * Wait for kernel object to synchronize + * @param wait Boolean wait set if current thread should wait as a result of sync operation + * @return Result of operation, 0 on success, otherwise error code + */ + Result WaitSynchronization(bool* wait) { + // TODO(bunnei): ImplementMe + ERROR_LOG(OSHLE, "unimplemented function"); + return 0; + } +}; + +/** + * Creates an Archive + * @param name Optional name of Archive + * @param handle Handle to newly created archive object + * @return Newly created Archive object + */ +Archive* CreateArchive(Handle& handle, const std::string& name) { + Archive* archive = new Archive; + handle = Kernel::g_object_pool.Create(archive); + archive->name = name; + return archive; +} + +/** + * Creates an Archive + * @param name Optional name of Archive + * @return Handle to newly created Archive object + */ +Handle CreateArchive(const std::string& name) { + Handle handle; + Archive* archive = CreateArchive(handle, name); + return handle; +} + +} // namespace Kernel diff --git a/src/core/hle/kernel/archive.h b/src/core/hle/kernel/archive.h new file mode 100644 index 000000000..98670f06c --- /dev/null +++ b/src/core/hle/kernel/archive.h @@ -0,0 +1,23 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +#include "core/hle/kernel/kernel.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Kernel namespace + +namespace Kernel { + +/** + * Creates an archive + * @param name Optional name of archive + * @return Handle to newly created archive object + */ +Handle CreateArchive(const std::string& name="Unknown"); + +} // namespace FileSys diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 3f15da0ac..69f4ddd37 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -29,6 +29,7 @@ enum class HandleType : u32 { Arbiter = 9, File = 10, Semaphore = 11, + Archive = 12, }; enum { |