From 1de6f8f8ab953cd8e55107c56d7f6f00c2997de4 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Thu, 15 Jul 2021 13:28:53 -0700 Subject: [PATCH] Add ROM Updater to Boot Loader - Phil Summers' ROM Updater has been given an official/permanent place in the Boot Loader menu. - Rearranged the order and sizing of the modules in the third ROM bank to allow space for above. - Made a few minor updates to the DSKYng support code. --- Doc/ChangeLog.txt | 1 + Source/Apps/tstdskng.asm | 18 ++++++++---- Source/HBIOS/Build.ps1 | 7 ++--- Source/HBIOS/Build.sh | 13 ++++----- Source/HBIOS/Makefile | 3 +- Source/HBIOS/dskyng.asm | 29 ++++++++++++------- Source/HBIOS/imgpad.asm | 12 -------- Source/HBIOS/imgpad2.asm | 4 +-- Source/HBIOS/netboot.mod | Bin 8192 -> 4096 bytes Source/HBIOS/romldr.asm | 61 ++++++++++++++++++++++----------------- Source/HBIOS/std.asm | 48 +++++++++++++++++++++++------- Source/HBIOS/updater.asm | 11 +++---- Source/ver.inc | 2 +- Source/ver.lib | 2 +- 14 files changed, 120 insertions(+), 91 deletions(-) delete mode 100644 Source/HBIOS/imgpad.asm diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index cbe797d5..80b6f996 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -42,6 +42,7 @@ Version 3.1.1 - PMS: Early DMA support - W?S: Updated FLASH software to v1.3.5 (supports 128KB A29010B, 512KB A29040B) - DDW: Support for DSKYng capabitlities +- WBW: Added Phil Summers' ROM Updater into ROM Loader Version 3.1 ----------- diff --git a/Source/Apps/tstdskng.asm b/Source/Apps/tstdskng.asm index dc1927bb..ef34f35d 100644 --- a/Source/Apps/tstdskng.asm +++ b/Source/Apps/tstdskng.asm @@ -16,9 +16,9 @@ FALSE: .EQU 0 TRUE: .EQU !FALSE ; -DSKY_OSC: .EQU 1000000 ; OSCILLATOR FREQ IN HZ +DSKY_OSC: .EQU 3000000 ; OSCILLATOR FREQ IN HZ ; -BDOS: .EQU FALSE ; BDOS OR DIRECT TO 8250ISH +BDOS: .EQU TRUE ; BDOS OR DIRECT TO 8250ISH ; UART_BASE: .EQU $68 ; UART BASE IO ADDRESS PPI_BASE: .EQU $60 ; PPI BASE IO PORT @@ -31,7 +31,12 @@ PPI_BASE: .EQU $60 ; PPI BASE IO PORT ; 10 04 ; +--08--+ 80 ; -; KEY CODE MAP (KEY CODES) --CCCRRR +; KEY CODE MAP (KEY CODES) CSCCCRRR +; |||||||| +; |||||+++-- ROW +; ||+++----- COL +; |+-------- SHIFT +; +--------- CONTROL ; ; 00 08 10 18 23 ; 01 09 11 19 22 @@ -85,7 +90,7 @@ DSKY_PRESCL: .EQU DSKY_OSC / 100000 ; PRESCALER LD SP,STACK ; CALL PRTSTRD - .DB "\r\nNextGenDSKY Test Program, v1.2, 2021-06-26$" + .DB "\r\nNextGenDSKY Test Program, v1.3, 2021-07-15$" CALL PRTSTRD .DB "\r\nPPI port 0x$" LD A,PPI_BASE @@ -179,7 +184,7 @@ M1: ; M2: CALL CST ; CONSOLE STATUS - JR NZ,M4 ; ABORT IF KEY PRESSED + JP NZ,M4 ; ABORT IF KEY PRESSED CALL DSKY_STAT AND $3F ; DUMP 2 HIGH BITS JR Z,M2 ; LOOP IF STATUS ZERO @@ -198,6 +203,7 @@ M2: M3: PUSH BC CALL DSKY_DIN + XOR %11000000 ; FLIP CONTROL & SHIFT MODIFIERS CALL PRTHEXBYTE CALL PC_SPACE ; SHIFT BUFFER @@ -223,7 +229,7 @@ M3: LD HL,DSPBUF CALL DSKY_PUTENCSTR POP AF - ; TOGGLE LED, KEY CODE: --CCCRRR + ; TOGGLE LED, KEY CODE: CSCCCRRR PUSH AF AND $07 ; ISOLATE ROW LD B,A ; SAVE IN B diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index faeaee73..42f36900 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -194,7 +194,7 @@ if ($Platform -ne "UNA") "Building ${RomName} output files..." # Build 32K OS chunk containing the loader, debug monitor, and two OS images -Concat 'romldr.bin', 'dbgmon.bin', "..\cpm22\cpm_${Bios}.bin", "..\zsdos\zsys_${Bios}.bin" osimg.bin +Concat 'romldr.bin', 'dbgmon.bin', "..\zsdos\zsys_${Bios}.bin", "..\cpm22\cpm_${Bios}.bin" osimg.bin # Build 20K OS chunk containing the loader, debug monitor, and one OS image Concat 'romldr.bin','dbgmon.bin', "..\zsdos\zsys_${Bios}.bin" osimg_small.bin @@ -202,8 +202,8 @@ Concat 'romldr.bin','dbgmon.bin', "..\zsdos\zsys_${Bios}.bin" osimg_small.bin # Build second and third 32K chunks containing supplemental ROM apps (not for UNA) if ($Platform -ne "UNA") { - Concat '..\Forth\camel80.bin', 'nascom.bin', 'tastybasic.bin', 'game.bin', 'eastaegg.bin', 'usrrom.bin' osimg1.bin - Concat 'netboot.mod', 'imgpad2.bin' osimg2.bin + Concat '..\Forth\camel80.bin', 'nascom.bin', 'tastybasic.bin', 'game.bin', 'eastaegg.bin', 'netboot.mod', 'updater.bin', 'usrrom.bin' osimg1.bin + Concat 'imgpad2.bin' osimg2.bin } # @@ -258,7 +258,6 @@ else Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg2.bin',$RomDiskFile $RomFile Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg2.bin' $UpdFile Concat 'hbios_app.bin','osimg_small.bin' $ComFile - # Concat 'hbios_img.bin','osimg_small.bin' $ImgFile } # Remove the temporary working ROM disk file diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index 21adc95f..65f6b205 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -99,21 +99,21 @@ done cp ../Forth/camel80.bin . -make dbgmon.bin romldr.bin eastaegg.bin imgpad2.bin +make dbgmon.bin romldr.bin imgpad2.bin if [ $platform != UNA ] ; then - make nascom.bin tastybasic.bin game.bin usrrom.bin imgpad2.bin + make nascom.bin tastybasic.bin game.bin eastaegg.bin updater.bin usrrom.bin imgpad2.bin make hbios_rom.bin hbios_app.bin hbios_img.bin fi echo "Building $romname output files..." -cat romldr.bin dbgmon.bin ../CPM22/cpm_$BIOS.bin ../ZSDOS/zsys_$BIOS.bin >osimg.bin +cat romldr.bin dbgmon.bin ../ZSDOS/zsys_$BIOS.bin ../CPM22/cpm_$BIOS.bin >osimg.bin cat romldr.bin dbgmon.bin ../ZSDOS/zsys_$BIOS.bin >osimg_small.bin if [ $platform != UNA ] ; then - cat camel80.bin nascom.bin tastybasic.bin game.bin eastaegg.bin usrrom.bin >osimg1.bin - cat netboot.mod imgpad2.bin >osimg2.bin + cat camel80.bin nascom.bin tastybasic.bin game.bin eastaegg.bin netboot.mod updater.bin usrrom.bin >osimg1.bin + cat imgpad2.bin >osimg2.bin fi echo "Building ${romsize}KB $romname ROM disk data file..." @@ -165,7 +165,4 @@ else cat hbios_rom.bin osimg.bin osimg1.bin osimg2.bin $romdiskfile >$romname.rom cat hbios_rom.bin osimg.bin osimg1.bin osimg2.bin >$romname.upd cat hbios_app.bin osimg_small.bin > $romname.com - # cat hbios_img.bin osimg_small.bin > $romname.img fi - -#rm $romdiskfile diff --git a/Source/HBIOS/Makefile b/Source/HBIOS/Makefile index df3845ff..a6edb1b0 100644 --- a/Source/HBIOS/Makefile +++ b/Source/HBIOS/Makefile @@ -37,7 +37,7 @@ endif MOREDIFF = camel80.bin game.bin hbios_rom.bin nascom.bin prefix.bin usrrom.bin \ dbgmon.bin hbios_app.bin imgpad2.bin osimg1.bin osimg2.bin romldr.bin \ eastaegg.bin hbios_img.bin osimg.bin tastybasic.bin \ - game.bin usrrom.bin + game.bin updater.bin usrrom.bin SUBDIRS = DEST = ../../Binary @@ -81,6 +81,7 @@ romldr.bin: build.inc dbgmon.bin: build.inc nascom.bin: build.inc eastaegg.bin: build.inc +updater.bin: build.inc dumps: for i in $(MOREDIFF) ; do \ diff --git a/Source/HBIOS/dskyng.asm b/Source/HBIOS/dskyng.asm index e351e925..5f244105 100644 --- a/Source/HBIOS/dskyng.asm +++ b/Source/HBIOS/dskyng.asm @@ -13,7 +13,12 @@ ; 10 04 ; +--08--+ 80 ; -; KEY CODE MAP (KEY CODES) --CCCRRR +; KEY CODE MAP (KEY CODES) CSCCCRRR +; |||||||| +; |||||+++-- ROW +; ||+++----- COL +; |+-------- SHIFT +; +--------- CONTROL ; ; 00 08 10 18 23 ; 01 09 11 19 22 @@ -147,7 +152,9 @@ DSKY_GETKEY: LD A,DSKY_CMD_FIFO CALL DSKY_CMD CALL DSKY_DIN - AND $3F ; STRIP OFF SHIFT AND CONTROL KEYS (FOR NOW) + XOR %11000000 ; FLIP POLARITY OF SHIFT/CTL BITS + PUSH AF ; SAVE VALUE + AND $3F ; STRIP SHIFT/CTL BITS FOR LOOKUP LD B,28 ; SIZE OF DECODE TABLE LD C,0 ; INDEX LD HL,DSKY_KEYMAP ; POINT TO BEGINNING OF TABLE @@ -157,11 +164,15 @@ DSKY_GETKEY1: INC HL INC C ; BUMP INDEX DJNZ DSKY_GETKEY1 ; LOOP UNTIL EOT + POP AF ; FIX STACK LD A,$FF ; NOT FOUND ERR, RETURN $FF RET DSKY_GETKEY2: ; RETURN THE INDEX POSITION WHERE THE SCAN CODE WAS FOUND - LD A,C ; RETURN INDEX VALUE + ; THE ORIGINAL SHIFT/CTRL BITS ARE RESTORED + POP AF ; RESTORE RAW VALUE + AND %11000000 ; ISOLATE SHIFT/CTRL BITS + OR C ; COMBINE WITH INDEX VALUE RET ; ;_KEYMAP_TABLE_____________________________________________________________________________________________________________ @@ -558,7 +569,7 @@ DSKY_L2ON: LD C,$0E CALL DSKY_GETBYTE - and $DF + or $20 LD C,$0E CALL DSKY_PUTBYTE @@ -592,7 +603,7 @@ DSKY_L2OFF: LD C,$0E CALL DSKY_GETBYTE - or $20 + and $DF LD C,$0E CALL DSKY_PUTBYTE @@ -665,14 +676,10 @@ DSKY_PPIRD1: ; DSKY_PPIIDLE: JR DSKY_PPIRD ; SAME AS READ MODE -; -; -; - ; ; CODES FOR NUMERICS -; HIGH BIT ALWAYS SET TO SUPPRESS DECIMAL POINT -; CLEAR HIGH BIT TO SHOW DECIMAL POINT +; HIGH BIT ALWAYS CLEAR TO SUPPRESS DECIMAL POINT +; SET HIGH BIT TO SHOW DECIMAL POINT ; HEXMAP: DSKY_NUMS: diff --git a/Source/HBIOS/imgpad.asm b/Source/HBIOS/imgpad.asm deleted file mode 100644 index 8ca47e5d..00000000 --- a/Source/HBIOS/imgpad.asm +++ /dev/null @@ -1,12 +0,0 @@ -#INCLUDE "std.asm" -; -SLACK .EQU ($8000-LDR_SIZ-MON_SIZ-SYS_SIZ-SYS_SIZ-EGG_SIZ) - .FILL SLACK,00H -; -MON_STACK .EQU $ -; - .ECHO "Padspace space created: " - .ECHO SLACK - .ECHO " bytes.\n" - - .END diff --git a/Source/HBIOS/imgpad2.asm b/Source/HBIOS/imgpad2.asm index 6a2ad74c..43099f3d 100644 --- a/Source/HBIOS/imgpad2.asm +++ b/Source/HBIOS/imgpad2.asm @@ -1,9 +1,7 @@ #INCLUDE "std.asm" ; -SLACK .EQU ($8000-NET_SIZ) +SLACK .EQU $8000 .FILL SLACK,00H -; -MON_STACK .EQU $ ; .ECHO "Padspace space created: " .ECHO SLACK diff --git a/Source/HBIOS/netboot.mod b/Source/HBIOS/netboot.mod index 12ee0b55e438d08b0644c08bf552b2fd5585bda1..674d9e9b95585b250a7ca018868d8cff8b6bbe13 100644 GIT binary patch delta 6 NcmZp0Xi!)n000N}0ucZJ delta 16 WcmZorXmD5{usMKz0|$@@U