From babdcae0631aacd3d01393e893b85de1b895de37 Mon Sep 17 00:00:00 2001 From: JPikachu Date: Wed, 29 Oct 2025 11:01:35 +0000 Subject: [PATCH] hacks for more tests (don't worry I'll make sure not to have this as the final solution) --- src/core/hle/kernel/svc/svc_process_memory.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/hle/kernel/svc/svc_process_memory.cpp b/src/core/hle/kernel/svc/svc_process_memory.cpp index 290ce96a29..35d05853dd 100644 --- a/src/core/hle/kernel/svc/svc_process_memory.cpp +++ b/src/core/hle/kernel/svc/svc_process_memory.cpp @@ -35,10 +35,17 @@ Result SetProcessMemoryPermission(Core::System& system, Handle process_handle, u "called, process_handle={:#X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}", process_handle, address, size, perm); + // Workaround for Skyline 32-bit bug + if (size == 0) { + LOG_DEBUG(Kernel_SVC, "called. size=0, bypassing for now."); + R_RETURN(ResultSuccess); + } + // Validate the address/size. R_UNLESS(Common::IsAligned(address, PageSize), ResultInvalidAddress); R_UNLESS(Common::IsAligned(size, PageSize), ResultInvalidSize); - R_UNLESS(size > 0, ResultInvalidSize); + // Removed for the workaround, temp. (DO NOT MERGE) + // R_UNLESS(size > 0, ResultInvalidSize); R_UNLESS((address < address + size), ResultInvalidCurrentMemory); R_UNLESS(address == static_cast(address), ResultInvalidCurrentMemory); R_UNLESS(size == static_cast(size), ResultInvalidCurrentMemory);