#
# Commodore 64 OCP (Advanced Art Studio) multicolor exporter
# A Multipaint internal script
#

XREM "Advanced Art Studio header"

XBYTE 0,32

XREM "Bitmap"

FOR Y=0 TO 24
	FOR X=0 TO 39
		FOR V=0 TO 7
			C=128
			L=0
			FOR B=0 TO 7
				P=V*320
				P=P+B
				M=X*8
				P=P+M
				M=Y*2560
				P=P+M
				P=P+1024
				O=PEEK P
				M=C*O
				L=L+M
				C=C/2
			NEXT B
			XBYTE L
		NEXT V
	NEXT X
NEXT Y

XREM "Color RAM 1 and 2"

FOR Y=0 TO 24
	FOR X=0 TO 39
		P = Y*40
		P = P+X
		P = P+65536
		L = PEEK P
		P = P+1000
		H = PEEK P
		M = H*16
		A = M+L
		XBYTE A
	NEXT X
NEXT Y

XREM "Border"

B = PEEK 0

XBYTE B

XREM "Background"

B = PEEK 1

XBYTE B

FOR I=0 TO 13
	XBYTE 0
NEXT I

XREM "Color RAM 3"

FOR Y=0 TO 24
	FOR X=0 TO 39
		P = Y*40
		P = P+X
		P = P+65536
		P = P+2000
		A = PEEK P
		XBYTE A
	NEXT X
NEXT Y

# Write to file (10018 bytes)

SAVE
