public static VgmHeader Read(ISequentialReader reader) { var header = new VgmHeader(); var unused = new V151HeaderPart(); ReadCommon(reader, ref header.Common); if (header.Common.VgmIdentification != CommonHeaderPart.VgmIdentificationValue) { throw new VgmException("Vgm magic number does not found"); } var version = header.Common.Version; if (version != FormatVersion.V100 && version != FormatVersion.V101 && version != FormatVersion.V110 && version != FormatVersion.V150) { throw new VgmException("Unsupported version"); } Read100(reader, ref header.V100); if (version == FormatVersion.V100) { return(header); } Read101(reader, ref header.V101); if (version == FormatVersion.V101) { return(header); } Read110Part1(reader, ref header.V110); Read151Part1(reader, ref unused); Read110Part2(reader, ref header.V110); if (version == FormatVersion.V110) { return(header); } Read150(reader, ref header.V150); return(header); }
private static void Read151Part1(ISequentialReader reader, ref V151HeaderPart part) { part.SN76489Flags = reader.ReadByte(); }