home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / asilib11 / text.doc < prev   
Text File  |  1994-10-22  |  28KB  |  836 lines

  1. ******************************  TEXT MODE  *******************************
  2.  
  3. ASILIB Text mode video subroutines (C) Copyright 1994 Douglas Herr
  4. All rights reserved
  5.  
  6. Screen writing in TEXT mode
  7.  
  8. ASILIB subroutines write directly to the video memory buffer, except
  9. where noted.  ASILIB detects the default display type and screen
  10. dimensions.  ASILIB assumes that CGA equipment requires "snow" control
  11. and behaves accordingly.  In text modes, ASILIB does not distinguish
  12. between CGA and MCGA equipment.
  13.  
  14. Multiple pages of video memory are available except with MDA video adapters.
  15.  
  16. Pages supported by ASILIB are shown below:
  17.  
  18. video system      screen size    ASILIB support
  19. -------------     -----------    --------------
  20. MDA               80 x 25        page  0       
  21. CGA, MCGA         80 x 25        pages 0 - 3   
  22. CGA, EGA, VGA     40 x 25        pages 0 - 7   
  23. EGA, VGA          80 x 25        pages 0 - 7   
  24. EGA               80 x 43        pages 0 - 3   
  25. VGA               80 x 50        pages 0 - 3   
  26. SVGA             132 x 25        pages 0 - 3   
  27. SVGA             132 x 44        pages 0 & 1   
  28. SVGA             132 x 50        pages 0 & 1
  29. HGC, HGC+, InC    80 x 25        pages 0 - 15  
  30. HGC+, InC         90 x 25        pages 0 - 13  
  31. HGC+, InC         80 x 43        page  0       
  32. HGC+, InC         90 x 43        page  0       
  33.  
  34.    ASILIB subroutines assume that rows are the vertical dimension and
  35.    columns are the horizontal dimension of a text-mode screen.  The upper
  36.    left corner of the screen is at row=1 and col=1
  37.  
  38.  
  39. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  40.  
  41. ANSICOLOR:    determines color attribute used by ANSI device driver.
  42.               See also IsANSI.
  43.  
  44. Parameters:   No input parameters; returns color attribute
  45.  
  46. Example:
  47.  
  48.         call sub "ansicolor", colorattribute
  49.  
  50.  
  51. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  52.  
  53. BLINKOFF:     disable blinking attributes; enable bright background attributes
  54. BLINKON:      enable blinking attributes; disable bright background attributes
  55.  
  56. Parameters:   None.
  57.  
  58.               Color attributes which specify a background color greater
  59.               than 7 will cause either blinking foreground characters or
  60.               a bright-color background, depending on whether "Blink" is
  61.               ON or OFF.  BlinkON enables the blinking characters and
  62.               disables the bright background; BlinkOFF disables blinking
  63.               characters and enables bright-color backgrounds.  This is
  64.               unlike ASIC, which does not permit bright backgrounds.
  65.  
  66. Restrictions: Cannot be used on selected portions of the screen.  Works
  67.               with all monitors in Text mode; may also affect 16-color
  68.               graphics modes.  Affects entire screen, all pages.
  69.  
  70. Example:
  71.  
  72. REM  turn blinking attributes into bright background attributes
  73.         call sub "blinkoff"
  74.  
  75. REM  turn bright background attributes into blinking attributes
  76.         call sub "blinkon"
  77.  
  78.  
  79. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  80.  
  81. BORDER:       Change border color on CGA, EGA and VGA systems.
  82.  
  83. Parameters:   colorattribute
  84.  
  85.               EGA borders are quite thin.  Valid color attributes are 0 - 15.
  86.               See COLORATTR for default colors.
  87.  
  88. Example:
  89.  
  90. REM  blue border
  91. REM  assumes color palette was not changed
  92.         attr = 1
  93.         call sub "border", attr
  94.  
  95. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  96.  
  97. CLEAREOL:     clear from cursor position to end of line
  98.  
  99. Parameters:   colorattribute
  100.  
  101.               CLEAREOL clears from the cursor's current position to the
  102.               right edge of the screen using colorattribute.
  103.  
  104. Restrictions: On Hercules equipment, works only in text mode on page 0;
  105.               will not work with VGA13X graphics modes.
  106.  
  107. Example:
  108.  
  109. REM  I want to clear from (5,10) to the right edge of the screen
  110. REM  with a BLACK color
  111.  
  112.         cursorrow=5
  113.         cursorcolumn=10
  114.         colorattribute=0
  115.         call sub "cursoron", cursorrow, cursorcolumn
  116.         call sub "cleareol", colorattribute
  117.  
  118.  
  119. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  120.  
  121. CURSORCOLOR:  set cursor color and enable color palette (InColor only)
  122.  
  123. Parameters:   colorattribute
  124.  
  125.               Colorattribute may range from 0 to 15; requires Hercules
  126.               InColor equipment.  If colorattribute = 0, the cursor color
  127.               defaults to 7 (white).  If Hercules InColor is not installed,
  128.               CURSORCOLOR does nothing.
  129.  
  130. Restrictions: works on Hercules InColor equipment only
  131.  
  132. Example:
  133.  
  134. REM  Change cursor color to bright red
  135.         call sub "cursorcolor",12
  136.  
  137.  
  138.  
  139.  
  140. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  141.  
  142. CURSOROFF:    make hardware cursor invisible at present location
  143.  
  144. Parameters:   None.
  145.  
  146. Restrictions: Text mode only; supports CGA, MCGA, MDA, HGC, HGC+, InC,
  147.               EGA, VGA, SVGA
  148.  
  149. Example:
  150.  
  151.         call sub "cursoroff"
  152.  
  153.  
  154. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  155.  
  156. CURSORON:     move cursor to (row, col) and update cursor shape
  157.  
  158. Parameters:   Row, Column
  159.  
  160.               Row is the vertical dimension of the screen, starting at
  161.               the top of the screen = 1, and column is the horizontal
  162.               dimension of the screen, starting at the left edge = 1.
  163.  
  164.               Cursor shape is underscore if INSERT is off, larger block
  165.               if INSERT is on.
  166.  
  167. Restrictions: Text mode only. Supports CGA, MCGA, MDA, HGC, HGC+, InC, EGA
  168.               VGA, SVGA
  169.  
  170. Example:
  171.  
  172. REM  move cursor to left bottom of 80-column, 50-row screen
  173.  
  174.         CursorRow=50
  175.         CursorColumn=1
  176.         call sub "cursoron", CursorRow, CursorColumn
  177.  
  178.  
  179.  
  180.  
  181. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  182.  
  183. COLORATTR:    Calculate color attribute from foreground & background colors
  184.  
  185. Parameters:   Fore, Back, Colorattribute
  186.  
  187.               Calculates color attribute used by many ASILIB subroutines
  188.               from foreground and background attributes.  Default
  189.               foreground colors are shown below:
  190.  
  191.      foreground color   Value
  192.  
  193.          black            0         Note: Background colors 0-7 are
  194.          blue             1         identical to foreground colors 0-7.
  195.          green            2         Background colors 8-15 are identical
  196.          cyan             3         foreground color 8-15 if Blink has
  197.          red              4         been turned off.  If blink is on,
  198.          magenta          5         background colors 8-15 will look like
  199.          brown            6         colors 0-7, and will make the foreground
  200.          "white"          7         blink.
  201.          gray             8
  202.          bright blue      9
  203.          bright green    10
  204.          bright cyan     11
  205.          bright red      12
  206.          bright magenta  13
  207.          yellow          14
  208.          bright white    15
  209.  
  210. Example:
  211.  
  212. REM  determine color attribute for bright red foreground with
  213. REM  white background, no blinking
  214.         fore=12
  215.         back=7
  216.         call sub "colorattr", fore, back, colorattribute
  217.  
  218.  
  219. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  220.  
  221. FILLEOL:      fill row from cursor position to edge of screen
  222.  
  223. Parameters:   fill character, colorattribute
  224.  
  225.               FILLEOL fills from the cursor's current position to the
  226.               right edge of the screen using colorattribute and specified
  227.               fill character
  228.  
  229. Restrictions: On Hercules equipment, works only in text mode on page 0;
  230.               will not work with VGA13X graphics modes.
  231.  
  232. Example:
  233.  
  234. REM  I want to fill from (5,10) to the right edge of the screen
  235. REM  with a blue "*".
  236.  
  237.         cursorrow=5
  238.         cursorcolumn=10
  239.         colorattribute=1
  240.         fillcharacter=ASC("*")
  241.         call sub "cursoron", cursorrow, cursorcolumn
  242.         call sub "filleol", fillcharacter, colorattribute
  243.  
  244.  
  245. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  246.  
  247. GETBORDER:    determine border color on CGA, EGA and VGA systens
  248.  
  249. Parameters:   no input parameters; returns color of screen border.
  250.  
  251.               Color attributes returned by GETBORDER range from 0 to 15.
  252.  
  253. Example:
  254.  
  255.         call sub "getborder", bordercolor
  256.  
  257.  
  258.  
  259.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  260.  
  261. GETPOS:       Get cursor position
  262.  
  263. Parameters:   No input parameters; returns cursorrow, cursorcolumn
  264.  
  265.               Uses BIOS functions to determine the current cursor position.
  266.               Similar to ASIC's col% = POS(x) and row% = CSRLIN commands,
  267.               but works with all text-mode screens sizes.
  268.  
  269. Example:
  270.  
  271.         call sub "getpos", cursorrow, cursorcolumn
  272.  
  273. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  274.  
  275. GETSCREEN:    save a screen page to a memory buffer
  276. PUTSCREEN:    copy a saved screen page to the video buffer
  277.  
  278. Parameters:   buffersegment, bufferoffset
  279.  
  280.               Buffersegment is the segment part of the memory buffer's
  281.               address; bufferoffset is the offset part of the buffer's
  282.               address.  You may use either an ASIC array or an ASILIB
  283.               memory block allocated by AllocDOS.
  284.  
  285. Restrictions: Text mode only.
  286.  
  287. Example:
  288.  
  289. REM  allocate 4000 bytes for 80-column, 25-row screen
  290.  
  291.         dim screenbuffer(2000)
  292.  
  293. REM  save the screen
  294.         bufferoffset = VARPTR(screenbuffer(1))
  295.         call sub "asicds", buffersegment
  296.         call sub "getscreen", buffersegment, bufferoffset
  297.                .
  298.                .
  299.                .
  300. REM  some time later...
  301.         call sub "putscreen", buffersegment, bufferoffset
  302.  
  303. REM  see also ScreenMem example
  304.  
  305.  
  306.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  307.  
  308. GETSCREENSIZE:determine screen dimensions
  309.  
  310. Parameters:   No input parameters; returns screenrows, screencolumns
  311.  
  312.               GETSCREENSIZE allows you to determine the screen's dimensions.
  313.               Rows are the vertical dimension and columns are the horizontal
  314.               dimension.
  315.  
  316. Example:
  317.  
  318.         call sub "getscreensize", screenrows, screencolumns
  319.  
  320. REM with a standard 80 x 25 screen, getscreenrows returns screenrows = 25
  321. REM and screencolumns = 80
  322.  
  323.  
  324. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  325.  
  326. HSCROLL:      scroll a portion of the screen left or right.
  327.  
  328. Parameters:   row0, col0, row1, col1, color, columns
  329.  
  330.               (Row0, col0) are the coordinates of the upper left part of
  331.               the screen you want to scroll; (row1, col1) is the lower
  332.               right corner.  Color = color attribute for cleared columns.
  333.               Columns is the number of columns scrolled left or right.
  334.               Scrolls left if columns > 0, scrolls right if columns < 0,
  335.               clears area if columns = 0.
  336.  
  337. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  338.  
  339. Example:
  340.  
  341. REM  I want to scroll the entire screen area left 3 columns
  342. REM  assume 80-column, 25-row screen
  343.  
  344. REM  use white-on-blue color attribute
  345.  
  346.         colorattribute = &hex0107
  347.         call sub "hscroll", 1, 1, 25, 80, colorattribute, 3
  348.         
  349.  
  350.  
  351. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  352.  
  353. MODE43:       switch EGA to 80x43 text mode or VGA to 80x50 text mode
  354.               Mode43 switches an EGA to the 80-column, 43-row text mode from
  355.               any color mode or any EGA monochrome mode, or switches a color
  356.               VGA to 80x50 text mode from any other color mode.
  357.  
  358. Parameters:   None
  359.  
  360. Example:
  361.  
  362.         call sub "mode43"
  363.  
  364.  
  365. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  366.  
  367. MODECOLOR:    switches system to color text mode; may be used to switch
  368.               monitors on a 2-monitor system, or to switch to the standard
  369.               80-column, 25-rows color mode from other color modes
  370.  
  371. Parameters:   None
  372.  
  373. Example:
  374.  
  375.         call sub "modecolor"
  376.  
  377.  
  378. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  379.  
  380. MODEMONO:     switches system to monochrome text mode; may be used either
  381.               to switch active monitors on a 2-monitor sysem or to switch
  382.               to monchrome text mode (80x25) from graphics mode (EGA or
  383.               Hercules).
  384.  
  385. Parameters:   None
  386.  
  387. Example:
  388.  
  389.         call sub "modemono"
  390.  
  391.  
  392.  
  393. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  394.  
  395. MOVEPOS:      Move cursor position
  396.  
  397. Parameters:   rowoffset, columnoffset
  398.  
  399.               Moves the cursor from its present position by rowoffset rows
  400.               and columnoffset columns.  Rowoffset and columnoffset may be
  401.               positive or negative.
  402.  
  403. Example:
  404.  
  405.         rowoffset = -2            REM move the cursor up two rows
  406.         columnoffset = 0          REM same column
  407.         call sub "movepos", rowoffset, columnoffset
  408.  
  409.  
  410.  
  411. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  412.  
  413. SETPOS:       Set cursor location to row, column
  414.  
  415. Parameters:   row, column
  416.  
  417.               Positions the cursor at row, column.  Similar to ASIC's
  418.  
  419.               LOCATE row, column
  420.  
  421.               command, but works with non-standard text screens.  ASIC's
  422.               PRINT command will not work well beyond 25 rows.
  423.  
  424.     Example:
  425.  
  426.         call sub "hram9043"     REM Hercules RAMFont 90-column mode, 43 rows
  427.         row = 40
  428.         column = 85
  429.         call sub "setpos", row, column
  430.  
  431.  
  432. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  433.  
  434. SCREENMEM:    calculate bytes required to save screen page
  435.               Used with GetScreen and PutScreen.
  436.  
  437. Parameters:   No input parameters; returns bytes& required to save screen.
  438.  
  439.               Note that SCREENMEM returns a LONG integer (bytes&) so that
  440.               you can allocate the required space with AllocDOS.  Requires
  441.               ASIC's extended math option.
  442.  
  443. Example:
  444.  
  445.         call sub "screenmem", screenbytes&
  446.         call sub "allocdos", screenbytes&, blockseg
  447.         call sub "getscreen", blockseg, 0
  448.                .
  449.                .
  450.                .
  451. REM  some time later...
  452.         call sub "putscreen", blockseg, 0
  453.  
  454.  
  455. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  456.  
  457. TCENTER:      Print string directly to video buffer, centered horizontally
  458.  
  459. Parameters:   TextToPrint$, screenrow, colorattribute
  460.  
  461.               TextToPrint$ is a normal ASIC text string; Screenrow is
  462.               the row on the screen where you want the text to appear,
  463.               and Colorattribute is the color you want the text to be.
  464.               TCENTER calculates the correct column to center te string
  465.               on the screen.
  466.  
  467. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  468.  
  469. Example:
  470.  
  471. REM  Center a warning message at the bottom of the screen.  I already
  472. REM  know that the screen has been set in a 43-row Hercules RAMFont mode.
  473.  
  474.         call sub "tcenter", warning$, 43,12
  475.  
  476.  
  477.  
  478. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  479.  
  480. TCLEAR:       Clear entire screen
  481.  
  482. Parameters:   colorattribute
  483.  
  484.               Clears the entire screen using " " character and color as
  485.               specified by colorattribute.
  486.  
  487. Restrictions: Text mode only.  Supports all ASILIB screen dimensions.
  488.  
  489. Example:
  490.  
  491.         colorattribute = &hex0107
  492.         call sub "tclear", colorattribute
  493.  
  494.  
  495. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  496.  
  497. TCOPY:        copies one page of text-mode video memory to another page
  498.  
  499. Supports:     all ASILIB text modes, pages 0 - 15; includes CGA snow control
  500.  
  501. Parameters:   frompage, topage, errcode
  502.  
  503.               Copies from frompage to topage.
  504.                returns errcode=0 if no problem
  505.                        errcode=&hexFF00 if frompage out-of-bounds
  506.                        errcode=&hex00FF if topage out-of-bounds
  507.  
  508. Example:
  509.  
  510. REM  copy from page 0 to page 1
  511.         frompage=0
  512.         topage=1
  513.         call sub "tcopy", frompage, topage, errcode
  514.  
  515.  
  516. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  517.  
  518. TFILL:        Fill entire screen with specified character
  519.  
  520. Parameters:   ASCIIcode, colorattribute
  521.  
  522.               Fills the entire screen using the character specified by the
  523.               ASCII code and color as specified by colorattribute.
  524.  
  525. Restrictions: Text mode only.  Supports all ASILIB screen dimensions.
  526.  
  527. Example:
  528.  
  529.         colorattribute = &hex0107
  530.         ASCIIchar=ASC("$")
  531.         call sub "tfill", ASCIIchar, colorattribute
  532.  
  533.  
  534. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  535.  
  536. TGETCHR:      Get character and color attribute at specified screen
  537.               position.
  538.  
  539. Parameters:   row, column, character, color attribute.
  540.  
  541.               Determines what character and color attribute are at
  542.               (row, column).  The character returned is the ASCII
  543.               character code, not a string.
  544.  
  545. Restrictions: Text mode only.
  546.  
  547. Example:
  548.  
  549.         row = 14
  550.         column = 28
  551.         call sub "tputchr", row, column, character, colorattribute
  552.         
  553.  
  554.  
  555.  
  556. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  557.  
  558. TPRINT:       Print string directly to video buffer.
  559.  
  560. Parameters:   TextToPrint$, screenrow, screencolumn, colorattribute
  561.  
  562.               TextToPrint$ is a normal ASIC text string; Screenrow is
  563.               the row on the screen where you want the text to appear;
  564.               Screencolumn is the column on the screen where you want
  565.               the text, and Colorattribute is the color you want the
  566.               text to be.  TPrint may be used to print on any part of
  567.               any text-mode screen; it is not limited to ASIC's 25-row,
  568.               80-column screen area.
  569.  
  570. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  571.  
  572. Example:
  573.  
  574. REM  Print a warning message at the bottom of the screen.  I already
  575. REM  know that the screen has been set in a 43-row Hercules RAMFont mode.
  576.  
  577.         call sub "tprint", warning$, 43,1, 12
  578.  
  579.  
  580. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  581.  
  582. TPRINTCE:     Print string directly to video buffer, clearing to right edge.
  583.  
  584. Parameters:   TextToPrint$, screenrow, screencolumn, colorattribute
  585.  
  586.               TextToPrint$ is a normal ASIC text string; Screenrow is
  587.               the row on the screen where you want the text to appear;
  588.               Screencolumn is the column on the screen where you want
  589.               the text, and Colorattribute is the color you want the
  590.               text to be.  TPRINTCE works just like TPRINT except that
  591.               the remainder of the row after the end of the string is
  592.               cleared to the right edge of the screen.
  593.  
  594. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  595.  
  596. Example:
  597.  
  598.         See TPRINT.
  599.  
  600.  
  601.  
  602. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  603.  
  604. TPUTCHR:      Print a single character on the screen.
  605.  
  606. Parameters:   row, column, character, color attribute.
  607.  
  608.               Prints ASCII character on the screen at (row, column) using
  609.               specified color attribute.  Note that character is the
  610.               ASCII character code, not a string.
  611.  
  612. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  613.  
  614. Example:
  615.  
  616.         row = 14
  617.         column = 28
  618.         colorattribute = 12
  619.         character = ASC("!")
  620.         call sub "tputchr", row, column, character, colorattribute
  621.  
  622.  
  623. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  624.  
  625. VSCROLL:      scroll a portion of the screen up or down.
  626.  
  627. Parameters:   row0, col0, row1, col1, color, rows
  628.  
  629.               (Row0, col0) are the coordinates of the upper left part of
  630.               the screen you want to scroll; (row1, col1) is the lower
  631.               right corner.  Color = color attribute for cleared columns.
  632.               Rows is the number of rows scrolled up or down.  Scrolls up
  633.               if rows > 0, scrolls down if columns < 0, clears area if
  634.               columns = 0.
  635.  
  636. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  637.  
  638. Example:
  639.  
  640. REM  I want to scroll the entire screen area up 3 columns
  641. REM  assume 80-column, 25-row screen
  642.  
  643. REM  use white-on-blue color attribute
  644.  
  645.         colorattribute = &hex0107
  646.         call sub "vscroll", 1, 1, 25, 80, colorattribute, 3
  647.  
  648.  
  649.  
  650. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  651.  
  652. WCLEAR:       clear a rectangular portion of a text-mode screen
  653.  
  654. Parameters:   row0, col0, row1, col1, colorattribute
  655.  
  656.               (Row0, col0) are the coordinates of the upper left part of
  657.               the screen you want to clear; (row1, col1) is the lower
  658.               right corner.  Color = color attribute for the cleared area.
  659.  
  660. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  661.  
  662. Example:
  663.  
  664. REM  I want to clear from row 3, column 3 to row 20, column 62
  665. REM  using white-on-blue color attribute
  666.  
  667.         colorattribute = &hex0107
  668.         call sub "wclear", 3, 3, 20, 62, colorattribute
  669.  
  670. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  671.  
  672. WFILL:        fill a rectangular protion of a text-mode screen with
  673.               specified character and attribute; variation of WClear
  674.  
  675. Parameters:   row0, col0, row1, col1, colorattribute, asciicode
  676.  
  677.               (Row0, col0) are the coordinates of the upper left part of
  678.               the screen you want to clear; (row1, col1) is the lower
  679.               right corner.  Color = color attribute for the cleared area.
  680.               Asciicode is the ASCII character code for the character
  681.               you want to fill the area with.
  682.  
  683. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  684.  
  685. Example:
  686.  
  687. REM  I want to fill from row 3, column 3 to row 20, column 62
  688. REM  using white-on-blue color attribute and character "*"
  689.  
  690.         colorattribute = &hex0107
  691.         i = ASC("*")
  692.         call sub "wfill", 3, 3, 20, 62, colorattribute, i
  693.  
  694.  
  695.  
  696. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  697.  
  698. WFRAME:       draw a border around a part of a text-mode screen
  699.  
  700. Parameters:   row0, col0, row1, col1, colorattribute, asciicode
  701.  
  702.               (Row0, col0) are the coordinates of the upper left part of
  703.               the screen you want to draw a border around; (row1, col1) is
  704.               the lower right corner.  Color = color attribute for the
  705.               border.  Colorattribute is the color you want the border
  706.               to be.  Asciicode is the ASCII character code for the character
  707.               you want to use for the border.  There are 2 special border
  708.               types: if asciicode = 0, a single line is used, and if
  709.               asciicode = -1, a double line is drawn.
  710.  
  711. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  712.  
  713. Example:
  714.  
  715. REM  I want to frame from row 4, column 4 to row 19, column 61
  716. REM  using white-on-blue color attribute and a single-lined border.
  717. REM  I need to draw the border OUTSIDE the area I want framed.
  718.  
  719.         colorattribute = &hex0107
  720.         i = 0
  721.         call sub "wframe", 3, 3, 20, 62, colorattribute, i
  722.  
  723.  
  724. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  725.  
  726. WPAINT:       replace all color attributes in a window of the screen
  727.               Any text or other information in the window will not be
  728.               changed; only the color is changed.
  729.  
  730. Parameters:   row0, col0, row1, col1, colorattribute
  731.  
  732.               (row0, col0) are the coordinates of the upper left corner of
  733.               the area you want to change, (row1, col1) are the coordinates
  734.               of the lower right corner of the are you want to change.
  735.               Colorattribute is the color you want the area changed to.
  736.  
  737. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  738.  
  739. Example:
  740.  
  741. REM  I want to change the color from row 3, column 5 to row 20, column 60
  742. REM  to bright red on a blue background.
  743.  
  744.         colorattribute = &hex010C
  745.         call sub "wpaint", 3, 5, 20, 60, colorattribute
  746.  
  747.  
  748.  
  749. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  750.  
  751. WRECOLOR:     change selected color attributes in a window of the screen
  752.  
  753. Parameters:   row0, col0, row1, col1, oldcolor, newcolor
  754.  
  755.               (row0, col0) are the coordinates of the upper left corner of
  756.               the area you want to change, (row1, col1) are the coordinates
  757.               of the lower right corner of the are you want to change.
  758.               Oldcolor is the color you want to be changed; newcolor is the
  759.               you want oldcolor in that window changed to.
  760.  
  761. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  762.  
  763. Example:
  764.  
  765. REM  I want to change yellow-on-black color attributes from row 3, column 5
  766. REM  to row 20, column 60 to bright red on a blue background.
  767.  
  768.         oldcolor = &hex000E
  769.         newcolor = &hex010C
  770.         call sub "wrecolor", 3, 5, 20, 60, oldcolor, newcolor
  771.  
  772.  
  773.  
  774. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  775.  
  776. WRESTORE:     restore a portion of a text-mode screen from a buffer
  777. WSAVE:        save a portion of a text-mode screen to a buffer
  778.               (handy when using pop-up windows on the screen)
  779.  
  780. Parameters:   bufferseg, bufferoffset, row0, col0, row1, col1
  781.  
  782.               Bufferseg is the segment address of the buffer you want to
  783.               use to save the screen portion.  Bufferoffset os the offset
  784.               portion of the buffer's address.  (row0, col0) are the
  785.               coordinates of the upper left corner of the screen window
  786.               and ((row1, col1) are the coordinates of the lower right
  787.               corner of the screen window.  WSave and WRestore use the
  788.               same parameters; WSave copies from the screen to the buffer
  789.               while WRestore copies from the buffer to the screen.
  790.  
  791. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  792.  
  793. Example:
  794.  
  795. REM  I'm going to pop up a message window on the screen so I want
  796. REM  to save the area of the screen where the message box is going
  797. REM  to be 'cuz I want to make the message box disappear as quickly
  798. REM  as it appeared.
  799.  
  800.         call sub "wsize", row0, col0, row1, col1, bytes
  801.         longbytes& = bytes
  802.         call sub "allocdos", longbytes&, bufferseg
  803.  
  804. REM  According to ASILIB documentation, memory blocks allocated with
  805. REM  AllocDOS start at bufferseg:0
  806. REM  thus bufferoffset = 0
  807.         bufferoffset = 0
  808.         call sub "wsave", bufferseg, bufferoffset, row0, col0, row1, col1
  809.  
  810. REM  now the program does its thing to the screen and waits for the humanoid
  811. REM  staring at the screen to push either the "Y" or "N" key.
  812.  
  813.         call sub "yesno", keycode
  814. REM  Having received an answer, the program may now clean up the screen.
  815.         call sub "wrestore", bufferseg, bufferoffset, row0, col0, row1, col1
  816.  
  817.  
  818.  
  819. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  820.  
  821. WSIZE:        calculate the memory required to save a screen window
  822.  
  823. Parameters:   row0, col0, row1, col1, bytes
  824.  
  825.               As with all other ASILIB text-mode Window subroutines, the
  826.               row and column coordinates define the corners of the window.
  827.               Bytes = the size of the buffer required to store this portion
  828.               of the screen.
  829.  
  830. Restrictions: Text mode only; any screen dimensions supported by ASILIB.
  831.  
  832. Example:
  833.         See example for WSave, WRestore.
  834.  
  835.  
  836.