mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-23 14:30:48 +00:00
DHGR test lib
This commit is contained in:
parent
0ab16d4877
commit
2eea9e585c
@ -1,6 +1,7 @@
|
|||||||
include "inc/cmdsys.plh"
|
include "inc/cmdsys.plh"
|
||||||
|
include "inc/lines.plh"
|
||||||
|
|
||||||
sysflags restxt1|reshgr1|resxhgr1
|
sysflags resxtxt1|reshgr1|resxhgr1
|
||||||
|
|
||||||
//
|
//
|
||||||
// Apple II graphics soft switches
|
// Apple II graphics soft switches
|
||||||
@ -49,34 +50,57 @@ word = $2350,$2750,$2B50,$2F50,$3350,$3750,$3B50,$3F50
|
|||||||
word = $23D0,$27D0,$2BD0,$2FD0,$33D0,$37D0,$3BD0,$3FD0
|
word = $23D0,$27D0,$2BD0,$2FD0,$33D0,$37D0,$3BD0,$3FD0
|
||||||
//
|
//
|
||||||
// Pixel masks for 7 contiguous pixels
|
// Pixel masks for 7 contiguous pixels
|
||||||
// AUXL AUXH MEML MEMH
|
//
|
||||||
byte masks[] = $0F, $00, $00, $00
|
word auxmask[] = $000F
|
||||||
byte = $70, $00, $01, $00
|
word = $0070
|
||||||
byte = $00, $00, $1E ,$00
|
word = $0000
|
||||||
byte = $00, $03, $60, $00
|
word = $0300
|
||||||
byte = $00, $3C, $00, $00
|
word = $3C00
|
||||||
byte = $00, $40, $00, $07
|
word = $4000
|
||||||
byte = $00, $00, $00, $78
|
word = $0000
|
||||||
|
word memmask[] = $0000
|
||||||
|
word = $0001
|
||||||
|
word = $001E
|
||||||
|
word = $0060
|
||||||
|
word = $0000
|
||||||
|
word = $0700
|
||||||
|
word = $7800
|
||||||
//
|
//
|
||||||
// Solid colors
|
// Solid colors
|
||||||
// AUXL AUXH MEML MEMH
|
//
|
||||||
byte colors[] = $00, $00, $00, $00 // black
|
word auxclrs[] = $0000 // black
|
||||||
byte = $08, $22, $11, $44 // magenta
|
word = $2208 // magenta
|
||||||
byte = $44, $11, $08, $22 // brown
|
word = $1144 // brown
|
||||||
byte = $4C, $33, $19, $66 // orange
|
word = $334C // orange
|
||||||
byte = $22, $08, $44, $11 // dark green
|
word = $0822 // dark green
|
||||||
byte = $2A, $2A, $55, $55 // gray 1
|
word = $2A2A // gray 1
|
||||||
byte = $66, $19, $4C, $33 // green
|
word = $1966 // green
|
||||||
byte = $6E, $3B, $5D, $77 // yellow
|
word = $3B6E // yellow
|
||||||
byte = $11, $44, $22, $08 // dark blue
|
word = $4411 // dark blue
|
||||||
byte = $19, $66, $33, $4C // purple
|
word = $6619 // purple
|
||||||
byte = $55, $55, $2A, $2A // gray 2
|
word = $5555 // gray 2
|
||||||
byte = $5D, $77, $3B, $6E // pink
|
word = $775D // pink
|
||||||
byte = $33, $4C, $66, $19 // medium blue
|
word = $4C33 // medium blue
|
||||||
byte = $3B, $6E, $77, $5D // light blue
|
word = $6E3B // light blue
|
||||||
byte = $77, $5D, $6E, $3B // aqua
|
word = $5D77 // aqua
|
||||||
byte = $7F, $7F, $7F, $7F // white
|
word = $7F7F // white
|
||||||
word clr = @colors
|
word memclrs[] = $0000 // black
|
||||||
|
word = $4411 // magenta
|
||||||
|
word = $2208 // brown
|
||||||
|
word = $6619 // orange
|
||||||
|
word = $1144 // dark green
|
||||||
|
word = $5555 // gray 1
|
||||||
|
word = $334C // green
|
||||||
|
word = $775D // yellow
|
||||||
|
word = $0822 // dark blue
|
||||||
|
word = $4C33 // purple
|
||||||
|
word = $2A2A // gray 2
|
||||||
|
word = $6E3B // pink
|
||||||
|
word = $1966 // medium blue
|
||||||
|
word = $5D77 // light blue
|
||||||
|
word = $3B6E // aqua
|
||||||
|
word = $7F7F // white
|
||||||
|
word auxclr, memclr
|
||||||
//
|
//
|
||||||
// Modulo 7
|
// Modulo 7
|
||||||
//
|
//
|
||||||
@ -103,47 +127,98 @@ byte = 0, 1, 2, 3, 4, 5, 6
|
|||||||
//
|
//
|
||||||
// Divide 7
|
// Divide 7
|
||||||
//
|
//
|
||||||
byte div7[] = 0, 0, 0, 0, 0, 0, 0
|
byte div7x2[] = 0, 0, 0, 0, 0, 0, 0
|
||||||
byte = 1, 1, 1, 1, 1, 1, 1
|
byte = 2, 2, 2, 2, 2, 2, 2
|
||||||
byte = 2, 2, 2, 2, 2, 2, 2
|
byte = 4, 4, 4, 4, 4, 4, 4
|
||||||
byte = 3, 3, 3, 3, 3, 3, 3
|
byte = 6, 6, 6, 6, 6, 6, 6
|
||||||
byte = 4, 4, 4, 4, 4, 4, 4
|
byte = 8, 8, 8, 8, 8, 8, 8
|
||||||
byte = 5, 5, 5, 5, 5, 5, 5
|
byte =10,10,10,10,10,10,10
|
||||||
byte = 6, 6, 6, 6, 6, 6, 6
|
byte =12,12,12,12,12,12,12
|
||||||
byte = 7, 7, 7, 7, 7, 7, 7
|
byte =14,14,14,14,14,14,14
|
||||||
byte = 8, 8, 8, 8, 8, 8, 8
|
byte =16,16,16,16,16,16,16
|
||||||
byte = 9, 9, 9, 9, 9, 9, 9
|
byte =18,18,18,18,18,18,18
|
||||||
byte =10,10,10,10,10,10,10
|
byte =20,20,20,20,20,20,20
|
||||||
byte =11,11,11,11,11,11,11
|
byte =22,22,22,22,22,22,22
|
||||||
byte =12,12,12,12,12,12,12
|
byte =24,24,24,24,24,24,24
|
||||||
byte =13,13,13,13,13,13,13
|
byte =26,26,26,26,26,26,26
|
||||||
byte =14,14,14,14,14,14,14
|
byte =28,28,28,28,28,28,28
|
||||||
byte =15,15,15,15,15,15,15
|
byte =30,30,30,30,30,30,30
|
||||||
byte =16,16,16,16,16,16,16
|
byte =32,32,32,32,32,32,32
|
||||||
byte =17,17,17,17,17,17,17
|
byte =34,34,34,34,34,34,34
|
||||||
byte =18,18,18,18,18,18,18
|
byte =36,36,36,36,36,36,36
|
||||||
byte =19,19,19,19,19,19,19
|
byte =38,38,38,38,38,38,38
|
||||||
|
|
||||||
def dhgrcolor(c)#0
|
def dhgrColor(c)#0
|
||||||
clr = @colors + ((c & $0F) << 2)
|
auxclr = auxclrs[c & $0F]
|
||||||
|
memclr = memclrs[c & $0F]
|
||||||
end
|
end
|
||||||
def dhgrplot(x, y)#0
|
def dhgrPlot(x, y)#0
|
||||||
word pixaddr, maskblk, mask
|
byte pix7
|
||||||
|
word pix7addr, mask
|
||||||
|
|
||||||
pixaddr = hgrscan[y] + div7[x] * 2
|
pix7addr = hgrscan[y] + div7x2[x]
|
||||||
maskblk = @masks + mod7[x] * 4
|
pix7 = mod7[x]
|
||||||
mask = *maskblk
|
mask = auxmask[pix7]
|
||||||
if mask
|
if mask
|
||||||
^page1x
|
^page1x
|
||||||
*pixaddr = (*pixaddr & ~mask) | (mask & *clr)
|
*pix7addr = (*pix7addr & ~mask) | (mask & auxclr)
|
||||||
fin
|
fin
|
||||||
mask = *(maskblk + 2)
|
mask = memmask[pix7]
|
||||||
if mask
|
if mask
|
||||||
^page1m
|
^page1m
|
||||||
*pixaddr = (*pixaddr & ~mask) | (mask & *(clr + 2))
|
*pix7addr = (*pix7addr & ~mask) | (mask & memclr)
|
||||||
fin
|
fin
|
||||||
end
|
end
|
||||||
def dhgrmode(mode)
|
def dhgrTile(x7, y8, tileptr)#0
|
||||||
|
word tileaddr
|
||||||
|
byte scan
|
||||||
|
|
||||||
|
tileaddr = hgrscan[y8 * 8] + x7 * 2
|
||||||
|
for scan = 0 to 7
|
||||||
|
^page1x
|
||||||
|
*tileaddr = *tileptr
|
||||||
|
tileptr = tileptr + 2
|
||||||
|
^page1m
|
||||||
|
*tileaddr = *tileptr
|
||||||
|
tileptr = tileptr + 2
|
||||||
|
tileaddr = tileaddr + $0400
|
||||||
|
next
|
||||||
|
end
|
||||||
|
def dhgrDst(x7, y, w7, h, dstptr)#0
|
||||||
|
word pix7addr
|
||||||
|
byte scan, b
|
||||||
|
|
||||||
|
for scan = y to y+h-1
|
||||||
|
pix7addr = hgrscan[scan] + x7 * 2
|
||||||
|
for b = 1 to w7
|
||||||
|
^page1x
|
||||||
|
*dstptr = *pix7addr
|
||||||
|
dstptr = dstptr + 2
|
||||||
|
^page1m
|
||||||
|
*dstptr = *pix7addr
|
||||||
|
dstptr = dstptr + 2
|
||||||
|
pix7addr = pix7addr + 2
|
||||||
|
next
|
||||||
|
next
|
||||||
|
end
|
||||||
|
def dhgrSrc(x7, y, w7, h, srcptr)#0
|
||||||
|
word pix7addr
|
||||||
|
byte scan, b
|
||||||
|
|
||||||
|
for scan = y to y+h-1
|
||||||
|
pix7addr = hgrscan[scan] + x7 * 2
|
||||||
|
for b = 1 to w7
|
||||||
|
^page1x
|
||||||
|
*pix7addr = *srcptr
|
||||||
|
srcptr = srcptr + 2
|
||||||
|
^page1m
|
||||||
|
*pix7addr = *srcptr
|
||||||
|
srcptr = srcptr + 2
|
||||||
|
pix7addr = pix7addr + 2
|
||||||
|
next
|
||||||
|
next
|
||||||
|
end
|
||||||
|
def dhgrMode(mode)
|
||||||
if mode == 0
|
if mode == 0
|
||||||
^page1m
|
^page1m
|
||||||
^showfull
|
^showfull
|
||||||
@ -167,12 +242,29 @@ def dhgrmode(mode)
|
|||||||
return mode
|
return mode
|
||||||
end
|
end
|
||||||
|
|
||||||
def dhgrtest#0
|
def dhgrTest#0
|
||||||
byte i
|
byte i, j
|
||||||
|
word pixblk
|
||||||
|
|
||||||
dhgrcolor(15)
|
setlineplot(@dhgrPlot)
|
||||||
for i = 0 to 139
|
for i = 0 to 191 step 4
|
||||||
dhgrplot(i, i)
|
dhgrColor(i)
|
||||||
|
line(0, 0, 139, i)
|
||||||
|
next
|
||||||
|
for i = 139 downto 0 step 4
|
||||||
|
dhgrColor(i)
|
||||||
|
line(0, 0, i, 191)
|
||||||
|
next
|
||||||
|
pixblk = heapalloc(16/2*20)
|
||||||
|
dhgrDst(0, 0, 2, 20, pixblk)
|
||||||
|
for i = 1 to 170
|
||||||
|
dhgrSrc(0, i, 2, 20, pixblk)
|
||||||
|
next
|
||||||
|
dhgrDst(0, 0, 1, 8, pixblk) // Create tile
|
||||||
|
for j = 0 to 19
|
||||||
|
for i = 0 to 19
|
||||||
|
dhgrTile(i, j, pixblk)
|
||||||
|
next
|
||||||
next
|
next
|
||||||
while ^$C000 < 128
|
while ^$C000 < 128
|
||||||
loop
|
loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user