Beispiel #1
0
        public void WriteToBuffer(ref byte *ptr, bool olt)
        {
            MapDataHelper.SaveUint(ref ptr, Comp_id);
            if (!olt)
            {
                Addr ^= MapDataHelper.XorKey;
            }

            MapDataHelper.SaveUint(ref ptr, Addr);
            MapDataHelper.SaveBytes(ref ptr, unk1, olt ? 4 : 8);
            MapDataHelper.SaveString(ref ptr, Units, 16);
            MapDataHelper.SaveDouble(ref ptr, Lower_lim);
            MapDataHelper.SaveDouble(ref ptr, Upper_lim);

            *(ptr++) = Const_type;
            *(ptr++) = Precision;

            Convert.WriteToBuffer(ref ptr);

            if (olt)
            {
                return;
            }
            MapDataHelper.SaveUshort(ref ptr, Cs);
        }
Beispiel #2
0
 public void WriteToBuffer(ref byte *ptr)
 {
     *ptr++ = CaptureRamId;
     *ptr++ = (byte)RtType;
     *ptr++ = (byte)(SymmetricPalette ? 1 : 0);
     MapDataHelper.SaveBytes(ref ptr, unk1);
 }
Beispiel #3
0
        public Entry1D(ref byte *ptr, bool olt = false)
        {
            Comp_id = MapDataHelper.LoadUint(ref ptr);
            Addr    = MapDataHelper.LoadUint(ref ptr);
            if (!olt)
            {
                Addr ^= MapDataHelper.XorKey;
                unk1  = MapDataHelper.LoadBytes(ref ptr, 8);
            }
            else
            {
                unk1 = MapDataHelper.LoadBytes(ref ptr, 4);
            }

            Units      = MapDataHelper.LoadString(ref ptr, 16);
            Lower_lim  = MapDataHelper.LoadDouble(ref ptr);
            Upper_lim  = MapDataHelper.LoadDouble(ref ptr);
            Const_type = *(ptr++);
            Precision  = *(ptr++);
            Convert    = new ConvertInfo(ref ptr);

            if (olt)
            {
                return;
            }
            Cs = MapDataHelper.LoadUshort(ref ptr);
        }
Beispiel #4
0
 public ExInfo(ref byte *ptr)
 {
     CaptureRamId     = *ptr++;
     RtType           = (RtType)(*ptr++);
     SymmetricPalette = *ptr++ == 1;
     unk1             = MapDataHelper.LoadBytes(ref ptr, 5);
 }
Beispiel #5
0
        public void WriteToBuffer(ref byte *ptr, bool olt)
        {
            MapDataHelper.SaveUint(ref ptr, Comp_id);
            MapDataHelper.SaveString(ref ptr, Name);

            if (!olt)
            {
                Addr[0] ^= MapDataHelper.XorKey;
            }

            foreach (var t in Addr)
            {
                MapDataHelper.SaveUint(ref ptr, t);
            }

            MapDataHelper.SaveBytes(ref ptr, unk1, olt ? 4 : 8);
            MapDataHelper.SaveBytes(ref ptr, Length);

            foreach (var t in ItemsName)
            {
                MapDataHelper.SaveString(ref ptr, t);
            }

            if (olt)
            {
                return;
            }
            MapDataHelper.SaveBytes(ref ptr, unk2);
            MapDataHelper.SaveUshort(ref ptr, Cs);
        }
Beispiel #6
0
        public IdentEntry(ref byte *ptr, bool olt = false)
        {
            Comp_id = MapDataHelper.LoadUint(ref ptr);
            Name    = MapDataHelper.LoadString(ref ptr);
            Addr    = new uint[8];
            for (var i = 0; i < Addr.Length; i++)
            {
                Addr[i] = MapDataHelper.LoadUint(ref ptr);
            }

            if (!olt)
            {
                Addr[0] ^= MapDataHelper.XorKey;
                unk1     = MapDataHelper.LoadBytes(ref ptr, 8);
            }
            else
            {
                unk1 = MapDataHelper.LoadBytes(ref ptr, 4);
            }

            Length = MapDataHelper.LoadBytes(ref ptr, 8);

            ItemsName = new string[8];
            for (int i = 0; i < ItemsName.Length; i++)
            {
                ItemsName[i] = MapDataHelper.LoadString(ref ptr);
            }

            if (olt)
            {
                return;
            }
            unk2 = MapDataHelper.LoadBytes(ref ptr, 16);
            Cs   = MapDataHelper.LoadUshort(ref ptr);
        }
Beispiel #7
0
 public void WriteToBuffer(ref byte *ptr)
 {
     MapDataHelper.SaveDouble(ref ptr, Div_step);
     MapDataHelper.SaveDouble(ref ptr, Offset2);
     MapDataHelper.SaveDouble(ref ptr, Inverted);
     MapDataHelper.SaveDouble(ref ptr, Step);
     MapDataHelper.SaveDouble(ref ptr, Offset1);
     ExInfo.WriteToBuffer(ref ptr);
 }
Beispiel #8
0
 public ConvertInfo(ref byte *ptr)
 {
     Div_step = MapDataHelper.LoadDouble(ref ptr);
     Offset2  = MapDataHelper.LoadDouble(ref ptr);
     Inverted = MapDataHelper.LoadDouble(ref ptr);
     Step     = MapDataHelper.LoadDouble(ref ptr);
     Offset1  = MapDataHelper.LoadDouble(ref ptr);
     ExInfo   = new ExInfo(ref ptr);
 }
Beispiel #9
0
        public Entry3D(ref byte *ptr, bool olt)
        {
            Comp_id = MapDataHelper.LoadUint(ref ptr);
            Addr    = MapDataHelper.LoadUint(ref ptr);
            if (!olt)
            {
                Addr ^= MapDataHelper.XorKey;
                unk1  = MapDataHelper.LoadBytes(ref ptr, 8);
            }
            else
            {
                unk1 = MapDataHelper.LoadBytes(ref ptr, 4);
            }

            xUnits = MapDataHelper.LoadString(ref ptr, 32);
            Units  = MapDataHelper.LoadString(ref ptr, 32);
            zUnits = MapDataHelper.LoadString(ref ptr, 32);
            xTable = MapDataHelper.LoadString(ref ptr, 255);
            zTable = MapDataHelper.LoadString(ref ptr, 255);

            xPoints   = MapDataHelper.LoadUshort(ref ptr);
            ShiftMask = MapDataHelper.LoadUshort(ref ptr);
            zPoints   = *(ptr++);

            xStart = MapDataHelper.LoadDouble(ref ptr);
            xEnd   = MapDataHelper.LoadDouble(ref ptr);

            unk2 = *(ptr++);             //FF

            Lower_lim = MapDataHelper.LoadDouble(ref ptr);
            Upper_lim = MapDataHelper.LoadDouble(ref ptr);

            unk3 = *(ptr++);             //FF

            zStart = MapDataHelper.LoadDouble(ref ptr);
            zEnd   = MapDataHelper.LoadDouble(ref ptr);

            unk4       = *(ptr++);       //FF
            Const_type = *(ptr++);
            unk5       = *(ptr++);       //00
            gbc_thrott = *(ptr++);

            unk6 = MapDataHelper.LoadBytes(ref ptr, 2);             //FF00

            Convert = new ConvertInfo(ref ptr);

            if (olt)
            {
                return;
            }
            Cs = MapDataHelper.LoadUshort(ref ptr);
        }
Beispiel #10
0
        public void WriteToBuffer(ref byte *ptr, bool olt)
        {
            MapDataHelper.SaveUint(ref ptr, Comp_id);
            if (!olt)
            {
                Addr ^= MapDataHelper.XorKey;
            }

            MapDataHelper.SaveUint(ref ptr, Addr);
            MapDataHelper.SaveBytes(ref ptr, unk1, olt ? 4 : 8);
            MapDataHelper.SaveString(ref ptr, xUnits, 32);
            MapDataHelper.SaveString(ref ptr, Units, 32);
            MapDataHelper.SaveString(ref ptr, zUnits, 32);
            MapDataHelper.SaveString(ref ptr, xTable, 255);
            MapDataHelper.SaveString(ref ptr, zTable, 255);

            MapDataHelper.SaveUshort(ref ptr, xPoints);
            MapDataHelper.SaveUshort(ref ptr, ShiftMask);
            *(ptr++) = zPoints;

            MapDataHelper.SaveDouble(ref ptr, xStart);
            MapDataHelper.SaveDouble(ref ptr, xEnd);

            *(ptr++) = unk2;             //FF

            MapDataHelper.SaveDouble(ref ptr, Lower_lim);
            MapDataHelper.SaveDouble(ref ptr, Upper_lim);

            *(ptr++) = unk3;             //FF

            MapDataHelper.SaveDouble(ref ptr, zStart);
            MapDataHelper.SaveDouble(ref ptr, zEnd);

            *(ptr++) = unk4;             //FF
            *(ptr++) = Const_type;
            *(ptr++) = unk5;             //FF
            *(ptr++) = gbc_thrott;

            MapDataHelper.SaveBytes(ref ptr, unk6);             //0000FF

            Convert.WriteToBuffer(ref ptr);

            if (olt)
            {
                return;
            }
            MapDataHelper.SaveUshort(ref ptr, Cs);
        }
Beispiel #11
0
        public uint WriteToBuffer(ref byte *ptr, bool olt = false)
        {
            var startPtr = (uint)ptr;

            MapDataHelper.SaveString(ref ptr, Name);
            *(ptr++) = Level;
            *(ptr++) = Type;

            switch (Type)
            {
            case 5:
                MapDataHelper.SaveUshort(ref ptr, (ushort)(Length - (olt ? 22 : 0)));
                IdentEntry.WriteToBuffer(ref ptr, olt);
                break;

            case 4:
                MapDataHelper.SaveUshort(ref ptr, (ushort)(Length - (olt ? 22 : 0)));
                FlagsEntry.WriteToBuffer(ref ptr, olt);
                break;

            case 3:
                MapDataHelper.SaveUshort(ref ptr, (ushort)(Length - (olt ? 6 : 0)));
                Entry1D.WriteToBuffer(ref ptr, olt);
                break;

            case 1:
                MapDataHelper.SaveUshort(ref ptr, (ushort)(Length - (olt ? 6 : 0)));
                Entry2D.WriteToBuffer(ref ptr, olt);
                break;

            case 2:
                MapDataHelper.SaveUshort(ref ptr, (ushort)(Length - (olt ? 6 : 0)));
                Entry3D.WriteToBuffer(ref ptr, olt);
                break;

            default:
                MapDataHelper.SaveUshort(ref ptr, Length);
                ptr += Length;
                break;
            }

            return((uint)ptr - startPtr);
        }
Beispiel #12
0
        public FlagsEntry(ref byte *ptr, bool olt = false)
        {
            Comp_id = MapDataHelper.LoadUint(ref ptr);
            Addr    = new uint[8];
            for (var i = 0; i < Addr.Length; i++)
            {
                Addr[i] = MapDataHelper.LoadUint(ref ptr);
            }

            if (!olt)
            {
                Addr[0] ^= MapDataHelper.XorKey;
                unk1     = MapDataHelper.LoadBytes(ref ptr, 8);
            }
            else
            {
                unk1 = MapDataHelper.LoadBytes(ref ptr, 4);
            }

            ItemsName = new string[8];
            for (int i = 0; i < ItemsName.Length; i++)
            {
                ItemsName[i] = MapDataHelper.LoadString(ref ptr);
            }

            BitsName = new string[8, 8];
            for (int i = 0; i < BitsName.GetLength(0); i++)
            {
                for (int j = 0; j < BitsName.GetLength(1); j++)
                {
                    BitsName[i, j] = MapDataHelper.LoadString(ref ptr);
                }
            }

            if (olt)
            {
                return;
            }
            unk2 = MapDataHelper.LoadBytes(ref ptr, 16);
            Cs   = MapDataHelper.LoadUshort(ref ptr);
        }
Beispiel #13
0
        public MapEntry(ref byte *ptr, bool olt = false)
        {
            Name    = MapDataHelper.LoadString(ref ptr);
            Level   = *(ptr++);
            Type    = *(ptr++);
            Length  = MapDataHelper.LoadUshort(ref ptr);
            Comp_id = MapDataHelper.LoadUint(ref ptr);
            ptr    -= 4;

            switch ((MapEntryType)Type)
            {
            case MapEntryType.Ident:
                IdentEntry = new IdentEntry(ref ptr, olt);
                break;

            case MapEntryType.Flags:
                FlagsEntry = new FlagsEntry(ref ptr, olt);
                break;

            case MapEntryType.Entry1D:
                Entry1D = new Entry1D(ref ptr, olt);
                break;

            case MapEntryType.Entry2D:
                Entry2D = new Entry2D(ref ptr, olt);
                break;

            case MapEntryType.Entry3D:
                Entry3D = new Entry3D(ref ptr, olt);
                break;

            default:
                Comp_id = 0;
                ptr    += Length;
                break;
            }
        }
Beispiel #14
0
        public void WriteToBuffer(ref byte *ptr, bool olt)
        {
            MapDataHelper.SaveUint(ref ptr, Comp_id);

            if (!olt)
            {
                Addr[0] ^= MapDataHelper.XorKey;
            }

            foreach (var t in Addr)
            {
                MapDataHelper.SaveUint(ref ptr, t);
            }

            MapDataHelper.SaveBytes(ref ptr, unk1, olt ? 4 : 8);

            foreach (var t in ItemsName)
            {
                MapDataHelper.SaveString(ref ptr, t);
            }

            for (int i = 0; i < BitsName.GetLength(0); i++)
            {
                for (int j = 0; j < BitsName.GetLength(1); j++)
                {
                    MapDataHelper.SaveString(ref ptr, BitsName[i, j]);
                }
            }

            if (olt)
            {
                return;
            }
            MapDataHelper.SaveBytes(ref ptr, unk2);
            MapDataHelper.SaveUshort(ref ptr, Cs);
        }