	DEVICE	ZXSPECTRUM128
	
	ORG	#8000

	LD	HL,TBL_NOISE
INI_NOISE_1
	CALL	GET_RANDOM
	LD	C,0
	CP	48
	JP	NC,INI_NOISE_2
	LD	C,#01
INI_NOISE_2
	CALL	GET_RANDOM
	CP	200
	LD	A,#00
	JP	C,INI_NOISE_3
	LD	A,#10
INI_NOISE_3
	OR	C
	LD	(HL),A
	;---
	INC	L
	JP	NZ,INI_NOISE_1
	;---
	RET
	
GET_RANDOM
	LD  A,137
SEED	EQU	$-1
	LD	B,A
	ADD	A,A
	XOR	B
	LD	B,A
	SRL	A
	XOR	B
	LD	B,A
	ADD	A,A
	ADD	A,A
	XOR	B
	LD	(SEED),A
	RET
	
	ALIGN	256
TBL_NOISE

	SAVEBIN	"3d_black_circles_noise_tbl.bin", TBL_NOISE, 256