1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-03-27 18:35:06 +00:00

Minimal but working sprite editor

This commit is contained in:
David Schmenk 2024-10-27 19:53:38 -07:00
parent a2d8d22c3d
commit 12c9e07826
15 changed files with 326 additions and 248 deletions

8
src/inc/dcgrutils.plh Normal file
View File

@ -0,0 +1,8 @@
import dcgrutils
predef dcgrAllocBl7Mem(w, h)#2
predef dcgrStr(x, y, strptr)#0
predef dcgrBoldStr(x, y, strptr)#0
predef dcgrRect(x, y, w, h)#0
predef spriteRead(filestr)#5
predef spriteWrite(filestr, xorg, yorg, width, height, sprptr, sprspan)#1
end

View File

@ -642,7 +642,6 @@ YPIXS LDY ESTKL-2,X ; Y COORD
CPY #192 ; OFF SCREEN?
BCC +
LDA ESTKL-3,X ; WIDTH
ADC #0 ; ROUND UP (WITH CARRY)
LSR
ADC SRCL ; NEXT PIXMAP ROW
STA SRCL
@ -677,6 +676,7 @@ asm _dcgrPixmapScrC
PIXSCRH INC TMPL
LDA TMPL
CMP ESTKH-3,X ; AT RIGHT EDGE?
BEQ ++
CMP #140 ; OFF SCREEN?
BCS +
LDA (SRC),Y ; HI NIBBLE SRC PIXEL
@ -695,12 +695,12 @@ end
asm _dcgrPixmapScrE
JSR $1000 ; PLOT PIXEL
LDY #$00
+ INC SRCL
BNE +
INC SRCH
+ INC TMPL
LDA TMPL
CMP ESTKH-3,X ; AT RIGHT EDGE?
++ INC SRCL
BNE +
INC SRCH
+ CMP ESTKH-3,X ; AT RIGHT EDGE?
BNE PIXSCRL
NXTPIXS DEC ESTKL-4,X ; HEIGHT
BNE YPIXS ; NEXT ROW
@ -1055,7 +1055,6 @@ YPIXM LDA ESTKL-2,X ; Y COORD
CMP ESTKL-7,X ; OUT OF DST BOUNDS?
BCC +
LDA ESTKL-3,X ; WIDTH
ADC #0 ; ROUND UP (WITH CARRY)
LSR
ADC SRCL ; NEXT PIXMAP ROW
STA SRCL
@ -1087,7 +1086,7 @@ asm _dcgrPixmapMemC
PIXMEMH INC TMPL
LDA TMPL
CMP ESTKH-3,X ; AT RIGHT EDGE?
BEQ NXTPIXM ; NEXT ROW
BEQ ++ ; NEXT ROW
CMP ESTKL-6,X ; OUT OF DST BOUNDS?
BCS +
LDA (SRC),Y ; HI NIBBLE SRC PIXEL
@ -1107,12 +1106,12 @@ end
asm _dcgrPixmapMemE
JSR $1000 ; PLOT PIXEL
LDY #$00
+ INC SRCL ; PIXPTR
BNE +
INC SRCH
+ INC TMPL
LDA TMPL
CMP ESTKH-3,X ; AT RIGHT EDGE?
++ INC SRCL ; PIXPTR
BNE +
INC SRCH
+ CMP ESTKH-3,X ; AT RIGHT EDGE?
BNE PIXMEML
NXTPIXM CLC
LDA ESTKL-9,X ; SPAN

View File

@ -0,0 +1,229 @@
include "inc/cmdsys.plh"
include "inc/fileio.plh"
include "inc/dcgrlib.plh"
//
// Apple //e hires character font
//
byte fontBits[]
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $04,$08,$10,$00,$00,$00,$00,$00,$00,$00,$1C,$20,$3C,$22,$3C,$00
byte = $02,$02,$1E,$22,$22,$22,$1E,$00,$00,$00,$3C,$02,$02,$02,$3C,$00
byte = $20,$20,$3C,$22,$22,$22,$3C,$00,$00,$00,$1C,$22,$3E,$02,$3C,$00
byte = $18,$24,$04,$1E,$04,$04,$04,$00,$00,$00,$1C,$22,$22,$3C,$20,$1C
byte = $02,$02,$1E,$22,$22,$22,$22,$00,$08,$00,$0C,$08,$08,$08,$1C,$00
byte = $10,$00,$18,$10,$10,$10,$12,$0C,$02,$02,$22,$12,$0E,$12,$22,$00
byte = $0C,$08,$08,$08,$08,$08,$1C,$00,$00,$00,$36,$2A,$2A,$22,$22,$00
byte = $00,$00,$1E,$22,$22,$22,$22,$00,$00,$00,$1C,$22,$22,$22,$1C,$00
byte = $00,$00,$1E,$22,$22,$1E,$02,$02,$00,$00,$3C,$22,$22,$3C,$20,$20
byte = $00,$00,$3A,$06,$02,$02,$02,$00,$00,$00,$3C,$02,$1C,$20,$1E,$00
byte = $04,$04,$1E,$04,$04,$24,$18,$00,$00,$00,$22,$22,$22,$32,$2C,$00
byte = $00,$00,$22,$22,$22,$14,$08,$00,$00,$00,$22,$22,$2A,$2A,$36,$00
byte = $00,$00,$22,$14,$08,$14,$22,$00,$00,$00,$22,$22,$22,$3C,$20,$1C
byte = $00,$00,$3E,$10,$08,$04,$3E,$00,$38,$0C,$0C,$06,$0C,$0C,$38,$00
byte = $08,$08,$08,$08,$08,$08,$08,$08,$0E,$18,$18,$30,$18,$18,$0E,$00
byte = $00,$2C,$1A,$00,$00,$00,$00,$00,$00,$2A,$14,$2A,$14,$2A,$00,$00
//
// Utility functions
//
export def dcgrAllocBl7Mem(w, h)#2
word memblk, span
span = (w+13)/7 << 2
memblk = heapalloc(span * h)
return memblk, span
end
export def dcgrStr(x, y, strptr)#0
byte i
for i = 1 to ^strptr
dcgrBitmap(x, y, 7, 8, @fontBits + (^(strptr + i) + 128) * 8)
x = x + 7
next
end
export def dcgrBoldStr(x, y, strptr)#0
byte h, v
for v = y - 1 to y + 1
for h = x - 1 to x + 1
dcgrStr(h, v, strptr)
next
next
dcgrColor(CLR_BLACK)
dcgrStr(x, y, strptr)
end
export def dcgrRect(x, y, w, h)#0
byte x2, y2, v
x2 = x + w - 1
y2 = y + h - 1
for v = y to y2
dcgrHLin(x, x2, v)
next
end
export def spriteRead(filestr)#5
var sprptr, sprsize, xorg, yorg
byte refnum, width, height
width = 0
height = 0
sprptr = 0
refnum = fileio:open(filestr)
if refnum
fileio:read(refnum, @xorg, 1); xorg = sext(xorg)
fileio:read(refnum, @yorg, 1); yorg = sext(yorg)
fileio:read(refnum, @width, 1)
fileio:read(refnum, @height, 1)
if width <= 40 and height <= 48
sprsize = (width + 1) / 2 * height
sprptr = heapalloc(sprsize)
if sprptr
if fileio:read(refnum, sprptr, sprsize) <> sprsize
heaprelease(sprptr)
sprptr = NULL
fin
fin
fin
fileio:close(refnum)
fin
return xorg, yorg, width, height, sprptr
end
export def spriteWrite(filestr, xorg, yorg, width, height, sprptr, sprspan)#1
var sprsize, error
byte refnum, i
sprsize = (width + 1) / 2 * height
error = FALSE
fileio:destroy(filestr)
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
refnum = fileio:open(filestr)
if refnum
fileio:write(refnum, @xorg, 1)
fileio:write(refnum, @yorg, 1)
fileio:write(refnum, @width, 1)
fileio:write(refnum, @height, 1)
width = (width + 1) / 2
while height
if fileio:write(refnum, sprptr, width) <> width
error = TRUE
break
fin
sprptr = sprptr + sprspan
height--
loop
fileio:close(refnum)
fin
fin
return error
end

View File

@ -66,6 +66,7 @@ DGRLIB = rel/apple/DGRLIB\#FE1000
HGRSPRITE = rel/apple/HGRSPRITE\#FE1000
HGRTILE = rel/apple/HGRTILE\#FE1000
HGRFONT = rel/apple/HGRFONT\#FE1000
DCGRUTILS = rel/apple/DCGRUTILS\#FE1000
LINES = rel/LINES\#FE1000
GRAFIX = rel/apple/GRAFIX\#FE1000
SFM = rel/apple/SFM\#FE1000
@ -120,7 +121,7 @@ TXTTYPE = .TXT
#SYSTYPE = \#FF2000
#TXTTYPE = \#040000
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(TX2FORTH) $(SEXPR) $(SMATH) $(DRAWL) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(DCGRLIB) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(DCGRTEST) $(DCGRSPRED) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTEST)
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(TX2FORTH) $(SEXPR) $(SMATH) $(DRAWL) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(DCGRLIB) $(GRLIB) $(DGRLIB) $(DCGRUTILS) $(GRTEST) $(DGRTEST) $(HGRTEST) $(DCGRTEST) $(DCGRSPRED) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTEST)
-rm vmsrc/plvmzp.inc
@ -498,6 +499,10 @@ $(DGRLIB): libsrc/apple/dgrlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/dgrlib.pla
acme --setpc 4094 -o $(DGRLIB) libsrc/apple/dgrlib.a
$(DCGRUTILS): libsrc/apple/dcgrutils.pla $(DCGRLIB) $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/dcgrutils.pla
acme --setpc 4094 -o $(DCGRUTILS) libsrc/apple/dcgrutils.a
$(TILETEST): samplesrc/tiletest.pla $(PLASM)
./$(PLASM) -AMOW samplesrc/tiletest.pla
acme --setpc 4094 -o $(TILETEST) samplesrc/tiletest.a
@ -526,11 +531,11 @@ $(DGRTEST): samplesrc/dgrtest.pla $(DGRLIB) $(PLASM)
./$(PLASM) -AMOW samplesrc/dgrtest.pla
acme --setpc 4094 -o $(DGRTEST) samplesrc/dgrtest.a
$(DCGRTEST): samplesrc/dcgrtest.pla $(DCGRLIB) $(PLASM)
$(DCGRTEST): samplesrc/dcgrtest.pla $(DCGRLIB) $(DCGRUTILS) $(PLASM)
./$(PLASM) -AMOW samplesrc/dcgrtest.pla
acme --setpc 4094 -o $(DCGRTEST) samplesrc/dcgrtest.a
$(DCGRSPRED): samplesrc/dcgrspred.pla $(DCGRLIB) $(PLASM)
$(DCGRSPRED): samplesrc/dcgrspred.pla $(DCGRLIB) $(DCGRUTILS) $(PLASM)
./$(PLASM) -AMOW samplesrc/dcgrspred.pla
acme --setpc 4094 -o $(DCGRSPRED) samplesrc/dcgrspred.a

View File

@ -19,6 +19,7 @@ cp rel/apple/HGRTILE#FE1000 prodos/sys/HGRTILE.REL
cp rel/apple/HGRSPRITE#FE1000 prodos/sys/HGRSPRITE.REL
cp rel/apple/HGRLIB#FE1000 prodos/sys/HGRLIB.REL
cp rel/apple/DCGRLIB#FE1000 prodos/sys/DCGRLIB.REL
cp rel/apple/DCGRUTILS#FE1000 prodos/sys/DCGRUTILS.REL
cp rel/apple/GRLIB#FE1000 prodos/sys/GRLIB.REL
cp rel/apple/DGRLIB#FE1000 prodos/sys/DGRLIB.REL
cp rel/apple/COPY#FE1000 prodos/sys/COPY.REL
@ -104,8 +105,11 @@ cp rel/apple/TILETEST#FE1000 prodos/demos/apple2/TILETEST.REL
cp rel/apple/HGRTEST#FE1000 prodos/demos/apple2/HGRTEST.REL
cp rel/apple/GRTEST#FE1000 prodos/demos/apple2/GRTEST.REL
cp rel/apple/DGRTEST#FE1000 prodos/demos/apple2/DGRTEST.REL
cp rel/apple/DCGRTEST#FE1000 prodos/demos/apple2/DCGRTEST.REL
cp rel/apple/DCGRSPRED#FE1000 prodos/demos/apple2/DCGRSPRED.REL
mkdir prodos/demos/apple2/dcgr
cp rel/apple/DCGRTEST#FE1000 prodos/demos/apple2/dcgr/DCGRTEST.REL
cp rel/apple/DCGRSPRED#FE1000 prodos/demos/apple2/dcgr/DCGRSPRED.REL
cp samplesrc/ENT.* prodos/demos/apple2/dcgr
mkdir prodos/demos/apple2/spiders
cp rel/apple/SFM#FE1000 prodos/demos/apple2/spiders/SFM.REL
@ -227,6 +231,7 @@ cp inc/hgrlib.plh prodos/bld/inc/HGRLIB.PLH.TXT
cp inc/grlib.plh prodos/bld/inc/GRLIB.PLH.TXT
cp inc/dgrlib.plh prodos/bld/inc/DGRLIB.PLH.TXT
cp inc/dcgrlib.plh prodos/bld/inc/DCGRLIB.PLH.TXT
cp inc/dcgrutils.plh prodos/bld/inc/DCGRUTILS.PLH.TXT
cp inc/fiber.plh prodos/bld/inc/FIBER.PLH.TXT
cp inc/fileio.plh prodos/bld/inc/FILEIO.PLH.TXT
cp inc/int32.plh prodos/bld/inc/INT32.PLH.TXT

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +1,8 @@
include "inc/cmdsys.plh"
include "inc/fileio.plh"
include "inc/args.plh"
include "inc/grlib.plh"
include "inc/dcgrlib.plh"
include "inc/dcgrutils.plh"
sysflags restxt1|restxt2|resxtxt1|reshgr1|resxhgr1 // Reserve all the pages
@ -25,68 +25,6 @@ byte yCursor = 24
byte clrCursor = 0
byte bgTileOfst = 0
def spriteRead(filestr)#5
var sprptr, sprsize, xorg, yorg
byte refnum, width, height
width = 0
height = 0
sprptr = 0
refnum = fileio:open(filestr)
if refnum
fileio:read(refnum, @xorg, 1); xorg = sext(xorg)
fileio:read(refnum, @yorg, 1); yorg = sext(yorg)
fileio:read(refnum, @width, 1)
fileio:read(refnum, @height, 1)
puts("Sprite width, height = "); puti(width); puts(", "); puti(height); putln
if width > 40 or height > 48
fileio:close(refnum)
return 0, 0, 0, 0, 0
fin
sprsize = (width + 1) / 2 * height
sprptr = heapalloc(sprsize)
if not sprptr
fileio:close(refnum)
return 0, 0, 0, 0, 0
fin
if fileio:read(refnum, sprptr, sprsize) <> sprsize
fileio:close(refnum)
return 0, 0, 0, 0, 0
fin
fileio:close(refnum)
fin
return xorg, yorg, width, height, sprptr
end
def spriteWrite(filestr, xorg, yorg, width, height, sprptr, sprspan)#1
var sprsize, result
byte refnum, i
sprsize = (width + 1) / 2 * height
result = FALSE
fileio:destroy(filestr)
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
refnum = fileio:open(filestr)
if refnum
fileio:write(refnum, @xorg, 1)
fileio:write(refnum, @yorg, 1)
fileio:write(refnum, @width, 1)
fileio:write(refnum, @height, 1)
width = (width + 1) / 2
while height
if fileio:write(refnum, sprptr, width) <> width
result = TRUE
break
fin
sprptr = sprptr + sprspan
height--
loop
fileio:close(refnum)
fin
fin
return result
end
def dcgr2gr(width, height, pdcgrSpr)#0
var pgrSpr
byte i, cl, ch
@ -137,7 +75,8 @@ def gr2dcgr#6
pdcgrSpr++
next
next
pdcgrSpr = @dcgrSprite + ymin * 20 + (xmin + 1) / 2
if xmin & 1; xmin--; fin
pdcgrSpr = @dcgrSprite + ymin * 20 + xmin / 2
return xCursor - xmin, yCursor - ymin, xmax - xmin + 1, ymax - ymin + 1, pdcgrSpr, 20
end

View File

@ -1,141 +1,10 @@
include "inc/cmdsys.plh"
include "inc/lines.plh"
include "inc/dcgrlib.plh"
include "inc/dcgrutils.plh"
sysflags resxtxt1|reshgr1|resxhgr1
//
// Apple //e hires character font
//
byte fontBits[]
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $04,$08,$10,$00,$00,$00,$00,$00,$00,$00,$1C,$20,$3C,$22,$3C,$00
byte = $02,$02,$1E,$22,$22,$22,$1E,$00,$00,$00,$3C,$02,$02,$02,$3C,$00
byte = $20,$20,$3C,$22,$22,$22,$3C,$00,$00,$00,$1C,$22,$3E,$02,$3C,$00
byte = $18,$24,$04,$1E,$04,$04,$04,$00,$00,$00,$1C,$22,$22,$3C,$20,$1C
byte = $02,$02,$1E,$22,$22,$22,$22,$00,$08,$00,$0C,$08,$08,$08,$1C,$00
byte = $10,$00,$18,$10,$10,$10,$12,$0C,$02,$02,$22,$12,$0E,$12,$22,$00
byte = $0C,$08,$08,$08,$08,$08,$1C,$00,$00,$00,$36,$2A,$2A,$22,$22,$00
byte = $00,$00,$1E,$22,$22,$22,$22,$00,$00,$00,$1C,$22,$22,$22,$1C,$00
byte = $00,$00,$1E,$22,$22,$1E,$02,$02,$00,$00,$3C,$22,$22,$3C,$20,$20
byte = $00,$00,$3A,$06,$02,$02,$02,$00,$00,$00,$3C,$02,$1C,$20,$1E,$00
byte = $04,$04,$1E,$04,$04,$24,$18,$00,$00,$00,$22,$22,$22,$32,$2C,$00
byte = $00,$00,$22,$22,$22,$14,$08,$00,$00,$00,$22,$22,$2A,$2A,$36,$00
byte = $00,$00,$22,$14,$08,$14,$22,$00,$00,$00,$22,$22,$22,$3C,$20,$1C
byte = $00,$00,$3E,$10,$08,$04,$3E,$00,$38,$0C,$0C,$06,$0C,$0C,$38,$00
byte = $08,$08,$08,$08,$08,$08,$08,$08,$0E,$18,$18,$30,$18,$18,$0E,$00
byte = $00,$2C,$1A,$00,$00,$00,$00,$00,$00,$2A,$14,$2A,$14,$2A,$00,$00
//
// Test sprite
//
const SPRW = 16
@ -180,43 +49,25 @@ word[] dither = @dither25, @dither50, @dither75
//
const SLIDEY = 170
//
// Utility functions
// Enterprise sprites
//
def dcgrAllocBl7Mem(w, h)#2
word memblk, span
span = (w+13)/7 << 2
memblk = heapalloc(span * h)
return memblk, span
struc t_sprite
var spr_xorg
var spr_yorg
var spr_width
var spr_height
var spr_pixmap
end
def dcgrStr(x, y, strptr)#0
byte i
res[t_sprite * 8] ncc1701
char[12] sprFile = "ENT.UP.SPR"
char[12] = "ENT.UR.SPR"
char[12] = "ENT.RT.SPR"
char[12] = "ENT.DR.SPR"
char[12] = "ENT.DN.SPR"
char[12] = "ENT.DL.SPR"
char[12] = "ENT.LT.SPR"
char[12] = "ENT.UL.SPR"
for i = 1 to ^strptr
dcgrBitmap(x, y, 7, 8, @fontBits + (^(strptr + i) + 128) * 8)
x = x + 7
next
end
def dcgrBoldStr(x, y, strptr)#0
byte h, v
for v = y - 1 to y + 1
for h = x - 1 to x + 1
dcgrStr(h, v, strptr)
next
next
dcgrColor(CLR_BLACK)
dcgrStr(x, y, strptr)
end
def dcgrRect(x, y, w, h)#0
byte x2, y2, v
x2 = x + w - 1
y2 = y + h - 1
for v = y to y2
dcgrHLin(x, x2, v)
next
end
def dcgrCompSprite(offset)#0
byte i
@ -247,6 +98,25 @@ def dcgrCompMask(offset)#0
dcgrMemBl7(sprite7w, i * SPRH, sprite7w, SPRH, sprite7msk[i], sprite7span)
next
end
def readEnterprise#0
var xorg, yorg, width, height, pixptr, t_ptr, f_ptr
byte i
t_ptr = @ncc1701
f_ptr = @sprFile
for i = 0 to 7
xorg, yorg, width, height, pixptr = spriteRead(f_ptr)
t_ptr=>spr_xorg = xorg
t_ptr=>spr_yorg = yorg
t_ptr=>spr_width = width
t_ptr=>spr_height = height
t_ptr=>spr_pixmap = pixptr
t_ptr = t_ptr + t_sprite
f_ptr = f_ptr + 12
next
end
////////////////////////////////////////////////////////////////
// //
// Test Harness //
@ -259,10 +129,10 @@ def dcgrTest#0
byte mode
byte[40] tilestr
backblk, backspan = dcgrAllocBl7Mem(SCR_WIDTH, SPRH)
//
// Use back buffer for tile set buffer
//
backblk, backspan = dcgrAllocBl7Mem(SCR_WIDTH, SPRH)
j = 0
while ^$C000 < 128
//
@ -368,7 +238,7 @@ def dcgrTest#0
is 4
dcgrSurfMem(OP_SRC, SPRH, restrblk, restrspan)
dcgrMemBl7(0, 0, restr7w, SPRH, backblk + (k7 << 1), backspan)
dcgrPixMap(km7 + 2, 0, SPRH, SPRH, @sprite)
dcgrPixMap(km7 + 2, 0, SPRW, SPRH, @sprite)
dcgrSurfScr(OP_SRC)
dcgrMemBl7(k7, SLIDEY, restr7w, SPRH, restrblk, restrspan)
break
@ -408,6 +278,28 @@ def dcgrTest#0
j = j + incj
loop
//
// Rotate Enterprise
//
dcgrSurfScr(OP_SRC)
dcgrColor(CLR_BLACK)
dcgrClearBl7(21/7, 30, 100/7, 132)
dcgrColor(CLR_YELLOW)
dcgrStr(30, 40, "'q' to quit")
k = 0
i = @ncc1701
repeat
dcgrColor(CLR_BLACK)
dcgrClearBl7(60/7, 75, 5, 43)
dcgrPixMap(70-i=>spr_xorg, 96-i=>spr_yorg, i=>spr_width, i=>spr_height, i=>spr_pixmap)
i = i + t_sprite
k++
if k > 7
k = 0
i = @ncc1701
fin
for j = 0 to 200; next
until getc == 'q'
//
// Re-use the back buffer for a stipple pattern to mask the screen
//
for k = 0 to 2
@ -476,6 +368,7 @@ def dcgrTest#0
getc
end
dcgrMode(0)
readEnterprise
dcgrCompSprite(2)
dcgrCompMask(2)
dcgrTest