1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-02-20 17:29:11 +00:00

Keep trying to free some bytes

This commit is contained in:
David Schmenk 2023-03-18 19:30:17 -07:00
parent 4ca1ba9c04
commit 3d1c3e9407
7 changed files with 30 additions and 39 deletions

View File

@ -5,6 +5,7 @@ include "inc/cmdsys.plh"
include "inc/inet.plh"
include "inc/fileio.plh"
include "inc/conio.plh"
sysflags nojitc // Keep JITC from compiling and pausing while transferring
//
// TFTP values
//
@ -369,7 +370,7 @@ def volumes#0
next
end
puts("TFTP Server,Version 2.0\n")
puts("TFTP Server, Version 2.0\n")
if !iNet:initIP()
return -1
fin

View File

@ -1318,9 +1318,8 @@ end
def docmds#0
word prefix
prefix = allocheap(64)
pfxop(prefix, GET_PFX)
while 1
prefix = pfxop(heap, GET_PFX)
repeat
if ^getlnbuf
strcpy(@cmdln, getlnbuf)
when toupper(parsecmd(getlnbuf))
@ -1345,7 +1344,6 @@ def docmds#0
execsys(getlnbuf)
break
is '+'
releaseheap(prefix)
//
// Exec module
//
@ -1354,7 +1352,6 @@ def docmds#0
// Clean up
//
resetmemfiles
prefix = allocheap(64)
break
otherwise
cout('?')
@ -1367,7 +1364,7 @@ def docmds#0
fin
prstr(pfxop(prefix, GET_PFX))
rdstr($BA)
loop
until 0
end
//
// Dummy definition to get free heap
@ -1381,7 +1378,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.0 BETA 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.0 64K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
//
// Init symbol table.
//

View File

@ -1388,9 +1388,8 @@ def docmds#0
loadmod(jitmod) // Cannot do this in init code - it will overwrite it!
xheap = $0400 // Reset heap to point at low memory
xheaptop = $A000 // Top below JITC
prefix = allocheap(64)
pfxop(prefix, GET_PFX)
while 1
prefix = pfxop(heap, GET_PFX)
repeat
if ^getlnbuf
strcpy(@cmdln, getlnbuf)
when toupper(parsecmd(getlnbuf))
@ -1415,7 +1414,6 @@ def docmds#0
execsys(getlnbuf)
break
is '+'
releaseheap(prefix)
//
// Set JIT code pointer
//
@ -1428,7 +1426,6 @@ def docmds#0
// Clean up
//
resetmemfiles
prefix = allocheap(64)
break
otherwise
cout('?')
@ -1441,7 +1438,7 @@ def docmds#0
fin
prstr(pfxop(prefix, GET_PFX))
rdstr($BA)
loop
until 0
end
//
// Dummy definition to get free heap
@ -1455,7 +1452,7 @@ heap = @lastdef
//
// Print PLASMA version
//
prstr("PLASMA 2.0 BETA 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA 2.0 128K\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
//
// Init symbol table.
//

View File

@ -170,11 +170,10 @@ end
//
def shell#1
byte textmode[3]
word prefix
byte prefix[64]
byte err[]
word cmdptr
prefix = heapalloc(64)
//
// Copy AUTORUN commmand line
//
@ -190,18 +189,18 @@ def shell#1
break
is 'P'
if ^cmdptr and ^(cmdptr + 1) <> '/'
strcat(prefix, cmdptr)
strcat(@prefix, cmdptr)
else
strcpy(prefix, cmdptr)
strcpy(@prefix, cmdptr)
fin
setpfx(prefix)
setpfx(@prefix)
break
is '/'
repeat
^prefix--
until prefix->[^prefix] == '/'
if ^prefix > 1
setpfx(prefix)
prefix--
until prefix[prefix] == '/'
if prefix > 1
setpfx(@prefix)
fin
break
is 'S'
@ -212,7 +211,6 @@ def shell#1
volumes
break
is '+'
heaprelease(prefix)
//cmdsys:modexec(striptrail(cmdptr))
return striptrail(cmdptr)
//cmdsys:syswrite(cmdsys.refcons, @textmode, 3)
@ -229,7 +227,7 @@ def shell#1
fin
putln
fin
puts(getpfx(prefix))
puts(getpfx(@prefix))
cmdptr = gets($BA)
strcpy(cmdsys:cmdline, cmdptr)
until 0

View File

@ -245,11 +245,10 @@ end
//
def shell#1
byte textmode[3]
word prefix
byte prefix[64]
byte err[]
word cmdptr
prefix = heapalloc(64)
//
// Copy AUTORUN commmand line
//
@ -265,18 +264,18 @@ def shell#1
break
is 'P'
if ^cmdptr and ^(cmdptr + 1) <> '/'
strcat(prefix, cmdptr)
strcat(@prefix, cmdptr)
else
strcpy(prefix, cmdptr)
strcpy(@prefix, cmdptr)
fin
setpfx(prefix)
setpfx(@prefix)
break
is '/'
repeat
^prefix--
until prefix->[^prefix] == '/'
if ^prefix > 1
setpfx(prefix)
prefix--
until prefix[prefix] == '/'
if prefix > 1
setpfx(@prefix)
fin
break
is 'S'
@ -287,7 +286,6 @@ def shell#1
volumes
break
is '+'
heaprelease(prefix)
*jitcodeptr = jitcbuf
//cmdsys:modexec(striptrail(cmdptr))
return striptrail(cmdptr)
@ -305,7 +303,7 @@ def shell#1
fin
putln
fin
puts(getpfx(prefix))
puts(getpfx(@prefix))
cmdptr = gets($BA)
strcpy(cmdsys:cmdline, cmdptr)
until 0

View File

@ -1263,7 +1263,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.0 BETA\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.0\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser

View File

@ -1286,7 +1286,7 @@ cmdlnptr = @cmdln
// Print PLASMA version
//
init_cons
prstr("PLASMA 2.0 BETA JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("PLASMA 2.0 JITC\n")//; putb(version.1); putc('.'); putb(version.0); putln
prstr("MEM:$"); prword(availheap); crout
//
// Exec command line parser