Re: LF: Plotting a pixel with Fargo


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

Re: LF: Plotting a pixel with Fargo



Tim Gerla wrote:
> 
> Hello, I'm trying to create a 68k program that draws the Mandelbrot
> set. I need to figure out that 'pixel_on' FLib command! What register
> does pixel_on use? Thanks!


OK, this is one thing many ppl will get problems with, since it's not
explained in the txt files (and there doesn't seem to be many reading
those either...). Of course you should look in the sources that came
with fargo to find that out (I did that way, since David Ellsworth never
answered my emails about it).


Anywaym first you have to know that a point is two words, first the X
coord then the Y coord. And you don't use register, you push the values
on the stack!


Next question: How do I push!? Answer: you move.w #$xx,-(a7) which
will first decrease A7 (which is the stack pointer) with 2 (since it's
a word, .w) and then store #$xx (an immediate value in this case, not
necessary) at (a7). You do thise twice, first with the Y coord then
with the X coord. Note that you push the function paramters BACKWARDS!
Then you call the with jsr flib[point_on]. After that you must restore
the stack pointer, else the stack pointer (A7) will be at the wrong place.
This is easiest done with lea 4(a7),a7 which will add 4 to a7 (remember,
two words=4 byte).


<pre>
-- 
Jimmy Mårdell               | "He claimed to be the son of God
mailto:mja@algonet.se       |  he went too far, he was outlawed
http://www.algonet.se/~mja  |  he actually died for you and me
IRC: Yarin                  |  just to prove how cool he could be."
</pre>


References: