Skip to content

Commit eb54385

Browse files
committed
Bug fixes and improvements
Fixed small issue when converting to .MFM Fixed small issue when replacing a file Database updates
1 parent 3e4eea8 commit eb54385

File tree

7 files changed

+492
-75
lines changed

7 files changed

+492
-75
lines changed

DiskImageTool/Bitstream/IBM_MFM/IBM_MFM_Bitstream.vb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
_RPM = RPM
105105
_DataRate = DataRate
106106

107-
Dim MaxSize = GetMaxSize(RPM, DataRate)
107+
Dim MaxSize = MFMGetSize(RPM, DataRate)
108108
Dim Diff = MaxSize - _Bitstream.Length
109109
If Diff > 0 Then
110110
AddGap(Diff \ 16)
@@ -192,13 +192,6 @@
192192
Return _Bitstream.Get(_Bitstream.Length - 1)
193193
End If
194194
End Function
195-
196-
Private Function GetMaxSize(RPM As UShort, DataRate As UShort) As UInteger
197-
Dim MicrosecondsPerRev As Single = 1 / RPM * 60 * 1000000
198-
Dim MicrossecondsPerBit As Single = DataRate / 1000
199-
200-
Return Math.Ceiling(MicrosecondsPerRev * MicrossecondsPerBit / 8) * 16
201-
End Function
202195
End Class
203196
End Namespace
204197
End Namespace

DiskImageTool/Bitstream/IBM_MFM/IBM_MFM_Tools.vb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,13 @@
754754
Return New Byte(-1) {}
755755
End Function
756756

757+
Public Function MFMGetSize(RPM As UShort, DataRate As UShort) As UInteger
758+
Dim MicrosecondsPerRev As Single = 1 / RPM * 60 * 1000000
759+
Dim MicrossecondsPerBit As Single = DataRate / 1000
760+
761+
Return Math.Ceiling(MicrosecondsPerRev * MicrossecondsPerBit / 8) * 16
762+
End Function
763+
757764
Public Function ResizeBitstream(Bitstream As BitArray, Length As UInteger) As BitArray
758765
Dim NewBitstream = CType(Bitstream.Clone, BitArray)
759766
NewBitstream.Length = Length

DiskImageTool/DiskImageTool.vbproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<TargetCulture>en-US</TargetCulture>
3131
<ProductName>DiskImageTool</ProductName>
3232
<PublisherName>Digitoxin</PublisherName>
33-
<ApplicationRevision>3</ApplicationRevision>
34-
<ApplicationVersion>2.9.0.%2a</ApplicationVersion>
33+
<ApplicationRevision>0</ApplicationRevision>
34+
<ApplicationVersion>2.10.0.%2a</ApplicationVersion>
3535
<UseApplicationTrust>false</UseApplicationTrust>
3636
<PublishWizardCompleted>true</PublishWizardCompleted>
3737
<BootstrapperEnabled>true</BootstrapperEnabled>

DiskImageTool/FloppyDB.xml

Lines changed: 456 additions & 49 deletions
Large diffs are not rendered by default.

DiskImageTool/ImageFormats/ImageConversion.vb

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ Namespace ImageFormats
292292
Dim NewTrackCount = TrackCount \ Image.TrackStep
293293

294294
Dim HFE = New HFE.HFEImage(NewTrackCount, Image.SideCount) With {
295-
.BitRate = 0,
296-
.RPM = 0
295+
.BitRate = 250,
296+
.RPM = 300
297297
}
298298

299299
For Track = 0 To TrackCount - 1 Step Image.TrackStep
@@ -392,27 +392,37 @@ Namespace ImageFormats
392392
Dim NewTrackCount = TrackCount \ Image.TrackStep
393393

394394
Dim MFM = New MFM.MFMImage(NewTrackCount, Image.SideCount, 1) With {
395-
.BitRate = 0,
396-
.RPM = 0
395+
.BitRate = 250,
396+
.RPM = 300
397397
}
398398

399399
For Track = 0 To TrackCount - 1 Step Image.TrackStep
400400
Dim NewTrack = Track \ Image.TrackStep
401401
For Side = 0 To Image.SideCount - 1
402402
BitstreamTrack = Image.GetTrack(Track, Side)
403403

404-
Dim DriveSpeed = GetDriveSpeed(BitstreamTrack, Image.TrackStep)
404+
Dim MFMTrack As ImageFormats.MFM.MFMTrack
405405

406-
If Track = 0 And Side = 0 Then
407-
MFM.BitRate = DriveSpeed.BitRate
408-
MFM.RPM = DriveSpeed.RPM
409-
End If
406+
If BitstreamTrack.TrackType = BitstreamTrackType.MFM Then
407+
Dim DriveSpeed = GetDriveSpeed(BitstreamTrack, Image.TrackStep)
410408

411-
Dim MFMTrack = New MFM.MFMTrack(NewTrack, Side) With {
412-
.Bitstream = BitstreamTrack.Bitstream,
413-
.BitRate = DriveSpeed.BitRate,
414-
.RPM = DriveSpeed.RPM
415-
}
409+
If Track = 0 And Side = 0 Then
410+
MFM.BitRate = DriveSpeed.BitRate
411+
MFM.RPM = DriveSpeed.RPM
412+
End If
413+
414+
MFMTrack = New MFM.MFMTrack(NewTrack, Side) With {
415+
.Bitstream = BitstreamTrack.Bitstream,
416+
.BitRate = DriveSpeed.BitRate,
417+
.RPM = DriveSpeed.RPM
418+
}
419+
Else
420+
MFMTrack = New MFM.MFMTrack(NewTrack, Side) With {
421+
.Bitstream = New BitArray(MFMGetSize(MFM.RPM, MFM.BitRate)),
422+
.BitRate = MFM.BitRate,
423+
.RPM = MFM.RPM
424+
}
425+
End If
416426

417427
MFM.SetTrack(NewTrack, Side, MFMTrack)
418428
Next

DiskImageTool/MainForm.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ Public Class MainForm
22792279
Dim ReplaceFileForm As New ReplaceFileForm(AvailableSpace, DirectoryEntry.ParentDirectory)
22802280
With ReplaceFileForm
22812281
.SetOriginalFile(DirectoryEntry.GetShortFileName, DirectoryEntry.GetLastWriteDate.DateObject, DirectoryEntry.FileSize)
2282-
.SetNewFile(DirectoryEntry.ParentDirectory.GetAvailableShortFileName(FileInfo.Name, False), FileInfo.LastWriteTime, FileInfo.Length)
2282+
.SetNewFile(DirectoryEntry.ParentDirectory.GetAvailableShortFileName(FileInfo.Name, False, DirectoryEntry.Index), FileInfo.LastWriteTime, FileInfo.Length)
22832283
.RefreshText()
22842284
.ShowDialog(Me)
22852285
FormResult = .Result

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.3")>
34+
<Assembly: AssemblyFileVersion("2.10.0.0")>

0 commit comments

Comments
 (0)