A better way to turn pixels on and off is to use
iGetPixel, like this:
Code: ;Turn pixel on
ld a,[x coord]
ld e,[y coord]
call iGetPixel
or (hl)
ld (hl),a
;Turn pixel off
ld a,[x coord]
ld e,[y coord]
call iGetPixel
cpl
and (hl)
ld (hl),a
;Invert pixel
ld a,[x coord]
ld e,[y coord]
call iGetPixel
xor (hl)
ld (hl),a
There's also a DCS routine for lines, Fastline:
Code: ld a,1 ;for a black line; other colors are possible (see url)
ld h,[x1]
ld l,[y1]
ld d,[x2]
ld e,[y2]
call FastLine
(or)
ld a,1
ld hl,(256*[x1])+[y1]
ld de,(256*[x2])+[y2]
call FastLine
Be aware that you'll need iFastCopy too.