home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PCGPEV10.ZIP / GMOUSE.DOC < prev    next >
Text File  |  1994-05-10  |  50KB  |  1,501 lines

  1.              PROGRAMMER'S  REFERENCE  FOR  GENIUS  MOUSE  DRIVER
  2.  
  3. *** 1 : BRIEF DESCRIPTION
  4.  
  5. The Genius Mouse Driver enables you to use mouse hardware to move an on-screen
  6. cursor and control its movement through a software program.  Various functions
  7. allow you to determine cursor placement, cursor shape, and button status.
  8.  
  9. In order for you to interface your Genius Mouse with an application program, the
  10. following information on the Genius Driver has been provided.
  11.  
  12. *** 2 : GRAPHICS AND TEXT CURSORS
  13.  
  14. GMOUSE Driver supports a hardware text cursor,  a software  text   cursor, and
  15. a graphics cursor. A hardware text cursor is a blinking cursor which moves from
  16. one character to another on-screen. This blinking cursor may take the form of a
  17. block or underscore. A software text cursor makes use of display attributes to
  18. change the visual appearance of a character on-screen.  Movement is from
  19. character to character. A graphics cursor is a shape that moves over on-screen
  20. images.
  21.  
  22. You can choose any of these three cursors to use on-screen, however, only one
  23. cursor can be displayed at a given time.  Also, within your application program,
  24. you can switch back and forth between cursors.
  25.  
  26.  
  27. Display the Graphics Cursor
  28.  
  29. The cursor appears on-screen or disappears from the screen through the calling
  30. program.  This cursor consists of a block of pixels.  As this block moves
  31. on-screen and affects the pixels beneath it, the cursor shape and background are
  32. created. This interaction is defined by two 16-by-16 bit arrays;
  33. one is the screen mask and the other is the cursor mask. The screen mask
  34. determines what part of the cursor pixel is to be the shape, and what part  is
  35. is to be the background. The cursor mask determines which pixels contribute to
  36. the color of the cursor. Whenever changes are made to the screen which lie
  37. directly  beneath the cursor, the cursor should be concealed so that old values
  38. are not restored to the screen.
  39.  
  40. Please note that with a high resolution mode, you have a 16-by-16 pixel block;
  41. with a medium resolution (four color) mode, you have a 8-by-16 pixel block; with
  42. a medium resolution (sixteen color) mode, you have a 4-by-16 pixel block.
  43.  
  44. Refer to function 9.
  45.  
  46. To create the cursor, the software uses data from the computer's screen memory
  47. which defines the color of each pixel on-screen.  Operations are performed that
  48. affect individual screen bits.  Software ANDs the screen mask defining the
  49. pixels under the cursor and XORs the cursor mask with the result of the AND
  50. operation.
  51.  
  52. Note the results when:
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                                  page 1
  60.  
  61. Screen Mask Bit is      Cursor Mask Bit is      Resulting Screen Bit is
  62. ------------------      ------------------      -----------------------
  63.         0                        0                         0
  64.         0                        1                         1
  65.         1                        0                     unchanged
  66.         1                        1                      inverted
  67.  
  68. With each mouse function, a reference to the graphics cursor location is in
  69. reference to a point on-screen directly beneath the cursor.  This point that the
  70. mouse software uses to determine the cursor coordinates is known as the cursor's
  71. hot spot.
  72. Generally, the upper_left hand corner of the cursor block is designated as the
  73. coordinates for the cursor default value. ((0,0) are the upper_left hand corner
  74. coordinates.)
  75.  
  76. Software Text Cursor
  77.  
  78. You can use this text cursor when your computer is in one of the text modes.  By
  79. changing the character attributes beneath the cursor, the appearance of the
  80. character is influenced on-screen.  This effect on the text cursor can be
  81. defined by two 16-bit mask values. These bits can be described as follows:
  82. bit 15 sets the blinking (1) or non-blinking (0) character ; bit 12 - 14 set the
  83. background (1); bits 8 - 10 set the foreground color; and bits 0 - 7 set the
  84. character code. These values in the screen mask and the cursor mask
  85. determine the character's new attributes when the cursor is covering the
  86. character.  The screen mask decides which of the character's attributes are
  87. maintained. The cursor mask decides in what manner the attributes are altered
  88. to produce the cursor.
  89.  
  90. In creating this cursor, the software works from data which defines each
  91. character on the screen.  The software first ANDs the screen mask and the screen
  92. data bit for the character beneath the cursor.  Next, the software XORs the
  93. cursor mask and the result of the AND operation.
  94.  
  95. When a function refers to the text cursor location, it gives the coordinates of
  96. the character beneath the cursor.
  97.  
  98. Refer  to function 10.
  99.  
  100. Hardware Text Cursor
  101.  
  102. This cursor is also available when the computer is in one of the text modes.
  103. This cursor is the one seen on-screen when the computer is powered on.  It
  104. consists of 8 pixels wide and 8 to 14 pixels tall.  Software allows you to use
  105. this cursor for your needs. Scan lines determine a cursor's appearance
  106. on-screen. A scan line consists of a horizontal set of pixels.
  107. If a line is on, there will be flashing on the screen. If a line is off, there
  108. is no effect. Scan lines are numbered from 0 to 7, or 0 to 11 depending on the
  109. type of display used. 0 indicates the top scan line.
  110.  
  111. Refer to function 10.
  112.  
  113. *** 2.1 : Mouse Buttons
  114.  
  115.  
  116.  
  117.  
  118.  
  119.                                  page 2
  120.  
  121. Mouse functions can give the status of the mouse buttons and the number of times
  122. a certain button has been pressed and released.  The button status is given as
  123. an integer. If a bit is set to 1 the button is down; if a bit is set to 0, the
  124. button is up.
  125.       Bit 0 - Left Button Status
  126.       Bit 1 - Right Button Status
  127.       Bit 2 - Middle Button Status
  128. Each time a mouse button is pressed, a counter records the number of presses and
  129. releases.  The software sets the counter to zero once it has been read or after
  130. a reset.
  131.  
  132. *** 2.2 : Unit of Distance - Mouse Motion
  133.  
  134. The motion of the mouse can be expressed in a unit of distance (mouse motion)
  135. and is approximately 1/200 of an inch.
  136.  
  137. With mouse movement, mouse software determines a horizontal and vertical mouse
  138. motion count.  This count is used by the software to move a cursor a certain
  139. number of pixels on-screen.  Software defines mouse motion sensitivity (the
  140. number of mouse motions needed to move the cursor 8 pixels on-screen) and this
  141. sensitivity determines the rate at which the cursor moves on-screen.
  142.  
  143. Refer to function 15.
  144.  
  145. *** 2.3 : Internal Cursor Flag
  146.  
  147. Mouse software supports an internal flag.  This flag determines when the cursor
  148. should appear on-screen.  If the flag equals 0, the cursor appears on-screen; if
  149. the flag is any other number, the cursor disappears from the screen.
  150.  
  151. You can call functions 1 and 2 a number of times, however, if you call function
  152. 2, you must call function 1 later.  This is necessary to restore the flag's
  153. previous value.
  154.  
  155. Refer to functions 1 and 2.
  156.  
  157. *** 3 : CALLING FROM ASSEMBLY LANGUAGE PROGRAMS
  158.  
  159. To make mouse function calls:
  160.  
  161. Load the appropriate registers (AX, BX, CX, DX) with the parameter values.
  162. These correspond to G1%, G2%, G3%, and G4% as shown in the BASIC example to
  163. follow.  Then execute software interrupt 51 (33H).  The values given by the
  164. mouse functions will be installed in the registers.
  165.  
  166. Example:
  167.  
  168.    ; * set cursor to location (150,100)
  169.    Mov AX,4    ;(function call 4)
  170.    Mov CX,150  ;(set horizontal to 150)
  171.    Mov DX,100  ;(set vertical to 100)
  172.    Int 51(33H) ;(interrupt to mouse)
  173.  
  174. It is important to note that before using INT 33H, one should verify the
  175. presence of the mouse driver.  Executing an INT 33H will cause uncertain results
  176. if the mouse driver is not loaded.  Assume a mouse driver is present when INT
  177. 33H vector is non-zero and the vector does not point to an IRET instruction.
  178.  
  179.                                  page 3
  180.  
  181. Note:  When making a mouse call in Assembly Language, expect somewhat of a
  182. different value for the fourth parameter (when compared with calls using a BASIC
  183. program) involving functions 9, 12, and 16.
  184.  
  185. *** 4 : CALLING FROM BASIC LANGUAGE PROGRAM
  186.  
  187. To make  mouse function calls:
  188.  
  189.   Set a pair of integer variables in your program for the offset and the segment
  190.   of the mouse driver entry point.
  191.  
  192.   In order to obtain the offset and segment values, the following statements
  193.   must be inserted into your program before any calls to mouse functions:
  194.  
  195. 10 DEF SEG = 0
  196. 15 ' GET GMOUSE ENTRY POINT
  197. 20 GMSEG   = PEEK( 51*4 + 2 ) + 256 * PEEK( 51*4 + 3 )   ' GET SEGMENT ENTRY
  198. 30 GMOUSE  = 2 + PEEK( 51*4 ) + 256 * PEEK( 51*4 + 1 )   ' GET OFFSET  ENTRY
  199. 40 DEF SEG = GMSEG           ' SET SEGMENT REGISTER AS THE SEGMENT OF GMOUSE
  200.  
  201. To enter the mouse driver, use the CALL statement:
  202.  
  203.   CALL GMOUSE (G1%, G2%, G3%, G4%)
  204.  
  205. GMOUSE contains the entry offset of the mouse driver.  G1%, G2%, G3%, and G4%
  206. are the integer variables given in the call.  These four must be specified in
  207. the CALL statement even if a value is not assigned.  When a value is assigned,
  208. it must be an integer, that is, a whole number.
  209.  
  210. Example:
  211.  
  212. 50  ' Find the Activated Mode of Genius Mouse
  213. 60  G1% = 0 : G2% = 0
  214. 70  CALL GMOUSE ( G1%, G2%, G3%, G4% )
  215. 80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"
  216. 90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"
  217. 100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"
  218.  
  219. *** 5 : MOUSE FUNCTIONS
  220.  
  221. These functions listed apply to the Genius Mouse.  Further descriptions of each
  222. mouse function will be given in the following pages.
  223.  
  224. Functions                                         Function Number
  225. -----------------------------------------------------------------
  226. Reset Genius Mouse Driver                                 0
  227. Enable Cursor Display                                     1
  228. Disable Cursor Display                                    2
  229. Read Cursor Location & Button State of Genius Mouse       3
  230. Set Cursor Location of Genius Mouse                       4
  231. Read Button Press State of Genius Mouse                   5
  232. Read Button Release State of Genius Mouse                 6
  233. Define Horizontal (X) Range of Cursor Location            7
  234. Define Vertical (Y) Range of Cursor Location              8
  235. Define Graphics Mode Cursor Style                         9
  236. Define Text Mode Cursor Style                            10
  237. Read Genius Mouse Motion Number                          11
  238.  
  239.                                  page 4
  240.  
  241. Define Event Handler Entry Location                      12
  242. Enable Light Pen Emulation Function                      13
  243. Disable Light Pen Emulation Function                     14
  244. Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse  15
  245. Disable Cursor Display in Special Range                  16
  246. Define Double-Speed Threshold                            19
  247. Swap Event Handler Entry Location                        20
  248. Get Mouse Driver State Storage Size                      21
  249. Save Mouse Driver state                                  22
  250. Restore Mouse Driver state                               23
  251. Set CRT Page Number                                      29
  252. Read CRT Page Number                                     30
  253.  
  254. EGA functions are described in Section *** 7.
  255.  
  256. *** 6 : DESCRIPTION OF THE MOUSE FUNCTIONS
  257.  
  258. You'll notice that with the following mouse function descriptions, the
  259. parameters needed to make the calls and the expected outcome (return) for each
  260. is indicated. Also,  any special conditions regarding any of the mouse functions
  261. have been included.  Further, an example of a program has been provided in order
  262. for you to understand how to make the call.
  263.  
  264. The input and return values are presented for 8086 registers and for BASIC in
  265. the following pages.
  266.  
  267. It is important to note that each mouse function call needs four parameters.
  268. The Genius Mouse software does not verify any input values, and therefore, if
  269. any incorrect values are given, uncertain results will occur.
  270.  
  271. Function 0: Reset Genius Mouse Driver
  272.  
  273. Function 0 gives the current status of the mouse hardware plus the current
  274. status of the mouse software.  The calling program is able to determine the
  275. presence of a mouse driver and/or a serial port.
  276.  
  277. This function resets the mouse driver to the following default status as
  278. indicated:
  279.  
  280. Variable                                Value
  281. ------------------------------------------------------------------------------
  282. internal cursor flag                    -1 (cursor concealed)
  283. graphics  cursor shape                  horizontal oval
  284. text cursor                             reverse video
  285. user-defined call mask                  all zeroes
  286. light pen emulation mode                enabled
  287. vertical mouse motion/pixel ratio       16 to 8
  288. horizontal mouse motion/pixel ratio     8 to 8
  289. vertical min/max cursor coordinates     0/current display mode y values minus 1
  290. horizontal min/max cursor coordinates   0/current display mode x values minus 1
  291.  
  292. 8086 Register
  293. Input:  AX = 0
  294. Return: AX = mouse state (-1: installed, 0: not installed)
  295.         BX = number of buttons (2 button mode, 3 button mode)
  296.  
  297.  
  298.  
  299.                                  page 5
  300.  
  301. BASIC
  302. Input:  G1% = 0
  303. Return: G1% = mouse state (-1: installed, 0: not installed)
  304.         G2% = number of buttons (2 button mode, 3 button mode)
  305.  
  306. Example:  Used initially to determine if the GMOUSE driver is present and to
  307.           reset GMOUSE.
  308.  
  309. 50  ' Find the Actived Mode of Genius Mouse
  310. 60  G1% = 0 : G2% = 0
  311. 70  CALL GMOUSE ( G1%, G2%, G3%, G4% )
  312. 80  IF G2% AND 2 THEN PRINT "Genius Mouse ( 2_Button Mode ) Enable"
  313. 90  IF G2% AND 3 THEN PRINT "Genius Mouse ( 3_Button Mode ) Enable"
  314. 100 IF NOT G1%   THEN PRINT "Can't Find Genius Mouse"
  315.  
  316. Function 1: Enable Cursor Display
  317.  
  318. Function 1 increments the internal cursor flag counter.  If the counter is zero,
  319. the cursor is enabled and appears on-screen.
  320.  
  321. The default value is -1 which indicates a concealed cursor.  Function 1 must be
  322. called to display the cursor.  In case the internal cursor flag is already zero,
  323. a call to this function produces no effect.
  324.  
  325. 8086 Register
  326. Input:  AX = 1
  327. Return: none
  328.  
  329. BASIC
  330. Input:  G1% = 1
  331. Return: none
  332.  
  333. Example:
  334.  
  335. 110  ' Enable Genius Mouse's Cursor
  336. 120  G1% = 1
  337. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  338.  
  339. Function 2: Disable Cursor Display
  340.  
  341. Function 2 disables the cursor by removing it from the screen and decrementing
  342. the internal cursor flag.  Even though the cursor cannot be seen, it still
  343. tracks any motion made with the mouse.
  344.  
  345. You should use this function before changing any portion of the screen
  346. containing the cursor.  You will avoid the problem of the cursor affecting
  347. screen data.
  348.  
  349. Keep in mind that whenever your program calls function 2, it must later call
  350. function 1 to return the internal cursor flag to its default value.  In
  351. addition, if your program changes the screen mode, function 2 is called
  352. automatically. Therefore, the cursor's movement is enabled the next time it is
  353. displayed.
  354.  
  355. Call function 2 at the end of a program in order to conceal the cursor.  This
  356. ensures that nothing remains on-screen.
  357.  
  358.  
  359.                                  page 6
  360.  
  361. 8086 Register
  362. Input:  AX = 2
  363. Return: none
  364.  
  365. BASIC
  366. Input:  G1% = 2
  367. Return: none
  368.  
  369. Example:
  370.  
  371. 110  ' Disable Genius Mouse's Cursor
  372. 120  G1% = 2
  373. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  374.  
  375. Function 3: Read Cursor Location & Button State of Genius Mouse
  376.  
  377. Function 3 gives the status of mouse buttons, plus cursor location.
  378.  
  379. Button status consists of a single integer value:
  380.   Bit 0 = left button (2 button mode, 3 button mode)
  381.   Bit 1 = right button (2 button mode, 3 button mode)
  382.   Bit 2 = middle button (3 button mode)
  383.  
  384. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  385. released.
  386.  
  387. 8086 Register
  388. Input:  AX = 3
  389. Return: BX = button status
  390.         CX = horizontal cursor coordinate
  391.         DX = vertical cursor coordinate
  392.  
  393. BASIC
  394. Input:  G1% = 3
  395. Return: G2% = button status
  396.         G3% = horizontal cursor coordinate
  397.         G4% = vertical cursor coordinate
  398.  
  399. Example:
  400.  
  401. 110  ' Read Genius Mouse Location & Button State
  402. 120  G1% = 3
  403. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  404. 140 PRINT "Genius Mouse Location : X_Coord=" G3% " Y_Coord=" G4%
  405. 150 IF G2% AND 1 THEN PRINT "Left Button"
  406. 160 IF G2% AND 2 THEN PRINT "Right Button"
  407. 170 IF G2% AND 4 THEN PRINT "Middle Button"
  408. 180 PRINT "Pressed"
  409.  
  410. Function 4: Set Cursor Location of Genius Mouse
  411.  
  412. Function 4 sets the current cursor location.  Values must be within the
  413. coordinate ranges for the virtual screen and, if necessary, are rounded to the
  414. nearest values allowed for the current screen mode.
  415.  
  416.  
  417.  
  418.  
  419.                                  page 7
  420.  
  421.   Screen     Display        Virtual         Cell        Bits/Pixel
  422.    Mode      Adapter       Screen (XxY)     Size      Graphics Mode
  423. ---------  ------------  ---------------  --------   ----------------
  424.     0      C, E, 3270     640 x 200        16 x 8          -
  425.     1      C, E, 3270     640 x 200        16 x 8          -
  426.     2      C, E, 3270     640 x 200         8 x 8          -
  427.     3      C, E, 3270     640 x 200         8 x 8          -
  428.     4      C, E, 3270     640 x 200         2 x 1          2
  429.     5      C, E, 3270     640 x 200         2 x 1          2
  430.     6      C, E, 3270     640 x 200         1 x 1          1
  431.     7      M, E, 3270     640 x 200         8 x 8          -
  432.     D      E              640 x 200        16 x 8          2
  433.     E      E              640 x 200         1 x 1          1
  434.     F      E              640 x 350         1 x 1          1
  435.     10     E              640 x 350         1 x 1          1
  436.     30     3270           720 x 350         1 x 1          1
  437.            H              720 x 348         1 x 1          1
  438.  
  439. Display Adapter:
  440.   M = IBM Monochrome Display/Printer Adapter
  441.   C = IBM Color/Graphics Adapter
  442.   E = IBM Enhanced Graphics Adapter
  443. 3270 = IBM All Points Addressable Graphics Adapter (3270 PC)
  444.   H = Hercules Monochrome Graphics Card
  445.  
  446. 8086 Register
  447. Input:  AX = 4
  448.         CX = new horizontal cursor coordinate
  449.         DX = new vertical cursor coordinate
  450. Return: none
  451.  
  452. BASIC
  453. Input:  G1% = 4
  454.         G3% = new horizontal cursor coordinate
  455.         G4% = new vertical cursor coordinate
  456. Return: none
  457.  
  458. Example:
  459.  
  460. 110  ' Set Cursor Location at the Upper_Left Corner of Screen
  461. 120 G1% = 4
  462. 130 G3% = 0 : G4% = 0
  463. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  464.  
  465. Function 5: Read Button Press State of Genius Mouse
  466.  
  467. Function 5 provides status on the specified button, gives the number of button
  468. presses since the last call, and produces the location of the cursor at last
  469. button press.
  470.  
  471. Button status consists of a single integer value.  Again, as in function 3:
  472.              Bit 0 = left button (2 button mode, 3 button mode)
  473.              Bit 1 = right button (2 button mode, 3 button mode)
  474.              Bit 2 = middle button (3 button mode)
  475.  
  476. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  477. released.
  478.  
  479.                                  page 8
  480.  
  481. The number of button presses will always fall in the range of 0 to 32767.  There
  482. is no indicator for overflow.  Following this function call, the count is reset
  483. to zero.
  484.  
  485. 8086 Register
  486. Input:  AX = 5
  487.         BX = button status (left = 0, right = 1, middle = 2)
  488. Return: AX = button status
  489.         BX = number of button presses
  490.         CX = horizontal cursor coordinate at last press
  491.         DX = vertical cursor coordinate at last press
  492.  
  493. BASIC
  494. Input:  G1% = 5
  495.         G2% = button status (left = 0, right = 1, middle = 2)
  496. Return: G1% = button status
  497.         G2% = number of button presses
  498.         G3% = horizontal cursor coordinate at last press
  499.         G4% = vertical cursor coordinate at last press
  500.  
  501. Example:
  502.  
  503. 110 ' Read the Left Button Press State of Genius Mouse
  504. 120 G1% = 5 : G2% = 2
  505. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  506. 140 IF G1% AND 2 THEN PRINT "The Middle Button Pressed at X_loc=" G3%
  507.  
  508. Function 6: Read Button Release State of Genius Mouse
  509.  
  510. Function 6 provides status on the specified button, gives the number of button
  511. releases since the last call, and provides the location of the cursor at the
  512. last button release.
  513.  
  514. Button status consists of a single integer value.  Again, as in function 3:
  515.              Bit 0 = left button (2 button mode, 3 button mode)
  516.              Bit 1 = right button (2 button mode, 3 button mode)
  517.              Bit 2 = middle button (3 button mode)
  518.  
  519. The bit is 1 when the button is pressed.  The bit is 0 when the button is
  520. released.
  521.  
  522. The number of button releases will always fall in the range of 0 to 32767.
  523. There is no indicator for overflow.  Following this function call, the count is
  524. reset to zero.
  525.  
  526. 8086 Register
  527. Input:  AX = 6
  528.         BX = button status (left = 0, right = 1, middle = 2)
  529. Return: AX = button status
  530.         BX = number of button releases
  531.         CX = horizontal cursor coordinate at last release
  532.         DX = vertical cursor coordinate at last release
  533.  
  534. BASIC
  535. Input:  G1% = 6
  536.         G2% = button status (left = 0, right = 1, middle = 2)
  537.  
  538.  
  539.                                  page 9
  540.  
  541. Return: G1% = button status
  542.         G2% = number of button releases
  543.         G3% = horizontal cursor coordinate at last release
  544.         G4% = vertical cursor coordinate at last release
  545.  
  546. Example:
  547.  
  548. 110 ' Read the Left Button Release State of Genius Mouse
  549. 120 G1% = 6 : G2% = 2
  550. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  551. 140 IF NOT G1% OR &HFFFB THEN PRINT "The Middle Button Released at X_loc=" G3%
  552.  
  553. Function 7: Define Horizontal (X) Range of Cursor Location
  554.  
  555. Function 7 defines the horizontal range of the cursor on-screen.  As a result,
  556. cursor movement is limited to this specified area.  If a cursor happens to be
  557. outside of this area when a call is made, the cursor is moved to just inside the
  558. area.
  559.  
  560. 8086 Register
  561. Input:  AX = 7
  562.         CX = minimum horizontal cursor coordinate
  563.         DX = maximum horizontal cursor coordinate
  564. Return: none
  565.  
  566. BASIC
  567. Input:  G1% = 7
  568.         G3% = minimum horizontal cursor coordinate
  569.         G4% = maximum horizontal cursor coordinate
  570. Return: none
  571.  
  572. Example:
  573.  
  574. 110 ' Enable Cursor in Horizontal Range between 100 to 200
  575. 120 G1% = 7
  576. 130 G2% = 100 : G3% = 200
  577. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  578.  
  579. Function 8: Define Vertical (Y) Range of Cursor Location
  580.  
  581. Function 8 defines the vertical range of the cursor on-screen.  As a result,
  582. cursor movement is limited to this specified area.  If a cursor happens to be
  583. outside of this area when a call is made, the cursor is moved to just inside the
  584. area.
  585.  
  586. 8086 Register
  587. Input:  AX = 8
  588.         CX = minimum vertical cursor coordinate
  589.         DX = maximum vertical cursor coordinate
  590. Return: none
  591.  
  592. BASIC
  593. Input:  G1% = 8
  594.         G3% = minimum vertical cursor coordinate
  595.         G4% = maximum vertical cursor coordinate
  596. Return: none
  597.  
  598.  
  599.                                  page 10
  600.  
  601. Example:
  602.  
  603. 110 ' Enable Cursor in Vertical Range between 100 to 200
  604. 120 G1% = 8
  605. 130 G2% = 100 : G3% = 200
  606. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  607.  
  608. Function 9: Define Graphics Mode Cursor Style
  609.  
  610. Function 9 defines the style of the cursor in terms of color, shape, and center
  611. for the graphics.  As mentioned before, this cursor is a 16-by-16 pixel block
  612. and is defined by two 16-bit arrays (the screen mask bit and the cursor mask
  613. bit). Cursor coordinates for the hot spot must be in the range of -16 to +16.
  614. 8086 Register
  615. Input:  AX = 9
  616.         BX = horizontal cursor hot spot
  617.         CX = vertical cursor hot spot
  618.         DX = pointer to screen and cursor mask
  619. Return: none
  620.  
  621. BASIC
  622. Input:  G1% = 9
  623.         G2% = horizontal cursor hot spot
  624.         G3% = vertical cursor hot spot
  625.         G4% = pointer to screen and cursor mask
  626. Return: none
  627.  
  628. Example:
  629.  
  630. 10  ' Define the screen mask
  631. 20  '
  632. 30    cursor (0,0)  = &HFFFF       '1111111111111111
  633. 40    cursor (1,0)  = &HFFFF       '1111111111111111
  634. 50    cursor (2,0)  = &HFFFF       '1111111111111111
  635. 60    cursor (3,0)  = &HFFFF       '1111111111111111
  636. 70    cursor (4,0)  = &HFFFF       '1111111111111111
  637. 80    cursor (5,0)  = &HF00F       '1111000000001111
  638. 90    cursor (6,0)  = &H0000       '0000000000000000
  639. 100   cursor (7,0)  = &H0000       '0000000000000000
  640. 110   cursor (8,0)  = &H0000       '0000000000000000
  641. 120   cursor (9,0)  = &H0000       '0000000000000000
  642. 130   cursor (10,0) = &HF00F       '1111000000001111
  643. 140   cursor (11,0) = &HFFFF       '1111111111111111
  644. 150   cursor (12,0) = &HFFFF       '1111111111111111
  645. 160   cursor (13,0) = &HFFFF       '1111111111111111
  646. 170   cursor (14,0) = &HFFFF       '1111111111111111
  647. 180   cursor (15,0) = &HFFFF       '1111111111111111
  648. 190 '
  649. 200 ' Define the cursor mask
  650. 210 '
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.                                  page 11
  660.  
  661. 220   cursor (0,1)  = &H0000       '0000000000000000
  662. 230   cursor (1,1)  = &H0000       '0000000000000000
  663. 240   cursor (2,1)  = &H0000       '0000000000000000
  664. 250   cursor (3,1)  = &H0000       '0000000000000000
  665. 260   cursor (4,1)  = &H0000       '0000000000000000
  666. 270   cursor (5,1)  = &H0000       '0000000000000000
  667. 280   cursor (6,1)  = &H07E0       '0000011111100000
  668. 290   cursor (7,1)  = &H7FFE       '0111111111111110
  669. 300   cursor (8,1)  = &H7FFE       '0111111111111110
  670. 310   cursor (9,1)  = &H07E0       '0000011111100000
  671. 320   cursor (10,1) = &H0000       '0000000000000000
  672. 330   cursor (11,1) = &H0000       '0000000000000000
  673. 340   cursor (12,1) = &H0000       '0000000000000000
  674. 350   cursor (13,1) = &H0000       '0000000000000000
  675. 360   cursor (14,1) = &H0000       '0000000000000000
  676. 370   cursor (15,1) = &H0000       '0000000000000000
  677. 380 '
  678. 390 ' Set the cursor style and hot spot number of Genius Mouse
  679. 400 '
  680. 410 '
  681. 420   G1% = 9
  682. 430   G2% = 6 ' horizontal hot spot
  683. 440   G3% = 5 ' vertical hot spot
  684. 450   CALL GMOUSE ( G1%, G2%, G3%, cursor (0,0))
  685.  
  686. Function 10: Define Text Mode Cursor Style
  687.  
  688. Function 10 chooses the hardware or the software text cursor.
  689.  
  690. For example, if BX (G2%) is 1, the hardware cursor is selected and the hardware
  691. is set up with the first and last scan lines which define the cursor.
  692. (Values for CX (G3%) and DX (G4%) range from 0 to 7 for the color display and 0
  693. to 11 for the monochrome display.)
  694.  
  695. If BX (G2%) is 0, the software cursor is selected; and CX (G3%) and DX (G4%)
  696. must specify the screen and cursor masks.  (These masks give the attributes and
  697. character code of the cursor, and their values are dependent on the type of
  698. display in use.)
  699.  
  700. 8086 Register
  701. Input:  AX = 10
  702.         BX = select cursor (0: software text, 1: hardware text)
  703.         CX = screen mask value/scan line start
  704.         DX = cursor mask value/scan line stop
  705. Return: none
  706.  
  707. BASIC
  708. Input:  G1% = 10
  709.         G2% = select cursor (0: software text, 1: hardware text)
  710.         G3% = screen mask value/scan line start
  711.         G4% = cursor mask value/scan line stop
  712. Return: none
  713.  
  714. Example:
  715.  
  716.  
  717.  
  718.  
  719.                                  page 12
  720.  
  721. 110 ' Enable an Inverting Cursor
  722. 120 G1% = 10
  723. 130 G2% = 0
  724. 140 G3% = &HFFFF  :  G4% = &H7700
  725. 150 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  726.  
  727. Function 11: Read Genius Mouse Motion Number
  728.  
  729. Function 11 gives the mouse motion number since the last call.  A positive
  730. horizontal number indicates rightward movement (negative shows leftward
  731. movement).  A positive vertical number indicates downward movement (negative
  732. shows upward movement).
  733. The number is always in the range of -32768 to 32767.  Overflow is disregarded.
  734. Once the call is completed, the number is set to 0.
  735.  
  736. 8086 Registers
  737. Input:  AX = 11
  738. Return: CX = horizontal number
  739.         DX = vertical number
  740.  
  741. BASIC
  742. Input:  G1% = 11
  743. Return: G3% = horizontal number
  744.         G4% = vertical number
  745.  
  746. Example:
  747.  
  748. 110 ' Read Genius Mouse Motion Number
  749. 120 G1% = 11
  750. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  751. 140 IF G3% > 0 THEN PRINT "Genius Mouse is Moving to Right"
  752. 150 IF G4% > 0 THEN PRINT "Genius Mouse is Moving Down"
  753.  
  754. Function 12: Define Event Handler Entry Location
  755.  
  756. Function 12 defines the address entry location of an event handler routine which
  757. is called when a certain event (defined by the call mask) occurs.  The program
  758. is temporarily interrupted by the mouse driver. At the end of the event handler
  759. routine  the program continues at the point it was interrupted.
  760.  
  761. The call mask is a single integer value defining the conditions which will cause
  762. an interrupt.
  763.  
  764. A specific condition corresponds to a bit in the call mask:
  765.  
  766. Mask Bit                Condition
  767. --------------------------------------------------
  768.    0                    cursor location changed
  769.    1                    left button pressed
  770.    2                    left button released
  771.    3                    right button pressed
  772.    4                    right button released
  773.    5                    middle button pressed
  774.    6                    middle button released
  775.    7 - 15               not used
  776.  
  777.  
  778.  
  779.                                  page 13
  780.  
  781. In order to call the event handler routine, set the mask bit to 1 and put the
  782. mask in at CX (G3%).  To disable, set the mask bit to 0 and put the mask in at
  783. CX (G3%).  Always be sure to set the call mask to 0 before the program finishes.
  784. (Leave the system in the same state upon exit as if was upon entrance.)
  785.  
  786. 8086 Register
  787. Input:  AX = 12
  788.         CX = call mask
  789.         ES:DX = pointer to event handler routine
  790. Return: none
  791.  
  792. BASIC
  793. Input:  G1% = 12
  794.         G3% = call mask
  795.         G4% = pointer to event handler routine
  796. Return: none
  797.  
  798. Example:
  799.  
  800.  
  801. 110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed
  802. 120 G1% = 12
  803. 130 G3% = &H002A  :  G4% = BUTTDOWN%
  804. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  805.  
  806. Function 13: Enable Light Pen Emulation Function
  807.  
  808. Function 13 permits the mouse to act like a light pen.  When in this mode, calls
  809. to the pen function will give the cursor coordinates at the last pen down
  810. location.
  811.  
  812. Note that the status of "pen down" and "pen off-screen" is controlled by the
  813. mouse buttons:  all buttons up, pen off-screen; one button pressed, pen down.
  814.  
  815. Light pen emulation is ON after each call to function 0 (Reset Mouse Driver).
  816.  
  817. 8086 Register
  818. Input:  AX = 13
  819. Return: none
  820.  
  821. BASIC
  822. Input:  G1% = 13
  823. Return: none
  824.  
  825. Example:
  826.  
  827. 110 ' Enable Light Pen Emulation Function
  828. 120 G1% = 13
  829. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  830.  
  831. Function 14: Disable Light Pen Emulation Function
  832.  
  833. Function 14 turns off the light pen emulation mode.  When disabled, any call to
  834. the pen function will give information only about a real light pen.
  835.  
  836. 8086 Register
  837. Input:  AX = 14
  838.  
  839.                                  page 14
  840.  
  841. Return: none
  842.  
  843. BASIC
  844. Input:  G1% = 14
  845. Return: none
  846.  
  847. Example:
  848.  
  849. 110 ' Disable Light Pen Emulation Function
  850. 120 G1% = 14
  851. 130 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  852.  
  853. Function 15: Define Sensitivity (Mouse Motion/Pixel) of Genius Mouse
  854.  
  855. Function 15 defines mouse sensitivity as determined by the mouse motion/pixel
  856. ratio.  This is a way of setting the amount of cursor motion wanted for mouse
  857. movement.  These ratios specify mouse motion per 8 pixels.  These values must
  858. be in the range of 1 to 32767.  With a larger ratio, the cursor movement is
  859. shortened for each mouse movement.
  860.  
  861. Default values:   horizontal ratio - 8  mouse motions to 8 pixels
  862.                   vertical ratio   - 16 mouse motions to 8 pixels
  863.  
  864. Note: 1 mouse motion = 1/200 of an inch increment
  865.  
  866. 8086 Register
  867. Input:  AX = 15
  868.         CX = horizontal mouse motion counts to pixel ratio
  869.         DX = vertical mouse motion counts to pixel ratio
  870. Return: none
  871.  
  872. BASIC
  873. Input:  G1% = 15
  874.         G3% = horizontal mouse motion counts to pixel ratio
  875.         G4% = vertical mouse motion counts to pixel ratio
  876. Return: none
  877.  
  878. Example:
  879.  
  880. 110 ' Define Horizontal Sensitivity as 8
  881. 120 ' Define Vertical Sensitivity as 16
  882. 130 G1% = 15
  883. 140 G3% =  8
  884. 150 G4% = 16
  885. 160 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  886.  
  887. Function 16: Disable Cursor Display in Special Range
  888.  
  889. Function 16 sets up a special range on-screen.  If the cursor moves to this area
  890. or is in this area, it will be disabled.  After a call is made to this function,
  891. it is necessary to call function 1 to enable the cursor again.
  892.  
  893. Define the special range with screen location values using four components:
  894.  
  895.  
  896.  
  897.  
  898.  
  899.                                  page 15
  900.  
  901. Components          Values
  902. --------------------------------------------------------
  903.     1               Left horizontal screen location
  904.     2               Upper vertical screen location
  905.     3               Right horizontal screen location
  906.     4               Lower vertical screen location
  907.  
  908. 8086 Register
  909. Input:  AX = 16
  910.         ES:DX = pointer to special range
  911. Return: none
  912.  
  913. BASIC
  914. Input:  G1% = 16
  915.         G4% = pointer to special range
  916. Return: none
  917.  
  918. Example:
  919.  
  920. 110 ' Disable Cursor Display in (0,0) to (100,100) Range
  921. 120 G1% = 16
  922. 130 RANGE%(1) = 0   : RANGE%(2) = 0
  923. 140 RANGE%(3) = 100 : RANGE%(4) = 100
  924. 150 CALL GMOUSE ( G1%, G2%, G3%, RANGE%(0) )
  925.  .
  926.  .
  927.  .
  928.  
  929. 500 ' Enable Cursor Display Again
  930. 510 G1% = 1
  931. 520 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  932.  
  933. Function 19: Define Double-Speed Threshold
  934.  
  935. Function 19 defines the threshold value (mouse motion per second) for doubling
  936. the cursor's motion.  Should the mouse move faster than the DX (G4%) value, the
  937. cursor motion doubles.  The default value is 64 mouse motions per second.
  938.  
  939. If you should want to disable double-speed, just set the threshold to 32767
  940. (7FFFH) mouse motions/second.
  941.  
  942. 8086 Register
  943. Input:  AX = 19
  944.         DX = threshold speed in mouse motions/second
  945. Return: none
  946.  
  947. BASIC
  948. Input:  G1% = 19
  949.         G4% = threshold speed in mouse motions/second
  950. Return: none
  951.  
  952. Example:
  953.  
  954. 110 ' Define Double-Speed Threshold as 20 Mouse Motions/Second
  955.  
  956.  
  957.  
  958.  
  959.                                  page 16
  960.  
  961. 120 G1% = 19
  962. 130 G4% = 20
  963. 140 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  964. .
  965. .
  966. .
  967.  
  968. 500 ' Disable Double-Speed Threshold Function
  969. 510 G1% = 19
  970. 520 G4% = 256 'MAX. VALUE
  971. 530 CALL GMOUSE ( G1%, G2%, G3%, G4% )
  972.  
  973. Function 20: Swap Event Handler Entry Location
  974.  
  975. Function 20 sets new values for the call mask and event handler routine
  976. address  for mouse  hardware interrupts and return the values that were
  977. previously specified.
  978.  
  979. For detail information to reference Function 12 description.
  980.  
  981. 8086 Register
  982. Input:  AX = 20
  983.         CX = new call mask
  984.         ES:DX = new pointer to event handler routine
  985. Return: CX = old call mask
  986.         ES:DX = old pointer to event handler routine
  987.  
  988. BASIC
  989. Input:  G1% = 20
  990.         G3% = call mask
  991.         G4% = pointer to event handler routine
  992. Return: G3% = old call mask
  993.         G4% = old pointer to event handler routine
  994.  
  995. Example:
  996.  
  997. 100 ' Swap Event Handler Entry Location
  998. 110 ' Active BUTTDOWN Event Handler Routine, When One or More Buttons Pressed
  999. 120 G1% = 20
  1000. 130 G3% = &H002A  :  G4% = BUTTDOWN%
  1001. 140 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1002.  
  1003. Function 21: Get Mouse Driver State Storage Size
  1004.  
  1005. Function 21 returns the size of the buffer required to store the current state
  1006. of the  mouse  driver.  It is used with  functions 22  and 23 when you want to
  1007. temporarily  interrupt a program  that is using the mouse  and execute another
  1008. that also uses the mouse.
  1009.  
  1010. 8086 Register
  1011. Input:  AX = 21
  1012.  
  1013. Return: BX = buffer size required for mouse driver state
  1014.  
  1015. BASIC
  1016. Input:  G1% = 21
  1017.  
  1018.  
  1019.                                  page 17
  1020.  
  1021. Return: G2% = buffer size required for mouse driver state
  1022.  
  1023. Example:
  1024.  
  1025. 110 ' Get Mouse Driver State Storage Size
  1026. 120 G1% = 21
  1027. 130 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1028. 140 STATESIZE% = G2%
  1029.  
  1030. Function 22: Save Mouse Driver state
  1031.  
  1032. Function 22 saves the current mouse driver state in a buffer allocated by your
  1033. program.   It is used with  functions 21  and 23  when you want to temporarily
  1034. interrupt a program  that is using the mouse  and execute another program that
  1035. also uses the mouse.
  1036.  
  1037. Before your program  calls function 22, the program should call function 21 to
  1038. determine  the buffer size required  for saving the  mouse driver state,  then
  1039. allocate the appropriate amount of memory.
  1040.  
  1041. 8086 Register
  1042. Input:  AX = 22
  1043.         ES:DX = pointer to the buffer
  1044. Return: None
  1045.  
  1046. BASIC
  1047. Input:  G1% = 22
  1048.         G4% = pointer to the buffer
  1049. Return: None
  1050.  
  1051. Example:
  1052.  
  1053. 110 ' Save The Mouse Driver State
  1054. 120 G1% = 22
  1055. 130 G4% =  BUFPTR
  1056. 140 ' Assume BUFPTR contains the address of the buffer
  1057. 150 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1058.  
  1059. Function 23: Restore Mouse Driver State
  1060.  
  1061. Function 23 restores the last  mouse driver state saved by function 22.  It is
  1062. used with functions 21 and 22 when you want to temporarily interrupt a program
  1063. that is  using the mouse  and execute another program that also uses the mouse.
  1064. To restore the mouse driver state saved by function 22, call function 23 at the
  1065. end of the interrupt program.
  1066.  
  1067. 8086 Register
  1068. Input:  AX = 23
  1069.         ES:DX = pointer to the buffer
  1070. Return: None
  1071.  
  1072. BASIC
  1073. Input:  G1% = 23
  1074.         G4% = pointer to the buffer
  1075. Return: None
  1076.  
  1077. Example:
  1078.  
  1079.                                  page 18
  1080.  
  1081. 110 ' Restore The Mouse Driver State
  1082. 120 G1% = 23
  1083. 130 G4% =  BUFPTR
  1084. 140 ' Assume BUFPTR contains the address of the buffer
  1085. 150 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1086.  
  1087. Function 29: Set CRT Page Number
  1088.  
  1089. Function 29 specifies the CRT page on which the mouse cursor will be displayed.
  1090.  
  1091. For information on the number of CRT pages available in each display mode your
  1092. adapter supports, see the documentation that came with the graphics adapter.
  1093.  
  1094. 8086 Register
  1095. Input:  AX = 29
  1096.         BX = CRT page for mouse cursor display
  1097. Return: none
  1098.  
  1099. BASIC
  1100. Input:  G1% = 29
  1101.         G2% = CRT page for mouse cursor display
  1102. Return: none
  1103.  
  1104. Example:
  1105.  
  1106. 110 ; Set CRT page 2 for display mouse cursor
  1107. 120 G1% = 29
  1108. 130 G2% = 2
  1109. 140 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1110.  .
  1111.  .
  1112.  .
  1113.  
  1114. 500 ; Enable Cursor Display Again
  1115. 510 G1% = 1
  1116. 520 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1117.  
  1118. Function 30: Read CRT Page Number
  1119.  
  1120. Function 30 returns the number of the CRT page on which the mouse cursor is
  1121. displayed.
  1122.  
  1123. 8086 Register
  1124. Input:  AX = 30
  1125.  
  1126. Return: BX = CRT page number of current cursor display
  1127.  
  1128. BASIC
  1129. Input:  G1% = 30
  1130.  
  1131. Return: G2% = CRT page number of current cursor display
  1132.  
  1133. Example:
  1134.  
  1135. 110 ; Read CRT page number
  1136. 120 G1% = 30
  1137. 130 CALL MOUSE ( G1%, G2%, G3%, G4% )
  1138.  
  1139.                                  page 19
  1140.  
  1141. *** 7 : USING GENIUS MOUSE WITH IBM ENHANCED GRAPHICS ADAPTER
  1142.  
  1143. Within the Genius Mouse driver, you'll find nine EGA functions.  These functions
  1144. permit your program to write to and read from write-only registers.
  1145.  
  1146. The cursor in use is defined as a monochrome cursor with one bit per pixel.  The
  1147. bit masks are determined by function 9 and apply to all active planes.
  1148.  
  1149. In order to make an EGA function call from an Assembly-Language program, first
  1150. load the AX, BX, CX, DX, and ES registers with the values indicated for the
  1151. parameters.  Note that five values must be given for a high level language
  1152. program.  Next, execute software interrupt 16 (10h). The values that are
  1153. returned are intalled in the registers by EGA functions.
  1154.  
  1155. Upon start with DOS, PC BIOS will verify if the EGA BIOS exists.  When this is
  1156. verified, the PC will execute the EGA BIOS, booting up the program to write the
  1157. INT 10h entry vector to the address of the INT 42h vector.  Now, EGA BIOS
  1158. address will be written to INT 10h. Following this, you are able to call EGA
  1159. BIOS (by using INT 10h) and PC video BIOS (by using INT 42h).
  1160.  
  1161. There are twenty functions in EGA BIOS.  (PC BIOS has only 16.) The EGA BIOS
  1162. routines only intercept the BIOS ROM video routines (INT 10h, AH = 13h or less).
  1163.  
  1164. The following indicates nine EGA functions and the corresponding function
  1165. number:
  1166.  
  1167. Function                                             Number (HEX)
  1168. -----------------------------------------------------------------
  1169. Retrieve Single Data                                       F0
  1170. Save Single Data                                           F1
  1171. Retrieve Registers on a Specified Port                     F2
  1172. Save Registers on a Specified Port                         F3
  1173. Retrieve Several Registers Data                            F4
  1174. Save Several Registers Data                                F5
  1175. Reset All Registers as Initial Values                      F6
  1176. Set Initial Values                                         F7
  1177. Get Version Number of Genius Mouse Driver                  FA
  1178.  
  1179. In the above functions, the EGA I/O port number and address are as follows:
  1180.  
  1181. Port No.  Register Name   No. of Registers  Index No.  Address Select Register
  1182. ------------------------------------------------------------------------------
  1183.  00H      CRT Controller         25           0 - 24            3x4H
  1184.  08H      Sequencer               5           0 - 4             3C4H
  1185.  10H      Graphics Controller     9           0 - 8             3CEH
  1186.  18H      Attribute Controlle    20           0 - 19            3C0H
  1187.           Singular Registers
  1188.  20H      Miscellaneous Output    1           ignored           3C2H
  1189.  28H      Feature Control         1           ignored           3xAH
  1190.  30H      Graphics 1 Position     1           ignored           3CCH
  1191.  38H      Graphics 2 Position     1           ignored           3CAH
  1192.  
  1193.   Note: x = B or D depending on the base I/O address;
  1194.         determined by Miscellaneous Output Register bit 1.
  1195.  
  1196.  
  1197.  
  1198.  
  1199.                                  page 20
  1200.  
  1201. Function F0: Retrieve Single Data
  1202.  
  1203. This function retrieves data from a single register.
  1204.  
  1205. Input:  AH = F0H
  1206.         BX = Index number
  1207.         DX = Port number
  1208. Return: BL = Retrieved data from EGA register
  1209.  
  1210.  
  1211. Example:
  1212.  
  1213. FUN_F0     EQU     0f0H         ; Function F0
  1214. ;
  1215. GR_CONTR   EQU     010H         ; Graphics Controller
  1216. MODE_REG   EQU     005H         ; Mode Regisiter
  1217. ;
  1218. GR1_PORT   EQU     030H         ; Graphics 1 Position Register
  1219. GR2_PORT   EQU     038H         ; Graphics 2 Position Register
  1220. ;
  1221. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1222.  
  1223.            ; Retrieve the Mode Register in Graphics Controller
  1224. MODE_REG   DB      00
  1225.            ;
  1226.            MOV     DX, GR_CONTR
  1227.            MOV     BX, MODE_REG
  1228.            MOV     AH, FUN_F0
  1229.            INT     VIDEO
  1230.            MOV     MODE_REG, BL
  1231.  
  1232.  
  1233.            ; Retrieve Graphics 1 Position Data
  1234. GR1_POS    DB      00
  1235.            ;
  1236.            MOV     DX, GR1_POS
  1237.            MOV     AH, FUN_F0
  1238.            INT     VIDEO
  1239.            MOV     GR1_POS, NL
  1240.  
  1241.  
  1242. Function F1: Save Single Data
  1243.  
  1244. This function saves data to an EGA register.  Upon finishing a call to this
  1245. function, the BH and DX values are altered.
  1246.  
  1247. Input:  AH = F1H
  1248.         BL = Index number (Non-single register only)
  1249.            = Data (Single register only)
  1250.         BH = Data (Non-single register only)
  1251.            = Disregard (Single register only)
  1252.         DX = Port number
  1253. Return: None
  1254.  
  1255.  
  1256. Example:
  1257.  
  1258.  
  1259.                                  page 21
  1260.  
  1261. FUN_F1     EQU     0f1H         ; Function F1
  1262. ;
  1263. SEQUENCE   EQU     008H         ; Sequencer
  1264. MASK_REG   EQU     002H         ; Map Mask Register
  1265. ;
  1266. FEAT_PORT  EQU     028H         ; Feature Control Register
  1267. ;
  1268. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1269.  
  1270.            ; Save Map Mask Register of Sequencer
  1271. MAP_MASK   EQU     03H
  1272.            ;
  1273.            MOV     DX, SEQUENCE
  1274.            MOV     BL, MASK_REG
  1275.            MOV     BH, MAP_MASK
  1276.            MOV     AH, FUN_F1
  1277.            INT     VIDEO
  1278.            MOV     MAP_MASK, BL
  1279.  
  1280.  
  1281.            ; Save Feature Control Register
  1282. FEATURE    DB      02H
  1283.            ;
  1284.            MOV     DX, FEAT_PORT
  1285.            MOV     BL, FEATURE
  1286.            MOV     AH, FUN_F1
  1287.            INT     VIDEO
  1288.            MOV     FEATURE, BL
  1289.  
  1290. Function F2: Retrieve Registers on a Specified Port
  1291.  
  1292. This function retrieves data from registers on a specifiπ port.  Upon finishing
  1293. a call to this function, the CX value is altered.
  1294.  
  1295. Input:  AH = F3H
  1296.         CH = Starting index number
  1297.         CL = Number of registers
  1298.         DX = Port number
  1299.         ES:BX = Destination of returned data
  1300. Return: Returned data to destination address
  1301.  
  1302. Example:
  1303.  
  1304. FUN_F2     EQU     0f2H         ; Function F2
  1305. ;
  1306. GR_CONTR   EQU     010H         ; Graphics Controller
  1307. ;
  1308. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1309.  
  1310.  
  1311.            ; Retrieve Four Registers Data from Graphics Controller
  1312. GRAPH_POOL DB      04   DUP (0)
  1313.            ;
  1314.            MOV     DX, DS
  1315.            MOV     ES, DX
  1316.            ;
  1317.  
  1318.  
  1319.                                  page 22
  1320.  
  1321.            MOV     DX, GR_CONTR
  1322.            MOV     BX, OFFSET GRAPH_POOL
  1323.            MOV     CX, 04H
  1324.            MOV     AH, FUN_F2
  1325.            INT     VIDEO
  1326.  
  1327. Function F3: Save Registers on a Specified Port
  1328.  
  1329. This function saves data from registers on a specifiπ port.  Upon finishing a
  1330. call to this function, the BX, CX, and DX values are altered.
  1331.  
  1332. Input:  AH = F3H
  1333.         CH = Starting index number
  1334.         CL = Number of register
  1335.         DX = Port number
  1336.         ES:BX = Address source of incoming data
  1337. Return: None
  1338.  
  1339. Example:
  1340.  
  1341. FUN_F3     EQU     0f3H         ; Function F3
  1342. ;
  1343. ATTR_CONTR EQU     018H         ; Attribute Controller
  1344. ;
  1345. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1346.  
  1347.  
  1348.            ; Save Four Registers Data into Attribute Controller
  1349. PALET_DATA DB      1, 2, 4, 3
  1350.            ;
  1351.            MOV     DX, DS
  1352.            MOV     ES, DX
  1353.            ;
  1354.            MOV     DX, ATTR_CONTR
  1355.            MOV     BX, OFFSET PALET_DATA
  1356.            MOV     CX, 08
  1357.            MOV     AH, FUN_F3
  1358.            INT     VIDEO
  1359.  
  1360. Function F4: Retrieve Several Registers Data At The Same Time
  1361.  
  1362. This function retrieves data from several registers at the same time.  Upon
  1363. finishing a call to this function, the CX value is altered.
  1364.  
  1365. Input:  AH = F4H
  1366.         CX = Number of registers (more than 1)
  1367.         ES:BX = Address of register packet (each consists of 4 bytes;
  1368.                 port  address,  byte 1-2;  index number,  byte 3;
  1369.                 returned data, byte 4)
  1370. Return: Returned data is saved into byte 4
  1371.  
  1372. Example:
  1373.  
  1374. FUN_F4     EQU     0f4H         ; Function F4
  1375. ;
  1376. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1377.  
  1378.  
  1379.                                  page 23
  1380.  
  1381.             ; Retrieve Follow  Registers Data
  1382. TABLE       DW     030H         ; Graphics 1 Position Register
  1383.             DB      00          ; Single Register
  1384.             DB      00          ; Retrieved Data
  1385.             ;
  1386.             DW     010H         ; Graphics Controller
  1387.             DB      05          ; Mode Register
  1388.             DB      00          ; Retrieved Data
  1389.             ;
  1390.             ;
  1391.             MOV    DX, DS
  1392.             MOV    ES, DX
  1393.             ;
  1394.             MOV    BX, OFFSET TABLE
  1395.             MOV    CX, 02
  1396.             MOV    AH, FUN_F4
  1397.             INT    VIDEO
  1398.  
  1399.  
  1400. Function F5: Save Several Registers Data At The Same Time
  1401.  
  1402. This function saves data from several registers at the same time.  Upon
  1403. finishing a call to this function, the CX value is altered.
  1404.  
  1405. Input:  AH = F5H
  1406.         CX = Number of registers (more than 1)
  1407.         ES:BX = Address of register packet (each consists of 4 bytes;
  1408.                 port  number, byte 1-2;  index number,  byte 3;
  1409.                 output data, byte 4)
  1410. Return: None
  1411.  
  1412. Example:
  1413.  
  1414. FUN_F5     EQU     0f5H         ; Function F5
  1415. ;
  1416. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1417.  
  1418.             ; Save Follow Registers Data
  1419. TABLE       DW      20H         ; Miscellaneous
  1420.             DB      00          ; Single Register
  1421.             DB      01          ; Data
  1422.             ;
  1423.             DW      18H         ; Attribute Controller
  1424.             DB      12H         ; Color Plane Enable
  1425.             DB      07H         ; Data
  1426.             ;
  1427.             ;
  1428.             MOV    DX, DS
  1429.             MOV    ES, DX
  1430.             ;
  1431.             MOV    BX, OFFSET TABLE
  1432.             MOV    CX, 02
  1433.             MOV    AH, FUN_F5
  1434.             INT    VIDEO
  1435.  
  1436.  
  1437.  
  1438.  
  1439.                                  page 24
  1440.  
  1441. Function F6: Reset All Registers as Initial Values
  1442.  
  1443. This function resets all values to default values for the specific registers.
  1444. Function 7 sets the default values.
  1445.  
  1446. Input:  AH = F6H
  1447. Return: None
  1448.  
  1449. Example:
  1450.  
  1451. FUN_F6     EQU     0f6H         ; Function F6h
  1452. ;
  1453. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1454.  
  1455.            MOV     AH, FUN_F6
  1456.            INT     VIDEO
  1457.  
  1458. Function F7: Set Initial Values
  1459.  
  1460. This function sets the initial default values.  Upon finishing a call to this
  1461. function, the BX and DX values are altered.
  1462.  
  1463. Input:  AH = F7H
  1464.         DX = Port number
  1465.         ES:BX = Table of output data
  1466. Return: None
  1467.  
  1468. Example:
  1469.  
  1470. FUN_F7     EQU     0f7H         ; Function F7
  1471. ;
  1472. ATTR_CONTR EQU     018H         ; Attribute Controller
  1473. ;
  1474. VIDEO      EQU     010H         ; BIOS ROM Video Routine Entry
  1475.  
  1476.            ; Setting Initial Values for the Attribute Controller
  1477. ATTR_DATA  DB      1,  2,  4,  3,  5,  6,  0,  7
  1478.            DB      0,  0,  0,  0,  0,  0,  0,  0
  1479.            DB      0,  0, 0fh, 0
  1480.            ;
  1481.            MOV     DX, DS
  1482.            MOV     ES, DX
  1483.            ;
  1484.            MOV     DX, ATTR_CONTR
  1485.            MOV     BX, OFFSET ATTR_DATA
  1486.            MOV     AH, FUN_F7
  1487.            INT     VIDEO
  1488.  
  1489. Function FA: Get Version Number of Genius Mouse Driver
  1490.  
  1491. This function will give the Genius Mouse driver version number.
  1492.  
  1493. Input:  AH = FAH
  1494.         BX = 00H
  1495. Return: ES:BX = Pointer to Genius Mouse driver version number.
  1496.  
  1497.  
  1498.  
  1499.                                  page 25
  1500.  
  1501.