Re: A86: Major Problem with FindPixel
[Prev][Next][Index][Thread]
Re: A86: Major Problem with FindPixel
yeah do this:
ld d,1
ld e,3
call FindPixel
ld (hl),a
ld d,1
ld e,4
call FindPixel
ld b,a
ld a,(hl)
or b
ld (hl),a
that will work.. FindPixel was NOT designed to do what you described. It's not a 'major problem' It was developed to ruturn hl with the base memory and A as
a mask showing where the 'true' posistion is..
Ricci E. Adams wrote:
> Has anybody notice while using FindPixel that if you put 2 pixels with the
> same Y value next to each other the second one will erase the first one? I
> am using the following routine:
>
> ld d,(ter_y)
> ld e,(ter_x)
> call FindPixel
> ld (hl),a
>
> This is probobly caused by the first pixel having an A value of %01000000
> (or close to it) and the second having an A value of %00000100 (or close to
> it). The second A value completly erases the first pixel. The solution
> would be to have the FindPixel routine retern %01000100 instead of
> %00000100 the second time. Does anybody have a clue how to do this?
>
> I need this for the terrain routine for my game. Right now, the calculator
> choses +1, 0, or -1 and adds it to the current Y value, the X value is
> continually increased cause random smooth terrain to form. The problem is
> whenever the calc choses 0, it erases all the neighboring pixels on the
> same level due to the problem stated above.
>
>
> -Thanks
> Ricci Adams
> ricci@chipsnet.com
--
Trent Lillehaugen
Computer Engineering Major
California Polytechnic University, San Luis Obispo
<http://www.calpoly.edu/~tllilleh/a86/a86.html>
<mailto:tllilleh@polymail.calpoly.edu>
Follow-Ups:
References: