home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 186_01 / txtplot.doc < prev    next >
Text File  |  1985-08-21  |  3KB  |  96 lines

  1. DOCUMENTATION FOR TXTPLOT FUNCTION:
  2.  
  3. Version 1.1 -- 6/14/85
  4.  
  5.  
  6. Revisions:
  7.  
  8. 1.1 -- (JWP, 6/14/85) Added parity stripping, skipping of controls, and
  9.        variable tab size.
  10.  
  11. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  12.  
  13. TXTPLOT.CSM is a replacement for the txtplot function in the BDS C library.
  14. BDS C has 5 library functions for memory-mapped video: 
  15.  
  16.     setplot(base,xsize,ysize)
  17.     clrplot()
  18.     plot(x,y,chr)
  19.     txtplot(string,x,y,ropt)
  20.     line(c,x1,y1,x2,y2)
  21.  
  22. Although setplot and plot work OK for the 8801A, txtplot, clrplot and line 
  23. do not work at all.  Simply doing a putch(0x1a) will take care of clrplot,
  24. and line is not a very useful function, anyway.  But txtplot, which maps
  25. a string at a given set of screen coordinates, is great for using in 
  26. editors and the like, so I have written a replacement that works well
  27. on the 8801A.
  28.  
  29. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  30.  
  31. USAGE:
  32.  
  33. There are some changes to the format of a txtplot call.  The old version
  34. worked like this:
  35.  
  36.     void txtplot(string,x,y,ropt)
  37.     char *string;
  38.     int  x,y,ropt;
  39.  
  40. where string is a pointer to the string to be plotted, x and y are the
  41. coordinates to plot at, and "ropt" was supposedly a flag to toggle
  42. reverse video.  This function was designed for a memory-mapping scheme
  43. where the lines on the screen were mapped end-to-end in memory, and 
  44. a parity bit set indicated reverse video.  On the 8801A, this won't
  45. work, since each screen line is followed in video ram by 40 bytes
  46. of attribute information.  When the old txtplot function tries to
  47. wrap a line around column 80, on the 8801A, it will wreak havoc with
  48. your video attributes.
  49.  
  50. The new format is as follows:
  51.  
  52.     int txtplot(string,x,y,tabsiz)
  53.     char *string;
  54.     int  x,y,tabsiz;
  55.  
  56. At its simplest, the new txtplot rectifies this situation by simply refusing
  57. to plot text past column 80.  I could have done it with wrap-around, but
  58. chose not to since in the applications I use it with, one line of text
  59. must occupy only one line on the screen.
  60.  
  61. The new txtplot does more than the old, however.  To facilitate its use
  62. in word processing applications, I added the following features:
  63.  
  64.     (1)  Strings may now be terminated by either a null or by
  65.          a carriage return (0x0d).  This means you can just pass
  66.          it a pointer to a regular C character string, or you
  67.          can pass a pointer to a line of a standard text file.
  68.  
  69.     (2)  All control characters (with the exception of tabs) are
  70.          ignored in the plotting.
  71.  
  72.     (3)  All characters have their parity bit stripped before mapping.
  73.          (2) and (3) combined will allow for WordStar files to be
  74.          properly mapped.
  75.  
  76.     (4)  The new txplot expands tabs.  The "tabsiz" variable is
  77.          the factor for tab expansion, allowing variable tab sizes.
  78.  
  79.     (5)  The "ropt" flag has been removed altogether.  Setting video
  80.          attributes on the 8801A requires a different strategy.
  81.  
  82.     (6)  The old txtplot did not return anything.  The new version 
  83.          returns the number of the last column mapped to.  This can
  84.          be helpful if you want to relocate the cursor after mapping
  85.          a line.
  86.  
  87.  
  88. James Pritchett
  89. 275 Bleecker St., Apt. 1
  90. New York, NY  10014
  91.  
  92.  
  93. 
  94.  
  95. s Pritchett
  96. 275 Bleecker St., Apt. 1