1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-19 22:38:50 +00:00

Memory plot pix routines

This commit is contained in:
David Schmenk 2024-09-06 16:56:27 -07:00
parent 1c39679540
commit 83c70b14b6
2 changed files with 37 additions and 18 deletions

@ -21,19 +21,24 @@ import dcgrlib
const DCLR_PINK = 11
const DCLR_MEDBLUE = 12
const DCLR_LTBLUE = 13
const DCLR_ACQUA = 14
const DCLR_AQUA = 14
const DCLR_WHITE = 15
predef dcgrDivMod7(x)#2
predef dcgrDiv7(x)#1
predef dcgrColor(c)#0
predef dcgrPlotScr(x, y)#0
predef dcgrHlinScr(x1, x2, y)#0
predef dcgrHLinScr(x1, x2, y)#0
predef dcgrVlinScr(y1, y2, x)#0
predef dcgrPixBLTScr(x, y, w, h, pixptr)#0
predef dcgrPixScr(x, y, w, h, pixptr)#0
predef dcgrPlotMem(x, y, w, h, dstptr, dstspan)#0
predef dcgrHLinMem(x1, x2, y, dstptr, dstspan)#0
predef dcgrVLinMem(y1, y2, x, dstptr, dstspan)#0
predef dcgrPixMem(x, y, w, h, pixptr, dstw, dsth, dstptr, dstspan)#0
predef dcgrScrBLTMem(x7, y, w7, h, dstptr, dstspan)#0
predef dcgrMemBLTScr(x7, y, w7, h, srcptr, srcspan)#0
predef dcgrFillScr(x7, y, w7, h)#0
predef dcgrFillMem(x7, y, w7, h, dstptr, dstspan)#0
predef dcgrVLB#0
predef dcgrOpScr(op)#0
predef dcgrAllocBLKMem(w, h)#3

@ -25,8 +25,9 @@ byte[] = $55,$55,$00,$00,$00,$00,$55,$55
byte[] = $55,$55,$00,$00,$00,$00,$55,$55
def dcgrTest#0
word i, j, oi7, oj, backw7
word backblk, backspan, inci, incj
word i, j, k, i7, m7, ok7, inci, incj, inck
word backblk, backspan, backw7
word restrblk, restrspan, restrw7, restrw
setlineplot(@dcgrPlotScr)
setlinespans(@dcgrHLinScr, @dcgrVLinScr)
@ -39,22 +40,35 @@ def dcgrTest#0
linespans(0, 0, i, 191)
next
dcgrColor(DCLR_BLACK)
//dcgrFillScr(21/7, 30, 100/7, 132)
i = 86; j = 90
oi7 = i/7; oj = j
inci = 1; incj = 1
dcgrFillScr(21/7, 30, 100/7, 132)
dcgrColor(DCLR_WHITE)
dcgrHLinScr((21/7)*7, (21/7)*7+(100/7)*7, 30)
dcgrHLinScr((21/7)*7, (21/7)*7+(100/7)*7, 30+132)
dcgrVLinScr(30, 30+132, (21/7)*7)
dcgrVLinScr(30, 30+132, (21/7)*7+(100/7)*7)
i = 64; j = 64; k = 86
ok7 = k/7
inci = 1; incj = 1; inck = 1
backblk, backspan, backw7 = dcgrAllocBLKMem(SCR_WIDTH, 16)
dcgrScrBLTMem(0, j, backw7, 16, backblk, backspan)
dcgrScrBLTMem(0, 170, backw7, 16, backblk, backspan)
restrblk, restrspan, restrw7 = dcgrAllocBLKMem(16, 16)
restrw = restrw7 * 7
while ^$C000 < 128
dcgrMemBLTScr(oi7, oj, (16+14)/7, 16, backblk + oi7 * 4, backspan)
//dcgrFillScr(oi7, oj, (16+14)/7, 16)
dcgrPixBLTScr(i, j, 16, 16, @sprite)
oi7 = i/7; oj = j
//if i > 125 or i < 2; inci = -inci; fin
if i > 138 or i < -16; inci = -inci; fin
dcgrMemBLTScr(ok7, 170, (16+14)/7, 16, backblk + ok7 * 4, backspan)
dcgrPixScr(k, 170, 16, 16, @sprite)
ok7 = k/7
if k > 138 or k < -16; inck = -inck; fin
k = k + inck
dcgrColor(DCLR_DRKBLUE)
i7, m7 = dcgrDivMod7(i)
dcgrFillMem(0, 0, restrw7, 16, restrblk, restrspan)
dcgrColor(DCLR_WHITE)
dcgrPixMem(m7, 0, 16, 16, @sprite, restrw, 16, restrblk, restrspan)
dcgrMemBLTScr(i7, j, restrw7, 16, restrblk, restrspan)
if i > 102 or i < 23; inci = -inci; fin
i = i + inci
//if j > 178 or j < 2; incj = -incj; fin
//j = j + incj
if j > 145 or j < 32; incj = -incj; fin
j = j + incj
loop
^$C010
getc