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 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 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}..." 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