Skip to content

Commit 07bd20f

Browse files
committed
Replaced the sector drop-down with a visual sector selector in the raw track viewer
Fixed minor compliance issue when exporting to .86F
1 parent 9f2b525 commit 07bd20f

File tree

10 files changed

+440
-174
lines changed

10 files changed

+440
-174
lines changed

DiskImageTool/Bitstream/BitstreamRegionSector.vb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
Namespace Bitstream
22
Namespace IBM_MFM
33
Public Class BitstreamRegionSector
4+
Public Property DAM As Byte
45
Public Property DataChecksumValid As Boolean
56
Public Property DataLength As UInteger
67
Public Property DataStartIndex As UInteger
78
Public Property Gap3 As UShort
9+
Public Property HasData As Boolean
10+
Public Property IDAMChecksumValid As Boolean
811
Public Property Length As UInteger
912
Public Property SectorId As Byte
1013
Public Property SectorIndex As UShort

DiskImageTool/Bitstream/IBM_MFM/IBM_MFM_Tools.vb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@
361361

362362
Buffer = MFMGetBytes(Bitstream, BitstreamIndex, 2)
363363
Checksum = BitConverter.ToUInt16(Buffer, 0)
364-
If Checksum = CalculatedChecksum Then
364+
RegionSector.IDAMChecksumValid = (Checksum = CalculatedChecksum)
365+
366+
If RegionSector.IDAMChecksumValid Then
365367
RegionType = MFMRegionType.IDAMChecksumValid
366368
Else
367369
RegionType = MFMRegionType.IDAMChecksumInvalid
@@ -419,6 +421,7 @@
419421
BitstreamIndex += DAMPattern.Length
420422
End If
421423

424+
RegionSector.DAM = MFMGetByte(Bitstream, BitstreamIndex)
422425
RegionData.Regions.Add(New BitstreamRegion(MFMRegionType.DAM, ByteIndex, 1, RegionSector, BitOffset))
423426
ByteIndex += 1
424427
BitstreamIndex += MFM_BYTE_SIZE
@@ -466,6 +469,10 @@
466469
ByteIndex += MFM_CRC_SIZE
467470
BitstreamIndex += MFM_CRC_SIZE * MFM_BYTE_SIZE
468471
End If
472+
473+
RegionSector.HasData = True
474+
Else
475+
RegionSector.HasData = False
469476
End If
470477
SectorIndex += 1
471478
Next
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Class SelectablePanel
2+
Inherits Panel
3+
4+
Public Sub New()
5+
Me.SetStyle(ControlStyles.Selectable, True)
6+
Me.TabStop = True
7+
End Sub
8+
9+
Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
10+
Me.Focus()
11+
MyBase.OnMouseDown(e)
12+
End Sub
13+
14+
Protected Overrides Function IsInputKey(ByVal keyData As Keys) As Boolean
15+
If keyData = Keys.Up OrElse keyData = Keys.Down Then Return True
16+
If keyData = Keys.Left OrElse keyData = Keys.Right Then Return True
17+
Return MyBase.IsInputKey(keyData)
18+
End Function
19+
20+
Protected Overrides Sub OnEnter(ByVal e As EventArgs)
21+
Me.Invalidate()
22+
MyBase.OnEnter(e)
23+
End Sub
24+
25+
Protected Overrides Sub OnLeave(ByVal e As EventArgs)
26+
Me.Invalidate()
27+
MyBase.OnLeave(e)
28+
End Sub
29+
30+
'Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
31+
' MyBase.OnPaint(pe)
32+
33+
' If Me.Focused Then
34+
' Dim rc = Me.ClientRectangle
35+
' rc.Inflate(-2, -2)
36+
' ControlPaint.DrawFocusRectangle(pe.Graphics, rc)
37+
' End If
38+
'End Sub
39+
End Class

DiskImageTool/DiskImageTool.vbproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<ProductName>DiskImageTool</ProductName>
3232
<PublisherName>Digitoxin</PublisherName>
3333
<ApplicationRevision>0</ApplicationRevision>
34-
<ApplicationVersion>2.7.0.%2a</ApplicationVersion>
34+
<ApplicationVersion>2.8.0.%2a</ApplicationVersion>
3535
<UseApplicationTrust>false</UseApplicationTrust>
3636
<PublishWizardCompleted>true</PublishWizardCompleted>
3737
<BootstrapperEnabled>true</BootstrapperEnabled>
@@ -130,6 +130,9 @@
130130
</ItemGroup>
131131
<ItemGroup>
132132
<Compile Include="Bitstream\Bitstream.vb" />
133+
<Compile Include="Controls\SelectablePanel.vb">
134+
<SubType>Component</SubType>
135+
</Compile>
133136
<Compile Include="DiskImage\AddFileOptions.vb" />
134137
<Compile Include="DiskImage\Modules\EnumDescriptions.vb" />
135138
<Compile Include="DiskImage\MappedFloppyImage.vb" />

DiskImageTool/Forms/HexViewRawForm.Designer.vb

Lines changed: 42 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DiskImageTool/Forms/HexViewRawForm.resx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@
129129
<metadata name="ToolStripStatusLabel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
130130
<value>False</value>
131131
</metadata>
132-
<metadata name="DataGridDataInspector.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
133-
<value>True</value>
134-
</metadata>
135132
<metadata name="DataGridName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
136133
<value>True</value>
137134
</metadata>
@@ -153,15 +150,9 @@
153150
<metadata name="ContextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
154151
<value>127, 15</value>
155152
</metadata>
156-
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
153+
<metadata name="StatusStripBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
157154
<value>17, 17</value>
158155
</metadata>
159-
<metadata name="StatusStrip1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
160-
<value>True</value>
161-
</metadata>
162-
<metadata name="HexBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
163-
<value>True</value>
164-
</metadata>
165156
<metadata name="ContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
166157
<value>291, 17</value>
167158
</metadata>
@@ -289,9 +280,6 @@
289280
<metadata name="ToolStripMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
290281
<value>418, 17</value>
291282
</metadata>
292-
<metadata name="ToolStripMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
293-
<value>True</value>
294-
</metadata>
295283
<data name="ToolStripBtnSelectRegion.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
296284
<value>
297285
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@@ -330,7 +318,4 @@
330318
eYWrNU2s8LqmSSgMwgLwq+TVEQcQ2G8k2gASG8b3WMVvggAAAABJRU5ErkJggg==
331319
</value>
332320
</data>
333-
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
334-
<value>True</value>
335-
</metadata>
336321
</root>

0 commit comments

Comments
 (0)