D2T_IM_CALL
	LD	A,0
D2T_A	EQU	$-1
	XOR	#FF
	LD	(D2T_A),A
	LD	HL,BUFFD2TA
	JP	NZ,D2T3
	LD	HL,BUFFD2TB
D2T3	LD	DE,#5800
	LD	BC,768
	LDIR

	JP







D2T_BITS_OUT
	LD	HL,D2T_BITS
	LD	DE,#5800
	LD	HX,6
D2T2	;-
	LD	LX,4
	PUSH	HL
D2T1	;-
	POP	HL
	PUSH	HL
	CALL	LDI256	;16*256=4096 ~= 16384 на 4 линии * 6 = 98304 ~= 1.3f
	;-
	DEC	LX
	JP	NZ,D2T1
	;-
	POP	BC
	DEC	HX
	JP	NZ,D2T2
	RET
LDI256	;-----
	DUP	256
	LDI		
	EDUP
	RET
D2T_BITS	INCLUDE "duo-to-twister-bits.bin"
