Subject: Mouse support
To: NetBSD Mac68k <port-mac68k@NetBSD.ORG>
From: Colin Wood <ender@is.rice.edu>
List: port-mac68k
Date: 01/01/1997 16:41:24
Well, about 2 days of reading the Apple specs and the NetBSD source, 
along with some hacking here and there (and many, many reboots) has 
resulted in working support for the Mouse Systems A3 mouse (i.e. the 2nd 
and 3rd mouse buttons work like they are supposed to).  Basically, I just 
added a new completion routine in adbsys.c (and adbsysasm.s), and added a 
couple of lines to adb_processevent() in adb.c (with the necessary 
changes to adbvar.h and adbsys.h, of course).

The kernel that I've hacked this into is based on 1.2-release sources, 
but as soon as I get back to school, I'll update them to -current (I've 
also got a kernel from mid-October for color X support, but it's quite a 
hack to get it to compile).  I probably need to clean up the code a bit 
before sending it to the proper person for submission, though (btw, who 
_is_ the proper person to pour over my code?)

When I looked through the current NetBSD ADB code, though, I came up with 
a few questions.  My first question is:  does the Extended Mouse protocol 
support actually work?  From what I've read of the spec, it doesn't  
appear to do so (I mean, it just might support 3 buttons, but definitely 
not any more than that, and it completely ignores the additional motion 
bits supplied by the protocol).  I might be able to fix this, but first, 
does anyone have a mouse which uses the Extended Mouse Protocol which 
actually works under NetBSD?

My next question is: does ADBReinit() ever get called outside of 
adb_init()?  If it does, then I might need to add a little more to get 
the A3 mouse support fully working (i.e. I'd need to worry about all that 
JADBProc pointer mess).

Also, I haven't looked at John's ADB code yet, but one problem (IMO) with 
the Apple ADB code is that it doesn't allow the resetting of the handler 
id in the ADBInfo  structure that is kept for each device in the ADB 
table.  If it could easily be changed (like in adb_init(), for example), 
it would eliminate half of the code that I've added and make it fairly 
simple to add support for any other ADB device.  So, John, if and when we 
finally switch over to your ADB code, is there any way this feature could 
be added?

Finally, assuming that my approach is somewhat workable, it should be 
fairly easy to add support for other "unsupported" pointer devices if I 
have a decent enough description of the device.

Well, enough rambling for now, I've got to get back to the docs ;-)

Later.

-- 
Colin Wood                                      ender@is.rice.edu
Consultant                                        Rice University
Information Technology Services                       Houston, TX