mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
pl_u: Resize buffers in shared font data getter to what game requests
Fixes unmapped spam in SMP and buffer size errors in some other games
This commit is contained in:
parent
8a537a2021
commit
8aa17f0480
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue