mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Remove the ability to support little endian from BigEndianBitConverter.
This commit is contained in:
@@ -70,14 +70,14 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
return null;
|
||||
}
|
||||
|
||||
BurstCuttingArea decoded = new BurstCuttingArea();
|
||||
BurstCuttingArea decoded = new BurstCuttingArea
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(BCAResponse, 0),
|
||||
Reserved1 = BCAResponse[2],
|
||||
Reserved2 = BCAResponse[3],
|
||||
BCA = new byte[64]
|
||||
};
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
decoded.DataLength = BigEndianBitConverter.ToUInt16(BCAResponse, 0);
|
||||
decoded.Reserved1 = BCAResponse[2];
|
||||
decoded.Reserved2 = BCAResponse[3];
|
||||
decoded.BCA = new byte[64];
|
||||
Array.Copy(BCAResponse, 4, decoded.BCA, 0, 64);
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -72,21 +72,20 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
return null;
|
||||
}
|
||||
|
||||
CartridgeStatus decoded = new CartridgeStatus();
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
decoded.DataLength = BigEndianBitConverter.ToUInt16(CSResponse, 0);
|
||||
decoded.Reserved1 = CSResponse[2];
|
||||
decoded.Reserved2 = CSResponse[3];
|
||||
decoded.Cartridge = Convert.ToBoolean(CSResponse[4] & 0x80);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4] & 0x40);
|
||||
decoded.Reserved3 = (byte)((CSResponse[4] & 0x38) >> 3);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4] & 0x04);
|
||||
decoded.Reserved4 = (byte)(CSResponse[4] & 0x03);
|
||||
decoded.Reserved5 = CSResponse[5];
|
||||
decoded.Reserved6 = CSResponse[6];
|
||||
decoded.Reserved7 = CSResponse[7];
|
||||
CartridgeStatus decoded = new CartridgeStatus
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CSResponse, 0),
|
||||
Reserved1 = CSResponse[2],
|
||||
Reserved2 = CSResponse[3],
|
||||
Cartridge = Convert.ToBoolean(CSResponse[4] & 0x80),
|
||||
OUT = Convert.ToBoolean(CSResponse[4] & 0x40),
|
||||
Reserved3 = (byte)((CSResponse[4] & 0x38) >> 3),
|
||||
CWP = Convert.ToBoolean(CSResponse[4] & 0x04),
|
||||
Reserved4 = (byte)(CSResponse[4] & 0x03),
|
||||
Reserved5 = CSResponse[5],
|
||||
Reserved6 = CSResponse[6],
|
||||
Reserved7 = CSResponse[7]
|
||||
};
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
{
|
||||
if(DDSResponse == null) return null;
|
||||
|
||||
DiscDefinitionStructure decoded = new DiscDefinitionStructure();
|
||||
DiscDefinitionStructure decoded = new DiscDefinitionStructure
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DDSResponse, 0),
|
||||
Reserved1 = DDSResponse[2],
|
||||
Reserved2 = DDSResponse[3],
|
||||
Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4)
|
||||
};
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
decoded.DataLength = BigEndianBitConverter.ToUInt16(DDSResponse, 0);
|
||||
decoded.Reserved1 = DDSResponse[2];
|
||||
decoded.Reserved2 = DDSResponse[3];
|
||||
decoded.Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4);
|
||||
if(decoded.Signature != DDSIdentifier)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD DDS decoder", "Found incorrect DDS signature (0x{0:X4})",
|
||||
|
||||
@@ -83,13 +83,12 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
return null;
|
||||
}
|
||||
|
||||
DiscInformation decoded = new DiscInformation();
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
decoded.DataLength = BigEndianBitConverter.ToUInt16(DIResponse, 0);
|
||||
decoded.Reserved1 = DIResponse[2];
|
||||
decoded.Reserved2 = DIResponse[3];
|
||||
DiscInformation decoded = new DiscInformation
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DIResponse, 0),
|
||||
Reserved1 = DIResponse[2],
|
||||
Reserved2 = DIResponse[3]
|
||||
};
|
||||
|
||||
int offset = 4;
|
||||
List<DiscInformationUnits> units = new List<DiscInformationUnits>();
|
||||
@@ -141,6 +140,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
Array.Copy(DIResponse, 32 + offset, unit.FormatDependentContents, 0, 32);
|
||||
break;
|
||||
}
|
||||
|
||||
case DiscTypeBDRE:
|
||||
case DiscTypeBDR:
|
||||
{
|
||||
@@ -156,6 +156,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
offset += 14;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD Disc Information decoder",
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
@@ -71,16 +70,15 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
return null;
|
||||
}
|
||||
|
||||
SpareAreaInformation decoded = new SpareAreaInformation();
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
decoded.DataLength = BigEndianBitConverter.ToUInt16(SAIResponse, 0);
|
||||
decoded.Reserved1 = SAIResponse[2];
|
||||
decoded.Reserved2 = SAIResponse[3];
|
||||
decoded.Reserved3 = BigEndianBitConverter.ToUInt32(SAIResponse, 4);
|
||||
decoded.FreeSpareBlocks = BigEndianBitConverter.ToUInt32(SAIResponse, 8);
|
||||
decoded.AllocatedSpareBlocks = BigEndianBitConverter.ToUInt32(SAIResponse, 12);
|
||||
SpareAreaInformation decoded = new SpareAreaInformation
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(SAIResponse, 0),
|
||||
Reserved1 = SAIResponse[2],
|
||||
Reserved2 = SAIResponse[3],
|
||||
Reserved3 = BigEndianBitConverter.ToUInt32(SAIResponse, 4),
|
||||
FreeSpareBlocks = BigEndianBitConverter.ToUInt32(SAIResponse, 8),
|
||||
AllocatedSpareBlocks = BigEndianBitConverter.ToUInt32(SAIResponse, 12)
|
||||
};
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user