1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-10-01 14:57:08 +00:00

Change text file EOL strategy

This commit is contained in:
David Schmenk 2018-04-29 14:47:44 -07:00
parent 1ced9b1a1a
commit d7e0873c10
2 changed files with 34 additions and 27 deletions

View File

@ -191,7 +191,7 @@ def readUDP(ipsrc, portsrc, data, len, param)
fin
if param == 512 // Size of initial read
param = fileio:read(ref, buff+datBytes, 512)
if netscii
if type == $04 // TXT type
xlat($0D, $0A, buff+datBytes, param)
fin
block++
@ -228,7 +228,7 @@ def writeUDP(ipsrc, portsrc, data, len, param)
break
fin
len = len - t_datPkt
if netscii
if type == $04 // TXT type
xlat($0A, $0D, data+datBytes, len)
fin
if fileio:write(ref, data+datBytes, len) <> len
@ -259,6 +259,8 @@ def writeUDP(ipsrc, portsrc, data, len, param)
return 0
end
def servUDP(ipsrc, portsrc, data, len, param)
byte info[24]
when *data
is RRQ // Read request
//
@ -284,12 +286,16 @@ def servUDP(ipsrc, portsrc, data, len, param)
iNet:sendUDP(portTFTP, ipsrc, portsrc, @tftpError, t_errPkt)
return 0
fin
info.0 = $0A
info:1 = @filename
syscall($C4, @info)
type = info.4
puts("Reading file: "); puts(@filename); putln
TID = (TID + TID_INC) | $1000
block = 1
buff=>datBlock = swab(block)
len = fileio:read(ref, buff+datBytes, 512)
if netscii
if type == $04 // TXT type
xlat($0D, $0A, buff+datBytes, 512)
fin
portTID = iNet:openUDP(TID, @readUDP, len)

View File

@ -1,32 +1,33 @@
#!/bin/bash
# Build tools
echo "BLD/PLASM"; atftp $1 --put -l rel/PLASM#FE1000 -r $2/BLD/PLASM#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
#Build incs
echo "BLD/INC/ARGS.PLH"; atftp $1 --option "mode netascii" --put -l inc/args.plh -r $2/BLD/INC/ARGS.PLH#040000
echo "BLD/INC/CMDSYS.PLH"; atftp $1 --option "mode netascii" --put -l inc/cmdsys.plh -r $2/BLD/INC/CMDSYS.PLH#040000
echo "BLD/INC/CONIO.PLH"; atftp $1 --option "mode netascii" --put -l inc/conio.plh -r $2/BLD/INC/CONIO.PLH#040000
echo "BLD/INC/DGR.PLH"; atftp $1 --option "mode netascii" --put -l inc/dgr.plh -r $2/BLD/INC/DGR.PLH#040000
echo "BLD/INC/FIBER.PLH"; atftp $1 --option "mode netascii" --put -l inc/fiber.plh -r $2/BLD/INC/FIBER.PLH#040000
echo "BLD/INC/FILEIO.PLH"; atftp $1 --option "mode netascii" --put -l inc/fileio.plh -r $2/BLD/INC/FILEIO.PLH#040000
echo "BLD/INC/FPSTR.PLH"; atftp $1 --option "mode netascii" --put -l inc/fpstr.plh -r $2/BLD/INC/FPSTR.PLH#040000
echo "BLD/INC/FPU.PLH"; atftp $1 --option "mode netascii" --put -l inc/fpu.plh -r $2/BLD/INC/FPU.PLH#040000
echo "BLD/INC/GRAFIX.PLH"; atftp $1 --option "mode netascii" --put -l inc/grafix.plh -r $2/BLD/INC/GRAFIX.PLH#040000
echo "BLD/INC/INET.PLH"; atftp $1 --option "mode netascii" --put -l inc/inet.plh -r $2/BLD/INC/INET.PLH#040000
echo "BLD/INC/JOYBUZZ.PLH"; atftp $1 --option "mode netascii" --put -l inc/joybuzz.plh -r $2/BLD/INC/JOYBUZZ.PLH#040000
echo "BLD/INC/LONGJUMP.PLH"; atftp $1 --option "mode netascii" --put -l inc/longjmp.plh -r $2/BLD/INC/LONGJUMP.PLH#040000
echo "BLD/INC/LZ4.PLH"; atftp $1 --option "mode netascii" --put -l inc/lz4.plh -r $2/BLD/INC/LZ4.PLH#040000
echo "BLD/INC/MEMMGR.PLH"; atftp $1 --option "mode netascii" --put -l inc/memmgr.plh -r $2/BLD/INC/MEMMGR.PLH#040000
echo "BLD/INC/MOUSE.PLH"; atftp $1 --option "mode netascii" --put -l inc/mouse.plh -r $2/BLD/INC/MOUSE.PLH#040000
echo "BLD/INC/PORTIO.PLH"; atftp $1 --option "mode netascii" --put -l inc/portio.plh -r $2/BLD/INC/PORTIO.PLH#040000
echo "BLD/INC/SANE.PLH"; atftp $1 --option "mode netascii" --put -l inc/sane.plh -r $2/BLD/INC/SANE.PLH#040000
echo "BLD/INC/SDFAT.PLH"; atftp $1 --option "mode netascii" --put -l inc/sdfat.plh -r $2/BLD/INC/SDFAT.PLH#040000
echo "BLD/INC/SNDSEQ.PLH"; atftp $1 --option "mode netascii" --put -l inc/sndseq.plh -r $2/BLD/INC/SNDSEQ.PLH#040000
echo "BLD/INC/SPIPORT.PLH"; atftp $1 --option "mode netascii" --put -l inc/spiport.plh -r $2/BLD/INC/SPIPORT.PLH#040000
echo "BLD/INC/TESTLIB.PLH"; atftp $1 --option "mode netascii" --put -l inc/testlib.plh -r $2/BLD/INC/TESTLIB.PLH#040000
echo "BLD/INC/ARGS.PLH"; atftp $1 --put -l inc/args.plh -r $2/BLD/INC/ARGS.PLH#040000
echo "BLD/INC/CMDSYS.PLH"; atftp $1 --put -l inc/cmdsys.plh -r $2/BLD/INC/CMDSYS.PLH#040000
echo "BLD/INC/CONIO.PLH"; atftp $1 --put -l inc/conio.plh -r $2/BLD/INC/CONIO.PLH#040000
echo "BLD/INC/DGR.PLH"; atftp $1 --put -l inc/dgr.plh -r $2/BLD/INC/DGR.PLH#040000
echo "BLD/INC/FIBER.PLH"; atftp $1 --put -l inc/fiber.plh -r $2/BLD/INC/FIBER.PLH#040000
echo "BLD/INC/FILEIO.PLH"; atftp $1 --put -l inc/fileio.plh -r $2/BLD/INC/FILEIO.PLH#040000
echo "BLD/INC/FPSTR.PLH"; atftp $1 --put -l inc/fpstr.plh -r $2/BLD/INC/FPSTR.PLH#040000
echo "BLD/INC/FPU.PLH"; atftp $1 --put -l inc/fpu.plh -r $2/BLD/INC/FPU.PLH#040000
echo "BLD/INC/GRAFIX.PLH"; atftp $1 --put -l inc/grafix.plh -r $2/BLD/INC/GRAFIX.PLH#040000
echo "BLD/INC/INET.PLH"; atftp $1 --put -l inc/inet.plh -r $2/BLD/INC/INET.PLH#040000
echo "BLD/INC/JOYBUZZ.PLH"; atftp $1 --put -l inc/joybuzz.plh -r $2/BLD/INC/JOYBUZZ.PLH#040000
echo "BLD/INC/LONGJUMP.PLH"; atftp $1 --put -l inc/longjmp.plh -r $2/BLD/INC/LONGJUMP.PLH#040000
echo "BLD/INC/LZ4.PLH"; atftp $1 --put -l inc/lz4.plh -r $2/BLD/INC/LZ4.PLH#040000
echo "BLD/INC/MEMMGR.PLH"; atftp $1 --put -l inc/memmgr.plh -r $2/BLD/INC/MEMMGR.PLH#040000
echo "BLD/INC/MOUSE.PLH"; atftp $1 --put -l inc/mouse.plh -r $2/BLD/INC/MOUSE.PLH#040000
echo "BLD/INC/PORTIO.PLH"; atftp $1 --put -l inc/portio.plh -r $2/BLD/INC/PORTIO.PLH#040000
echo "BLD/INC/SANE.PLH"; atftp $1 --put -l inc/sane.plh -r $2/BLD/INC/SANE.PLH#040000
echo "BLD/INC/SDFAT.PLH"; atftp $1 --put -l inc/sdfat.plh -r $2/BLD/INC/SDFAT.PLH#040000
echo "BLD/INC/SNDSEQ.PLH"; atftp $1 --put -l inc/sndseq.plh -r $2/BLD/INC/SNDSEQ.PLH#040000
echo "BLD/INC/SPIPORT.PLH"; atftp $1 --put -l inc/spiport.plh -r $2/BLD/INC/SPIPORT.PLH#040000
echo "BLD/INC/TESTLIB.PLH"; atftp $1 --put -l inc/testlib.plh -r $2/BLD/INC/TESTLIB.PLH#040000
# Sample source
echo "BLD/MOUSETEST.PLA"; atftp $1 --option "mode netascii" --put -l samplesrc/mousetest.pla -r $2/BLD/MOUSETEST.PLA#040000
echo "BLD/HTTPD.PLA"; atftp $1 --option "mode netascii" --put -l samplesrc/httpd.pla -r $2/BLD/HTTPD.PLA#040000
echo "BLD/MOUSETEST.PLA"; atftp $1 --put -l samplesrc/mousetest.pla -r $2/BLD/MOUSETEST.PLA#040000
echo "BLD/HTTPD.PLA"; atftp $1 --put -l samplesrc/httpd.pla -r $2/BLD/HTTPD.PLA#040000
echo "BLD/LZ4CAT.PLA"; atftp $1 --put -l samplesrc/lz4cat.pla -r $2/BLD/LZ4CAT.PLA#040000