Deleted Added
full compact
main.c (28328) main.c (30044)
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 *
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 * $Id: main.c,v 1.14 1997/08/15 12:32:59 sos Exp $
28 * $Id: main.c,v 1.1 1997/08/17 21:09:34 sos Exp $
29 */
30
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/signal.h>
34#include <sys/file.h>
35#include <sys/ioctl.h>
36#include <sys/mman.h>
37#include <machine/console.h>
38#include "vgl.h"
39
40VGLBitmap *VGLDisplay;
41
42static int VGLMode;
43static int VGLOldMode;
44static byte *VGLBuf;
45static byte *VGLMem;
46static int VGLSwitchPending;
47static int VGLOnDisplay;
29 */
30
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/signal.h>
34#include <sys/file.h>
35#include <sys/ioctl.h>
36#include <sys/mman.h>
37#include <machine/console.h>
38#include "vgl.h"
39
40VGLBitmap *VGLDisplay;
41
42static int VGLMode;
43static int VGLOldMode;
44static byte *VGLBuf;
45static byte *VGLMem;
46static int VGLSwitchPending;
47static int VGLOnDisplay;
48static int VGLInitDone = 0;
48
49void
50VGLEnd()
51{
52struct vt_mode smode;
53
49
50void
51VGLEnd()
52{
53struct vt_mode smode;
54
55 if (!VGLInitDone)
56 return;
54/*
55 while (!VGLOnDisplay) pause();
56 VGLCheckSwitch();;
57*/
58 outb(0x3c4, 0x02);
59 outb(0x3c5, 0x0f);
60 bzero(VGLMem, 64*1024);
61 ioctl(0, _IO('S', VGLOldMode), 0);
62 ioctl(0, KDDISABIO, 0);
63 ioctl(0, KDSETMODE, KD_TEXT);
64 smode.mode = VT_AUTO;
65 ioctl(0, VT_SETMODE, &smode);
66 free(VGLBuf);
67 free(VGLDisplay);
57/*
58 while (!VGLOnDisplay) pause();
59 VGLCheckSwitch();;
60*/
61 outb(0x3c4, 0x02);
62 outb(0x3c5, 0x0f);
63 bzero(VGLMem, 64*1024);
64 ioctl(0, _IO('S', VGLOldMode), 0);
65 ioctl(0, KDDISABIO, 0);
66 ioctl(0, KDSETMODE, KD_TEXT);
67 smode.mode = VT_AUTO;
68 ioctl(0, VT_SETMODE, &smode);
69 free(VGLBuf);
70 free(VGLDisplay);
71 VGLKeyboardEnd();
68}
69
70static void
71VGLAbort()
72{
73 VGLEnd();
74 exit(0);
75}

--- 88 unchanged lines hidden (view full) ---

164 smode.relsig = SIGUSR1;
165 smode.acqsig = SIGUSR1;
166 smode.frsig = SIGINT;
167 if (ioctl(0, VT_SETMODE, &smode) == -1) {
168 VGLEnd();
169 return 1;
170 }
171 VGLTextSetFontFile((byte*)0);
72}
73
74static void
75VGLAbort()
76{
77 VGLEnd();
78 exit(0);
79}

--- 88 unchanged lines hidden (view full) ---

168 smode.relsig = SIGUSR1;
169 smode.acqsig = SIGUSR1;
170 smode.frsig = SIGINT;
171 if (ioctl(0, VT_SETMODE, &smode) == -1) {
172 VGLEnd();
173 return 1;
174 }
175 VGLTextSetFontFile((byte*)0);
176 VGLInitDone = 1;
172 return 0;
173}
174
175void
176VGLCheckSwitch()
177{
178 if (VGLSwitchPending) {
179 int i;

--- 47 unchanged lines hidden ---
177 return 0;
178}
179
180void
181VGLCheckSwitch()
182{
183 if (VGLSwitchPending) {
184 int i;

--- 47 unchanged lines hidden ---