diff options
Diffstat (limited to 'loader/kon2')
-rw-r--r-- | loader/kon2/include/config.h | 12 | ||||
-rw-r--r-- | loader/kon2/include/errors.h | 2 | ||||
-rw-r--r-- | loader/kon2/include/mouse.h | 2 | ||||
-rw-r--r-- | loader/kon2/include/version.h | 2 | ||||
-rw-r--r-- | loader/kon2/src/fnld.c | 63 | ||||
-rw-r--r-- | loader/kon2/src/term.c | 6 |
6 files changed, 70 insertions, 17 deletions
diff --git a/loader/kon2/include/config.h b/loader/kon2/include/config.h index 9a8f7143d..ab5145a8d 100644 --- a/loader/kon2/include/config.h +++ b/loader/kon2/include/config.h @@ -37,16 +37,14 @@ /* build MINI KON */ -#define MINI_KON /* Support VGA driver */ #define HAS_VGA /* Support J31SX driver */ -#define HAS_J31SX /* Support MOUSE driver */ -#undef HAS_MOUSE +#define HAS_MOUSE /* Install Minix/V font loader */ #define FLD_MINIX @@ -58,14 +56,10 @@ #define FLD_FONTX2 /* Install J3100ROM font loader */ -#define FLD_J31ROM /* Use ROM font */ -#define USE_ROMFONT -#endif -#ifdef MINI_KON -#undef USE_ROMFONT -#define USE_ROMFONT +/* Use Static font */ +#define USE_STATICFONT #endif diff --git a/loader/kon2/include/errors.h b/loader/kon2/include/errors.h index f4bfc1e18..c4f0c1a08 100644 --- a/loader/kon2/include/errors.h +++ b/loader/kon2/include/errors.h @@ -29,8 +29,6 @@ #ifndef ERRORS_H #define ERRORS_H -#define error kon_error - extern void Perror(const char *message); /* perror(message) */ extern void PerrorExit(const char *message); /* perror(message) and die */ extern void fatal(const char *format, ...); /* print error message and die */ diff --git a/loader/kon2/include/mouse.h b/loader/kon2/include/mouse.h index 6c01006ca..fec8afa85 100644 --- a/loader/kon2/include/mouse.h +++ b/loader/kon2/include/mouse.h @@ -50,7 +50,7 @@ extern int mouseFd; extern void MouseInit(void); extern int MouseStart(void); -extern void MouseGetPacket(u_char *, int); +extern void MouseGetPacket(unsigned char *, int); extern void MouseCleanup(void); extern void MouseSetRfd(int); extern void MouseResetRfd(int); diff --git a/loader/kon2/include/version.h b/loader/kon2/include/version.h index e50b625c6..165a07108 100644 --- a/loader/kon2/include/version.h +++ b/loader/kon2/include/version.h @@ -1 +1 @@ -#define VERSION "ver.0.3.8 (98/03/09)" +#define VERSION "ver.0.3.9 (2000/03/21)" diff --git a/loader/kon2/src/fnld.c b/loader/kon2/src/fnld.c index 499bce962..c3c282636 100644 --- a/loader/kon2/src/fnld.c +++ b/loader/kon2/src/fnld.c @@ -50,7 +50,7 @@ struct fontRegs *dbFReg, *sbFReg; #define PATH_MINIFONT "/usr/lib/minikon.fnt.gz" #define CMD_MINIFONT "/bin/gzip -dc "PATH_MINIFONT #else -#define PATH_MINIFONT "/etc/minikon.fnt" +#define PATH_MINIFONT "/usr/lib/minikon.fnt" #endif void @@ -106,6 +106,8 @@ LoadMiniFont() #endif } +#ifdef USE_ROMFONT + void VgaLoadRomFont(char *fontbuff) { @@ -133,6 +135,34 @@ VgaLoadRomFont(char *fontbuff) loaded = 1; } +#else /* USE_ROMFONT */ + +#include "vgafont.h" + +void +VgaLoadStaticFont() +{ + static int loaded=0; + int i; + + if (loaded) return; + i = 1; + sbFReg = &fSRegs[0]; + sbFReg->size = 256 * 16; + sbFReg->high = 16; + sbFReg->stat = FR_ATTACH; + sbFReg->bitmap = vgaFont; + while (fSRegs[i].registry) { + fSRegs[i].high = sbFReg->high; + fSRegs[i].stat = FR_PROXY; + fSRegs[i].size = sbFReg->size; + fSRegs[i].bitmap = sbFReg->bitmap; + i ++; + } + loaded = 1; +} +#endif /* USE_ROMFONT */ + #else #ifdef USE_ROMFONT @@ -167,6 +197,37 @@ VgaLoadRomFont(char *fontbuff) #endif +#ifdef USE_STATICFONT + +#include "vgafont.h" + +void +VgaLoadStaticFont() +{ + static int loaded=0; + key_t shmkey; + int shmid, i; + u_char *shmbuff, *buff; + struct fontInfo fi; + + if (loaded) return; + shmkey = ftok(CONFIG_NAME, CHR_SFLD); + fi.size = 256 * 16; + fi.high = 16; + fi.width = 8; + fi.type = CHR_SFLD; + shmid = shmget(shmkey, fi.size+sizeof(struct fontInfo), + IPC_CREAT|0666); + shmbuff = shmat(shmid, 0, 0); + memcpy(shmbuff, &fi, sizeof(struct fontInfo)); + buff = shmbuff + sizeof(struct fontInfo); + + memcpy(buff, vgaFont, fi.size); + shmdt(shmbuff); + loaded = 1; +} +#endif /* MINI_KON || USE_STATICFONT */ + void FontDetach(bool down) { int i; diff --git a/loader/kon2/src/term.c b/loader/kon2/src/term.c index a415b6b7d..7133363ee 100644 --- a/loader/kon2/src/term.c +++ b/loader/kon2/src/term.c @@ -259,7 +259,7 @@ static void ProcessArgs(int argc, const char *argv[]) const char *arg; if (argv[i][0] != '-') { - kon_warn("bad arg `%s'; assumed `-%s'\r\n", argv[i]); + warn("bad arg `%s'; assumed `-%s'\r\n", argv[i]); arg = (char *) argv[i]; } else arg = (char *) argv[i] + 1; @@ -271,7 +271,7 @@ static void ProcessArgs(int argc, const char *argv[]) if (!strcasecmp(arg, "e")) ConfigExecProg(argv[i]); else if (SetCapArg(arg, argv[i]) < 0) - kon_warn("invalid capability `%s' ignored\r\n", arg); + warn("invalid capability `%s' ignored\r\n", arg); i++; } } @@ -512,7 +512,7 @@ void ChangeOrgConsole() #if defined(linux) cfd = open("/dev/console", O_WRONLY); if (cfd < 0 && (cfd = open("/dev/console", O_RDONLY)) < 0) { - PerrorExit("/dev/console"); + PerrorExit("/dev/console"); } #elif defined(__FreeBSD__) cfd = open("/dev/vga", O_WRONLY); |