Re: A82: Help with plotting a pixel


[Prev][Next][Index][Thread]

Re: A82: Help with plotting a pixel




In a message dated 97-12-20 16:09:02 EST, you write:

<< Can somebody make a routine that will plot a pixel at (b,c).
 
 For example:
 
 You have the x cord in b and the y cord in c.  The routine should turn on
 the pixel located at this point.  It shouldn't change the whole byte rather
 just the one bit from 0 to 1.
 
 PS. it would be helpful if (0,0) was the top left.
 
 Thanks,
 andrew@dgi.net >>

PutPixel:
  ld a, 63
  sub c
  ld c, a
  call FIND_PIXEL
  ld de, $88B8
  add hl, de
  or (hl)
  ld (hl), a
  ret

or for taking away a pixel, use
  cpl
  and (hl)
  ld (hl), a

instead of 
  or (hl)
  ld (hl), a

for changing the pixel:
  xor (hl)
  ld (hl), a

Not sure about the last one.  check at the Ash school or
http://www.algonet.se/~mja/zshell.htm (the 5th lesson)
those should also have testing a pixel, which I can't remember off the top of
my head.
Hope this helps,

~Adamman