Re: A83: Re: Check this Pixel Routine. =)


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

Re: A83: Re: Check this Pixel Routine. =)




Just insert the cpl and leave the and (hl) as well. I'll show you why:
let's say that the byte on the screen ( (hl) after running getPixel) is
%00101111 and you want to change bit 3 (the output from getPixel is
%00001000). This is what will happen:
  call getPixel ; (hl)=%00101111 | a=%00001000
  cpl           ; (hl)=%00101111 | a=%11110111
  and (hl)      ; (hl)=%00101111 | a=%00100111
  ld a,(hl)     ; (hl)=%00100111
So what basically happened was we turned off bit 3 of (hl).

Joe Wingbermuehle
http://www.usmo.com/~joewing/

----- Original Message -----
From: <Jkhum98@aol.com>
To: <assembly-83@lists.ticalc.org>
Sent: Saturday, December 19, 1998 7:57 PM
Subject: Re: A83: Re: Check this Pixel Routine. =)


>
>Hey Joe (or anybody else who may have some time to) could you elaborate on
>that change a little more...?  All I should do is _Insert_ the "CPL"
command,
>but also leave the "AND (hl)" ?  The function I want to take place is that
the
>specific Bit will become Cleared no matter what the original byte
contained,
>but not Every bit in that byte. Will that "AND (hl)" operation do this for
me
>along with the CPL?  Thanks for the correction though. =)
> --Jason K.
>
>In a message dated 12/19/98 8:04:15 PM, joewing@usmo.com writes:
>
>>Just a minor change, everything else looks like it should work though.
>>Sorry about not responding sooner, I just don't much time lately.
>>
>>Joe Wingbermuehle
>>http://www.usmo.com/~joewing/
>
>>> . . .
>>>PIXEL_WHITE:
>>> ld a, d ; 'a' now has X Coordinate
>>> call GETPIX ; Call the Pixel Routine from ZLIB
>>
>>  cpl  ; compliment output so that we have a pixel mask
>>
>>> AND (hl) ; 'AND' to clear pixel
>>> ld (hl), a ; Write the new byte to Graph Buffer
>>> ld a, 0 ; Reload this for use with the CPs above
>>> ret
>>> . . .
>