示例#1
0
        /// <summary>
        /// Returns an address by resolving the pointer's parent references
        /// </summary>
        /// <returns></returns>
        private int GetAddr()
        {
            int o = 0;

            if (Parent != null)
            {
                o = Parent.GetAddr() & 0xFFFFFF;
                o = Zpr.ReadRamInt32(o) & 0xFFFFFF;
            }

            return(o + Offset);
        }
示例#2
0
        public void Write(params object[] p)
        {
            if (p.Length % 2 != 0)
            {
                return;
            }

            for (int i = 0; i < (p.Length / 2); i++)
            {
                int    offset = (int)p[i * 2];
                object item   = p[i * 2 + 1];

                if (item is int)
                {
                    Zpr.WriteRam32(this + offset, (int)item);
                }
                else if (item is uint)
                {
                    Zpr.WriteRam32(this + offset, (int)((uint)item));
                }
                else if (item is float)
                {
                    Zpr.WriteRam32(this + offset, (float)item);
                }
                else if (item is short)
                {
                    Zpr.WriteRam16(this + offset, (short)item);
                }
                else if (item is ushort)
                {
                    Zpr.WriteRam16(this + offset, (short)((ushort)item));
                }
                else if (item is byte)
                {
                    Zpr.WriteRam8(this + offset, (byte)item);
                }
            }
        }
示例#3
0
 public int ReadByte(int offset)
 {
     return(Zpr.ReadRamByte(this + offset));
 }
示例#4
0
 public ushort ReadUInt16(int offset)
 {
     return((ushort)Zpr.ReadRamInt16(this + offset));
 }
示例#5
0
 public short ReadInt16(int offset)
 {
     return(Zpr.ReadRamInt16(this + offset));
 }
示例#6
0
 public float ReadFloat(int offset)
 {
     return(System.BitConverter.ToSingle(Zpr.ReadRam(this + offset, 4), 0));
 }
示例#7
0
 public uint ReadUInt32(int offset)
 {
     return((uint)Zpr.ReadRamInt32(this + offset));
 }
示例#8
0
 public int ReadInt32(int offset)
 {
     return(Zpr.ReadRamInt32(this + offset));
 }