#
# ZX Spectrum SCR (Loading screen) importer
# A Multipaint internal script
#

LOAD

# Error checking

A = LENGTH

IF A<>6912
	ALERT 1
	STOP
ENDIF

# Display file

# bitmap

FOR Y=0 TO 2
	FOR V=0 TO 7
		FOR E=0 TO 7
			P=1024+V*256+E*2048+Y*16384
			FOR X=0 TO 31
				C=128
				READ L
				FOR B=0 TO 7
					A=L&C				
					IF A=0
						POKE P,0
					ENDIF
					IF A<>0
						POKE P,1
					ENDIF
					P=P+1
					C=C/2
				NEXT B
			NEXT X
		NEXT E
	NEXT V
NEXT Y

# Attributes

FOR Y=0 TO 23
	FOR X=0 TO 31
		READ A
		R=A&$40
		R=R/64
		P=A&$38
		I=A&$07
		P=P/8
		I=I+R*8
		P=P+R*8
		D=65536+X+Y*256
		J=65536+X+Y*256+6144
		FOR V=0 TO 7
			POKE D,I
			POKE J,P
			LET D=D+32
			LET J=J+32
		NEXT V
	NEXT X
NEXT Y

REFRESH

