|BBC Mice and Mouse Drivers|
+5v 1 | 2 CB1 - Xaxis / | / | 3 | 4 CB2 - Yaxis / 1| Yaxis / 1| Xdir 0v 5 | 6 D0 - Xdir Left |6 | Left |6 | 7 | 8 D1 | 2| Xaxis | 2| Right 9 | 10 D2 - YDir +5v |7 | +5v |7 | 11 | 12 D3 | 3| Ydir | 3| Middle 13 | 14 D4 0v |8 | 0v |8 | 15 | 16 D5 - Left | 4| Xdir | 4| Ydir 17 | 18 D6 - Middle Right |9 | Yaxis |9 | 19 | 20 D7 - Right \ 5| Middle \ 5| Xaxis USER PORT \ | \ | AMIGA MOUSE PORT COMPACT MOUSE PORTA short adapter with a 20-pin IDC header and a 9-pin D plug (male, pins) makes the user port accessible for plugging in the mouse and lets mice be interchangeable between Compacts and non-Compacts.
*MOUSEcommand which provides a mouse driver, and a relocatable sideways ROM that provides a *MOUSE command.
DFS224+Mse and DFS229+Mse are DFS ROM images for the Master and Master Compact that include a mouse driver in the spare ROM space using ROMMouse.src.
Once the mouse driver has been turned on with
then the mouse position and button state can be read using OSBYTE or OSWORD.
The OSBYTE routines are accessible using the INKEY and ADVAL calls.
|ADVAL(7)||Osbyte &80,&07,&00||Mouse X position|
|ADVAL(8)||Osbyte &80,&08,&00||Mouse Y position|
|ADVAL(9)||Osbyte &80,&09,&00||Mouse buttons %rml, set if pressed|
|INKEY-10||Osbyte &81,&F6,&FF||Mouse left button|
|INKEY-11||Osbyte &82,&F5,&FF||Mouse middle button|
|INKEY-12||Osbyte &82,&F4,&FF||Mouse right button|
The mouse driver also responds to the AMX OSWORD 64 call. On exit:
|XY+0, XY+1||Mouse X position|
|XY+2, XY+3||Mouse Y position|
|XY+4||Text X position|
|XY+5||Text Y position|
|XY+6||Mouse buttons b7=R, b6=M, b5=L, clear if button pressed|
MouseTest is a short BASIC program that tests the mouse calls and displays their return values.
|initialises mouse variables mx%,my%,bl%,bm% and br%.|
|waits until the mouse changes state, by being moved or a button being pressed, or until a keyboard key is pressed.|
|reads the mouse state into mx%,my%,bl%,bm% and br%, being the mouse x and y position, and the button left, middle and right state.|
|initialises a simple pointer.|
|draws a pointer at the current graphics position.|
|waits until the mouse buttons change state or a keyboard key is pressed, drawing a pointer at the mouse position while waiting.|
using the Mouse library a main program just needs to start by calling
PROCMouse_Init and use
the main loop.