mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 22:33:12 -06:00
Image Creation Refinements, Issue #576
- Determine slice images to create dynamically based on the hd_xxx.txt and fd_xxx.txt files. - Add a volume label directive to the hd_xxx.txt and fd_xxx.txt files. - Add a system image directive to the hd_xxx.txt and fd_xxx.txt files.
This commit is contained in:
@@ -1,92 +1,22 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
:: call BuildDisk.cmd bp hd wbw_hd1k ..\zsdos\zsys_wbw.sys
|
||||
:: copy /b hd1k_prefix.dat + ..\..\Binary\hd1k_bp.img + ..\..\Binary\hd1k_cpm22.img + ..\..\Binary\hd1k_zsdos.img + ..\..\Binary\hd1k_nzcom.img + ..\..\Binary\hd1k_cpm3.img + ..\..\Binary\hd1k_zpm3.img + ..\..\Binary\hd1k_ws4.img ..\..\Binary\hd1k_combo_bp.img || exit /b
|
||||
:: goto :eof
|
||||
|
||||
echo.
|
||||
echo Building Floppy Disk Images...
|
||||
echo.
|
||||
call BuildDisk.cmd cpm22 fd wbw_fd144 ..\cpm22\cpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd zsdos fd wbw_fd144 ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd nzcom fd wbw_fd144 ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd cpm3 fd wbw_fd144 ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd zpm3 fd wbw_fd144 ..\zpm3\zpmldr.sys || exit /b
|
||||
call BuildDisk.cmd z3plus fd wbw_fd144 ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd ws4 fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd qpm fd wbw_fd144 ..\qpm\qpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd z80asm fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd aztecc fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd hitechc fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd tpascal fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd bascomp fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd cobol fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd fortran fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd games fd wbw_fd144 || exit /b
|
||||
call BuildDisk.cmd cowgol fd wbw_fd144 || exit /b
|
||||
|
||||
echo.
|
||||
echo Building Hard Disk Images (512 directory entry format)...
|
||||
echo.
|
||||
call BuildDisk.cmd blank hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd cpm22 hd wbw_hd512 ..\cpm22\cpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd zsdos hd wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd nzcom hd wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd cpm3 hd wbw_hd512 ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd zpm3 hd wbw_hd512 ..\zpm3\zpmldr.sys || exit /b
|
||||
call BuildDisk.cmd z3plus hd wbw_hd512 ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd ws4 hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd dos65 hd wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd qpm hd wbw_hd512 ..\qpm\qpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd z80asm hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd aztecc hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd hitechc hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd tpascal hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd bascomp hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd cobol hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd fortran hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd games hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd cowgol hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd msxroms1 hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd msxroms2 hd wbw_hd512 || exit /b
|
||||
call BuildDisk.cmd infocom hd wbw_hd512 || exit /b
|
||||
|
||||
:: echo.
|
||||
:: echo Building Combo Disk (512 directory entry format) Image...
|
||||
:: copy /b ..\..\Binary\hd512_cpm22.img + ..\..\Binary\hd512_zsdos.img + ..\..\Binary\hd512_nzcom.img + ..\..\Binary\hd512_cpm3.img + ..\..\Binary\hd512_zpm3.img + ..\..\Binary\hd512_ws4.img ..\..\Binary\hd512_combo.img || exit /b
|
||||
|
||||
echo.
|
||||
echo Building Hard Disk Images (1024 directory entry format)...
|
||||
echo.
|
||||
call BuildDisk.cmd blank hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd cpm22 hd wbw_hd1k ..\cpm22\cpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd zsdos hd wbw_hd1k ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd nzcom hd wbw_hd1k ..\zsdos\zsys_wbw.sys || exit /b
|
||||
call BuildDisk.cmd cpm3 hd wbw_hd1k ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd zpm3 hd wbw_hd1k ..\zpm3\zpmldr.sys || exit /b
|
||||
call BuildDisk.cmd z3plus hd wbw_hd1k ..\cpm3\cpmldr.sys || exit /b
|
||||
call BuildDisk.cmd ws4 hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd qpm hd wbw_hd1k ..\qpm\qpm_wbw.sys || exit /b
|
||||
call BuildDisk.cmd z80asm hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd aztecc hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd hitechc hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd tpascal hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd bascomp hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd cobol hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd fortran hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd games hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd cowgol hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd msxroms1 hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd msxroms2 hd wbw_hd1k || exit /b
|
||||
call BuildDisk.cmd infocom hd wbw_hd1k || exit /b
|
||||
|
||||
if exist ..\BPBIOS\bp*.rel call BuildDisk.cmd bp hd wbw_hd1k ..\zsdos\zsys_wbw.sys || exit /b
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
copy hd1k_prefix.dat ..\..\Binary\ || exit /b
|
||||
|
||||
:: echo.
|
||||
:: echo Building Combo Disk (1024 directory entry format) Image...
|
||||
:: copy /b hd1k_prefix.dat + ..\..\Binary\hd1k_cpm22.img + ..\..\Binary\hd1k_zsdos.img + ..\..\Binary\hd1k_nzcom.img + ..\..\Binary\hd1k_cpm3.img + ..\..\Binary\hd1k_zpm3.img + ..\..\Binary\hd1k_ws4.img ..\..\Binary\hd1k_combo.img || exit /b
|
||||
for %%f in (fd_*.txt) do (
|
||||
set Image=%%~nf
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildImg.ps1 fd144_!Image:fd_=! || exit /b
|
||||
)
|
||||
|
||||
call BuildImg.cmd || exit /b
|
||||
for %%f in (hd_*.txt) do (
|
||||
set Image=%%~nf
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildImg.ps1 hd512_!Image:hd_=! || exit /b
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildImg.ps1 hd1k_!Image:hd_=! || exit /b
|
||||
)
|
||||
|
||||
for %%f in (*.def) do (
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildDsk.ps1 hd512_%%~nf || exit /b
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildDsk.ps1 hd1k_%%~nf || exit /b
|
||||
)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildDisk.ps1 %* || exit /b
|
||||
@@ -1,110 +0,0 @@
|
||||
Param($Disk, $Type="", $Format="", $SysFile="")
|
||||
|
||||
$ErrorAction = 'Stop'
|
||||
|
||||
$CpmToolsPath = '../../Tools/cpmtools'
|
||||
|
||||
$env:PATH = $CpmToolsPath + ';' + $env:PATH
|
||||
|
||||
if ($Type.Length -eq 0)
|
||||
{
|
||||
Write-Error "No disk type specified!" -ErrorAction Stop
|
||||
return
|
||||
}
|
||||
|
||||
if ($Format.Length -eq 0)
|
||||
{
|
||||
Write-Error "No disk format specified!" -ErrorAction Stop
|
||||
return
|
||||
}
|
||||
|
||||
switch ($Format)
|
||||
{
|
||||
"wbw_fd144"
|
||||
{
|
||||
# 1.44MB Floppy Disk
|
||||
$Desc = "1.44MB Floppy Disk"
|
||||
$ImgFile = "fd144_${Disk}.img"
|
||||
$CatFile = "fd144_${Disk}.cat"
|
||||
$MediaID = 6
|
||||
$Size = 1440KB
|
||||
}
|
||||
|
||||
"wbw_hd512"
|
||||
{
|
||||
# 512 Directory Entry Hard Disk Format
|
||||
$Desc = "Hard Disk (512 directory entry format)"
|
||||
$ImgFile = "hd512_${Disk}.img"
|
||||
$CatFile = "hd512_${Disk}.cat"
|
||||
$MediaID = 4
|
||||
$Size = 8MB + 128KB
|
||||
}
|
||||
|
||||
"wbw_hd1k"
|
||||
{
|
||||
# 1024 Directory Entry Hard Disk Format
|
||||
$Desc = "Hard Disk (1024 directory entry format)"
|
||||
$ImgFile = "hd1k_${Disk}.img"
|
||||
$CatFile = "hd1k_${Disk}.cat"
|
||||
$MediaID = 10
|
||||
$Size = 8MB
|
||||
}
|
||||
}
|
||||
|
||||
if (-not (Test-Path("d_${Disk}/")))
|
||||
{
|
||||
Write-Error "Source directory d_${Disk} for disk ${Disk} not found!" -ErrorAction Stop
|
||||
return
|
||||
}
|
||||
|
||||
"Generating $Disk $Desc..."
|
||||
|
||||
if ($SysFile.Length -gt 0)
|
||||
{ [byte[]]$SysImg = [System.IO.File]::ReadAllBytes($SysFile) }
|
||||
else
|
||||
{ [byte[]]$SysImg = @() }
|
||||
|
||||
$Image = ($SysImg + ([byte[]](0xE5) * ($Size - $SysImg.length)))
|
||||
|
||||
# $Image[1410] = 0x4D
|
||||
# $Image[1411] = 0x49
|
||||
# $Image[1412] = 0x44
|
||||
# $Image[1413] = $MediaID
|
||||
|
||||
[System.IO.File]::WriteAllBytes($ImgFile, $Image)
|
||||
|
||||
for ($Usr=0; $Usr -lt 16; $Usr++)
|
||||
{
|
||||
if (Test-Path ("d_${Disk}/u${Usr}/*"))
|
||||
{
|
||||
$Cmd = "cpmcp -f $Format $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd
|
||||
if ($LASTEXITCODE -gt 0) {throw "Command returned exit code $LASTEXITCODE"}
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path("${Type}_${Disk}.txt"))
|
||||
{
|
||||
foreach($Line in Get-Content "${Type}_${Disk}.txt")
|
||||
{
|
||||
$Spec = $Line.Trim()
|
||||
if (($Spec.Length -gt 0) -and ($Spec.Substring(0,1) -ne "#"))
|
||||
{
|
||||
$Cmd = "cpmcp -f $Format $ImgFile ${Spec}"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd
|
||||
if ($LASTEXITCODE -gt 0) {throw "Command returned exit code $LASTEXITCODE"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Cmd = "cpmls -f $Format -D $ImgFile"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd > $CatFile
|
||||
|
||||
"Moving image $ImgFile into output directory..."
|
||||
|
||||
Move-Item $ImgFile -Destination "..\..\Binary\" -Force
|
||||
|
||||
return
|
||||
59
Source/Images/BuildDsk.ps1
Normal file
59
Source/Images/BuildDsk.ps1
Normal file
@@ -0,0 +1,59 @@
|
||||
param([string]$Disk)
|
||||
|
||||
# If a PowerShell exception occurs, just stop the script immediately.
|
||||
$ErrorAction = 'Stop'
|
||||
|
||||
# $ImgFile = "..\..\Binary\hd1k_" + $Image + ".img"
|
||||
|
||||
$Format, $Def = $Disk.Split("_")
|
||||
|
||||
$DefFile = $Def + ".def"
|
||||
|
||||
$SliceList = @()
|
||||
|
||||
ForEach ($Line in Get-Content $DefFile)
|
||||
{
|
||||
$Line = $Line.Trim()
|
||||
|
||||
if (($Line.Length -eq 0) -or ($Line[0] -eq "#"))
|
||||
{
|
||||
continue
|
||||
}
|
||||
|
||||
$SliceList += $Line
|
||||
}
|
||||
|
||||
$ImgFile = "..\..\Binary\" + $Disk + ".img"
|
||||
|
||||
$FileList = ""
|
||||
|
||||
"Generating $ImgFile using $DefFile..."
|
||||
|
||||
ForEach ($Slice in $SliceList)
|
||||
{
|
||||
$File = "..\..\Binary\" + $Format + "_" + $Slice + ".img"
|
||||
|
||||
if (!(Test-Path $File))
|
||||
{
|
||||
"Slice input file """ + $File + """ not found!!!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($FileList.Length -gt 0)
|
||||
{
|
||||
$FileList += "+"
|
||||
}
|
||||
|
||||
$FileList += $File
|
||||
}
|
||||
|
||||
if ($Format -eq "hd1k")
|
||||
{
|
||||
$FileList = "hd1k_prefix.dat+" + $FileList
|
||||
}
|
||||
|
||||
$Cmd = "$env:ComSpec /c copy /b $FileList $ImgFile"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd
|
||||
|
||||
exit 0
|
||||
@@ -1,6 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
for %%f in (*.def) do (
|
||||
PowerShell -ExecutionPolicy Unrestricted .\BuildImg.ps1 %%~nf || exit /b
|
||||
)
|
||||
@@ -3,64 +3,142 @@ param([string]$Image)
|
||||
# If a PowerShell exception occurs, just stop the script immediately.
|
||||
$ErrorAction = 'Stop'
|
||||
|
||||
$DefFile = $Image + ".def"
|
||||
$CpmToolsPath = '../../Tools/cpmtools'
|
||||
|
||||
$ImgFile = "..\..\Binary\hd1k_" + $Image + ".img"
|
||||
$env:PATH = $CpmToolsPath + ';' + $env:PATH
|
||||
|
||||
$Format, $Disk = $Image.Split("_")
|
||||
|
||||
$Format = "wbw_" + $Format
|
||||
|
||||
|
||||
$SliceList = @()
|
||||
|
||||
ForEach ($Line in Get-Content $DefFile)
|
||||
if ($Format.Length -eq 0)
|
||||
{
|
||||
$Line = $Line.Trim()
|
||||
|
||||
if (($Line.Length -eq 0) -or ($Line[0] -eq "#"))
|
||||
{
|
||||
continue
|
||||
}
|
||||
|
||||
$SliceList += $Line
|
||||
Write-Error "No disk format specified!" -ErrorAction Stop
|
||||
return
|
||||
}
|
||||
|
||||
function CreateImageFile {
|
||||
param (
|
||||
[string]$Format = "" # hd1k or hd512
|
||||
)
|
||||
switch ($Format)
|
||||
{
|
||||
"wbw_fd144"
|
||||
{
|
||||
# 1.44MB Floppy Disk
|
||||
$Type = "fd"
|
||||
$Desc = "1.44MB Floppy Disk"
|
||||
$ImgFile = "fd144_${Disk}.img"
|
||||
$CatFile = "fd144_${Disk}.cat"
|
||||
$MediaID = 6
|
||||
$Size = 1440KB
|
||||
}
|
||||
|
||||
$ImgFile = "..\..\Binary\" + $Format + "_" + $Image + ".img"
|
||||
|
||||
$FileList = ""
|
||||
|
||||
"Generating $ImgFile using $DefFile..."
|
||||
|
||||
ForEach ($Slice in $SliceList)
|
||||
{
|
||||
$File = "..\..\Binary\" + $Format + "_" + $Slice + ".img"
|
||||
|
||||
if (!(Test-Path $File))
|
||||
{
|
||||
"Slice input file """ + $File + """ not found!!!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($FileList.Length -gt 0)
|
||||
{
|
||||
$FileList += "+"
|
||||
}
|
||||
|
||||
$FileList += $File
|
||||
}
|
||||
"wbw_hd512"
|
||||
{
|
||||
# 512 Directory Entry Hard Disk Format
|
||||
$Type = "hd"
|
||||
$Desc = "Hard Disk (512 directory entry format)"
|
||||
$ImgFile = "hd512_${Disk}.img"
|
||||
$CatFile = "hd512_${Disk}.cat"
|
||||
$MediaID = 4
|
||||
$Size = 8MB + 128KB
|
||||
}
|
||||
|
||||
if ($Format -eq "hd1k")
|
||||
{
|
||||
$FileList = "hd1k_prefix.dat+" + $FileList
|
||||
}
|
||||
cmd.exe /c copy /b $FileList $ImgFile
|
||||
"wbw_hd1k"
|
||||
{
|
||||
# 1024 Directory Entry Hard Disk Format
|
||||
$Type = "hd"
|
||||
$Desc = "Hard Disk (1024 directory entry format)"
|
||||
$ImgFile = "hd1k_${Disk}.img"
|
||||
$CatFile = "hd1k_${Disk}.cat"
|
||||
$MediaID = 10
|
||||
$Size = 8MB
|
||||
}
|
||||
}
|
||||
|
||||
CreateImageFile "hd512"
|
||||
CreateImageFile "hd1k"
|
||||
if (-not (Test-Path("d_${Disk}/")))
|
||||
{
|
||||
Write-Error "Source directory d_${Disk} for disk ${Disk} not found!" -ErrorAction Stop
|
||||
return
|
||||
}
|
||||
|
||||
exit 0
|
||||
"Generating $Disk $Desc..."
|
||||
|
||||
if (Test-Path("${Type}_${Disk}.txt"))
|
||||
{
|
||||
foreach($Line in Get-Content "${Type}_${Disk}.txt")
|
||||
{
|
||||
$Spec = $Line.Trim()
|
||||
if (($Spec.Length -gt 0) -and ($Spec.Substring(0,1) -eq '@'))
|
||||
{
|
||||
$Directive = $Spec.Substring(1);
|
||||
$VarName, $VarVal = $Directive.Split("=")
|
||||
Invoke-Expression "`$$VarName = $VarVal"
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# "Label: '$Label'"
|
||||
# "SysImage: '$SysImage'"
|
||||
|
||||
if ($SysImage.Length -gt 0)
|
||||
{ [byte[]]$SysImg = [System.IO.File]::ReadAllBytes($SysImage) }
|
||||
else
|
||||
{ [byte[]]$SysImg = @() }
|
||||
|
||||
$ImageBin = ($SysImg + ([byte[]](0xE5) * ($Size - $SysImg.length)))
|
||||
|
||||
if ($Label.Length -gt 0)
|
||||
{
|
||||
$LabelBytes = [System.Text.Encoding]::ASCII.GetBytes($Label)
|
||||
$nLabel = 0;
|
||||
for ($nImg = 0x5E7; $nImg -lt 0x5F7; $nImg++)
|
||||
{
|
||||
if ($nLabel -lt $Label.Length)
|
||||
{
|
||||
$ImageBin[$nImg] = $LabelBytes[$nLabel]
|
||||
}
|
||||
else
|
||||
{
|
||||
$ImageBin[$nImg] = [byte][char]'$'
|
||||
}
|
||||
$nLabel++
|
||||
}
|
||||
$ImageBin[0x5F7] = [byte][char]'$'
|
||||
}
|
||||
|
||||
[System.IO.File]::WriteAllBytes($ImgFile, $ImageBin)
|
||||
|
||||
for ($Usr=0; $Usr -lt 16; $Usr++)
|
||||
{
|
||||
if (Test-Path ("d_${Disk}/u${Usr}/*"))
|
||||
{
|
||||
$Cmd = "cpmcp -f $Format $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd
|
||||
if ($LASTEXITCODE -gt 0) {throw "Command returned exit code $LASTEXITCODE"}
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path("${Type}_${Disk}.txt"))
|
||||
{
|
||||
foreach($Line in Get-Content "${Type}_${Disk}.txt")
|
||||
{
|
||||
$Spec = $Line.Trim()
|
||||
if (($Spec.Length -gt 0) -and ($Spec.Substring(0,1) -ne "#") -and ($Spec.Substring(0,1) -ne "@"))
|
||||
{
|
||||
$Cmd = "cpmcp -f $Format $ImgFile ${Spec}"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd
|
||||
if ($LASTEXITCODE -gt 0) {throw "Command returned exit code $LASTEXITCODE"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Cmd = "cpmls -f $Format -D $ImgFile"
|
||||
$Cmd
|
||||
Invoke-Expression $Cmd > $CatFile
|
||||
|
||||
# "Moving image $ImgFile into output directory..."
|
||||
|
||||
Move-Item $ImgFile -Destination "..\..\Binary\" -Force
|
||||
|
||||
return
|
||||
|
||||
@@ -3,51 +3,40 @@
|
||||
#
|
||||
SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../QPM/qpm_wbw.sys ../CPM3/cpmldr.sys ../ZPM3/zpmldr.sys
|
||||
|
||||
FDIMGS = fd144_cpm22.img fd144_zsdos.img fd144_nzcom.img \
|
||||
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img \
|
||||
fd144_z3plus.img \
|
||||
fd144_z80asm.img fd144_aztecc.img fd144_hitechc.img \
|
||||
fd144_bascomp.img fd144_fortran.img fd144_games.img \
|
||||
fd144_tpascal.img fd144_cowgol.img fd144_cobol.img
|
||||
HD512IMGS = hd512_cpm22.img hd512_zsdos.img hd512_nzcom.img \
|
||||
hd512_cpm3.img hd512_zpm3.img hd512_ws4.img
|
||||
HD512XIMGS = hd512_z80asm.img hd512_aztecc.img hd512_hitechc.img \
|
||||
hd512_bascomp.img hd512_fortran.img hd512_games.img \
|
||||
hd512_tpascal.img hd512_dos65.img hd512_qpm.img \
|
||||
hd512_z3plus.img hd512_infocom.img \
|
||||
hd512_cowgol.img hd512_msxroms1.img hd512_msxroms2.img \
|
||||
hd512_cobol.img hd512_blank.img
|
||||
HD1KIMGS = hd1k_cpm22.img hd1k_zsdos.img hd1k_nzcom.img \
|
||||
hd1k_cpm3.img hd1k_zpm3.img hd1k_ws4.img
|
||||
HD1KXIMGS = hd1k_z80asm.img hd1k_aztecc.img hd1k_hitechc.img \
|
||||
hd1k_bascomp.img hd1k_fortran.img hd1k_games.img \
|
||||
hd1k_tpascal.img hd1k_qpm.img \
|
||||
hd1k_z3plus.img hd1k_infocom.img \
|
||||
hd1k_cowgol.img hd1k_msxroms1.img hd1k_msxroms2.img \
|
||||
hd1k_cobol.img hd1k_blank.img
|
||||
HD1KXIMGS += hd1k_bp.img
|
||||
# OBJECTS =
|
||||
|
||||
HD512PREFIX =
|
||||
HD1KPREFIX = hd1k_prefix.dat
|
||||
|
||||
OBJECTS = $(FDIMGS)
|
||||
OBJECTS += $(HD512IMGS) $(HD512XIMGS) $(HD512PREFIX)
|
||||
OBJECTS += $(HD1KIMGS) $(HD1KXIMGS) $(HD1KPREFIX)
|
||||
|
||||
# OBJECTS =
|
||||
|
||||
# add base images used in *.def files
|
||||
|
||||
BASEIMG = $(shell grep -vEh "^\#" *.def)
|
||||
BASEIMG := $(addprefix hd512_,$(BASEIMG)) $(addprefix hd1k_,$(BASEIMG))
|
||||
BASEIMG := $(addsuffix .img,$(BASEIMG))
|
||||
OBJECTS += $(BASEIMG)
|
||||
FDIMGS = $(wildcard fd_*.txt)
|
||||
FDIMGS := $(subst fd_,,$(FDIMGS))
|
||||
FDIMGS := $(addprefix fd144_,$(FDIMGS))
|
||||
FDIMGS := $(FDIMGS:.txt=.img)
|
||||
|
||||
TEMP = $(wildcard *.def)
|
||||
TEMP := $(addprefix hd512_,$(TEMP)) $(addprefix hd1k_,$(TEMP))
|
||||
TEMP := $(TEMP:.def=.img)
|
||||
OBJECTS += $(TEMP)
|
||||
# $(info FDIMGS: $(FDIMGS))
|
||||
|
||||
HDIMGS = $(wildcard hd_*.txt)
|
||||
HDIMGS := $(subst hd_,,$(HDIMGS))
|
||||
HDIMGS := $(addprefix hd512_,$(HDIMGS)) $(addprefix hd1k_,$(HDIMGS))
|
||||
HDIMGS := $(HDIMGS:.txt=.img)
|
||||
|
||||
# $(info HDIMGS: $(HDIMGS))
|
||||
|
||||
BASEIMGS = $(shell grep -vEh "^\#" *.def)
|
||||
BASEIMGS := $(addprefix hd512_,$(BASEIMGS)) $(addprefix hd1k_,$(BASEIMGS))
|
||||
BASEIMGS := $(addsuffix .img,$(BASEIMGS))
|
||||
|
||||
# $(info BASEIMGS: $(BASEIMGS))
|
||||
|
||||
DSKIMGS = $(wildcard *.def)
|
||||
DSKIMGS := $(addprefix hd512_,$(DSKIMGS)) $(addprefix hd1k_,$(DSKIMGS))
|
||||
DSKIMGS := $(DSKIMGS:.def=.img)
|
||||
|
||||
# $(info DSKIMGS: $(DSKIMGS))
|
||||
|
||||
OBJECTS = $(FDIMGS) $(HDIMGS) $(DSKIMGS) $(HD512PREFIX) $(HD1KPREFIX)
|
||||
|
||||
OTHERS = blank144 blankhd512 blankhd1k *.cat
|
||||
|
||||
@@ -56,47 +45,27 @@ NODELETE = $(HD512PREFIX) $(HD1KPREFIX)
|
||||
DEST=../../Binary
|
||||
|
||||
TOOLS = ../../Tools
|
||||
|
||||
|
||||
# $(info OBJECTS: $(OBJECTS))
|
||||
|
||||
include $(TOOLS)/Makefile.inc
|
||||
|
||||
.SHELLFLAGS = -ce
|
||||
|
||||
DIFFPATH = $(DIFFTO)/Binary
|
||||
|
||||
# hd512_%.img: %.def $(HD512IMGS) $(HD512XIMGS)
|
||||
|
||||
hd512_%.img: %.def
|
||||
@echo "Making hd512 $^"; \
|
||||
file_list=""; \
|
||||
while read line; do \
|
||||
line=$$(echo "$${line}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$$//') ; \
|
||||
if [ -z "$${line}" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if [ "`echo ""$${line}"" | awk '{print substr($$0,1,1);exit}'`" = "#" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
file_list="$${file_list} hd512_$${line}.img"; \
|
||||
done < $^ ; \
|
||||
echo "$${file_list}"; \
|
||||
cat $${file_list} > $@
|
||||
|
||||
# hd1k_%.img: %.def $(HD1KIMGS) $(HD1KXIMGS)
|
||||
@echo "Generating hd512 disk image ""$@"" using $^"; \
|
||||
files=`grep -vEh "^\s*\#" $^ | grep -vEh "^\s*$$" | tr -d '\r' | awk '{print "hd512_" $$0 ".img"}'`; \
|
||||
echo " " $${files}; \
|
||||
cat $(HD512PREFIX) $${files} > $@
|
||||
|
||||
hd1k_%.img: %.def
|
||||
@echo "Making hd1k $^"; \
|
||||
file_list=""; \
|
||||
while read line; do \
|
||||
line=$$(echo "$${line}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$$//') ; \
|
||||
if [ -z "$${line}" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if [ "`echo ""$${line}"" | awk '{print substr($$0,1,1);exit}'`" = "#" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
file_list="$${file_list} hd1k_$${line}.img"; \
|
||||
done < $^ ; \
|
||||
echo "$${file_list}"; \
|
||||
cat $(HD1KPREFIX) $${file_list} > $@
|
||||
@echo "Generating hd1k disk image ""$@"" using $^"; \
|
||||
files=`grep -vEh "^\s*\#" $^ | grep -vEh "^\s*$$" | tr -d '\r' | awk '{print "hd1k_" $$0 ".img"}'`; \
|
||||
echo " " $${files}; \
|
||||
cat $(HD1KPREFIX) $${files} > $@
|
||||
|
||||
#
|
||||
# this somewhat impenetrable and fragile code is used to build each of the images
|
||||
@@ -127,16 +96,8 @@ blankhd1k:
|
||||
@LC_ALL=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HD1KSIZE)
|
||||
@hexdump $@
|
||||
|
||||
%.img: $(SYSTEMS) blank144 blankhd512 blankhd1k Makefile
|
||||
@sys= ; \
|
||||
case $@ in \
|
||||
(*cpm22*) sys=../CPM22/cpm_wbw.sys;; \
|
||||
(*qpm*) sys=../QPM/qpm_wbw.sys;; \
|
||||
(*zsdos* | *nzcom* | *dos65* | *bp*) sys=../ZSDOS/zsys_wbw.sys;; \
|
||||
(*cpm3* | *z3plus*) sys=../CPM3/cpmldr.sys;; \
|
||||
(*zpm3*) sys=../ZPM3/zpmldr.sys;; \
|
||||
esac ; \
|
||||
if echo $@ | grep -q ^fd144_ ; then \
|
||||
%.img: $(SYSTEMS) blank144 blankhd512 blankhd1k # Makefile
|
||||
@if echo $@ | grep -q ^fd144_ ; then \
|
||||
fmt=wbw_fd144 ; dtype=fd ; type=fd144_ ; proto=blank144 ; \
|
||||
fi ; \
|
||||
if echo $@ | grep -q ^hd512_ ; then \
|
||||
@@ -148,9 +109,24 @@ blankhd1k:
|
||||
d=$$(echo $(basename $@) | sed s/$$type//) ; \
|
||||
echo Generating $@ ; \
|
||||
cp $$proto $@ ; \
|
||||
if [ "$$sys" ] ; then \
|
||||
echo copying system $$sys to $@ ; \
|
||||
$(BINDIR)/mkfs.cpm -f $$fmt -b $$sys $@ ; \
|
||||
if [ -f $${dtype}_$$d.txt ] ; then \
|
||||
output=` \
|
||||
grep "^\s*@" $${dtype}_$$d.txt | tr -d '\r' | while read directive ; do \
|
||||
echo $${directive#?} ; \
|
||||
done ` ; \
|
||||
eval "$$output" ; \
|
||||
# echo "Label: $$Label" ; \
|
||||
# echo "SysImage: $$SysImage" ; \
|
||||
fi ; \
|
||||
if [ "$$SysImage" ] ; then \
|
||||
echo copying system $$SysImage to $@ ; \
|
||||
$(BINDIR)/mkfs.cpm -f $$fmt -b $$SysImage $@ ; \
|
||||
fi ; \
|
||||
if [ "$$Label" ] ; then \
|
||||
Label=`expr substr "$$Label" 1 16` ; \
|
||||
echo "Label: \"$$Label\""
|
||||
echo -n "\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$\$$" | dd conv=notrunc status=none bs=1 seek=1511 of=$@ ; \
|
||||
echo -n "$$Label" | dd conv=notrunc status=none bs=1 seek=1511 of=$@; \
|
||||
fi ; \
|
||||
for u in $$(seq 0 15) ; do \
|
||||
dir=d_$$d/u$$u ; \
|
||||
@@ -163,14 +139,14 @@ blankhd1k:
|
||||
done ; \
|
||||
fi ; \
|
||||
done ; \
|
||||
echo $${dtype}_$$d.txt ; \
|
||||
if [ -f $${dtype}_$$d.txt ] ; then \
|
||||
echo " " copying files from $${dtype}_$$d.txt ; \
|
||||
grep -v ^# $${dtype}_$$d.txt | tr -d '\r' | while read file user ; do \
|
||||
grep -v "^\s*[#@]" $${dtype}_$$d.txt | tr -d '\r' | while read file user ; do \
|
||||
rf=$$($(CASEFN) $$file | sort -f) ; \
|
||||
echo " " $$rf ; \
|
||||
if [ -z "$$rf" ] ; then \
|
||||
echo " " $$file missing ; \
|
||||
exit 1 ; \
|
||||
else \
|
||||
$(CPMCP) -f $$fmt $@ $$rf $$user ; \
|
||||
fi ; \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Aztec C"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft BASIC"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# Add ZSystem images
|
||||
#
|
||||
../BPBIOS/*.img 0:
|
||||
../BPBIOS/*.rel 0:
|
||||
../BPBIOS/*.zrl 0:
|
||||
../BPBIOS/*.zex 0:
|
||||
../BPBIOS/bpbuild.com 0:
|
||||
#
|
||||
# Add RomWBW utilities
|
||||
#
|
||||
#../../Binary/Apps/*.com 15:
|
||||
../../Binary/Apps/assign.com 15:
|
||||
#../../Binary/Apps/bbcbasic.com 15:
|
||||
#../../Binary/Apps/bbcbasic.txt 15:
|
||||
../../Binary/Apps/cpuspd.com 15:
|
||||
../../Binary/Apps/reboot.com 15:
|
||||
../../Binary/Apps/fat.com 15:
|
||||
../../Binary/Apps/fdu.com 15:
|
||||
../../Binary/Apps/fdu.doc 15:
|
||||
../../Binary/Apps/format.com 15:
|
||||
../../Binary/Apps/mode.com 15:
|
||||
../../Binary/Apps/rtc.com 15:
|
||||
../../Binary/Apps/survey.com 15:
|
||||
../../Binary/Apps/syscopy.com 15:
|
||||
../../Binary/Apps/sysgen.com 15:
|
||||
../../Binary/Apps/talk.com 15:
|
||||
../../Binary/Apps/htalk.com 15:
|
||||
../../Binary/Apps/tbasic.com 15:
|
||||
../../Binary/Apps/timer.com 15:
|
||||
../../Binary/Apps/tune.com 15:
|
||||
../../Binary/Apps/xm.com 15:
|
||||
../../Binary/Apps/zmp.com 15:
|
||||
../../Binary/Apps/zmp.hlp 15:
|
||||
../../Binary/Apps/zmp.doc 10:
|
||||
../../Binary/Apps/zmp.cfg 15:
|
||||
../../Binary/Apps/zmp.fon 15:
|
||||
../../Binary/Apps/zmxfer.ovr 15:
|
||||
../../Binary/Apps/zmterm.ovr 15:
|
||||
../../Binary/Apps/zminit.ovr 15:
|
||||
../../Binary/Apps/zmconfig.ovr 15:
|
||||
../../Binary/Apps/zmd.com 15:
|
||||
../../Binary/Apps/vgmplay.com 15:
|
||||
#
|
||||
# Add Common Applications
|
||||
#
|
||||
Common/All/u10/*.* 10:
|
||||
Common/All/u14/*.* 14:
|
||||
Common/All/u15/*.* 15:
|
||||
Common/CPM22/*.* 15:
|
||||
Common/Z/u14/*.* 14:
|
||||
Common/Z/u15/*.* 15:
|
||||
Common/Z3/u10/*.* 10:
|
||||
Common/Z3/u14/*.* 14:
|
||||
Common/Z3/u15/*.* 15:
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft COBOL"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Cowgol"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="CP/M 2.2"
|
||||
@SysImage="../CPM22/cpm_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="CP/M 3"
|
||||
@SysImage="../CPM3/cpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft Fortran"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Games"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="HITECH-C"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="NZ-COM"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="QP/M 2.7"
|
||||
@SysImage="../QPM/qpm_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Turbo Pascal"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="WordStar 4"
|
||||
#
|
||||
# Add the ZDE binaries
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="Z3PLUS"
|
||||
@SysImage="../CPM3/cpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="SLR Z80ASM"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="ZPM3"
|
||||
@SysImage="../ZPM3/zpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="ZSDOS 1.1"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Aztec C"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft BASIC"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Blank"
|
||||
#
|
||||
# Blank disk template
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="BPBIOS"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add ZSystem images
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft COBOL"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Cowgol"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="CP/M 2.2"
|
||||
@SysImage="../CPM22/cpm_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="CP/M 3"
|
||||
@SysImage="../CPM3/cpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="DOS65"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Microsoft Fortran"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Games"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="HITECH-C"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Infocom Games"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="MSX ROMS 1"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="MSX ROMS 2"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="NZ-COM"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="QP/M 2.7"
|
||||
@SysImage="../QPM/qpm_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="Turbo Pascal"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="WordStar 4"
|
||||
#
|
||||
# Add the ZDE binaries
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="Z3PLUS"
|
||||
@SysImage="../CPM3/cpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@Label="SLR Z80ASM"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="ZPM3"
|
||||
@SysImage="../ZPM3/zpmldr.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@Label="ZSDOS 1.1"
|
||||
@SysImage="../ZSDOS/zsys_wbw.sys"
|
||||
#
|
||||
# Add the ReadMe document
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user