From 0af2aefa6fd1ee826ae71d3bc157eabf7bb9a58b Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Fri, 15 Dec 2017 16:18:41 -0800 Subject: [PATCH] Add dgr.plh include --- src/inc/dgr.plh | 16 +++++++ src/samplesrc/dgrtest.pla | 87 ++++++++++++++++----------------------- 2 files changed, 52 insertions(+), 51 deletions(-) create mode 100644 src/inc/dgr.plh diff --git a/src/inc/dgr.plh b/src/inc/dgr.plh new file mode 100644 index 0000000..0449a16 --- /dev/null +++ b/src/inc/dgr.plh @@ -0,0 +1,16 @@ +import dgr + word[] dgrbuff + predef dgrPlot(buff, x, y)#0 + predef dgrHLin(buff, x1, x2, y)#0 + predef dgrVLin(buff, x, y1, y2)#0 + predef dgrBLT(buff, x, y, width, height, src)#0 + predef dgrTile(buff, x, y, src)#0 + predef dgrTileStr(buff, x, y, tilestr, strlen, tilebuff)#0 + predef dgrFill(buff, x, y, tile)#0 + predef dgrMode#1 + predef txtMode#0 + predef dgrShow(page)#1 + predef dgrColor(clr)#0 + predef dgrLine(buff, x1, y1, x2, y2)#0 + predef dgrClear(buff, clr)#0 +end diff --git a/src/samplesrc/dgrtest.pla b/src/samplesrc/dgrtest.pla index e3f3eee..d3412c6 100644 --- a/src/samplesrc/dgrtest.pla +++ b/src/samplesrc/dgrtest.pla @@ -1,19 +1,4 @@ -import dgr - word[] dgrbuff - predef dgrPlot(buff, x, y)#0 - predef dgrHLin(buff, x1, x2, y)#0 - predef dgrVLin(buff, x, y1, y2)#0 - predef dgrBLT(buff, x, y, width, height, src)#0 - predef dgrTile(buff, x, y, src)#0 - predef dgrTileStr(buff, x, y, tilestr, strlen, tilebuff)#0 - predef dgrFill(buff, x, y, tile)#0 - predef dgrMode#1 - predef txtMode#0 - predef dgrShow(page)#1 - predef dgrColor(clr)#0 - predef dgrLine(buff, x1, y1, x2, y2)#0 - predef dgrClear(buff, clr)#0 -end +include "inc/dgr.plh" byte[] sprite1 = $80,$80,$00,$00,$00,$00,$80,$80 byte[] = $80,$00,$0A,$0A,$0A,$0A,$00,$80 @@ -33,42 +18,42 @@ byte[] = $0A,$05,$0A,$05,$0A,$05,$0A,$00 // Test routine // def dgrTest#0 - byte b, l, k - word i, j, ii, ij + byte b, l, k + word i, j, ii, ij - b = dgrMode() - for k = 15 downto 0 - dgrClear(dgrbuff[0], k) - next - for l = 0 to 79 - dgrColor(l) - dgrLine(dgrbuff[0], 0, 0, l, 47) - next - for l = 47 downto 0 - dgrColor(l) - dgrLine(dgrbuff[0], 0, 0, 79, l) - next - ii = 2 - ij = -1 - i = 40 - j = 10 - ^$C010 - while ^$C000 < 128 - dgrFill(dgrbuff[b], k, k, @tile1) - dgrBLT(dgrbuff[b], i, j, 8, 8, @sprite1) - b = dgrShow(b) - 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 + b = dgrMode() + for k = 15 downto 0 + dgrClear(dgrbuff[0], k) + next + for l = 0 to 79 + dgrColor(l) + dgrLine(dgrbuff[0], 0, 0, l, 47) + next + for l = 47 downto 0 + dgrColor(l) + dgrLine(dgrbuff[0], 0, 0, 79, l) + next + ii = 2 + ij = -1 + i = 40 + j = 10 + ^$C010 + while ^$C000 < 128 + dgrFill(dgrbuff[b], k, k, @tile1) + dgrBLT(dgrbuff[b], i, j, 8, 8, @sprite1) + b = dgrShow(b) + 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