Exemplo n.º 1
0
 public MFSEntry(string _name, string _ccode, string _gcode, ushort _dir = 0)
 {
     Attributes.CopyLimit    = false;
     Attributes.Encode       = false;
     Attributes.Hidden       = false;
     Attributes.DisableRead  = false;
     Attributes.DisableWrite = false;
     Name            = _name;
     CompanyCode     = _ccode;
     GameCode        = _gcode;
     ParentDirectory = _dir;
     Renewal         = 0;
     Date            = new MFS.Date();
 }
Exemplo n.º 2
0
        public void LoadEntry(byte[] Data, int Offset)
        {
            Attributes.CopyLimit    = (Util.ReadBEU16(Data, Offset) & 0x0200) != 0;
            Attributes.Encode       = (Util.ReadBEU16(Data, Offset) & 0x0400) != 0;
            Attributes.Hidden       = (Util.ReadBEU16(Data, Offset) & 0x0800) != 0;
            Attributes.DisableRead  = (Util.ReadBEU16(Data, Offset) & 0x1000) != 0;
            Attributes.DisableWrite = (Util.ReadBEU16(Data, Offset) & 0x2000) != 0;

            ParentDirectory = Util.ReadBEU16(Data, Offset + 0x02);
            CompanyCode     = Util.ReadStringN(Data, Offset + 0x04, 2);
            GameCode        = Util.ReadStringN(Data, Offset + 0x06, 4);

            Name = Util.ReadStringN(Data, Offset + 0x10, 0x14);

            Renewal = Data[Offset + 0x2A];
            Date    = new MFS.Date(Util.ReadBEU32(Data, Offset + 0x2C));
        }
Exemplo n.º 3
0
        public void Load(byte[] Data, int Offset)
        {
            Attributes.isWriteProtected       = (Data[Offset + 0x0E] & 0x80) != 0;
            Attributes.isVolumeReadProtected  = (Data[Offset + 0x0E] & 0x40) != 0;
            Attributes.isVolumeWriteProtected = (Data[Offset + 0x0E] & 0x20) != 0;
            DiskType = Data[Offset + 0x0F];
            Name     = Util.ReadStringN(Data, Offset + 0x10, 0x14);
            Date     = new MFS.Date(Util.ReadBEU32(Data, Offset + 0x24));
            Renewal  = Util.ReadBEU16(Data, Offset + 0x28);
            Country  = Data[Offset + 0x2A];

            //Get All FAT Entries
            FAT = new ushort[MFS.FAT_MAX];
            for (int i = 0; i < MFS.FAT_MAX; i++)
            {
                FAT[i] = Util.ReadBEU16(Data, Offset + 0x3C + (i * 2));
            }

            //Get All File Entries
            Entries = new List <MFSEntry>();
            for (int i = 0; i < MFS.EntryLimit[DiskType]; i++)
            {
                int check = (Data[Offset + 0x16B0 + (i * 0x30)] & 0xC0);
                if (check == 0x80)
                {
                    //Directory
                    MFSDirectory dir = new MFSDirectory(Data, Offset + 0x16B0 + (i * 0x30));
                    Entries.Add(dir);
                }
                else if (check == 0x40)
                {
                    //File
                    MFSFile file = new MFSFile(Data, Offset + 0x16B0 + (i * 0x30));
                    Entries.Add(file);
                }
            }
        }