diff --git a/Source/Images/Build.cmd b/Source/Images/Build.cmd index 6e379154..891419cb 100644 --- a/Source/Images/Build.cmd +++ b/Source/Images/Build.cmd @@ -9,9 +9,9 @@ call Clean.cmd echo : echo : Building Floppy Disk Images... echo : -call BuildFD.cmd cpm22 ..\cpm22\cpm_wbw -call BuildFD.cmd zsdos ..\zsdos\zsys_wbw -call BuildFD.cmd nzcom ..\zsdos\zsys_wbw +call BuildFD.cmd cpm22 ..\cpm22\cpm_wbw.sys +call BuildFD.cmd zsdos ..\zsdos\zsys_wbw.sys +call BuildFD.cmd nzcom ..\zsdos\zsys_wbw.sys call BuildFD.cmd cpm3 call BuildFD.cmd zpm3 call BuildFD.cmd ws4 @@ -19,9 +19,9 @@ call BuildFD.cmd ws4 echo : echo : Building Hard Disk Images... echo : -call BuildHD.cmd cpm22 ..\cpm22\cpm_wbw -call BuildHD.cmd zsdos ..\zsdos\zsys_wbw -call BuildHD.cmd nzcom ..\zsdos\zsys_wbw +call BuildHD.cmd cpm22 ..\cpm22\cpm_wbw.sys +call BuildHD.cmd zsdos ..\zsdos\zsys_wbw.sys +call BuildHD.cmd nzcom ..\zsdos\zsys_wbw.sys call BuildHD.cmd cpm3 call BuildHD.cmd zpm3 call BuildHD.cmd ws4 diff --git a/Source/Images/BuildFD.ps1 b/Source/Images/BuildFD.ps1 index 531a891f..f482bc10 100644 --- a/Source/Images/BuildFD.ps1 +++ b/Source/Images/BuildFD.ps1 @@ -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 \ No newline at end of file diff --git a/Source/Images/BuildHD.ps1 b/Source/Images/BuildHD.ps1 index 523a4b62..eedfa4aa 100644 --- a/Source/Images/BuildHD.ps1 +++ b/Source/Images/BuildHD.ps1 @@ -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 Hard 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 \ No newline at end of file