Virtual-Mac/DiskImageCreator.vb
Edson Armando 8b3286fe05
Little updates
New Mac Wizard working, and revamped, so now you choose emulator and OS. Thank to adespoton for the Mac compatibility matrix. (https://docs.google.com/spreadsheets/d/1us6SCBgVs8NqbxofJXTmHDeK3nKQJpcgya2nWC9_t2w/edit#gid=0)
Now PearPC files can be loaded and saved (I've taken code from PearPC Config File Generator and adapted it to Virtual Mac)
Still getting the challenge of dealing with BII and SheepShaver config files. Will upload new versions of files when they work.
Updated to 0.6.1 in file version, but technically it's 0.6.1 Beta (Or 0.6.1 RC, 0.6.0, not the final 0.6.1)
Now with some investigation, the app is "translated" to Spanish and German (Please forgive the bad German translation, I used GTranslate and Virtual PC as reference points for this). To change the language, go to File > Options > Language and select the new language. Note that German(de-DE) or Spanish(es-MX) might be loaded by default if you are using these languages in you Windows installation. Note that the translation is crap, and is not complete, so many parts are still in English. Will try to fix this in 0.7.1
Still need to fix Saving BII and SS files, so this is not final 0.6.1, will release a "revision" later.
2019-02-08 11:19:10 -06:00

34 lines
1.6 KiB
VB.net

Module DiskImageCreator
Public Function CreateRawDisk(ByVal DiskSize As Integer, ByVal DiskPath As String, Optional ShowMessages As Boolean = True) As Long
Dim Size((DiskSize * 1024) * 1024) As Byte
'//Create the file, so we don't depend on the creation of the file to report progress
'//And after file creation, fill the file with zeroes until we get the desired size
'//As the byte gets assigned a value, it's written, and also it's reported as a progress of the creation
For x As Integer = 0 To Size.Length - 1
Size(x) = 0
Next
My.Computer.FileSystem.WriteAllBytes(DiskPath, Size, False)
If ShowMessages = False Then Exit Function
MsgBox("The image ''" & DiskPath & "'' was created succefully.", MsgBoxStyle.Exclamation, "Creating disk image")
End Function
'//This thing below is useless right now. In a later update, this will create Mac formatted floppy disks of 720 KB and 1.44 MB
Public Function CreateFloppyDisk(ByVal DiskSize As Integer, ByVal DiskPath As String, Optional ShowMessages As Boolean = True) As Long
Dim FloppyImageToUse() As Byte = {0}
Select Case DiskSize
Case "720"
Case "1440"
End Select
'//Create the file from an existing image, which is formatted and ready to use with a Mac
My.Computer.FileSystem.WriteAllBytes(DiskPath, FloppyImageToUse, False)
If ShowMessages = False Then Exit Function
MsgBox("The image ''" & DiskPath & "'' was created succefully.", MsgBoxStyle.Exclamation, "Creating disk image")
End Function
End Module