Use MACHID to check for realtime clock.

There's no need to do guesswork to know if a realtime clock is present/active.
This commit is contained in:
Oliver Schmidt
2019-09-10 09:49:06 +02:00
parent c53b167307
commit 3b128ba59f
4 changed files with 22 additions and 26 deletions

View File

@@ -27,10 +27,10 @@ _clock_getres:
ldx #<day_res
ldy #>day_res
; Check for existing minutes or hours
lda TIMELO
ora TIMELO+1
beq :+
; Check for realtme clock
lda MACHID
lsr a
bcc :+
; Switch to minute resolution
ldx #<min_res

View File

@@ -21,11 +21,11 @@ _clock_settime:
ldy __dos_type
beq enosys
; Check for existing minutes or hours
; Check for realtme clock
tay ; Save A
lda TIMELO
ora TIMELO+1
bne erange
lda MACHID
lsr a
bcs erange
tya ; Restore A
; Get tm