Smooth graphics in GFA Basic - HELP!

Smooth graphics in GFA Basic - HELP!

Post by Blak » Sat, 09 Nov 1991 20:16:10



I am currently writing a 3D graphical rotation program in GFA Basic and
I am having difficulty in creating flicker-free graphics. Does anyone
know how to direct graphics commands to a memory location while the
screen is displaying something else, and then copy the memory contents
to screen and over-write the previous one. Or, is there a way of doing
it through the TOS system commands available in GFA? Or am I looking in
the wrong place all together?

Any help appreciated - e-mail me if you can.
Thanks in advance.
B.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~           ....                                                     ~
~        ...    ...         "I have never seen why it is necessary   ~
~   *********************    to become irrational to proove that you ~
~    \               ***     care for somebody, or indeed, why you   ~
~     \          ****        have to prove it at all". Avon.         ~
~      /     ****  .                                                 ~
~     /  ****   ...         "I plan to live forever, or die trying". ~
~    /*** ' ....            Villa.                                   ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

Smooth graphics in GFA Basic - HELP!

Post by Steve Yelvingt » Sun, 10 Nov 1991 01:21:46




 > I am currently writing a 3D graphical rotation program in GFA Basic and
 > I am having difficulty in creating flicker-free graphics. Does anyone
 > know how to direct graphics commands to a memory location while the
 > screen is displaying something else, and then copy the memory contents
 > to screen and over-write the previous one. Or, is there a way of doing
 > it through the TOS system commands available in GFA? Or am I looking in
 > the wrong place all together?

Look up Physbase(), Logbase() and Setscreen() in your GFA manual. If
they are not supported, Physbase() is xbios(2), Logbase() is xbios(3),
and Setscreen(l, p, r) is xbios(5, l, p, r).

The logical screen (l) is where output will be written. The physical
screen (p) is the one that is being displayed.

The technique is to obtain a screen's worth of memory, aligned on a
256-byte page. This memory must stay put -- you can't just declare
it in GFA, because GFA shuffles variables around to conserve memory.
So you need to understand GFA's Reserve keyword and how to call the
system Malloc function. You need to know how to adjust the address so
that it is evenly divisible by 256. And you need to know how much
memory to reserve, which is a minimum of 32000 bytes.

Malloc 32*1024, save that pointer for Mfree, and create a pointer to
the new screen by adding the saved pointer with the remainder of a
division by 256. The result will point to sufficient memory that is
properly aligned.

You then call Physbase to get the address of the physical screen,
which you save for later use. Logbase gets the address of the current
logical screen, which can be useful.

Setscreen lets you redirect the logical screen at your allocated
memory. Pass -1 as the resolution argument (r) so that the system
resolution is unchanged.

Now you can write to the background screen. Another Setscreen call
can make it the physical screen in an instant. No data need be copied.

Remember to restore the original physical and logical screen pointers
before your program terminates.

Further discussion of this should go to comp.sys.atari.st.tech.

 --


 
 
 

1. GFA BASIC -> GFA BASIC for WINDOWS

As far as I know, as of GFA v3.5E, GFA was trying to promote cross
platform capabilities with Amiga and PC versions of GFA Basic.

As long as you stay clear of machine specific peeks, pokes, and hardware
registers, etc. most GFA commands should translate smoothly over to the
PC.  Don't forget that the PC versions were developed after the Atari
versions so compatibility was most likely retained.

If you are really concerned, try contacting GFA directly about code
portability.

Ari

2. DCOM Simple example in the SDK

3. VoIP via Frame Relay From IXC

4. GFA BASIC ST <--> GFA BASIC PC Windows

5. Fax Fax Fax

6. GFA Basic graphics routines

7. collect all dependent files (graphics etc) ?

8. looking for gfa-basic v1 (same author as turbo basic xl)

9. Hisoft BASIC v GFA Basic?

10. FA Atari ST Developer Tools : Prospero C, GFA Basic System 2, Atari ST Basic

11. GFA basic vs. HISOFT basic