home *** CD-ROM | disk | FTP | other *** search
- 10000 '
- 10002 ' Interpreted BASIC mouse library interface subroutines
- 10004 '
- 10006 ' Copyright (c) 1988-1989 by Microsoft Corp. All rights reserved.
- 10008 '
- 10010 ' Author: Tom Hensel 11/13/88
- 10012 '
- 10014 ' Use a GOSUB 10000 + 100*(function number) to call subroutine
- 10016 '
- 10018 ' For example: Show Cursor (function 1) would be GOSUB 10100
- 10020 '
- 10022 ' Variables are named M1%, M2%, M3%, and M4%. Only variables affected
- 10024 ' need to be passed, the subroutines will take care of the rest.
- 10026 '
- 10028 ' The current segment will be set to BASIC's data segment on return
- 10030 '
- 10032 ' Function 0 - Mouse Reset and Status
- 10034 '
- 10036 DEF SEG=0 ' Point to segment 0
- 10038 MOUSESEG=256*PEEK(51*4+3) + PEEK(51*4+2) ' Get mouse vector segment
- 10040 MOUSEOFF=256*PEEK(51*4+1) + PEEK(51*4) + 2 ' Get mouse vector offset + 2
- 10045 M1%=0
- 10047 ' Check if vector = 0:0
- 10050 IF MOUSESEG=0 AND (MOUSEOFF - 2)=0 THEN DEFSEG : RETURN
- 10055 DEF SEG=MOUSESEG ' Point to mouse driver segment
- 10057 ' Check if vector points to IRET
- 10060 IF PEEK(MOUSEOFF - 2)=207 THEN DEF SEG : RETURN
- 10065 CALL MOUSEOFF(M1%, M2%, M3%, M4%)
- 10067 DEF SEG ' Restore BASIC data segment
- 10070 IF MOUSESEMAPHORE% THEN RETURN
- 10075 MOUSETMPM1%=M1% : MOUSETMPM2%=M2% : MOUSETMPM3%=M3% : MOUSETMPM4%=M4%
- 10080 GOSUB 13600 ' Get mouse driver version number
- 10085 MOUSEVERSION%=M2% ' Save it for later
- 10090 M1%=MOUSETMPM1% : M2%=MOUSETMPM2% : M3%=MOUSETMPM3% : M4%=MOUSETMPM4%
- 10095 MOUSESEMAPHORE%=1 : RETURN
- 10100 '
- 10110 ' Function 1 - Show Cursor
- 10120 '
- 10130 M1%=1
- 10140 DEF SEG=MOUSESEG ' Point to mouse driver segment
- 10150 CALL MOUSEOFF(M1%, M2%, M3%, M4%)
- 10160 DEF SEG ' Restore BASIC data segment
- 10170 RETURN
- 10200 '
- 10210 ' Function 2 - Hide Cursor
- 10220 '
- 10230 M1%=2
- 10240 GOTO 10140 ' Common mouse library entry point
- 10300 '
- 10310 ' Function 3 - Get Button Status and Mouse Position
- 10320 '
- 10330 M1%=3
- 10340 GOTO 10140 ' Common mouse library entry point
- 10400 '
- 10410 ' Function 4 - Set Mouse Cursor Position
- 10420 '
- 10430 M1%=4
- 10440 GOTO 10140 ' Common mouse library entry point
- 10500 '
- 10510 ' Function 5 - Get Button Press Information
- 10520 '
- 10530 M1%=5
- 10540 GOTO 10140 ' Common mouse library entry point
- 10600 '
- 10610 ' Function 6 - Get Button Release Information
- 10620 '
- 10630 M1%=6
- 10640 GOTO 10140 ' Common mouse library entry point
- 10700 '
- 10710 ' Function 7 - Set Minimum and Maximum Horizontal Cursor Position
- 10720 '
- 10730 M1%=7
- 10740 GOTO 10140 ' Common mouse library entry point
- 10800 '
- 10810 ' Function 8 - Set Minimum and Maximum Vertical Cursor Position
- 10820 '
- 10830 M1%=8
- 10840 GOTO 10140 ' Common mouse library entry point
- 10900 '
- 10905 ' Function 9 - Set Graphics Cursor Block
- 10910 '
- 10915 ' M4% should contain a pointer to cursor block array
- 10920 '
- 10925 ' For example: M4% = VARPTR(USERGCB(0, 0))
- 10930 '
- 10935 ' For backward compatibility (mouse drivers before 6.25), the graphics
- 10940 ' cursor block should be named USERGCB, or change name on line 10970
- 10945 '
- 10950 M1%=9
- 10955 IF MOUSEVERSION%>=1573 THEN GOTO 10140 ' Common mouse library entry point
- 10960 ' Backward compatible if previous to mouse driver version 6.25
- 10965 DEF SEG=MOUSESEG ' Point to mouse driver segment
- 10970 CALL MOUSEOFF(M1%, M2%, M3%, USERGCB(0, 0))
- 10975 DEF SEG ' Restore BASIC data segment
- 10980 RETURN
- 11000 '
- 11010 ' Function 10 - Set text Cursor
- 11020 '
- 11030 M1%=10
- 11040 GOTO 10140 ' Common mouse library entry point
- 11100 '
- 11110 ' Function 11 - Read Mouse Motion Counters
- 11120 '
- 11130 M1%=11
- 11140 GOTO 10140 ' Common mouse library entry point
- 11200 '
- 11205 ' Function 12 - Set Interrupt Subroutine Call Mask and Address
- 11210 '
- 11215 ' M4% should contain a pointer to subroutine address
- 11220 '
- 11225 ' For example: M4% = VARPTR(USERSUB%)
- 11230 '
- 11235 ' Remove line 11260 and pass M2% = VARPTR(subroutineSegment)
- 11240 ' if subroutine doesn't reside in data segment
- 11245 '
- 11250 ' For backward compatibility (mouse drivers before 6.25), the subroutine
- 11255 ' address should be named USERSUB%, or change name on line 11290
- 11260 '
- 11265 M1%=12
- 11270 M2%=0 ' Use DS for code segment
- 11275 IF MOUSEVERSION%>=1573 THEN GOTO 10140 ' Common mouse library entry point
- 11280 ' Backward compatible if previous to mouse driver version 6.25
- 11285 DEF SEG=MOUSESEG ' Point to mouse driver segment
- 11290 CALL MOUSEOFF(M1%, M2%, M3%, USERSUB%(0))
- 11295 DEF SEG ' Restore BASIC data segment
- 11297 RETURN
- 11300 '
- 11310 ' Function 13 - Light Pen Emulation Mode On
- 11320 '
- 11330 M1%=13
- 11340 GOTO 10140 ' Common mouse library entry point
- 11400 '
- 11410 ' Function 14 - Light Pen Emulation Mode Off
- 11420 '
- 11430 M1%=14
- 11440 GOTO 10140 ' Common mouse library entry point
- 11500 '
- 11510 ' Function 15 - Set Mickey/Pixel Ratio
- 11520 '
- 11530 M1%=15
- 11540 GOTO 10140 ' Common mouse library entry point
- 11600 '
- 11610 ' Function 16 - Conditional Off
- 11620 '
- 11630 ' M4% should contain a pointer to conditional off array
- 11640 '
- 11650 ' For example: M4% = VARPTR(CO(0))
- 11660 '
- 11670 M1%=16
- 11680 GOTO 10140 ' Common mouse library entry point
- 11900 '
- 11910 ' Function 19 - Set Double-Speed Threshold
- 11920 '
- 11930 M1%=19
- 11940 GOTO 10140 ' Common mouse library entry point
- 12000 '
- 12005 ' Function 20 - Swap Interrupt Subroutines
- 12010 '
- 12015 ' M4% should contain a pointer to subroutine address
- 12020 '
- 12025 ' For example: M4% = VARPTR(subroutineOffset)
- 12030 '
- 12035 ' Remove line 12060 and pass M2% = VARPTR(subroutineSegment)
- 12040 ' if subroutine doesn't reside in data segment
- 12045 '
- 12050 ' For backward compatibility (mouse drivers before 6.25), the subroutine
- 12055 ' address should be named USERSUB%, or change name on
- 10257 ' lines 12087, 12090, 12092, and 12094
- 12060 '
- 12065 M1%=20
- 12070 M2%=0 ' Use DS for code segment
- 12075 IF MOUSEVERSION%>=1573 THEN GOTO 10140 ' Common mouse library entry point
- 12080 ' Backward compatible if previous to mouse driver version 6.25
- 12085 DEF SEG=MOUSESEG ' Point to mouse driver segment
- 12087 MOUSETMP%=USERSUB%(0) ' Save old value
- 12090 CALL MOUSEOFF(M1%, M2%, M3%, USERSUB%(0))
- 12092 M4%=USERSUB%(0) ' Returned this way because of bug
- 12094 USERSUB%(0)=MOUSETMP% ' Restore original value
- 12095 DEF SEG ' Restore BASIC data segment
- 12097 RETURN
- 12100 '
- 12110 ' Function 21 - Get Mouse Driver State Storage Requirements
- 12120 '
- 12130 M1%=21
- 12140 GOTO 10140 ' Common mouse library entry point
- 12200 '
- 12210 ' Function 22 - Save Mouse Driver State
- 12220 '
- 12230 ' M4% should contain a pointer to state buffer array
- 12240 '
- 12250 ' For example: M4% = VARPTR(buffer(0))
- 12260 '
- 12270 M1%=22
- 12280 GOTO 10140 ' Common mouse library entry point
- 12300 '
- 12310 ' Function 23 - Restore Mouse Driver State
- 12320 '
- 12330 ' M4% should contain a pointer to state buffer array
- 12340 '
- 12350 ' For example: M4% = VARPTR(buffer(0))
- 12360 '
- 12370 M1%=23
- 12380 GOTO 10140 ' Common mouse library entry point
- 12400 '
- 12405 ' Function 24 - Set Alternate Subroutine Call Mask and Address
- 12410 '
- 12415 ' M4% should contain a pointer to subroutine address
- 12420 '
- 12425 ' For example: M4% = VARPTR(subroutineOffset)
- 12430 '
- 12435 ' Remove line 12460 and pass M2% = VARPTR(subroutineSegment)
- 12440 ' if subroutine doesn't reside in data segment
- 12445 '
- 12450 M1%=24
- 12460 M2%=0 ' Use DS for code segment
- 12470 GOTO 10140 ' Common mouse library entry point
- 12500 '
- 12510 ' Function 25 - Get User Alternate Interrupt Address
- 12520 '
- 12530 M1%=25
- 12540 GOTO 10140 ' Common mouse library entry point
- 12600 '
- 12610 ' Function 26 - Set Mouse Sensitivity
- 12620 '
- 12630 M1%=26
- 12640 GOTO 10140 ' Common mouse library entry point
- 12700 '
- 12710 ' Function 27 - Get Mouse Sensitivity
- 12720 '
- 12730 M1%=27
- 12740 GOTO 10140 ' Common mouse library entry point
- 12800 '
- 12810 ' Function 28 - Set Mouse Interrupt Rate
- 12820 '
- 12830 M1%=28
- 12840 GOTO 10140 ' Common mouse library entry point
- 12900 '
- 12910 ' Function 29 - Set CRT Page Number
- 12920 '
- 12930 M1%=29
- 12940 GOTO 10140 ' Common mouse library entry point
- 13000 '
- 13010 ' Function 30 - Get CRT Page Number
- 13020 '
- 13030 M1%=30
- 13040 GOTO 10140 ' Common mouse library entry point
- 13100 '
- 13110 ' Function 31 - Disable Mouse Driver
- 13120 '
- 13130 M1%=31
- 13140 GOTO 10140 ' Common mouse library entry point
- 13200 '
- 13210 ' Function 32 - Enable Mouse Driver
- 13220 '
- 13230 M1%=32
- 13240 GOTO 10140 ' Common mouse library entry point
- 13300 '
- 13310 ' Function 33 - Software Reset
- 13320 '
- 13330 M1%=33
- 13340 GOTO 10140 ' Common mouse library entry point
- 13400 '
- 13410 ' Function 34 - Set Language For Messages
- 13420 '
- 13430 M1%=34
- 13440 GOTO 10140 ' Common mouse library entry point
- 13500 '
- 13510 ' Function 35 - Get Language Number
- 13520 '
- 13530 M1%=35
- 13540 GOTO 10140 ' Common mouse library entry point
- 13600 '
- 13610 ' Function 36 - Get Driver Version, Mouse Type, and IRQ #
- 13620 '
- 13630 M1%=36
- 13640 GOTO 10140 ' Common mouse library entry point
- 13700 '
- 13710 ' Function 37 - Set Video Mode Number
- 13720 '
- 13730 M1%=37
- 13740 GOTO 10140 ' Common mouse library entry point
- 13800 '
- 13810 ' Function 38 - Enumerate Video Mode Numbers
- 13820 '
- 13830 M1%=38
- 13840 GOTO 10140 ' Common mouse library entry point
-