Browse Source

User Defined Aggregate Disk Images, #576

Initial round of work on user defined aggregate disk images.
pull/589/head
Wayne Warthen 7 months ago
parent
commit
c8014d1947
No known key found for this signature in database GPG Key ID: 8B34ED29C07EEB0A
  1. 13
      Source/Images/Build.cmd
  2. 6
      Source/Images/BuildImg.cmd
  3. 66
      Source/Images/BuildImg.ps1
  4. 52
      Source/Images/Makefile
  5. 25
      Source/Images/all.def.example
  6. 8
      Source/Images/combo.def

13
Source/Images/Build.cmd

@ -52,9 +52,9 @@ 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 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)...
@ -85,7 +85,8 @@ if exist ..\BPBIOS\bp*.rel call BuildDisk.cmd bp hd wbw_hd1k ..\zsdos\zsys_wbw.s
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
:: 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
call BuildImg.cmd || exit /b

6
Source/Images/BuildImg.cmd

@ -0,0 +1,6 @@
@echo off
setlocal
for %%f in (*.def) do (
PowerShell -ExecutionPolicy Unrestricted .\BuildImg.ps1 %%~nf || exit /b
)

66
Source/Images/BuildImg.ps1

@ -0,0 +1,66 @@
param([string]$Image)
# If a PowerShell exception occurs, just stop the script immediately.
$ErrorAction = 'Stop'
$DefFile = $Image + ".def"
$ImgFile = "..\..\Binary\hd1k_" + $Image + ".img"
$SliceList = @()
ForEach ($Line in Get-Content $DefFile)
{
$Line = $Line.Trim()
if (($Line.Length -eq 0) -or ($Line[0] -eq "#"))
{
continue
}
$SliceList += $Line
}
function CreateImageFile {
param (
[string]$Format = "" # hd1k or hd512
)
$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
}
if ($Format -eq "hd1k")
{
$FileList = "hd1k_prefix.dat+" + $FileList
}
cmd.exe /c copy /b $FileList $ImgFile
}
CreateImageFile "hd512"
CreateImageFile "hd1k"
exit 0

52
Source/Images/Makefile

@ -31,8 +31,16 @@ HD512PREFIX =
HD1KPREFIX = hd1k_prefix.dat
OBJECTS = $(FDIMGS)
OBJECTS += $(HD512IMGS) $(HD512XIMGS) hd512_combo.img $(HD512PREFIX)
OBJECTS += $(HD1KIMGS) $(HD1KXIMGS) hd1k_combo.img $(HD1KPREFIX)
OBJECTS += $(HD512IMGS) $(HD512XIMGS) $(HD512PREFIX)
OBJECTS += $(HD1KIMGS) $(HD1KXIMGS) $(HD1KPREFIX)
# OBJECTS =
TEMP = $(wildcard *.def)
TEMP := $(addprefix hd512_,$(TEMP)) $(addprefix hd1k_,$(TEMP))
TEMP := $(TEMP:.def=.img)
OBJECTS += $(TEMP)
OTHERS = blank144 blankhd512 blankhd1k *.cat
@ -47,11 +55,41 @@ include $(TOOLS)/Makefile.inc
DIFFPATH = $(DIFFTO)/Binary
hd512_combo.img: $(HD512PREFIX) $(HD512IMGS)
cat $^ > $@
hd1k_combo.img: $(HD1KPREFIX) $(HD1KIMGS)
cat $^ > $@
# 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 [ "`expr substr "$$line" 1 1`" = "#" ]; then \
continue; \
fi; \
file_list="$${file_list} hd512_$${line}.img"; \
done < $^ ; \
echo "$${file_list}"; \
cat $${file_list} > $@
# hd1k_%.img: %.def $(HD1KIMGS) $(HD1KXIMGS)
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 [ "`expr substr "$$line" 1 1`" = "#" ]; then \
continue; \
fi; \
file_list="$${file_list} hd1k_$${line}.img"; \
done < $^ ; \
echo "$${file_list}"; \
cat $(HD1KPREFIX) $${file_list} > $@
#
# this somewhat impenetrable and fragile code is used to build each of the images

25
Source/Images/all.def.example

@ -0,0 +1,25 @@
# This image definition shows how to generate
# an disk image containing all of the available
# slices.
aztecc
bascomp
blank
cobol
cowgol
cpm22
cpm3
fortran
games
hitechc
infocom
msxroms1
msxroms2
nzcom
qpm
tpascal
ws4
z3plus
z80asm
zpm3
zsdos

8
Source/Images/combo.def

@ -0,0 +1,8 @@
# This is the ubiquituous Combo image for RomWBW
cpm22
zsdos
nzcom
cpm3
zpm3
ws4
Loading…
Cancel
Save