changeset 8246:d48c2b01fba5

(mouse_init1): Use alternate mouse detection for old mouse drivers. (mouse_get_pos): Downscale coordinates by 8.
author Richard M. Stallman <rms@gnu.org>
date Thu, 14 Jul 1994 04:58:02 +0000
parents b743577d12c2
children 26dbb6234efd
files src/msdos.c
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/msdos.c	Thu Jul 14 03:46:11 1994 +0000
+++ b/src/msdos.c	Thu Jul 14 04:58:02 1994 +0000
@@ -1147,8 +1147,8 @@
   *f = selected_frame;
   *bar_window = Qnil;
   gettimeofday (&tv, NULL);
-  *x = make_number (regs.x.cx);
-  *y = make_number (regs.x.dx);
+  *x = make_number (regs.x.cx / 8);
+  *y = make_number (regs.x.dx / 8);
   *time = tv.tv_usec;
   mouse_moved = 0;
 }
@@ -1174,9 +1174,22 @@
   union REGS regs;
   int present;
 
+  if (!internal_terminal)
+    return 0;
+
   regs.x.ax = 0x0021;
   int86 (0x33, &regs, &regs);
-  present = internal_terminal && (regs.x.ax & 0xffff) == 0xffff;
+  present = (regs.x.ax & 0xffff) == 0xffff;
+  if (!present)
+    {
+      /* Reportedly, the above doesn't work for some mouse drivers.  There
+	 is an additional detection method that should work, but might be
+	 a little slower.  Use that as an alternative.  */
+      regs.x.ax = 0x0000;
+      int86 (0x33, &regs, &regs);
+      present = (regs.x.ax & 0xffff) == 0xffff;
+    }
+
   if (present)
     {
       if (regs.x.bx == 3)