From 7cdad0b4ed4cdb4668b68a023ae2496865e91f5d Mon Sep 17 00:00:00 2001 From: b1ackmai1er <39449559+b1ackmai1er@users.noreply.github.com> Date: Wed, 7 Nov 2018 15:15:12 +0800 Subject: [PATCH 1/4] Add option to force DS1302 RTC to turn on super caps and battery recharging at boot. --- Source/HBIOS/cfg_sbc.asm | 1 + Source/HBIOS/dsrtc.asm | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Source/HBIOS/cfg_sbc.asm b/Source/HBIOS/cfg_sbc.asm index 8e9813ea..b78d09b4 100644 --- a/Source/HBIOS/cfg_sbc.asm +++ b/Source/HBIOS/cfg_sbc.asm @@ -19,6 +19,7 @@ HTIMENABLE .EQU FALSE ; TRUE FOR SIMH TIMER SUPPORT SIMRTCENABLE .EQU FALSE ; SIMH CLOCK DRIVER DSRTCENABLE .EQU TRUE ; DS-1302 CLOCK DRIVER DSRTCMODE .EQU DSRTCMODE_STD ; DSRTCMODE_STD, DSRTCMODE_MFPIC +DSRTCCHG .EQU FALSE ; DS-1302 CONFIGURE CHARGE ON (TRUE) OR OFF (FALSE) ; ASCIENABLE .EQU FALSE ; TRUE FOR Z180 ASCI SUPPORT UARTENABLE .EQU TRUE ; TRUE FOR UART SUPPORT (ALMOST ALWAYS WANT THIS TO BE TRUE) diff --git a/Source/HBIOS/dsrtc.asm b/Source/HBIOS/dsrtc.asm index 14d17093..c4aaff9c 100644 --- a/Source/HBIOS/dsrtc.asm +++ b/Source/HBIOS/dsrtc.asm @@ -122,6 +122,27 @@ DSRTC_INIT1: CALL DSRTC_CLK2TIM LD HL,DSRTC_TIMBUF CALL PRTDT + +#IF DSRTCCHG ; FORCE_RTC_CHARGE_ENABLE + LD C,$8E ; ACCESS WRITE PROT REG + CALL DSRTC_CMD ; + LD A,$00 ; WRITE PROTECT OFF + CALL DSRTC_PUT ; + CALL DSRTC_END ; FINISH CMD + + LD C,$90 ; ACCESS CHARGE REGISTER + CALL DSRTC_CMD ; + LD A,$A5 ; STD CHARGE VALUES + CALL DSRTC_PUT ; + CALL DSRTC_END ; FINISH REG WRITE + + LD C,$8E ; ACCESS WRITE PROT REG + CALL DSRTC_CMD ; + LD A,$80 ; WRITE PROTECT ON + CALL DSRTC_PUT ; + CALL DSRTC_END ; FINISH CMD +#ENDIF + PRTS(" CHARGE=$") CALL DSRTC_TSTCHG JR NZ,NOCHG1 From d686f982ccc7a5abac425e3d395ba2a8ac120fcc Mon Sep 17 00:00:00 2001 From: b1ackmai1er <39449559+b1ackmai1er@users.noreply.github.com> Date: Wed, 7 Nov 2018 16:21:10 +0800 Subject: [PATCH 2/4] Add a command to return to bootldr --- Source/Apps/reboot.asm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Source/Apps/reboot.asm diff --git a/Source/Apps/reboot.asm b/Source/Apps/reboot.asm new file mode 100644 index 00000000..4ee08390 --- /dev/null +++ b/Source/Apps/reboot.asm @@ -0,0 +1,18 @@ +;=============================================================================== +; +; REBOOT - Execute HBIOS reset to restart to boot loader. +; +;=============================================================================== +; +BID_BOOT .EQU $00 +HB_BNKCALL .EQU $FFF9 + + .org $100 + + LD A,BID_BOOT ; BOOT BANK + LD HL,0 ; ADDRESS ZERO + CALL HB_BNKCALL ; DOES NOT RETURN + HALT + + .end + \ No newline at end of file From 26dea9aa336c445626d7690807f5418e40034445 Mon Sep 17 00:00:00 2001 From: b1ackmai1er <39449559+b1ackmai1er@users.noreply.github.com> Date: Wed, 7 Nov 2018 16:24:14 +0800 Subject: [PATCH 3/4] Add a command to return to bootldr --- Source/Apps/Build.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Apps/Build.cmd b/Source/Apps/Build.cmd index 03acd2bf..266f838f 100644 --- a/Source/Apps/Build.cmd +++ b/Source/Apps/Build.cmd @@ -21,6 +21,7 @@ call :asm Mode || goto :eof call :asm RTC || goto :eof call :asm Timer || goto :eof call :asm180 IntTest || goto :eof +call :asm Reboot || goto :eof zx Z80ASM -SYSGEN/F From 1dbc6ea740de075f4e9a5a32ef7363b6cb12bd1b Mon Sep 17 00:00:00 2001 From: b1ackmai1er <39449559+b1ackmai1er@users.noreply.github.com> Date: Wed, 7 Nov 2018 16:25:37 +0800 Subject: [PATCH 4/4] Add a command to return to bootldr --- Source/HBIOS/Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index 149b05d0..7fd48d9d 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -104,7 +104,7 @@ $ImgFile = "${OutDir}/${RomName}.img" # Final name of IMG image (memory loadable if ($Platform -eq "UNA") {$CBiosFile = '../CBIOS/cbios_una.bin'} else {$CBiosFile = '../CBIOS/cbios_wbw.bin'} # List of RomWBW proprietary apps to imbed in ROM disk. -$RomApps = "assign","fdu","format","mode","osldr","rtc","survey","syscopy","sysgen","talk","timer","xm","inttest" +$RomApps = "assign","fdu","format","mode","osldr","rtc","survey","syscopy","sysgen","talk","timer","xm","inttest","reboot" "" "Building ${RomName}: ${ROMSize}KB ROM configuration ${Config} for Z${CPUType}..."