1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-01-22 18:15:59 +00:00
Files
PLASMA/src/samplesrc/dgrtest.pla
David Schmenk 72f7dea67f Clean up DGRlib
2019-12-19 10:22:26 -08:00

67 lines
1.5 KiB
Plaintext

include "inc/cmdsys.plh"
include "inc/dgrlib.plh"
include "inc/linespans.plh"
sysflags restxt1|restxt2|resxtxt1|resxtxt2 // Reserve all text pages
byte[] sprite1 = $80,$80,$00,$00,$00,$00,$80,$80
byte[] = $80,$00,$0A,$0A,$0A,$0A,$00,$80
byte[] = $00,$0A,$0F,$0F,$0F,$0F,$0A,$00
byte[] = $00,$0A,$0F,$80,$80,$0F,$0A,$00
byte[] = $00,$0A,$0F,$80,$80,$0F,$0A,$00
byte[] = $00,$0A,$0F,$0F,$0F,$0F,$0A,$00
byte[] = $80,$00,$0A,$0A,$0A,$0A,$00,$80
byte[] = $80,$80,$00,$00,$00,$00,$80,$80
byte[] tile1 = $88,$11,$88,$11,$88,$11,$AA,$00
byte[] = $88,$11,$88,$11,$88,$11,$AA,$00
byte[] = $88,$11,$88,$11,$88,$11,$AA,$00
byte[] = $0A,$05,$0A,$05,$0A,$05,$0A,$00
//
// Test routine
//
def dgrTest#0
byte b, l, k
word i, j, ii, ij
b = dgrMode()
dgrDrawBuf(0)
for k = 15 downto 0
dgrClear(k)
next
setlinespans(@dgrHLin, @dgrVLin)
for l = 0 to 79
dgrColor(l)
linetospans(0, 0, l, 47)
next
for l = 47 downto 0
dgrColor(l)
linetospans(0, 0, 79, l)
next
ii = 2
ij = -1
i = 40
j = 10
^$C010
dgrDrawBuf(1)
while ^$C000 < 128
dgrFill(k, k, @tile1)
dgrBLT(i, j, 8, 8, @sprite1)
dgrSwap
k++
i = i + ii
if i < -3 or i > 75
ii = -ii
fin
j = j + ij
if j < -3 or j > 43
ij = -ij
fin
loop
^$C010
txtMode
end
dgrTest
done