Kernel version 0.9 : UTHERNET2.DRV.S.txt, Change in RESET Time

This commit is contained in:
Rémy GIBERT 2017-04-04 17:39:09 +02:00
parent 92c34d5fde
commit 993ace3a59
4 changed files with 40 additions and 22 deletions

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
LOMEM $A00
INC 1
AUTO 6
.LIST OFF
@ -10,11 +10,15 @@ AUTO 6
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/MLI.ERR.I
.INB /A2OSX.BUILD/INC/NET.I
.INB /A2OSX.BUILD/INC/NET.W5100.I
.INB /A2OSX.BUILD/INC/LIBTCPIP.I
*--------------------------------------
ZPTmpPTR .EQ ZPDRV
RXTX.Size .EQ ZPDRV+2
Counter .EQ ZPDRV+4
Offset .EQ ZPDRV+6
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -62,10 +66,10 @@ Dev.Detect >STYA Args
lda #W5100.MR.AI+W5100.MR.IND
sta W5100.MR,x
pha
pla
lda W5100.MR,x
cmp #W5100.MR.AI+W5100.MR.IND
bne .2
@ -149,7 +153,7 @@ DEV.HEADER cld
jmp (DRV.CS.START,x)
.DA #0
.BS 6
DEV.HEADER.NAME >PSTR "ETH7" NAME
DEV.HEADER.NAME >PSTR "ETH7" NAME
*--------------------------------------
* Driver Code
*--------------------------------------
@ -166,7 +170,7 @@ DRV.CS.START .DA STATUS
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #1 MLI.ERR.BADCALL
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
@ -177,15 +181,15 @@ STATUS >LDYA L.DEVSTAT
READBLOCK ldx DEVSLOTx0
>AR.SELECT S0.RX.RSR
lda W5100.DR,x get the received size HI
lda W5100.DR,x get the received size HI
ora W5100.DR,x LO
bne READBLOCK.RxOK
lda #ERR.DEV.NOFRAME
READBLOCK.Err sec
rts
READBLOCK.RxOK >AR.SELECT S0.RX.RD
lda W5100.DR,x get the received ptr HI
ldy W5100.DR,x get the received ptr LO
@ -209,7 +213,7 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
bcs .1
dey
.1 sty RXTX.Size+1
* >PUSHYA Already pushed....
>PUSHBI 0
>SYSCALL GetMem
@ -246,7 +250,7 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
bne .2
inc ZPTmpPTR+1
bne .2
.4 >AR.SELECT S0.RX.RD
ldy W5100.DR,x Get HI
lda W5100.DR,x Get LO
@ -261,17 +265,17 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
sta W5100.DR,x write HI
pla
sta W5100.DR,x write LO
>AR.SELECT S0.CR
lda #$40 RECV
lda #W5100.AR.S0.CR.RCVD
sta W5100.DR,x
.8 ldx #$ff hMem
ldy #$ff PtrLO
lda #$ff PtrHI
clc
rts
*--------------------------------------
*--------------------------------------
WRITEBLOCK >PULLW ZPTmpPTR
lda (ZPTmpPTR)
@ -336,8 +340,8 @@ WRITEBLOCK.1 ldy #S.ETH.SRCMAC+5
.4 >AR.SELECT S0.TX.WR
clc
lda Offset
clc
adc RXTX.Size
pha save LO
@ -379,9 +383,8 @@ OPEN jsr CLOSE
lda #W5100.AR.S0.MR.MACRAW+W5100.AR.S0.MR.MF
sta W5100.DR,x
>AR.SELECT S0.CR
lda #1 OPEN
lda #W5100.AR.S0.CR.OPEN
sta W5100.DR,x
clc
@ -390,16 +393,22 @@ OPEN jsr CLOSE
CLOSE ldx DEVSLOTx0
lda #W5100.MR.RST
sta W5100.MR,x
lda $C019 we can use VBL as we are not on //c
.1 eor $C019
bpl .1
lda $C019
.2 eor $C019
bpl .2
clc
rts
*--------------------------------------
DRV.CS.END
DEVSLOTx0 .BS 1
RXTX.Size .BS 2
Counter .BS 2
Offset .BS 2
*--------------------------------------
DEVSTAT .DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ
DEVSTAT .DA #0
.BS 3 size
>PSTR "UtherNetII/W5100"
.DA #S.DEVSTAT.TYPE.NET

Binary file not shown.

Binary file not shown.

View File

@ -46,6 +46,15 @@ W5100.AR.S0.MR.IPRAW .EQ $03
W5100.AR.S0.MR.MACRAW .EQ $04
W5100.AR.S0.MR.PPPOE .EQ $05
W5100.AR.S0.CR .EQ $0401
W5100.AR.S0.CR.OPEN .EQ $01
W5100.AR.S0.CR.LISTEN .EQ $02
W5100.AR.S0.CR.CONNECT .EQ $04
W5100.AR.S0.CR.DISCON .EQ $08
W5100.AR.S0.CR.CLOSE .EQ $10
W5100.AR.S0.CR.SEND .EQ $20
W5100.AR.S0.CR.SENDMAC .EQ $21
W5100.AR.S0.CR.SENDKEEP .EQ $22
W5100.AR.S0.CR.RCVD .EQ $40
W5100.AR.S0.IR .EQ $0402
W5100.AR.S0.SR .EQ $0403
W5100.AR.S0.PORT .EQ $0404