mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-01 14:50:10 +00:00
64b71db7b3
NSC: Reverted to $C3xx I/O space
127 lines
2.0 KiB
Plaintext
127 lines
2.0 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
* Driver For DS1216E
|
||
*--------------------------------------
|
||
* we can safely use $200 (used by TCLK)
|
||
*--------------------------------------
|
||
DS1216E.DATA .EQ $200 Reverted YY MM DD Day HH mm SS CS
|
||
*--------------------------------------
|
||
NCLK.START php
|
||
sei NO IRQ !!!
|
||
|
||
lda RDCXROM
|
||
php
|
||
|
||
sta SETCXROM
|
||
|
||
sta NSC.IOBASE
|
||
* lda $C00B Workaround for Ultrawarp bug
|
||
|
||
lda NSC.IOBASE+4 Reset DS1216E comparison register with READ A2=1
|
||
|
||
ldy #8 Read 8 bytes...
|
||
|
||
.1 lda DS1216E.SIG-1,y
|
||
phy
|
||
|
||
ldy #8 ....of 8 bits
|
||
|
||
.2 ldx #0
|
||
lsr
|
||
bcc .3
|
||
|
||
inx
|
||
|
||
.3 bit NSC.IOBASE,x Write Pattern bit in A0, with A2=0
|
||
|
||
dey
|
||
bne .2
|
||
|
||
ply
|
||
dey
|
||
bne .1
|
||
|
||
ldx #8
|
||
|
||
.4 ldy #8
|
||
|
||
.5 pha
|
||
lda NSC.IOBASE+4 Read Byte...
|
||
|
||
lsr
|
||
pla
|
||
ror
|
||
|
||
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
|
||
bpl .6
|
||
|
||
sta DS1216E.DATA-1,x
|
||
dex
|
||
bne .4
|
||
|
||
pha DS1216E.DATA
|
||
|
||
lda DS1216E.DATA+1 Get MM
|
||
asl
|
||
asl
|
||
asl
|
||
asl
|
||
asl
|
||
ora DS1216E.DATA+2 Get DD
|
||
sta DATELO
|
||
|
||
* lda DS1216E.DATA Get YY
|
||
|
||
pla
|
||
rol
|
||
sta DATELO+1
|
||
|
||
lda DS1216E.DATA+5 Get mm
|
||
sta TIMELO
|
||
|
||
lda DS1216E.DATA+4 Get HH
|
||
sta TIMELO+1
|
||
|
||
plp
|
||
bmi .8
|
||
|
||
sta CLRCXROM
|
||
|
||
.8 plp
|
||
rts
|
||
*--------------------------------------
|
||
DS1216E.SIG .HS 5CA33AC55CA33AC5 Reverted 7->0
|
||
*--------------------------------------
|
||
.LIST ON
|
||
NCLK.LEN .EQ *-NCLK.START
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* CONTROL SECTION :
|
||
*--------------------------------------
|
||
.DO NCLK.LEN>125
|
||
ERROR:NCLK Driver too big
|
||
.FIN
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/prodos.fx/prodos.s.nclk
|
||
LOAD usr/src/prodos.fx/prodos.s
|
||
ASM
|