diff options
author | joerg <joerg@FreeBSD.org> | 1995-04-08 16:04:22 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-04-08 16:04:22 +0000 |
commit | da4e71efba2a070b42d4712c89e62b30be8c918c (patch) | |
tree | cb663414f834fa69e9a92ec4a1fe67fddd6f42bf /usr.sbin/pcvt/loadfont | |
parent | a5e4ad5c0cbe2d6e096a040a3413bd969f5fde7f (diff) | |
download | FreeBSD-src-da4e71efba2a070b42d4712c89e62b30be8c918c.zip FreeBSD-src-da4e71efba2a070b42d4712c89e62b30be8c918c.tar.gz |
Upgrade pcvt to 3.20 b24.
Diffstat (limited to 'usr.sbin/pcvt/loadfont')
-rw-r--r-- | usr.sbin/pcvt/loadfont/loadfont.1 | 12 | ||||
-rw-r--r-- | usr.sbin/pcvt/loadfont/loadfont.c | 52 |
2 files changed, 47 insertions, 17 deletions
diff --git a/usr.sbin/pcvt/loadfont/loadfont.1 b/usr.sbin/pcvt/loadfont/loadfont.1 index f799574..1ae339b 100644 --- a/usr.sbin/pcvt/loadfont/loadfont.1 +++ b/usr.sbin/pcvt/loadfont/loadfont.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1992,1993,1994 Hellmuth Michaelis +.\" Copyright (c) 1992, 1995 Hellmuth Michaelis .\" .\" All rights reserved. .\" @@ -27,9 +27,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" @(#)loadfont.1, 3.00, Last Edit-Date: [Mon Jan 10 21:25:01 1994] +.\" @(#)loadfont.1, 3.20, Last Edit-Date: [Tue Apr 4 13:06:00 1995] .\" -.Dd January 3, 1993 +.Dd April 4, 1995 .Dt LOADFONT 1 .Sh NAME .Nm loadfont @@ -38,6 +38,7 @@ driver. .Sh SYNOPSIS .Nm loadfont .Op Fl c Ar charsetno +.Op Fl d Ar devicefile .Op Fl f Ar fontfilename .Op Fl i .Sh DESCRIPTION @@ -51,6 +52,8 @@ The options are as follows: .It Fl c Specifies the slot, the font is to load into. EGA boards have four slots and VGA boards have eight slots available for downloading fonts. +.It Fl d +Specifies the devicefile to use. .It Fl f Specifies the file which contains the font to be downloaded. .It Fl i @@ -61,8 +64,7 @@ This is also the default behaviour if no options are specified on the commandlin This utility is used only on EGA and VGA boards, as MDA, HCG and CGA boards do not have downloadable charactersets available. .Sh FILES -Unless otherwise specified in the Makefile, the following fontfiles are -available for the pcvt 2.0 distribution: +The following fontfiles are available in the pcvt distribution: .nf /usr/share/misc/vgafonts/vt220l.808: 8x8 IBM II font diff --git a/usr.sbin/pcvt/loadfont/loadfont.c b/usr.sbin/pcvt/loadfont/loadfont.c index 0dfb054..db25185 100644 --- a/usr.sbin/pcvt/loadfont/loadfont.c +++ b/usr.sbin/pcvt/loadfont/loadfont.c @@ -1,5 +1,7 @@ /* - * Copyright (c) 1992,1993,1994 Hellmuth Michaelis and Brian Dunford-Shore + * Copyright (c) 1992, 1995 Hellmuth Michaelis + * + * Copyright (c) 1992, 1994 Brian Dunford-Shore * * All rights reserved. * @@ -32,7 +34,7 @@ */ static char *id = - "@(#)loadfont.c, 3.20, Last Edit-Date: [Tue Dec 20 14:52:58 1994]"; + "@(#)loadfont.c, 3.20, Last Edit-Date: [Fri Apr 7 10:13:16 1995]"; /*---------------------------------------------------------------------------* * @@ -40,10 +42,12 @@ static char *id = * * -hm removing explicit HGC support (same as MDA ..) * -hm new pcvt_ioctl.h SIZ_xxROWS + * -hm add -d option * *---------------------------------------------------------------------------*/ #include <stdio.h> +#include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <machine/pcvt_ioctl.h> @@ -51,25 +55,25 @@ static char *id = #define FONT8X8 2048 /* filesize for 8x8 font */ #define HEIGHT8X8 8 /* 8 scan lines char cell height */ #define SSCAN8X8 143 /* 400 scan lines on screen - 256 - 1 */ -#define SROWS8X8 50 /* 50 character lines on screen */ #define FONT8X10 2560 /* filesize for 8x10 font */ #define HEIGHT8X10 10 /* 10 scan lines char cell height */ #define SSCAN8X10 143 /* 400 scan lines on screen - 256 - 1 */ -#define SROWS8X10 40 /* 50 character lines on screen */ #define FONT8X14 3584 /* filesize for 8x14 font */ #define HEIGHT8X14 14 /* 14 scan lines char cell height */ #define SSCAN8X14 135 /* 392 scan lines on screen - 256 - 1 */ -#define SROWS8X14 28 /* 28 character lines on screen */ #define FONT8X16 4096 /* filesize for 8x16 font */ #define HEIGHT8X16 16 /* 16 scan lines char cell height */ #define SSCAN8X16 143 /* 400 scan lines on screen - 256 - 1 */ -#define SROWS8X16 25 /* 25 character lines on screen */ struct screeninfo screeninfo; +#define DEFAULTFD 0 +int fd; + + main(argc,argv) int argc; char *argv[]; @@ -90,8 +94,10 @@ char *argv[]; char *filename; int fflag = -1; int info = -1; + int dflag = 0; + char *device; - while( (c = getopt(argc, argv, "c:f:i")) != EOF) + while( (c = getopt(argc, argv, "c:d:f:i")) != EOF) { switch(c) { @@ -99,6 +105,11 @@ char *argv[]; chr_set = atoi(optarg); break; + case 'd': + device = optarg; + dflag = 1; + break; + case 'f': filename = optarg; fflag = 1; @@ -118,11 +129,27 @@ char *argv[]; if(chr_set == -1 || fflag == -1) info = 1; + if(dflag) + { + if((fd = open(device, O_RDWR)) == -1) + { + char buffer[80]; + strcpy(buffer,"ERROR opening "); + strcat(buffer,device); + perror(buffer); + exit(1); + } + } + else + { + fd = DEFAULTFD; + } + if(info == 1) { int i; - if(ioctl(0, VGAGETSCREEN, &screeninfo) == -1) + if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1) { perror("ioctl VGAGETSCREEN failed"); exit(1); @@ -234,7 +261,7 @@ int charset, fontloaded, charscan, scrscan, scrrow; vfattr.screen_scanlines = scrscan; vfattr.screen_size = scrrow; - if(ioctl(1, VGASETFONTATTR, &vfattr) == -1) + if(ioctl(fd, VGASETFONTATTR, &vfattr) == -1) { perror("loadfont - ioctl VGASETFONTATTR failed, error"); exit(1); @@ -260,7 +287,7 @@ unsigned char *font_table; vlc.char_table[j] = font_table[j]; } font_table += charscanlines; - if(ioctl(1, VGALOADCHAR, &vlc) == -1) + if(ioctl(fd, VGALOADCHAR, &vlc) == -1) { perror("loadfont - ioctl VGALOADCHAR failed, error"); exit(1); @@ -276,7 +303,7 @@ int charset; vfattr.character_set = charset; - if(ioctl(1, VGAGETFONTATTR, &vfattr) == -1) + if(ioctl(fd, VGAGETFONTATTR, &vfattr) == -1) { perror("loadfont - ioctl VGAGETFONTATTR failed, error"); exit(1); @@ -309,8 +336,9 @@ printheader() usage() { fprintf(stderr,"\nloadfont - load font into ega/vga font ram for pcvt video driver\n"); - fprintf(stderr,"usage: loadfont -c<cset> -f<filename> -i\n"); + fprintf(stderr,"usage: loadfont -c <cset> -d <dev> -f <name> -i\n"); fprintf(stderr," -c <cset> characterset to load (ega 0..3, vga 0..7)\n"); + fprintf(stderr," -d <dev> specify device\n"); fprintf(stderr," -f <name> filename containing binary font data\n"); fprintf(stderr," -i print status and types of loaded fonts (default)\n"); exit(1); |