#
# Sinclair QL (lowres 256x256 bitmap) exporter
# A Multipaint internal script
#

XREM "QL Display file"

XREM "Bitmap"

FOR Y=0 TO 255
	FOR X=0 TO 63
		P=GETPOINT X*4+3,Y
		R=P&2
		R=R/2
		G=P&4
		G=G/4
		B=P&1
		H=G*2
		L=R*2
		L=L+B
		P=GETPOINT X*4+2,Y
		R=P&2
		R=R/2
		G=P&4
		G=G/4
		B=P&1
		H=H+G*8
		L=L+R*8
		L=L+B*4
		P=GETPOINT X*4+1,Y
		R=P&2
		R=R/2
		G=P&4
		G=G/4
		B=P&1
		H=H+G*32
		L=L+R*32
		L=L+B*16
		P=GETPOINT X*4,Y
		R=P&2
		R=R/2
		G=P&4
		G=G/4
		B=P&1
		H=H+G*128
		L=L+R*128
		L=L+B*64
		XBYTE H
		XBYTE L						
	NEXT X
NEXT Y

# Write to file

SAVE
