home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / maj / 4401 / whats.new < prev   
Text File  |  1993-07-30  |  41KB  |  734 lines

  1.  
  2.                                 Release Notes
  3.  
  4.                              Fastgraph (tm) V3.0
  5.  
  6.                                 July 31, 1993
  7.  
  8.  
  9.  
  10.                              Ted Gruber Software
  11.                                  PO Box 13408
  12.                              Las Vegas, NV  89112
  13.  
  14.                              (702) 735-1980 voice
  15.                               (702) 735-4603 FAX
  16.                               (702) 796-7134 BBS
  17.                                 72000,1642 CIS
  18.  
  19.                  Copyright (c) 1991-1993 Ted Gruber Software.
  20.                              All Rights Reserved.
  21.  
  22.  
  23. ------------------------------------------------------------------------------
  24.                                  Introduction
  25. ------------------------------------------------------------------------------
  26.  
  27. The Fastgraph 3.0 release notes describe the new features added in Fastgraph
  28. 3.00 through 3.02 (hereafter collectively referred to as Fastgraph 3.0).  The
  29. release notes will be of interest to customers who are already familiar with
  30. Fastgraph so they can get an overview of the new version.  Among the many new
  31. features in Fastgraph 3.0 are:
  32.  
  33. * SVGA support for 19 chipsets plus VESA in resolutions of 640x400x256,
  34.   640x480x256, 800x600x256, 1024x768x256, 800x600x16, and 1024x768x16.
  35. * Routines for displaying and creating GIF files (not in Fastgraph/Light).
  36. * Routines for FAST filling of convex polygons, with clipping.
  37. * Low-level keyboard handler, ideal for game development.
  38. * User-definable image buffer (up to 64K) for faster creation and display
  39.   of GIF, PCX, and pixel run files.
  40. * Additional graphics primitives, including XOR points/lines/boxes in all
  41.   graphics modes, filled circles and ellipses, and clipped region fill.
  42. * Bit maps that don't include transparent colors.
  43. * Block transfers between RAM and video memory instead of just video memory
  44.   to video memory.
  45. * Improved ROM text support, including three font sizes (VGA/SVGA) and the
  46.   ability to display strings relative to any graphics position.
  47. * Ability to access up to 1MB video RAM in non-SVGA modes with certain SVGA
  48.   chipsets (see the READ.ME file for more information about this).
  49. * Ability to display PCX images at the position defined in the PCX header
  50.   instead of only relative to the current graphics position.
  51. * Total of 47 new functions.
  52. * Support for additional compilers.
  53.  
  54. The release notes provide an overview of most of these new features.  For
  55. details, refer to the Fastgraph User's Guide and Reference Manual.
  56.  
  57. Please be sure to see the last section of this document, which discusses two
  58. important compatibility considerations when migrating Fastgraph 2.xx programs
  59. to version 3.0.
  60.  
  61. ------------------------------------------------------------------------------
  62.                    Summary of New Routines in Fastgraph 3.0
  63. ------------------------------------------------------------------------------
  64.  
  65. The following routines are new to Fastgraph 3.0.  Please see the Fastgraph
  66. Reference Manual for full descriptions, including their parameters, return
  67. values, and restrictions.
  68.  
  69. FG_BOXW      World space version of FG_BOX
  70. FG_BOXX      Draw hollow rectangle in XOR mode
  71. FG_BOXXW     World space version of FG_BOXX
  72. FG_CIRCLEF   Draw a filled circle
  73. FG_CIRCLEFW  World space version of FG_CIRCLEF
  74. FG_DEFPAGES  Define extended video pages when using block transfer routines
  75. FG_DRAWRELX  Draw line in XOR mode relative to graphics position
  76. FG_DRAWRXW   World space version of FG_DRAWRELX
  77. FG_DRAWX     Draw line in XOR mode
  78. FG_DRAWXW    World space version of FG_DRAWX
  79. FG_ELLIPSEF  Draw a filled ellipse
  80. FG_ELLIPSFW  World space version of FG_ELLIPSEF
  81. FG_FILLPAGE  Fill active video page with the current color
  82. FG_FLOOD     Like FG_PAINT but observes the clipping limits
  83. FG_FLOODW    World space version of FG_FLOOD
  84. FG_FONTSIZE  Enable 8x8, 8x14, or 8x16 ROM font (VGA/SVGA only)
  85. FG_GETBLOCK  Transfer rectangular region from video memory to RAM
  86. FG_GETENTRY  Get address and type of a physical, virtual, or logical page
  87. FG_IMAGEBUF  Define address and size of Fastgraph's GIF/PCX file buffer
  88. FG_INSIDE    Check if a specified point is inside a convex polygon
  89. FG_JUSTIFY   Define justification settings for FG_PRINT
  90. FG_KBINIT    Enable or disable the Fastgraph low-level keyboard handler
  91. FG_KBTEST    Determine if a key is now pressed or released
  92. FG_MAKEGIF   Create GIF file from rectangular region of active video page
  93. FG_MAKEPPR   Create PPR file from rectangular region of active video page
  94. FG_MAKESPR   Create SPR file from rectangular region of active video page
  95. FG_MEMORY    Return amount of video memory present in kilobytes
  96. FG_MOUSEFIN  Unhook Fastgraph's XVGA or SVGA mouse handler
  97. FG_PAGESIZE  Return video page size in bytes
  98. FG_POINTX    Draw point in XOR mode
  99. FG_POINTXW   World space version of FG_POINTX
  100. FG_POLYFILL  Draw filled convex polygon
  101. FG_POLYLINE  Draw unfilled polygon from one vertex array
  102. FG_POLYOFF   Define polygon offsets for FG_POLYFILL and FG_POLYLINE
  103. FG_PRINT     Display hardware characters in screen space
  104. FG_PUTBLOCK  Transfer rectangular region from RAM to video memory
  105. FG_PUTIMAGE  Like FG_DRWIMAGE but doesn't check for transparent pixels
  106. FG_SETENTRY  Set address and type of a physical, virtual, or logical page
  107. FG_SHOWGIF   Display GIF file
  108. FG_SHOWPCX   Display PCX file (formerly FG_DISPPCX)
  109. FG_SHOWPPR   Display packed pixel run (PPR) file
  110. FG_SHOWSPR   Display standard pixel run (SPR) file
  111. FG_SVGAINIT  Initialize Fastgraph's SVGA kernel
  112. FG_SVGASTAT  Return information about the active SVGA chipset
  113. FG_SVGAVER   Return Fastgraph SVGA kernel version number
  114. FG_TCDEFINE  Define transparent color number for FG_TCXFER
  115. FG_WAITVR    Specify if functions wait internally for vertical retrace
  116.  
  117. Note that FG_MAKEGIF, FG_SHOWGIF, and the world space functions are not in
  118. Fastgraph/Light.
  119.  
  120. ------------------------------------------------------------------------------
  121.                              New SVGA Video Modes
  122. ------------------------------------------------------------------------------
  123.  
  124. Six new video modes have been introduced for Fastgraph's SVGA support.  These
  125. are summarized below:
  126.  
  127.         640x400x256   mode 24         1024x768x256   mode 27
  128.         640x480x256   mode 25         800x600x16     mode 28
  129.         800x600x256   mode 26         1024x768x16    mode 29
  130.  
  131. Before you establish an SVGA graphics mode with FG_SETMODE, you must call the
  132. FG_SVGAINIT function.  This new function initializes Fastgraph's SVGA kernel
  133. for a specific SVGA chipset (see the list of supported chipsets in the next
  134. section).  You can use FG_SVGAINIT to automatically detect the system's SVGA
  135. chipset, or you can use a specific chipset.
  136.  
  137. More information about the new SVGA video modes, Fastgraph's SVGA kernel, and
  138. the FG_SVGAINIT routine appears in Chapters 2 and 3 of the Fastgraph User's
  139. Guide.
  140.  
  141. ------------------------------------------------------------------------------
  142.                            Supported SVGA Chipsets
  143. ------------------------------------------------------------------------------
  144.  
  145. As different manufacturers developed SVGA cards, they implemented the SVGA
  146. features according to their own specifications (each unique implementation is
  147. called a "chipset").  This situation arose because of the lack of an SVGA
  148. standard.  Fastgraph 3.0 will directly support the SVGA chipsets listed in
  149. the table below.  A "Y" entry means the chipset supports the video mode, and
  150. an "N" means it doesn't.  The last row of the table shows the amount of video
  151. memory required to support each mode.
  152.  
  153.                         ----------- 256 colors ------------  --- 16 colors ---
  154. SVGA chipset            640x400  640x480  800x600  1024x768  800x600  1024x768
  155. ==============================================================================
  156. Ahead "A" type             Y        Y        Y         N        Y         Y
  157. ------------------------------------------------------------------------------
  158. Ahead "B" type             Y        Y        Y         Y        Y         Y
  159. ------------------------------------------------------------------------------
  160. ATI 18800                  Y        Y        Y         N        Y         N
  161. ------------------------------------------------------------------------------
  162. ATI 18800-1                Y        Y        Y         N        Y         Y
  163. ------------------------------------------------------------------------------
  164. ATI 28800                  Y        Y        Y         Y        Y         Y
  165. ------------------------------------------------------------------------------
  166. Chips & Tech 82c451        Y        N        N         N        Y         N
  167. ------------------------------------------------------------------------------
  168. Chips & Tech 82c452        Y        Y        N         N        Y         Y
  169. ------------------------------------------------------------------------------
  170. Chips & Tech 82c453        Y        Y        Y         Y        Y         Y
  171. ------------------------------------------------------------------------------
  172. Genoa 6000 series          Y        Y        Y         N        Y         Y
  173. ------------------------------------------------------------------------------
  174. Oak OTI-067                N        Y        Y         N        Y         Y
  175. ------------------------------------------------------------------------------
  176. Paradise PVGA1a            Y        Y        N         N        Y         N
  177. ------------------------------------------------------------------------------
  178. Paradise WD90C00/10        Y        Y        N         N        Y         Y
  179. ------------------------------------------------------------------------------
  180. Paradise WD90C11/30/31     Y        Y        Y         Y        Y         Y
  181. ------------------------------------------------------------------------------
  182. S3                         N        Y        Y         Y        Y         Y
  183. ------------------------------------------------------------------------------
  184. Trident 8800               Y        Y        N         N        Y         Y
  185. ------------------------------------------------------------------------------
  186. Trident 8900/8900B/8900C   Y        Y        Y         Y        Y         Y
  187. ------------------------------------------------------------------------------
  188. Tseng ET3000               N        Y        Y         N        Y         Y
  189. ------------------------------------------------------------------------------
  190. Tseng ET4000               Y        Y        Y         Y        Y         Y
  191. ------------------------------------------------------------------------------
  192. Video7                     Y        Y        Y         Y        Y         Y
  193. ==============================================================================
  194. minimum video RAM needed  256      512      512       1MB      256       512
  195. ------------------------------------------------------------------------------
  196.  
  197. ------------------------------------------------------------------------------
  198.                           VESA-compatible SVGA Cards
  199. ------------------------------------------------------------------------------
  200.  
  201. The Video Electronics Standards Association (VESA) has assumed the complex
  202. task of improving the compatibility of SVGA cards from different companies.
  203. Most SVGA cards sold today include VESA compatibility, either directly in ROM
  204. or through software drivers.  Fastgraph 3.0 provides support for any SVGA
  205. card with VESA compatibility.
  206.  
  207. When using VESA compatibility, the VESA BIOS handles all chipset-specific
  208. functions such as bank switching.  The overhead imposed by the BIOS usually
  209. makes the VESA modes slightly slower than using chipset-specific functions
  210. directly.  For this reason, the FG_SVGAINIT routine lets you specify if you
  211. want to give precedence to the chipset-specific SVGA code or to the VESA
  212. BIOS.  Chipset-specific precedence means FG_SVGAINIT will only use the VESA
  213. BIOS if no supported SVGA chipset is found.  Conversely, VESA precedence
  214. means FG_SVGAINIT will only use the chipset-specific functions if no VESA
  215. BIOS is found.
  216.  
  217. VESA implementations for some video cards are more VESA-compatible than
  218. others, especially in areas of page flipping and panning.  Fastgraph has no
  219. way to determine the degree of compatibility for any VESA function.  If an
  220. SVGA program will include VESA support, we recommend also including a method
  221. to select chipset-specific SVGA code.  Problematic VESA drivers are beyond
  222. the control of Fastgraph, of application programmers, and perhaps most
  223. importantly, beyond the control of your program's end users.
  224.  
  225. ------------------------------------------------------------------------------
  226.                            SVGA Read and Write Banks
  227. ------------------------------------------------------------------------------
  228.  
  229. Accessing video memory on an SVGA is controlled through a banking scheme that
  230. maps contiguous 64KB blocks of video memory into a segmented address space.
  231. In other words, referencing a specific byte in video RAM requires a bank
  232. number and an address offset within that bank.  Some SVGA cards provide dual
  233. read and write bank registers, while others perform both operations through
  234. the same bank register.
  235.  
  236. Fastgraph's FG_COPYPAGE, FG_RESTORE, FG_SAVE, FG_TCXFER, and FG_TRANSFER
  237. functions copy rectangular blocks from one part of video memory to another.
  238. If an SVGA card provides separate read and write banks, these functions can
  239. copy the source region directly to the destination region.  However, SVGA
  240. cards that employ a single bank register require that these functions copy
  241. the source region to an intermediate buffer and then copy the buffer contents
  242. to the destination.  This makes the block transfer operation slower,
  243. especially in 16-color SVGA modes.
  244.  
  245. ------------------------------------------------------------------------------
  246.                               SVGA Display Pages
  247. ------------------------------------------------------------------------------
  248.  
  249. Most of the SVGA graphics modes include additional video pages if your SVGA
  250. card has enough video RAM.  The following table shows the number of video
  251. pages available in each mode.
  252.  
  253.         Mode                     Number of pages with....
  254.        Number  Resolution        256KB  512KB  768KB  1MB
  255.  
  256.          24    640x400x256         1      2      3     4
  257.          25    640x480x256         0      1      1     2
  258.          26    800x600x256         0      1      1     2
  259.          27    1024x768x256        0      0      1     1
  260.          28    800x600x16          1      2      3     4
  261.          29    1024x768x16         0      1      1     2
  262.  
  263. Some SVGA chipsets restrict what you can do with video pages beyond page 0.
  264. Certain chipsets let you access the additional pages but do not let you make
  265. them the visual page, while others completely disable some or all of the
  266. extra memory in some video modes.  A few older chipsets have limitations on
  267. page flipping and panning.  These items are discussed in the READ.ME file.
  268.  
  269. ------------------------------------------------------------------------------
  270.                     SVGA Chipset Limitations and Problems
  271. ------------------------------------------------------------------------------
  272.  
  273. This section summarizes the known limitations and problems of the supported
  274. SVGA chipsets.
  275.  
  276. The ATI 18800 chipset restricts horizontal panning to four-pixel increments
  277. in 256-color SVGA modes.  In these modes, FG_PAN will reduce the x position
  278. to a multiple of four pixels.
  279.  
  280. The Genoa 6000 series chipsets do not include the ability to set the display
  281. start address beyond the 16-bit capability provided by the CRT Controller.
  282. This means FG_SETVPAGE is not meaningful in SVGA graphics modes.  Further,
  283. the FG_PAN screen origin is restricted to the first 64K bytes of video memory
  284. in 256-color SVGA modes, and to the first 256K bytes in 16-color SVGA modes.
  285.  
  286. The Genoa 6000 series chipsets restrict horizontal panning to even addresses
  287. in video memory in the 1024x768x16 mode (mode 29).  This means you can pan
  288. only to x coordinates where x modulo 16 is less than 8.
  289.  
  290. The Oak OTI-067 chipset apparently does not include the ability to set the
  291. display start address beyond the 16-bit capability provided by the CRT
  292. Controller.  This means FG_SETVPAGE is not meaningful in SVGA graphics modes.
  293. Further, the FG_PAN screen origin is restricted to the first 64K bytes of
  294. video memory in 256-color SVGA modes, and to the first 256K bytes in 16-color
  295. SVGA modes.
  296.  
  297. The Oak OTI-067 chipset has paging problems in 16-color SVGA modes.  Because
  298. this chipset supports a maximum of 512K video memory, mode 28 is the only
  299. 16-color SVGA mode that is a candidate for additional pages.  However, video
  300. memory beyond 256K is apparently disabled in this mode.
  301.  
  302. All Paradise chipsets restrict horizontal panning to four-pixel increments in
  303. 256-color SVGA modes.  In these modes, FG_PAN will reduce the x position to a
  304. multiple of four pixels.
  305.  
  306. All S3 chipsets restrict horizontal panning to four-pixel increments in 256-
  307. color SVGA modes.  In these modes, FG_PAN will reduce the x position to a
  308. multiple of four pixels.
  309.  
  310. The Trident 8800 chipsets use a unique pixel doubling technique in the 256-
  311. color SVGA modes.  For example, the 640 x 400 mode (mode 24) actually uses a
  312. 1280 x 400 video frame.  This means a multisync monitor is required to use
  313. the two available 256-color modes (24 and 25).  Note that this "feature" only
  314. applies to the Trident 8800 and NOT the 8900 family.
  315.  
  316. Video cards based on the Trident 8900, 8900B, and 8900C chipsets all have
  317. problems accessing video memory beyond 512K in 16-color SVGA modes.  This
  318. means a 1MB Trident card has two pages instead of four in mode 28, and one
  319. page instead of two in mode 29.
  320.  
  321. At least one video card based on the Trident 8900C chipset has problems
  322. accessing video memory beyond 512K in the 640x400 and 640x480 256-color SVGA
  323. modes (in addition to the similar problem in the 16-color SVGA modes for all
  324. Trident chipsets).  Such cards would have two video pages instead of four in
  325. modes 24 and 28, and one page instead of two in modes 25 and 29.  Note that
  326. this problem does not apply to all Trident 8900C cards; the problem has only
  327. been reported on one 8900C-based video card.
  328.  
  329. Video cards based on the Video7 HT208 chipset (i.e., the Video7 VGA 1024i)
  330. have panning problems in all SVGA modes.
  331.  
  332. ------------------------------------------------------------------------------
  333.                          XVGA and SVGA Mouse Support
  334. ------------------------------------------------------------------------------
  335.  
  336. This release offers mouse support for the extended VGA (XVGA) graphics video
  337. modes (modes 20 to 23) and SVGA graphics modes (24 to 29).  In these modes,
  338. Fastgraph displays the mouse cursor through an interrupt handler that is
  339. activated whenever the mouse moves.  The handler is installed when you call
  340. FG_MOUSEINI in modes 20 to 29.
  341.  
  342. If you do not disable this handler before your program exits, strange things
  343. will happen.  More specifically, characters may be invisible, or your system
  344. may hang upon attempting a disk access.  Obviously, these are problems to
  345. avoid.  The FG_MOUSEFIN routine removes Fastgraph's mouse interrupt handler
  346. previously installed with FG_MOUSEINI.  You should call FG_MOUSEFIN just
  347. before restoring the original video mode, as illustrated below:
  348.  
  349.         fg_mousefin();
  350.         fg_setmode(old_mode);
  351.         fg_reset();
  352.         /* now exit to DOS */
  353.  
  354. Note that calling FG_MOUSEFIN is required only in XVGA and SVGA graphics
  355. modes.  Calling it in other video modes is not applicable, though it causes
  356. no problems.
  357.  
  358. In the standard VGA/MCGA 256-color mode (mode 19), white pixels in the mouse
  359. cursor are displayed in color 15.  This is inconsistent with other graphics
  360. modes, where the white pixels are displayed in the highest-numbered color
  361. value available in that mode.  Fastgraph corrects this inconsistency in modes
  362. 20 to 27 by displaying white mouse cursor pixels in color 255.  Like color 15,
  363. color 255 is white by default.  This allows you to redefine color 15 in your
  364. 256-color applications without interfering with the mouse cursor colors.
  365.  
  366. ------------------------------------------------------------------------------
  367.                           Low-Level Keyboard Handler
  368. ------------------------------------------------------------------------------
  369.  
  370. Fastgraph 3.0 includes a new low-level keyboard handler that replaces the
  371. BIOS keyboard handler.  Fastgraph's keyboard handler intercepts keystrokes
  372. ahead of the BIOS and thus eliminates the annoying beep that sounds upon
  373. filling the BIOS keyboard buffer.  The low-level keyboard handler should be
  374. especially well-suited to game development because it increases keyboard
  375. responsiveness in high-speed action games.  However, when the low-level
  376. keyboard handler is enabled, it is not possible to use FG_GETKEY, FG_INTKEY,
  377. or any third party functions that use BIOS or DOS services to access the
  378. keyboard.  For this reason, a program that enables the low-level keyboard
  379. handler must disable it before exiting to DOS.
  380.  
  381. The low-level keyboard handler can be enabled and disabled at any time.  The
  382. FG_KBINIT routine is provided for this purpose.  When it is enabled, you can
  383. use the FG_KBTEST routine to check if keys are currently pressed or released.
  384. FG_KBTEST provides the only mechanism for accessing the keyboard when the
  385. low-level handler is enabled.
  386.  
  387. Please see Chapter 14 of the Fastgraph User's Guide for a full description of
  388. the low-level keyboard handler.
  389.  
  390. ------------------------------------------------------------------------------
  391.                           Some Notes About Polygons
  392. ------------------------------------------------------------------------------
  393.  
  394. Fastgraph's new polygon fill function (FG_POLYFILL) fills convex polygons.  A
  395. polygon is convex if any horizontal line drawn through the polygon crosses the
  396. left edge exactly once and the right edge exactly once (excluding horizontal
  397. and zero-length edge segments).  Note that this definition includes shapes
  398. that are not convex in the traditional sense.  In addition, any non-convex
  399. polygon can be decomposed into two or more convex polygons.
  400.  
  401. The filled convex polygon is a fundamental tool of three-dimensional computer
  402. graphics.  A common practice is to build an image or object from several
  403. adjacent or connecting polygons.  Such polygons typically overlap at one or
  404. more edges.  For instance, the coordinates defining the right edge of one
  405. polygon may also define the left edge of another polygon immediately to its
  406. right.  For an overall image to appear correct, its component polygons must
  407. fit together correctly.  Fastgraph's FG_POLYFILL function applies the
  408. following rules to handle overlapping polygon edges:
  409.  
  410. 1)  Points located exactly on non-horizontal edges are drawn only if the
  411.     polygon's interior is directly to the right.
  412.  
  413. 2)  Points located exactly on horizontal edges are drawn only if the
  414.     polygon's interior is directly below them.
  415.  
  416. 3)  A vertex is drawn only if all lines ending at that point meet the above
  417.     two conditions.
  418.  
  419. These three rules ensure that no pixel is drawn more than once when filling
  420. adjacent polygons.  However, they may not be suitable for displaying polygons
  421. that are not adjacent because some of the pixels on the polygon's edge will
  422. not be included.  If this is an issue, first draw the filled polygon with
  423. FG_POLYFILL, then draw an unfilled polygon having the same vertices with the
  424. FG_POLYLINE function.  Both FG_POLYFILL and FG_POLYLINE honor the current
  425. clipping limits.
  426.  
  427. Refer to Chapter 6 of the Fastgraph User's Guide for more information about
  428. Fastgraph's new polygon routines.
  429.  
  430. ------------------------------------------------------------------------------
  431.                              Extended Video Pages
  432. ------------------------------------------------------------------------------
  433.  
  434. One of the more frequent technical support questions we receive is "I have
  435. one megabyte of memory on my video card, why can I only use the first 256K?".
  436. The answer is simple:  the standard EGA and VGA modes have no way to address
  437. video memory beyond 256K.  Accessing this memory requires SVGA bank switching
  438. techniques.  This is analogous to the fact that you might have four megabytes
  439. of RAM on your system, but without an EMS/XMS memory manager, a DOS extender,
  440. or the like, all that memory won't do much good.
  441.  
  442. Unfortunately, not all SVGA chipsets allow bank switching in non-SVGA video
  443. modes.  For those that do, however, Fastgraph 3.0 includes a last-minute
  444. addition called EXTENDED VIDEO PAGES that provide access to all memory on the
  445. video card in modes 13 to 23 instead of restricting access to the first
  446. 256K.  This means, for example, that a 1MB SVGA card will allow 32 physical
  447. pages in mode 13 rather than the usual 8 pages.  At this time, extended pages
  448. are available with the following SVGA chipsets:
  449.  
  450.         Ahead B (except in mode 19)
  451.         ATI 28800 (except in mode 19)
  452.         Paradise WD90C11/WD90C30/WD90C31
  453.         Tseng ET4000
  454.  
  455. Although extended pages are used in non-SVGA graphics modes, the method of
  456. accessing video memory above 256K is specific to each SVGA chipset.  Thus,
  457. you must initialize Fastgraph's SVGA kernel (with FG_SVGAINIT) before you can
  458. use extended pages.
  459.  
  460. When writing applications that use extended video pages, you should make sure
  461. they are available on the active SVGA chipset and that there is enough video
  462. memory for the number of pages required.  First, verify that FG_SVGAINIT
  463. successfully initializes the SVGA kernel.  If so, use the FG_SVGASTAT routine
  464. to see if the SVGA chipset supports extended pages.  Finally, use FG_MEMORY
  465. to insure that enough video memory is available for the number of video pages
  466. needed.
  467.  
  468. The following table shows the number of video pages available in modes 13 to
  469. 23.
  470.  
  471.                                  Number of Pages With...
  472.                          Mode    256K    512K    1MB
  473.  
  474.                           13       8      16      32
  475.                           14       4       8      16
  476.                           15       2       4       8
  477.                           16       2       4       8
  478.                           17       2       4       8
  479.                           18       2       4       8
  480.                           19       4       8      16
  481.                           20       4       8      16
  482.                           21       2       4       8
  483.                           22       4       8      16
  484.                           23       2       4       8
  485.  
  486. Note that when extended pages are not enabled, the video mode has the number
  487. of physical video pages listed in the 256K column.  The exception to this is
  488. mode 19, which has only one physical page unless extended pages are enabled.
  489.  
  490. Some video modes do not provide the listed number of full video pages.  For
  491. example, modes 17 and 18 normally have two video pages -- one full 640x480
  492. page (page 0) and one partial 640x320 page (page 1).  For extended pages,
  493. Fastgraph uses a page numbering scheme that maintains consistency with its
  494. standard page numbering.  That is, when extended pages are available and mode
  495. 17 or 18 is used on a 1MB video card, the page numbers will range from 0 to
  496. 7, with the even-numbered pages being full pages and the odd-numbered pages
  497. being partial 640x320 pages.  Similarly, in mode 22 pages 3, 7, 11, and 15
  498. are partial (320x80); in mode 23 odd-numbered pages are partial (320x320).
  499. See the Fastgraph User's Guide for more information on partial video pages.
  500.  
  501. When you use Fastgraph's block transfer routines (FG_COPYPAGE, FG_RESTORE,
  502. FG_SAVE, FG_TCXFER, and FG_TRANSFER) with extended pages, you must also use
  503. the new FG_DEFPAGES routine to define the source and destination video pages.
  504. This is needed because the two pages may reside in different SVGA banks, and
  505. bank switching is not performed in Fastgraph's non-SVGA code.  The additional
  506. overhead of having the block transfer routines determine the bank numbers is
  507. not necessary in all cases (see below), and it would also impact the block
  508. transfer routines when extended pages are not being used.
  509.  
  510. Before you use one of the block transfer routines, you must call FG_DEFPAGES,
  511. passing it the source and destination page numbers.  FG_DEFPAGES determines
  512. the SVGA bank numbers in which the source and destination pages reside and
  513. then enables the corresponding banks for reading and writing, respectively.
  514. These banks remain in effect until you define new ones with FG_DEFPAGES or
  515. FG_SETPAGE, so you may not need to call FG_DEFPAGES before every call to a
  516. block transfer routine.  The following table shows the bank numbers for each
  517. video page in each 16-color mode that supports extended pages.
  518.  
  519.                             ---------- Pages in ----------
  520.                     Mode    Bank 0  Bank 1  Bank 2  Bank 3
  521.  
  522.                      13        0-7    8-15   16-23   24-31
  523.                      14        0-3     4-7    8-11   12-15
  524.                      15        0-1     2-3     4-5     6-7
  525.                      16        0-1     2-3     4-5     6-7
  526.                      17        0-1     2-3     4-5     6-7
  527.                      18        0-1     2-3     4-5     6-7
  528.                      20        0-3     4-7    8-11   12-15
  529.                      21        0-1     2-3     4-5     6-7
  530.                      22        0-3     4-7    8-11   12-15
  531.                      23        0-1     2-3     4-5     6-7
  532.  
  533. In mode 19, each of the 16 possible pages is in its own SVGA bank.  That is,
  534. page 0 is in bank 0, page 1 is in bank 1, and so forth.
  535.  
  536. The following code calls FG_DEFPAGES only when needed in mode 13, where each
  537. group of 8 pages resides in its own SVGA bank.  FG_SETMODE enables bank 0
  538. for reading and writing, so we don't need to call FG_DEFPAGES until we
  539. reference a page in one of the other banks (page 10 in this example).
  540.  
  541.         fg_svgainit(0);
  542.         fg_setmode(13);         /* enables bank 0 for reading and writing */
  543.         fg_copypage(0,1);
  544.         fg_copypage(0,2);
  545.         fg_defpages(0,1);       /* page 10 is in bank 1 */
  546.         fg_copypage(2,10);
  547.         fg_defpages(1,1);       /* page 15 is in bank 1 */
  548.         fg_copypage(10,15);
  549.         fg_setpage(0);          /* enables bank 0 for reading and writing */
  550.         fg_erase();
  551.         fg_copypage(0,3);
  552.         fg_defpages(1,0);       /* page 15 is in bank 1 */
  553.         fg_copypage(15,4);
  554.  
  555. FG_DEFPAGES has no effect unless extended pages are enabled.
  556.  
  557. Most mouse drivers know nothing about SVGA bank switching and non-standard
  558. video modes (that's why Fastgraph must hook its own mouse cursor control
  559. handlers into the mouse driver in XVGA and SVGA modes).  As Fastgraph still
  560. programs the mouse driver for cursor control in modes 13 to 19, it is only
  561. possible to display the mouse cursor on video pages in the first SVGA bank
  562. (bank 0) in these modes.  Note that this does not apply to modes 20 to 23,
  563. where Fastgraph controls the mouse cursor through its own handlers.
  564.  
  565. Some SVGA chipsets do not reset the read and write bank numbers back to zero
  566. when establishing a non-SVGA video mode.  When a mode set operation clears
  567. video memory, such chipsets will clear the first video page in whatever write
  568. bank was last selected.  While FG_SETMODE does set the read and write banks
  569. to zero when extended pages are available, it cannot do this before setting
  570. the video mode, which is what normally would clear the screen.  This may
  571. result in artifacts on page 0 after calling FG_SETMODE.  The easiest way
  572. around this problem is to call FG_DEFPAGES(0,0) before restoring the original
  573. video mode in programs that use extended pages.  Even this, however, does not
  574. clear video memory after a mode set when using extended pages with some SVGA
  575. chipsets.  We therefore recommend calling FG_ERASE immediately after calling
  576. FG_SETMODE when using extended pages.
  577.  
  578. Extended pages may be resized (with FG_RESIZE) just as the standard video
  579. pages may in modes 13-18 and 20-23.  However, the resulting pages must not
  580. cross SVGA bank boundaries.  In mode 20, for instance, you normally have four
  581. 320x200 pages in each bank.  You could change the video page size to 640x400,
  582. thereby having four larger pages, one in each bank.  You could not, however,
  583. resize video memory to two 640x800 pages, as each page would span two banks.
  584.  
  585. Again, we developed extended pages as a last-minute addition to Fastgraph
  586. because we've had so many requests for this feature.  Please bear in mind
  587. that the implementation of extended pages in Fastgraph 3.0 is the first
  588. attempt at a solution to our customer's needs.  In the future, we hope to
  589. find ways to support more SVGA chipsets and remove some of the limitations,
  590. especially the restriction on displaying the mouse cursor beyond bank zero.
  591.  
  592. ------------------------------------------------------------------------------
  593.       Optimizations, Improvements, and Corrections to Existing Routines
  594. ------------------------------------------------------------------------------
  595.  
  596. The performance of several existing Fastgraph functions has been improved in
  597. version 3.0.  The most notable of these are FG_DRWIMAGE (in 16-color modes)
  598. and FG_PAINT, both of which provide a performance improvement on the order of
  599. 20% to 25%.
  600.  
  601. The FG_TEXT routine no longer uses the BIOS in modes 13 to 18.  This change
  602. greatly improves the speed of FG_TEXT in these modes.  It also eliminates
  603. the problem where characters were displayed in the wrong colors when a
  604. character's background cell contained pixels of different colors.
  605.  
  606. The FG_PAN routine now supports one-pixel horizontal panning in modes 19 to
  607. 23.  Previously panning was restricted to four-pixel increments in these
  608. video modes.
  609.  
  610. Fastgraph's mouse support routines no longer require the presence of the
  611. mouse driver's EGA Register Interface Library (RIL) when using the mouse in
  612. modes 17 and 18.  Fastgraph will still use the RIL if it is present, as many
  613. mouse drivers rely on the RIL for proper operation.  For mouse drivers such
  614. as the OS/2 mouse driver that do not use the RIL in these modes, Fastgraph
  615. now programs the VGA registers directly, just as when the mouse isn't used.
  616.  
  617. In modes 20 and 21, the video page offsets were changed to prevent the mouse
  618. cursor save area from conflicting with displayable video memory.  This would
  619. cause problems if the last video page (page 3 in mode 20, page 1 in mode 21)
  620. was the visual page and you moved the mouse into the lower right corner of
  621. the screen.  If your code relies on specific page offsets in these modes, the
  622. new page sizes are 3E80 hex for mode 20 and 7D00 hex for mode 21.  The values
  623. in Fastgraph 2.xx were 4000 and 8000 hex respectively.
  624.  
  625. The FG_BESTMODE routine will now propose mode 20 instead of mode 19 when
  626. checking for a 320 x 200 graphics mode on VGA systems.
  627.  
  628. The order of the two FG_BOXDEPTH parameters has been corrected (they were
  629. transposed in Fastgraph 2.xx).
  630.  
  631. The masking map routines (FG_CLIPMASK, FG_DRAWMASK, FG_FLIPMASK, and
  632. FG_REVMASK) now work in all video modes.
  633.  
  634. The CLIP utility no longer requires two video pages, which means it now
  635. supports modes 17, 18, and 23.
  636.  
  637. ------------------------------------------------------------------------------
  638.                           New Turbo Pascal Unit Files
  639. ------------------------------------------------------------------------------
  640.  
  641. Fastgraph 2.xx uses two unit files, FGTP.TPU and FGTPX.TPU.  FGTP.TPU is the
  642. primary Fastgraph unit, while FGTPX.TPU contains the extended Fastgraph
  643. routines listed in Appendix D of the Fastgraph User's Guide.
  644.  
  645. Borland Pascal and Turbo Pascal restrict the total size of all code segments
  646. in a unit file 65,520 bytes.  With the introduction of the SVGA support and
  647. other new features in Fastgraph 3.0, the size of the FGTP.TPU unit file would
  648. have exceeded this limit.  For this reason, the FGTP.TPU file has been split
  649. into several unit files.
  650.  
  651. Fastgraph routines in FGBITMAP.TPU:
  652.  
  653.         FG_CLIPMASK     FG_FLIPMASK     FG_IMAGEBUF     FG_REVIMAGE
  654.         FG_CLPIMAGE     FG_FLPIMAGE     FG_IMAGESIZ     FG_REVMASK
  655.         FG_DRAWMASK     FG_GETBLOCK     FG_PUTBLOCK
  656.         FG_DRWIMAGE     FG_GETIMAGE     FG_PUTIMAGE
  657.  
  658. Fastgraph routines in FGGIF.TPU:
  659.  
  660.         FG_MAKEGIF      FG_SHOWGIF
  661.  
  662. Fastgraph routines in FGMISC.TPU:
  663.  
  664.         FG_BUTTON       FG_INTKEY       FG_MOUSEPOS     FG_SETCAPS
  665.         FG_CAPSLOCK     FG_KBINIT       FG_MOUSEPTR     FG_SETNUM
  666.         FG_CURSOR       FG_KBTEST       FG_MOUSESPD     FG_SOUND
  667.         FG_GETCLOCK     FG_MEASURE      FG_MOUSEVIS     FG_SOUNDS
  668.         FG_GETKEY       FG_MEMAVAIL     FG_MUSIC        FG_SUSPEND
  669.         FG_GETXJOY      FG_MOUSEBUT     FG_MUSICB       FG_VOICE
  670.         FG_GETYJOY      FG_MOUSECUR     FG_NUMLOCK      FG_VOICES
  671.         FG_HUSH         FG_MOUSEFIN     FG_PLAYING      FG_WAITFOR
  672.         FG_HUSHNEXT     FG_MOUSEINI     FG_QUIET        FG_WAITKEY
  673.         FG_INITJOY      FG_MOUSELIM     FG_RESUME
  674.         FG_INTJOY       FG_MOUSEMOV     FG_SCRLOCK
  675.  
  676. Fastgraph routines in FGPCX.TPU:
  677.  
  678.         FG_MAKEPCX      FG_PCXHEAD      FG_PCXMODE      FG_SHOWPCX
  679.  
  680. Fastgraph routines in FGPR.TPU:
  681.  
  682.         FG_DISPFILE     FG_DISPLAYP     FG_MAKESPR      FG_SHOWSPR
  683.         FG_DISPLAY      FG_MAKEPPR      FG_SHOWPPR
  684.  
  685. Fastgraph routines in FGSVGA.TPU:
  686.  
  687.         FG_DEFPAGES     FG_SVGAINIT     FG_SVGASTAT     FG_SVGAVER
  688.         FG_MEMORY
  689.  
  690. Any Fastgraph routine that uses the world space coordinate system is in the
  691. file FGWORLD.TPU (this was formerly FGTPX.TPU).  All other Fastgraph routines
  692. are in the FGMAIN.TPU unit file.
  693.  
  694. The above lists appear in Appendix E of the Fastgraph User's Guide.
  695.  
  696. ------------------------------------------------------------------------------
  697.                    Converting Applications to Fastgraph 3.0
  698. ------------------------------------------------------------------------------
  699.  
  700. Only two features in Fastgraph 2.xx are not upwardly compatible with version
  701. 3.0.  The first applies only to Borland Pascal and Turbo Pascal, while the
  702. second applies to all supported compilers.
  703.  
  704. As described in the previous section, it was necessary to split the FGTP.TPU
  705. unit of Fastgraph 2.xx into several unit files.  Additionally, the FGTPX.TPU
  706. unit is now called FGWORLD.TPU.  Pascal programmers must replace the FGTP and
  707. FGTPX unit names in the USES statement with FGMAIN and FGWORLD, respectively.
  708. If your programs call any of the routines in the other new units, you must
  709. add the appropriate unit names to the USES statement as well.  Please see the
  710. preceding section of this document or Appendix E of the Fastgraph User's
  711. Guide for lists of the Fastgraph routines in each unit file.
  712.  
  713. The other change pertains to the new FG_SHOWPCX function, which replaces the
  714. FG_DISPPCX function of earlier versions (the function was renamed to avoid
  715. confusion with the pixel run display routines, which all have names of the
  716. form FG_DISPxxxx).  In addition, a new bit (bit 2) has been defined in the
  717. routine's flags argument to allow positioning the PCX image at the location
  718. specified in the PCX file header (FG_DISPPCX always displayed PCX files
  719. relative to the current graphics position).  When the position bit is zero,
  720. the PCX image will be displayed at the position defined in the PCX header.
  721.  
  722. PCX image positioning will generally not be an issue for full-screen PCX files
  723. because the PCX header typically defines their upper left corner at the screen
  724. origin, which is where you'd move to display a full-screen image anyway.
  725. However, if a PCX file is smaller than the screen resolution and you want to
  726. override the image positioning in the PCX header, you must define a new
  727. FG_SHOWPCX flags argument in which bit two is set.  That is, the Fastgraph
  728. 2.xx call FG_DISPPCX(filename,0) is equivalent to FG_SHOWPCX(filename,2).
  729. Similarly, FG_DISPPCX(filename,1) is equivalent to FG_SHOWPCX(filename,3).
  730. Note that C programmers can use the following preprocessor directive to make
  731. an old FG_DISPPCX call compatible with the new FG_SHOWPCX function.
  732.  
  733.                   #define fg_disppcx(a,b) fg_showpcx(a,b|2)
  734.