Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site python.UUCP Path: utzoo!linus!decvax!bellcore!petrus!sabre!python!michael From: michael@python.UUCP (M. Cain) Newsgroups: net.micro.6809 Subject: 8-bit A/D under OS9 Message-ID: <189@python.UUCP> Date: Tue, 1-Apr-86 08:36:36 EST Article-I.D.: python.189 Posted: Tue Apr 1 08:36:36 1986 Date-Received: Wed, 2-Apr-86 20:19:19 EST Distribution: net Organization: Bell Communications Research Lines: 34 I have recently been experimenting with the Coco Max 8-bit A/D converter using OS9. The documentation is scanty -- "the module is addressed at 0xff90" is the extent of it -- but I have had some success. The following code fragment works: point = (char *)0xff90; for (i=0; i<4; i++) mouse[i] = *point++; After the loop, mouse[1] contains a vertical coordinate, mouse[2] a horizontal, and mouse[3] indicates the status of the button. The advantage of the 8-bit A/D values is, of course, that it is now possible to point to individual pixels on a high-resolution graphics screen without resorting to "sliding windows" or the like. The following attempts at efficiency all break the code: - Unrolling the loop, - Skipping the "wasted" access of 0xff90, - Declaring mouse to be an array of type char rather than type int. I tried taking the cartridge apart, but it appears that unreasonable amounts of force are needed, and I didn't want to risk any damage to the internals. Does anyone know what's inside, and how it's being used? Finally, I find that it is necessary for any programs that poll the module to make a sleep(n) call at the beginning, with n a small integer -- if I don't, the disk drive motor continues to run, apparently forever. Michael Cain