diff --git a/Source/CBIOS/cbios.asm b/Source/CBIOS/cbios.asm index d3e1cf27..8cbf68c1 100644 --- a/Source/CBIOS/cbios.asm +++ b/Source/CBIOS/cbios.asm @@ -76,6 +76,17 @@ MEMTOP .EQU $10000 ; #IFDEF PLTUNA #INCLUDE "../UBIOS/ubios.inc" +; +; EQUATES BELOW SHOULD BE REPLACED WITH RUNTIME CALLS TO UNA GET BIOS INFO FUNCS +; +RAMSIZE .EQU 512 +; +BID_RAM0 .EQU $8000 +BID_RAMN .EQU (BID_RAM0 + ((RAMSIZE / 32) - 1)) +; +BID_RAMD0 .EQU BID_RAM0 ; FIRST RAM DRIVE BANK +BID_BIOS .EQU BID_RAMN - 2 ; BIOS BANK +BID_USR .EQU BID_RAMN - 1 ; USER BANK (CP/M TPA, ETC.) #ENDIF ; .ORG CBIOS_LOC ; DEFINED IN STD.ASM diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index eab445d2..cc61b0b9 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -155,15 +155,14 @@ ROMSIZE .EQU ${ROMSize} ; "@ | Out-File "build.inc" -Encoding ASCII -# Bring over previously assembled binary copy of Forth for later use. -Copy-Item '..\Forth\camel80.bin' 'camel80.bin' +# # Bring over previously assembled binary copy of Forth for later use. +# Copy-Item '..\Forth\camel80.bin' 'camel80.bin' # Bring over previously generated font files. Copy-Item '..\Fonts\font*.asm' '.' # Assemble individual components. Note in the case of UNA, there is less to build. -# -$RomComponentList = "dbgmon", "romldr", "eastaegg", "nascom", "tastybasic", "game", "usrrom", "imgpad", "imgpad0" +$RomComponentList = "dbgmon", "romldr", "eastaegg", "imgpad" ForEach ($RomComponentName in $RomComponentList) {Asm $RomComponentName} if ($Platform -ne "UNA") @@ -171,6 +170,12 @@ if ($Platform -ne "UNA") Asm 'hbios' '-dROMBOOT' -Output 'hbios_rom.bin' -List 'hbios_rom.lst' Asm 'hbios' '-dAPPBOOT' -Output 'hbios_app.bin' -List 'hbios_app.lst' Asm 'hbios' '-dIMGBOOT' -Output 'hbios_img.bin' -List 'hbios_img.lst' + + Asm 'nascom' + Asm 'tastybasic' + Asm 'game' + Asm 'usrrom' + Asm 'imgpad0' } # @@ -181,7 +186,12 @@ if ($Platform -ne "UNA") # Build 32K OS chunk containing the loader, debug monitor, and OS images Concat 'romldr.bin', 'eastaegg.bin','dbgmon.bin', "..\cpm22\cpm_${Bios}.bin", "..\zsdos\zsys_${Bios}.bin" osimg.bin -Concat 'camel80.bin', 'nascom.bin', 'tastybasic.bin', 'game.bin', 'imgpad0.bin', 'usrrom.bin' osimg1.bin + +# Build second 32K chunk containing supplemental ROM apps (not for UNA) +if ($Platform -ne "UNA") +{ + Concat '..\Forth\camel80.bin', 'nascom.bin', 'tastybasic.bin', 'game.bin', 'imgpad0.bin', 'usrrom.bin' osimg1.bin +} # # Now the ROM disk image is created. This is done by starting with a diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index ee0cc6c2..32fb786f 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -90,17 +90,20 @@ done cp ../Forth/camel80.bin . -make dbgmon.bin romldr.bin eastaegg.bin nascom.bin \ - tastybasic.bin game.bin usrrom.bin imgpad.bin imgpad0.bin +make dbgmon.bin romldr.bin eastaegg.bin imgpad.bin if [ $platform != UNA ] ; then + make nascom.bin tastybasic.bin game.bin usrrom.bin imgpad0.bin make hbios_rom.bin hbios_app.bin hbios_img.bin fi echo "Building $romname output files..." cat romldr.bin eastaegg.bin dbgmon.bin ../CPM22/cpm_$BIOS.bin ../ZSDOS/zsys_$BIOS.bin >osimg.bin -cat camel80.bin nascom.bin tastybasic.bin game.bin imgpad0.bin usrrom.bin >osimg1.bin + +if [ $platform != UNA ] ; then + cat camel80.bin nascom.bin tastybasic.bin game.bin imgpad0.bin usrrom.bin >osimg1.bin +fi echo "Building ${romsize}KB $romname ROM disk data file..." diff --git a/Source/HBIOS/Makefile b/Source/HBIOS/Makefile index 1cb60991..fa07785f 100644 --- a/Source/HBIOS/Makefile +++ b/Source/HBIOS/Makefile @@ -61,6 +61,7 @@ hbios_img.bin: hbios.asm build.inc romldr.bin: build.inc dbgmon.bin: build.inc nascom.bin: build.inc +eastaegg.bin: build.inc dumps: for i in $(MOREDIFF) ; do \ diff --git a/Source/HBIOS/eastaegg.asm b/Source/HBIOS/eastaegg.asm index 23744cb5..66982bee 100644 --- a/Source/HBIOS/eastaegg.asm +++ b/Source/HBIOS/eastaegg.asm @@ -17,11 +17,6 @@ ; #include "std.asm" -; *** HACK TO GET THIS TO BUILD UNDER UNA *** -#IF (BIOS == BIOS_UNA) -#INCLUDE "hbios.inc" -#ENDIF - cr .equ 0dh lf .equ 0ah eos .equ 00h @@ -33,7 +28,7 @@ scale .equ 256 ; Do NOT change this - the ; this scaling factor! :-) divergent .equ scale * 4 - ld sp,0fdffh + ld sp,HBX_LOC ld hl, welcome ; Print a welcome message call _puts @@ -178,16 +173,29 @@ inner_loop_end call _putcrlf ; Print a CR/LF pair mandel_end ld hl, finished ; Print finished-message call _puts ; GET CONSOLE INPUT STATUS VIA HBIOS -waitch LD C,CIODEV_CONSOLE ; CONSOLE UNIT TO C - LD B,BF_CIOIST ; HBIOS FUNC: INPUT STATUS - RST 08 ; HBIOS RETURNS STATUS IN A - ; RESTORE REGISTERS (AF IS OUTPUT) - JR Z,waitch - ; Return to the loader - LD A,BID_BOOT ; BOOT BANK - LD HL,0 ; ADDRESS ZERO - CALL HB_BNKCALL ; DOES NOT RETURN - HALT +waitch +#IF (BIOS == BIOS_WBW) + LD C,CIODEV_CONSOLE ; CONSOLE UNIT TO C + LD B,BF_CIOIN ; HBIOS FUNC: INPUT CHAR + RST 08 ; DO IT + + ; RETURN TO THE LOADER + LD A,BID_BOOT ; BOOT BANK + LD HL,0 ; ADDRESS ZERO + CALL HB_BNKCALL ; DOES NOT RETURN + HALT +#ENDIF +#IF (BIOS == BIOS_UNA) + LD B,0 ; CONSOLE UNIT TO B + LD C,BF_CIOIN ; UBIOS FUNC: INPUT CHAR + CALL $FFFD ; DO IT + + ; RETURN TO THE LOADER + LD BC,$01FB ; UNA FUNC = SET BANK + LD DE,0 ; ROM BANK 0 + CALL $FFFD ; DO IT + JP 0 ; JUMP TO RESTART ADDRESS +#ENDIF _putcrlf ld hl, crlf _puts push af @@ -200,22 +208,41 @@ puts0 ld a,(hl) puts1 pop af ret -_putc PUSH AF - PUSH BC - PUSH DE - PUSH HL - LD E,A ; OUTPUT CHAR TO E - LD C,CIODEV_CONSOLE; CONSOLE UNIT TO C - LD B,BF_CIOOUT ; HBIOS FUNC: OUTPUT CHAR - RST 08 ; HBIOS OUTPUTS CHARACTDR - POP HL - POP DE - POP BC - POP AF - RET +_putc +#IF (BIOS == BIOS_WBW) + PUSH AF + PUSH BC + PUSH DE + PUSH HL + LD E,A ; OUTPUT CHAR TO E + LD C,CIODEV_CONSOLE ; CONSOLE UNIT TO C + LD B,BF_CIOOUT ; HBIOS FUNC: OUTPUT CHAR + RST 08 ; HBIOS OUTPUTS CHARACTDR + POP HL + POP DE + POP BC + POP AF + RET +#ENDIF +#IF (BIOS == BIOS_UNA) + PUSH AF + PUSH BC + PUSH DE + PUSH HL + LD E,A ; OUTPUT CHAR TO E + LD B,0 ; CONSOLE UNIT TO B + LD C,BF_CIOOUT ; UBIOS FUNC: OUTPUT CHAR + CALL $FFFD ; UBIOS OUTPUTS CHARACTDR + POP HL + POP DE + POP BC + POP AF + RET +#ENDIF + -welcome .db "Generating a Mandelbrot set" - .db cr, lf, eos +welcome .db "Generating a Mandelbrot set..." + .db cr, lf, cr, lf, eos finished .db "Computation finished." crlf .db cr, lf, eos diff --git a/Source/HBIOS/nascom.asm b/Source/HBIOS/nascom.asm index 671513de..e0447606 100644 --- a/Source/HBIOS/nascom.asm +++ b/Source/HBIOS/nascom.asm @@ -29,11 +29,6 @@ ; #INCLUDE "std.asm" ; -; *** HACK TO GET THIS TO BUILD UNDER UNA *** -#IF (BIOS == BIOS_UNA) -#INCLUDE "hbios.inc" -#ENDIF -; ; CUSTOMIZATION ; ABBRERR .EQU FALSE ; Choose between long error message and abbreviated error messages. diff --git a/Source/HBIOS/romldr.asm b/Source/HBIOS/romldr.asm index 5b0a9420..8da83d8e 100644 --- a/Source/HBIOS/romldr.asm +++ b/Source/HBIOS/romldr.asm @@ -459,9 +459,10 @@ REBOOT: CALL HB_BNKCALL ; DOES NOT RETURN #ENDIF #IF (BIOS == BIOS_UNA) - ; UMMM... NEED TO DO SOMETHING HERE... - LD DE,STR_INVALID ; SET ERROR STRING MESSAGE - JP MENU ; AND RESTART MENU LOOP + LD BC,$01FB ; UNA FUNC = SET BANK + LD DE,0 ; ROM BANK 0 + RST 08 ; DO IT + JP 0 ; JUMP TO RESTART ADDRESS #ENDIF ; ;================================================================================================== diff --git a/Source/HBIOS/sd.asm b/Source/HBIOS/sd.asm index 5cf837e8..2930fa72 100644 --- a/Source/HBIOS/sd.asm +++ b/Source/HBIOS/sd.asm @@ -1639,9 +1639,7 @@ SD_SELECT2: SD_DESELECT: LD A,(SD_OPRVAL) #IF (SD_DEVCNT > 1) -; AND ~(SD_CS0 | SD_CS1) -SD_CS .EQU (SD_CS0 | SD_CS1) ; HACK TO WORK AROUND UZ80AX EXPRESSION EVAL ISSUE - AND ~SD_CS + AND ~(SD_CS0 | SD_CS1) #ELSE AND ~SD_CS0 #ENDIF diff --git a/Source/HBIOS/std.asm b/Source/HBIOS/std.asm index 7dc8aa40..89f5fcfd 100644 --- a/Source/HBIOS/std.asm +++ b/Source/HBIOS/std.asm @@ -320,6 +320,10 @@ FORCECON .EQU 0 ; DEFAULT IS TO FOLLOW NORMAL SEQUENCE #INCLUDE "hbios.inc" #ENDIF ; +#IF (BIOS == BIOS_UNA) +#INCLUDE "../UBIOS/ubios.inc" +#ENDIF +; ; ; INCLUDE Z180 REGISTER DEFINITIONS ; @@ -419,7 +423,7 @@ TBC_LOC .EQU $0A00 ; TASTYBASIC TBC_SIZ .EQU $0900 TBC_END .EQU TBC_LOC + TBC_SIZ -EGG_LOC .EQU $0A00 ; EASTER EGG +EGG_LOC .EQU $F000 ; EASTER EGG EGG_SIZ .EQU $0200 EGG_END .EQU EGG_LOC + EGG_SIZ diff --git a/Source/HBIOS/tastybasic.asm b/Source/HBIOS/tastybasic.asm index 7c907dfa..7d009815 100644 --- a/Source/HBIOS/tastybasic.asm +++ b/Source/HBIOS/tastybasic.asm @@ -40,10 +40,6 @@ TBC_LOC .equ 0 #else ; RomWBW #include "std.asm" #endif -; *** HACK TO GET THIS TO BUILD UNDER UNA *** -#IF (BIOS == BIOS_UNA) -#INCLUDE "hbios.inc" -#ENDIF .org TBC_LOC start: diff --git a/Source/UBIOS/ubios.inc b/Source/UBIOS/ubios.inc index 580ec42b..546c671d 100644 --- a/Source/UBIOS/ubios.inc +++ b/Source/UBIOS/ubios.inc @@ -11,27 +11,27 @@ BF_CIOOST .EQU BF_CIO + 4 ; CHARACTER OUTPUT STATUS BF_DIO .EQU $40 BF_DIOREAD .EQU BF_DIO + 2 ; DISK READ BF_DIOWRITE .EQU BF_DIO + 3 ; DISK WRITE +;; +;; MEMORY BANK CONFIGURATION +;; +;ROMSIZE .EQU 512 +;RAMSIZE .EQU 512 ; -; MEMORY BANK CONFIGURATION +;BID_ROM0 .EQU $0000 +;BID_ROMN .EQU (BID_ROM0 + ((ROMSIZE / 32) - 1)) +;BID_RAM0 .EQU $8000 +;BID_RAMN .EQU (BID_RAM0 + ((RAMSIZE / 32) - 1)) ; -ROMSIZE .EQU 512 -RAMSIZE .EQU 512 - -BID_ROM0 .EQU $0000 -BID_ROMN .EQU (BID_ROM0 + ((ROMSIZE / 32) - 1)) -BID_RAM0 .EQU $8000 -BID_RAMN .EQU (BID_RAM0 + ((RAMSIZE / 32) - 1)) - -BID_BOOT .EQU BID_ROM0 ; BOOT BANK -BID_BIOSIMG .EQU BID_ROM0 + 1 ; BIOS IMAGE BANK -BID_OSIMG .EQU BID_ROM0 + 2 ; ROM LOADER AND IMAGES BANK -BID_FSFAT .EQU BID_ROM0 + 3 ; FAT FILESYSTEM DRIVER BANK -BID_ROMD0 .EQU BID_ROM0 + 4 ; FIRST ROM DRIVE BANK -BID_ROMDN .EQU BID_ROMN ; LAST ROM DRIVE BANK - -BID_RAMD0 .EQU BID_RAM0 ; FIRST RAM DRIVE BANK -BID_RAMDN .EQU BID_RAMN - 4 ; LAST RAM DRIVE BANK -BID_AUX .EQU BID_RAMN - 3 ; AUX BANK (BPBIOS, ETC.) -BID_BIOS .EQU BID_RAMN - 2 ; BIOS BANK -BID_USR .EQU BID_RAMN - 1 ; USER BANK (CP/M TPA, ETC.) -BID_COM .EQU BID_RAMN ; COMMON BANK, UPPER 32K +;BID_BOOT .EQU BID_ROM0 ; BOOT BANK +;BID_BIOSIMG .EQU BID_ROM0 + 1 ; BIOS IMAGE BANK +;BID_OSIMG .EQU BID_ROM0 + 2 ; ROM LOADER AND IMAGES BANK +;BID_FSFAT .EQU BID_ROM0 + 3 ; FAT FILESYSTEM DRIVER BANK +;BID_ROMD0 .EQU BID_ROM0 + 4 ; FIRST ROM DRIVE BANK +;BID_ROMDN .EQU BID_ROMN ; LAST ROM DRIVE BANK +; +;BID_RAMD0 .EQU BID_RAM0 ; FIRST RAM DRIVE BANK +;BID_RAMDN .EQU BID_RAMN - 4 ; LAST RAM DRIVE BANK +;BID_AUX .EQU BID_RAMN - 3 ; AUX BANK (BPBIOS, ETC.) +;BID_BIOS .EQU BID_RAMN - 2 ; BIOS BANK +;BID_USR .EQU BID_RAMN - 1 ; USER BANK (CP/M TPA, ETC.) +;BID_COM .EQU BID_RAMN ; COMMON BANK, UPPER 32K diff --git a/Tools/unix/cpmtools/Makefile b/Tools/unix/cpmtools/Makefile index 8c56b657..d630b6f2 100644 --- a/Tools/unix/cpmtools/Makefile +++ b/Tools/unix/cpmtools/Makefile @@ -13,6 +13,9 @@ DEVICE = posix DISKDEFS=$(shell cd ../../cpmtools ; pwd)/diskdefs DEFFORMAT=wbw_fd144 +# Locate the ncurses libs or try a guess if pkg-config does not exist +NCURSESLIBS=$(shell if env pkg-config --libs ncurses ; then : ; else echo -lncurses ; fi) + CPPFLAGS = -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\" DEVICEOBJ = device_posix.o @@ -44,7 +47,7 @@ fsck.cpm: fsck.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) $(CC) $(LDFLAGS) -o $@ fsck.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) fsed.cpm: fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) - $(CC) $(LDFLAGS) -o $@ fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) -lncurses + $(CC) $(LDFLAGS) -o $@ fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) $(NCURSESLIBS) $(DEST): mkdir -p $(DEST)