home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / mouse / rodent.arc / GMOUSE.DOC < prev    next >
Encoding:
Text File  |  1987-09-28  |  28.4 KB  |  1,273 lines

  1.  
  2.  
  3.  
  4.           GMOUSE.DOC - GENIUS MOUSE Programming Interface
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                Programmer's Reference Manual
  23.  
  24.  
  25.  
  26.                    GENIUS-MOUSE DRIVER
  27.                    Serial Mouse Version
  28.                   Release 7.01
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. KUN YING ENTERPRISE CO.,LTD.
  48. RM. 1311,NO.41,SEC 1,
  49. CHUNG HSIAO W. RD.
  50. TAIPEI, TAIWAN, R.O.C.
  51. P.O. BOX: 22826 TAIPEI
  52. TEL: 3813682 3318779 3118545 3822228
  53. TELEX: 11388 KUNYING
  54. FAX: 2-361-5300
  55.  
  56.  
  57.  
  58.  
  59.                                page 1
  60.  
  61.  
  62.  
  63. Introduction
  64.  
  65.  
  66. The following provides information to programmers who want
  67. to include support for GENIUS-MOUSE in their application
  68. programs. This document includes descriptions of the
  69. graphics and text cursors, and descriptions of the mouse
  70. functions.
  71.  
  72. This protocol is compatible with the protocol of Microsoft
  73. Corp. as it is documented in the installation and operation
  74. manual published by Microsoft Corp. entitled Microsoft (R)
  75. Mouse User's Guide for IBM (R) Personal Computers.
  76.  
  77. These notes apply to the GENIUS Serial Mouse Driver
  78. (mouse.com and mouse.sys) Release 5.01.
  79.  
  80.  
  81.  
  82. Cursor Descriptions - Text and Graphics Cursors
  83.  
  84. The characteristics of the cursor are determined by
  85. Functions 9 and 10. GENIUS MOUSE has both text and graphics
  86. cursors available. The graphics cursor is a shape that
  87. moves over the images on the screen. The shape can include
  88. an arrow, a sight mark, or others. The software text cursor
  89. is a character attribute that moves from character to
  90. character on the screen. The hardware text cursor is a
  91. moving, sometimes flashing block which also moves from
  92. character to character on the screen. The three cursors are
  93. exclusive - only one can be on the screen at one time. You
  94. have the option of choosing which cursor will appear on the
  95. screen and of switching from one cursor to the other.
  96.  
  97.  
  98. Graphics Cursor
  99.  
  100. The graphics cursor is an array of pixels (normally 16 by
  101. 16).  It is defined by two arrays of bits called the screen
  102. mask and the cursor mask.
  103.  
  104. The screen mask is used to determine which of the cursor
  105. pixels becomes are part of the shape (1) or of the
  106. background (0) (it is ANDed with the screen contents).    The
  107. cursor mask is used to determine which of the pixels of the
  108. cursors contribute to the color/shape of the cursor (it is
  109. XORed with the result of the previous operation).
  110.  
  111.  
  112.  
  113.                                page 2
  114.  
  115.  
  116.  
  117. The operational behaviour of these bit arrays are
  118. summarized by the following table:
  119.  
  120. screen mask   cursor mask    resulting screen bit
  121.  0           0          0
  122.  0           1          1
  123.  1           0          unchanged
  124.  1           1          inverted
  125.  
  126.  
  127. Note that when a mouse function refers to the graphics
  128. cursor location it is referring to the point on the screen
  129. that lies directly under the cursor's target area. The
  130. target area is the point in the cursor block that the mouse
  131. software uses to determine the cursor coordinates. This
  132. point is called the hot spot of the cursor. The upper left
  133. corner of the cursor block is the hot spot for the default
  134. graphic cursor.
  135.  
  136.  
  137.  
  138. Text Cursor
  139.  
  140. The text cursor is a cursor that can be used when the video
  141. is in one of the text modes.
  142.  
  143. Two kind of text cursors are supported: a hardware text
  144. cursor and a software text cursor.
  145.  
  146. The hardware text cursor is the cursor actually placed on
  147. the screen by the video controller itself. It is defined in
  148. terms of the scan lines of the character cell numbered from
  149. 0 starting from the top scan line. The numbers of scan
  150. lines on a character cell depends on the actual video
  151. controller and monitor (see the controller documentation
  152. for details).
  153.  
  154. The software text cursor is a character or a character
  155. attribute that replaces and/or modifies the character cell
  156. on the screen where it is positioned.
  157.  
  158. The behaviour of this cursor is defined by 2 16-bit values.
  159.  
  160. The format of the two values is the following:
  161.  
  162. bit     description
  163. 15     blinking (1) or non blinking (0) character
  164. 14-12     background color
  165. 11     high intensity (1) or medium intensity (0)
  166. 10-8     foreground color
  167. 7-0     character code
  168.  
  169.  
  170.                                page 3
  171.  
  172.  
  173.  
  174. The two values are called the screen mask and the cursor
  175. mask.  The screen mask is used to determine which of the
  176. character attributes are preserved (it is ANDed with the
  177. screen character and attribute).  The cursor mask is used
  178. to determine which of the characteristics are changed by
  179. the cursor (it is XORed with the result of the previous
  180. operation).
  181.  
  182.  
  183.  
  184. Notice to System Programmers
  185.  
  186. System programmers who intercept the video i/o software
  187. interrupt (int 10h) should exercise utmost care, and note
  188. the following:
  189.  
  190. The program should guarantee that video mode changes
  191. (function 0) are intercepted by the mouse driver. The mouse
  192. driver guarantees consistency of the screen contents to
  193. programs that write on the screen via int 10h (or via
  194. DOS).
  195.  
  196. Some programs write directly on the video memory.  In this
  197. case the application program should use function 2 (hide
  198. cursor) or 16 (conditional hide cursor) before writing,
  199. then function 1 (show cursor) after writing.  GWBASIC is an
  200. example of such a program.
  201.  
  202.  
  203. The presence of the mouse driver can also be detected by
  204. checking the interrupt vector entry for interrupt 51 in low
  205. memory for value 0 or for pointing to an IRET instruction.
  206. This method should be used with some care as it is
  207. dependent on the release of DOS.
  208.  
  209.  
  210. The programming interface uses the 8086 software interrupt
  211. 51. Parameter values are passed and returned via 8086
  212. registers. This interface can be used from assembly
  213. language programs or from high level language programs such
  214. as BASIC , FORTRAN , COBOL , C or Pascal.
  215.  
  216. You can also let the mouse software call a subroutine in your
  217. program whenever a specific condition occurs. When this
  218. capability is enabled, the mouse software interrupts whatever
  219. process is going on and passes execution control to the
  220. subroutine that you have specified in Function 12 of the mouse
  221. system calls.
  222.  
  223.  
  224.                                page 4
  225.  
  226.  
  227.  
  228. Making Calls From Assembly Language Programs :
  229.  
  230. TO make mouse systemcalls from an assembly language program,
  231. you must:
  232.  
  233.  1. Load the AX, BX, CX and DX registers with the parameter
  234.     values.
  235.  
  236.  2. Execute software interrupt 51(33H)
  237.     The AX, BX, CX and DX registers correspond to the M1%,
  238.     M2%, M3%, and M4% parameters. defined for the BASIC program.
  239.     Values returned by the Mouse functions will be placed in the
  240.     registers.
  241.  
  242. Example
  243.  
  244.  Use the following instructions to set the cursor position to 150
  245.  (horizontal) and 100 (vertical):
  246.  
  247.      ; * set cursor to location (150,100)
  248.      Mov  AX,4       ;(function call 4)
  249.      Mov  CX,150   ;(set Horiziontal to 150)
  250.      Mov  DX,100   ;(set vertical to 100)
  251.      Int  51       ;(interrupt to mouse)
  252.  
  253. Note: When making a mouse system call in Assembly Language,
  254.       function 9 and 12 expect a somewhat different.
  255.       Value for the fourth parameter than when calling from a
  256.       Basic program.
  257.  
  258.  
  259.  
  260.  
  261.                                page 5
  262.  
  263.  
  264.  
  265. Making Calls from BASIC (BASICA) Language Program :
  266.  
  267.  
  268. It is possible to make a mouse system call from a BASIC
  269. program running under the GWBASIC interpreter.    The
  270. following shows how to make these calls.
  271.  
  272. Insert an initialization sequence such as:
  273.  
  274.     10    DEF SEG=0
  275.     20    MSEG=256*PEEK(51*4+3)+PEEK(51*4+2)
  276.     30    MOUSE=256*PEEK(51*4+1)+PEEK(51*4)+2
  277.     40    DEF SEG=MSEG
  278.  
  279. Be sure that the statements appear before any calls to
  280. mouse functions.  Then use the CALL statement to make the
  281. call.
  282.  
  283.     CALL MOUSE(M1%,M2%,M3%,M4%)
  284.  
  285. where MOUSE is the variable containing the entry offset of
  286. the mouse software, and M1%, M2%, M3%, and M4% are the
  287. names of the integer variables you have chosen for
  288. parameters in this call.  They correspond to the values for
  289. AX, BX, CX, and DX which are described in this document.
  290. As an example:
  291.  
  292.     100  'Set minimum and maximum horizontal position to
  293.      '(320,100)
  294.     200  M1%=7 'function number is 7
  295.     300  M3%=0 'minimum coordinate
  296.     400  M4%=639 'maximum coordinate
  297.     500  CALL MOUSE(M1%,M2%,M3%,M4%)
  298.  
  299.  
  300.  
  301.  
  302.                                page 6
  303.  
  304.  
  305. List of Mouse Functions
  306.  
  307. The following functions apply to GENIUS MOUSE. These functions
  308. will be described in greater detail in subsequent sections.
  309.  
  310.  
  311.  
  312.      FUNCTIONS        FUNCTION NUMBER
  313.  
  314. Base Functions
  315.  
  316. Mouse Initialization                0
  317. Show Cursor                    1
  318. Hide Cursor                    2
  319. Get Mouse Position & Button Status        3
  320. Set Mouse Cursor Position            4
  321. Get Button Press Information            5
  322. Get Button Release Information            6
  323. Set Minimum & Maximum X Position        7
  324. Set Minimum & Maximum Y Position        8
  325. Define Graphics Cursor Block            9
  326. Define Text Cursor                   10
  327. Read Mouse Motion Counters               11
  328. Define Event Handler                   12
  329. Light Pen Emulation Mode On               13
  330. Light Pen Emulation Mode Off               14
  331. Set Mouse Motion/Pixel Ratio               15
  332. Condition Off                       16
  333. Set Double-Speed Threshold               19
  334.  
  335.  
  336.  
  337.                                page 7                                page 6
  338.  
  339.  
  340.  
  341. Description of the Mouse Functions
  342.  
  343. The following descriptions of the mouse functions specify
  344. the required input and the expected output of each
  345. function. The descriptions also include any special
  346. circumstances involved with each function. The input and
  347. output parameters are specified as values for 8086
  348. registers and parameter for BASIC Language.
  349.  
  350.  
  351.  
  352. Mouse Initialization - Function 0
  353. ***********************************
  354.  
  355. This function describes whether the mouse hardware and
  356. software are installed. The mouse status is 0 if the mouse
  357. hardware and software are not installed and -1 if the
  358. hardware and software are installed.
  359.  
  360. 8086 register :
  361.     Input
  362.      AX = 0
  363.  
  364.     Output
  365.      AX = mouse status
  366.      BX = number of buttons
  367.  
  368. Basic:
  369.  
  370.     Input
  371.      M1% = 0
  372.  
  373.     Output
  374.      M1% = Mouse status
  375.      M2% = number of Buttons
  376.  
  377. Example:
  378.  
  379.     100  :  Is mouse present ? if not error
  380.     200     M1% = 0
  381.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  382.     500     IF NOT (M1%) THEN PRINT "Mouse not installed" : END
  383.  
  384.  
  385.  
  386.  
  387.                                page 8
  388.  
  389.  
  390.  
  391.  
  392. Show Cursor - Function 1
  393. **************************
  394.  
  395. This function increments the internal cursor flag. If the
  396. flag is 0 it displays the cursor on the screen. The cursor
  397. tracks the motion of the mouse, changing position as the
  398. mouse changes position.
  399.  
  400. 8086 register :
  401.  
  402.     Input
  403.      AX = 1
  404.  
  405.     Output
  406.      none
  407.  
  408. Basic:
  409.  
  410.     Input
  411.      M1% = 1
  412.  
  413.     Output
  414.      none
  415.  
  416. Example:
  417.  
  418.     100  :  show the cursor
  419.     200     M1% = 1
  420.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  421.  
  422.  
  423.  
  424.  
  425.  
  426.                                page 9
  427.  
  428.  
  429.  
  430. Hide Cursor - Function 2
  431. **************************
  432.  
  433. This function removes the cursor from the screen and
  434. decrements the internal cursor flag. Although the cursor is
  435. hidden it still tracks the motion of the mouse, changing
  436. position as the mouse changes position.
  437.  
  438. 8086 register :
  439.  
  440.     Input
  441.      AX = 2
  442.  
  443.     Output
  444.      none
  445.  
  446.  
  447. Basic:
  448.  
  449.     Input
  450.      M1% = 2
  451.  
  452.     Output
  453.      none
  454.  
  455. Example:
  456.  
  457.     100  :  Hide the cursor
  458.     200     M1% = 2
  459.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.                                page 10
  466.  
  467.  
  468.  
  469. Get Mouse Position & Button Status - Function 3
  470. *************************************************
  471.  
  472. This function reports the status of the buttons. It also
  473. reports the position of the cursor horizontally and
  474. vertically. The button status is a single integer value
  475. with bit 0 representing the left button and bit 1 the
  476. right. When the button is down a bit is 1 and when the
  477. button is up a bit is 0.
  478.  
  479. 8086 register :
  480.  
  481.     Input
  482.      AX = 3
  483.  
  484.  
  485.     Output
  486.      BX = button status
  487.      CX = horizontal cursor position
  488.      DX = vertical cursor position
  489.  
  490. Basic :
  491.  
  492.     Input
  493.      M1% = 3
  494.  
  495.     Output
  496.      M2% = button status
  497.      M3% = cursor position
  498.      M4% = cursor position
  499.  
  500. Example :
  501.  
  502.     100  :  Get current cursor positions, check button status
  503.     200     M1% = 3
  504.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  505.     400     IF M2% AND 1 THEN PRINT "LEFT Button Down"
  506.     500     IF M2% AND 2 THEN PRINT "RIGHT Button Down"
  507.  
  508.  
  509.  
  510.  
  511.  
  512.                                page 11
  513.  
  514.  
  515. è
  516.  
  517. Set Mouse Cursor Position - Function 4
  518. ****************************************
  519.  
  520. This function sets the cursor to the specified horizontal
  521. and vertical positions on the screen. The new values must
  522. be within the specified ranges of the virtual screen. If
  523. you are not using a high resolution screen the values are
  524. rounded to the nearest values permitted by the screen for
  525. horizontal and vertical positions.
  526.  
  527. 8086 register :
  528.  
  529.     Input
  530.      AX = 4
  531.      CX = new horizontal cursor position
  532.      DX = new vertical cursor position
  533.  
  534.     Output
  535.      none
  536.  
  537. Basic:
  538.  
  539.     Input
  540.      M1% = 4
  541.      M3% = (horixontal) new cursor position
  542.      M4% = (vertical) new cursor position
  543.  
  544. Example:
  545.  
  546.     100  ;  Put corsor in center of screen
  547.     200     M1% = 4
  548.     300     M3% = INT(Hmax/2)
  549.     400     M4% = INT(Vmax/2)
  550.     500     CALL Mouse(M1%,M2%,M3%,M4%)
  551.  
  552.  
  553.  
  554.  
  555.                                page 12
  556.  
  557.  
  558.  
  559. Get Button Press Information - Function 5
  560. *********************************************
  561.  
  562. This function reports on the current button status.  It
  563. gives a count of button presses since the last call to
  564. Function 5, and it gives the horizontal and vertical
  565. position of the cursor the last time the button was
  566. pressed.
  567.  
  568. The BX parameter indicates which button was pressed. If BX
  569. is 0, the left button is checked.  If BX is 1, the right
  570. button is checked. The button status is a single integer
  571. value. Bit 0 represents the left button and bit 1 the
  572. right. If the button is down a bit is 1 and if it is up a
  573. bit is 0.
  574.  
  575. 8086 register :
  576.  
  577.     Input
  578.      AX = 5
  579.      BX = button
  580.  
  581.  
  582.     Output
  583.      AX = button status
  584.      BX = number of button presses
  585.      CX = horizontal cursor position at last press
  586.      DX = vertical cursor position at last press
  587.  
  588. Basic :
  589.  
  590.     Input
  591.      M1% = 5
  592.      M2% = Button
  593.  
  594.     Output
  595.      M1% = Button status
  596.      M2% = number of Button presses
  597.      M3% = horizontal cursor position at last press
  598.      M4% = vertical cursor positin at last press
  599.  
  600. Example :
  601.  
  602.     100  ;  Get cursor position at last button press
  603.     200     M1% = 5
  604.     300     M2% = 0
  605.     400     CALL Mouse(M1%,M2%,M3%,M4%)
  606.     500     IF (M1% AND 1) THEN PRINT "LEFT Button Down"
  607.  
  608.  
  609.  
  610.                                page 13
  611.  
  612.  
  613. è
  614.  
  615. Get Button Release Information - Function 6
  616. *********************************************
  617.  
  618. This function reports on the current button status. It
  619. reports a count of the button releases since the last call
  620. to Function 6, and it gives the horizontal and vertical
  621. position of the cursor since the last time the button was
  622. released.
  623.  
  624. The BX parameter specifies which button is checked. If BX
  625. is 0, the left button is checked. If BX is 1, the right
  626. button is checked. The button status is a single integer
  627. value. Bit 0 represents the left button and bit 1
  628. represents the right button. If a button is down a bit is 1
  629. and if a bit is 0 a button is up.
  630.  
  631. 8086 register :
  632.  
  633.     Input
  634.      AX = 6
  635.      BX = button
  636.  
  637.  
  638.     Output
  639.      AX = button status
  640.      BX = number of button releases
  641.      CX = horizontal cursor position at last release
  642.      DX = vertical cursor position at last release
  643.  
  644. Basic :
  645.  
  646.     Input
  647.      M1% = 6
  648.      M2% = Button
  649.  
  650.     Output
  651.      M1% = button status
  652.      M2% = number of button releases
  653.      M3% = horizontal cursor position at last release
  654.      M4% = vartical cursor position at last release
  655.  
  656. Example :
  657.  
  658.     100  ; Get cursor position at last button release
  659.     200    M1% = 6
  660.     300    M2% = 1
  661.     400    CALL Mouse(M1%,M2%,M3%,M4%)
  662.     500    IF (M1% AND 2) THEN PRINT "RIGHT Button Down"
  663.  
  664.  
  665.  
  666.                                page 14
  667.  
  668.  
  669.  
  670. Set Minimum & Maximum X Position - Function 7
  671. ************************************************
  672.  
  673. This function sets the minimum and maximum possible cursor
  674. positions on the screen. All cursor movement is restricted
  675. to this area once the area is set. The virtual screen
  676. determines the maximum and minimum values.
  677. If the cursor is outside the defined area when the call is
  678. made, it moves to just inside the area. If the minimum
  679. value is greater than the maximum the two values are
  680. exchanged.
  681.  
  682. 8086 register :
  683.  
  684.     Input
  685.      AX = 7
  686.      CX = new minimum horizontal cursor position
  687.      DX = new maximum horizontal cursor position
  688.  
  689.     Output
  690.      none
  691.  
  692. Basic :
  693.  
  694.     Input
  695.      M1% = 7
  696.      M3% = new minimum horizontal cursor position
  697.      M4% = new maximum horizontal cursor position
  698.  
  699.     Output
  700.      none
  701.  
  702. Example :
  703.  
  704.     100  ;  Limit cursor to horizontal position between
  705.         50 and 200
  706.     200     M1% = 7
  707.     300     M3% = 50
  708.     400     M4% = 200
  709.     500     CALL Mouse(M1%,M2%,M3%,M4%)
  710.  
  711.  
  712.  
  713.  
  714.                                page 15
  715.  
  716.  
  717. è
  718.  
  719. Set Minimum & Maximum Y Position - Function 8
  720. ***********************************************
  721.  
  722. This function sets the minimum and maximum possible cursor
  723. positions on the screen. All cursor movement is restricted
  724. to this area once the area is set. The virtual screen
  725. determines the maximum and minimum values.
  726.  
  727. If the cursor is outside the defined area when the call is
  728. made, it moves to just inside the area. If the minimum
  729. value is greater than the maximum the two values are
  730. switched.
  731.  
  732. 8086 register :
  733.  
  734.     Input
  735.      AX = 7
  736.      CX = new minimum vertical cursor position
  737.      DX = new maximum vertical cursor position
  738.  
  739.     Output
  740.      none
  741.  
  742. Basic :
  743.  
  744.     Input
  745.      M1% = 7
  746.      M3% = new minimum vertical cursor position
  747.      M4% = new Maximum vertical cursor position
  748.  
  749.     Output
  750.      none
  751.  
  752. Example :
  753.  
  754.     100  ;  Limit cursor to vertical position between
  755.         100 and 200
  756.     200     M1% = 8
  757.     300     M3% = 100
  758.     400     M4% = 200
  759.     500     CALL Mouse(M1%,M2%,M3%,M4%)
  760.  
  761.  
  762.  
  763.                                page 16
  764.  
  765.  
  766.  
  767. Define Graphics Cursor Block - Function 9
  768. *******************************************
  769.  
  770. This function determines what the shape and color of the
  771. cursor will be when it is in graphics mode, and it
  772. identifies the center of the cursor. The cursor block is a
  773. 16 X 16 bit pattern. The cursor hot spot values must be
  774. within the range of -16 to 16. They define one pixel within
  775. (or outside) the cursor block.
  776. 8086 register :
  777.  
  778.     Input
  779.      AX = 9
  780.      BX = horizontal cursor hot spot
  781.      CX = vertical cursor hot spot
  782.      DX = pointer toscreen and cursor mask
  783.  
  784.     Output
  785.      none
  786.  
  787. Basic :
  788.  
  789.     Input
  790.      M1% = 9
  791.      M2% = horizontal cursor hot spot
  792.      M3% = vertical cursor hot spot
  793.      M4% = pointer to sereen and cursor mask
  794.  
  795.  
  796.  
  797.  
  798.                                page 17
  799.  
  800.  
  801. è
  802.  
  803. Example :
  804.  
  805.      100  ;
  806.      200  ;  Define the screen mask
  807.      300  ;
  808.      400     cursor(0,0)  = &hffff      '1111111111111111
  809.      500     cursor(1,0)  = &hffff      '1111111111111111
  810.      600     cursor(2,0)  = &hffff      '1111111111111111
  811.      700     cursor(3,0)  = &hffff      '1111111111111111
  812.      800     cursor(4,0)  = &hffff      '1111111111111111
  813.      900     cursor(5,0)  = &hffff      '1111111111111111
  814.     1000     cursor(6,0)  = &hffff      '1111111111111111
  815.     1100     cursor(7,0)  = &hffff      '1111111111111111
  816.     1200     cursor(8,0)  = &hffff      '1111111111111111
  817.     1300     cursor(9,0)  = &hffff      '1111111111111111
  818.     1400     cursor(10,0) = &hffff      '1111111111111111
  819.     1500     cursor(11,0) = &hffff      '1111111111111111
  820.     1600     cursor(12,0) = &hffff      '1111111111111111
  821.     1700     cursor(13,0) = &hffff      '1111111111111111
  822.     1800     cursor(14,0) = &hffff      '1111111111111111
  823.     1900     cursor(15,0) = &hffff      '1111111111111111
  824.     2000  ;
  825.     2100  ;  Define the cursor mask
  826.     2200  ;
  827.     2300     cursor(0,1)  = &h8000       '1000000000000000
  828.     2400     cursor(1,1)  = &hf000       '1110000000000000
  829.     2500     cursor(2,1)  = &hf800       '1111100000000000
  830.     2600     cursor(3,1)  = &hff00       '1111111000000000
  831.     2700     cursor(4,1)  = &hd800       '1101100000000000
  832.     2800     cursor(5,1)  = &h0c00       '0000110000000000
  833.     2900     cursor(6,1)  = &h0600       '0000011000000000
  834.     3000     cursor(7,1)  = &h0300       '0000001100000000
  835.     3100     cursor(8,1)  = &h0000       '0000000000000000
  836.     3200     cursor(9,1)  = &h0000       '0000000000000000
  837.     3300     cursor(10,1) = &h0000       '0000000000000000
  838.     3400     cursor(11,1) = &h0000       '0000000000000000
  839.     3500     cursor(12,1) = &h0000       '0000000000000000
  840.     3600     cursor(13,1) = &h0000       '0000000000000000
  841.     3700     cursor(14,1) = &h0000       '0000000000000000
  842.     3800     cursor(15,1) = &h0000       '0000000000000000
  843.     3900  ;
  844.     4000  ;  Set the mouse cursor shape, color, and
  845.     4050  ;  hot spot
  846.     4100  ;
  847.     4200     M1% = 9
  848.     4300     M2% = 0 'horixontal hot spot
  849.     4400     M3% = 0 'vartical hot sopt
  850.     4500     CALL Mouse(M1%,M2%,M3%,cursor(0,0))
  851.  
  852.  
  853.  
  854.                                page 18
  855.  
  856.  
  857. Define Text Cursor - Function 10
  858. **********************************
  859.  
  860. This function selects the software or hardware cursor. When
  861. the hardware cursor is selected this function sets the
  862. first and last scan lines which will be shown on the
  863. screen. The value of the parameter BX selects the cursor
  864. type. If the value is 0, the software text cursor is
  865. selected. If the value is 1, the hardware text cursor is
  866. selected. When the software text cursor is selected, the
  867. values of parameters CX and DX specify the screen and
  868. cursor masks. When the hardware cursor is selected, the
  869. parameters of CX and DX must contain the line numbers of
  870. the first and last scan line in the cursor to be shown on
  871. the screen.
  872.  
  873. 8086 register :
  874.  
  875.     Input
  876.      AX = 10
  877.      BX = select cursor
  878.      CX = screen mask value/scan line start
  879.      DX = cursor mask value/scan line stop
  880.  
  881.     Output
  882.      none
  883.  
  884. Basic :
  885.  
  886.     Input
  887.      M1% = 10
  888.      M2% = select cursor
  889.      M3% = screen mask value/scan line start
  890.      M4% = cursor mask value/scan line stop
  891.  
  892. Example :
  893.  
  894.     TO create a text crusor that inverts the foregrand
  895.     and backgrand colors:
  896.  
  897.     100     M1% = 10
  898.     110     M2% = 0
  899.     120     M3% = &hffff
  900.     130     M4% = &h7700
  901.     140     CALL Mouse(M1%,M2%,M3%,M4%)
  902.  
  903.  
  904.  
  905.  
  906.                                page 19
  907.  
  908.  
  909. è
  910.  
  911. Read Mouse Motion Counters - Function 11
  912. ******************************************
  913.  
  914.  
  915. This function returns the horizontal and vertical step
  916. count, which is the distance the mouse has moved in 1/200
  917. inch increments, since the last call to this function.
  918. With the Default Accelerator installed the ratio of mouse
  919. to cursor movement is variable between 1/200 and 1/400.
  920. The step count is always within the range -32768 to 32767.
  921. A positive horizontal count specifies a motion to the right
  922. while a positive vertical count specifies a motion to the
  923. bottom of the screen. The step count is set to 0 after the
  924. call is completed.
  925.  
  926. 8086 register :
  927.  
  928.     Input
  929.      AX = 11
  930.  
  931.  
  932.     Output
  933.      CX = horizontal count
  934.      DX = vertical count
  935.  
  936. Basic :
  937.  
  938.     Input
  939.      M1% = 11
  940.  
  941.     Output
  942.      M3% = horizontal count
  943.      M4% = vertical count
  944.  
  945. Example :
  946.  
  947.     100  ;  Get the Michey count
  948.     200     M1% = 11
  949.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  950.  
  951.  
  952.  
  953.                                page 20
  954.  
  955.  
  956. Define Event Handler - Function 12
  957. ************************************
  958.  
  959. This routine sets the call mask and subroutine address for
  960. the mouse software interrupts. The software interrupts stop
  961. execution of your program and call the specified subroutine
  962. whenever one or more of the conditions defined by the call
  963. mask occur. The call mask is a single integer value which
  964. defines the conditions which will cause an interrupt. Each
  965. bit in the call mask corresponds to a specific condition:
  966.  
  967.     Mask Bit  Condition
  968.  
  969.     0          change cursor position
  970.     1          press left button
  971.     2          release left button
  972.     3          press right button
  973.     4          release right button
  974.     5-15      not used
  975.  
  976. 8086 register :
  977.  
  978.     Input
  979.      AX = 12
  980.      CX = call mask
  981.      ES:DX = address of subroutine
  982.  
  983.     Output
  984.      none
  985.  
  986. Basic :
  987.  
  988.     Input
  989.      M1% = 12
  990.      M3% = call mask
  991.      M4% = ADDRESS offset to subroutine
  992.  
  993.     Output
  994.      none
  995.  
  996. Example :
  997.  
  998.     100  ;   Call subroutine SKETCH on Left Button press
  999.     200      M1% = 12
  1000.     300      M3% = &h0002
  1001.     400      M4% = SKETCH%
  1002.     500      CALL Mouse(M1%,M2%,M3%,M4%)
  1003.  
  1004.  
  1005.  
  1006.  
  1007.                                page 21
  1008.  
  1009. è
  1010.  
  1011.  
  1012. Light Pen Emulation Mode On - Function 13
  1013. ********************************************
  1014.  
  1015. This function enables light pen emulation by the mouse.
  1016. When the mouse emulates the light pen, calls to the pen
  1017. function will return the cursor position at the last pen
  1018. down which is controlled by the mouse buttons. The pen is
  1019. down when both buttons are down. The pen is off the screen
  1020. when both buttons are up.
  1021.  
  1022. 8086 register :
  1023.  
  1024.     Input
  1025.      AX = 13
  1026.  
  1027.     Output
  1028.      none
  1029.  
  1030. Basic :
  1031.  
  1032.     Input
  1033.      M1% = 13
  1034.  
  1035.     Output
  1036.      none
  1037.  
  1038. Example :
  1039.  
  1040.     100  ;  Enable Light pen
  1041.     200     M1% = 13
  1042.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  1043.  
  1044.  
  1045.  
  1046.  
  1047.                                page 22
  1048.  
  1049.  
  1050. Light Pen Emulation Mode Off - Function 14
  1051. *******************************************
  1052.  
  1053. This function disables the light pen emulation mode. When
  1054. light pen simulation is disabled, calls to the pen function
  1055. return information about the light pen only.
  1056.  
  1057. 8086 register :
  1058.  
  1059.     Input
  1060.      AX = 14
  1061.      CX = new horizontal cursor position
  1062.      DX = new vertical cursor position
  1063.  
  1064.     Output
  1065.      none
  1066.  
  1067. Basic :
  1068.  
  1069.     Input
  1070.      M1% = 14
  1071.      M3% = new horizontal cursor position
  1072.      M4% = new vertical cursor position
  1073.  
  1074. Example :
  1075.  
  1076.     100  ;  Disable Light pen
  1077.     200     M1% = 14
  1078.     300     CALL Mouse(M1%,M2%,M3%,M4%)
  1079.  
  1080.  
  1081.  
  1082.  
  1083.                                page 23
  1084.  
  1085.  
  1086. Set Mouse Motion/Pixel Ratio - Function 15
  1087. *********************************************
  1088.  
  1089. This function sets the mouse motion to screen pixel ratio.
  1090.  
  1091. The horizontal and vertical ratios specify the amount of
  1092. mouse motion at 8 pixels with the values falling within the
  1093. range of 1 to 32767. The default values are 8 steps to 8
  1094. pixels horizontally and 16 steps to 8 pixels vertically.
  1095. This is equivalent to 3.2 inches of horizontal mouse
  1096. movement and 2.0 inches of vertical mouse movement.
  1097.  
  1098. 8086 register :
  1099.  
  1100.     Input
  1101.      AX = 15
  1102.      CX = horizontal step to pixel ratio
  1103.      DX = vertical step to pixel ratio
  1104.  
  1105.     Output
  1106.      none
  1107.  
  1108. Basic :
  1109.  
  1110.     Input
  1111.      M1% = 15
  1112.      M3% = horizontal step to pixel ratio
  1113.      m4% = vertical step to pixel ratio
  1114.  
  1115.     Output
  1116.      none
  1117.  
  1118. Example :
  1119.  
  1120.     100  ;  Set mickey/pixel ratio at 16 to 8 AND 32 TO 8
  1121.     200     M1% = 15
  1122.     300     M3% = 16
  1123.     400     M4% = 32
  1124.     500     CALL Mouse(M1%,M2%,M3%,M4%)
  1125.  
  1126.  
  1127.  
  1128.                                page 24
  1129.  
  1130.  
  1131. Conditional Off - Function 16
  1132. *******************************
  1133.  
  1134. This function allows the user to define an area on the
  1135. screen within which the mouse will turn off. Performing the
  1136. Show Cursor Function - Function 1 - resets the region and
  1137. turns the mouse back on. This function is used to guard a
  1138. portion of the screen which your program is about to
  1139. update.
  1140.  
  1141. 8086 register :
  1142.  
  1143.     Input
  1144.      AX = 16
  1145.      CX = left margin
  1146.      DX = top margin
  1147.      SI = right margin
  1148.      DI = bottom margin
  1149.  
  1150.     Output
  1151.      none
  1152.  
  1153.  
  1154. BASIC :
  1155.  
  1156.    Input
  1157.     M1% = 16
  1158.     M4% = address of the region array
  1159.  
  1160.    Output
  1161.     none
  1162.  
  1163. Example :
  1164.  
  1165.       100 ; define screen region for conditional off
  1166.       200  OFF%(1)=10
  1167.       300  OFF%(2)=30
  1168.       400  OFF%(3)=40
  1169.       500  OFF%(4)=80
  1170.       600  M1%=16
  1171.       700  CALL MOUSE(M1%,M2%,M3%,off(0))
  1172.       800 ; Screen update routine
  1173.        :
  1174.        :
  1175.       2000  M1%=1
  1176.       2100  CALL MOUSE (M1%,M2%,M3%,M4%)
  1177.  
  1178.  
  1179.  
  1180.  
  1181.                                page 25
  1182.  
  1183.  
  1184.  
  1185. Set Double-Speed Threshold - Function 19
  1186. *****************************************
  1187.  
  1188. Function 19 sets the threshold speed for doubling the
  1189. cursor's motion on the screen. Using function 19 makes it
  1190. easier to point at images widely separated on the screen.
  1191.  
  1192. Parameter M4% defines the mouse's threshold speed. If
  1193. no value is given, or if the mouse is reset by a call to
  1194. function 0, a default value of 64 mickeys per second is
  1195. assigned. If the mouse moves faster than the value of M4%,
  1196. cursor motion doubles in speed. The threshold speed remains
  1197. set until function 19 is called again or until the mouse is
  1198. reset by function 0.
  1199.  
  1200. Once your program turns on teh speed-doubling feature, this
  1201. feature is always on. However, the program can effectively
  1202. turn of this feature by setting M4% to a speed faster than
  1203. the mouse can physically move (for example, 10,000) and then
  1204. calling function 19.
  1205.  
  1206. 8086 register :
  1207.  
  1208.    Input
  1209.     AX = 19
  1210.     DX = threshold speed in mickeys/second
  1211.    Output
  1212.     none
  1213.  
  1214. BASIC :
  1215.  
  1216.    Input
  1217.     M1% = 19
  1218.     M4% = threshold speed in mickeys/second
  1219.    Output
  1220.     none
  1221.  
  1222.  
  1223.  
  1224.  
  1225.                                page 26
  1226.  
  1227.  
  1228.  
  1229. Example :
  1230.  
  1231.  
  1232.    100    ;
  1233.    110    ;  Set threshold to 32 mickeys/sec
  1234.    120    ;
  1235.    130       M1% = 19
  1236.    140       M4% = 32
  1237.    150       CALL Mouse (M1%,M2%,M3%,M4%)
  1238.     .
  1239.     .
  1240.     .
  1241.     .
  1242.    1000 ;  Turn off speed doubling
  1243.    1010    M1% = 19
  1244.    1020    M4% = 1000  'mickeys/second
  1245.    1030    CALL Mouse(M1%,M2%,M3%,M4%)
  1246.  
  1247.    ***************  END  ***************
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272. è
  1273.