1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-03-14 00:16:32 +00:00

Add puti to cmdsys and clean up sanity comments

This commit is contained in:
David Schmenk
2017-11-16 10:46:06 -08:00
parent 6ea55e3038
commit f3a6bfbb59
18 changed files with 58 additions and 190 deletions

View File

@@ -111,24 +111,12 @@ byte[] endDHCP
//
byte boundstr = "Apple II bound to:\n"
byte dnsstr = "DNS: "
def putln
return putc($0D)
end
def putb(hexb)
return call($FDDA, hexb, 0, 0, 0)
end
def puth(hex)
return call($F941, hex >> 8, hex, 0, 0)
end
def puti(i)
if i < 0; putc('-'); i = -i; fin
if i < 10
putc(i + '0')
else
puti(i / 10)
putc(i % 10 + '0')
fin
end
def putip(ipptr)
byte i

View File

@@ -53,27 +53,15 @@ def iNetSetDNS(ipptr)
return memcpy(@dns, ipptr, 4)
end
def putln
return putc($0D)
end
def putb(hexb)
return call($FDDA, hexb, 0, 0, 0)
end
def puth(hex)
return call($F941, hex >> 8, hex, 0, 0)
end
def puti(i)
if i < 0; putc('-'); i = -i; fin
if i < 10
putc(i + '0')
else
puti(i / 10)
putc(i % 10 + '0')
fin
end
def putip(ipptr)
byte i
for i = 0 to 2
puti(ipptr->[i]); putc('.')
next
@@ -81,7 +69,7 @@ def putip(ipptr)
end
def dumpbytes(buf, len)
word i
for i = 0 to len - 1
putb(buf->[i])
if i & 7 == 7
@@ -95,7 +83,7 @@ end
def parseIP(ipstr, ipaddr)
byte i
word endstr
endstr = ipstr + ^ipstr
for i = 0 to 3
ipstr = ipstr + 1
@@ -125,13 +113,13 @@ def parseDomain(domstr, msgptr)
msgptr->[l] = i - l - 1
msgptr = msgptr + i
^msgptr = 0 // Terminate label list
return msgptr + 1
return msgptr + 1
end
def recvDNS(remip, remport, pkt, len, ipaddr)
byte q, r
word resptr
if pkt=>dnsID == $BEEF
q = pkt->dnsQdCount.1
r = pkt->dnsAnCount.1 + pkt->dnsNsCount.1 + pkt->dnsArCount.1
@@ -174,7 +162,7 @@ end
def iNetResolve(namestr, ipaddr)
word dnspkt, msgptr, msglen
word portDNS, timeout
ipaddr=>0 = 0
ipaddr=>2 = 0
if not parseIP(namestr, ipaddr)

View File

@@ -430,24 +430,12 @@ end
//
// DEBUG
//
def putln
return putc($0D)
end
def putb(hexb)
return call($FDDA, hexb, 0, 0, 0)
end
def puth(hex)
return call($F941, hex >> 8, hex, 0, 0)
end
def puti(i)
if i < 0; putc('-'); i = -i; fin
if i < 10
putc(i + '0')
else
puti(i / 10)
putc(i % 10 + '0')
fin
end
def putip(ipptr)
byte i