From 637174373f6f3854533614206a832ada9472b270 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Mon, 26 Jul 2021 19:01:49 -0700 Subject: [PATCH] Make and Build Tweaks --- Source/Fonts/Makefile | 1 - Source/HBIOS/Build.sh | 78 +++-------------------------------------- Source/HBIOS/Makefile | 14 ++++++-- Source/Makefile | 6 ++-- Source/RomDsk/Build.cmd | 40 +++++++++++---------- Source/RomDsk/Makefile | 36 +++++++++++++++++++ Source/ver.inc | 2 +- Source/ver.lib | 2 +- Tools/Makefile.inc | 3 +- 9 files changed, 82 insertions(+), 100 deletions(-) create mode 100644 Source/RomDsk/Makefile diff --git a/Source/Fonts/Makefile b/Source/Fonts/Makefile index c9a06b35..0a3ddf78 100644 --- a/Source/Fonts/Makefile +++ b/Source/Fonts/Makefile @@ -4,7 +4,6 @@ OBJECTS = \ OTHERS = font8x8c.bin font8x11c.bin font8x16c.bin -DEST = ../HBIOS TOOLS = ../../Tools include $(TOOLS)/Makefile.inc diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index 65f6b205..777985dc 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -3,9 +3,6 @@ # fail on any error set -e -CPMCP=../../Tools/`uname`/cpmcp -CPMCH=../../Tools/`uname`/cpmchattr - timestamp=$(date +%Y-%m-%d) #timestamp="2020-02-24" @@ -60,22 +57,8 @@ else BIOS=wbw fi -Apps=(assign mode rtc syscopy xm) -if [ $romsize -gt 256 ] ; then - Apps+=(fdu format survey sysgen talk timer inttest) -fi - -blankfile=Blank${romsize}KB.dat -romdiskfile=RomDisk.tmp -romfmt=wbw_rom${romsize} outdir=../../Binary -echo "creating empty rom disk of size $romsize in $blankfile" -#LANG=en_US.US-ASCII tr '\000' '\345' /dev/null -#LC_CTYPE=en_US.US-ASCII tr '\000' '\345' /dev/null -LC_ALL=en_US.US-ASCII tr '\000' '\345' build.inc ; RomWBW Configured for $platform $config $timestamp ; @@ -87,19 +70,9 @@ ROMSIZE .EQU $romsize ; EOF -echo "checking prerequisites" -for need in ../CPM22/cpm_$BIOS.bin ../ZSDOS/zsys_$BIOS.bin \ - ../Forth/camel80.bin font8x11c.asm font8x11u.asm font8x16c.asm \ - font8x16u.asm font8x8c.asm font8x8u.asm ; do - if [ ! -f $need ] ; then - echo $need missing - exit 2 - fi -done - -cp ../Forth/camel80.bin . +make prereq -make dbgmon.bin romldr.bin imgpad2.bin +make dbgmon.bin romldr.bin if [ $platform != UNA ] ; then make nascom.bin tastybasic.bin game.bin eastaegg.bin updater.bin usrrom.bin imgpad2.bin @@ -116,53 +89,12 @@ if [ $platform != UNA ] ; then cat imgpad2.bin >osimg2.bin fi -echo "Building ${romsize}KB $romname ROM disk data file..." - -cp $blankfile $romdiskfile - -if [ $romsize -gt 128 ] ; then - - echo placing files into $romdiskfile - - for file in $(ls -1 ../RomDsk/ROM_${romsize}KB/* | sort -V) ; do - echo " " $file - $CPMCP -f $romfmt $romdiskfile $file 0: - done - - if [ -d ../RomDsk/$platform ] ; then - for file in ../RomDsk/$platform/* ; do - echo " " $file - $CPMCP -f $romfmt $romdiskfile $file 0: - done - fi - - echo "adding apps to $romdiskfile" - for i in ${Apps[@]} ; do - set +e - f=$(../../Tools/unix/casefn.sh ../../Binary/Apps/$i.com) - set -e - if [ -z "$f" ] ; then - echo " " $i "not found" - else - echo " " $f - $CPMCP -f $romfmt $romdiskfile $f 0: - fi - done - - echo "copying systems to $romdiskfile" - $CPMCP -f $romfmt $romdiskfile ../CPM22/cpm_$BIOS.sys 0:cpm.sys - $CPMCP -f $romfmt $romdiskfile ../ZSDOS/zsys_$BIOS.sys 0:zsys.sys - - echo "setting files in the ROM disk image to read only" - $CPMCH -f $romfmt $romdiskfile r 0:*.* -fi - if [ $platform = UNA ] ; then cp osimg.bin $outdir/UNA_WBW_SYS.bin - cp $romdiskfile $outdir/UNA_WBW_ROM$romsize.bin - cat ../UBIOS/UNA-BIOS.BIN osimg.bin ../UBIOS/FSFAT.BIN $romdiskfile >$romname.rom + cp ../RomDsk/rom${romsize}_una.dat $outdir/UNA_WBW_ROM$romsize.bin + cat ../UBIOS/UNA-BIOS.BIN osimg.bin ../UBIOS/FSFAT.BIN ../RomDsk/rom${romsize}_una.dat >$romname.rom else - cat hbios_rom.bin osimg.bin osimg1.bin osimg2.bin $romdiskfile >$romname.rom + cat hbios_rom.bin osimg.bin osimg1.bin osimg2.bin ../RomDsk/rom${romsize}_wbw.dat >$romname.rom cat hbios_rom.bin osimg.bin osimg1.bin osimg2.bin >$romname.upd cat hbios_app.bin osimg_small.bin > $romname.com fi diff --git a/Source/HBIOS/Makefile b/Source/HBIOS/Makefile index a6edb1b0..19d4eade 100644 --- a/Source/HBIOS/Makefile +++ b/Source/HBIOS/Makefile @@ -42,9 +42,11 @@ MOREDIFF = camel80.bin game.bin hbios_rom.bin nascom.bin prefix.bin usrrom.bin \ SUBDIRS = DEST = ../../Binary TOOLS =../../Tools -OTHERS = *.img *.rom *.com *.bin *.z80 cpm.sys zsys.sys Build.inc RomDisk.tmp font*.asm *.dat +OTHERS = *.img *.rom *.com *.bin *.z80 cpm.sys zsys.sys Build.inc font*.asm *.dat include $(TOOLS)/Makefile.inc +FONTS := font8x11c.asm font8x11u.asm font8x16c.asm font8x16u.asm font8x8c.asm font8x8u.asm + ifneq ($(findstring $(platform), N8 MK4 RCZ180 SCZ180 DYNO),) TASM=$(BINDIR)/uz80as -t hd64180 endif @@ -64,10 +66,18 @@ ROMSIZE=512 N8_std.rom: ROMSIZE=512 RCZ280_nat_zzr.rom: ROMSIZE=256 -%.rom: +%.rom %.upd %.com: chmod +x Build.sh bash Build.sh $(DIFFBUILD) $(shell echo $* | sed 's/_/ /') $(ROMSIZE) + +prereq: $(FONTS) camel80.bin + +font%.asm: + cp ../Fonts/$@ . +camel80.bin: + cp ../Forth/$@ . + hbios_rom.bin: hbios.asm build.inc $(TASM) -dROMBOOT hbios.asm hbios_rom.bin hbios_rom.lst diff --git a/Source/Makefile b/Source/Makefile index 189430e2..cb096c4a 100644 --- a/Source/Makefile +++ b/Source/Makefile @@ -6,10 +6,10 @@ SUBDIRS += Apps SUBDIRS += CBIOS SUBDIRS += Forth SUBDIRS += Fonts -SUBDIRS += CPM22 ZCPR ZCPR-DJ ZSDOS -SUBDIRS += HBIOS CPM3 -SUBDIRS += ZPM3 +SUBDIRS += CPM22 ZCPR ZCPR-DJ ZSDOS CPM3 ZPM3 #SUBDIRS += BPBIOS +SUBDIRS += RomDsk +SUBDIRS += HBIOS SUBDIRS += Images SUBDIRS += ZRC SUBDIRS += ZZR diff --git a/Source/RomDsk/Build.cmd b/Source/RomDsk/Build.cmd index 24f9bbed..5e784779 100644 --- a/Source/RomDsk/Build.cmd +++ b/Source/RomDsk/Build.cmd @@ -11,6 +11,9 @@ set ZXBINDIR=%TOOLS%/cpm/bin/ set ZXLIBDIR=%TOOLS%/cpm/lib/ set ZXINCDIR=%TOOLS%/cpm/include/ +set RomApps1=assign mode rtc syscopy xm +set RomApps2=fdu format survey sysgen talk timer inttest + :: :: Make all variants of the ROM Disk contents image. Three sizes are :: created for each of the different ROM sizes possible (256K, 512K, 1024K). @@ -21,45 +24,46 @@ set ZXINCDIR=%TOOLS%/cpm/include/ :: the final ROM size less 128K. :: +set RomApps= + copy NUL rom128_wbw.dat copy NUL rom128_una.dat :: MakeDisk -set RomApps=assign mode rtc syscopy xm +set RomApps=%RomApps1% -call :MakeDisk rom256_wbw 0x20000 wbw_rom256 ROM_256KB wbw -call :MakeDisk rom256_una 0x20000 wbw_rom256 ROM_256KB una +call :MakeDisk rom256_wbw 256 0x20000 wbw +call :MakeDisk rom256_una 256 0x20000 una -set RomApps=%RomApps% fdu format survey sysgen talk timer inttest +set RomApps=%RomApps1% %RomApps2% -call :MakeDisk rom512_wbw 0x60000 wbw_rom512 ROM_512KB wbw -call :MakeDisk rom512_una 0x60000 wbw_rom512 ROM_512KB una +call :MakeDisk rom512_wbw 512 0x60000 wbw +call :MakeDisk rom512_una 512 0x60000 una -call :MakeDisk rom1024_wbw 0xE0000 wbw_rom1024 ROM_1024KB wbw -call :MakeDisk rom1024_una 0xE0000 wbw_rom1024 ROM_1024KB una +call :MakeDisk rom1024_wbw 1024 0xE0000 wbw +call :MakeDisk rom1024_una 1024 0xE0000 una goto :eof :MakeDisk set Output=%1 -set Size=%2 -set Format=%3 -set Content=%4 -set Bios=%5 +set RomSize=%2 +set ImgSize=%3 +set Bios=%4 echo Making ROM Disk %Output% :: Create the empty disk image file -srec_cat -Generate 0 %Size% --Constant 0xE5 -Output %Output%.dat -Binary || exit /b +srec_cat -Generate 0 %ImgSize% --Constant 0xE5 -Output %Output%.dat -Binary || exit /b :: Populate the disk image via cpmtools -cpmcp -f %Format% %Output%.dat %Content%/*.* 0: || exit /b -for %%f in (%RomApps%) do cpmcp -f %Format% %Output%.dat ../../Binary/Apps/%%f.com 0: || exit /b -cpmcp -f %Format% %Output%.dat ..\cpm22\cpm_%Bios%.sys 0:cpm.sys || exit /b -cpmcp -f %Format% %Output%.dat ..\zsdos\zsys_%Bios%.sys 0:zsys.sys || exit /b +cpmcp -f wbw_rom%RomSize% %Output%.dat ROM_%RomSize%KB/*.* 0: || exit /b +for %%f in (%RomApps%) do cpmcp -f wbw_rom%RomSize% %Output%.dat ../../Binary/Apps/%%f.com 0: || exit /b +cpmcp -f wbw_rom%RomSize% %Output%.dat ..\cpm22\cpm_%Bios%.sys 0:cpm.sys || exit /b +cpmcp -f wbw_rom%RomSize% %Output%.dat ..\zsdos\zsys_%Bios%.sys 0:zsys.sys || exit /b :: Mark all disk files R/O for safety -cpmchattr -f %Format% %Output%.dat r 0:*.* || exit /b +cpmchattr -f wbw_rom%RomSize% %Output%.dat r 0:*.* || exit /b goto :eof diff --git a/Source/RomDsk/Makefile b/Source/RomDsk/Makefile new file mode 100644 index 00000000..7f4837ac --- /dev/null +++ b/Source/RomDsk/Makefile @@ -0,0 +1,36 @@ +OBJECTS = rom128_wbw.dat rom128_una.dat rom256_wbw.dat rom256_una.dat rom512_wbw.dat rom512_una.dat rom1024_wbw.dat rom1024_una.dat +OTHERS=*.dat + +TOOLS = ../../Tools +include $(TOOLS)/Makefile.inc + +.SHELLFLAGS = -ce + +ROMAPPS1 := assign mode rtc syscopy xm +ROMAPPS2 := fdu format survey sysgen talk timer inttest + +rom256_%.dat: ROMSIZ=256 +rom512_%.dat: ROMSIZ=512 +rom1024_%.dat: ROMSIZ=1024 + +rom256_%.dat: IMGSIZ=0x20000 +rom512_%.dat: IMGSIZ=0x60000 +rom1024_%.dat: IMGSIZ=0xE0000 + +rom256_%.dat: ROMAPPS=$(ROMAPPS1) +rom512_%.dat rom1024_%.dat: ROMAPPS=$(ROMAPPS1) $(ROMAPPS2) + +rom%_wbw.dat: BIOS=wbw +rom%_una.dat: BIOS=una + +rom128%.dat: + >$@ + +%.dat: + ### Making ROM Disk $@ + srec_cat -Generate 0 $(IMGSIZ) --Constant 0xE5 -Output $@ -Binary + $(CPMCP) -f wbw_rom$(ROMSIZ) $@ ROM_$(ROMSIZ)KB/*.* 0: + for i in $(ROMAPPS) ; do $(CPMCP) -f wbw_rom$(ROMSIZ) $@ ../../Binary/Apps/$$i.com 0: ; done + $(CPMCP) -f wbw_rom$(ROMSIZ) $@ ../CPM22/cpm_$(BIOS).sys 0:cpm.sys + $(CPMCP) -f wbw_rom$(ROMSIZ) $@ ../ZSDOS/zsys_$(BIOS).sys 0:zsys.sys + $(CPMCHATTR) -f wbw_rom$(ROMSIZ) $@ r 0:*.* diff --git a/Source/ver.inc b/Source/ver.inc index dcd01dd9..e08be308 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -2,4 +2,4 @@ #DEFINE RMN 1 #DEFINE RUP 1 #DEFINE RTP 0 -#DEFINE BIOSVER "3.1.1-pre.97" +#DEFINE BIOSVER "3.1.1-pre.98" diff --git a/Source/ver.lib b/Source/ver.lib index 38ce6f26..ff52a610 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -3,5 +3,5 @@ rmn equ 1 rup equ 1 rtp equ 0 biosver macro - db "3.1.1-pre.97" + db "3.1.1-pre.98" endm diff --git a/Tools/Makefile.inc b/Tools/Makefile.inc index 28cb24fc..32ad2bb0 100644 --- a/Tools/Makefile.inc +++ b/Tools/Makefile.inc @@ -43,6 +43,7 @@ TASMFLAGS= OPENSPIN=$(BINDIR)/openspin BSTC=$(BINDIR)//bstc CPMCP=$(BINDIR)/cpmcp +CPMCHATTR=$(BINDIR)/cpmchattr # # directory containing cpm binaries @@ -84,7 +85,7 @@ CPM=$(TOOLS)/cpm/bin mv $$($(CASEFN) $@) tmp.com ; mv tmp.com $@ %.bin: %.asm - $(TASM) $(TASMFLAGS) $< $@ $*.lst + $(TASM) $(TASMFLAGS) $< $@ $(basename $<).lst %.rel: %.asm $(ZXCC) $(CPM)/RMAC -$<