Convert bcmouse.c to K&R style.
authorDavid Griffith <dave@661.org>
Mon, 23 Sep 2019 20:38:11 +0000 (13:38 -0700)
committerDavid Griffith <dave@661.org>
Tue, 24 Sep 2019 01:03:24 +0000 (18:03 -0700)
src/dos/bcmouse.c

index e4302dbada7d90c3351b5f96ac16265177f808c0..fadf219699b737a6f97cbab5f0fa38bd66053843 100644 (file)
  * Return true if a mouse driver is present.
  *
  */
-
-bool detect_mouse (void)
+bool detect_mouse(void)
 {
+       asm xor ax, ax
+       asm int 0x33
+       return _AX;
+} /* detect_mouse */
 
-    asm xor ax,ax
-    asm int 0x33
-
-    return _AX;
-
-}/* detect_mouse */
 
 /*
  * read_mouse
@@ -47,43 +44,36 @@ bool detect_mouse (void)
  * click or 0 if there was no mouse activity at all.
  *
  */
-
-int read_mouse (void)
+int read_mouse(void)
 {
-    int click;
-
-    /* Read the current mouse status */
+       int click;
 
-    for (click = 0; click < 2; click++) {
+       /* Read the current mouse status */
+       for (click = 0; click < 2; click++) {
+               if (click == 1)
+                       delay(222);
 
-       if (click == 1)
-           delay (222);
+               asm mov ax, 6
+               asm xor bx, bx
+               asm int 0x33
+               if (_BX == 0)
+                       break;
 
-       asm mov ax,6
-       asm xor bx,bx
-       asm int 0x33
+               mouse_x = _CX;
+               mouse_y = _DX;
 
-       if (_BX == 0)
-           break;
+               if (display <= _TEXT_) {
+                       mouse_x /= 8;
+                       mouse_y /= 8;
+               }
 
-       mouse_x = _CX;
-       mouse_y = _DX;
+               if (display == _MCGA_)
+                       mouse_x /= 2;
 
-       if (display <= _TEXT_) {
-           mouse_x /= 8;
-           mouse_y /= 8;
+               mouse_x++;
+               mouse_y++;
        }
 
-       if (display == _MCGA_)
-           mouse_x /= 2;
-
-       mouse_x++;
-       mouse_y++;
-
-    }
-
-    /* Return single or double click */
-
-    return click;
-
-}/* read_mouse */
+       /* Return single or double click */
+       return click;
+} /* read_mouse */