sagen@nucthy.physics.orst.edu (Milt Sagen) (01/30/89)
I wrote a program to use the mouse following the articles published in Turbo Technix, which in general works fine with ega and vga monitors, but when the graphics driver is the Hercules bgi driver the minimum difference between two positions of the mouse returned to my program is 8. That is if the first position of the mouse is x,y and the next position is (or at least should be) one pixel to right (left, up, down, etc.) the value returned is x+8,y. Its as if the lower three bits are always returned as 0's. This only happens with the Hercules, and I have only been able to check it with the Logitech mouse driver 6.10. Has anyone else experienced similar difficulties. Note: By simply calling the max rows and max columns functions for the mouse I am able to get this version of the mouse driver to work correctly with a vga monitor. So that does not seem to be the problem here (I'm refer of course to the comment of the author of the Turbo Technix articles regarding problems with the vga and the Logitech mouse driver). Milt Sagen Internet: sagen@nucthy.physics.orst.edu Department of Physics Oregon State University Corvallis, OR 97331 Tele: (503) 754-4631
payne@batcomputer.tn.cornell.edu (Andrew Payne) (02/06/89)
In article <8539@orstcs.CS.ORST.EDU> sagen@nucthy.physics.orst.edu (Milt Sagen) writes: >I wrote a program to use the mouse following the articles published in Turbo >Technix, which in general works fine with ega and vga monitors, but when the >graphics driver is the Hercules bgi driver the minimum difference between >two positions of the mouse returned to my program is 8. That is if the >first position of the mouse is x,y and the next position is (or at least >should be) one pixel to right (left, up, down, etc.) the value returned is >x+8,y. >Its as if the lower three bits are always returned as 0's. Yes, I ran into this exact problem.. Seems that the mouse driver (be it Logitech or Microsoft) is too dumb to recognize that you are in a graphic mode (Hercules). It thinks that you are in a text mode and snaps everthing to a multiple of 8. The best solution I've found so far is to fool the driver into thinking its in some kind of graphics mode. If you set the location 0x040:0x049 (in the BIOS segment), which contains the current screen mode, to a 6, the mouse driver thinks its in a 640x200 CGA mode. Set this value before you reset the mouse driver, and restore it afterwards to keep things neat. Then set the mouse limits to the size of the Hercules screen (720x348??) and you should be all set! You still don't get a cursor though, have to write that yourself. In my mouse code, I detect if you are in the Hercules mode (from the detectgraph() results in Turbo C) and perform the above steps if so. That way my code should run on Hercules as well as non-Hercules systems. If you still get stuck, drop me a note, -- = = = = = = = = = = = = = = = = = = = = = = = = = = = Andrew C. Payne, N8KEI UUCP: ...!cornell!batcomputer!payne INTERNET: payne@tcgould.tn.cornell.edu PHONE: +1 607 253 2776 USMAIL: 5428 Cls '26-UHall 5 Ithaca, NY 14853