#include "mouse.h" MouseStatType MouseStat; char *MouVersion = __FILE__" "__TIME__" "__DATE__; #ifdef __GNUC__ #include #endif int _m_MFAR MouseInstalled(void) { #ifdef ALLEGRO_VERSION return install_mouse()>0; #else __asm xor ax, ax __asm int 0x33 __asm mov word ptr MouseStat.Installed, ax __asm mov ax, 1 __asm mov word ptr MouseStat.XScale, ax __asm mov word ptr MouseStat.YScale, ax return MouseStat.Installed; #endif } void _m_MFAR GetMouseStat(void) { #ifdef ALLEGRO_VERSION MouseStat.x = mouse_x; MouseStat.y = mouse_y; *(int *)&MouseStat.Buttons = mouse_b; #else __asm mov ax, 3 __asm int 0x33 __asm mov word ptr MouseStat.x, cx __asm mov word ptr MouseStat.y, dx __asm mov word ptr MouseStat.Buttons, bx MouseStat.x /= MouseStat.XScale; MouseStat.y /= MouseStat.YScale; #endif } void _m_MFAR MouseSens(int x, int y) { #ifdef ALLEGRO_VERSION set_mouse_speed(x, y); #else __asm mov ax, 0x1A __asm mov bx, x __asm mov cx, y __asm xor dx, dx __asm int 0x33 #endif } void _m_MFAR MouseWindow(int x1, int y1, int x2, int y2) { #ifdef ALLEGRO_VERSION set_mouse_range(x1,y1, x2,y2); #else __asm {mov ax, 7; mov cx, x1; mov dx, x2; int 0x33} __asm {mov ax, 8; mov cx, y1; mov dx, y2; int 0x33} #endif } void _m_MFAR PositionMouse(int x, int y) { #ifdef ALLEGRO_VERSION position_mouse(x, y); #else x *= MouseStat.XScale; y *= MouseStat.XScale; __asm mov ax, 4 __asm mov cx, x __asm mov dx, y __asm int 0x33 #endif } void _m_MFAR HideMouse(void) { #ifdef ALLEGRO_VERSION // UNUSED // FIXME #else __asm mov ax, 2 __asm int 0x33 #endif } void _m_MFAR ShowMouse(void) { #ifdef ALLEGRO_VERSION // UNUSED // FIXME #else __asm mov ax, 1 __asm int 0x33 #endif }