Exemplo n.º 1
0
        private static void WriteConfigEntry(
            AMemory Memory,
            ref long Position,
            int Key,
            int Flags   = 0,
            long Value0 = 0,
            long Value1 = 0)
        {
            Memory.WriteInt32(Position + 0x00, Key);
            Memory.WriteInt32(Position + 0x04, Flags);
            Memory.WriteInt64(Position + 0x08, Value0);
            Memory.WriteInt64(Position + 0x10, Value1);

            Position += 0x18;
        }
Exemplo n.º 2
0
        private static void SvcQueryMemory(Switch Ns, ARegisters Registers, AMemory Memory)
        {
            long InfoPtr  = (long)Registers.X0;
            long Position = (long)Registers.X2;

            AMemoryMapInfo MapInfo = Memory.Manager.GetMapInfo(Position);

            MemoryInfo Info = new MemoryInfo(MapInfo);

            Memory.WriteInt64(InfoPtr + 0x00, Info.BaseAddress);
            Memory.WriteInt64(InfoPtr + 0x08, Info.Size);
            Memory.WriteInt32(InfoPtr + 0x10, Info.MemType);
            Memory.WriteInt32(InfoPtr + 0x14, Info.MemAttr);
            Memory.WriteInt32(InfoPtr + 0x18, Info.MemPerm);
            Memory.WriteInt32(InfoPtr + 0x1c, Info.IpcRefCount);
            Memory.WriteInt32(InfoPtr + 0x20, Info.DeviceRefCount);
            Memory.WriteInt32(InfoPtr + 0x24, Info.Padding);

            //TODO: X1.

            Registers.X0 = (int)SvcResult.Success;
            Registers.X1 = 0;
        }
Exemplo n.º 3
0
        public void WriteInt64(long Value)
        {
            Memory.WriteInt64(Position, Value);

            Position += 8;
        }