A2osX/ProDOS.FX/ProDOS.S.XCLK.txt
2023-11-04 15:42:28 +01:00

104 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
XCLK.API.RDCLK .EQ $D8F0
*--------------------------------------
XCLK.START .PH CLK
XCLK.START1 php
sei
ldx #XCLK.START2xx.L-1
.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
sta GP.TIME
* Hour
lda XCLK.API.RTCBUF+2
and #%00111111 23
jsr XCLK.BCD2BIN
sta GP.TIME+1
* Day
lda XCLK.API.RTCBUF+4
and #%00111111 31
jsr XCLK.BCD2BIN
sta GP.DATE
* Year
lda XCLK.API.RTCBUF+6 99
jsr XCLK.BCD2BIN
sta GP.DATE+1
* Month
lda XCLK.API.RTCBUF+5
and #%00011111 12
jsr XCLK.BCD2BIN
asl
asl
asl
asl
asl
tsb GP.DATE
rol GP.DATE+1
plp
rts
XCLK.BCD2BIN tax
and #$F0
lsr CC
sta ZP.PCL temp location
lsr CC
lsr CC
adc ZP.PCL
sta ZP.PCL
txa
* clc
and #$0F
adc ZP.PCL
rts
XCLK.START2xx bit IO.RROMBNK2
sta $C070
bit $FACA
bit $FACA
bit $FAFE
jsr XCLK.API.RDCLK
bit $F851
bit IO.RRAMWRAMBNK1
bit IO.RRAMWRAMBNK1
rts
XCLK.START2xx.L .EQ *-XCLK.START2xx
*--------------------------------------
XCLK.CODE2xx .EQ XCLK.API.RTCBUF-XCLK.START2xx.L
*--------------------------------------
.EP
*--------------------------------------
* .LIST ON
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