aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/Loaders/Executable.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-03-10 20:39:16 -0300
committergdkchan <gab.dark.100@gmail.com>2018-03-10 20:39:16 -0300
commit3777fb44cf03d05fdedee00f1a19d30fac73b31b (patch)
tree315dc98309bc19c05ee6ac79d1648ddfa2a87964 /Ryujinx.Core/Loaders/Executable.cs
parent553f6c2976818b3abcd0fd09de582dc71f03736e (diff)
Allow to enable/disable memory checks even on release mode through the flag, return error for invalid addresses on SvcMap*Memory svcs, do not return error on SvcQueryMemory (instead, return reserved for the end of the address space), other minor tweaks
Diffstat (limited to 'Ryujinx.Core/Loaders/Executable.cs')
-rw-r--r--Ryujinx.Core/Loaders/Executable.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/Ryujinx.Core/Loaders/Executable.cs b/Ryujinx.Core/Loaders/Executable.cs
index fa204460..943b8e51 100644
--- a/Ryujinx.Core/Loaders/Executable.cs
+++ b/Ryujinx.Core/Loaders/Executable.cs
@@ -34,7 +34,7 @@ namespace Ryujinx.Core.Loaders
if (Exe.Mod0Offset == 0)
{
- int BssOffset = Exe.DataOffset + Exe.Data.Count;
+ int BssOffset = Exe.DataOffset + Exe.Data.Length;
int BssSize = Exe.BssSize;
MapBss(ImageBase + BssOffset, BssSize);
@@ -92,18 +92,15 @@ namespace Ryujinx.Core.Loaders
private void WriteData(
long Position,
- IList<byte> Data,
+ byte[] Data,
MemoryType Type,
AMemoryPerm Perm)
{
- Memory.Manager.Map(Position, Data.Count, (int)Type, AMemoryPerm.Write);
+ Memory.Manager.Map(Position, Data.Length, (int)Type, AMemoryPerm.Write);
- for (int Index = 0; Index < Data.Count; Index++)
- {
- Memory.WriteByte(Position + Index, Data[Index]);
- }
+ AMemoryHelper.WriteBytes(Memory, Position, Data);
- Memory.Manager.Reprotect(Position, Data.Count, Perm);
+ Memory.Manager.Reprotect(Position, Data.Length, Perm);
}
private void MapBss(long Position, long Size)