mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-07 00:29:34 +00:00
read/write dazzle draw screens
This commit is contained in:
parent
8fc9175555
commit
eb43eb4e14
@ -8,4 +8,6 @@ import dcgrutils
|
|||||||
predef dcgrRect(x, y, w, h)#0
|
predef dcgrRect(x, y, w, h)#0
|
||||||
predef spriteRead(filestr)#5
|
predef spriteRead(filestr)#5
|
||||||
predef spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
predef spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
||||||
|
predef screenRead(filestr)#1
|
||||||
|
predef screenWrite(filestr)#1
|
||||||
end
|
end
|
||||||
|
@ -2,6 +2,8 @@ include "inc/cmdsys.plh"
|
|||||||
include "inc/fileio.plh"
|
include "inc/fileio.plh"
|
||||||
include "inc/dcgrlib.plh"
|
include "inc/dcgrlib.plh"
|
||||||
|
|
||||||
|
const page1m = $C054
|
||||||
|
const page1x = $C055
|
||||||
//
|
//
|
||||||
// Apple //e hires character font
|
// Apple //e hires character font
|
||||||
//
|
//
|
||||||
@ -150,11 +152,10 @@ export def spriteRead(filestr)#5
|
|||||||
return xorg, yorg, width, height, sprptr
|
return xorg, yorg, width, height, sprptr
|
||||||
end
|
end
|
||||||
export def spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
export def spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
||||||
var sprsize, error
|
var sprsize
|
||||||
byte refnum, i
|
byte refnum, i
|
||||||
|
|
||||||
sprsize = (width + 1) / 2 * height
|
sprsize = (width + 1) / 2 * height
|
||||||
error = FALSE
|
|
||||||
fileio:destroy(filestr)
|
fileio:destroy(filestr)
|
||||||
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
|
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
|
||||||
refnum = fileio:open(filestr)
|
refnum = fileio:open(filestr)
|
||||||
@ -164,9 +165,38 @@ export def spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
|||||||
fileio:write(refnum, @width, 1)
|
fileio:write(refnum, @width, 1)
|
||||||
fileio:write(refnum, @height, 1)
|
fileio:write(refnum, @height, 1)
|
||||||
sprsize = (width + 1) / 2 * height
|
sprsize = (width + 1) / 2 * height
|
||||||
error = fileio:write(refnum, sprptr, sprsize) <> sprsize
|
fileio:write(refnum, sprptr, sprsize) <> sprsize
|
||||||
fileio:close(refnum)
|
fileio:close(refnum)
|
||||||
fin
|
fin
|
||||||
fin
|
fin
|
||||||
return error
|
return perr
|
||||||
|
end
|
||||||
|
export def screenRead(filestr)#1
|
||||||
|
byte refnum
|
||||||
|
|
||||||
|
refnum = fileio:open(filestr)
|
||||||
|
if refnum
|
||||||
|
^page1x // Read AUX bytes
|
||||||
|
fileio:read(refnum, $2000, $2000)
|
||||||
|
^page1m // Read MAIN bytes
|
||||||
|
fileio:read(refnum, $2000, $2000)
|
||||||
|
fileio:close(refnum)
|
||||||
|
fin
|
||||||
|
return perr
|
||||||
|
end
|
||||||
|
export def screenWrite(filestr)#1
|
||||||
|
byte refnum
|
||||||
|
|
||||||
|
fileio:destroy(filestr)
|
||||||
|
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
|
||||||
|
refnum = fileio:open(filestr)
|
||||||
|
if refnum
|
||||||
|
^page1x // Write AUX bytes
|
||||||
|
fileio:write(refnum, $2000, $2000)
|
||||||
|
^page1m // Write MAIN bytes
|
||||||
|
fileio:write(refnum, $2000, $2000)
|
||||||
|
fileio:close(refnum)
|
||||||
|
fin
|
||||||
|
fin
|
||||||
|
return perr
|
||||||
end
|
end
|
||||||
|
@ -422,6 +422,7 @@ def dcgrTest#0
|
|||||||
getc
|
getc
|
||||||
end
|
end
|
||||||
dcgrMode(0)
|
dcgrMode(0)
|
||||||
|
screenRead("monarch")
|
||||||
readEnterprise
|
readEnterprise
|
||||||
dcgrCompSprite(2)
|
dcgrCompSprite(2)
|
||||||
dcgrCompMask(2)
|
dcgrCompMask(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user