mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-30 14:37:11 +02:00
Fix Mario Kart 8 Crash and SMO Glitching Issues :3
This commit is contained in:
parent
160a58e127
commit
2901f462aa
10 changed files with 28 additions and 137 deletions
|
@ -24,13 +24,13 @@ namespace ARMeilleure.Native
|
|||
public static unsafe void Copy(IntPtr dst, IntPtr src, ulong n) {
|
||||
// When NativeAOT is in use, we can toggle per-thread write protection without worrying about breaking .NET code.
|
||||
|
||||
//pthread_jit_write_protect_np(0);
|
||||
// pthread_jit_write_protect_np(0);
|
||||
|
||||
var srcSpan = new Span<byte>(src.ToPointer(), (int)n);
|
||||
var dstSpan = new Span<byte>(dst.ToPointer(), (int)n);
|
||||
srcSpan.CopyTo(dstSpan);
|
||||
|
||||
//pthread_jit_write_protect_np(1);
|
||||
// pthread_jit_write_protect_np(1);
|
||||
|
||||
// Ensure that the instruction cache for this range is invalidated.
|
||||
sys_icache_invalidate(dst, (IntPtr)n);
|
||||
|
|
|
@ -91,7 +91,15 @@ namespace ARMeilleure.Translation.Cache
|
|||
|
||||
if (OperatingSystem.IsIOS())
|
||||
{
|
||||
Marshal.Copy(code, 0, funcPtr, code.Length);
|
||||
// Marshal.Copy(code, 0, funcPtr, code.Length);
|
||||
unsafe
|
||||
{
|
||||
fixed (byte* codePtr = code)
|
||||
{
|
||||
JitSupportDarwinAot.Copy(funcPtr, (IntPtr)codePtr, (ulong)code.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if (deferProtect)
|
||||
{
|
||||
_deferredRxProtect.Enqueue((funcOffset, code.Length));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue