Browse Source

CP/M 3 Date Hack

- Hack to allow INTRTC to increment time without destroying the date
patch
Wayne Warthen 6 years ago
parent
commit
153b494e61
  1. 25
      Source/CPM3/boot.z80

25
Source/CPM3/boot.z80

@ -497,9 +497,14 @@ time$get:
rst 08 ; do it
ret nz ; bail out on error
ld a,(datehack)
or a
jr nz,time$get1
; convert yymmss in time buffer -> cpm3 epoch date offset
call date2cpm ; time buf (yr, mon, day) -> SCB (@date)
time$get1:
; set time fields in SCB
ld a,(tim$hr) ; get hour from time buf
ld (@hour),a ; ... and put in SCB
@ -514,7 +519,23 @@ time$set:
; CPM date/time in SCB -> RTC
; convert CPM3 epoch date offset in SCB -> yymmss in time buffer
call cpm2date ; SCB (@date) -> time buf (yr, mon, day)
;call cpm2date ; SCB (@date) -> time buf (yr, mon, day)
; this is a temporary hack!!!
; since we cannot actually set the date on the RTC, we
; just read the current RTC date and use that so that we
; don't clobber a potentially good date.
; read time from RTC
ld b,020h ; HBIOS func: get time
ld hl,tim$buf ; time buffer
rst 08 ; do it
ret nz ; bail out on error
;
; now we set a hack active flag so that future time$get
; calls do not update the date field in the SCB
;
ld a,0FFh ; true value
ld (datehack),a ; save it
; copy CPM3 time values from SCB -> time buffer
ld a,(@hour) ; get hour from SCB
@ -629,6 +650,8 @@ tim$hr db 01h
tim$min db 02h
tim$sec db 03h
datehack db 00h
open:
ld c,15
jp bdos

Loading…
Cancel
Save