2022-04-19 18:24:34 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver For ROMXce Clock
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* we can safely use $200, PCL/H, AIL/H (used by TCLK)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
XCLK.API.RTCBUF .EQ $2B0
|
2022-04-20 17:37:15 +00:00
|
|
|
|
XCLK.API.RDCLK .EQ $D8F0
|
2022-04-19 18:24:34 +00:00
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
XCLK.START .PH CLK
|
|
|
|
|
|
|
|
|
|
XCLK.START1 php
|
2022-04-19 18:24:34 +00:00
|
|
|
|
sei
|
2022-06-12 20:42:22 +00:00
|
|
|
|
ldx #XCLK.START2xx.L-1
|
2022-04-19 18:24:34 +00:00
|
|
|
|
|
|
|
|
|
.1 lda XCLK.START2xx,X
|
|
|
|
|
sta XCLK.CODE2xx,X
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
jsr XCLK.CODE2xx
|
|
|
|
|
* Minutes
|
|
|
|
|
lda XCLK.API.RTCBUF+1
|
|
|
|
|
and #%01111111 59
|
|
|
|
|
jsr XCLK.BCD2BIN
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta GP.TIME
|
2022-04-19 18:24:34 +00:00
|
|
|
|
* Hour
|
|
|
|
|
lda XCLK.API.RTCBUF+2
|
|
|
|
|
and #%00111111 23
|
|
|
|
|
jsr XCLK.BCD2BIN
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta GP.TIME+1
|
2022-04-19 18:24:34 +00:00
|
|
|
|
* Day
|
|
|
|
|
lda XCLK.API.RTCBUF+4
|
|
|
|
|
and #%00111111 31
|
|
|
|
|
jsr XCLK.BCD2BIN
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta GP.DATE
|
2022-04-19 18:24:34 +00:00
|
|
|
|
* Year
|
|
|
|
|
lda XCLK.API.RTCBUF+6 99
|
|
|
|
|
jsr XCLK.BCD2BIN
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta GP.DATE+1
|
2022-04-19 18:24:34 +00:00
|
|
|
|
* Month
|
|
|
|
|
lda XCLK.API.RTCBUF+5
|
|
|
|
|
and #%00011111 12
|
|
|
|
|
jsr XCLK.BCD2BIN
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
2023-11-04 14:42:28 +00:00
|
|
|
|
tsb GP.DATE
|
|
|
|
|
rol GP.DATE+1
|
2022-04-19 18:24:34 +00:00
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
XCLK.BCD2BIN tax
|
|
|
|
|
and #$F0
|
|
|
|
|
lsr CC
|
2023-11-04 14:42:28 +00:00
|
|
|
|
sta ZP.PCL temp location
|
2022-04-19 18:24:34 +00:00
|
|
|
|
lsr CC
|
|
|
|
|
lsr CC
|
2023-11-04 14:42:28 +00:00
|
|
|
|
adc ZP.PCL
|
|
|
|
|
sta ZP.PCL
|
2022-04-19 18:24:34 +00:00
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
* clc
|
|
|
|
|
and #$0F
|
2023-11-04 14:42:28 +00:00
|
|
|
|
adc ZP.PCL
|
2022-04-19 18:24:34 +00:00
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
2023-11-04 14:42:28 +00:00
|
|
|
|
XCLK.START2xx bit IO.RROMBNK2
|
2022-04-19 18:24:34 +00:00
|
|
|
|
sta $C070
|
|
|
|
|
bit $FACA
|
|
|
|
|
bit $FACA
|
|
|
|
|
bit $FAFE
|
|
|
|
|
jsr XCLK.API.RDCLK
|
|
|
|
|
bit $F851
|
2023-11-04 14:42:28 +00:00
|
|
|
|
bit IO.RRAMWRAMBNK1
|
|
|
|
|
bit IO.RRAMWRAMBNK1
|
2022-04-19 18:24:34 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
XCLK.START2xx.L .EQ *-XCLK.START2xx
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
XCLK.CODE2xx .EQ XCLK.API.RTCBUF-XCLK.START2xx.L
|
|
|
|
|
*--------------------------------------
|
2023-11-04 14:42:28 +00:00
|
|
|
|
.EP
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* .LIST ON
|
2022-04-19 18:24:34 +00:00
|
|
|
|
XCLK.LEN .EQ *-XCLK.START
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* CONTROL SECTION :
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO XCLK.LEN>125
|
|
|
|
|
ERROR:XCLK Driver too big
|
|
|
|
|
.FIN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/prodos.fx/prodos.s.xclk
|
|
|
|
|
LOAD usr/src/prodos.fx/prodos.s
|
|
|
|
|
ASM
|