Skip to content

Commit ed3f086

Browse files
committed
Updates to the FAT editor
Bug fixes in the Boot Sector editor
1 parent edae5ad commit ed3f086

File tree

7 files changed

+41
-21
lines changed

7 files changed

+41
-21
lines changed

DiskImageTool/DiskImageTool.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<ProductName>DiskImageTool</ProductName>
3131
<PublisherName>Digitoxin</PublisherName>
3232
<ApplicationRevision>0</ApplicationRevision>
33-
<ApplicationVersion>1.28.0.%2a</ApplicationVersion>
33+
<ApplicationVersion>1.29.0.%2a</ApplicationVersion>
3434
<UseApplicationTrust>false</UseApplicationTrust>
3535
<PublishWizardCompleted>true</PublishWizardCompleted>
3636
<BootstrapperEnabled>true</BootstrapperEnabled>

DiskImageTool/Forms/AboutBox.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
' TODO: Customize the application's assembly information in the "Application" pane of the project
1515
' properties dialog (under the "Project" menu).
1616
Me.LabelProductName.Text = My.Application.Info.ProductName
17-
Me.LabelVersion.Text = String.Format("Version {0}", FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion)
17+
Me.LabelVersion.Text = String.Format("Version {0}", GetVersionString)
1818
Me.LabelURL.Text = MainForm.SITE_URL
1919
Me.TextBoxDescription.Text = GetResource("License.txt")
2020
End Sub

DiskImageTool/Forms/BootSectorForm.vb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ Public Class BootSectorForm
317317
SetValue(TxtSectorsPerFAT, BootSector.SectorsPerFAT)
318318
SetValue(TxtSectorsPerTrack, BootSector.SectorsPerTrack, {"8", "9", "15", "18", "21", "36"})
319319
SetValue(TxtNumberOfHeads, BootSector.NumberOfHeads, {"1", "2"})
320-
SetValue(TxtHiddenSectors, BootSector.HiddenSectors)
321-
SetValue(HexJumpInstruction, BootSector.JmpBoot, Not BootSector.HasValidJumpInstruction(True))
322-
SetValue(HexBootSectorSignature, BootSector.BootStrapSignature.ToString("X4"), {BootSector.ValidBootStrapSignature.ToString("X4")})
323320
End Sub
324321

325322
Private Sub PopulateExtended(BootSector As BootSector)
@@ -393,6 +390,11 @@ Public Class BootSectorForm
393390
PopulateBytesPerSector()
394391
PopulateSectorsPerCluster()
395392
PopulateBootRecord(_Disk.BootSector)
393+
394+
SetValue(TxtHiddenSectors, _Disk.BootSector.HiddenSectors)
395+
SetValue(HexJumpInstruction, _Disk.BootSector.JmpBoot, Not _Disk.BootSector.HasValidJumpInstruction(True))
396+
SetValue(HexBootSectorSignature, _Disk.BootSector.BootStrapSignature.ToString("X4"), {BootSector.ValidBootStrapSignature.ToString("X4")})
397+
396398
PopulateAdditionalData(_Disk.BootSector)
397399

398400
If _HasExtended Then

DiskImageTool/Forms/FATEditForm.vb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Public Class FATEditForm
2020
' Color.Magenta
2121
'}
2222

23-
Public Sub New(Disk As DiskImage.Disk, Index As UShort)
23+
Public Sub New(Disk As DiskImage.Disk, Index As UShort, DisplaySync As Boolean)
2424

2525
' This call is required by the designer.
2626
InitializeComponent()
@@ -29,10 +29,14 @@ Public Class FATEditForm
2929

3030
Me.Text = "File Allocation Table " & Index + 1
3131
ChkSync.Checked = True
32+
ChkSync.Visible = DisplaySync
33+
If Not DisplaySync Then
34+
DataGridViewFAT.Height = ChkSync.Bottom - DataGridViewFAT.Top
35+
End If
3236
SetButtonStatus(False)
3337

3438
PopulateContextMenu()
35-
InitializeGridColumns
39+
InitializeGridColumns()
3640

3741
_ToolTip = New ToolTip()
3842
_Disk = Disk

DiskImageTool/Functions.vb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ Module Functions
7373
Return NewTable
7474
End Function
7575

76+
Public Function GetVersionString() As String
77+
Dim Version = FileVersionInfo.GetVersionInfo(Application.ExecutablePath)
78+
Return Version.FileMajorPart & "." & Version.FileMinorPart & "." & Version.FilePrivatePart
79+
End Function
80+
7681
Public Function HexStringToBytes(ByVal HexString As String) As Byte()
7782
Dim b(HexString.Length / 2 - 1) As Byte
7883

DiskImageTool/MainForm.vb

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ Public Class MainForm
477477
End Try
478478
Cursor.Current = Cursors.Default
479479
If DownloadVersion <> "" And DownloadURL <> "" Then
480-
Dim CurrentVersion = FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion
480+
Dim CurrentVersion = GetVersionString()
481481
UpdateAvailable = Version.Parse(DownloadVersion) > Version.Parse(CurrentVersion)
482482
End If
483483

@@ -1080,8 +1080,8 @@ Public Class MainForm
10801080
End If
10811081
End Sub
10821082

1083-
Private Sub FATEdit(Index As UShort)
1084-
Dim frmFATEdit As New FATEditForm(_Disk, Index)
1083+
Private Sub FATEdit(Index As UShort, DisplaySync As Boolean)
1084+
Dim frmFATEdit As New FATEditForm(_Disk, Index, DisplaySync)
10851085

10861086
frmFATEdit.ShowDialog()
10871087

@@ -1906,16 +1906,21 @@ Public Class MainForm
19061906
RemoveHandler Item.Click, AddressOf BtnEditFAT_Click
19071907
Next
19081908
BtnEditFAT.DropDownItems.Clear()
1909+
BtnEditFAT.Tag = Nothing
19091910

19101911
If _Disk IsNot Nothing AndAlso _Disk.IsValidImage Then
1911-
For Counter = 0 To _Disk.BootSector.NumberOfFATs - 1
1912-
Dim Item As New ToolStripMenuItem With {
1913-
.Text = "FAT &" & Counter + 1,
1914-
.Tag = Counter
1915-
}
1916-
BtnEditFAT.DropDownItems.Add(Item)
1917-
AddHandler Item.Click, AddressOf BtnEditFAT_Click
1918-
Next
1912+
If _Disk.BootSector.NumberOfFATs = 1 OrElse _Disk.FAT.CompareTables Then
1913+
BtnEditFAT.Tag = -1
1914+
Else
1915+
For Counter = 0 To _Disk.BootSector.NumberOfFATs - 1
1916+
Dim Item As New ToolStripMenuItem With {
1917+
.Text = "FAT &" & Counter + 1,
1918+
.Tag = Counter
1919+
}
1920+
BtnEditFAT.DropDownItems.Add(Item)
1921+
AddHandler Item.Click, AddressOf BtnEditFAT_Click
1922+
Next
1923+
End If
19191924
End If
19201925
End Sub
19211926

@@ -2959,7 +2964,11 @@ Public Class MainForm
29592964

29602965
Private Sub BtnEditFAT_Click(sender As Object, e As EventArgs) Handles BtnEditFAT.Click
29612966
If sender.tag IsNot Nothing Then
2962-
FATEdit(sender.tag)
2967+
If sender.tag = -1 Then
2968+
FATEdit(0, False)
2969+
Else
2970+
FATEdit(sender.tag, True)
2971+
End If
29632972
End If
29642973
End Sub
29652974

@@ -3298,7 +3307,7 @@ Public Class MainForm
32983307
End Sub
32993308

33003309
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles Me.Load
3301-
_FileVersion = FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion
3310+
_FileVersion = GetVersionString()
33023311
Me.Text = GetWindowCaption()
33033312

33043313
ParseCustomFilters()

DiskImageTool/My Project/AssemblyInfo.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Imports System.Runtime.InteropServices
3131
' <Assembly: AssemblyVersion("1.0.*")>
3232

3333
<Assembly: AssemblyVersion("1.0.0.0")>
34-
<Assembly: AssemblyFileVersion("1.28.0.0")>
34+
<Assembly: AssemblyFileVersion("1.29.0.0")>

0 commit comments

Comments
 (0)