home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C128CPM / SGTOOL16.ARC / LIBC128.ARC / VDCPSTR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-27  |  846 b   |  35 lines

  1. /*
  2. SG C Tools 1.6
  3.  
  4. (C) 1993 Steve Goldsmith
  5. All Rights Reserved
  6.  
  7. Compiled with HI-TECH C 3.09 (CP/M-80).
  8. */
  9.  
  10. #include <string.h>
  11. #include <hitech.h>
  12. #include <vdc.h>
  13.  
  14. extern uchar  vdcScrHorz;
  15. extern ushort vdcDispMem;
  16.  
  17. /* fast vdc string print given x and y offset in current page */
  18.  
  19. void printstrvdc(uchar X, uchar Y, uchar Attr, char *TextStr)
  20. {
  21.   register uchar I, TextLen;
  22.   ushort DispOfs;
  23.  
  24.   TextLen = strlen(TextStr);
  25.   if(TextLen > 0)
  26.   {
  27.   DispOfs = Y*vdcScrHorz+vdcDispMem+X; /* calc disp mem offset */
  28.   fillattrvdc(X,Y,TextLen,Attr);       /* use block fill for attrs */
  29.   outvdc(vdcUpdAddrHi,(uchar) (DispOfs >> 8));
  30.   outvdc(vdcUpdAddrLo,(uchar) DispOfs); /* set addr of first char */
  31.   for(I = 0; TextStr[I]; I++)          /* send str to vdc disp mem */
  32.     outvdc(vdcCPUData,TextStr[I]);
  33.   }
  34. }
  35.