
;DRAWTEXT xdest,ydest,xsource,ysource,vartoprint

func_drawtext_0:

LD A,(HL)
AND A
RET Z
CALL func_drawtext_1
INC HL
JR func_drawtext_0
RET

func_drawtext_1:

PUSH HL

ld c,a

ld de,($ca14)
and 31
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
add hl,de
ld (64695),hl
push hl

ld de,($ca16)
ld a,c
rra
rra
rra
rra
rra
and 7
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
add hl,de

ld (64697),hl
push hl

ld de,7
ld hl,(64695)
add hl,de
ld (64695),hl
push hl
ld hl,(64697)
add hl,de
ld (64697),hl
push hl

ld a,1
ld ($FC18),A

ld hl,($ca10)
ld (64695),hl
push hl

ld hl,($ca12)
ld (64697),hl
push hl

xor a
ld ($FC19),A

pop hl
pop de
pop iy
pop ix
pop hl
pop de

ld b,0
call func_copyvram

ld hl,($ca10)
ld de,8
add hl,de
ld ($ca10),hl

POP HL

RET