12-21-2011, 08:18 PM
btw, 'samcoupeattr(ikv as ubyte,pav as ubyte)' were really missing - the updated version is below:
(it's much more simpler than from ULAplus, since it only works on 'bright', because only using those 16 colours)
library/samcoupepalette.bas
(it's much more simpler than from ULAplus, since it only works on 'bright', because only using those 16 colours)
library/samcoupepalette.bas
Code:
'- SamCoupé palette library for Boriel's zxbasic-compiler
'- 20111221201251 - (ↄ) Paulo Silva - http://nitrofurano.altervista.org
'- This file is released under the GPL v3 License
dim tmpv as uinteger
sub samcoupepalette(clv as ubyte, vlv as ubyte):
out (clv*256)bor 248,vlv:pause 1
end sub
function samcoupehexcolour(hxcv as uinteger):
tmpv=(hxcv band 4)/4
tmpv=tmpv bor ((hxcv band 64)/16)
tmpv=tmpv bor ((hxcv band 8)*2)
tmpv=tmpv bor ((hxcv band 128)/2)
tmpv=tmpv bor ((hxcv band 32)/4)
hxcv=int(hxcv/256)
tmpv=tmpv bor ((hxcv band 64)/16)
tmpv=tmpv bor ((hxcv band 8)*2)
return tmpv
end function
sub samcoupeattr(ikv as ubyte,pav as ubyte):
'- usage: ink priority (from 0 to 15), and only using 3 bits lsb from paper
ink(ikv band 7):paper(pav band 7)
bright((ikv band 16)/16)
end sub