A2osX/SYS/PM.VEDRIVE.S.U1.txt

246 lines
4.1 KiB
Plaintext
Raw Normal View History

2022-03-13 12:58:15 +00:00
NEW
AUTO 3,1
*--------------------------------------
U1.Init lda CONF.SLOT
asl
asl
asl
asl
sta Slotn0
tax
lda /PP.ID
sta PacketPagePTR+1,x
lda #PP.ID
sta PacketPagePTR,x
lda PacketPageDATA+1,x
cmp /CS8900A.DEVID
bne .9
lda PacketPageDATA,x
cmp #CS8900A.DEVID
beq .1
.9 sec
rts
.1 lda CONF.SLOT
pha
lda /PP.REVISION Get Revision# of ths chip...
sta PacketPagePTR+1,x
lda #PP.REVISION
sta PacketPagePTR,x
lda PacketPageDATA+1,x
pha
lda PacketPageDATA,x
pha
lda #U1.Name
pha
lda /U1.Name
pha
>LDYAI VEDRIVE.NICOK
jsr PrintFYA
ldx Slotn0
lda /PP.RxCTL
sta PacketPagePTR+1,x
lda #PP.RxCTL
sta PacketPagePTR,x
lda /PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
sta PacketPageDATA+1,x
lda #PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
sta PacketPageDATA,x
lda /PP.MAC
sta PacketPagePTR+1,x
lda #PP.MAC
sta PacketPagePTR,x
lda CONF.SRCMAC+1
sta PacketPageDATA+1,x
lda CONF.SRCMAC+0
sta PacketPageDATA,x
lda /PP.MAC+2
sta PacketPagePTR+1,x
lda #PP.MAC+2
sta PacketPagePTR,x
lda CONF.SRCMAC+3
sta PacketPageDATA+1,x
lda CONF.SRCMAC+2
sta PacketPageDATA,x
lda /PP.MAC+4
sta PacketPagePTR+1,x
lda #PP.MAC+4
sta PacketPagePTR,x
lda CONF.SRCMAC+5
sta PacketPageDATA+1,x
lda CONF.SRCMAC+4
sta PacketPageDATA,x
lda /PP.LineCTL
sta PacketPagePTR+1,x
lda #PP.LineCTL
sta PacketPagePTR,x
lda /PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
sta PacketPageDATA+1,x
lda #PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
sta PacketPageDATA,x
clc
rts
*--------------------------------------
U1.READ php
sei
ldx Slotn0
lda /PP.RxEvent
sta PacketPagePTR+1,x
lda #PP.RxEvent
sta PacketPagePTR,x
lda PacketPageDATA+1,x
ldy PacketPageDATA,x
and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
beq U1.READWRITE.9
lda RTDATA+1,x discard RxStatus
lda RTDATA,x
lda RTDATA+1,x get RxLength
sta ZPBufCnt+1
eor #$ff
sta ZPnCnt+1
lda RTDATA,x
sta ZPBufCnt
eor #$ff
sta ZPnCnt
ldx Slotn0
lda ZPBufPtr+1
pha
ldy #0
.2 inc ZPnCnt
bne .3
inc ZPnCnt+1
beq .8
.3 lda RTDATA,x
sta (ZPBufPtr),y
iny
inc ZPnCnt
bne .4
inc ZPnCnt+1
beq .8
.4 lda RTDATA+1,x
sta (ZPBufPtr),y
iny
bne .2
inc ZPBufPtr+1
bra .2
.8 pla
sta ZPBufPtr+1
plp
clc
rts
*--------------------------------------
U1.READWRITE.9 plp
sec
rts
*--------------------------------------
U1.WRITE php
sei
ldx Slotn0
lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL
sta TxCMD+1,x
lda #PP.TxCMD.LID+PP.TxCMD.TxStartFULL
sta TxCMD,x
lda ZPBufCnt+1
sta TxLength+1,x
eor #$ff
sta ZPnCnt+1
lda ZPBufCnt
sta TxLength,x
eor #$ff
sta ZPnCnt
lda /PP.BusST
sta PacketPagePTR+1,x
lda #PP.BusST
sta PacketPagePTR,x
lda PacketPageDATA+1,x
ldy PacketPageDATA,x
bit /PP.BusST.Rdy4TxNOW
beq U1.READWRITE.9
ldx Slotn0
ldy #0
.1 inc ZPnCnt
bne .2
inc ZPnCnt+1
beq .8
.2 lda (ZPBufPtr),y
sta RTDATA,x
iny
inc ZPnCnt
bne .3
inc ZPnCnt+1
beq .8
.3 lda (ZPBufPtr),y
sta RTDATA+1,x
iny
bne .1
inc ZPBufPtr+1
bne .1
.8 plp
clc
rts
*--------------------------------------
U1.Name >PSTR "Uthernet V1"
*--------------------------------------
DRV.U1 .EQ *
.PH $D400
.EP
*--------------------------------------
MAN
SAVE usr/src/sys/pm.vedrive.s.u1
LOAD usr/src/sys/pm.vedrive.s
ASM