1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-04-20 01:16:36 +00:00

Use cmdsys.plh include file

This commit is contained in:
Dave Schmenk
2017-11-11 06:50:06 -08:00
parent 50c72063dd
commit e9191c20d8
31 changed files with 950 additions and 1564 deletions
+1 -3
View File
@@ -1,6 +1,4 @@
import cmdsys
predef puts
end
include "inc/cmdsys.plh"
puts("Hello, world.\n")
done
+2 -15
View File
@@ -1,17 +1,4 @@
import cmdsys
predef memset
//
// System flags: memory allocator screen holes.
//
const restxt1 = $0001
const restxt2 = $0002
const resxtxt1 = $0004
const resxtxt2 = $0008
const reshgr1 = $0010
const reshgr2 = $0020
const resxhgr1 = $0040
const resxhgr2 = $0080
end
include "inc/cmdsys.plh"
sysflags reshgr1 // Reserve HGR page 1
@@ -20,4 +7,4 @@ memset($2000, 0, $2000) // Clear HGR page 1
^$C052
^$C057
^$C050
done
done
+1 -5
View File
@@ -1,8 +1,4 @@
import cmdsys
predef memset, memcpy, heapalloc, heapmark, heaprelease
predef puts, putc, gets, getc
predef isugt, isuge, isult, isule
end
include "inc/cmdsys.plh"
import HGR1
end
+13 -19
View File
@@ -8,13 +8,7 @@
// - check for binary files and set Content-Type accordingly
// still todo: output base filename for Content-Disposition header
//
import cmdsys
predef syscall, call, getc, gets, putc, puts, putln
predef memset, memcpy, modaddr, modexec
predef isugt, isuge, isult, isule
predef heapmark, heapallocalign, heapalloc, heaprelease
byte MACHID
end
include "inc/cmdsys.plh"
//
// Net object
//
@@ -116,7 +110,7 @@ def read(refnum, buff, len)
end
def get_eof(refnum)
byte params[5]
params.0 = 2
params.1 = refnum
params:2 = 0
@@ -125,7 +119,7 @@ def get_eof(refnum)
return params:2
end
def get_file_info(path)
fileInfo.0 = 10 // param count
fileInfo:1 = path // path name
@@ -155,7 +149,7 @@ def puti(i)
end
def putip(ipptr)
byte i
for i = 0 to 2
puti(ipptr->[i]); putc('.')
next
@@ -163,7 +157,7 @@ def putip(ipptr)
end
def dumpbytes(buf, len)
word i
for i = 0 to len - 1
putb(buf->[i])
if i & 15 == 15
@@ -175,7 +169,7 @@ def dumpbytes(buf, len)
end
def dumpchars(buf, len)
word i
len = len - 1
for i = 0 to len
putc(buf->[i])
@@ -194,7 +188,7 @@ def itos(dst, i)
if i < 0; ^dst = '-'; i = -i; dst = dst + 1; fin
if i < 10
^dst = i + '0'
else
else
dst = itos(dst, i / 10)
^dst = i % 10 + '0'
fin
@@ -247,7 +241,7 @@ def servHTTP(remip, remport, lclport, data, len, param)
url->1 = url->0 - 1
url = url + 1
fin
fin
fin
strcat(@filename, @prefix, url)
puts("GET:"); puts(@filename);putln
//
@@ -271,7 +265,7 @@ def servHTTP(remip, remport, lclport, data, len, param)
//
//puts(@mimeTextHtml) // debug
strcat(@okhdr, @okhdr, @httpContentType)
strcat(@okhdr, @okhdr, @mimeTextHtml)
strcat(@okhdr, @okhdr, @mimeTextHtml)
else
//
// send as binary attachment
@@ -285,7 +279,7 @@ def servHTTP(remip, remport, lclport, data, len, param)
//
strcat(@okhdr, @okhdr, @httpContentAttach)
// todo: get the base filename...
fin
fin
strcat(@okhdr, @okhdr, @httpEnd)
//dumpchars(@okhdr + 1, okhdr) // debug
iNet:sendTCP(socketHTTP, @okhdr + 1, okhdr) // send HTTP response header to client
@@ -313,8 +307,8 @@ getpfx(@prefix)
//
// Alloc aligned file/io buffers
//
filebuff = heapallocalign(1024, 8, 0)
iobuff = heapallocalign(1024, 8, 0)
filebuff = heapallocalign(1024, 8, 0)
iobuff = heapallocalign(1024, 8, 0)
//
// Service IP
//
@@ -329,4 +323,4 @@ repeat
until ^$C000 > 127
^$C010
done
done
+2 -8
View File
@@ -1,10 +1,4 @@
import cmdsys
predef syscall, call, memset, getc, gets, putc, puts, putln
predef memset, memcpy, modaddr, modexec
predef heapmark, heapallocalign, heapalloc, heaprelease
predef isugt, isuge, isult, isule
byte MACHID
end
include "inc/cmdsys.plh"
import memmgr
predef sweep, brk, sbrk
predef hmemNew, hmemLock, hmemUnlock, hmemRef, hmemDel, hmemFre
@@ -76,4 +70,4 @@ if memptr; puth(e); putc('='); puth(*memptr); putln; fin
hmemUnlock(e)
hmemDel(e)
memfre=hmemFre(@memlrgst);puth(memfre); putc(' '); puth(memlrgst); putln
done
done
+2 -8
View File
@@ -1,10 +1,4 @@
import cmdsys
predef syscall, call, memset, getc, gets, putc, puts, putln
predef memset, memcpy, modaddr, modexec
predef heapmark, heapallocalign, heapalloc, heaprelease
predef isugt, isuge, isult, isule
byte MACHID
end
include "inc/cmdsys.plh"
byte bye = $20, $00, $BF, $65
word paramsptr
byte[7] params = 4
@@ -22,4 +16,4 @@ paramsptr = @params
// Call into monitor
//
call(-151, 0, 0, 0, 0)
done
done
+1 -4
View File
@@ -1,7 +1,4 @@
import cmdsys
predef syscall(f,p)#1, call(adr,a,x,y,p)#1, memset(d,s,l)#1, getc#1, putc(c)#1, puts(s)#1, modaddr(a)#1
byte MACHID
end
include "inc/cmdsys.plh"
//
// Handy constants.
//
+1 -6
View File
@@ -1,9 +1,4 @@
import cmdsys
predef syscall, call, memset, getc, putc, puts, putln
predef memset, memcpy
predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail
byte MACHID
end
include "inc/cmdsys.plh"
import ROGUEMAP
predef puti, toupper, moveplayer
+2 -7
View File
@@ -1,9 +1,4 @@
import cmdsys
predef syscall, call, getc, putc, puts, putln
predef memset, memcpy, modaddr
predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail
byte MACHID
end
include "inc/cmdsys.plh"
const modkeep = $2000
const modinitkeep = $4000
@@ -279,4 +274,4 @@ while ^titlestr
titlestr = titlestr + ^titlestr + 1
loop
done
done
+2 -7
View File
@@ -1,12 +1,7 @@
//
// Map module
//
import cmdsys
predef syscall, call, getc, putc, puts, putln
predef memset, memcpy, modaddr
predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail
byte MACHID
end
include "inc/cmdsys.plh"
import rogueio
const O_READ = 1
@@ -767,4 +762,4 @@ export def drawvisentity(xofst, yofst, tile)
fin
end
done
done
+2 -8
View File
@@ -1,9 +1,4 @@
import cmdsys
predef syscall, call, memset, getc, gets, putc, puts, putln
predef memset, memcpy
predef heapmark, heapallocalign, heapalloc, heaprelease, heapavail
byte MACHID
end
include "inc/cmdsys.plh"
import roguemap
const xcentr = 20
@@ -238,7 +233,7 @@ end
def moveplayer(dir)
byte xmove, ymove
xmove = player.xpos + dir * xdir[player.angle]
ymove = player.ypos + dir * ydir[player.angle]
when getmaptile(xmove, ymove) & MAP_TILE
@@ -666,4 +661,3 @@ else
fin
puts(@againstr)
done
+2 -5
View File
@@ -1,7 +1,4 @@
import cmdsys
predef syscall, call, memset, getc, putc, puts, putln
byte MACHID
end
include "inc/cmdsys.plh"
const FALSE = 0
const TRUE = !FALSE
@@ -48,4 +45,4 @@ beep
beep
puti(count)
puts(@strPrimes)
done
done