diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
index 4d95cab6f..3e1c72e3d 100644
--- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml
+++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
@@ -1612,6 +1612,8 @@
+
+
diff --git a/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto b/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto
index e43c122ba..cdedb54b3 100644
--- a/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto
+++ b/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto
@@ -156,31 +156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto.cs
index 384368e69..94ca5a3fc 100644
--- a/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto.cs
+++ b/DiscImageChef.Gui/Panels/pnlDeviceInfo.xeto.cs
@@ -33,7 +33,6 @@
using System;
using System.IO;
using DiscImageChef.Console;
-using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.PCMCIA;
using DiscImageChef.Decoders.SCSI.SSC;
using DiscImageChef.Devices;
@@ -171,61 +170,10 @@ namespace DiscImageChef.Gui.Panels
if(devInfo.AtaIdentify != null || devInfo.AtapiIdentify != null)
{
- tabAta.Visible = true;
+ tabAtaInfo tabAtaInfo = new tabAtaInfo();
+ tabAtaInfo.LoadData(devInfo.AtaIdentify, devInfo.AtapiIdentify, devInfo.AtaMcptError);
- if(devInfo.AtaIdentify != null)
- {
- stkAtaMcpt.Visible = false;
- chkAtaMcpt.Checked = devInfo.AtaMcptError.HasValue;
- lblAtaMcpt.Visible = devInfo.AtaMcptError.HasValue;
- lblAtaIdentify.Text = "ATA IDENTIFY DEVICE";
-
- if(devInfo.AtaMcptError.HasValue)
- {
- switch(devInfo.AtaMcptError.Value.DeviceHead & 0x7)
- {
- case 0:
- lblAtaMcpt.Text = "Device reports incorrect media card type";
- break;
- case 1:
- lblAtaMcpt.Text = "Device contains a Secure Digital card";
- break;
- case 2:
- lblAtaMcpt.Text = "Device contains a MultiMediaCard ";
- break;
- case 3:
- lblAtaMcpt.Text = "Device contains a Secure Digital I/O card";
- break;
- case 4:
- lblAtaMcpt.Text = "Device contains a Smart Media card";
- break;
- default:
- lblAtaMcpt.Text =
- $"Device contains unknown media card type {devInfo.AtaMcptError.Value.DeviceHead & 0x07}";
- break;
- }
-
- chkAtaMcptWriteProtection.Checked = (devInfo.AtaMcptError.Value.DeviceHead & 0x08) == 0x08;
-
- ushort specificData = (ushort)(devInfo.AtaMcptError.Value.CylinderHigh * 0x100 +
- devInfo.AtaMcptError.Value.CylinderLow);
- if(specificData != 0)
- {
- lblAtaMcptSpecificData.Visible = true;
- lblAtaMcptSpecificData.Text = $"Card specific data: 0x{specificData:X4}";
- }
- }
-
- tabAta.Text = "ATA";
- txtAtaIdentify.Text = Identify.Prettify(this.devInfo.AtaIdentify);
- }
- else if(devInfo.AtapiIdentify != null)
- {
- lblAtaIdentify.Text = "ATA PACKET IDENTIFY DEVICE";
- stkAtaMcpt.Visible = false;
- tabAta.Text = "ATAPI";
- txtAtaIdentify.Text = Identify.Prettify(this.devInfo.AtapiIdentify);
- }
+ tabInfos.Pages.Add(tabAtaInfo);
}
if(devInfo.ScsiInquiryData != null)
@@ -496,35 +444,6 @@ namespace DiscImageChef.Gui.Panels
tabScr.Visible;
}
- protected void OnBtnSaveAtaBinary(object sender, EventArgs e)
- {
- SaveFileDialog dlgSaveBinary = new SaveFileDialog();
- dlgSaveBinary.Filters.Add(new FileFilter {Extensions = new[] {"*.bin"}, Name = "Binary"});
- DialogResult result = dlgSaveBinary.ShowDialog(this);
-
- if(result != DialogResult.Ok) return;
-
- FileStream saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
- if(devInfo.AtaIdentify != null) saveFs.Write(devInfo.AtaIdentify, 0, devInfo.AtaIdentify.Length);
- else if(devInfo.AtapiIdentify != null) saveFs.Write(devInfo.AtapiIdentify, 0, devInfo.AtapiIdentify.Length);
-
- saveFs.Close();
- }
-
- protected void OnBtnSaveAtaText(object sender, EventArgs e)
- {
- SaveFileDialog dlgSaveText = new SaveFileDialog();
- dlgSaveText.Filters.Add(new FileFilter {Extensions = new[] {"*.txt"}, Name = "Text"});
- DialogResult result = dlgSaveText.ShowDialog(this);
-
- if(result != DialogResult.Ok) return;
-
- FileStream saveFs = new FileStream(dlgSaveText.FileName, FileMode.Create);
- StreamWriter saveSw = new StreamWriter(saveFs);
- saveSw.Write(txtAtaIdentify.Text);
- saveFs.Close();
- }
-
protected void OnBtnSaveUsbDescriptors(object sender, EventArgs e)
{
SaveFileDialog dlgSaveBinary = new SaveFileDialog();
@@ -580,16 +499,6 @@ namespace DiscImageChef.Gui.Panels
TextBox txtScsiType;
CheckBox chkRemovable;
CheckBox chkUsb;
- TabPage tabAta;
- Label lblAtaIdentify;
- TextArea txtAtaIdentify;
- Button btnSaveAtaBinary;
- Button btnSaveAtaText;
- StackLayout stkAtaMcpt;
- CheckBox chkAtaMcpt;
- Label lblAtaMcpt;
- CheckBox chkAtaMcptWriteProtection;
- Label lblAtaMcptSpecificData;
TabPage tabKreon;
CheckBox chkKreonChallengeResponse;
CheckBox chkKreonDecryptSs;
@@ -655,7 +564,6 @@ namespace DiscImageChef.Gui.Panels
CheckBox chkPlextorBitSettingDl;
CheckBox chkPlextorDvdPlusWriteTest;
TabPage tabSsc;
- StackLayout Vertical;
Label lblMinBlockSize;
Label lblMaxBlockSize;
Label lblBlockSizeGranularity;
diff --git a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
index 2e18cea5f..7ac2fe272 100644
--- a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
+++ b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
@@ -212,8 +212,8 @@ namespace DiscImageChef.Gui.Panels
PeripheralDeviceTypes scsiDeviceType = PeripheralDeviceTypes.DirectAccess;
byte[] scsiInquiryData = null;
- Inquiry.SCSIInquiry? scsiInquiry;
- Modes.DecodedMode? scsiMode;
+ Inquiry.SCSIInquiry? scsiInquiry = null;
+ Modes.DecodedMode? scsiMode = null;
byte[] scsiModeSense6 = null;
byte[] scsiModeSense10 = null;
@@ -244,8 +244,22 @@ namespace DiscImageChef.Gui.Panels
tabScsiInfo tabScsiInfo = new tabScsiInfo();
tabScsiInfo.LoadData(scsiInquiryData, scsiInquiry, null, scsiMode, scsiDeviceType, scsiModeSense6,
scsiModeSense10, null);
-
tabInfos.Pages.Add(tabScsiInfo);
+
+ byte[] ataIdentify = null;
+ byte[] atapiIdentify = null;
+
+ if(imageFormat.Info.ReadableMediaTags != null &&
+ imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.ATA_IDENTIFY))
+ ataIdentify = imageFormat.ReadDiskTag(MediaTagType.ATA_IDENTIFY);
+
+ if(imageFormat.Info.ReadableMediaTags != null &&
+ imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.ATAPI_IDENTIFY))
+ atapiIdentify = imageFormat.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY);
+
+ tabAtaInfo tabAtaInfo = new tabAtaInfo();
+ tabAtaInfo.LoadData(ataIdentify, atapiIdentify, null);
+ tabInfos.Pages.Add(tabAtaInfo);
}
#region XAML controls
diff --git a/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto b/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto
new file mode 100644
index 000000000..d5e5cb78a
--- /dev/null
+++ b/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto.cs b/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto.cs
new file mode 100644
index 000000000..acbe3fa1e
--- /dev/null
+++ b/DiscImageChef.Gui/Tabs/tabAtaInfo.xeto.cs
@@ -0,0 +1,160 @@
+// /***************************************************************************
+// The Disc Image Chef
+// ----------------------------------------------------------------------------
+//
+// Filename : pnlDeviceInfo.xeto.cs
+// Author(s) : Natalia Portillo
+//
+// Component : Device information.
+//
+// --[ Description ] ----------------------------------------------------------
+//
+// Implements the device information panel.
+//
+// --[ License ] --------------------------------------------------------------
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General public License for more details.
+//
+// You should have received a copy of the GNU General public License
+// along with this program. If not, see .
+//
+// ----------------------------------------------------------------------------
+// Copyright © 2011-2018 Natalia Portillo
+// ****************************************************************************/
+
+using System;
+using System.IO;
+using DiscImageChef.Decoders.ATA;
+using Eto.Forms;
+using Eto.Serialization.Xaml;
+
+namespace DiscImageChef.Gui.Tabs
+{
+ public class tabAtaInfo : TabPage
+ {
+ byte[] ata;
+ byte[] atapi;
+
+ public tabAtaInfo()
+ {
+ XamlReader.Load(this);
+ }
+
+ internal void LoadData(byte[] ataIdentify, byte[] atapiIdentify, AtaErrorRegistersChs? ataMcptError)
+ {
+ ata = ataIdentify;
+ atapi = atapiIdentify;
+
+ if(ataIdentify == null && atapiIdentify == null) return;
+
+ Visible = true;
+
+ if(ataIdentify != null)
+ {
+ stkAtaMcpt.Visible = false;
+ chkAtaMcpt.Checked = ataMcptError.HasValue;
+ lblAtaMcpt.Visible = ataMcptError.HasValue;
+ lblAtaIdentify.Text = "ATA IDENTIFY DEVICE";
+
+ if(ataMcptError.HasValue)
+ {
+ switch(ataMcptError.Value.DeviceHead & 0x7)
+ {
+ case 0:
+ lblAtaMcpt.Text = "Device reports incorrect media card type";
+ break;
+ case 1:
+ lblAtaMcpt.Text = "Device contains a Secure Digital card";
+ break;
+ case 2:
+ lblAtaMcpt.Text = "Device contains a MultiMediaCard ";
+ break;
+ case 3:
+ lblAtaMcpt.Text = "Device contains a Secure Digital I/O card";
+ break;
+ case 4:
+ lblAtaMcpt.Text = "Device contains a Smart Media card";
+ break;
+ default:
+ lblAtaMcpt.Text =
+ $"Device contains unknown media card type {ataMcptError.Value.DeviceHead & 0x07}";
+ break;
+ }
+
+ chkAtaMcptWriteProtection.Checked = (ataMcptError.Value.DeviceHead & 0x08) == 0x08;
+
+ ushort specificData = (ushort)(ataMcptError.Value.CylinderHigh * 0x100 +
+ ataMcptError.Value.CylinderLow);
+ if(specificData != 0)
+ {
+ lblAtaMcptSpecificData.Visible = true;
+ lblAtaMcptSpecificData.Text = $"Card specific data: 0x{specificData:X4}";
+ }
+ }
+
+ Text = "ATA";
+ txtAtaIdentify.Text = Identify.Prettify(ata);
+ }
+ else
+ {
+ lblAtaIdentify.Text = "ATA PACKET IDENTIFY DEVICE";
+ stkAtaMcpt.Visible = false;
+ Text = "ATAPI";
+ txtAtaIdentify.Text = Identify.Prettify(atapi);
+ }
+ }
+
+ protected void OnBtnSaveAtaBinary(object sender, EventArgs e)
+ {
+ SaveFileDialog dlgSaveBinary = new SaveFileDialog();
+ dlgSaveBinary.Filters.Add(new FileFilter {Extensions = new[] {"*.bin"}, Name = "Binary"});
+ DialogResult result = dlgSaveBinary.ShowDialog(this);
+
+ if(result != DialogResult.Ok) return;
+
+ FileStream saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
+ if(ata != null) saveFs.Write(ata, 0, ata.Length);
+ else if(atapi != null) saveFs.Write(atapi, 0, atapi.Length);
+
+ saveFs.Close();
+ }
+
+ protected void OnBtnSaveAtaText(object sender, EventArgs e)
+ {
+ SaveFileDialog dlgSaveText = new SaveFileDialog();
+ dlgSaveText.Filters.Add(new FileFilter {Extensions = new[] {"*.txt"}, Name = "Text"});
+ DialogResult result = dlgSaveText.ShowDialog(this);
+
+ if(result != DialogResult.Ok) return;
+
+ FileStream saveFs = new FileStream(dlgSaveText.FileName, FileMode.Create);
+ StreamWriter saveSw = new StreamWriter(saveFs);
+ saveSw.Write(txtAtaIdentify.Text);
+ saveFs.Close();
+ }
+
+ #region XAML controls
+ #pragma warning disable 169
+ #pragma warning disable 649
+ Label lblAtaIdentify;
+ TextArea txtAtaIdentify;
+ Button btnSaveAtaBinary;
+ Button btnSaveAtaText;
+ StackLayout stkAtaMcpt;
+ CheckBox chkAtaMcpt;
+ Label lblAtaMcpt;
+ CheckBox chkAtaMcptWriteProtection;
+ Label lblAtaMcptSpecificData;
+ #pragma warning restore 169
+ #pragma warning restore 649
+ #endregion
+ }
+}
\ No newline at end of file