ZX Spectrum allowed enabling XOR pixel operation for drawing routines and text. Some interesting interference patterns could be achieved this way.



As drawing XOR was important to me, I wrote a routine to cover this in PAINT. (WIP)
-- simple xor line ------------ -- from the lab⧗of dw817 ----- -- draw xline point to point -- function pline(a,b,c,d) local px,py=c-a,d-b local ax,ay=abs(px),abs(py) if ax>ay then py/=ax px=sgn(px) else px/=ay py=sgn(py) end repeat pset(a,b,15-pget(a,b)) a+=px b+=py until abs(a-c)<1 and abs(b-d)<1 end--pline(.....) --- main code --------------->> cls() circfill(64,64,48,3) for i=.5,127,1.5 do pline(i,0,127-i,127) pline(0,i,127,127-i) flip() end |



Hi dw817. You're right: BXOR(I,15) and 15-I give same results on integers from 0 to 15. My code applies XOR between color being written and color already on screen. This works well on monochrome screen (1bpp) but gives weird results with 4bpp. I'm also working on a paint program, a colouring book for kids. Good luck with yours! ;)



Coloring book for kids ? In Pico ? I would definitely like to see that, or rather my 9yo niece would. :D
And yes, good luck to you too !
[Please log in to post a comment]