deepstone

diff src/mouse.c @ 21:00d84ab1ef26

switched to wacom
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 21 Sep 2013 18:17:55 +0300
parents f04884489bad
children
line diff
     1.1 --- a/src/mouse.c	Sat Sep 21 16:40:31 2013 +0300
     1.2 +++ b/src/mouse.c	Sat Sep 21 18:17:55 2013 +0300
     1.3 @@ -1,4 +1,5 @@
     1.4  #include "mouse.h"
     1.5 +#include "inttypes.h"
     1.6  
     1.7  #define INTR	0x33
     1.8  
     1.9 @@ -13,8 +14,8 @@
    1.10  
    1.11  int have_mouse(void)
    1.12  {
    1.13 -	int res;
    1.14 -	asm {
    1.15 +	int16_t res;
    1.16 +	__asm {
    1.17  		mov ax, QUERY
    1.18  		int INTR
    1.19  		mov res, ax
    1.20 @@ -24,8 +25,8 @@
    1.21  
    1.22  void show_mouse(int show)
    1.23  {
    1.24 -	int cmd = show ? SHOW : HIDE;
    1.25 -	asm {
    1.26 +	int16_t cmd = show ? SHOW : HIDE;
    1.27 +	__asm {
    1.28  		mov ax, cmd
    1.29  		int INTR
    1.30  	}
    1.31 @@ -33,9 +34,9 @@
    1.32  
    1.33  int read_mouse(int *xp, int *yp)
    1.34  {
    1.35 -	int x, y, bn;
    1.36 +	int16_t x, y, bn;
    1.37  
    1.38 -	asm {
    1.39 +	__asm {
    1.40  		mov ax, READ
    1.41  		int INTR
    1.42  		mov bn, bx
    1.43 @@ -51,24 +52,24 @@
    1.44  
    1.45  void set_mouse(int x, int y)
    1.46  {
    1.47 -	asm {
    1.48 +	__asm {
    1.49  		mov ax, WRITE
    1.50 -		mov cx, x
    1.51 -		mov dx, y
    1.52 +		mov ecx, x
    1.53 +		mov edx, y
    1.54  		int INTR
    1.55  	}
    1.56  }
    1.57  
    1.58  void set_mouse_limits(int xmin, int ymin, int xmax, int ymax)
    1.59  {
    1.60 -	asm {
    1.61 +	__asm {
    1.62  		mov ax, XLIM
    1.63 -		mov cx, xmin
    1.64 -		mov dx, xmax
    1.65 +		mov ecx, xmin
    1.66 +		mov edx, xmax
    1.67  		int INTR
    1.68  		mov ax, YLIM
    1.69 -		mov cx, ymin
    1.70 -		mov dx, ymax
    1.71 +		mov ecx, ymin
    1.72 +		mov edx, ymax
    1.73  		int INTR
    1.74  	}
    1.75  }