[comp.sys.atari.st.tech] C function wanted

marco@sys6626.bison.mb.ca (Marco) (04/16/91)

I'm not sure if there is such a fuction, but I would like to know the C 
function for blanking the screen. Many ACCs have it and I still haven't 
found one that suits my needs. If anyone could post a message containing 
this (if it's short) or e-mail me it (if it's long) I would greatly 
appreciate it. 
Thanks in advance.

      /-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\
      *John Perry; Voice #-204/783-0812; Internet:              *
      *marco%sys6626.bison.mb.ca@niven.cc.umanitoba.ca          *
      *---------------------------------------------------------*
      * "It is an old maxim of mine that when you have excluded *
      *  the impossible, whatever remains, however improbable,  *
      *  must be the truth." -Sir Arthur Conan Doyle            *
      \-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/

fabian@etek.chalmers.se (Martin Fabian) (04/17/91)

In article <R90g11w164w@sys6626.bison.mb.ca>, marco@sys6626.bison.mb.ca (Marco) writes:
|> I'm not sure if there is such a fuction, but I would like to know the C 
|> function for blanking the screen. Many ACCs have it and I still haven't 
|> found one that suits my needs. If anyone could post a message containing 
|> this (if it's short) or e-mail me it (if it's long) I would greatly 
|> appreciate it. 
|> Thanks in advance.

How about
         printf("\x1BE");
or maybe
         Bconout(2, '\x1b');
         Bconout(2, 'E');
which essentially is the same. This is for TOS applications.

------------------------------------------------------------
M Fabian, fabian@contrl.chalmers.se | Control Engineering
          fabian@etek.chalmers.se   | Laboratory,     CTH
                                    |       Sweden
------------------------------------------------------------
          "Who says humans must be humane ?"
 

steve@thelake.mn.org (Steve Yelvington) (04/17/91)

[In article <R90g11w164w@sys6626.bison.mb.ca>,
     marco@sys6626.bison.mb.ca (Marco) writes ... ]

> I'm not sure if there is such a fuction, but I would like to know the C 
> function for blanking the screen. Many ACCs have it and I still haven't 
> found one that suits my needs. If anyone could post a message containing 
> this (if it's short) or e-mail me it (if it's long) I would greatly 
> appreciate it. 

The UManitoba ether mailer has no idea where you are, so ...

Do you want to clear the screen or black it? Two different things. If the
latter, try saving the palette and resetting it to zeroes.

int oldpal[16], i;
int pal[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

for (i=0;i<16;i++)
    oldpal[i] = Setcolor(i,-1);  /* save old palette */
Setpalette(p);                   /* set new palette */

 ...

Setpalette(oldpal);              /* restore original palette */

Note: This is off-top-of-head, untested code. Corrections welcome.
I have no idea how an STE or TT would react to this code.

 ----
 Steve Yelvington, Marine on St. Croix, Minnesota, USA / steve@thelake.mn.org

marc@sequoia.cray.com (Marc Bouron) (04/18/91)

In article <R90g11w164w@sys6626.bison.mb.ca>,
      marco@sys6626.bison.mb.ca (Marco) writes:
 
> I'm not sure if there is such a fuction, but I would like to know the C 
> function for blanking the screen. Many ACCs have it and I still haven't 
> found one that suits my needs. If anyone could post a message containing 
> this (if it's short) or e-mail me it (if it's long) I would greatly 
> appreciate it. 

How about using the `clear screen' VT52 escape.  Can't think of it off-hand, but
you should be able to find it documented somewhere.  Or else some other netter
with a better memory than mine (not difficult :-) ) might help you...  (The good
point about this method is that it takes virtually no programming: just a printf
statement.)


[M][a][r][c]


################################################################################
#                           #  marc@sequoia.cray.com           #     .   .     #
#  Marc CR Bouron           #  M.Bouron@cray.co.uk     (ARPA)  #    _|\ /|_    #
#  Cray Research (UK) Ltd.  #  M.Bouron@crayuk.uucp  (DOMAIN)  #   (_|_V_|_)   #
#  +44 344 485971 x2208     #  M.Bouron@uk.co.cray    (JANET)  #     |   |     #
#                           #  ...!ukc!crayuk!M.Bouron (UUCP)  #               #
################################################################################