summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar David2018-05-01 13:28:36 -0700
committerGravatar bunnei2018-05-01 16:28:36 -0400
commitff2f0d980ae613e64a9bc46ec4793b1a033426b3 (patch)
tree337e684389231717c18c7bdd6c0bef85c294f24e /src/core/hle/service
parentMerge pull request #425 from lioncash/namespace (diff)
downloadyuzu-ff2f0d980ae613e64a9bc46ec4793b1a033426b3.tar.gz
yuzu-ff2f0d980ae613e64a9bc46ec4793b1a033426b3.tar.xz
yuzu-ff2f0d980ae613e64a9bc46ec4793b1a033426b3.zip
GetSharedFontInOrderOfPriority (#381)
* GetSharedFontInOrderOfPriority * Update pl_u.cpp * Ability to use ReadBuffer and WriteBuffer with different buffer indexes, fixed up GetSharedFontInOrderOfPriority * switched to NGLOG * Update pl_u.cpp * Update pl_u.cpp * language_code is actually language code and not index * u32->u64 * final cleanups
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/ns/pl_u.cpp27
-rw-r--r--src/core/hle/service/ns/pl_u.h1
2 files changed, 27 insertions, 1 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index c2a647e89..636af9a1e 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -37,7 +37,7 @@ PL_U::PL_U() : ServiceFramework("pl:u") {
37 {2, &PL_U::GetSize, "GetSize"}, 37 {2, &PL_U::GetSize, "GetSize"},
38 {3, &PL_U::GetSharedMemoryAddressOffset, "GetSharedMemoryAddressOffset"}, 38 {3, &PL_U::GetSharedMemoryAddressOffset, "GetSharedMemoryAddressOffset"},
39 {4, &PL_U::GetSharedMemoryNativeHandle, "GetSharedMemoryNativeHandle"}, 39 {4, &PL_U::GetSharedMemoryNativeHandle, "GetSharedMemoryNativeHandle"},
40 {5, nullptr, "GetSharedFontInOrderOfPriority"}, 40 {5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"},
41 }; 41 };
42 RegisterHandlers(functions); 42 RegisterHandlers(functions);
43 43
@@ -116,4 +116,29 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
116 rb.PushCopyObjects(shared_font_mem); 116 rb.PushCopyObjects(shared_font_mem);
117} 117}
118 118
119void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
120 IPC::RequestParser rp{ctx};
121 const u64 language_code{rp.Pop<u64>()}; // TODO(ogniK): Find out what this is used for
122 NGLOG_DEBUG(Service_NS, "called, language_code=%lx", language_code);
123 IPC::ResponseBuilder rb{ctx, 4};
124 std::vector<u32> font_codes;
125 std::vector<u32> font_offsets;
126 std::vector<u32> font_sizes;
127
128 // TODO(ogniK): Have actual priority order
129 for (size_t i = 0; i < SHARED_FONT_REGIONS.size(); i++) {
130 font_codes.push_back(static_cast<u32>(i));
131 font_offsets.push_back(SHARED_FONT_REGIONS[i].offset);
132 font_sizes.push_back(SHARED_FONT_REGIONS[i].size);
133 }
134
135 ctx.WriteBuffer(font_codes.data(), font_codes.size(), 0);
136 ctx.WriteBuffer(font_offsets.data(), font_offsets.size(), 1);
137 ctx.WriteBuffer(font_sizes.data(), font_sizes.size(), 2);
138
139 rb.Push(RESULT_SUCCESS);
140 rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded
141 rb.Push<u32>(static_cast<u32>(font_codes.size()));
142}
143
119} // namespace Service::NS 144} // namespace Service::NS
diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.h
index b175c9c44..fcc2acab7 100644
--- a/src/core/hle/service/ns/pl_u.h
+++ b/src/core/hle/service/ns/pl_u.h
@@ -21,6 +21,7 @@ private:
21 void GetSize(Kernel::HLERequestContext& ctx); 21 void GetSize(Kernel::HLERequestContext& ctx);
22 void GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx); 22 void GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx);
23 void GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx); 23 void GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx);
24 void GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx);
24 25
25 /// Handle to shared memory region designated for a shared font 26 /// Handle to shared memory region designated for a shared font
26 Kernel::SharedPtr<Kernel::SharedMemory> shared_font_mem; 27 Kernel::SharedPtr<Kernel::SharedMemory> shared_font_mem;