Date : Wed, 25 Aug 1999 20:06:38 +0100
From : Tom Lees <tom@...>
Subject: Re: Mouse on the BBC
On Tue, Aug 24, 1999 at 07:53:46PM +0100, B.E.Newsam wrote:
> In message <1EowVaAUCew3EwDX@...>, Stuart William
> McConnachie <stuart@...> writes
> >Has anyone got an AMX mouse they could take apart and draw me a basic
> >circuit diagram, and tell me how the optical choppers are connected?
> >Has anyone attempted this before?
>
> No AMX mouse, but somewhere I've got a Marconi trackball, which I
> believe works on exactly the same princple, just upside down, IYSWIM
The newest BeebEm for Windows does emulate the AMX mouse, so you might take
a peek at it (look in uservia.cpp and uservia.h). From a fairly cursory
examination, it looks like it works like this:-
The AMX mouse has three buttons. The button states are represented as a
0 bit for pressed, 1 for not pressed. The button states are in the top
three bits of the user port data (User VIA port B).
Bit 0 is for X movement. If bit 0 is set, X movement is positive. Unset,
negative movement. X movement is indicated by the CB1 interrupt line.
Similarly for Y movement with bit 1 and the CB2 interrupt line.
One pixel of mouse movement (really, it should be a mickey, but it maps
directly to pixels in BeebEm and the BBC) causes one interrupt - there is no
fancy "how far has the mouse moved" stuff.
I'm not sure exactly on how these VIA lines map to the User port - but I
assume that's in the UG or the AUG.
Hope this helps.
--
Tom <tom@... >