2015-08-05 20:38:05 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2016-10-17 15:47:50 +00:00
|
|
|
|
NEW
|
2015-08-05 20:38:05 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF /A2OSX.BOOT/DRV/UTHERNET2.DRV
|
|
|
|
|
*--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/A2OSX.I
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/NET.W5100.I
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/LIBTCPIP.I
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPTmpPTR .EQ ZPDRV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp Dev.Detect cld,jmp abs=DRV
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 DRV Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length
|
|
|
|
|
.DA DEV.HEADER-CS.START Device Header Offset
|
|
|
|
|
.DA DRV.CS.START-CS.START Driver Code Offset
|
|
|
|
|
.DA DRV.CS.END-DRV.CS.START Drv Code Length
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
2016-01-04 07:29:32 +00:00
|
|
|
|
L.MSG.DETECT.OK .DA MSG.DETECT.OK
|
|
|
|
|
L.MSG.DETECT.KO .DA MSG.DETECT.KO
|
|
|
|
|
L.DEV.HEADER.NAME .DA DEV.HEADER.NAME
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2016-10-17 15:47:50 +00:00
|
|
|
|
Dev.Detect >STYA Args
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>LDYA L.MSG.DETECT
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
ldx #$70
|
|
|
|
|
|
|
|
|
|
.1 txa IO based detection, avoid scanning in Disk Controller IO!!!!
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda A2osX.SLOTS,y
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
lda #W5100.MR.RST
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
|
2017-02-19 20:14:09 +00:00
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
.10 dec give some time....
|
|
|
|
|
bne .10
|
|
|
|
|
|
2016-01-06 17:02:39 +00:00
|
|
|
|
lda #W5100.MR.AI+W5100.MR.IND
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
|
2017-02-19 20:14:09 +00:00
|
|
|
|
pha
|
|
|
|
|
pla
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.MR,x
|
2016-01-06 17:02:39 +00:00
|
|
|
|
cmp #W5100.MR.AI+W5100.MR.IND
|
2016-01-10 22:16:07 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
>AR.SELECT RTR Double Check with RTR default value...
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x Get RTR HI
|
2016-01-10 22:16:07 +00:00
|
|
|
|
cmp /2000
|
|
|
|
|
bne .2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x Get RTR LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
cmp #2000
|
2015-08-05 20:38:05 +00:00
|
|
|
|
beq .3
|
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.2 dec DEV.HEADER.NAME+4
|
2015-08-05 20:38:05 +00:00
|
|
|
|
txa
|
2017-02-17 21:10:43 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #$10
|
2015-08-05 20:38:05 +00:00
|
|
|
|
tax
|
2017-02-17 21:10:43 +00:00
|
|
|
|
bne .1
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
lda #$28 MLI.ERR.NODEV
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.3 stx DEVSLOTx0
|
|
|
|
|
txa
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
|
|
|
|
lda #A2osX.SLOTS.NET
|
|
|
|
|
sta A2osX.SLOTS,y
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-10-17 15:47:50 +00:00
|
|
|
|
>LDYA ARGS
|
|
|
|
|
>STYA ZPTmpPTR
|
|
|
|
|
lda (ZPTmpPTR)
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .4
|
2016-10-17 15:47:50 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
lda #$00
|
|
|
|
|
sta MAC
|
|
|
|
|
lda #$08
|
|
|
|
|
sta MAC+1
|
|
|
|
|
lda #$DC
|
|
|
|
|
sta MAC+2
|
|
|
|
|
lda A2osX.RANDOM16
|
|
|
|
|
eor A2osX.TIMER16
|
|
|
|
|
sta MAC+3
|
|
|
|
|
eor A2osX.RANDOM16+1
|
|
|
|
|
sta MAC+4
|
|
|
|
|
eor A2osX.TIMER16+1
|
|
|
|
|
sta MAC+5
|
|
|
|
|
bra .8
|
|
|
|
|
|
2017-02-19 20:14:09 +00:00
|
|
|
|
.4 jsr DecodeMac
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bcc .8
|
2016-01-04 07:29:32 +00:00
|
|
|
|
lda #DEVMGR.ERRICL
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-10-17 15:47:50 +00:00
|
|
|
|
.8 >PUSHW L.DEV.HEADER.NAME
|
|
|
|
|
>LDYA L.MSG.DETECT.OK
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-01-10 22:16:07 +00:00
|
|
|
|
clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-20 22:12:57 +00:00
|
|
|
|
.INB DRV/X.NET.DRV.S
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2016-10-24 15:54:43 +00:00
|
|
|
|
MSG.DETECT >CSTR "UtherNet2/W5100 Driver.\n"
|
|
|
|
|
MSG.DETECT.OK >CSTR "UtherNet2/W5100 Installed As Device : %S\n"
|
|
|
|
|
MSG.DETECT.KO >CSTR "Hardware Not Found.\n"
|
2016-10-17 15:47:50 +00:00
|
|
|
|
Args .BS 2
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Device Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
DEV.HEADER .DA DRV.CS.START
|
|
|
|
|
.DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ
|
2017-02-19 20:14:09 +00:00
|
|
|
|
DEV.HEADER.NAME >PSTR "ETH7" NAME
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
DRV.CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.1 .DA STATUS
|
|
|
|
|
.DA READBLOCK
|
|
|
|
|
.DA WRITEBLOCK
|
|
|
|
|
.DA BADCALL
|
|
|
|
|
.DA BADCALL
|
|
|
|
|
.DA BADCALL
|
|
|
|
|
.DA OPEN
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA CLOSE
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.DA BADCALL
|
|
|
|
|
.DA BADCALL
|
|
|
|
|
L.DEVSTAT .DA DEVSTAT
|
2015-08-05 20:38:05 +00:00
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
BADCALL lda #1 MLI.ERR.BADCALL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
STATUS >LDYA L.DEVSTAT
|
2015-08-05 20:38:05 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
READBLOCK ldx DEVSLOTx0
|
2016-04-04 20:48:20 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
>AR.SELECT S0.RX.RSR
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get the received size HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ora W5100.DR,x LO
|
2017-02-17 21:10:43 +00:00
|
|
|
|
bne READBLOCK.RxOK
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
lda #ERR.DEV.NOFRAME
|
2017-02-17 21:10:43 +00:00
|
|
|
|
|
|
|
|
|
READBLOCK.Err sec
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
READBLOCK.RxOK >AR.SELECT S0.RX.RD
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get the received ptr HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x get the received ptr LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
and /RXTX.MASK
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ora /RX.BASE
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR,x
|
2016-01-10 22:16:07 +00:00
|
|
|
|
tya
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.AR+1,x
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-04-11 14:40:25 +00:00
|
|
|
|
lda W5100.DR,x get RX.Size HI
|
2016-04-11 19:12:01 +00:00
|
|
|
|
sta Offset+1
|
2016-04-11 14:40:25 +00:00
|
|
|
|
>PUSHA for SYS.GetMem
|
|
|
|
|
tay
|
2016-04-07 21:05:38 +00:00
|
|
|
|
lda W5100.DR,x get RX.Size LO
|
2016-04-11 19:12:01 +00:00
|
|
|
|
sta Offset
|
2016-04-11 14:40:25 +00:00
|
|
|
|
>PUSHA for SYS.GetMem
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2016-04-11 14:40:25 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #2
|
|
|
|
|
sta RXTX.Size
|
|
|
|
|
bcs .1
|
|
|
|
|
dey
|
|
|
|
|
.1 sty RXTX.Size+1
|
|
|
|
|
|
|
|
|
|
* >PUSHYA Already pushed....
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>PUSHBI 0
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMem
|
2017-02-17 21:10:43 +00:00
|
|
|
|
bcs READBLOCK.Err
|
2015-08-05 20:38:05 +00:00
|
|
|
|
>STYA ZPTmpPTR
|
2017-02-17 21:10:43 +00:00
|
|
|
|
stx .8+1
|
|
|
|
|
sty .8+3
|
|
|
|
|
sta .8+5
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
lda RXTX.Size
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta (ZPTmpPTR)
|
2016-04-07 06:13:41 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
|
|
|
|
ldy #1
|
2016-04-11 14:40:25 +00:00
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
lda RXTX.Size+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
2016-04-07 06:13:41 +00:00
|
|
|
|
eor #$ff
|
2016-04-01 15:57:51 +00:00
|
|
|
|
sta Counter+1
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-04-11 06:40:17 +00:00
|
|
|
|
iny
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
|
|
|
|
.2 inc Counter
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .3
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2017-02-17 21:10:43 +00:00
|
|
|
|
beq .4
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
.3 lda W5100.DR,x
|
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
iny
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .2
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2016-04-04 20:48:20 +00:00
|
|
|
|
bne .2
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.4 >AR.SELECT S0.RX.RD
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x Get HI
|
|
|
|
|
lda W5100.DR,x Get LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
clc
|
2016-04-11 19:12:01 +00:00
|
|
|
|
adc Offset
|
2016-04-01 15:57:51 +00:00
|
|
|
|
pha save LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
tya
|
2016-04-11 19:12:01 +00:00
|
|
|
|
adc Offset+1
|
2016-04-11 06:40:17 +00:00
|
|
|
|
pha
|
2016-04-01 15:57:51 +00:00
|
|
|
|
>AR.SELECT S0.RX.RD
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write HI
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write LO
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda #$40 RECV
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.DR,x
|
2016-04-11 06:40:17 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.8 ldx #$ff hMem
|
|
|
|
|
ldy #$ff PtrLO
|
|
|
|
|
lda #$ff PtrHI
|
2015-08-05 20:38:05 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
WRITEBLOCK >PULLW ZPTmpPTR
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
lda (ZPTmpPTR)
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta RXTX.Size
|
2016-04-07 06:13:41 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter
|
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
ldy #1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
lda (ZPTmpPTR),y
|
|
|
|
|
sta RXTX.Size+1
|
2016-04-07 06:13:41 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2016-03-13 22:07:01 +00:00
|
|
|
|
>AR.SELECT S0.TX.FSR
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda W5100.DR,x get send size HI
|
2016-04-01 15:57:51 +00:00
|
|
|
|
ldy W5100.DR,x LO
|
|
|
|
|
cpy RXTX.Size
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sbc RXTX.Size+1
|
2017-02-17 21:10:43 +00:00
|
|
|
|
bcs WRITEBLOCK.1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-03-20 22:12:57 +00:00
|
|
|
|
lda #ERR.DEV.NOBUFFER
|
2015-08-05 20:38:05 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
WRITEBLOCK.1 ldy #S.ETH.SRCMAC+5
|
2016-04-18 20:15:34 +00:00
|
|
|
|
ldx #5
|
|
|
|
|
.1 lda MAC,x
|
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2016-04-18 20:15:34 +00:00
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.TX.WR
|
2016-04-01 15:57:51 +00:00
|
|
|
|
lda W5100.DR,x Get HI
|
|
|
|
|
ldy W5100.DR,x Get LO
|
|
|
|
|
and /RXTX.MASK
|
|
|
|
|
ora /TX.BASE
|
|
|
|
|
sta W5100.AR,x Write HI
|
2016-04-04 20:48:20 +00:00
|
|
|
|
sta Offset+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
tya
|
|
|
|
|
sta W5100.AR+1,x Write LO
|
2016-04-04 20:48:20 +00:00
|
|
|
|
sta Offset
|
2016-04-01 15:57:51 +00:00
|
|
|
|
|
2016-04-04 20:48:20 +00:00
|
|
|
|
ldy #2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
.2 inc Counter
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
inc Counter+1
|
2017-02-17 21:10:43 +00:00
|
|
|
|
beq .4
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
|
|
|
|
.3 lda (ZPTmpPTR),y
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
iny
|
|
|
|
|
bne .2
|
|
|
|
|
inc ZPTmpPTR+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2017-02-17 21:10:43 +00:00
|
|
|
|
.4 >AR.SELECT S0.TX.WR
|
2016-04-04 20:48:20 +00:00
|
|
|
|
|
2016-04-01 15:57:51 +00:00
|
|
|
|
clc
|
2016-04-04 20:48:20 +00:00
|
|
|
|
lda Offset
|
2016-04-01 15:57:51 +00:00
|
|
|
|
adc RXTX.Size
|
|
|
|
|
pha save LO
|
2016-04-04 20:48:20 +00:00
|
|
|
|
|
|
|
|
|
lda Offset+1
|
2016-04-01 15:57:51 +00:00
|
|
|
|
adc RXTX.Size+1
|
2016-04-18 20:15:34 +00:00
|
|
|
|
* and /RXTX.MASK
|
|
|
|
|
* ora /TX.BASE
|
2016-04-01 15:57:51 +00:00
|
|
|
|
sta W5100.DR,x write HI
|
|
|
|
|
pla
|
|
|
|
|
sta W5100.DR,x write LO
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
>AR.SELECT S0.CR
|
2016-03-13 22:07:01 +00:00
|
|
|
|
lda #$20 SEND
|
|
|
|
|
sta W5100.DR,x
|
2017-02-17 21:10:43 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OPEN jsr CLOSE
|
|
|
|
|
|
|
|
|
|
lda #W5100.MR.AI+W5100.MR.IND
|
|
|
|
|
sta W5100.MR,x
|
|
|
|
|
|
|
|
|
|
>AR.SELECT SHAR
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
.1 lda MAC,y
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
iny
|
|
|
|
|
cpy #6
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
>AR.SELECT RMSR
|
|
|
|
|
lda #3 8k,0k,0k,0k
|
|
|
|
|
sta W5100.DR,x ...for Socket RX Buffers
|
|
|
|
|
sta W5100.DR,x ...for Socket TX Buffers
|
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.MR
|
|
|
|
|
lda #W5100.AR.S0.MR.MACRAW+W5100.AR.S0.MR.MF
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>AR.SELECT S0.CR
|
|
|
|
|
lda #1 OPEN
|
|
|
|
|
sta W5100.DR,x
|
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-08-05 20:38:05 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
CLOSE ldx DEVSLOTx0
|
2016-01-06 17:02:39 +00:00
|
|
|
|
lda #W5100.MR.RST
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta W5100.MR,x
|
2017-02-17 21:10:43 +00:00
|
|
|
|
clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2016-03-31 13:42:01 +00:00
|
|
|
|
*--------------------------------------
|
2015-08-05 20:38:05 +00:00
|
|
|
|
DRV.CS.END
|
2017-02-17 21:10:43 +00:00
|
|
|
|
DEVSLOTx0 .BS 1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
RXTX.Size .BS 2
|
2016-04-01 15:57:51 +00:00
|
|
|
|
Counter .BS 2
|
2016-04-04 20:48:20 +00:00
|
|
|
|
Offset .BS 2
|
2016-03-31 13:42:01 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-17 21:10:43 +00:00
|
|
|
|
DEVSTAT .DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ
|
|
|
|
|
.BS 3 size
|
|
|
|
|
>PSTR "UtherNetII/W5100"
|
|
|
|
|
.DA #S.DEVSTAT.TYPE.NET
|
|
|
|
|
.BS 1 Subtype
|
|
|
|
|
.BS 2 Version
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
FLAGS .DA #0
|
|
|
|
|
LINK.STATUS .DA #S.DEVSTAT.NET.STATUS.OK+S.DEVSTAT.NET.STATUS.FD+S.DEVSTAT.NET.STATUS.100
|
2015-08-05 20:38:05 +00:00
|
|
|
|
MAC .BS 6
|
|
|
|
|
MAN
|
|
|
|
|
SAVE DRV/UTHERNET2.DRV.S
|
|
|
|
|
ASM
|