comparison src/msdos.c @ 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 b11f71df59d9
children 3c4437496ebc
comparison
equal deleted inserted replaced
8245:b743577d12c2 8246:d48c2b01fba5
1145 regs.x.ax = 0x0003; 1145 regs.x.ax = 0x0003;
1146 int86 (0x33, &regs, &regs); 1146 int86 (0x33, &regs, &regs);
1147 *f = selected_frame; 1147 *f = selected_frame;
1148 *bar_window = Qnil; 1148 *bar_window = Qnil;
1149 gettimeofday (&tv, NULL); 1149 gettimeofday (&tv, NULL);
1150 *x = make_number (regs.x.cx); 1150 *x = make_number (regs.x.cx / 8);
1151 *y = make_number (regs.x.dx); 1151 *y = make_number (regs.x.dx / 8);
1152 *time = tv.tv_usec; 1152 *time = tv.tv_usec;
1153 mouse_moved = 0; 1153 mouse_moved = 0;
1154 } 1154 }
1155 1155
1156 void 1156 void
1172 mouse_init1 () 1172 mouse_init1 ()
1173 { 1173 {
1174 union REGS regs; 1174 union REGS regs;
1175 int present; 1175 int present;
1176 1176
1177 if (!internal_terminal)
1178 return 0;
1179
1177 regs.x.ax = 0x0021; 1180 regs.x.ax = 0x0021;
1178 int86 (0x33, &regs, &regs); 1181 int86 (0x33, &regs, &regs);
1179 present = internal_terminal && (regs.x.ax & 0xffff) == 0xffff; 1182 present = (regs.x.ax & 0xffff) == 0xffff;
1183 if (!present)
1184 {
1185 /* Reportedly, the above doesn't work for some mouse drivers. There
1186 is an additional detection method that should work, but might be
1187 a little slower. Use that as an alternative. */
1188 regs.x.ax = 0x0000;
1189 int86 (0x33, &regs, &regs);
1190 present = (regs.x.ax & 0xffff) == 0xffff;
1191 }
1192
1180 if (present) 1193 if (present)
1181 { 1194 {
1182 if (regs.x.bx == 3) 1195 if (regs.x.bx == 3)
1183 { 1196 {
1184 mouse_button_count = 3; 1197 mouse_button_count = 3;