home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / asilib11 / graphics.doc < prev    next >
Text File  |  1994-10-23  |  64KB  |  1,697 lines

  1.  ************************ ASILIB GRAPHICS ***********************************
  2.  
  3.   ASILIB's graphics subroutines may be used with nearly every widely-
  4.   available graphics screen mode (see mode chart on next page).  ASILIB
  5.   automatically configures itself for the graphics mode in use.
  6.  
  7.   Locations on Graphics screens are defined by coordinate pairs such as (x,y).
  8.   X-coordinates are the horizontal dimensions of the screen, and Y-coordinates
  9.   are the vertical coordinates.  X = 0 is the at the left edge of the screen,
  10.   and X = 719 is the right edge of a Hercules screen, while Y = 0 is the top
  11.   edge of the screen and Y = 347 is the bottom (Hercules).  Thus, the
  12.   coordinate (719,0) is the upper right corner of a Hercules screen.
  13.  
  14.   Note that for a graphics mode that allows 800 X-pixels and 600 Y-pixels,
  15.   the permissible values for X are 0 through 799 and for Y the permissible
  16.   values are 0 through 599.  See mode chart on next page.
  17.  
  18.   ASILIB also allows multiple screen pages to be used.  This is handy for
  19.   storing one image while another is displayed, for drawing an image off-
  20.   screen while another is viewed, and for animation techniques.  As with
  21.   pixel dimensions, with a graphics mode that permits 4 screen pages (for
  22.   example) the allowable page numbers are 0, 1, 2 and 3.  See UseGPage,
  23.   ShowGPage, GPage and GCopy.
  24.  
  25.   You may also use your own coordinate system with ASILIB graphics, similar
  26.   to using WINDOW with GWBASIC's graphics functions.  See QWindow at the
  27.   end of this file.
  28.  
  29.  
  30.   Graphics modes supported by ASILIB are listed below, along with the
  31.   equivalent ASIC SCREEN command (if any) and the ASILIB subroutine to
  32.   switch to each mode:
  33.  
  34.   ASILIB             Screen size    Colors   Equipment              ASIC
  35.   subroutine      (X by Y by Pages)                             SCREEN command
  36.  
  37.  
  38.   HGraph              720 x 348 x 2    2      Hercules
  39.   HGraph0             720 x 348 x 1    2      Hercules
  40.   ScreenMode(&hex8)   720 x 348 (1)    2      Hercules
  41.  
  42.   HGraph              720 x 348 x 2   16      Hercules InColor
  43.   HGraph0             720 x 348 x 1   16      Hercules InColor
  44.   ScreenMode(&hex8)   720 x 348 (1)   16      Hercules InColor
  45.  
  46.   ScreenMode(&hex4)   320 x 200 x 1    4      CGA, EGA, MCGA, VGA   SCREEN 1
  47.   ScreenMode(&hex6)   640 x 200 x 1    2      CGA, EGA, MCGA, VGA   SCREEN 2
  48.   ScreenMode(&hex40)  640 x 400 x 1    2      ATT 6300
  49.   ScreenMode(&hexD)   320 x 200 x 8   16      EGA, VGA              SCREEN 7
  50.   ScreenMode(&hexE)   640 x 200 x 4   16      EGA, VGA
  51.   ScreenMode(&hexF)   640 x 350 x 2    4      EGA, VGA  (2)
  52.   ScreenMode(&hex10)  640 x 350 x 2   16      EGA, VGA  (3)         SCREEN 9
  53.   ScreenMode(&hex11)  640 x 480 x 1    2      MCGA, VGA
  54.   ScreenMode(&hex12)  640 x 480 x 1   16      VGA
  55.   ScreenMode(&hex13)  320 x 200 x 1  256      MCGA, VGA             SCREEN 13
  56.   ScreenMode(&hex6A)  800 x 600 x 1   16      VESA SVGA
  57.   VGA13X(0)           320 x 200 x 4  256      VGA
  58.   VGA13X(1)           320 x 240 x 3  256      VGA
  59.   VGA13X(2)           320 x 400 x 2  256      VGA
  60.   VGA13X(3)           360 x 480 x 1  256      VGA
  61.   SVGA16(0)           800 x 600 x 1   16      SVGA
  62.   SVGA16(1)          1024 x 768 x 1   16      SVGA
  63.   SVGA256(0)          640 x 400 x 1  256      SVGA
  64.   SVGA256(1)          640 x 480 x 1  256      SVGA
  65.   SVGA256(2)          800 x 600 x 1  256      SVGA
  66.   SVGA256(3)         1024 x 768 x 1  256      SVGA
  67.  
  68.   (1) ScreenMode(&hex8) permits 2 pages if no color monitor is present,
  69.       otherwise only 1 page is allowed.
  70.   (2) monochrome monitor only; EGA requires 256k for 2 pages.
  71.   (3) EGA with 128k or more memory; 256k required for 2 pages.
  72.  
  73. Many ASILIB Graphics subroutines can be configured to draw in a number of
  74. ways: dots, lines or images can simply replace whatever had been on the
  75. screen, or may be combined with the pre-existing screen:
  76.  
  77.    draw mode =  0 XORs the text/pixel/line/whatever with the pre-existing
  78.                 screen: if a pixel (x,y) is XORed to the screen, the pixel
  79.                 will be turned on if previously off, or will be turned off
  80.                 if previously on;
  81.  
  82.    draw mode =  1 is normal; lines are drawn, pixels are turned on, text is
  83.                 foreground-on-background, and the previous screen content
  84.                 is ignored or obliterated;
  85.  
  86.    draw mode =  2 similar to draw mode 1, but foreground color only is updated
  87.  
  88.    draw mode =  3 ORs the line or block with the existing screen; this means
  89.                 that the new stuff is added to the old.
  90.  
  91.    draw mode =  4 ANDs a block (or fillbox) with the existing screen; within
  92.                 the block's limits, only those pixels where both the
  93.                 previous screen and the pattern in the block have ON pixels
  94.                 will there be a resulting ON pixel;
  95.  
  96.    draw mode = -3 similar to draw mode 3, but reverses the foreground and
  97.                 background before combining it with the screen
  98.  
  99.    draw mode = -2 similar to draw mode 2, but reverses the foreground and
  100.                 background before combining it with the screen
  101.  
  102.    draw mode = -1 like draw mode 1, but uses background color.  In monochrome
  103.                 modes, pixels are erased, text is black with a bright
  104.                 background.
  105.  
  106.    Use ASILIB's SetDrawMode subroutine to change drawing mode.
  107.  
  108.  
  109.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  110.  
  111. BUFFERDIM:    Change logical dimensions of graphics memory buffer
  112.               does not change number of pixels displayed on screen;
  113.               used with ScreenOrigin.
  114. Modes supported: EGA and VGA 16-color modes to 800x600
  115.                  VGA13x
  116.  
  117. Parameters:   Xpixels, Ypixels, Pages
  118.  
  119.               Note that the logical buffer dimensions should be greater
  120.               than the dimensions displayed on the screen.  The logical
  121.               buffer dimensions must not create a plane size greater than
  122.               64k; in 16-color modes, a logical pixel width of 800 + logical
  123.               height of 600 works out to 60,000 bytes per plane.  In VGA13x
  124.               modes the same dimensions result in a plane size of 120,000
  125.               bytes so this would not work.
  126.  
  127.               If anything is displayed on the screen before changing
  128.               logical dimensions, it will be unreadable after calling
  129.               BufferDim if your logical x-dimension is not the same as
  130.               the screen's physical x-width.
  131.  
  132.               BufferDim does no error checking; you must determine if
  133.               the computer has an EGA or VGA (see GetCRT in SYSTEM.DOC)
  134.               and you must verify that the logical dimensions are greater
  135.               than the screen dimensions.
  136.  
  137.               Bufferdim re-calculate the number of pages available with
  138.               the new logical dimensions and returns the maximum page number
  139.               as Pages.
  140.  
  141. Example on next page
  142. (BufferDim example)
  143.  
  144. REM The computer has a 256k EGA card & EGA-only monitor 
  145. REM and I want to display an image that is 800 pixels wide
  146. REM and 600 pixels high.
  147. REM I'll use EGA mode 10h, switch to logical dimensions of 800x600,
  148. REM put the image in the video buffer & use ScreenOrigin to view
  149. REM various parts of the image
  150.  
  151.         fname$="800x600.pcx"      REM a .PCX file with an 800 x 600 image
  152.  
  153. REM  set up 640x350 16-color mode and re-dimension
  154. REM  the buffer
  155. REM  BufferDim should return pages = 0, because only page number 0
  156. REM  is available with there dimensions
  157.  
  158.         SCREEN 9
  159.         call sub "bufferdim", 800,600,pages
  160.  
  161. REM  program loads image to video buffer
  162.         call sub "loadpcx", fname$, errcode
  163.  
  164. REM  default screen origin: (0,0) of buffer is at (0,0) of screen
  165. REM  change portion of buffer displayed to logical (100,100)
  166. REM  at (0,0) of screen
  167.         call sub "screenorigin", 100,100
  168.  
  169.  
  170.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  171.  
  172. GETBITBLOCK:  Copy a portion of the screen to system memory
  173.  
  174. Parameters:   ramseg, ramptr, x0, y0, x1, y1
  175.  
  176.  
  177. PUTBITBLOCK:  Copy saved screen data from system ram
  178.  
  179. Parameters:   ramseg, ramptr, x, y
  180.  
  181.  
  182. BITBLOCKBYTES:calculate byte requirements to save bit block
  183.  
  184. Parameters:   x0, y0, x1, y1, bytes&
  185.  
  186. Modes supported: All
  187.  
  188.               GetBitBlock copies a section of the graphics screen to system
  189.               memory in order to copy the block back to the screen later
  190.               with PutBitBlock.
  191.  
  192.               BitBlockBytes returns the number of bytes of memory required
  193.               store the entire pixel block.  Note that bytes& is a long
  194.               integer, requiring ASIC's extended math option.  After
  195.               calculating the bytes required, you may use ASILIB's AllocDOS
  196.               to allocate the memory space required.  See AllocDOS in
  197.               SYSTEM.DOC.  Note that bit block memory requirements can
  198.               be large.  In 256-color modes, PutBitBlock clips bitblocks at
  199.               ASILIB's View boundaries.
  200.  
  201.               drawing modes supported by PutBitBlock are:
  202.  
  203.               All 256-color modes:
  204.                1 = replace existing screen area with bit block
  205.                2 = replace existing screen with non-zero pixels in bit block
  206.  
  207.               HGraph (InColor):
  208.                4 = AND the bit block with the existing screen
  209.                3 = OR the bit block with the existing screen
  210.                1,2 = replace existing screen area with bit block
  211.                0 = XOR the bit block with the existing image
  212.               -1,-2 = replace existing screen area with inverse bit block
  213.  
  214.              16-color EGA/VGA-type modes including SVGA16, and SCREEN 10:
  215.               same as InColor, plus:
  216.              -3 = OR the inverse bit block with the existing screen
  217.              -4 = AND the inverse bit block with the existing screen
  218.  
  219.              SCREEN 1 and monochrome modes:
  220.               2 = combine non-zero pixels in the bit block with the
  221.                   pre-existing image
  222.               1 = replace the existing screen image with un-altered
  223.                   bit block
  224.               0 = XOR the bit block with the existing image
  225.              -1 = replace existing screen image with inverse bit block
  226.              -2 = combine non-zero pixel in the inverse bit block with
  227.                   the previous screen image
  228.  
  229.              See example on next page.
  230.  
  231.     BIT BLOCK Example:
  232.  
  233.  
  234. REM  This example calculates the array size required,
  235. REM  dimensions the array, saves a portion of the screen and
  236. REM  restores it later.
  237.  
  238. REM  start in the desired graphics mode
  239.         SCREEN 9
  240.               .
  241.               .
  242.               .
  243.         x0 = 100
  244.         y0 = 0
  245.         x1 = 400
  246.         y1 = 347
  247.  
  248. REM  calculate bytes required to save bit block and allocate from
  249. REM  DOS memory space
  250.         call sub "bitblockbytes",x0, y0, x1, y1, bytes&
  251.         call sub "allocdos", bytes&, bbseg, errcode
  252.         if errcode > 0 then nogood:
  253.         bbptr = 0
  254.  
  255. REM  save the bit block
  256.         call sub "getbitblock",bbseg, bbptr, x0, y0, x1, y1
  257.               .
  258.               .
  259.               .
  260. REM  now we'll copy the block back to the screen
  261. REM  x2 and y2 may be any coordinates on the screen
  262.         call sub "putbitblock", bbseg, x2, y2
  263.  
  264. REM  also release the memory block
  265.         call sub "freedos", bbseg, errcode
  266.  
  267.  
  268.  
  269.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  270.  
  271. GETBITPLANE:  Copy one plane of grapics screen to system RAM
  272.  
  273. Parameters:   plane, ramseg, ramptr, x0, y0, x1, y1
  274.  
  275.  
  276. PUTBITPLANE:  Copy saved bit plane from system RAM to screen
  277.  
  278. Parameters:   plane, ramseg, ramptr, x0, y0 
  279.  
  280.  
  281. BITPLANEBYTES:Calculate bytes required to save bit plane
  282.  
  283. Parameters:   x0, y0, x1, y1, bytes&
  284.  
  285. Modes supported: All 16-color graphics modes
  286.                  plus ScreenMode(&hexF)
  287.  
  288.               GetBitPlane subroutines copy a section of the graphics screen
  289.               to a memory buffer in order to copy that block back to the
  290.               screen at a later time with PutBitPlane.  This is similar to
  291.               the GetBitBlock/PutBitBlock subroutines, except that BitPlane
  292.               subroutines copy to or from only one of the four "planes" of
  293.               memory in 16-color modes.  This is handy when you want to move
  294.               or modify only one plane at a time.  The exact color
  295.               represented by each plane is determined by PALETTE or COLOR
  296.               statements.
  297.  
  298.               BitPlaneBytes calculates the number of bytes of memory required
  299.               to save the desired portion of the plane.  All PutBitBlock draw
  300.               modes work with PutBitPlane.  You may use AllocDOS to allocate
  301.               memory space for the bit plane.  Note that BitPlaneBytes, as
  302.               with BitBlockBytes, requires ASIC's extended math option.
  303.  
  304. Example on next page
  305.  
  306.  
  307. Example:
  308.          REM  calculate the array size required, allocate the memory,
  309.          REM  save a portion of one plane of the screen and restores it later.
  310.          REM  note that valid plane numbers are 0 - 3
  311.  
  312.          REM  First I need to establish graphics mode
  313.          call sub "screenmode", &hex10
  314.               .
  315.               .
  316.          x0 = 100: y0 = 0: x1 = 400: y1 = 347
  317.          call sub "bitplanebytes", x0, y0, x1, y1, bytes&
  318.          call sub "allocdos", bytes&, bpseg, errcode
  319.          plane = 0
  320.          ptr = 0
  321.          call sub "getbitplane", plane, bpseg, ptr, x0, y0, x1, y1
  322.               .
  323.               .
  324.          REM  now we'll copy the plane back to the screen
  325.          call sub "putbitplane", plane, bpseg, ptr, x2, y2
  326.  
  327.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  328.  
  329. GCLEAR:       Clear graphics screen.
  330.  
  331. Modes supported: All
  332.  
  333. Parameters:   None.
  334.  
  335.               GClear erases everything within the active viewport.  In
  336.               color modes, the background color set by GColor is used.  Use
  337.               SetView to establish the active viewport.
  338.  
  339. Example:
  340.  
  341.       call sub "gclear"
  342.  
  343.  
  344.  
  345.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  346.  
  347. COLOR16:      Calculates a color value for 16-color palette
  348.  
  349. Supports EGA and VGA 16-color modes
  350.  
  351. Parameters:   Red, green, blue, colorvalue
  352.  
  353.               Color16 calculates a color value from individual red, green
  354.               and blue intensities, for changing the color palette in high-
  355.               resolution 16-color modes and 16-color text modes.
  356.               Used with Palette16.  Red, green and blue range from 0 (off)
  357.               to 3 (highest intensity).
  358.  
  359. Example:  see Palette16
  360.  
  361.  
  362.  
  363.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  364.  
  365. COLOR256:     returns a color value given red, green & blue intensities
  366.  
  367. Supports all VGA and SVGA 256-color modes
  368.  
  369. Parameters:   red, green, blue, colorvalue&
  370.  
  371.               Color256 returns a LONG INTEGER color value from individual
  372.               red, green and blue components for changing palette colors
  373.               in 256-color modes.  Color256 changes the actual color
  374.               associated with a particular color attribute.  With Color256,
  375.               red, green and blue color intensitites may range from 0 (off)
  376.               to 63 (highest intensity).  Note that ASIC's Extended Math
  377.               option is required and that colorvalue& is a LONG integer.
  378.  
  379. Example:  see Palette256
  380.  
  381.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  382.  
  383. DRAWBOX:      Draw a box on the screen
  384.  
  385. Modes supported: All
  386.  
  387. Parameters:   x0, y0, x1, y1
  388.  
  389.               DrawBox draws a box with corners at (x0, y0), (x0, y1),
  390.               (x1, y0), (x1, y1).  Legal draw modes are -1, 0, and 1.
  391.               If any part of the box lies outside the active graphics
  392.               viewport, that part of the box will not be drawn.  See also
  393.               LinePattern.
  394.  
  395. Example:
  396.         call sub "hgraph"
  397.         x0 = 10
  398.         y0 = 10
  399.         x1 = 79
  400.         y1 = 38
  401.         call sub "drawbox", x0, y0, x1, y1
  402.  
  403.  
  404.  
  405.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  406.  
  407. DRAWCIRCLE:   Draw a circle on the screen
  408.  
  409. Parameters:   xc, yc, Xradius
  410.  
  411. CIRCLEASPECT: Change circle's aspect ratio
  412.  
  413. Parameters:   numerator, denominator
  414.  
  415. Modes supported: All
  416.  
  417.               DrawCircle draws a circle on a graphics screen centered at
  418.               (xc, yc), with x-radius Xradius%.  The circle's aspect ratio
  419.               may be changed with CircleAspect.  Legal draw modes are -1, 
  420.               0 and 1 with monochrome modes.  In color modes, draw modes 2,
  421.               -2, 3 and -3 are also supported. Only the part of the circle
  422.               which lies within the viewport defined by SetView will be drawn.
  423.  
  424.               CircleAspect changes the aspect ratio of the circle; using
  425.               CircleAspect, you can make the circle look like a flattened
  426.               ellipse or a tall ellipse.  CircleAspect changes the Y-dimension
  427.               of the circle; the X-dimension is controlled with Xradius.
  428.               ASILIB's default is an aspect ratio of 1:1.  CAUTION: extreme
  429.               aspect ratios are not supported by DrawCircle.  With
  430.               numerator = 1, a maximum usable denominator% is 5, or else a
  431.               "divide by zero" error will occur.  With denominator = 1, a
  432.               high numerator will cause unpredictable results.
  433.  
  434. Example:
  435.  
  436.         call sub "drawcircle" xc, yc, Xradius
  437.  
  438.  
  439.  
  440.  
  441.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  442.  
  443. DRAWLINE:     Draw a line on the screen
  444.  
  445. Modes supported: All
  446.  
  447. Parameters:   x0, y0, x1, y1
  448.  
  449.               DrawLine draws a line from (x0, y0) to (x1, y1).  Legal draw
  450.               modes are -4 through 4.  See also LinePattern.
  451.  
  452. Example:
  453.  
  454. REM  this draws a diagonal line across a Hercules screen
  455. REM  using ASILIB's current background color
  456.         x0 = 0
  457.         y0 = 0
  458.         x1 = 719
  459.         y1 = 348
  460.         call sub "setdrawmode", -1
  461.         call sub "drawline", x0, y0, x1, y1
  462.  
  463.  
  464.  
  465.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  466.  
  467. FILLAREA:     Fill contiguous irregular region on graphics screen
  468.  
  469. Modes supported: All
  470.  
  471. Parameters:   x, y
  472.  
  473.               FillArea fills irregularly-shaped areas enclosed by solid
  474.               lines.  FillArea works best with SIMPLE areas; holes in the
  475.               area or areas with "inside" corners dividing horizontal lines
  476.               may not be filled properly.  FillArea works by starting at the
  477.               seed pixel (x, y) and looking left and right for non-black
  478.               region boundaries, then filling horizontal lines between the
  479.               boundaries.  FillArea works upward until the top of the area
  480.               has been reached, then returns to the seed pixel and works
  481.               downward.  FillArea presently assumes draw mode = 1.  If you
  482.               want to fill rectangular areas, FillBox is much faster than
  483.               FillArea.
  484.  
  485. Example:
  486.          call sub "hgraph"
  487.               .
  488.               .
  489.               .
  490.          REM for color modes
  491.          call sub "gcolor", attr
  492.  
  493.          rem optional fill pattern
  494.          call sub "fillpattern" pattern$
  495.          call sub "fillarea", x, y
  496.  
  497.  
  498.  
  499.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  500.  
  501. FILLBOX:      Draw a filled box on the screen.
  502.  
  503. Modes supported: All
  504.  
  505. Parameters:   x0, y0, x1, y1
  506.  
  507.               Similar to DrawBox, FillBox uses the same coordinates, but
  508.               fills the box instead of drawing the sides.  If draw mode = 1
  509.               or 2, an optional pattern may be used to fill the box (except
  510.               SCREEN 1).  See FillPattern.
  511.  
  512. Example:
  513.         call sub "hgraph"
  514.         x0 = 10
  515.         y0 = 10
  516.         x1 = 79
  517.         y1 = 38
  518.  
  519.         call sub "fillbox", x0, y0, x1, y1
  520.  
  521.  
  522.  
  523.  
  524.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  525.  
  526. FILLPATTERN:  Define non-solid fill pattern
  527.  
  528. Parameters:   pattern$
  529.  
  530. Modes supported: 2-color and 16-color modes
  531.                  ScreenMode (&hexF)
  532.  
  533.               FillPattern defines an optional pattern used by FillBox if
  534.               draw mode >= 1,  or by FillArea (which assumes draw mode = 1).
  535.               The bit patterns in the first 8 characters of pattern$ are
  536.               used to modify the fill in the box or area.  If you want to
  537.               use a fill pattern, FillPattern must be called before each
  538.               call to FillBox or FillArea.  See Examples.
  539.               FillBox will replace box borders.  If you want the box to have
  540.               a solid outline, call DrawBox with draw mode = 1 after calling
  541.               FillBox.  Using draw mode = 1, the pattern will completely
  542.               replace whatever was in the box.  16-color modes use draw
  543.               mode = 2.
  544.  
  545.               Sample patterns, and what they produce:
  546.  
  547.               REM  squares
  548.               pattern$ = CHR$(255) + STRING$(5,32)
  549.  
  550.               REM  vertical lines
  551.               pattern$ = STRING$(8,32)
  552.  
  553.               REM  horizontal lines
  554.               pattern$ = CHR$(255) + STRING$(5,0)
  555.  
  556.               Example on next page.
  557.  
  558. Example:
  559.       x0 = 10
  560.       y0 = 10
  561.       x1 = 79
  562.       y1 = 38
  563.  
  564.       REM pattern for squares
  565.       REM fill box with pattern
  566.       pattern$ = CHR$(255) + STRING$(5,32)
  567.       call sub "fillpattern", pattern$
  568.       call sub "fillbox", x0, y0, x1, y1
  569.       .
  570.       .
  571.       .
  572.       REM  no fill pattern because FillPattern was not called before FillArea
  573.       call sub "drawbox", x0, y0, x1, y1
  574.       call sub "fillarea", x, y
  575.  
  576.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  577.  
  578. GBASESEG:     Re-direct ASILIB graphics subroutines to alternate buffer.
  579.  
  580.     Modes supported: HGraph (monochrome only)
  581.                      SCREEN 1,2,13
  582.                      ScreenMode (&hex40)
  583.                      ScreenMode (&hex11)
  584.  
  585. Parameters:   Baseseg
  586.  
  587.               Re-directs ASILIB's Graphics subroutines to an alternate
  588.               buffer at baseseg:0.  This may be used to duplicate the
  589.               effect of multiple screen pages.  GBaseSeg works only with
  590.               non-planar, non-bank switched modes.  Baseseg is the segment
  591.               base address of the alternate buffer.  ASILIB assumes that the
  592.               buffer begins at the start of the segment.  If you call
  593.               GBaseSeg with baseseg = 0, the default video buffer becomes
  594.               active again.
  595.  
  596.               Note that GBaseSeg will not work if you change graphics modes
  597.               after calling GBaseSeg.
  598.  
  599.     Example on next page.
  600.  
  601.  
  602.     REM GBaseSeg example
  603.  
  604.     REM  load existing screen image to RAM buffer
  605.         call sub "fload"("screen13.gph", gpd, bytes&, errcode)
  606.  
  607.     REM  switch to graphics mode
  608.         SCREEN 13
  609.  
  610.     REM  after switching to graphics mode, tell ASILIB
  611.     REM  where the off-screen buffer is
  612.         call sub "gbaseseg", gpd
  613.  
  614.     REM  modify the off-screen image as desired
  615.         call sub "gcolor", 10
  616.         call sub "drawline" 0, 199, 319, 0
  617.         call sub "gprint","This was printed to an off-screen buffer", 0, 60
  618.  
  619.     REM  switch back to video buffer and print a message
  620.         call sub "gbaseseg", 0
  621.         call sub "gprint", "press any key...", 0, 0
  622.         call sub "getkey",keycode
  623.  
  624.     REM  copy the modified alternate buffer to the video buffer
  625.     REM  NOTE: Video buffer address and size vary depending on graphics mode:
  626.     REM 
  627.     REM   mode      address  size (bytes)
  628.     REM 
  629.     REM  SCREEN 1             &hexB800   16384
  630.     REM  SCREEN 2             &hexB800   16384
  631.     REM  HGraph               &hexB000   32768
  632.     REM  ScreenMode(&hex40)   &hexB800   32768
  633.     REM  ScreenMode(&hex11)   &hexA000   38400
  634.     REM  SCREEN 13            &hexA000   64000
  635.  
  636.         bytes& = 64000
  637.         call sub "copymem", gpd, 0, &hexA000, 0, bytes&
  638.  
  639.     REM  release the alternate buffer 'cuz I'm all done with it
  640.     REM  then wait for a keypress and exit
  641.         call sub "freedos", gpd, errcode
  642.         call sub "getkey",keycode
  643.         SCREEN 0
  644.         END
  645.  
  646.  
  647.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  648.  
  649. GCOPY:        Copy from one page of graphics video memory to another
  650.  
  651. Modes supported: HGraph (mono and InColor)
  652.                  VGA13X (0 - 2)
  653.                  SCREEN 7,9
  654.                  ScreenMode (&hexD)
  655.                  ScreenMode (&hexE)
  656.                  ScreenMode (&hex10)
  657.  
  658. Parameters:   frompage, topage, errcode
  659.  
  660.               Several graphics modes support more than one screen page.
  661.               GCopy copies one page of graphics memory to another and returns
  662.               an error flag.  Errcode = 0 if no error, or -1 if GCopy is not
  663.               supported or if either frompage or topage is out of range.
  664.               See also UseGPage, ShowGPage and GPage.
  665.  
  666. Example:
  667.  
  668. REM  copy from page 0 to page 1
  669.  
  670.         frompage = 0: topage = 1
  671.         call sub "gcopy", frompage, topage, errcode
  672.  
  673.  
  674.  
  675.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  676.  
  677. GETDOT:       Determine pixel color at specified screen location
  678.  
  679. Modes supported: All
  680.  
  681. Parameters:   x, y, pixelcolor
  682.  
  683.               Determines the color of the pixel located at (x, y).  Returns
  684.               pixelcolor = -1 if (x,y) falls outside the active graphics
  685.               viewport.
  686.  
  687. Example:
  688.  
  689.         x = 0: y = 0
  690.         call sub "getdot", x, y, pixelcolor
  691.         REM  This will determine the color of the pixel at the upper left
  692.         REM  corner of the screen.
  693.  
  694.  
  695.  
  696.  
  697.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  698.  
  699. GCOLOR:       Change color attribute used by ASILIB graphics subroutines
  700.  
  701. Modes supported: all modes with more than 2 colors
  702.  
  703. Parameters:   attribute
  704.  
  705.               Sets the color attribute to be used when ASILIB subroutines
  706.               are used in color modes.  Color attributes for 16-color modes
  707.               may be calculated with ColorAttr (See TEXT.DOC).
  708.  
  709.  
  710.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  711.  
  712. GCURSOR:      Put a simulated text cursor on graphics screen
  713. GUCURSOR:     Put a simulated underscore text cursor on graphics screen
  714.  
  715.     Modes supported: All
  716.  
  717. Parameters:   Xpixel, Ypixel
  718.  
  719.               GCursor subroutines put a text cursor on graphics screens
  720.               at the character box with upper left coordinates at (x, y).
  721.               GCursor and GUCursor subroutines are similar to ASILIB's
  722.               text-mode CursorON and UCursorON subroutines, except that
  723.               GCursor waits until a key has been pressed before returning
  724.               to the calling program.  The key pressed may be determined
  725.               with ASILIB's input subroutines.
  726.  
  727. Example:
  728.  
  729. REM  program fragment assumes the screen is in graphics mode
  730.  
  731.          a$ = "I want a cursor at the 'I' at the start of this line"
  732.          x = 5: y = 3
  733.          call sub "gprint", a$, x, y
  734.          call sub "gcursor", x, y
  735.  
  736.  
  737.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  738.  
  739. HGRAPH:       Switch to Hercules graphics mode, 2 pages
  740. HGRAPH0:      Switch to Hercules graphics mode, 1 page
  741.  
  742. HTEXT:        Switch to Hercules text mode
  743.  
  744. Parameters:   None.
  745.  
  746. Requires Hercules (mono or InColor)
  747.  
  748.               These subroutines change modes on the Hercules graphics card.
  749.               HText resets the active page to 0.  HGraph clears the entire
  750.               video buffer; HGraph0 clears only page 0.  You must first
  751.               determine if a Hercules or compatible is installed. (see
  752.               GetCRT in SYSTEM.DOC).  With HGraph0, anything in graph
  753.               page 1 is undisturbed.  A graph may be stored in page 1, the
  754.               system can be switched back to text mode for a while, and if
  755.               text pages 8 - 15 are not used, the graph may be restored
  756.               by calling "HGraph0" and "GCopy", (1, 0, errcode).
  757.  
  758.               HGraph0 can also be used if text screens are stored in pages
  759.               8 - 15.  As long as graph page 1 is not used, the text screens
  760.               will not be disturbed and can be restored with HText and TCopy.
  761.  
  762.               If you are using Hercules graphics in a 2-monitor system, use
  763.               HGraph0.  HGraph0 and HText will make the Monochrome monitor
  764.               the default; to use the color monitor, use the subroutine
  765.               ModeColor (See TEXT.DOC).
  766.  
  767. Example:
  768.    REM  establishes Hercules Graphics mode
  769.          call sub "hgraph"
  770.    REM  ASILIB graphics subroutines will work now
  771.            .
  772.            .
  773.            .
  774.            .
  775.            .
  776.            .
  777.  
  778.     REM  return Hercules system to text mode
  779.          call sub "htext"
  780.            .
  781.            .
  782.            .
  783.  
  784.  
  785.  
  786.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  787.  
  788. GLOAD:        Load a screen image from disk
  789. GSAVE:        Save a screen image to disk
  790.  
  791. Modes supported: All
  792.  
  793. Parameters:   filename$, errcode
  794.  
  795.               GLoad loads a Graphics screen from a file to the screen.
  796.               The file must have been previously saved by GSave.  GLoad
  797.               and GSave load to or save from the active graphics page.
  798.               If no error occurred, errcode = 0.  Errcode will be a DOS
  799.               error code if a file handling error occurs.  See the
  800.               introductory remarks in DISK.DOC for DOS error codes.
  801.  
  802.               NOTE: files created by GSave eat lots of disk space:
  803.  
  804.               HGraph  (mono)       32,768 bytes
  805.               HGraph  (InColor)   131,072 bytes
  806.               VGA13X(0)            64,000 bytes
  807.               VGA13X(1)            76,800 bytes
  808.               VGA13X(2)           128,000 bytes
  809.               VGA13X(3)           172,800 bytes
  810.               XMode16      up to  240,000 bytes
  811.               VESA6A, SVGA16(0)   240,000 bytes
  812.               SVGA16(1)           393,216 bytes
  813.               SVGA256(0)          256,000 bytes
  814.               SVGA256(1)          307,200 bytes
  815.               SVGA256(2)          480,000 bytes
  816.               SVGA256(3)          786,432 bytes
  817.               SCREEN 1, 2          16,384 bytes
  818.               ScreenMode(&hex40)   32,768 bytes
  819.               SCREEN 7             32,000 bytes
  820.               ScreenMode(&hexE)    64,000 bytes
  821.               SCREEN 9            112,000 bytes
  822.               ScreenMode(&hexF)    56,000 bytes
  823.               ScreenMode(&hex11)   38,400 bytes
  824.               ScreenMode(&hex12)  153,600 bytes
  825.               SCREEN 13            64,000 bytes
  826.  
  827. Example:
  828.         filename$ = "bargraph.hgc"
  829.         call sub "gsave", filename$, errcode
  830.  
  831.  
  832.  
  833.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  834.  
  835. GLOADEMS:     Load a graphics screen from EMS memory to the video buffer.
  836.               Modes supported: All
  837.  
  838. GSAVEEMS:     Save a graphics screen to EMS memory from the video buffer.
  839.               Modes supported: All
  840.  
  841. Parameters:   emshandle, emserror
  842.  
  843.               GSaveEMS calculates the screen's memory requirements and
  844.               allocates sufficient EMS memory to save the screen.  The
  845.               handle required to re-load the screen and to release the
  846.               EMS memory is my GSaveEMS as emshandle.  If any EMS errors
  847.               were detected, the error code is returned as emserror.
  848.  
  849.               GLoadEMS copies the memory block associated with emshandle
  850.               to the video buffer.  The screen must have been previously
  851.               saved by GSaveEMS.  GLoadEMS and GSaveEMS load to or save
  852.               from the active graphics page.  If no error occurred,
  853.               emserror = 0.  See the introductory remarks in EMSXMS.DOC
  854.               for EMS error codes.
  855.  
  856.     NOTE: uncompressed graphics screens eat lots of memory:
  857.  
  858.          HGraph  (mono)       32,768 bytes
  859.          HGraph  (InColor)   131,072 bytes
  860.          VGA13X(0)            64,000 bytes
  861.          VGA13X(1)            76,800 bytes
  862.          VGA13X(2)           128,000 bytes
  863.          VGA13X(3)           172,800 bytes
  864.          SVGA16(0)           240,000 bytes
  865.          SVGA16(1)           393,216 bytes
  866.          SVGA256(0)          256,000 bytes
  867.          SVGA256(1)          307,200 bytes
  868.          SVGA256(2)          480,000 bytes
  869.          SVGA256(3)          786,432 bytes
  870.          SCREEN 1, 2          16,384 bytes
  871.          ScreenMode(&hex40)   32,768 bytes
  872.          SCREEN 7             32,000 bytes
  873.          ScreenMode(&hexE)    64,000 bytes
  874.          SCREEN 9            112,000 bytes
  875.          ScreenMode(&hexF)    56,000 bytes
  876.          ScreenMode(&hex11)   38,400 bytes
  877.          ScreenMode(&hex12)  153,600 bytes
  878.          SCREEN 13            64,000 bytes
  879.  
  880. Restrictions: You must call IsEMS before using these or any other EMS
  881.               subroutines.
  882.  
  883. Example on next page
  884.  
  885.  
  886. Example:
  887.         call sub "IsEMS",emsflag
  888.         if emsflag = -1 then
  889.           call sub "gsaveems", emshandle, emserror
  890.         endif
  891.  
  892. REM  later in the program...
  893.  
  894.         call sub "gloadems", emshandle, emserror
  895.  
  896.  
  897.  
  898.  
  899.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  900.  
  901. GLOADXMS:     Load a graphics screen from XMS memory to the video buffer.
  902.               Modes supported: All
  903.  
  904. GSAVEXMS:     Save a graphics screen to XMS memory from the video buffer.
  905.               Modes supported: All
  906.  
  907. Parameters:   xmshandle, xmserror
  908.  
  909.               GSaveXMS calculates the screen's mXMory requirements and
  910.               allocates sufficient XMS memory to save the screen.  The
  911.               handle required to re-load the screen and to release the
  912.               XMS memory is my GSaveXMS as xmshandle.  If any XMS errors
  913.               were detected, the error code is returned as xmserror.
  914.  
  915.               GLoadXMS copies the memory block associated with xmshandle
  916.               to the video buffer.  The screen must have been previously
  917.               saved by GSaveXMS.  GLoadXMS and GSaveXMS load to or save
  918.               from the active graphics page.  If no error occurred,
  919.               xmserror = 0.  See the introductory remarks in EMSXMS.DOC
  920.               for XMS error codes.
  921.  
  922.               See also GLoadEMS, GSaveEMS.
  923.  
  924. Restrictions: You must call IsXMS before using these or any other XMS
  925.               subroutines.
  926.  
  927. Example:
  928.               See GLoadEMS and GSaveEMS.
  929.  
  930.  
  931.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  932.  
  933. GPAGE:        Change active and visible graphics page
  934.  
  935.     Modes supported: HGraph (mono and InColor)
  936.                      VGA13X(0 - 2)
  937.                      SCREEN 7
  938.                      ScreenMode(&hexE)
  939.                      ScreenMode(&hexF)
  940.                      SCREEN 9           (256k EGA memory)
  941.  
  942. Parameters:   page, errcode
  943.  
  944.               GPage combines the function of UseGPage and ShowGPage; see
  945.               UseGPage and ShowGPage for further information.
  946.  
  947. Example:
  948.         call sub "gpage", page, errcode
  949.         REM this is equivalent to
  950.         REM  call sub "usegpage", page, errcode
  951.         REM  call sub "showgpage", page, errcode
  952.  
  953.  
  954.  
  955.  
  956.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  957.  
  958. GPRINT:       Print text on a graphics screen
  959.  
  960. Modes supported: All
  961.  
  962. Parameters:   text$, x, y
  963.  
  964.               GPrint offers much more flexibility than ASIC's PRINT command
  965.               when printing text on a graphics screen, and it's the only way
  966.               to print text with many ASILIB graphics modes.  GPrint prints
  967.               a string of text anywhere on the screen in normal, reverse
  968.               video, XOR or "foreground only" modes.
  969.  
  970.               The size of each character and the number of characters across
  971.               the screen depends on the graphics mode:
  972.  
  973.               mode              standard character size    columns
  974.  
  975.               HGraph                8 x 14                    90
  976.               SCREEN 1, 7, 13       8 x 8                     40
  977.               SCREEN 2              8 x 8                     80
  978.               ScreenMode(&hexE)     8 x 8                     80
  979.               SCREEN 4, 9,10,11,12  8 x 14                    80
  980.               VGA13X(0-2)           8 x 14                    40
  981.               VGA13X(3)             8 x 14                    45
  982.               SVGA16(0)             8 x 14                   100
  983.               SVGA16(1), SVGA256(3) 8 x 14                   128
  984.               SVGA256(0 or 1)       8 x 14                    80
  985.               SVGA256(2)            8 x 14                   100
  986.  
  987.               All ASCII characters may be used.  x and y are the PIXEL
  988.               locations of the upper left corner of the first character.
  989.               SmallText, below, allows GPrint to use the smaller 8 x 8
  990.               character in Hercules, VESA6A, XMode16, SCREEN 9-12 and SVGA
  991.               modes.  Legal drawmodes are -2, -1, 0, 1 and 2.
  992.  
  993.               In modes with 8 x 8 characters, you must call SmallText
  994.               sometime before calling GPrint if you use characters greater
  995.               than CHR$(127).
  996.  
  997.               To calculate how many rows of text a graphics screen can
  998.               display, divide maximum Y by pixel rows (i.e., a Hercules
  999.               screen can display 347/8 = 43 rows of text in SmallText mode).
  1000.  
  1001. Example:
  1002.       st$ = "This is an example of text in graphics mode"
  1003.       x = 10
  1004.       y = 20
  1005.       call sub "gprint", text$, x, y
  1006.  
  1007.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1008.  
  1009. GPrintDOWN:   Print text on a graphics screen, from top to bottom
  1010. GPrintUP:     Print text on a graphics screen, from bottom to top
  1011.  
  1012.     Modes supported: same as GPrint
  1013.  
  1014. Parameters:   text$, x, y
  1015.  
  1016.               GPrintUP rotates the string so that text reads from the bottom
  1017.               of the screen to the top.  This is useful for labeling the
  1018.               vertical axis of a graph, among other things.  GPrintDOWN reads
  1019.               from the top of the screen to the bottom.  These subroutines
  1020.               use an 8 x 8 character box, allowing up to 43 characters from
  1021.               the bottom of the screen to the top in Hercules mode.  If you
  1022.               are going to use characters greater than CHR$(127), you must
  1023.               call SmallText some time in your program before calling
  1024.               GPrintDOWN/UP.  However, ASILIB does not need to be in SmallText
  1025.               mode when you call GPrintDOWN or GPrintUP.  All GPrint draw
  1026.               modes are valid.
  1027.  
  1028. Example:
  1029.          call sub "hgraph"
  1030.  
  1031. REM  let GPrintUP know where to find character definitions > CHR$(127)
  1032.          call sub "smalltext"
  1033.              .
  1034.              .
  1035.              .
  1036.          call sub "gprintup", text$, x, y
  1037.  
  1038.  
  1039.  
  1040.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1041.  
  1042.     CALL SUB "GPrintX",st$, x, y
  1043.     CALL SUB "GPrint2X",st$, x, y
  1044.     CALL SUB "GPrintDOWNX",st$, x, y
  1045.     CALL SUB "GPrintDOWN2X",st$, x, y
  1046.     CALL SUB "GPrintUPX",st$, x, y
  1047.     CALL SUB "GPrintUP2X",st$, x, y
  1048.  
  1049.        GPrintX subroutines are similar to GPrint, GPrintUP and GPrintDOWN,
  1050.     except each character in the string st$ is expanded to twice its normal
  1051.     horizontal size before printing it on the screen; this is handy for graph
  1052.     headings.  GPrint2X subroutines expand each character horizontally and
  1053.     vertically; all graphics modes and draw modes supported by GPrint work
  1054.     fine with these expanded character subroutines.  See GPrint for example.
  1055.  
  1056.  
  1057.  
  1058.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1059.  
  1060. LinePattern:  Define an optional pattern for lines drawn by DrawLine
  1061.               Modes supported: All
  1062.  
  1063. Parameters:   pattern$
  1064.  
  1065.               LinePattern passes a string of characters of up to 8 bytes to
  1066.               ASILIB's DrawLine and DrawBox subroutines.  The pattern of
  1067.               bits in pattern$ modify lines so that they are drawn as a
  1068.               series of dots and/or dashes instead of as a solid line.
  1069.               Lines drawn with a pattern will be slower than those drawn
  1070.               without a pattern.  In order to use pattern$, the draw mode
  1071.               must be greater than zero. On monochrome screens, only draw
  1072.               modes 1 and 2 are useful.  LinePattern must be called before
  1073.               each call to DrawLine or DrawBox if it is to work.
  1074.  
  1075.               Draw modes have the following effects:
  1076.  
  1077.                1 = both foreground and background colors are
  1078.                    drawn, obliterating underlying pixels
  1079.                2 = foreground only replaces pre-existing pixels.
  1080.                3 = foreground is ORed with pre-existing pixels
  1081.                4 = foreground is ANDed with pre-existing pixels.
  1082.     
  1083. Example:
  1084.      pattern$ = SPACE$(8)
  1085.      call sub "linepattern", pattern$
  1086.      call sub "drawbox", x0, y0, x1, y1
  1087.  
  1088.  
  1089.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1090.  
  1091. LOADPCX:      Reads and displays a .PCX-format file
  1092.  
  1093. Parameters:   filename$, errcode
  1094.  
  1095.               LOADPCX reads the file filename$ and displays the decoded
  1096.               image on the screen.  LOADPCX does not attempt to determine
  1097.               the appropriate screen mode for the image; your program
  1098.               can do that using ASILIB's PCXINFO subroutine.  Returns with
  1099.               opps <> 0 if a file error occurred.
  1100.  
  1101. Example:
  1102.  
  1103.     REM  horiz is the horizontal resolution of the screen
  1104.     REM  this is 640 for many EGA/VGA 16-color modes
  1105.  
  1106.     REM  vert is the vertical resolution of the screen
  1107.     REM  this is 350 for SCREEN 10 and 480 for SCREEN 12
  1108.  
  1109.     REM  colors is the number of colors encoded in the .PCX file
  1110.     REM  planes = 1 for SCREEN 1, 2 & 13, 4 for all 16-color modes
  1111.     REM  xpix is the number of horizontal pixels in the image
  1112.     REM  ypix is the number of vertical pixels in the image
  1113.  
  1114.     name$ = "\pcx\demo.pcx"
  1115.     CALL sub "pcxinfo", name$, horiz, vert, colors, planes, xpix, ypix, oops)
  1116.  
  1117.     b = &hex12                      ; assume VGA 640 x 480
  1118.     if ypix <= 350 then b = &hex10  ; use 640 x 350 if smaller image
  1119.     if colors = 256 then b = &hex13 ; SCREEN 13 if 256 colors
  1120.     call sub "screenmode",b
  1121.     call sub "loadpcx", name$, pcxerror
  1122.  
  1123.     REM etc.
  1124.  
  1125.  
  1126.  
  1127.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1128.  
  1129. SCREENMODE:   Change screen mode
  1130.  
  1131. Parameters:   modenumber
  1132.  
  1133.               ScreenMode allows graphics or text mode to be set, bypassing
  1134.               ASIC's SCREEN command.  ScreenMode also allows you to use VESA
  1135.               mode &hex6A, which is supported by ASILIB's graphics (or use
  1136.               SVGA16 for other high-resolution 16-color modes).
  1137.  
  1138.               The modenumber parameter is the BIOS mode number for the
  1139.               screen mode (except Hercules - ASILIB uses the Microsoft
  1140.               convention of &hex8 for Hercules since no BIOS mode number
  1141.               exists for Hercules).
  1142.  
  1143.               BIOS mode numbers and the equivalent ASIC SCREEN numbers are:
  1144.  
  1145.               BIOS number      equipment             SCREEN number
  1146.  
  1147.               &hex3            CGA, MCGA, EGA, VGA   SCREEN 0 (text mode)
  1148.               &hex4            CGA, MCGA, EGA, VGA   SCREEN 1
  1149.               &hex5            CGA, MCGA, EGA, VGA   SCREEN 1
  1150.               &hex6            CGA, MCGA, EGA, VGA   SCREEN 2
  1151.               &hex7            Monochrome, Hercules  SCREEN 0 (text mode)
  1152.                                 EGA Monochrome
  1153.               &hex8            Hercules, InColor
  1154.               &hex40           ATT 6300
  1155.               &hexD            EGA, VGA              SCREEN 7
  1156.               &hexE            EGA, VGA
  1157.               &hexF            EGA, VGA (monochrome)
  1158.               &hex10           EGA, VGA              SCREEN 9    128k+ memory
  1159.               &hex11           MCGA, VGA
  1160.               &hex12           VGA
  1161.               &hex13           MCGA, VGA             SCREEN 13
  1162.               &hex6A           VESA SVGA
  1163.  
  1164.               NOTE: ScreenMode is NOT intended for switching between a
  1165.               color monitor and a monochrome monitor.  Use ModeColor and
  1166.               ModeMono for monitor switching.   
  1167.  
  1168. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1169.  
  1170. SCREENORIGIN: control position of re-sized video buffer on screen
  1171.               see also BufferDim
  1172. Supports:     EGA/VGA 16-color modes re-sized with BufferDim
  1173.               VGA13x modes re-sized with BufferDim
  1174.  
  1175. Parameters:   xorigin, yorigin
  1176.  
  1177.               Xorigin and yorigin are the coordinates of the logical
  1178.               video buffer to be displayed at upper-left corner of screen.
  1179.  
  1180. Example:      see BufferDim
  1181.  
  1182.  
  1183.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1184.  
  1185. PALETTE16:    Change color associated with color attribute
  1186.  
  1187. Supports:     EGA and VGA 16-color modes
  1188.  
  1189. Parameters:   attribute, colorvalue
  1190.  
  1191.               PALETTE16 changes the actual color associated with a particular
  1192.               color attribute.  If you call PALETTE16 with attribute and
  1193.               colorvalue both equal to -1, the default colors will be
  1194.               restored.  PALETTE16 works in EGA and VGA 16-color modes,
  1195.               except modes &hex0D and &hex0E.  See also COLOR16.
  1196.  
  1197. Example:
  1198.  
  1199. REM  I want to use a color with low-intensity red
  1200. REM  and high-intensity blue
  1201.         red = 1
  1202.         blue = 3
  1203.         green = 0
  1204.         call sub "color16", red, green, blue, colorvalue
  1205.  
  1206. REM  I'll use color attribute 8 for this color
  1207.         call sub "palette16", 8, colorvalue
  1208.  
  1209.  
  1210.  
  1211.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1212.  
  1213. PALETTE256:   Change color associated with color attribute
  1214.  
  1215. Supports:     256-color modes
  1216.  
  1217. Parameters:   attribute, colorvalue&
  1218.  
  1219.               Similar to PALETTE16, PALETTE256 changes the actual color
  1220.               displayed by a specified color attribute.  Colorvalue& may
  1221.               be calculated from individual red, green and blue intensities
  1222.               using COLOR256.  Note that colorvalue& is a long integer and
  1223.               that ASIC's extended math option is required.
  1224.  
  1225. Restrictions: Requires ASIC's extended math option; 256-color modes only
  1226.  
  1227. Example:
  1228.  
  1229.         red = 63               REM  brightest red
  1230.         green = 10             REM  not much green
  1231.         blue = 32              REM  medium blue intensity
  1232.  
  1233.         call sub "color256", red, green, blue, colorvalue&
  1234.  
  1235. REM  I'll use color attribute 48 for this color
  1236.         call sub "palette256", 48, colorvalue&
  1237.  
  1238.  
  1239.  
  1240.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1241.  
  1242. PCXINFO:      determine vital data about a .PCX-format file
  1243.  
  1244. Parameters:   (input) filename$
  1245.               (output) horiz, vert, colors, planes, xpix, ypix, errcode
  1246.  
  1247.               Reads vital data from the header of a .PCX-format file.
  1248.               From this data you may determine whether you can use the
  1249.               image or what screen mode will work best.
  1250.  
  1251. Example: see LOADPCX
  1252.  
  1253.  
  1254.  
  1255.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1256.  
  1257. PUTDOT:       Write one pixel on graphics screen
  1258.  
  1259.     Modes supported: All
  1260.  
  1261. Parameters:   x, y
  1262.  
  1263.               Sets the pixel at (x, y) according to the specified draw mode
  1264.               and current GColor.  In monochrome modes, legal draw modes are
  1265.               -1, 0, and 1.  Color modes may use draw mode -4 through 4.
  1266.               Coordinates outside the active graphics viewport are ignored.
  1267.  
  1268. Example:
  1269.          x = 10
  1270.          y = 10
  1271.          call sub "putdot", x, y
  1272.  
  1273.  
  1274.  
  1275.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1276.  
  1277.     CALL SUB "ScreenDump", (errcode)
  1278.  
  1279.     Modes supported: HGraph (mono)
  1280.  
  1281.          Prints the active graphics screen on a graphics printer (Epson MX,
  1282.     FX, RX; IBM Graphics Printer, IBM ProPrinter, and compatibles).
  1283.     ScreenDump can be stopped with the ESC key.  If this occurs, errcode = 27
  1284.     is returned (27 is the ASCII character code for the ESC key).  If the
  1285.     computer is not in Hercules graphics mode, errcode = -1.  If all went
  1286.     well, errcode = 0.  Use PrinterReady (EQUIP.DOC) to see if the printer is
  1287.     ready.
  1288.  
  1289. Example:
  1290.          CALL SUB "ScreenDump", (errcode)
  1291.          errormsg$ = ""
  1292.          IF errcode = -1 THEN errmsg$ = "Not Hercules mode"
  1293.          IF errcode = 27 THEN errmsg$ = "Printing stopped"
  1294.          IF errorcode <> 0 THEN
  1295.               PRINT errmsg$
  1296.          ENDIF
  1297.  
  1298.  
  1299.  
  1300.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1301.  
  1302. SHOWGPAGE:    Select displayed page of graphics memory
  1303.  
  1304. Modes supported: HGraph (mono and InColor)    pages 0 and 1
  1305.                  SCREEN 7           pages 0 through 7  (256k EGA memory)
  1306.                  SCREEN 9           pages 0 and 1      (256k EGA memory)
  1307.                  ScreenMode(&hexE)  pages 0 through 3  (256k EGA memory)
  1308.                  ScreenMode(&hexF)  pages 0 and 1      (256k EGA memory)
  1309.                  VGA13X(0)          pages 0 through 3
  1310.                  VGA13X(1)          pages 0 through 2
  1311.                  VGA13X(2)          pages 0 and 1
  1312.  
  1313. Parameters:      gpagenumber, errcode
  1314.  
  1315.                  ShowGPage changes the graph page visible on the screen.
  1316.                  This can be handy for animation or for storing one graph
  1317.                  while another is displayed.  If gpagenumber is too large
  1318.                  for the default mode, errcode = -1.  See also GPage.
  1319.  
  1320. Example:
  1321.          REM  establish Hercules graphics mode
  1322.          REM  allow 2 pages in graphics mode
  1323.          call sub "hgraph"
  1324.          call sub "use64k"
  1325.  
  1326.               .
  1327.               .
  1328.               .
  1329.          REM  now put a graph in the second page
  1330.          gpagenumber = 1
  1331.          call sub "usegpage", gpagenumber, errcode
  1332.  
  1333.               .
  1334.               .
  1335.               .
  1336.          REM  let's look at graph 1 now that it's complete
  1337.          gpagenumber = 1
  1338.          call sub "showgpage", gpagenumber, errcode
  1339.  
  1340.               .
  1341.               .
  1342.          REM  restore default output page
  1343.          REM  and look at graph 0
  1344.          gpagenumber = 0
  1345.          call sub "gpage", gpagenumber, errcode
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1351.  
  1352.     CALL SUB "ShowGPlane",(plane, errcode)
  1353.  
  1354.     Modes supported: all 16-color modes
  1355.                      ScreenMode(&hexF), planes 0 and 2
  1356.  
  1357.         EGA and VGA memory in 16-color modes is arranged in 4 parallel
  1358.     "planes".  The 16 colors available when all planes are visible result
  1359.     from a combination of the data bits in each plane at each data address.
  1360.     The planes, numbered 0, 1, 2 and 3, each control a single color.  With
  1361.     the default palette, plane 0 is blue, plane 1 is green, plane 2 is red
  1362.     and plane 3 is "intensity".  A pixel that appears bright blue in the
  1363.     screen represents pixels at identical locations in the Blue and Intensity
  1364.     planes.  (Note that the actual colors each plane represents may change
  1365.     depending on the use of COLOR and PALETTE statements).  If ShowGPlane
  1366.     doesn't work in the active mode, errcode is returned = -1.
  1367.  
  1368.     The plane parameters are:
  1369.  
  1370.     plane 0    plane = 1
  1371.     plane 1    plane = 2
  1372.     plane 2    plane = 4
  1373.     plane 3    plane = 8
  1374.  
  1375.     Use ASIC's OR operator to show more than one plane; i.e., to
  1376.     show only planes 0 and 3, plane = 1 OR 8.  To restore normal output,
  1377.     plane = 1 OR 2 OR 4 OR 8.
  1378.  
  1379. Example:
  1380.         CALL SUB "ShowGraphPlane",(plane, errcode)
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1386.  
  1387. SETVIEW:      Change active portion of screen
  1388. GETVIEW:      Determine active portion of screen
  1389.  
  1390. Modes supported: All
  1391.  
  1392. Parameters:   (x0, y0) = upper left corner
  1393.               (x1, y1) = lower right corner
  1394.  
  1395.               SetView establishes the active viewport on the active graphics
  1396.               page.  Most ASILIB graphics subroutines limit their output to
  1397.               the active viewport.  GetView returns the viewport coordinates
  1398.               presently active.  ASILIB's default viewport is the entire
  1399.               graphics screen.  If SetView is called with coordinates outside
  1400.               legal bounds (for example, if x1 = 1000), SetView limits the
  1401.               coordinates to the bounds for the active graphics mode (or to
  1402.               Hercules bounds if the system is either not in graphics mode
  1403.               or in an unsupported mode).  This SetView feature is handy for
  1404.               clearing out old view data or for establishing the entire
  1405.               screen as the viewport when the exact limits are variable
  1406.               (such as when using BufferDIM).
  1407.  
  1408. Example:
  1409.          call sub "setview", x0, y0, x1, y1
  1410.  
  1411.  
  1412.  
  1413.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1414.  
  1415. SMALLTEXT:    force GPRINT to use 8x8 character font
  1416. STDTEXT:      force GPRINT to yse 8x14 character font
  1417.  
  1418.     Modes supported: HGraph (mono and InColor)
  1419.                      VESA6A, XMode16, SVGA16, SVGA256
  1420.                      SCREEN 3,9,10,12
  1421.  
  1422.               GPrint may be set to use a smaller 8 x 8 character,
  1423.               which allows up to 43 rows of text in Hercules graphics
  1424.               mode, where StdText (ASILIB's default) results in a maximum
  1425.               25 rows of text.  Once SmallText is called, GPrint will print
  1426.               8 x 8 text until the 8 x 14 character is restored with StdText.
  1427.               8x8 and 8x14 text may be mixed on one screen.
  1428.  
  1429. Example:
  1430.          call sub "hgraph"               REM  establish Hercules graphics mode
  1431.          call sub "smalltext"            REM  sets GPrint to use small text
  1432.          call sub "gprint" a$, x0, y0
  1433.  
  1434.  
  1435.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1436.  
  1437. VGA13X:       Extended 256-color VGA modes
  1438.  
  1439. Requires VGA or better
  1440.  
  1441. Parameters:   modenumber
  1442.  
  1443.               Provides extended VGA 256-color modes.  I have used these
  1444.               modes on PS/2 computers and with a variety of other VGA cards;
  1445.               it should be compatible with most VGA systems.  VGA13X modes
  1446.               provide up to twice the resolution of SCREEN 13, or up to 4
  1447.               pages with resolution identical to SCREEN 13.
  1448.  
  1449.               VGA13X modes are:
  1450.  
  1451.                             horizontal pixels   vertical pixels     pages
  1452.  
  1453.               VGA13X(0)           320                200         0, 1, 2, 3
  1454.               VGA13X(1)           320                240           0, 1, 2
  1455.               VGA13X(2)           320                400             0, 1
  1456.               VGA13X(3)           360                480               0
  1457.  
  1458. Example:
  1459.     REM  make sure we're running on a VGA system
  1460.        call sub "getcrt", crt
  1461.        if crt = 3 then
  1462.            REM  2-page mode
  1463.            call sub "vga13x", 2
  1464.            else
  1465.            print "Vga modes not available"
  1466.        end if
  1467.           .
  1468.           .
  1469.           .
  1470.        REM  all done with graphics, go back to text mode
  1471.  
  1472.        REM  80 x 25 text mode
  1473.        call sub "screenmode", 3
  1474.  
  1475.        REM  clear ASILIB's internal flags
  1476.        call sub "xmodeclear"
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1482.  
  1483. SetDrawmode:  changes default ASILIB graphics operations
  1484.  
  1485. Parameters:   drawmode
  1486.  
  1487.               See introductory remarks in this GRAPHICS.DOC
  1488.  
  1489.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1490.  
  1491. SVGA16:       16-color SVGA modes
  1492.  
  1493. Parameters:   modenumber, errcode
  1494.  
  1495.               SVGA16 sets most super VGA boards in either a 1024x768 16-color
  1496.               mode (modenumber = 1) or an 800x600 16-color mode (modenumber
  1497.               = 0).  Boards supported are:
  1498.  
  1499.               Ahead Technologies
  1500.               ATI
  1501.               Chips & Technologies
  1502.               Everex
  1503.               Genoa GVGA
  1504.               NCR
  1505.               Oak Technologies
  1506.               Paradise (Western Digital)
  1507.               Trident
  1508.               Trident 8900
  1509.               Tseng (Genoa, Orchid, Willow)
  1510.               Tseng 4000
  1511.               VESA standard
  1512.               Video 7
  1513.  
  1514.               SVGA16 returns errcode = -1 if the requested mode is not
  1515.               available on your equipment, errcode = 0 if successful.
  1516.  
  1517.               Most ASILIB subroutines may be used with SVGA16 modes.
  1518.               See documentation for each subroutine.
  1519.  
  1520.               ASILIB's SVGA subroutines are derived from John Bridges'
  1521.               public domain VGAKIT board identification and bank switching
  1522.               code.
  1523.  
  1524. Example:
  1525.  
  1526.        REM  Use SVGA mode if available, mode &hex12 otherwise
  1527.        call sub "svga16", 1, errcode
  1528.        if errcode = -1 then
  1529.           call sub "screenmode", &hex12
  1530.        end if
  1531.  
  1532.  
  1533.  
  1534.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1535.  
  1536. SVGA256:      256-color SVGA modes
  1537.  
  1538. Parameters:   modenumber, errcode
  1539.  
  1540.               SVGA256 is similar to SVGA16, but sets one of several 256-color
  1541.               modes.  Modes available are:
  1542.  
  1543.               modenumber = 3:   1024x768
  1544.               modenumber = 2:    800x600
  1545.               modenumber = 1:    640x480
  1546.               modenumber = 0:    640x400
  1547.  
  1548.               Equipment supported is listed under SVGA16, plus:
  1549.  
  1550.               Compaq (640x480 only)
  1551.  
  1552.               !! DO NOT USE ANY I% VALUES OTHER THAN 0, 1, 2 & 3 !!
  1553.  
  1554.               SVGA256() returns errcode = -1 if the requested mode is not
  1555.               available on your equipment; errcode = 0 if successful.
  1556.  
  1557.               Most ASILIB graphics subroutines may be used with SVGA16 modes.
  1558.               See documentation for each subroutine.
  1559.  
  1560.               ASILIB's SVGA subroutines are derived from John Bridges' public
  1561.               domain VGAKIT board identification and bank switching code.
  1562.  
  1563. Example:
  1564.  
  1565.        REM  Use SVGA mode if available, VGA13X mode otherwise
  1566.        call sub "svga256", 3, errcode
  1567.        if errcode = -1  then
  1568.            call sub "vga13x", 3
  1569.        endif
  1570.  
  1571.  
  1572.  
  1573.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1574.  
  1575. USE32K:       Hercules memory management; restrict to 1 page
  1576. USE64K:       Hercules memory management; allow 2 pages
  1577.  
  1578. Requires Hercules (mono or InColor)
  1579.  
  1580. Parameters:   None
  1581.  
  1582.               USE32K masks the second 32k block of Hercules memory out of the
  1583.               memory map.  If the second 32k is included in the memory map,
  1584.               ASILIB's video routines can use all Hercules screen pages.
  1585.               The second 32k of Hercules video memory conflicts with most
  1586.               color monitors' address space, so USE32K should be used to
  1587.               mask the second 32k out of the memory map for two-monitor
  1588.               systems.  USE64K allows the second block.  ASILIB's default is
  1589.               USE32K.   You MUST call USE64K if you want to use graphics
  1590.               page 1 with Hercules systems.
  1591.  
  1592. Example:
  1593.          call sub "getcrt", crt
  1594.          if crt >= 128 then call sub "use64k"
  1595.  
  1596.  
  1597.  
  1598.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1599.  
  1600.     CALL SUB "UseFont", (fseg, fptr, points, bytes)
  1601.  
  1602.     Supports: all graphics modes with maximum Y > 200
  1603.  
  1604.     UseFont permits use of non-standard fonts with GPrint, GPrintX, GCenter
  1605.     and GCenterX.  The font you wish to use must be somewhere in memory,
  1606.     either "hardwired" into your program or loaded from a disk file.
  1607.  
  1608.     Parameters used when calling UseFont are:
  1609.  
  1610.     fseg = segment address of character definition data
  1611.     fptr = offset address of character definition data
  1612.     points = height of each character on screen (in pixel rows)
  1613.     bytes = byte interval from the start of one character definition
  1614.              to the next
  1615.  
  1616.     ASILIB's GPrint subroutines assume that each character in the font is
  1617.     8 pixels wide.
  1618.     To use character widths other than 8 pixels, use FontWidth.
  1619.     This can be used not only to print properly spaced characters in a
  1620.     font less than 8 bits wide, but may also be used to add extra space
  1621.     between characters in a string.  Note that the character definition
  1622.     data still needs to be 8 bits wide; FontWith's pixel width parameter
  1623.     tells GPRINT how much space to leave between characters.
  1624.  
  1625. Example:
  1626.       REM   I want to use the italic font supplied by Hercules with the
  1627.       REM   InColor Card and Graphics Card Plus.  All Hercules font files
  1628.       REM   have a byte interval of 16, even for those fonts which are
  1629.       REM   less than 16 points high.
  1630.  
  1631.       REM  load font file into far memory
  1632.       filename$ = "C:\RAMFONT\ITALICS.FNT"
  1633.       CALL SUB "FLoad" (filename$, fseg, bytes&, errcode)
  1634.       fptr = 0                       ' Hercules font definitions begin
  1635.                                      ' at the start of the file
  1636.       points = 14                    ' 14-point font
  1637.       bytes = 16
  1638.       CALL SUB "UseFont", (fseg, fptr, points, bytes)
  1639.       CALL FontWidth(10)              REM  add extra space
  1640.  
  1641.       REM  GPrint will now use italics font until SmallText or StdText is
  1642.       REM  is called, or until UseFont is called with another font definition
  1643.       REM  Once you are done with the font, release the far memory with
  1644.       REM  CALL  FreeMem (fseg)
  1645.  
  1646.  
  1647.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1648.  
  1649.     CALL SUB "ForceGMode",(modenumber)
  1650.     CALL SUB "DefGMode"
  1651.  
  1652.       ForceGMode forces ASILIB's graphics subroutines to use a particular
  1653.     graphics mode whether the system is in that mode or not.  This is handy
  1654.     when you want to create an image in an off-screen buffer or on the
  1655.     computer's 2nd monitor while the primary monitor is in text mode.
  1656.     DefGMode causes ASILIB to use the algorithms for the system's active
  1657.     graphics mode.  Mode numbers used with ForceGMode are the same as those
  1658.     used by ScreenMode.
  1659.  
  1660. Example:
  1661.  
  1662.     REM  use Hercules graphics
  1663.       CALL SUB "ForceGMode",(&hex8)
  1664.           .
  1665.           .
  1666.           .
  1667.       CALL SUB "DefGMode"
  1668.  
  1669.  
  1670.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1671.  
  1672.     CALL SUB "UseGPage", (gpage, errcode)
  1673.  
  1674.     Modes supported: HGraph (mono and InColor)    pages 0 and 1
  1675.                      SCREEN 7           pages 0 through 7  (256k EGA memory)
  1676.                      SCREEN 9           pages 0 and 1      (256k EGA memory)
  1677.                      ScreenMode(&hexE)  pages 0 through 3  (256k EGA memory)
  1678.                      ScreenMode(&hexF)  pages 0 and 1      (256k EGA memory)
  1679.                      VGA13X(0)          pages 0 through 3
  1680.                      VGA13X(1)          pages 0 through 2
  1681.                      VGA13X(2)          pages 0 and 1
  1682.  
  1683.          UseGPage changes the screen page used by ASILIB's graphics
  1684.     subroutines.  ASILIB's default gpage is 0.  If multiple pages are not
  1685.     available for the current mode, or gpage is too big, errcode = -1.
  1686.  
  1687. Example:
  1688.          CALL SUB "HGraph"     REM  establish Hercules graphics mode
  1689.                                REM  HGraph calls Use64k
  1690.          gpage = 1
  1691.          CALL SUB "UseGPage", (gpage, errcode)
  1692.                                REM  ASILIB's graphics subroutines use page 1 now
  1693.  
  1694.  
  1695.  
  1696.  
  1697.