diff options
author | Chin <chin.bimbo@gmail.com> | 2014-12-20 04:16:34 +0100 |
---|---|---|
committer | Chin <chin.bimbo@gmail.com> | 2014-12-20 16:03:36 +0100 |
commit | e7956926147d2d2ac6741aee8a150466a5438ca3 (patch) | |
tree | 8a06a500c34248c12fff47998131742c4ca72390 /src/core | |
parent | Merge pull request #309 from chinhodado/patch-1 (diff) | |
download | yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar.gz yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar.bz2 yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar.lz yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar.xz yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.tar.zst yuzu-e7956926147d2d2ac6741aee8a150466a5438ca3.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/file_sys/archive_backend.h | 11 | ||||
-rw-r--r-- | src/core/hle/kernel/semaphore.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/kernel/semaphore.h | 2 | ||||
-rw-r--r-- | src/core/loader/3dsx.cpp | 4 |
4 files changed, 16 insertions, 9 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 18c314884..d7959b2ca 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -143,7 +143,16 @@ public: case Char: return std::vector<u8>(string.begin(), string.end()); case Wchar: - return std::vector<u8>(u16str.begin(), u16str.end()); + { + // use two u8 for each character of u16str + std::vector<u8> to_return(u16str.size() * 2); + for (size_t i = 0; i < u16str.size(); ++i) { + u16 tmp_char = u16str.at(i); + to_return[i*2] = (tmp_char & 0xFF00) >> 8; + to_return[i*2 + 1] = (tmp_char & 0x00FF); + } + return to_return; + } case Empty: return {}; default: diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 6f56da8a9..f955d1957 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -20,8 +20,8 @@ public: static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Semaphore; } Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Semaphore; } - u32 max_count; ///< Maximum number of simultaneous holders the semaphore can have - u32 available_count; ///< Number of free slots left in the semaphore + s32 max_count; ///< Maximum number of simultaneous holders the semaphore can have + s32 available_count; ///< Number of free slots left in the semaphore std::queue<Handle> waiting_threads; ///< Threads that are waiting for the semaphore std::string name; ///< Name of semaphore (optional) @@ -49,8 +49,8 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////// -ResultCode CreateSemaphore(Handle* handle, u32 initial_count, - u32 max_count, const std::string& name) { +ResultCode CreateSemaphore(Handle* handle, s32 initial_count, + s32 max_count, const std::string& name) { if (initial_count > max_count) return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h index f0075fdb8..ad474b875 100644 --- a/src/core/hle/kernel/semaphore.h +++ b/src/core/hle/kernel/semaphore.h @@ -18,7 +18,7 @@ namespace Kernel { * @param name Optional name of semaphore * @return ResultCode of the error */ -ResultCode CreateSemaphore(Handle* handle, u32 initial_count, u32 max_count, const std::string& name = "Unknown"); +ResultCode CreateSemaphore(Handle* handle, s32 initial_count, s32 max_count, const std::string& name = "Unknown"); /** * Releases a certain number of slots from a semaphore. diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 0437e5374..3d84fc5da 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -223,9 +223,7 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr) LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str()); FileUtil::IOFile file(filename, "rb"); if (file.IsOpen()) { - - THREEDSXReader reader; - reader.Load3DSXFile(filename, 0x00100000); + THREEDSXReader::Load3DSXFile(filename, 0x00100000); Kernel::LoadExec(0x00100000); } else { return ResultStatus::Error; |