1/*-
2 * Copyright (c) 1991-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/lib/libvgl/mouse.c 50476 1999-08-28 00:22:10Z peter $
29 */
30
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/ioctl.h>
34#include <sys/signal.h>
35#include <machine/console.h>
36#include "vgl.h"
37
38/* prototype for internal function */
39int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
40
41#define X 0xff
42static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = {
43 X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
44 X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,
45 X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,
46 X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,
47 X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,
48 X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,
--- 23 unchanged lines hidden (view full) ---
72 0,0,0,0,0,X,X,0,0,0,0,0,0,0,0,0,
73 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
74 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
75 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
76 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
77};
78#undef X
79static VGLBitmap VGLMouseStdAndMask =
80 { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask };
81static VGLBitmap VGLMouseStdOrMask =
82 { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask };
83static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask;
84static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
85static VGLBitmap VGLMouseSave = { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, map};
86static int VGLMouseVisible = 0;
87static int VGLMouseFrozen = 0;
88static int VGLMouseShown = 0;
89static int VGLMouseXpos = 0;
90static int VGLMouseYpos = 0;
91static int VGLMouseButtons = 0;
92
93void
94VGLMousePointerShow()
95{
96 byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
97 VGLBitmap buffer = { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf };
98 byte crtcidx, crtcval, gdcidx, gdcval;
99 int pos;
100
101 if (!VGLMouseVisible) {
102 VGLMouseVisible = 1;
103 crtcidx = inb(0x3c4);
104 crtcval = inb(0x3c5);
105 gdcidx = inb(0x3ce);
--- 179 unchanged lines hidden ---
2 * Copyright (c) 1991-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/lib/libvgl/mouse.c 50476 1999-08-28 00:22:10Z peter $
29 */
30
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/ioctl.h>
34#include <sys/signal.h>
35#include <machine/console.h>
36#include "vgl.h"
37
38/* prototype for internal function */
39int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
40
41#define X 0xff
42static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = {
43 X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
44 X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,
45 X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,
46 X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,
47 X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,
48 X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,
--- 23 unchanged lines hidden (view full) ---
72 0,0,0,0,0,X,X,0,0,0,0,0,0,0,0,0,
73 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
74 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
75 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
76 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
77};
78#undef X
79static VGLBitmap VGLMouseStdAndMask =
80 { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask };
81static VGLBitmap VGLMouseStdOrMask =
82 { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask };
83static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask;
84static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
85static VGLBitmap VGLMouseSave = { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, map};
86static int VGLMouseVisible = 0;
87static int VGLMouseFrozen = 0;
88static int VGLMouseShown = 0;
89static int VGLMouseXpos = 0;
90static int VGLMouseYpos = 0;
91static int VGLMouseButtons = 0;
92
93void
94VGLMousePointerShow()
95{
96 byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE];
97 VGLBitmap buffer = { MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf };
98 byte crtcidx, crtcval, gdcidx, gdcval;
99 int pos;
100
101 if (!VGLMouseVisible) {
102 VGLMouseVisible = 1;
103 crtcidx = inb(0x3c4);
104 crtcval = inb(0x3c5);
105 gdcidx = inb(0x3ce);
--- 179 unchanged lines hidden ---