1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-09 16:40:38 +00:00

Mem <-> Mem BLT

This commit is contained in:
David Schmenk 2024-09-07 14:30:57 -07:00
parent 83c70b14b6
commit 5242148ef6
2 changed files with 16 additions and 21 deletions

View File

@ -24,8 +24,6 @@ import dcgrlib
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
@ -35,12 +33,13 @@ import dcgrlib
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 dcgrScrBl7Mem(x7, y, w7, h, dstptr, dstspan)#0
predef dcgrMemBl7Scr(x7, y, w7, h, srcptr, srcspan)#0
predef dcgrMemBl7Mem(x7, y, w7, h, srcptr, srcspan, dstw7, dsth, dstptr, dstspan)#0
predef dcgrFillBl7Scr(x7, y, w7, h)#0
predef dcgrFillBl7Mem(x7, y, w7, h, dstptr, dstspan)#0
predef dcgrVLB#0
predef dcgrOpScr(op)#0
predef dcgrAllocBLKMem(w, h)#3
predef dcgrAllocBl7Mem(w, h)#3
predef dcgrMode(mode)
end

View File

@ -25,7 +25,7 @@ byte[] = $55,$55,$00,$00,$00,$00,$55,$55
byte[] = $55,$55,$00,$00,$00,$00,$55,$55
def dcgrTest#0
word i, j, k, i7, m7, ok7, inci, incj, inck
word i, j, k, ok7, om7, inci, incj, inck
word backblk, backspan, backw7
word restrblk, restrspan, restrw7, restrw
@ -40,7 +40,7 @@ def dcgrTest#0
linespans(0, 0, i, 191)
next
dcgrColor(DCLR_BLACK)
dcgrFillScr(21/7, 30, 100/7, 132)
dcgrFillBl7Scr(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)
@ -49,22 +49,18 @@ def dcgrTest#0
i = 64; j = 64; k = 86
ok7 = k/7
inci = 1; incj = 1; inck = 1
backblk, backspan, backw7 = dcgrAllocBLKMem(SCR_WIDTH, 16)
dcgrScrBLTMem(0, 170, backw7, 16, backblk, backspan)
restrblk, restrspan, restrw7 = dcgrAllocBLKMem(16, 16)
backblk, backspan, backw7 = dcgrAllocBl7Mem(SCR_WIDTH, 16)
dcgrScrBl7Mem(0, 170, backw7, 16, backblk, backspan)
restrblk, restrspan, restrw7 = dcgrAllocBl7Mem(16, 16)
restrw = restrw7 * 7
while ^$C000 < 128
dcgrMemBLTScr(ok7, 170, (16+14)/7, 16, backblk + ok7 * 4, backspan)
dcgrPixScr(k, 170, 16, 16, @sprite)
ok7 = k/7
ok7, om7 = divmod(k, 7)
dcgrMemBl7Mem(0, 0, restrw7, 16, backblk + ok7 * 4, backspan, restrw7, 16, restrblk, restrspan)
dcgrPixMem(om7 + 1, 0, 16, 16, @sprite, restrw, 16, restrblk, restrspan)
dcgrMemBl7Scr(ok7, 170, restrw7, 16, restrblk, restrspan)
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)
dcgrPixScr(i, j, 16, 16, @sprite)
if i > 102 or i < 23; inci = -inci; fin
i = i + inci
if j > 145 or j < 32; incj = -incj; fin