|
|
|
@ -1,4 +1,5 @@ |
|
|
|
Param([Parameter(Mandatory)]$Disk, $SysFile="") |
|
|
|
#Param([Parameter(Mandatory)]$Disk, $SysFile="") |
|
|
|
Param($Disk, $SysFile="") |
|
|
|
|
|
|
|
$ErrorAction = 'Stop' |
|
|
|
|
|
|
|
@ -18,8 +19,23 @@ if (-not (Test-Path("d_${Disk}/"))) |
|
|
|
|
|
|
|
"Generating Floppy Disk ${Disk}..." |
|
|
|
|
|
|
|
$Blank = ([string]([char]0xE5)) * $Size |
|
|
|
Set-Content -Value $Blank -NoNewLine -Path $ImgFile |
|
|
|
#$Blank = ([string]([char]0xE5)) * $Size |
|
|
|
#Set-Content -Value $Blank -NoNewLine -Path $ImgFile |
|
|
|
$Blank = ([byte[]](0xE5) * $Size) |
|
|
|
[System.IO.File]::WriteAllBytes($ImgFile, $Blank) |
|
|
|
|
|
|
|
if ($SysFile.Length -gt 0) |
|
|
|
{ |
|
|
|
"Adding System Image $SysFile..." |
|
|
|
#$Sys = Get-Content -Path "$SysFile.sys" -Raw |
|
|
|
#$Img = Get-Content -Path $ImgFile -Raw |
|
|
|
#$NewImg = $Sys + $Img.SubString($Sys.Length, $Img.Length - $Sys.Length) |
|
|
|
#Set-Content -NoNewLine -Path $ImgFile $NewImg |
|
|
|
|
|
|
|
$Cmd = "mkfs.cpm -f $Fmt -b $SysFile $ImgFile" |
|
|
|
$Cmd |
|
|
|
Invoke-Expression $Cmd |
|
|
|
} |
|
|
|
|
|
|
|
for ($Usr=0; $Usr -lt 16; $Usr++) |
|
|
|
{ |
|
|
|
@ -45,17 +61,9 @@ if (Test-Path("d_${Disk}.txt")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($SysFile.Length -gt 0) |
|
|
|
{ |
|
|
|
"Adding System Image $SysFile..." |
|
|
|
$Sys = Get-Content -Path "$SysFile.sys" -Raw |
|
|
|
$Img = Get-Content -Path $ImgFile -Raw |
|
|
|
$NewImg = $Sys + $Img.SubString($Sys.Length, $Img.Length - $Sys.Length) |
|
|
|
Set-Content -NoNewLine -Path $ImgFile $NewImg |
|
|
|
} |
|
|
|
|
|
|
|
"Moving image $ImgFile into output directory..." |
|
|
|
|
|
|
|
&$env:COMSPEC /c move $ImgFile ..\..\Binary\ |
|
|
|
#&$env:COMSPEC /c move $ImgFile ..\..\Binary\ |
|
|
|
Move-Item $ImgFile -Destination "..\..\Binary\" -Force |
|
|
|
|
|
|
|
return |