Пример #1
0
        private static DmadataRecord GetDmadataRec(ReadOnlySpan <byte> read, int dmadata)
        {
            int start = EndianX.ConvertInt32(read, dmadata + 0x20);
            int end   = EndianX.ConvertInt32(read, dmadata + 0x24);

            return(new DmadataRecord()
            {
                VRom = new FileAddress(start, end),
                Rom = new FileAddress(dmadata, 0)
            });
        }
Пример #2
0
        static List <DmadataRecord> GetDmadataRecords(ReadOnlySpan <byte> read)
        {
            List <DmadataRecord> result = new();
            DmadataRecord        record;

            for (int i = 0; i < read.Length; i += 0x10)
            {
                record = new DmadataRecord()
                {
                    VRom = new FileAddress(EndianX.ConvertInt32(read, i + 0x0), EndianX.ConvertInt32(read, i + 0x4)),
                    Rom  = new FileAddress(EndianX.ConvertInt32(read, i + 0x8), EndianX.ConvertInt32(read, i + 0xC))
                };
                if (record.VRom.End == 0)
                {
                    break;
                }
                result.Add(record);
            }
            return(result);
        }