[comp.sys.atari.st] Help With linea8

dgy@sigmast.UUCP (Dave Yearke) (09/10/88)

I am trying to use Mark Williams C 3.0 to do low-level line-A calls.  My
routines to do lines and points work just fine, but my text routines are
not working quite right.  Under msh they are generally OK, but when the
program is invoked from the desktop I either get invisible text or
garbled characters.

Below is a skeletal version of what I am trying to do.  Any help or
suggestions would be greatly appreciated!

#include <linea.h>
struct la_font *fontp; /* Line A font header. */
char scr_wrk[1024];

setup()
{
     linea0(); /* Initialize linea */
     lineaa(); /* Hide mouse */
     Cursconf(0, i); /* Hide cursor */

     WMODE = 0; /* Writing mode = replace */
     STYLE = 0; /* Normal Letters */
     SRCY = 0; /* Y coord of character in font */
     LITEMSK = 0x5555; /* Lightening and skewing masks for text */
     SKEWMSK = 0x1111;
     TEXTFG = 15; /* Text foreground dark blue */
     SCRTCHP = scr_wrk; /* Scratch area for graphics */
     LNMASK = -1; /* Solid lines */
     WEIGHT = 1; /* Thickening factor for lines */
     LSTLIN = -1;
}

writetxt(text, x, y)
char *text;
int x, y;
{
     register int i;
     unsigned int tmp;

     fontp = la_init.li_a1[0];  /* 6x6 system font */
     FBASE = fontp->font_data; /* Pointer to start of font form */
     FWIDTH = fontp->font_width; /* Width of font form */
     DELY = fontp->font_height; /* Height of character in font */

     DSTX = x;
     DSTY = y;
     i = 0;
     do {
          if (!iscntrl(text[i])) {
               tmp = text[i] - fontp->font_low_ade;
               DELX = fontp->font_char_off[tmp + 1] -
                      (SRCX = fontp->font_char_off[tmp]);
               linea8();
          }
     } while (text[++i] != '\0');
}

-- 
		Dave Yearke, Sigma Systems Technology, Inc.
		   5813 Main St, Williamsville, NY 14221
		          ...!sunybcs!sigmast!dgy