MOUSE DRIVER V2.0 RELEASE NOTES - 10.12.93 ------------------------------------------ The updated mouse driver consists of two files: MDriver The auto-loader which allocates the driver memory and relocates the code. MDriver2.0 The actual driver, containing code and graphics. Once loaded, it functions just like the original v1.0 driver supplied with the mouse (if there is one attached). However, a new system variable MSPRITE (5C9Ah = SVAR 666) allows you to turn on and off a variety of interrupt-driven pointers, and mouse-testing has been added with facilities for non-mouse owners. System variable MFLAG (5B99h = SVAR 409) determines whether the keyboard, mouse or neither is scanned for (0, 1 and 2 respectively). This is defaulted to 0 or 1 on installation, depending on a mouse being detected, but can be changed with a POKE. Keyboard control uses, as for DRIVER, the cursor keys with [.] and [,] representing the mouse buttons. This keyboard facility allows mouse-only programs to be used without any alteration, and provides access to the interupt-driven pointer (see below) for non-mouse owners. * Please note: System variable 5C9B (MDATAD, SVAR 667, 2 bytes) is used by the driver and should not be overwritten. It can be used as a check to see if the driver has been loaded - it will be non-zero * -+-+-+-+- The Basic functions XMOUSE and YMOUSE will return the coordinates of the mouse; BUTTON 1 returns the status of the left mouse button, BUTTON 3 returns the right button, and BUTTON 0 returns 1 if either button has been pressed. As with the original mouse driver, BUTTON 2 is not used. To turn the pointer on, use POKE SVAR 666,x where x is the number of the sprite graphic: 1. Cross 2. Small crosshair 3. Small arrow 4. Large crosshair 5. Large arrow 6. Pencil 7. Caret 8. User sprite PAUSE 1 will "force an interrupt" and make sure the pointer has been turned on/ changed (you don't need to turn it off before changing the sprite). To turn the pointer off, use POKE SVAR 666,0: PAUSE 1 You must ALWAYS turn the pointer off before printing text or graphics on the screen (or changing it in any other way except, perhaps, altering the palette). Once you have finished you can then turn it back on again. The sample programs on the disk provide examples of this. * Please note: the pointer will not work in modes 1 and 2, regardless of the state of MSPRITE. The mouse coordinates, of course, are updated in any mode with or without the pointer * In addition to the sprites supplied, number 8 is a "user sprite". This sprite's address is reported when you install the driver, and you can POKE some sprite data directly to that address, if you like. Alternatively, use LOAD "MDriver2.0" CODE &8000 LOAD "spritedata" CODE &8A00 SAVE OVER "MDriver2.0" CODE &8000,3000 To have the sprite installed for you. The sprite data consists of the following: Width (in mode 4 pixels); height (in lines); x offset (in pixels); y offset (in pixels); width * height (2 bytes). These 6 bytes are followed by the data for the two images (the first for an even x-coordinate, the second for odd x), which is stored line by line: mask, colour, mask, colour... The maximum size for one sprite image (including mask) is 400 bytes, so 20x20 sprites are possible. System Variables summary: SVAR - 398 MSEDP 5B8Eh (8) Used by the mouse as a data store. 399 BUTSTAT 5B8Fh Mouse button status. 406 MXCRD 5B96h (2) Mouse x coordinate. 408 MYCRD 5B98h Mouse y coordinate. 409 MFLAG 5B99h 0/1/2 to scan keyboard/mouse/neither. . . 666 MSPRITE 5C9Ah Sprite number, or 0. 667 MDATAD 5C9Bh (2) Used by the pointer routine. -+-+-+-+- The code relocates itself in a utilities page, and uses at least two free slots. If there is not enough space for it, a "No memory" error will be reported. The mouse driver is compatible with DRIVER, but you should turn the pointer OFF before entering the WIMP environment. It is also fully compatible with MasterDOS, MasterBASIC and other recognised device drivers such as the DUMP utility. * Mouse Driver v2.0 is Public Domain software and may, as such, be used and copied freely. You may also use it in this form for commercial software, provided appropriate credit is given. However the code may not be reproduced in any other form without prior permission from the author. * Steve Taylor 10.12.93 ---------------------