Skip to content

Commit 3e4eea8

Browse files
committed
Adjusted tolerances when checking track bitcounts
Floppy access form now stays open after reading or writing to a floppy disk Fixed the format of the volume date on the summary panel Database updates
1 parent f27ce0d commit 3e4eea8

File tree

10 files changed

+85
-51
lines changed

10 files changed

+85
-51
lines changed

DiskImageTool/Bitstream/Functions.vb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,48 +78,48 @@ Namespace Bitstream
7878
End Function
7979

8080
Public Function InferBitRate(BitCount As UInteger) As UShort
81-
BitCount = Math.Round(BitCount / 10000) * 10000
81+
BitCount = Math.Round(BitCount / 5000) * 5000
8282

83-
If BitCount <= 130000 Then
83+
If BitCount <= 135000 Then
8484
Return 250
85-
ElseIf BitCount = 170000 Then
85+
ElseIf BitCount >= 165000 And BitCount <= 175000 Then
8686
Return 500
87-
ElseIf BitCount = 200000 Then
87+
ElseIf BitCount >= 195000 And BitCount <= 205000 Then
8888
Return 500
89-
ElseIf BitCount = 400000 Then
89+
ElseIf BitCount >= 395000 And BitCount <= 405000 Then
9090
Return 1000
91-
ElseIf BitCount = 800000 Then
91+
ElseIf BitCount >= 795000 And BitCount <= 805000 Then
9292
Return 2000
9393
Else
9494
Return 0
9595
End If
9696
End Function
9797

9898
Public Function InferRPM(BitCount As UInteger) As UShort
99-
BitCount = Math.Round(BitCount / 10000) * 10000
99+
BitCount = Math.Round(BitCount / 5000) * 5000
100100

101-
If BitCount <= 130000 Then
101+
If BitCount <= 135000 Then
102102
Return 300
103-
ElseIf BitCount = 170000 Then
103+
ElseIf BitCount >= 165000 And BitCount <= 175000 Then
104104
Return 360
105-
ElseIf BitCount = 200000 Then
105+
ElseIf BitCount >= 195000 And BitCount <= 205000 Then
106106
Return 300
107-
ElseIf BitCount = 400000 Then
107+
ElseIf BitCount >= 395000 And BitCount <= 405000 Then
108108
Return 300
109109
Else
110110
Return 300
111111
End If
112112
End Function
113113
Public Function InferSectorCount(BitCount As UInteger) As UShort
114-
BitCount = Math.Round(BitCount / 10000) * 10000
114+
BitCount = Math.Round(BitCount / 5000) * 5000
115115

116-
If BitCount <= 130000 Then
116+
If BitCount <= 135000 Then
117117
Return 9
118-
ElseIf BitCount = 170000 Then
118+
ElseIf BitCount >= 165000 And BitCount <= 175000 Then
119119
Return 15
120-
ElseIf BitCount = 200000 Then
120+
ElseIf BitCount >= 195000 And BitCount <= 205000 Then
121121
Return 18
122-
ElseIf BitCount = 400000 Then
122+
ElseIf BitCount >= 395000 And BitCount <= 405000 Then
123123
Return 36
124124
Else
125125
Return 0

DiskImageTool/Bitstream/IBM_MFM/IBM_MFM_Tools.vb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,16 @@
596596
Return (2 ^ Size) * 128
597597
End Function
598598

599-
Public Function GetTrackFormat(Size As UInteger) As MFMTrackFormat
600-
Size = Math.Round(Size / 10000) * 10000
601-
If Size = 100000 Then
599+
Public Function GetTrackFormat(BitCount As UInteger) As MFMTrackFormat
600+
BitCount = Math.Round(BitCount / 5000) * 5000
601+
602+
If BitCount <= 135000 Then
602603
Return MFMTrackFormat.TrackFormatDD
603-
ElseIf Size = 170000 Then
604+
ElseIf BitCount >= 165000 And BitCount <= 175000 Then
604605
Return MFMTrackFormat.TrackFormatHD1200
605-
ElseIf Size = 200000 Then
606+
ElseIf BitCount >= 195000 And BitCount <= 205000 Then
606607
Return MFMTrackFormat.TrackFormatHD
607-
ElseIf Size = 400000 Then
608+
ElseIf BitCount >= 395000 And BitCount <= 405000 Then
608609
Return MFMTrackFormat.TrackFormatED
609610
Else
610611
Return MFMTrackFormat.TrackFormatUnknown

DiskImageTool/DiskImageTool.vbproj

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

DiskImageTool/FloppyDB.xml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,22 @@
9797
<disk md5="08223BB189BD109938D1AE8190E73AB5" disk="1"/>
9898
<disk md5="B9804935D95DADD510C8047F581F8CD4" disk="2"/>
9999
</release>
100-
<release year="1991" version="1.5, Int. 7.1.91" media="720K" status="V">
101-
<disk md5="899FC331FB780F9F5555E53CBF7A2E7B" disk="1" status="U"/>
102-
<disk md5="671A3DC0E7C69565D60050270E019439" disk="2" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
103-
<disk md5="E5EAAC338C6BACABE917E4A7B60AD0F5" disk="3" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
104-
<disk md5="6D67747ACD6D3A1C118695D000809FFA" disk="4" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
100+
<release year="1991" version="1.5, Int. 7.1.91">
101+
<media media="1.2M" status="V">
102+
<disk md5="F7B7A0E352276BD6A0B04F32F8753C71" disk="1"/>"
103+
<disk md5="E0FDC283DE1625B5A9F5C6C3C987A4A0" disk="2" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
104+
<disk md5="1389B6C6927B810A9B16EBAFE66B1DEB" disk="3" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
105+
</media>
106+
<media media="720K" status="V">
107+
<disk md5="899FC331FB780F9F5555E53CBF7A2E7B" disk="1"/>
108+
<disk md5="671A3DC0E7C69565D60050270E019439" disk="2" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
109+
<disk md5="E5EAAC338C6BACABE917E4A7B60AD0F5" disk="3" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
110+
<disk md5="6D67747ACD6D3A1C118695D000809FFA" disk="4" version="1.5, Int. 7.1.91, 1.51, Int. 8.22.91"/>
111+
</media>
105112
</release>
106113
<release year="1991" version="1.51, Int. 8.22.91">
107114
<media media="1.2M" status="U">
108-
<disk md5="2B1C4810954FA51432B2115C18D16242" disk="1"/>
109-
<disk md5="E0FDC283DE1625B5A9F5C6C3C987A4A0" disk="2"/>
110-
<disk md5="1389B6C6927B810A9B16EBAFE66B1DEB" disk="3"/>
115+
<disk md5="2B1C4810954FA51432B2115C18D16242" disk="1"/>
111116
</media>
112117
<media media="720K" status="V">
113118
<disk md5="8C83F4EAD1BCE3ECB7F337183BF6CC55" disk="1"/>
@@ -297,7 +302,7 @@
297302
</release>
298303
</title>
299304
<title name="Alien Legacy" publisher="Sierra On-Line, Inc.">
300-
<release year="1994" version="1.0, Int. 5.14.94" media="1.44M" status="U">
305+
<release year="1994" version="1.0, Int. 5.14.94" media="1.44M" status="V">
301306
<disk md5="63829096EE27748916B27820976CF81B" disk="1"/>
302307
<disk md5="3CB704DED28F1DFB42221F7FD2DC18F0" disk="2"/>
303308
<disk md5="9A7CA1B1EA461E0668102D3311A0B6BD" disk="3"/>
@@ -3718,7 +3723,7 @@
37183723
<disk md5="46FC067879694EF6831DF48F021F9FA5" disk="9" status="U"/>
37193724
<disk md5="5D88C1BD6793EB048CA942D643A39783" disk="10"/>
37203725
</release>
3721-
<release year="1993" version="1.0, Int. 2.17.93" media="1.44M" status="U">
3726+
<release year="1993" version="1.0, Int. 2.17.93" media="1.44M" status="V">
37223727
<disk md5="0A06AA8B5C6FD5442D494729EC96852D" disk="1"/>
37233728
<disk md5="B5EBA5BD1829595DE91E7BFE3FF8E750" disk="2"/>
37243729
<disk md5="CC3BF598D7F1F6B4109A92BAD0CF4A7A" disk="3"/>

DiskImageTool/FloppyDiskIO.vb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ Module FloppyDiskIO
1818
If Result Then
1919
Dim BPB = FloppyDiskGetReadOptions(Owner, FloppyDrive)
2020
If BPB IsNot Nothing Then
21-
Dim FloppyAccessForm As New FloppyAccessForm(FloppyDrive, BPB, FloppyAccessForm.FloppyAccessType.Read)
21+
Dim FloppyAccessForm As New FloppyAccessForm(FloppyDrive, BPB, FloppyAccessForm.FloppyAccessType.Read) With {
22+
.LoadedFileNames = LoadedFileNames
23+
}
2224
FloppyAccessForm.ShowDialog(Owner)
23-
If FloppyAccessForm.Complete Then
24-
Dim DiskFormat = GetFloppyDiskFormat(BPB, False)
25-
FileName = FloppyDiskSaveFile(FloppyAccessForm.DiskBuffer, DiskFormat, LoadedFileNames)
26-
End If
25+
FileName = FloppyAccessForm.FileName
2726
FloppyAccessForm.Close()
2827
End If
2928
FloppyDrive.Close()

DiskImageTool/Forms/FloppyAccessForm.Designer.vb

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

DiskImageTool/Forms/FloppyAccessForm.vb

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Public Class FloppyAccessForm
1515
Private _SectorData As SectorData = Nothing
1616
Private _SectorError As Boolean = False
1717
Private _TotalBadSectors As UInteger = 0
18+
Private _LoadedFileNames As New Dictionary(Of String, ImageData)
19+
Private _FileName As String = ""
1820

1921
Public Enum FloppyAccessType
2022
Read
@@ -51,6 +53,8 @@ Public Class FloppyAccessForm
5153
Me.Text = StatusTypeString & " " & GetFloppyDiskFormatName(_BPB, False) & " Floppy"
5254
StatusType.Text = StatusTypeString
5355

56+
btnAbort.Text = "Abort"
57+
5458
InitTables()
5559
End Sub
5660

@@ -87,6 +91,21 @@ Public Class FloppyAccessForm
8791
End Set
8892
End Property
8993

94+
Public ReadOnly Property FileName As String
95+
Get
96+
Return _FileName
97+
End Get
98+
End Property
99+
100+
Public Property LoadedFileNames As Dictionary(Of String, ImageData)
101+
Get
102+
Return _LoadedFileNames
103+
End Get
104+
Set(value As Dictionary(Of String, ImageData))
105+
_LoadedFileNames = value
106+
End Set
107+
End Property
108+
90109
Public ReadOnly Property TotalBadSectors As UInteger
91110
Get
92111
Return _TotalBadSectors
@@ -569,20 +588,31 @@ Public Class FloppyAccessForm
569588
Exit Sub
570589
End If
571590
End If
591+
572592
If Not _Complete Then
573593
If Not ConfirmAbort() Then
574594
Exit Sub
575595
End If
596+
StatusType.Text = "Aborted"
597+
Else
598+
StatusType.Text = "Complete"
576599
End If
577600

578601
If _AccessType = FloppyAccessType.Write Then
579602
If _Complete Then
580603
Dim Msg As String = $"Your disk has been written successfully.{vbCrLf}{vbCrLf}Please remove the disk from the drive and write protect it now.{vbCrLf}{vbCrLf}Warning: If you continue without write protecting the disk, The operating system may make modifications to the disk as soon as you close this window."
581604
MsgBox(Msg, MsgBoxStyle.Information)
582605
End If
606+
Else
607+
If _Complete Then
608+
Dim DiskFormat = GetFloppyDiskFormat(_BPB, False)
609+
_FileName = FloppyDiskSaveFile(_DiskBuffer, DiskFormat, _LoadedFileNames)
610+
End If
583611
End If
584612

585-
Me.Hide()
613+
btnAbort.Text = "Close"
614+
615+
'Me.Hide()
586616
End Sub
587617

588618
Private Sub FloppyAccessForm_Activated(sender As Object, e As EventArgs) Handles Me.Activated
@@ -641,5 +671,4 @@ Public Class FloppyAccessForm
641671
Public ReadOnly Property Sector As UInteger
642672
Public Property Status As TrackStatus
643673
End Class
644-
645674
End Class

DiskImageTool/ImageFormats/ImageConversion.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ Namespace ImageFormats
466466
BitstreamTrack = Image.GetTrack(Track, Side)
467467

468468
If BitstreamTrack.Decoded Then
469-
Dim TrackFormat = GetTrackFormat(BitstreamTrack.MFMData.Size)
469+
Dim TrackFormat = GetTrackFormat(BitstreamTrack.Bitstream.Length)
470470

471471
If DiskFormat = MFMTrackFormat.TrackFormatUnknown And TrackFormat <> MFMTrackFormat.TrackFormatUnknown Then
472472
DiskFormat = TrackFormat

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("2.9.0.2")>
34+
<Assembly: AssemblyFileVersion("2.9.0.3")>

DiskImageTool/SummaryPanel.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ Module SummaryPanel
559559
If fsi.VolumeLabel IsNot Nothing Then
560560
.AddItem(FileSystemGroup, "Volume Label", fsi.VolumeLabel.GetVolumeName.TrimEnd(NULL_CHAR))
561561
Dim VolumeDate = fsi.VolumeLabel.GetLastWriteDate
562-
.AddItem(FileSystemGroup, "Volume Date", VolumeDate.ToString(True, False, False, False))
562+
.AddItem(FileSystemGroup, "Volume Date", VolumeDate.ToString(True, True, False, True))
563563
End If
564564

565565
.AddItem(FileSystemGroup, "Total Space", Format(Disk.SectorToBytes(Disk.BPB.DataRegionSize), "N0") & " bytes")

0 commit comments

Comments
 (0)