A2osX/ProDOS.FX/ProDOS.S.NCLK.txt

131 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

2019-11-04 07:21:40 +00:00
NEW
AUTO 3,1
*--------------------------------------
* Driver For DS1216E
*--------------------------------------
2021-05-30 20:34:03 +00:00
* we can safely use $200 (used by TCLK)
*--------------------------------------
DS1216E.DATA .EQ $200 Reverted YY MM DD Day HH mm SS CS
*--------------------------------------
2023-11-04 14:42:28 +00:00
NCLK.START .PH CLK
NCLK.START1 php
2021-05-30 20:34:03 +00:00
sei NO IRQ !!!
2023-11-04 14:42:28 +00:00
lda IO.RDCXROM
2021-06-22 18:59:02 +00:00
php
2023-11-04 14:42:28 +00:00
sta IO.SETCXROM
2021-05-30 20:34:03 +00:00
sta NSC.IOBASE
2021-07-24 20:42:23 +00:00
* lda $C00B Workaround for Ultrawarp bug
2021-06-06 19:06:49 +00:00
lda NSC.IOBASE+4 Reset DS1216E comparison register with READ A2=1
2019-11-04 07:21:40 +00:00
2021-06-22 18:59:02 +00:00
ldy #8 Read 8 bytes...
2021-05-30 20:34:03 +00:00
.1 lda DS1216E.SIG-1,y
2021-06-22 18:59:02 +00:00
phy
2021-05-30 20:34:03 +00:00
2021-06-22 18:59:02 +00:00
ldy #8 ....of 8 bits
2021-05-30 20:34:03 +00:00
2021-06-22 18:59:02 +00:00
.2 ldx #0
lsr
bcc .3
inx
.3 bit NSC.IOBASE,x Write Pattern bit in A0, with A2=0
2021-05-30 20:34:03 +00:00
2021-06-22 18:59:02 +00:00
dey
2019-11-04 07:21:40 +00:00
bne .2
2021-06-22 18:59:02 +00:00
ply
dey
2021-05-30 20:34:03 +00:00
bne .1
2019-11-04 07:21:40 +00:00
2021-05-30 20:34:03 +00:00
ldx #8
2019-11-04 07:21:40 +00:00
.4 ldy #8
2021-05-30 20:34:03 +00:00
.5 pha
lda NSC.IOBASE+4 Read Byte...
2019-11-04 07:21:40 +00:00
lsr
2021-05-30 20:34:03 +00:00
pla
ror
2019-11-04 07:21:40 +00:00
dey
bne .5
pha
lsr
lsr
lsr
lsr
tay
pla
and #$0F
clc
.HS 2C Bit Absolute to skip adc #$0A
.6 adc #$0A
dey
2021-05-30 20:34:03 +00:00
bpl .6
2019-11-04 07:21:40 +00:00
2021-05-30 20:34:03 +00:00
sta DS1216E.DATA-1,x
2019-11-04 07:21:40 +00:00
dex
2021-05-30 20:34:03 +00:00
bne .4
pha DS1216E.DATA
2019-11-04 07:21:40 +00:00
lda DS1216E.DATA+1 Get MM
asl
asl
asl
asl
asl
ora DS1216E.DATA+2 Get DD
2023-11-04 14:42:28 +00:00
sta GP.DATE
2021-05-30 20:34:03 +00:00
* lda DS1216E.DATA Get YY
pla
rol
2023-11-04 14:42:28 +00:00
sta GP.DATE+1
2021-05-30 20:34:03 +00:00
lda DS1216E.DATA+5 Get mm
2023-11-04 14:42:28 +00:00
sta GP.TIME
2021-05-30 20:34:03 +00:00
lda DS1216E.DATA+4 Get HH
2023-11-04 14:42:28 +00:00
sta GP.TIME+1
2019-11-04 07:21:40 +00:00
plp
2021-06-03 17:43:28 +00:00
bmi .8
2021-05-30 20:34:03 +00:00
2023-11-04 14:42:28 +00:00
sta IO.CLRCXROM
2021-05-30 20:34:03 +00:00
2021-06-22 18:59:02 +00:00
.8 plp
rts
2019-11-04 07:21:40 +00:00
*--------------------------------------
DS1216E.SIG .HS 5CA33AC55CA33AC5 Reverted 7->0
2019-11-04 07:21:40 +00:00
*--------------------------------------
2023-11-04 14:42:28 +00:00
.EP
*--------------------------------------
* .LIST ON
2019-11-04 07:21:40 +00:00
NCLK.LEN .EQ *-NCLK.START
2021-05-30 20:34:03 +00:00
.LIST OFF
*--------------------------------------
* CONTROL SECTION :
*--------------------------------------
.DO NCLK.LEN>125
ERROR:NCLK Driver too big
.FIN
2019-11-04 07:21:40 +00:00
*--------------------------------------
MAN
2020-08-30 17:50:57 +00:00
SAVE usr/src/prodos.fx/prodos.s.nclk
LOAD usr/src/prodos.fx/prodos.s
2019-11-04 07:21:40 +00:00
ASM