home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / FGL112B.ZIP / USERAPP.DOC < prev   
Text File  |  1992-10-05  |  48KB  |  1,371 lines

  1.  
  2.  
  3. Appendix A
  4.  
  5. Fastgraph Utilities
  6. 258  Fastgraph User's Guide
  7.  
  8.  
  9. Overview
  10.  
  11.      This appendix describes utilities for creating and managing pixel run
  12. files used with the fg_dispfile routine.  By default, the Fastgraph
  13. installation procedure places these utilities in the \FG directory.  To use
  14. these utilities, you must either (1) copy the .EXE file from \FG to your
  15. current directory, (2) make \FG your current directory, or (3) include the
  16. \FG directory in your DOS path specification.
  17.  
  18.  
  19. SNAPSHOT Utility
  20.  
  21.      The SNAPSHOT utility is a terminate and stay resident program (TSR) to
  22. capture graphic images.  It stores the image in Fastgraph's standard pixel
  23. run format.  To load SNAPSHOT, just enter the command SNAPSHOT at the DOS
  24. prompt, and you'll see messages similar to the following if SNAPSHOT loads
  25. successfully.
  26.  
  27.  
  28.         C> SNAPSHOT
  29.  
  30.         SNAPSHOT  Version 1.01
  31.         Copyright (c) 1991 Ted Gruber Software.  All Rights Reserved.
  32.  
  33.         Press <alt>-<left shift> to activate.
  34.  
  35.  
  36.      After SNAPSHOT loads, control returns to the DOS prompt.  At this point,
  37. you can use any method whatsoever to display a graphic image and then press
  38. the Alt and left shift keys at the same time to capture the image.  You don't
  39. need to load SNAPSHOT for each image capture, just once per system boot.
  40. SNAPSHOT uses about 14,000 bytes of conventional memory once loaded.
  41.  
  42.      To illustrate the use of SNAPSHOT, suppose you have drawn and saved an
  43. image with a commercial paint program, and you want to incorporate this image
  44. into a Fastgraph application.  Once you load SNAPSHOT, start the paint
  45. program and retrieve your image.  Then press the Alt and left shift keys
  46. simultaneously and wait for the success tone (three quick medium-pitched
  47. sounds).  Finally, exit the paint program to return to the DOS prompt.
  48.  
  49.      The sequence described in the preceding paragraph will store the
  50. captured image in Fastgraph's standard pixel run format, in a file named
  51. SNAPSHOT.nnn in the current directory.  The file type nnn will be the first
  52. sequence of digits that does not result in a duplicate file name.  That is,
  53. if there are no captured image files in the current directory, SNAPSHOT will
  54. use the file name SNAPSHOT.000.  The next time you capture an image, SNAPSHOT
  55. will store it in SNAPSHOT.001, then SNAPSHOT.002, and so forth.  If you
  56. rename or delete one of these files, SNAPSHOT will again use that file name.
  57. For example, if you delete SNAPSHOT.000 but keep SNAPSHOT.001, SNAPSHOT will
  58. store the next image it captures in SNAPSHOT.000.
  59.  
  60.      If SNAPSHOT is unable to capture the image, it will produce its error
  61. tone (a single low-pitched sound).  The most common cause of this is trying
  62. to capture an image from a text video mode, but it also will occur if there
  63. is not enough disk space or if all 1,000 image file names are already being
  64. used.
  65.                                          Appendix A:  Fastgraph Utilities  259
  66.  
  67.  
  68. CLIP Utility
  69.  
  70.      The SNAPSHOT utility described in the previous section captures the
  71. entire screen.  While this might be desirable in some cases, other times
  72. you'll just need a portion of the screen.  CLIP is an interactive utility
  73. that you can use to reduce the size of any image stored in Fastgraph's
  74. standard or packed pixel run format.  The syntax of the command for invoking
  75. the CLIP utility from the DOS prompt is
  76.  
  77.                      CLIP input_file output_file options
  78.  
  79. where input_file is the name of the original image file, and output_file is
  80. the name of the new image file.  CLIP does not modify the input_file in any
  81. way, but it will overwrite the output_file if an identically named file
  82. exists in the current directory.  The options list specifies one or more
  83. optional switches as shown below.
  84.  
  85.  
  86.                option         meaning
  87.  
  88.                /M:mode   Specifies the video mode number in which to
  89.                          display the image.  The mode value must be an
  90.                          integer between 0 and 23.  If that video mode
  91.                          is a text mode, an unsupported graphics mode,
  92.                          or an unavailable graphics mode, CLIP
  93.                          displays an error message stating this.  If
  94.                          the /M switch is not present, CLIP uses the
  95.                          first available video mode from the list 16,
  96.                          15, 19, 13, 9, 4, 12.
  97.  
  98.                /P        Indicates the input_file is in Fastgraph's
  99.                          packed pixel run format.  If the /P switch is
  100.                          not present, CLIP assumes it is in standard
  101.                          pixel run format.  The output_file will be in
  102.                          the same format as the input_file.
  103.  
  104.                /W:width  Specifies the image width in pixels.  The
  105.                          width value must be an integer between 1 and
  106.                          the horizontal resolution of the selected
  107.                          video mode.  If the /W switch is not present,
  108.                          CLIP uses the horizontal resolution of the
  109.                          selected video mode.
  110.  
  111. For example, if you wanted to create the image file PARTIAL.PPR from the
  112. packed pixel run file SCREEN.PPR, and use the native 320 by 200 EGA graphics
  113. video mode (mode 13), you would start CLIP with the following command.
  114.  
  115.                      CLIP PARTIAL.PPR SCREEN.PPR /P /M:13
  116.  
  117. Because no /W switch appears in the above command and the horizontal
  118. resolution of mode 13 is 320 pixels, CLIP assumes the image width is 320
  119. pixels.
  120. 260  Fastgraph User's Guide
  121.  
  122.  
  123.      When CLIP displays the image and the plus-shaped cursor, you are ready
  124. to define one corner of the clipping region (that part of the image used to
  125. create the output_file).  To do this, use the directional keys on the numeric
  126. keypad to move the cursor to the desired position, then press the Enter key.
  127. You are then ready to define the clipping region's opposite corner.  Again,
  128. use the directional keys to move the cursor to the desired position.  When
  129. defining the second corner, however, CLIP uses a rectangular box instead of
  130. the plus-shaped cursor to simplify marking the clipping region's boundaries.
  131. After you press Enter to define the second corner, CLIP creates the
  132. output_file and displays the resulting image width and the number of pixel
  133. runs the image contains.
  134.  
  135.      CLIP includes some features that may help you define the clipping
  136. region.  You can change the distance the cursor moves in response to the
  137. directional keys, display the current (x,y) pixel coordinates of the cursor,
  138. and change the cursor color.  The following table explains the keystrokes
  139. that CLIP recognizes when you are defining the clipping region.
  140.  
  141.                key       meaning
  142.  
  143.                F1        Displays the (x,y) coordinate bar at the top
  144.                          of the screen.  If the coordinate bar is
  145.                          already on, F1 removes it.
  146.                F2        Displays the (x,y) coordinate bar at the
  147.                          bottom of the screen.  If the coordinate bar
  148.                          is already on, F2 removes it.
  149.                F3        Changes the cursor or box color from white to
  150.                          black, or from black to white.
  151.                F4        Displays a summary of the keys CLIP
  152.                          recognizes when defining the clipping region.
  153.                KP1       Moves the cursor one unit down and to the
  154.                          left.
  155.                KP2       Moves the cursor one unit down.
  156.                KP3       Moves the cursor one unit down and to the
  157.                          right.
  158.                KP4       Moves the cursor one unit to the left.
  159.                KP6       Moves the cursor one unit to the right.
  160.                KP7       Moves the cursor one unit up and to the left.
  161.                KP8       Moves the cursor one unit up.
  162.                KP9       Moves the cursor one unit up and to the
  163.                          right.
  164.                +         Increases the unit of cursor movement by one
  165.                          pixel.  The default cursor movement is one
  166.                          pixel.
  167.                -         Decreases the unit of cursor movement by one
  168.                          pixel.
  169.                Enter     Defines a corner of the clipping region
  170.                          at the cursor position.
  171.                Esc       Exits to DOS without creating the
  172.                          output_file.  CLIP will first issue an "Exit
  173.                          to DOS?" prompt in case you pressed the Esc
  174.                          key accidentally.
  175.                                          Appendix A:  Fastgraph Utilities  261
  176.  
  177.      The CLIP utility requires two video pages to run.  Thus, you cannot use
  178. it in video modes 17, 18, and 23 because they have only one physical video
  179. page and no virtual video pages.
  180.  
  181.  
  182. CONVERT Utility
  183.  
  184.      The CONVERT utility lets you translate files between Fastgraph's
  185. supported image file formats.  The syntax of the command for invoking CONVERT
  186. from the DOS prompt is
  187.  
  188.                         CONVERT input_file output_file
  189.  
  190. where input_file is the name of the original image file, and output_file is
  191. the name of the new translated image file.  CONVERT does not modify the
  192. input_file in any way, but it will overwrite the output_file if an
  193. identically named file exists in the current directory.
  194.  
  195.      By default, the file type of the input_file and output_file determine
  196. the image format of that file.  If the file type is .PPR, CONVERT assumes the
  197. image is in Fastgraph's packed pixel run format.  If the file type is .SPR,
  198. CONVERT assumes it is in the Fastgraph's standard pixel run format.  If your
  199. image files use other file types, you can explicitly specify the file's image
  200. format by appending one of the switches /PPR or /SPR to the file name.  The
  201. input_file and output_file must not both specify the same image format
  202. (CONVERT will display an error message if this is so).
  203.  
  204.      The following command will translate the standard pixel run file
  205. PICTURE.SPR to packed format.  The packed image will be stored in the file
  206. PICTURE.IMG, so we must append the switch /PPR to tell CONVERT that it will
  207. be a packed file.
  208.  
  209.                      CONVERT PICTURE.SPR PICTURE.IMG/PPR
  210.  
  211.  
  212. EDITSPR Utility
  213.  
  214.      The EDITSPR utility changes all pixel runs of one color to another color
  215. in an image file stored in Fastgraph's standard pixel run (.SPR) format.  The
  216. syntax of the command for invoking the EDITSPR utility from the DOS command
  217. prompt is
  218.  
  219.                         EDITSPR input_file output_file
  220.  
  221. where input_file is the name of the original image file, and output_file is
  222. the name of the new image file.  EDITSPR does not modify the input_file in
  223. any way, but it will overwrite the output_file if an identically named file
  224. exists in the current directory.
  225.  
  226.      After it reads the pixel runs from the input_file, EDITSPR will perform
  227. the requested color changes.  It does this iteratively by asking for an old
  228. color value followed by a new color value (each value must be between 0 and
  229. 262  Fastgraph User's Guide
  230.  
  231. 255).  EDITSPR then finds the pixel runs of the old color value and changes
  232. them to the new color value.  Following this, EDITSPR displays a message
  233. stating how many pixel runs it changed.  This process repeats until you enter
  234. a negative number for either color value.
  235.  
  236.      EDITSPR will next combine adjacent pixel runs of like colors.  For
  237. example, suppose the original image file contained a color 1 pixel run of
  238. length 50, followed by a color 2 pixel run of length 20, followed by another
  239. color 1 pixel run of length 10.  If you changed all color 2 pixel runs to
  240. color 1, EDITSPR will combine these three pixel runs into a single run of
  241. length 80.
  242.  
  243.      Finally, EDITSPR will close the output_file.
  244.  
  245.  
  246. GrabRGB Utility
  247.  
  248.      The GrabRGB utility is a terminate and stay resident program (TSR) to
  249. capture the current red, green, and blue color components of video DAC
  250. registers in the 256-color MCGA and VGA graphics modes.  You can use GrabRGB
  251. together with Fastgraph's SNAPSHOT utility to preserve the original colors of
  252. a captured image.
  253.  
  254.      To load GrabRGB, just enter the command GRABRGB at the DOS prompt.
  255. After GrabRGB loads, control returns to the DOS prompt.  At this point, you
  256. can use any method whatsoever to display a 256-color graphic image and then
  257. press the Alt and right shift keys at the same time to capture the current
  258. DAC values.  You don't need to load GrabRGB for each image, just once per
  259. system boot.  GrabRGB uses about 15,000 bytes of conventional memory once
  260. loaded.
  261.  
  262.      To illustrate the use of GrabRGB, suppose you have drawn and saved a
  263. 256-color image with a commercial paint program, and you want to incorporate
  264. this image into a Fastgraph application.  Once you load SNAPSHOT and GrabRGB,
  265. start the paint program and retrieve your image.  Then press the Alt and left
  266. shift keys to capture the image with SNAPSHOT.  After SNAPSHOT's success tone
  267. (three quick medium-pitched sounds), press Alt and right shift to capture the
  268. RGB components of each DAC register with GrabRGB, and wait for GrabRGB's
  269. success tone.  Finally, exit the paint program and return to the DOS prompt.
  270.  
  271.      The sequence described in the preceding paragraph will write the RGB
  272. color components for each DAC register to a file named GRABRGB.nnn in the
  273. current directory.  The file type nnn will be the first sequence of digits
  274. that does not result in a duplicate file name.  That is, if there are no
  275. GrabRGB output files in the current directory, GrabRGB will use the file name
  276. GRABRGB.000.  The next time you use GrabRGB, it will store the RGB
  277. information in GRABRGB.001, then GRABRGB.002, and so forth.  If you rename or
  278. delete one of these files, GrabRGB will again use that file name.  For
  279. example, if you delete GRABRGB.000 but keep GRABRGB.001, GrabRGB will next
  280. use the file name GRABRGB.000.
  281.  
  282.      If GrabRGB is unable to obtain the RGB components of each DAC register,
  283. it will produce its error tone (a single low-pitched sound).  The most common
  284. cause of this is trying to capture an image from a text video mode, or from a
  285. graphics video mode with fewer than 256 colors.  It also will occur if there
  286. is not enough disk space or if all 1,000 output file names are already being
  287. used.
  288.                                          Appendix A:  Fastgraph Utilities  263
  289.  
  290.      Each line in the output file created by GrabRGB is of the form
  291.  
  292.                                 nnn,rr,gg,bb,
  293.  
  294. where nnn is a DAC register index (between 0 and 255), rr is the red
  295. component of that DAC register, gg is the green component, and bb is the blue
  296. component.  Each color component is between 0 and 63.  You can edit and
  297. reformat these lines as necessary for inclusion in a C initializer list, a
  298. QuickBASIC or FORTRAN data statement, or a Turbo Pascal array-type constant
  299. list.  Such an array of RGB components, but without the nnn indices, is in
  300. the format expected by fg_setdacs.
  301.  
  302.      By default, GrabRGB captures information for all 256 DAC registers.  If
  303. you want to consider only the DAC registers with color components different
  304. from their initial values, just include the /D option when you load GrabRGB
  305. (that is, use the command GRABRGB /D).  If you specify the /D option and all
  306. 256 DACs use their default values, the output file will contain a message
  307. stating this.
  308.  
  309.  
  310. HERCFIX Utility
  311.  
  312.      The HERCFIX utility allows you to use SNAPSHOT (and possibly other TSRs)
  313. with programs that do not update the BIOS data area when establishing the
  314. 720x348 Hercules graphics mode.  If you use SNAPSHOT with such a program, it
  315. will think the monochrome text mode (video mode 7) is active and will produce
  316. its low-pitched error tone when activated.
  317.  
  318.      If this occurs, use HERCFIX to load the application from which you are
  319. trying to capture the image.  To do this, enter
  320.  
  321.                                HERCFIX command
  322.  
  323. at the DOS prompt, where command is the command that starts the application.
  324. For example, suppose you use the command PAINTER /H to run a commercial paint
  325. program in Hercules graphics mode.  To load the paint program with HERCFIX,
  326. you would enter the command HERCFIX PAINTER /H.
  327. 264  Fastgraph User's Guide
  328.  
  329.  
  330. Appendix B
  331.  
  332. Using Fastgraph
  333. from Assembly Language
  334. 266  Fastgraph User's Guide
  335.  
  336.  
  337.      Fastgraph uses the same naming and calling conventions as Microsoft C
  338. and Turbo C.  The details of these conventions that are important to assembly
  339. language programming are summarized below.  If you are calling Fastgraph
  340. routines from an assembly language program, the program must follow these
  341. conventions.
  342.  
  343.        All arrays and pointers are passed by reference
  344.        All other items are passed by value
  345.        Arguments are pushed onto the stack in reverse order
  346.        16-bit function values are returned in the AX register
  347.        32-bit function values are returned in the DX:AX register pair
  348.        Fastgraph routine names are prefixed with an underscore character
  349.  
  350. The small and medium model Fastgraph libraries pass arrays and pointers by
  351. near reference, while the large model library does so by far reference.  This
  352. is consistent with the run-time libraries for the supported compilers.
  353.  
  354.      All Fastgraph routines preserve the BP, DS, DI, and SI registers.  The
  355. contents of any other registers are unknown upon return from a Fastgraph
  356. routine (except for the AX register, which will either contain zero or the
  357. routine's return value).
  358.  
  359.      The following DOS commands show how to assemble a program (using the
  360. Microsoft Macro Assembler) and then link it with Fastgraph.  In all cases,
  361. we'll assume the file EXAMPLE.ASM contains the source code for the program.
  362. The resulting executable file will be called EXAMPLE.EXE.
  363.  
  364.                               small memory model
  365.  
  366.                     MASM EXAMPLE.ASM;
  367.                     LINK /CP:4096 /E EXAMPLE,,NUL.MAP,FGS
  368.  
  369.  
  370.                              medium memory model
  371.  
  372.                     MASM EXAMPLE.ASM;
  373.                     LINK /CP:4096 /E EXAMPLE,,NUL.MAP,FGM
  374.  
  375.  
  376.                               large memory model
  377.  
  378.                     MASM EXAMPLE.ASM;
  379.                     LINK /CP:4096 /E EXAMPLE,,NUL.MAP,FGL
  380.  
  381.  
  382.      Example B-1 calls the fg_getmode, fg_setmode, fg_reset, and fg_version
  383. routines from an assembly language program.  The fg_getmode routine returns
  384. its function value in the AX register.  The fg_setmode routine has a single
  385. argument, while fg_reset has no arguments.  The fg_version routine has two
  386. arguments, both passed by reference.  Notice how they are pushed on the stack
  387. in reverse order.  This example would work with either the medium or large
  388. memory model Fastgraph libraries.  To make it work with the small model
  389. library, all you would need to do is change the word "far" to "near" in the
  390. EXTRN declarations, and change the name of the code segment from "main_TEXT"
  391. to "_TEXT".
  392.                       Appendix B:  Using Fastgraph from Assembly Language  267
  393.  
  394.  
  395.                                  Example B-1.
  396.  
  397.                 EXTRN   _fg_getmode:far  ; Fastgraph's GETMODE routine
  398.                 EXTRN   _fg_reset:far    ; Fastgraph's RESET routine
  399.                 EXTRN   _fg_setmode:far  ; Fastgraph's SETMODE routine
  400.                 EXTRN   _fg_version:far  ; Fastgraph's VERSION routine
  401.  
  402.       stackseg  SEGMENT stack         ; suppress the linker's
  403.       stackseg  ENDS                  ; "no stack segment" error message
  404.  
  405.       _DATA     SEGMENT word public 'DATA'
  406.  
  407.       major     dw      ?             ; major version number
  408.       minor     dw      ?             ; minor version number
  409.       old_mode  dw      ?             ; original video mode
  410.  
  411.       _DATA     ENDS
  412.  
  413.       dgroup    GROUP   _DATA
  414.                 ASSUME  cs:main_TEXT,ds:dgroup
  415.  
  416.       main_TEXT SEGMENT byte public 'CODE'
  417.  
  418.       start:    mov     ax,_DATA      ; load segment location
  419.                 mov     ds,ax         ; into DS register
  420.  
  421.                 call    _fg_getmode   ; AX = current video mode
  422.                 mov     old_mode,ax   ; save it
  423.  
  424.                 mov     ax,4          ; use video mode 4
  425.                 push    ax            ; pass argument to SETMODE
  426.                 call    _fg_setmode   ; establish CGA four-color mode
  427.                 add     sp,2          ; remove SETMODE argument
  428.  
  429.                 push    old_mode      ; pass argument to SETMODE
  430.                 call    _fg_setmode   ; restore original video mode
  431.                 add     sp,2          ; remove SETMODE argument
  432.  
  433.                 call    _fg_reset     ; restore screen attributes
  434.  
  435.                 lea     ax,minor      ; get address of minor variable
  436.                 push    ax            ; pass argument #2 to VERSION
  437.                 lea     ax,major      ; get address of major variable
  438.                 push    ax            ; pass argument #1 to VERSION
  439.                 call    _fg_version   ; get the Fastgraph version number
  440.                 add     sp,4          ; remove VERSION arguments
  441.  
  442.                 mov     ah,76         ; function 76: terminate process
  443.                 xor     al,al         ; errorlevel 0
  444.                 int     21h           ; exit to DOS
  445.  
  446.       main_TEXT ENDS
  447.                 END     start
  448.  
  449. 268  Fastgraph User's Guide
  450.  
  451.  
  452. Appendix C
  453.  
  454. Interrupts and Fastgraph
  455. 270  Fastgraph User's Guide
  456.  
  457. Interrupts Used by Fastgraph
  458.  
  459.      DOS maintains an interrupt vector table that contains the addresses of
  460. 256 interrupt handlers, or routines, that perform various functions.  The
  461. handlers are usually referenced by their hexadecimal interrupt number,
  462. between 00 and FF.  Of these, only interrupts 60 through 66 and F1 through FF
  463. are not used by DOS, the ROM BIOS, or other software and are thus available
  464. for user applications.
  465.  
  466.      Certain Fastgraph routines use some of the available interrupts.
  467. Namely, the fg_music routine uses interrupt 60, the asynchronous sound
  468. routines (fg_musicb, fg_sounds, and fg_voices) use interrupts 60 and 61, and
  469. all Fastgraph/Light routines use interrupt 62.  If your program defines its
  470. own interrupt handlers, it must not use any of the interrupts reserved for
  471. Fastgraph (unless, of course, it doesn't use any of the Fastgraph routines
  472. that would create a conflict).
  473.  
  474.  
  475. Extending the Time-of-Day Interrupt
  476.  
  477.      As mentioned in Chapter 14, the BIOS time-of-day clock is incremented by
  478. an interrupt handler.  The routine that does this is interrupt 08, a hardware
  479. interrupt automatically activated 18.2 times per second.  After incrementing
  480. the clock, interrupt 08 invokes interrupt 1C, which by default references a
  481. "do-nothing" interrupt handler.  While changing interrupt 08 can be tricky,
  482. it is fairly straightforward to define our own handler for interrupt 1C.
  483. This handler also will be executed automatically 18.2 times per second.
  484. Example C-1 illustrates how to do this.
  485.  
  486.      When we discussed joysticks in Chapter 12, we said there were two ways
  487. to monitor joystick button status.  One is to intersperse calls to the
  488. fg_button routine at strategic places in your program and then take necessary
  489. action depending on the button status.  However, the problem with this scheme
  490. is the chance of missing a button press -- if you press the joystick button
  491. and then release it between calls to fg_button, the program will not detect
  492. the joystick activity.  A preferable method is to call fg_button from a
  493. handler for interrupt 1C, which essentially provides continuous monitoring of
  494. the joystick buttons.  When we need the button status within our program, all
  495. we need to do is examine a global variable.
  496.  
  497.      Example C-1 consists of a main program (written in C) and an assembly
  498. language subroutine named int1C (suitable for the medium memory model).  The
  499. main program calls int1C to define a handler for interrupt 1C.  In response
  500. to any keystroke (except Escape), the program displays the button press
  501. information for each joystick since the previous keystroke (refer to the
  502. discussion of the fg_button routine for the meanings of the status values).
  503. When you press the Escape key, the program exits to DOS, but not before
  504. calling int1C to restore the original interrupt 1C handler.
  505.  
  506.                          Example C-1 (main program).
  507.  
  508.                #include <fastgraf.h>
  509.                #include <stdio.h>
  510.                void main(void);
  511.  
  512.                #define ESC 27
  513.  
  514.                                     Appendix C:  Interrupts and Fastgraph  271
  515.  
  516.                int status1, status2;
  517.  
  518.                void main()
  519.                {
  520.                   unsigned char key, aux;
  521.  
  522.                   int1C(1);
  523.  
  524.                   status1 = 0;
  525.                   status2 = 0;
  526.  
  527.                   do {
  528.                      printf("\n");
  529.                      printf("Joystick 1 status: %d\n",status1);
  530.                      printf("Joystick 2 status: %d\n",status2);
  531.                      status1 = 0;
  532.                      status2 = 0;
  533.                      fg_getkey(&key,&aux);
  534.                      }
  535.                   while (key != ESC);
  536.  
  537.                   int1C(0);
  538.                }
  539.  
  540.  
  541.      We'll now examine the int1C assembly language subroutine.  It actually
  542. consists of three parts:  a portion to enable our interrupt handler, our
  543. handler itself, and a portion to disable the handler.  When we call int1C
  544. with a nonzero argument, it saves the original data segment (so we can access
  545. the global variables within the handler), saves the original handler's
  546. address (called the vector) for interrupt 1C, and then enables our handler,
  547. which takes the form of a far procedure.
  548.  
  549.      The handler routine then begins to be activated at 18.2 times per
  550. second.  After saving all the important registers, the handler calls the
  551. Fastgraph routine fg_button twice, once for each joystick.  The return values
  552. are logically ORed with the status1 and status2 C global variables to update
  553. the button status information.  Finally, the handler restores the original
  554. registers and returns control to the point of the interrupt.
  555.  
  556.      Before the main program exits, it calls int1C with a zero argument to
  557. restore the original handler for interrupt 1C.  No provision is made in the
  558. program to check if we had previously defined our own handler (and hence
  559. saved the original interrupt 1C vector), but this could be added with little
  560. difficulty.
  561.  
  562.                  Example C-1 (assembly language subroutine).
  563.  
  564.  
  565.              EXTRN   _status1:word ; C global variable for button 1 status
  566.  
  567.              EXTRN   _status2:word ; C global variable for button 2 status
  568.  
  569.              EXTRN   _fg_button:far ; Fastgraph routine
  570.  
  571. 272  Fastgraph User's Guide
  572.  
  573.   int1C_TEXT SEGMENT byte public 'CODE'
  574.  
  575.              ASSUME  cs:int1C_TEXT
  576.  
  577.  
  578.   int1C_CS   dw      ?             ; holds original INT 1C segment address
  579.  
  580.   int1C_IP   dw      ?             ; holds original INT 1C offset
  581.  
  582.   orig_DS    dw      ?             ; holds original data segment
  583.  
  584.  
  585.  
  586.   _int1C     PROC    far
  587.  
  588.              PUBLIC  _int1C
  589.  
  590.  
  591.  
  592.              push    bp            ; save caller's BP register
  593.  
  594.              mov     bp,sp         ; make BP point to argument list
  595.  
  596.              push    si            ; save caller's SI register
  597.  
  598.              push    di            ; save caller's DI register
  599.  
  600.  
  601.  
  602.              mov     dx,[bp+6]     ; get the flag parameter
  603.  
  604.              or      dx,dx         ; replace the old interrupt handler?
  605.  
  606.              jz      replace       ; yes, branch to that processing
  607.  
  608.  
  609.  
  610.   ; define a new handler for INT 1C
  611.  
  612.  
  613.  
  614.   define:    mov     ax,ds         ; put current data segment in AX
  615.  
  616.              mov     cs:orig_DS,ax ; save it in the control information area
  617.  
  618.  
  619.  
  620.              mov     al,1Ch        ; interrupt vector to save
  621.  
  622.              mov     ah,53         ; function 53: get interrupt vector
  623.  
  624.              int     21h           ; get the interrupt vector
  625.  
  626.              mov     cs:int1C_CS,es; save the segment
  627.  
  628.              mov     cs:int1C_IP,bx; save the offset
  629.  
  630.                                     Appendix C:  Interrupts and Fastgraph  273
  631.  
  632.  
  633.  
  634.              push    ds            ; save our DS register
  635.  
  636.              mov     dx,offset handler ; get offset of interrupt handler
  637.  
  638.              mov     ax,seg handler; get segment of interrupt handler
  639.  
  640.              mov     ds,ax         ; put it in DS
  641.  
  642.              mov     al,1Ch        ; interrupt vector to change
  643.  
  644.              mov     ah,37         ; function 37: set interrupt vector
  645.  
  646.              int     21h           ; change the INT 1C vector to our handler
  647.  
  648.              pop     ds            ; restore our DS register
  649.  
  650.  
  651.  
  652.              jmp     short return  ; return to the caller
  653.  
  654.  
  655.  
  656.   ; replace the original handler for INT 1C
  657.  
  658.  
  659.  
  660.   replace:   push    ds            ; save our DS register
  661.  
  662.              mov     dx,cs:int1C_IP; put original INT 1C offset in DX
  663.  
  664.              mov     ds,cs:int1C_CS; put original INT 1C segment in DS
  665.  
  666.              mov     ah,37         ; function 37: set interrupt vector
  667.  
  668.              mov     al,1Ch        ; interrupt vector 1C
  669.  
  670.              int     21h           ; restore original INT 1C vector
  671.  
  672.              pop     ds            ; restore our DS register
  673.  
  674.  
  675.  
  676.   return:    xor     ax,ax         ; in case int1C was called as a function
  677.  
  678.              pop     di            ; restore our DI register
  679.  
  680.              pop     si            ; restore our SI register
  681.  
  682.              pop     bp            ; restore our BP register
  683.  
  684.              ret
  685.  
  686.  
  687.   _int1C     ENDP
  688.  
  689. 274  Fastgraph User's Guide
  690.  
  691.  
  692.  
  693.   handler    PROC    far           ; interrupt handler that replaces INT 1C
  694.  
  695.  
  696.  
  697.              cli                   ; disable interrupts while handler active
  698.  
  699.              push    ax            ; save registers that may be altered
  700.  
  701.              push    bx
  702.  
  703.              push    cx
  704.  
  705.              push    dx
  706.  
  707.              push    di
  708.  
  709.              push    si
  710.  
  711.              push    ds
  712.  
  713.              push    es
  714.  
  715.  
  716.  
  717.              mov     ds,cs:orig_DS ; retrieve the original data segment
  718.  
  719.  
  720.  
  721.              mov     ax,1          ; use joystick 1
  722.  
  723.              push    ax            ; pass joystick number to button routine
  724.  
  725.              call    _fg_button    ; AX = button status for joystick 1
  726.  
  727.              add     sp,2          ; remove the argument
  728.  
  729.              or      _status1,ax   ; update status variable for joystick 1
  730.  
  731.  
  732.  
  733.              mov     ax,2          ; use joystick 2
  734.  
  735.              push    ax            ; pass joystick number to button routine
  736.  
  737.              call    _fg_button    ; AX = button status for joystick 2
  738.  
  739.              add     sp,2          ; remove the argument
  740.  
  741.              or      _status2,ax   ; update status variable for joystick 2
  742.  
  743.  
  744.  
  745.              pop     es            ; restore altered registers
  746.  
  747.                                     Appendix C:  Interrupts and Fastgraph  275
  748.  
  749.              pop     ds
  750.  
  751.              pop     si
  752.  
  753.              pop     di
  754.  
  755.              pop     dx
  756.  
  757.              pop     cx
  758.  
  759.              pop     bx
  760.  
  761.              pop     ax
  762.  
  763.              iret                  ; return from the interrupt routine
  764.  
  765.  
  766.  
  767.   handler    ENDP
  768.  
  769.  
  770.  
  771.   int1C_TEXT ENDS
  772.  
  773.              END
  774.  
  775.  
  776.  
  777.  
  778.      The example just presented is not meant to be a tutorial on interrupts;
  779. there are many good references on DOS that explain them in detail.  However,
  780. an example specific to Fastgraph should be helpful.
  781. 276  Fastgraph User's Guide
  782.  
  783.  
  784. Appendix D
  785.  
  786. Contents of the
  787. Compiler-Specific Libraries
  788. 278  Fastgraph User's Guide
  789.  
  790.  
  791.      For each of the supported Fastgraph compilers except QuickBASIC, there
  792. is a compiler-specific Fastgraph library (also called the extended Fastgraph
  793. library) that contains the following routines:
  794.  
  795.  
  796.            fg_circlew     fg_getworld    fg_rectw       fg_setworld
  797.            fg_clprect     fg_initw       fg_restorew    fg_swchar
  798.            fg_dashrw      fg_moverw      fg_savew       fg_swlength
  799.            fg_dashw       fg_movew       fg_setangle    fg_swtext
  800.            fg_drawrw      fg_paintw      fg_setclipw    fg_xscreen
  801.            fg_draww       fg_panw        fg_setratio    fg_xworld
  802.            fg_drectw      fg_pointw      fg_setsize     fg_yscreen
  803.            fg_ellipsew    fg_polygonw    fg_setsizew    fg_yworld
  804.  
  805.  
  806. These routines use the world space coordinate system, either directly or
  807. internally.  Note that none of them are included in Fastgraph/Light.
  808.  
  809.      As mentioned in Chapter 1, if your program uses any of these routines,
  810. you must link it with the standard Fastgraph library (FGx.LIB) and the
  811. compiler-specific Fastgraph library (FGcccx.LIB).
  812.                                                                     Index  279
  813.  
  814.                                   I n d e x
  815.  
  816. 8253-5 programmable timer chip  234
  817. Active page  119
  818. Animation  188
  819.      dynamic frame  194
  820.      dynamic page flipping  196
  821.      page flipping  196
  822.      simple  188
  823.      static frame  192
  824.      static page flipping  196
  825.      summary  198
  826.      XOR  190
  827. ANSI.SYS  28, 29
  828. Assembly language  266
  829. Attribute  48, 104, 105
  830. Available memory  254
  831. Background color  49, 50
  832. Bit maps  136
  833.      CGA  141, 142, 149
  834.      EGA  144, 151
  835.      filler bits  137
  836.      Hercules  144
  837.      MCGA  145
  838.      memory requirements  172
  839.      mode-independent  136
  840.      mode-specific  140
  841.      PCjr  143, 151
  842.      retrieving  169
  843.      subscript order  137, 138, 147
  844.      Tandy  143, 151
  845.      text modes  146
  846.      VGA  144, 145, 151
  847. Bit-mapped characters  114
  848. Borland C++  3, 7
  849. Byte boundary  174, 175
  850. CapsLock  212-214
  851. CGA palettes  51
  852. Character cells  18
  853. Character space  40, 100
  854. Characters
  855.      bit-mapped  114
  856.      hardware  101
  857.      software  108
  858. Circles  83, 84
  859. Clearing the screen  76
  860. CLIP  259, 260
  861.      /M option  259
  862.      /P option  259
  863.      /W option  259
  864. Clipping  76
  865. Clock tick  248-250
  866. Clock tick interrupt  239, 241, 248
  867. Closed shapes  83
  868. Color  48
  869. Color indices  69
  870.  
  871. 280  Fastgraph User's Guide
  872.  
  873. Color number  50
  874. Color value  50
  875. Compilation  5
  876. Compiler-specific Fastgraph library  278
  877. CONVERT  261
  878.      /PPR switch  261
  879.      /SPR switch  261
  880. Coordinate conversion  44, 107
  881. Current color  50
  882. Cursor mask  220, 222
  883. Dash pattern  82
  884. Delay units  249, 250
  885. Display patterns  158
  886.      CGA  159, 160
  887.      EGA  161
  888.      Hercules  161
  889.      MCGA  162, 163
  890.      PCjr  160
  891.      Tandy  160
  892.      VGA  162, 163
  893. Dithering  88
  894. Dithering matrix  89
  895.      alignment  94
  896.      CGA  89, 90
  897.      EGA  92
  898.      Hercules  91
  899.      MCGA  93
  900.      PCjr  91
  901.      Tandy  91
  902.      VGA  92, 93
  903. EDITSPR  261, 262
  904. Ellipses  83, 84
  905. EMM386.EXE  129
  906. EMS  129
  907. Expanded memory  129
  908. Expanded Memory Manager  129
  909. Extended Fastgraph library  278
  910. Extended memory  129
  911. Fade  66, 67
  912. FASTGRAF.BI  6
  913. FASTGRAF.H  5
  914. Fastgraph  2
  915. Fastgraph routines
  916.      fg_allocate  122, 124, 125, 127, 129, 132, 175, 178, 254
  917.      fg_alloccms  129
  918.      fg_allocems  129, 132
  919.      fg_allocxms  129, 132
  920.      fg_automode  33, 34, 36, 77, 84, 86, 206
  921.      fg_bestmode  30, 34, 35, 36, 95, 122, 124, 125
  922.      fg_box  87, 96
  923.      fg_boxdepth  87, 88, 96
  924.      fg_button  228, 229, 231, 270, 271
  925.      fg_capslock  213, 231
  926.      fg_chgattr  104, 114
  927.      fg_chgtext  104, 114
  928.      fg_circle  84, 85, 96
  929.  
  930. Fastgraph routines (continued)
  931.      fg_circlew  84, 96
  932.      fg_clipmask  166, 167, 184
  933.      fg_clpimage  148, 149, 150, 166, 167, 169, 184
  934.      fg_clprect  86, 96, 188, 195, 196
  935.      fg_clprectw  86, 96
  936.      fg_copypage  129, 131, 133, 175, 176, 184
  937.      fg_cursor  28, 36, 73, 105, 178
  938.      fg_dash  82, 96
  939.      fg_dashrel  82, 97
  940.      fg_dashrw  82, 97
  941.      fg_dashw  82, 97
  942.      fg_defcolor  70, 73, 94
  943.      fg_dispfile  157, 158, 184, 198, 258
  944.      fg_display  153-158, 184, 198
  945.      fg_displayp  154, 155, 156-158, 184, 198
  946.      fg_disppcx  164, 166, 184
  947.      fg_draw  79, 80, 97, 204
  948.      fg_drawmap  114, 136, 138-141, 152, 166, 168-172, 181, 185, 198,
  949.           222, 226
  950.      fg_drawmask  166, 167, 168, 185
  951.      fg_drawrel  79, 80, 95, 97
  952.      fg_drawrw  79, 97
  953.      fg_draww  79, 97
  954.      fg_drect  88, 89, 92, 93, 94, 97
  955.      fg_drectw  89, 94, 97
  956.      fg_drwimage  114, 141, 142-144, 146, 147, 148-150, 152, 166,
  957.           167-169, 172, 185, 198, 226
  958.      fg_egacheck  32, 36
  959.      fg_ellipse  84, 85, 97, 192
  960.      fg_ellipsew  84, 97
  961.      fg_erase  76, 97
  962.      fg_fadein  200, 201, 208
  963.      fg_fadeout  200, 208
  964.      fg_flipmask  166, 167, 185
  965.      fg_flpimage  149, 150, 166, 167, 169, 185
  966.      fg_freepage  122, 124, 125, 129, 132, 133, 254
  967.      fg_getaddr  127, 128, 133
  968.      fg_getattr  105, 114
  969.      fg_getchar  105, 114
  970.      fg_getclock  249, 251
  971.      fg_getcolor  49-51, 57, 73
  972.      fg_getdacs  66, 67, 73
  973.      fg_gethpage  176, 185
  974.      fg_getimage  105, 169, 172, 173, 185, 198
  975.      fg_getindex  73
  976.      fg_getkey  212, 231
  977.      fg_getlines  31, 36
  978.      fg_getmap  169-173, 181, 185, 198
  979.      fg_getmaxx  41, 42, 44, 86
  980.      fg_getmaxy  41, 42, 44, 86
  981.      fg_getmode  30, 36, 266
  982.      fg_getpage  127, 133
  983.      fg_getpixel  76, 77, 97
  984.      fg_getrgb  65, 66, 73
  985.      fg_getvpage  127, 133
  986.      fg_getworld  43, 44
  987.      fg_getxjoy  228-231
  988.  
  989. 282  Fastgraph User's Guide
  990.  
  991. Fastgraph routines (continued)
  992.      fg_getxpos  79, 97
  993.      fg_getyjoy  228-231
  994.      fg_getypos  79, 97
  995.      fg_hush  240, 242, 244
  996.      fg_hushnext  240, 242, 243, 244
  997.      fg_imagesiz  172, 173, 185
  998.      fg_initems  129, 132, 133
  999.      fg_initjoy  132, 227, 228, 231
  1000.      fg_initw  42, 44, 79, 108, 109
  1001.      fg_initxms  129, 132, 133
  1002.      fg_intjoy  229-231
  1003.      fg_intkey  212, 213, 229, 231, 242, 248, 249
  1004.      fg_locate  101-103, 107, 114, 120, 126, 173
  1005.      fg_makepcx  164, 166, 185
  1006.      fg_maprgb  68, 73
  1007.      fg_measure  250, 251
  1008.      fg_memavail  254, 256
  1009.      fg_mousebut  218, 219, 231
  1010.      fg_mousecur  220, 221, 231
  1011.      fg_mouseini  132, 215, 216, 219, 231
  1012.      fg_mouselim  216, 217, 231
  1013.      fg_mousemov  216, 217, 231
  1014.      fg_mousepos  218, 219, 231
  1015.      fg_mouseptr  220, 225, 231
  1016.      fg_mousespd  217, 231
  1017.      fg_mousevis  216, 217, 219, 232
  1018.      fg_move  79, 80, 82, 95, 98, 139, 140, 156, 170, 173, 181, 204
  1019.      fg_moverel  79, 80, 98
  1020.      fg_moverw  79, 98
  1021.      fg_movew  79, 98
  1022.      fg_music  237-239, 242, 244, 270
  1023.      fg_musicb  242-244, 270
  1024.      fg_numlock  213, 232
  1025.      fg_paint  95, 98, 204
  1026.      fg_paintw  95, 98
  1027.      fg_palette  51-60, 62, 64, 65, 68, 69, 74
  1028.      fg_palettes  69, 74
  1029.      fg_pan  205-208
  1030.      fg_panw  205, 206, 208
  1031.      fg_pattern  158, 159, 163, 185
  1032.      fg_playing  240, 243, 244
  1033.      fg_point  76, 77, 98
  1034.      fg_pointw  76, 98
  1035.      fg_polygon  83, 98
  1036.      fg_polygonw  83, 98
  1037.      fg_quiet  234, 236, 237, 244
  1038.      fg_rect  60, 65, 86, 87, 88, 98, 107, 120, 138, 141, 178, 188, 195
  1039.      fg_rectw  86, 98, 113
  1040.      fg_reset  29, 30, 36, 266
  1041.      fg_resize  131-133, 207, 208
  1042.      fg_restore  176-180, 185, 195, 201
  1043.      fg_restorew  177, 185
  1044.      fg_resume  243, 244
  1045.      fg_revimage  149, 150, 166, 167, 169, 185
  1046.      fg_revmask  166, 167, 185
  1047.  
  1048.                                                                     Index  283
  1049.  
  1050. Fastgraph routines (continued)
  1051.      fg_save  176-180, 185
  1052.      fg_savew  177, 185
  1053.      fg_scrlock  213, 232
  1054.      fg_scroll  202-204, 208
  1055.      fg_setangle  112, 114
  1056.      fg_setattr  48-50, 74, 101, 102, 104, 114, 120, 121, 123, 125
  1057.      fg_setcaps  214, 232
  1058.      fg_setclip  76, 98, 148
  1059.      fg_setclipw  76, 98
  1060.      fg_setcolor  28, 49, 50, 51-60, 62, 64, 65, 74, 76, 79, 82, 92, 93,
  1061.           101, 104, 108, 115, 120, 121, 123, 125, 138, 189, 190, 202,
  1062.           203
  1063.      fg_setdacs  66, 67, 74, 263
  1064.      fg_setfunc  190, 255, 256
  1065.      fg_sethpage  176, 177, 178, 185, 200, 202
  1066.      fg_setlines  31, 36
  1067.      fg_setmode  28, 30, 37, 50, 51, 57, 64, 69, 70, 76, 77, 79, 84, 86,
  1068.           91, 92, 101, 102, 104, 109, 119, 120, 126, 132, 151, 159, 160,
  1069.           161, 162, 210, 215, 227, 266
  1070.      fg_setnum  214, 232
  1071.      fg_setpage  119, 120, 133, 177
  1072.      fg_setratio  109, 111, 115
  1073.      fg_setrgb  53, 56, 60, 62, 64-66, 68, 73, 74, 163
  1074.      fg_setsize  109, 115
  1075.      fg_setsizew  109, 115
  1076.      fg_setvpage  119, 128, 133, 196, 216
  1077.      fg_setworld  42-44, 109
  1078.      fg_sound  234-237, 239, 240, 245
  1079.      fg_sounds  239, 240, 242, 245, 270
  1080.      fg_stall  249-251
  1081.      fg_suspend  243-245
  1082.      fg_swchar  108-113, 115
  1083.      fg_swlength  113, 115
  1084.      fg_swtext  112, 113, 115
  1085.      fg_tcmask  183, 185
  1086.      fg_tcxfer  183, 186
  1087.      fg_testmode  29, 30, 35, 37, 120, 122, 151, 177, 236
  1088.      fg_text  28, 101, 102, 103, 104, 108, 115, 119
  1089.      fg_transfer  179, 180, 181-183, 186, 194, 195, 196, 201
  1090.      fg_version  5, 266
  1091.      fg_voice  235-237, 239, 240, 241, 245
  1092.      fg_voices  240-242, 245, 270
  1093.      fg_waitfor  66, 188, 194, 196, 204, 206, 213, 217, 237, 248-251
  1094.      fg_waitkey  29, 212, 232
  1095.      fg_where  102, 103, 115, 126
  1096.      fg_xalpha  44, 107, 115
  1097.      fg_xconvert  44, 45, 107, 115
  1098.      fg_xscreen  44, 45, 77
  1099.      fg_xworld  44, 45, 79
  1100.      fg_yalpha  44, 107, 115
  1101.      fg_yconvert  44, 45, 107, 115
  1102.      fg_yscreen  44, 45, 77
  1103.      fg_yworld  44, 45, 79
  1104. Fastgraph/Light  2
  1105. Fastgraph/Light Video Driver  2, 16
  1106.  
  1107. 284  Fastgraph User's Guide
  1108.  
  1109. FGDRIVER  16
  1110.      /U option  16
  1111. FGTP unit  6
  1112. FGTPX unit  6
  1113. Filler bits  137
  1114. Foreground color  48, 49
  1115. FORTRAN see Microsoft FORTRAN
  1116. Game port  227
  1117. GrabRGB  158, 262, 263
  1118.      /D option  263
  1119.      output file format  263
  1120. Graphics cursor  79
  1121. Graphics modes  18, 21, 50
  1122.      CGA  21, 51, 52
  1123.      EGA  23, 56, 58, 59
  1124.      extended VGA  24
  1125.      Hercules  22, 54, 55
  1126.      MCGA  24, 61, 64
  1127.      native EGA  23
  1128.      native VGA  24
  1129.      PCjr  22, 53
  1130.      Tandy  53
  1131.      Tandy 1000  22
  1132.      VGA  24, 61, 63, 64
  1133. Hardware characters  101
  1134.      graphics modes  105
  1135.      side effects  106
  1136.      text modes  101
  1137. HERCFIX  263
  1138. Hidden page  119, 176
  1139. HIMEM.SYS  129
  1140. Hot spot  224
  1141. Image array  147
  1142. Image transfer routines  175
  1143. Images  136
  1144.      clipped  148
  1145.      regular  141
  1146.      reversed  149
  1147.      reversed clipped  149
  1148. INCLUDE environment variable  5, 6
  1149. Input devices  210
  1150. INSTALL program  4
  1151.      /L option  4
  1152. Installation  4
  1153. Interrupts  270
  1154. INTRFACE.FOR  6
  1155. Joystick  227
  1156.      button status  228, 229, 270
  1157.      calibration  228
  1158.      characteristics  228
  1159.      horizontal position  228
  1160.      initialize  227
  1161.      keyboard emulation  229
  1162.      special considerations  230
  1163.      vertical position  228
  1164.  
  1165.                                                                     Index  285
  1166. Keyboard  210
  1167.      extended codes  210
  1168.      standard codes  210
  1169. Keyboard buffer  212, 249
  1170. Keyboard state light  214
  1171. Lines
  1172.      dashed  82
  1173.      solid  79
  1174. Linking  5
  1175. Logical pages  129
  1176.      creating  129
  1177.      releasing  129
  1178. Masking map  166, 167
  1179. Memory models  3
  1180.      large  3
  1181.      medium  3
  1182.      small  3
  1183. Memory update function  255
  1184. Mickeys  217
  1185. Microsoft C  3, 8
  1186. Microsoft FORTRAN  3, 9
  1187. Microsoft Mouse  215
  1188. Microsoft QuickBASIC  3, 10
  1189. Microsoft QuickC  3, 11
  1190. Mode X  26
  1191. Mouse  214
  1192.      button status  218
  1193.      CGA Considerations  226
  1194.      cursor  216, 220
  1195.      cursor mask  220, 222
  1196.      cursor visibility  216
  1197.      default cursor  222
  1198.      hot spot  224
  1199.      initialize  215
  1200.      limits  216
  1201.      position  216, 218
  1202.      screen mask  220, 222
  1203.      screen updates  216
  1204.      speed  217
  1205. Mouse cursor  216, 220
  1206.      graphics modes  222
  1207.      hot spot  224
  1208.      text modes  220
  1209. Mouse driver  215
  1210. Music  237
  1211.      asynchronous  242
  1212.      restarting  243
  1213.      stopping  242
  1214.      suspending  243
  1215.      synchronous  237
  1216. Music commands  237
  1217. Music string  237, 242
  1218. Musical notes  237
  1219. Naming conventions  4
  1220. NumLock  212-214
  1221. Overscan  51
  1222. Packed pixel run map  154, 155
  1223.  
  1224. 286  Fastgraph User's Guide
  1225.  
  1226. Palette  19
  1227. Palette number  53, 56, 58, 59, 62
  1228. Palette registers  53, 56, 58, 59, 61, 63, 69, 70
  1229. Palette value  53, 56, 58, 59
  1230. Palettes  53, 56, 58, 59, 61, 63
  1231. Panning  131, 207
  1232. PC Paintbrush  164
  1233. PCOPTION environment variable  5
  1234. PCX file
  1235.      creating  164
  1236.      displaying  164
  1237.      video mode compatibility  165
  1238. PCX images  164
  1239. Periodic noise  236
  1240. Physical pages  118
  1241. Pixel bleeding  226
  1242. Pixel run  152
  1243. Pixel run file  156-158, 258
  1244. Pixel run map  152, 153, 158
  1245. Pixels  18
  1246. Points  76
  1247. Polygons  83
  1248. Power C  3, 13
  1249. Put_string  103
  1250. QuickBASIC see Microsoft QuickBASIC
  1251. QuickC see Microsoft QuickC
  1252. Real-time operations  248
  1253. Rectangles
  1254.      dithered  88
  1255.      solid  86
  1256.      unfilled  87
  1257. Region fill  95
  1258. Register preservation  266
  1259. Resolution  18
  1260. Reverse video  104
  1261. RGB color mapping  68
  1262. Screen dissolving  200
  1263. Screen mask  220, 222
  1264. Screen origin  205
  1265. Screen space  40, 41
  1266. Scrolling  202
  1267.      circular  202
  1268.      end-off  202
  1269. Scrolling increment  202
  1270. Scrolling region  202
  1271. ScrollLock  212, 213
  1272. Shadow  104
  1273. Sliding tone  235
  1274. SNAPSHOT  158, 258, 259, 262, 263
  1275.      error tone  258
  1276.      image files  258
  1277.      success tone  258
  1278. Software characters  108
  1279.      alternate font  108, 109, 112
  1280.      angle  112
  1281.      aspect ratio  109
  1282.  
  1283. Software characters (continued)
  1284.      font change operator (\)  109
  1285.      primary font  108, 109
  1286.      size  109
  1287.      string length  113
  1288.      subscript operator (\v)  110
  1289.      superscript operator (\^)  110
  1290.      underline operator (_)  110
  1291. Sound  234
  1292.      asynchronous  239
  1293.      disk accesses during  239
  1294.      duration  234
  1295.      frequency  234
  1296.      PCjr  234
  1297.      stopping  242
  1298.      synchronous  234
  1299.      Tandy  234
  1300.      volume  234
  1301. Sound effects  234-236
  1302. Splitter cable  227Standard color set  50
  1303. Strlen  103
  1304. Stroke characters  108
  1305. Texas Instruments SN76496A sound chip  234
  1306. Text cursor  28, 101, 126
  1307. Text modes  18, 19, 48
  1308.      43 lines  31
  1309.      50 lines  31
  1310.      color  48
  1311.      monochrome  49
  1312. TI sound chip  234
  1313. Transparent color  183
  1314. Turbo C  3, 14
  1315. Turbo C++  3, 14
  1316. Turbo Pascal  3, 15
  1317. Utilities  258
  1318. Vector characters  108
  1319. Video DAC registers  61, 62, 63-66, 69
  1320. Video modes  18
  1321.      mode 00  20
  1322.      mode 01  20
  1323.      mode 02  20
  1324.      mode 03  20
  1325.      mode 04  21
  1326.      mode 05  21
  1327.      mode 06  22
  1328.      mode 07  20
  1329.      mode 09  22
  1330.      mode 11  23
  1331.      mode 12  23
  1332.      mode 13  23
  1333.      mode 14  24
  1334.      mode 15  24
  1335.      mode 16  24
  1336.      mode 17  25
  1337.      mode 18  25
  1338.      mode 19  25
  1339.      mode 20  25
  1340.  
  1341.                                                                     Index  287
  1342. Video modes (continued)
  1343.      mode 21  25
  1344.      mode 22  26
  1345.      mode 23  26
  1346.      mode X  26
  1347.      summary  18
  1348. Video page  118
  1349. Video page resizing  207
  1350. Video pages  19
  1351.      active  119
  1352.      hidden  119, 176
  1353.      information  127
  1354.      logical  129
  1355.      physical  118
  1356.      resizing  131
  1357.      segment address  127
  1358.      virtual  118, 122
  1359.      visual  119
  1360. Video subsystem  19
  1361. Virtual colors  69, 70
  1362. Virtual pages  118
  1363.      creating  122
  1364.      releasing  122
  1365.      special considerations  128
  1366. Visual effects  201
  1367. Visual page  119
  1368. Warbling  235
  1369. White noise  236
  1370. World space  40, 42
  1371. XMS  129