[A86] Re: Inverse selecting.


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

[A86] Re: Inverse selecting.




Maybe he's trying to breathe some life into this list?

Anyway what you want to do is use the cpl command to invert a byte.
It's the same thing (almost) as xor %11111111.  For example to invert
a 40x6 section of the screen, you can do....

  call findpixel        ;use your favorite one...
  ld c,6                ;number of lines (height) to invert
  ld de,11              ;for use later...
outer_loop:
  ld b,5                ;number of bytes (width) to invert
inner_loop:
    ld a,(hl)           ;get a byte from video mem
    cpl                 ;invert it
    ld (hl),a           ;store it back in video mem
    inc l               ;move right one byte
    djnz inner_loop     ;do the entire line
  add hl,de             ;move to next line
  dec c                 ;do all the lines
  jr nz,outer_loop

Now if you do that once, it'll invert your text or whatever.  If you
do it again at the same spot, it'll put the text back to normal.

On Saturday, January 05, 2002, David wrote:

> Why don't you look at the source code and find out?

--
Hail Ants! 
Aaron
acurti1@umbc.edu





Follow-Ups: References: