mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-05 03:37:43 +00:00
Fix UTHERNET autodetect and code cleanup
This commit is contained in:
parent
d3a19cccbf
commit
1299cbc48b
@ -22,7 +22,6 @@ const AUTO_INC = $8000
|
||||
//
|
||||
// Uthernet register addresses
|
||||
//
|
||||
byte[] slot // Init time only
|
||||
byte rxdata_lo, rxdata_hi
|
||||
byte txcmd
|
||||
byte txlen
|
||||
@ -30,6 +29,7 @@ byte isq
|
||||
word rom[]
|
||||
byte pregidx
|
||||
byte pregdata
|
||||
byte[] slot // Init time only
|
||||
//
|
||||
// Uthernet MAC address
|
||||
//
|
||||
@ -219,17 +219,18 @@ for slot = $90 to $F0 step $10
|
||||
if (peekiow(slot+TX_CMD) & $CC3F) == $0009
|
||||
pokeiow(slot+PREG_INDEX, 0)
|
||||
if peekiow(slot+PREG_DATA) == $630E
|
||||
pokepreg($0114, $40) // RESET
|
||||
rxdata_hi = slot + 1
|
||||
pregidx = slot + PREG_INDEX
|
||||
pregdata = slot + PREG_DATA
|
||||
pokepreg($0114, $40) // RESET
|
||||
rxdata_lo = slot + RX_DATA
|
||||
rxdata_hi = slot + RX_DATA + 1
|
||||
txcmd = slot + TX_CMD
|
||||
txlen = slot + TX_LEN
|
||||
isq = slot + INT_STATUS
|
||||
pregidx = slot + PREG_INDEX
|
||||
pregdata = slot + PREG_DATA
|
||||
_pokefrml.1 = slot
|
||||
_pokefrmh.1 = slot+1
|
||||
_peekfrml.1 = slot
|
||||
_peekfrmh.1 = slot+1
|
||||
_pokefrml.1 = slot + TX_DATA
|
||||
_pokefrmh.1 = slot + TX_DATA + 1
|
||||
_peekfrml.1 = slot + RX_DATA
|
||||
_peekfrmh.1 = slot + RX_DATA + 1
|
||||
pokepreg($0158, utherMAC:0) // MAC addr
|
||||
pokepreg($015A, utherMAC:2) // MAC addr
|
||||
pokepreg($015C, utherMAC:4) // MAC addr
|
||||
|
@ -71,11 +71,11 @@ const WIZ_RXMEM3 = $7800
|
||||
//
|
||||
// Wiznet indirect registers
|
||||
//
|
||||
byte slot
|
||||
word rom[]
|
||||
word saveidx
|
||||
byte regidx
|
||||
byte regdata
|
||||
word[] rom
|
||||
word saveidx
|
||||
byte regidx
|
||||
byte regdata
|
||||
byte[] slot
|
||||
//
|
||||
// Wiznet MAC address
|
||||
//
|
||||
|
@ -212,11 +212,11 @@ repeat
|
||||
break
|
||||
fin
|
||||
next
|
||||
retry = retry + 1
|
||||
retry++
|
||||
until retry > 4 or optsOP.2 == DHCP_ACK
|
||||
iNet:closeUDP(portDHCP)
|
||||
iNet:setInterfaceIP(@localip, @localnet, @localgw)
|
||||
puts("Apple II bound to:\n");putip(@localip);putc('/');putip(@localnet);putln
|
||||
iNet:setDNS(@localdns)
|
||||
//puts("DNS: ");putip(@localdns);putln
|
||||
puts("DNS:");putip(@localdns);putln
|
||||
done
|
||||
|
@ -587,7 +587,6 @@ def getEtherHA(ha)
|
||||
if ha; memcpy(ha, @myMAC, MAC_SIZE); fin
|
||||
return MAC_SIZE
|
||||
end
|
||||
|
||||
//
|
||||
// Fill in iNet class
|
||||
//
|
||||
|
@ -148,7 +148,7 @@ def recvDNS(remip, remport, pkt, len, ipaddr)
|
||||
resptr = resptr + 8
|
||||
//dumpbytes(resptr + 2, ^(resptr + 1))
|
||||
resptr = resptr + 2 + ^(resptr + 1); putln
|
||||
r = r - 1
|
||||
r--
|
||||
loop
|
||||
fin
|
||||
stateDNS = DNS_ANSWER
|
||||
@ -197,7 +197,9 @@ def iNetResolve(namestr, ipaddr)
|
||||
fin
|
||||
return ipaddr=>0 <> 0 or ipaddr=>2 <> 0
|
||||
end
|
||||
|
||||
//
|
||||
// Initialze network stack
|
||||
//
|
||||
def iNetInit
|
||||
//
|
||||
// Look for net hardware
|
||||
@ -216,7 +218,6 @@ def iNetInit
|
||||
puts("No network adapters found.\n")
|
||||
return NULL
|
||||
end
|
||||
|
||||
//
|
||||
// Fill iNet class
|
||||
//
|
||||
|
64
src/tftprel
64
src/tftprel
@ -1,39 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Core VM, CMDSYS, JITC files
|
||||
echo "PLASMA.SYSTEM"; atftp $1 --put -l rel/apple/PLASMA.SYSTEM#FF2000 -r PLASMA.SYSTEM#FF2000
|
||||
echo "PLVM.128"; atftp $1 --put -l rel/apple/PLVM.128#FF2000 -r PLVM.128#FF2000
|
||||
echo "PLVM16"; atftp $1 --put -l rel/apple/PLVM16#FF2000 -r PLVM16#FF2000
|
||||
echo "CMD"; atftp $1 --put -l rel/apple/CMD#061000 -r CMD#061000
|
||||
echo "CMD128"; atftp $1 --put -l rel/apple/CMD128#061000 -r CMD128#061000
|
||||
echo "SYS/JIT"; atftp $1 --put -l rel/apple/JIT#FE1000 -r SYS/JIT#FE1000
|
||||
echo "SYS/JIT16"; atftp $1 --put -l rel/apple/JIT16#FE1000 -r SYS/JIT16#FE1000
|
||||
echo "SYS/JITUNE"; atftp $1 --put -l rel/apple/JITUNE#FE1000 -r SYS/JITUNE#FE1000
|
||||
echo "PLASMA.SYSTEM"; atftp $1 --put -l rel/apple/PLASMA.SYSTEM#FF2000 -r $2/PLASMA.SYSTEM#FF2000
|
||||
echo "PLVM.128"; atftp $1 --put -l rel/apple/PLVM.128#FF2000 -r $2/PLVM.128#FF2000
|
||||
echo "PLVM16"; atftp $1 --put -l rel/apple/PLVM16#FF2000 -r $2/PLVM16#FF2000
|
||||
echo "CMD"; atftp $1 --put -l rel/apple/CMD#061000 -r $2/CMD#061000
|
||||
echo "CMD128"; atftp $1 --put -l rel/apple/CMD128#061000 -r $2/CMD128#061000
|
||||
echo "SYS/JIT"; atftp $1 --put -l rel/apple/JIT#FE1000 -r $2/SYS/JIT#FE1000
|
||||
echo "SYS/JIT16"; atftp $1 --put -l rel/apple/JIT16#FE1000 -r $2/SYS/JIT16#FE1000
|
||||
echo "SYS/JITUNE"; atftp $1 --put -l rel/apple/JITUNE#FE1000 -r $2/SYS/JITUNE#FE1000
|
||||
|
||||
# Core libraries
|
||||
echo "SYS/ARGS"; atftp $1 --put -l rel/ARGS#FE1000 -r SYS/ARGS#FE1000
|
||||
echo "SYS/DHCP"; atftp $1 --put -l rel/DHCP#FE1000 -r SYS/DHCP#FE1000
|
||||
echo "SYS/ED"; atftp $1 --put -l rel/ED#FE1000 -r SYS/ED#FE1000
|
||||
echo "SYS/ETHERIP"; atftp $1 --put -l rel/ETHERIP#FE1000 -r SYS/ETHERIP#FE1000
|
||||
echo "SYS/FIBER"; atftp $1 --put -l rel/FIBER#FE1000 -r SYS/FIBER#FE1000
|
||||
echo "SYS/FPSTR"; atftp $1 --put -l rel/FPSTR#FE1000 -r SYS/FPSTR#FE1000
|
||||
echo "SYS/FPU"; atftp $1 --put -l rel/FPU#FE1000 -r SYS/FPU#FE1000
|
||||
echo "SYS/INET"; atftp $1 --put -l rel/INET#FE1000 -r SYS/INET#FE1000
|
||||
echo "SYS/LONGJUMP"; atftp $1 --put -l rel/LONGJMP#FE1000 -r SYS/LONGJMP#FE1000
|
||||
echo "SYS/LZ4"; atftp $1 --put -l rel/LZ4#FE1000 -r SYS/LZ4#FE1000
|
||||
echo "SYS/MEMMGR"; atftp $1 --put -l rel/MEMMGR#FE1000 -r SYS/MEMMGR#FE1000
|
||||
echo "SYS/SANE"; atftp $1 --put -l rel/SANE#FE1000 -r SYS/SANE#FE1000
|
||||
echo "SYS/CONIO"; atftp $1 --put -l rel/apple/CONIO#FE1000 -r SYS/CONIO#FE1000
|
||||
echo "SYS/DGR"; atftp $1 --put -l rel/apple/DGR#FE1000 -r SYS/DGR#FE1000
|
||||
echo "SYS/FILEIO"; atftp $1 --put -l rel/apple/FILEIO#FE1000 -r SYS/FILEIO#FE1000
|
||||
echo "SYS/GRAFIX"; atftp $1 --put -l rel/apple/GRAFIX#FE1000 -r SYS/GRAFIX#FE1000
|
||||
echo "SYS/JOYBUZZ"; atftp $1 --put -l rel/apple/JOYBUZZ#FE1000 -r SYS/JOYBUZZ#FE1000
|
||||
echo "SYS/MON"; atftp $1 --put -l rel/apple/MON#FE1000 -r SYS/MON#FE1000
|
||||
echo "SYS/PORTIO"; atftp $1 --put -l rel/apple/PORTIO#FE1000 -r SYS/PORTIO#FE1000
|
||||
echo "SYS/SPIPORT"; atftp $1 --put -l rel/apple/SPIPORT#FE1000 -r SYS/SPIPORT#FE1000
|
||||
echo "SYS/UTHERNET2";atftp $1 --put -l rel/apple/UTHERNET2#FE1000 -r SYS/UTHERNET2#FE1000
|
||||
echo "SYS/UTHERNET"; atftp $1 --put -l rel/apple/UTHERNET#FE1000 -r SYS/UTHERNET#FE1000
|
||||
echo "SYS/ARGS"; atftp $1 --put -l rel/ARGS#FE1000 -r $2/SYS/ARGS#FE1000
|
||||
echo "SYS/DHCP"; atftp $1 --put -l rel/DHCP#FE1000 -r $2/SYS/DHCP#FE1000
|
||||
echo "SYS/ED"; atftp $1 --put -l rel/ED#FE1000 -r $2/SYS/ED#FE1000
|
||||
echo "SYS/ETHERIP"; atftp $1 --put -l rel/ETHERIP#FE1000 -r $2/SYS/ETHERIP#FE1000
|
||||
echo "SYS/FIBER"; atftp $1 --put -l rel/FIBER#FE1000 -r $2/SYS/FIBER#FE1000
|
||||
echo "SYS/FPSTR"; atftp $1 --put -l rel/FPSTR#FE1000 -r $2/SYS/FPSTR#FE1000
|
||||
echo "SYS/FPU"; atftp $1 --put -l rel/FPU#FE1000 -r $2/SYS/FPU#FE1000
|
||||
echo "SYS/INET"; atftp $1 --put -l rel/INET#FE1000 -r $2/SYS/INET#FE1000
|
||||
echo "SYS/LONGJUMP"; atftp $1 --put -l rel/LONGJMP#FE1000 -r $2/SYS/LONGJMP#FE1000
|
||||
echo "SYS/LZ4"; atftp $1 --put -l rel/LZ4#FE1000 -r $2/SYS/LZ4#FE1000
|
||||
echo "SYS/MEMMGR"; atftp $1 --put -l rel/MEMMGR#FE1000 -r $2/SYS/MEMMGR#FE1000
|
||||
echo "SYS/SANE"; atftp $1 --put -l rel/SANE#FE1000 -r $2/SYS/SANE#FE1000
|
||||
echo "SYS/CONIO"; atftp $1 --put -l rel/apple/CONIO#FE1000 -r $2/SYS/CONIO#FE1000
|
||||
echo "SYS/DGR"; atftp $1 --put -l rel/apple/DGR#FE1000 -r $2/SYS/DGR#FE1000
|
||||
echo "SYS/FILEIO"; atftp $1 --put -l rel/apple/FILEIO#FE1000 -r $2/SYS/FILEIO#FE1000
|
||||
echo "SYS/GRAFIX"; atftp $1 --put -l rel/apple/GRAFIX#FE1000 -r $2/SYS/GRAFIX#FE1000
|
||||
echo "SYS/JOYBUZZ"; atftp $1 --put -l rel/apple/JOYBUZZ#FE1000 -r $2/SYS/JOYBUZZ#FE1000
|
||||
echo "SYS/MON"; atftp $1 --put -l rel/apple/MON#FE1000 -r $2/SYS/MON#FE1000
|
||||
echo "SYS/PORTIO"; atftp $1 --put -l rel/apple/PORTIO#FE1000 -r $2/SYS/PORTIO#FE1000
|
||||
echo "SYS/SPIPORT"; atftp $1 --put -l rel/apple/SPIPORT#FE1000 -r $2/SYS/SPIPORT#FE1000
|
||||
echo "SYS/UTHERNET2";atftp $1 --put -l rel/apple/UTHERNET2#FE1000 -r $2/SYS/UTHERNET2#FE1000
|
||||
echo "SYS/UTHERNET"; atftp $1 --put -l rel/apple/UTHERNET#FE1000 -r $2/SYS/UTHERNET#FE1000
|
||||
|
||||
# Build tools
|
||||
echo "BLD/PLASM"; atftp $1 --put -l rel/PLASM#FE1000 -r BLD/PLASM#FE1000
|
||||
echo "BLD/CODEOPT"; atftp $1 --put -l rel/CODEOPT#FE1000 -r BLD/CODEOPT#FE1000
|
||||
echo "BLD/PLASM"; atftp $1 --put -l rel/PLASM#FE1000 -r $2/BLD/PLASM#FE1000
|
||||
echo "BLD/CODEOPT"; atftp $1 --put -l rel/CODEOPT#FE1000 -r $2/BLD/CODEOPT#FE1000
|
||||
|
@ -982,7 +982,7 @@ def loadmod(mod)#1
|
||||
//
|
||||
dcitos(mod, @filename)
|
||||
refnum = open(@filename)
|
||||
if !refnum
|
||||
if !refnum and filename < 16
|
||||
//
|
||||
// Try system path
|
||||
//
|
||||
|
@ -1025,7 +1025,7 @@ def adddef(isfirst, addr, deflast)#1
|
||||
return defentry
|
||||
end
|
||||
def loadmod(mod)#1
|
||||
word rdlen, modsize, bytecode, codefix, defofst, defcnt, init, initcode[], fixup
|
||||
word rdlen[], bytecode, modsize, codefix, defofst, defcnt, init, initcode[], fixup
|
||||
word addr, defaddr, modaddr, modfix, modofst, modend
|
||||
word deftbl, deflast
|
||||
word moddep, rld, esd, sym
|
||||
@ -1036,7 +1036,7 @@ def loadmod(mod)#1
|
||||
//
|
||||
dcitos(mod, @filename)
|
||||
refnum = open(@filename)
|
||||
if !refnum
|
||||
if !refnum and filename < 16
|
||||
//
|
||||
// Try system path
|
||||
//
|
||||
|
@ -1059,7 +1059,7 @@ def loadmod(mod)#1
|
||||
//
|
||||
dcitos(mod, @filename)
|
||||
refnum = open(@filename)
|
||||
if !refnum
|
||||
if !refnum and filename < 16
|
||||
//
|
||||
// Try system path
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user