2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-04-18 20:15:34 +00:00
|
|
|
|
.LIST OFF
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/DRV/UTHERNET.DRV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/MLI.ERR.I
|
2017-12-22 21:24:30 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/NIC.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/NIC.8900A.I
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/LIBTCPIP.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPTmpPTR .EQ ZPDRV
|
2017-03-17 07:22:37 +00:00
|
|
|
|
Size .EQ ZPDRV+2
|
|
|
|
|
Counter .EQ ZPDRV+4
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
2015-06-03 18:30:57 +00:00
|
|
|
|
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
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
2015-11-22 22:30:06 +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-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
Dev.Detect >STYA ARGS
|
2015-06-03 18:30:57 +00:00
|
|
|
|
>LDYA L.MSG.DETECT
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-01-12 22:04:44 +00:00
|
|
|
|
ldx #$70
|
2017-04-27 20:08:12 +00:00
|
|
|
|
ldy #7
|
2017-01-12 22:04:44 +00:00
|
|
|
|
|
2017-10-19 15:27:38 +00:00
|
|
|
|
.1 lda A2osX.S,y IO based detection, avoid scanning in Disk Controller IO!!!!
|
2017-01-12 22:04:44 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2017-03-16 16:59:24 +00:00
|
|
|
|
lda /PP.ID
|
|
|
|
|
sta PacketPagePTR+1,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda #PP.ID
|
|
|
|
|
sta PacketPagePTR,x
|
2017-03-16 16:59:24 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA+1,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
cmp /DEVID
|
2017-03-16 16:59:24 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2017-04-27 20:09:33 +00:00
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
cmp #DEVID
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-10-06 06:33:21 +00:00
|
|
|
|
.2 dec DEV.HEADER.NAME+3
|
2015-03-14 21:48:35 +00:00
|
|
|
|
txa
|
2017-01-12 22:04:44 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #$10
|
2015-03-14 21:48:35 +00:00
|
|
|
|
tax
|
2017-04-27 20:08:12 +00:00
|
|
|
|
dey
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #MLI.E.NODEV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-01-10 22:16:07 +00:00
|
|
|
|
.3 stx DEVSLOTx0
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda #A2osX.S.NIC
|
|
|
|
|
sta A2osX.S,y
|
2016-01-10 22:16:07 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda /PP.REVISION Get Revision# of ths chip...
|
2017-03-16 16:59:24 +00:00
|
|
|
|
sta PacketPagePTR+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda #PP.REVISION
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta PacketPagePTR,x
|
2017-03-16 16:59:24 +00:00
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sta DEVSTAT+S.DSTAT.VERSION+1 set Hardware version
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA,x
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sta DEVSTAT+S.DSTAT.VERSION
|
2017-01-12 22:04:44 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
>LDYA ARGS
|
|
|
|
|
>STYA ZPTmpPTR
|
2018-01-17 06:56:16 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda (ZPTmpPTR)
|
2016-04-18 20:15:34 +00:00
|
|
|
|
bne .4
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-04-18 20:15:34 +00:00
|
|
|
|
lda #$00
|
|
|
|
|
sta MAC
|
|
|
|
|
lda #$0E
|
|
|
|
|
sta MAC+1
|
|
|
|
|
lda #$3A
|
|
|
|
|
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
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.4 jsr DecodeMac
|
2016-04-18 20:15:34 +00:00
|
|
|
|
bcc .8
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #K.E.SYN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-10-17 15:47:50 +00:00
|
|
|
|
.8 >PUSHW L.DEV.HEADER.NAME
|
|
|
|
|
>LDYA L.MSG.DETECT.OK
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
clc
|
2015-06-03 18:30:57 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.SRC/DRV/X.NET.DRV.S
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG.DETECT >CSTR "UtherNet/CS8900A Driver.\r\n"
|
2017-10-06 06:33:21 +00:00
|
|
|
|
MSG.DETECT.OK >CSTR "UtherNet/CS8900A Installed As Device : %s\r\n"
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG.DETECT.KO >CSTR "Hardware Not Found.\r\n"
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ARGS .BS 2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Device Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
DEV.HEADER cld
|
|
|
|
|
jmp (DRV.CS.START,x)
|
|
|
|
|
.DA #0
|
|
|
|
|
.BS 6
|
2017-10-06 06:33:21 +00:00
|
|
|
|
DEV.HEADER.NAME >CSTR "ETH7" NAME
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
DRV.CS.START .DA STATUS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA READBLOCK
|
|
|
|
|
.DA WRITEBLOCK
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA OPEN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA CLOSE
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
L.DEVSTAT .DA DEVSTAT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
2017-12-22 21:24:30 +00:00
|
|
|
|
STATUS lda #S.DSTAT.NIC.STATUS.10
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta LINK.STATUS
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
lda /PP.LineST
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.LineST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda PacketPageDATA,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
and #PP.LineST.LinkOK
|
2017-03-17 07:22:37 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda LINK.STATUS
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ora #S.DSTAT.NIC.STATUS.OK
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta LINK.STATUS
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.1 lda /PP.TestCTL
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.TestCTL
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
ldy PacketPageDATA,x
|
2017-01-12 17:43:45 +00:00
|
|
|
|
and /PP.TestCTL.FDX
|
2017-03-17 07:22:37 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda LINK.STATUS
|
2017-12-22 21:24:30 +00:00
|
|
|
|
ora #S.DSTAT.NIC.STATUS.FD
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta LINK.STATUS
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.2 >LDYA L.DEVSTAT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-17 07:22:37 +00:00
|
|
|
|
READBLOCK php
|
|
|
|
|
sei
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
ldx DEVSLOTx0
|
2017-01-26 21:57:35 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.RxEvent
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.RxEvent
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
|
|
|
|
lda PacketPageDATA+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
ldy PacketPageDATA,x
|
|
|
|
|
and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
|
2017-03-19 21:47:54 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #ERR.DEV.NOFRAME
|
2017-01-26 21:57:35 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda RTDATA+1,x discard RxStatus
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda RTDATA,x
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
lda RTDATA+1,x
|
|
|
|
|
sta Size+1
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
lda RTDATA,x get RxLength
|
2016-04-07 06:13:41 +00:00
|
|
|
|
sta Size
|
2016-03-13 22:07:01 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #2
|
2017-03-19 21:47:54 +00:00
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda Size+1
|
2017-03-17 16:50:32 +00:00
|
|
|
|
adc #0
|
2017-03-19 21:47:54 +00:00
|
|
|
|
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL GetMem.YA
|
2017-03-19 21:47:54 +00:00
|
|
|
|
bcs .9
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
>STYA ZPTmpPTR
|
2017-01-26 21:57:35 +00:00
|
|
|
|
stx .8+1
|
2017-01-29 21:47:19 +00:00
|
|
|
|
sty .8+3
|
|
|
|
|
sta .8+5
|
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
lda 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-07 06:13:41 +00:00
|
|
|
|
lda Size+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
2016-04-07 06:13:41 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
|
|
|
|
iny
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 22:07:01 +00:00
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.2 inc Counter
|
|
|
|
|
bne .3
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.3 lda RTDATA,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .4
|
2015-03-14 21:48:35 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.4 inc Counter
|
|
|
|
|
bne .5
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.5 lda RTDATA+1,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.8 ldx #$ff hMem
|
|
|
|
|
ldy #$ff PtrLO
|
|
|
|
|
lda #$ff PtrHI
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
plp
|
2017-01-26 21:57:35 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-17 07:22:37 +00:00
|
|
|
|
WRITEBLOCK php
|
|
|
|
|
sei
|
|
|
|
|
>STYA ZPTmpPTR
|
|
|
|
|
|
|
|
|
|
ldx #5
|
|
|
|
|
ldy #S.ETH.SRCMAC+5
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.10 lda MAC,x
|
|
|
|
|
sta (ZPTmpPTR),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .10
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldx DEVSLOTx0
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL
|
|
|
|
|
sta TxCMD+1,x
|
|
|
|
|
lda #PP.TxCMD.LID+PP.TxCMD.TxStartFULL
|
|
|
|
|
sta TxCMD,x
|
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPTmpPTR),y
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta TxLength+1,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter+1
|
|
|
|
|
|
|
|
|
|
lda (ZPTmpPTR)
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta TxLength,x
|
2017-03-17 16:50:32 +00:00
|
|
|
|
eor #$ff
|
|
|
|
|
sta Counter
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
|
|
|
|
lda /PP.BusST
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.BusST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #16
|
2017-03-17 07:22:37 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
.1 lda PacketPageDATA+1,x
|
2015-03-14 21:48:35 +00:00
|
|
|
|
and /PP.BusST.Rdy4TxNOW
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bne WRITEBLOCK.1
|
2016-03-20 22:12:57 +00:00
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
and #PP.BusST.TxBidErr
|
|
|
|
|
bne .9
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
dey
|
|
|
|
|
bne .1
|
2016-03-20 22:12:57 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #ERR.DEV.NOBUFFER
|
2017-03-17 07:22:37 +00:00
|
|
|
|
plp
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
WRITEBLOCK.1 ldy #2
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2016-04-07 06:13:41 +00:00
|
|
|
|
.1 inc Counter
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .2
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.2 lda (ZPTmpPTR),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta RTDATA,x
|
|
|
|
|
iny
|
2017-03-17 07:22:37 +00:00
|
|
|
|
bne .3
|
2015-03-14 21:48:35 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.3 inc Counter
|
|
|
|
|
bne .4
|
2016-04-07 06:13:41 +00:00
|
|
|
|
inc Counter+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .8
|
2016-04-07 06:13:41 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.4 lda (ZPTmpPTR),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta RTDATA+1,x
|
|
|
|
|
iny
|
2016-03-13 22:07:01 +00:00
|
|
|
|
bne .1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
inc ZPTmpPTR+1
|
|
|
|
|
bne .1
|
2016-03-13 22:07:01 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
.8 plp
|
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-26 21:57:35 +00:00
|
|
|
|
OPEN jsr CLOSE
|
2017-03-17 16:50:32 +00:00
|
|
|
|
|
|
|
|
|
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
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
lda /PP.MAC
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.MAC
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>LDYA MAC
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
>LDYAI PP.MAC+2
|
|
|
|
|
>STYA PacketPagePTR,x
|
|
|
|
|
>LDYA MAC+2
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
>LDYAI PP.MAC+4
|
|
|
|
|
>STYA PacketPagePTR,x
|
|
|
|
|
>LDYA MAC+4
|
|
|
|
|
>STYA PacketPageDATA,x
|
|
|
|
|
|
2017-03-17 16:50:32 +00:00
|
|
|
|
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
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-26 21:57:35 +00:00
|
|
|
|
CLOSE ldx DEVSLOTx0
|
2017-02-19 20:14:09 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.SelfCTL
|
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.SelfCTL
|
|
|
|
|
sta PacketPagePTR,x
|
2017-03-16 07:32:24 +00:00
|
|
|
|
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda /PP.SelfCTL.LID+PP.SelfCTL.RESET
|
|
|
|
|
sta PacketPageDATA+1,x
|
|
|
|
|
|
|
|
|
|
lda #PP.SelfCTL.LID+PP.SelfCTL.RESET
|
|
|
|
|
sta PacketPageDATA,x
|
2017-02-19 20:14:09 +00:00
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
lda /PP.SelfST
|
2017-03-17 07:22:37 +00:00
|
|
|
|
sta PacketPagePTR+1,x
|
|
|
|
|
lda #PP.SelfST
|
|
|
|
|
sta PacketPagePTR,x
|
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda PacketPageDATA+1,x
|
2017-03-17 07:22:37 +00:00
|
|
|
|
lda PacketPageDATA,x
|
|
|
|
|
and #PP.SelfST.InitDone
|
|
|
|
|
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
2016-04-18 20:15:34 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-26 21:57:35 +00:00
|
|
|
|
DRV.CS.END
|
2015-03-14 21:48:35 +00:00
|
|
|
|
DEVSLOTx0 .BS 1
|
2017-01-25 21:46:40 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-17 07:22:37 +00:00
|
|
|
|
DEVSTAT .DA #0
|
2017-01-12 22:04:44 +00:00
|
|
|
|
.BS 3 size
|
|
|
|
|
>PSTR "Uthernet/CS8900A"
|
2017-10-27 06:36:46 +00:00
|
|
|
|
.DA #S.DSTAT.T.NET
|
2017-01-12 22:04:44 +00:00
|
|
|
|
.BS 1 Subtype
|
|
|
|
|
.BS 2 Version
|
|
|
|
|
*--------------------------------------
|
2017-01-28 22:05:20 +00:00
|
|
|
|
FLAGS .DA #0
|
2016-03-13 22:07:01 +00:00
|
|
|
|
LINK.STATUS .BS 1 OK/DUPLEX/SPEED
|
2017-01-12 22:04:44 +00:00
|
|
|
|
MAC .BS 6
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/DRV/UTHERNET.DRV.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|