diff options
| author | bunnei <bunneidev@gmail.com> | 2018-11-18 19:23:38 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-18 19:23:38 -0800 |
| commit | e34d47e6e36f5c99211d0382eded6dbb78ed805e (patch) | |
| tree | 262bc94da150ef3b2995d72671ac075c2053ef4f /src/core/hle/service/ns/pl_u.cpp | |
| parent | f08b4cbbc889b09aa628f586018f1119b3cbd7ce (diff) | |
| parent | 51af996854ce01da17750b0a1f8d2f3a95449cfc (diff) | |
Merge pull request #1620 from DarkLordZach/ldr-ro
ldr_ro: Complete LDR:RO implementation
Diffstat (limited to 'src/core/hle/service/ns/pl_u.cpp')
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 44accecb7..1066bf505 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -351,6 +351,14 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) { font_sizes.push_back(region.size); } + // Resize buffers if game requests smaller size output. + font_codes.resize( + std::min<std::size_t>(font_codes.size(), ctx.GetWriteBufferSize(0) / sizeof(u32))); + font_offsets.resize( + std::min<std::size_t>(font_offsets.size(), ctx.GetWriteBufferSize(1) / sizeof(u32))); + font_sizes.resize( + std::min<std::size_t>(font_sizes.size(), ctx.GetWriteBufferSize(2) / sizeof(u32))); + ctx.WriteBuffer(font_codes, 0); ctx.WriteBuffer(font_offsets, 1); ctx.WriteBuffer(font_sizes, 2); |
