Move verbose output, exit is static config detected

This commit is contained in:
Rémy GIBERT 2016-01-09 23:39:10 +01:00
parent b1e65588a9
commit 2bc2428de2

View File

@ -36,16 +36,15 @@ CS.START cld
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBSTR .DA LIBSTR
L.LIBTCPIP .DA LIBTCPIP
L.IPCFG .DA IPCFG
L.MSG.CFG .DA MSG.CFG
L.MSG.CFG.KO .DA MSG.CFG.KO
L.MSG.CFG.OK .DA MSG.CFG.OK
L.MSG.CFG.NA .DA MSG.CFG.NA
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBSTR
>SYSCALL SYS.LoadLibYA
sta hLIBSTR
>LDYA L.LIBTCPIP
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL SYS.LoadLibYA
sta hLIBTCPIP
@ -53,6 +52,9 @@ CS.INIT >LDYA L.LIBSTR
bcs .9
>STYA ZPPtr1
lda (ZPPtr1)
bmi .99 Already Configured, exit
ldy #S.IPCFG
.1 dey
lda (ZPPtr1),y
@ -88,8 +90,16 @@ CS.INIT >LDYA L.LIBSTR
clc
.9 rts
.99 >LDYA L.MSG.CFG.NA
>SYSCALL SYS.PSTROutYA
lda #0
sec
rts
*--------------------------------------
CS.RUN
CS.RUN >LDYA L.MSG.CFG
>SYSCALL SYS.PSTROutYA
CS.RUN.DISC jsr SendDHCPDiscFrame
bcs CS.RUN.KO
@ -126,11 +136,30 @@ CS.RUN.OK lda #S.IPCFG.STATUS.OK
>PUSHW L.IPCFG
>LIBCALL hLIBTCPIP,LIBTCPIP.SET.IPCFG
ldx #3
.1 lda IPCFG+S.IPCFG.MASK,x
>PUSHA
dex
bpl .1
ldx #3
.2 lda IPCFG+S.IPCFG.IP,x
>PUSHA
dex
bpl .2
>LDYA L.MSG.CFG.OK
>SYSCALL SYS.PSTROutYA
lda #0 Leave with NO ERROR
sec
rts
CS.RUN.KO sec
CS.RUN.KO pha
>PUSHA
>LDYA L.MSG.CFG.KO
>SYSCALL SYS.PSTROutYA
pla
sec
rts
*--------------------------------------
CS.DOEVENT lda (pEvent)
@ -190,8 +219,6 @@ CS.DOEVENT lda (pEvent)
rts
*--------------------------------------
CS.QUIT lda hLIBTCPIP
>SYSCALL SYS.UnloadLibA
lda hLIBSTR
>SYSCALL SYS.UnloadLibA
clc
rts
@ -451,8 +478,11 @@ SetFramePtr1AX clc
rts
*--------------------------------------
CS.END
LIBSTR >PSTRING "libstr.o"
LIBTCPIP >PSTRING "libtcpip.o"
MSG.CFG >PSTRING "DHCPCLNT:Querying DHCP Server...\n"
MSG.CFG.KO >PSTRING "DHCPCLNT:Time Out [%h].\n"
MSG.CFG.OK >PSTRING "DHCPCLNT:Success:[IP=%d.%d.%d.%d/%d.%d.%d.%d]\n"
MSG.CFG.NA >PSTRING "DHCPCLNT:TCPIP Already Configured, Exiting.\n"
*--------------------------------------
FRAME.DISC .HS 01010600 OP,HTYPE,HLEN,HOPS
FRAME.DISC.XID .BS 4
@ -492,7 +522,6 @@ FRAME.REQ.OPT.SVRIP .BS 4
.HS FF
FRAME.REQ.LEN .EQ *-FRAME.REQ
*--------------------------------------
hLIBSTR .BS 1
hLIBTCPIP .BS 1
TimeOut .BS 1
IPCFG .BS S.IPCFG