func_copyramtovram:

push de
push bc
call func_prep_write_vram
pop bc
pop de

ld a,b
or c
ret z

ld h,d
ld l,e
ld d,b
ld e,c

ld a,d
or a

ld a,(7)
ld c,a

jr z,func_copyramtovram_loop3

xor a
ld b,a

func_copyramtovram_loop2:
outi
jr nz,func_copyramtovram_loop2

dec d
ld a,d
or a
jr z,func_copyramtovram_loop3

jr func_copyramtovram_loop2

func_copyramtovram_loop3:
ld a,e
or a
ret z
ld b,e
otir
ret



