summaryrefslogtreecommitdiffstats
path: root/loader/kon2/src
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-04-18 00:33:20 +0000
committerMatt Wilson <msw@redhat.com>2000-04-18 00:33:20 +0000
commit76de05be197968f874fdffd035ec577a7d0918d6 (patch)
tree2cd3a606ea116e2cd4310cd4194718ca99b458bd /loader/kon2/src
parent92035702beb8056b4f5b745de2d724c4169f9149 (diff)
partial merge to latest
Diffstat (limited to 'loader/kon2/src')
-rw-r--r--loader/kon2/src/display/j31sx.c2
-rw-r--r--loader/kon2/src/display/vga.c44
-rw-r--r--loader/kon2/src/vc.c125
3 files changed, 85 insertions, 86 deletions
diff --git a/loader/kon2/src/display/j31sx.c b/loader/kon2/src/display/j31sx.c
index 380c040a7..f93bdda1b 100644
--- a/loader/kon2/src/display/j31sx.c
+++ b/loader/kon2/src/display/j31sx.c
@@ -47,7 +47,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-/* #include <linux/mm.h> */
+#include <linux/mm.h>
#include <sys/kd.h>
#undef free
#include <stdlib.h>
diff --git a/loader/kon2/src/display/vga.c b/loader/kon2/src/display/vga.c
index f5bb3e176..48201f584 100644
--- a/loader/kon2/src/display/vga.c
+++ b/loader/kon2/src/display/vga.c
@@ -99,10 +99,8 @@ u_int vgaSt1Addr = 0x3DA;
static char *gramMem; /* dummy buffer for mmapping grahics memory */
static char *fontBuff1; /* saved font data - plane 2 */
-#ifndef MINI_KON
static bool savePlane3;
static char *fontBuff2; /* saved font data - plane 3 */
-#endif
static u_int writeAddr; /* address to write next character */
@@ -237,13 +235,15 @@ void VgaInit(void)
#ifdef USE_ROMFONT
VgaLoadRomFont(fontBuff1);
#endif
-#ifndef MINI_KON
- if (savePlane3) {
+#if defined(MINI_KON) || defined(USE_STATICFONT)
+ VgaLoadStaticFont();
+#endif
+
+ if (savePlane3 && fontBuff2) {
/* save font data in plane 3 */
PortOutw(0x0304, VGAGRP_ADDR);
memcpy(fontBuff2, gramMem, FONT_SIZE);
}
-#endif
}
void VgaTextMode(void)
@@ -264,14 +264,12 @@ void VgaTextMode(void)
PortOutb(0x04, VGASEQ_DATA );
memcpy(gramMem, fontBuff1, FONT_SIZE);
-#ifndef MINI_KON
if (savePlane3) {
/* restore font data in plane 3 - necessary for Trident VGA's */
PortOutb(0x02, VGASEQ_ADDR );
PortOutb(0x08, VGASEQ_DATA );
memcpy(gramMem, fontBuff2, FONT_SIZE);
}
-#endif
/* restore text mode VGA registers */
VgaSetRegisters(&regText);
@@ -435,17 +433,17 @@ void VgaHardScrollUp(int line)
if (line > dInfo.tymax) {
line %= dInfo.tymax + 1;
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
oldhead = gramHead;
gramHead += line * dInfo.tlineByte;
if (gramHead >= dInfo.gsize) {
gramHead -= dInfo.gsize;
- lzero(gramMem + oldhead, dInfo.gsize - oldhead);
-/* if (gramHead) lzero(gramMem, gramHead);*/
- lzero(gramMem, gramHead);
- } else lzero(gramMem + oldhead, gramHead - oldhead);
+ bzero(gramMem + oldhead, dInfo.gsize - oldhead);
+/* if (gramHead) bzero(gramMem, gramHead);*/
+ bzero(gramMem, gramHead);
+ } else bzero(gramMem + oldhead, gramHead - oldhead);
vInfo.set_start_address();
}
@@ -457,17 +455,17 @@ void VgaHardScrollDown(int line)
if (line > dInfo.tymax) {
line %= dInfo.tymax + 1;
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
oldhead = gramHead;
gramHead -= line * dInfo.tlineByte;
if (gramHead < 0) {
gramHead += dInfo.gsize;
-/* if (oldhead) lzero(gramMem, oldhead);*/
- lzero(gramMem, oldhead);
- lzero(gramMem + gramHead, dInfo.gsize - gramHead);
- } else lzero(gramMem + gramHead, oldhead - gramHead);
+/* if (oldhead) bzero(gramMem, oldhead);*/
+ bzero(gramMem, oldhead);
+ bzero(gramMem + gramHead, dInfo.gsize - gramHead);
+ } else bzero(gramMem + gramHead, oldhead - gramHead);
vInfo.set_start_address();
}
@@ -515,7 +513,7 @@ void VgaCursor(struct cursorInfo *ci)
void VgaClearAll(void)
{
VgaSetColor((con.attr & ATTR_REVERSE ? con.fcol:con.bcol)&7);
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
void VgaScreenSaver(bool blank)
@@ -668,9 +666,7 @@ int VgaAttach(void)
}
#endif
if ((fontBuff1 = malloc(FONT_SIZE)) == NULL
-#ifndef MINI_KON
|| (savePlane3 && (fontBuff2 = malloc(FONT_SIZE)) == NULL)
-#endif
) {
Perror("malloc ");
return FAILURE;
@@ -728,22 +724,18 @@ void VgaDetach(void)
SafeFree((void **)&gramMem);
SafeFree((void **)&fontBuff1);
-#ifndef MINI_KON
- if (savePlane3)
+ if (savePlane3 && fontBuff2)
SafeFree((void **)&fontBuff2);
-#endif
}
/* Configure */
-#ifndef MINI_KON
static
int ConfigPlane3(const char *confstr)
{
savePlane3 = BoolConf(confstr);
return SUCCESS;
}
-#endif
static
int ConfigKanjiCursor(const char *confstr)
@@ -769,9 +761,7 @@ static
void VgaDefaultCaps()
{
DefineCap("Pels", VgaReadPels, NULL);
-#ifndef MINI_KON
DefineCap("SavePlane3", ConfigPlane3, "Off");
-#endif
DefineCap("KanjiCursor", ConfigKanjiCursor, "On");
DefineCap("CursorTop", ConfigCursorTop, "14");
DefineCap("CursorBottom", ConfigCursorBottom, "15");
diff --git a/loader/kon2/src/vc.c b/loader/kon2/src/vc.c
index 387cdefae..e2f588fad 100644
--- a/loader/kon2/src/vc.c
+++ b/loader/kon2/src/vc.c
@@ -97,6 +97,12 @@ static
inline void blatch(void *head, int n)
{
+ int i;
+ unsigned char *p=head;
+
+ for (i = 0; i < n; i ++, p ++) *p &= 0x7F;
+
+#if 0
__asm__("\t clc\n"
"1:\n"
"\t andb %%bl, (%%eax)\n"
@@ -105,12 +111,15 @@ inline void blatch(void *head, int n)
:
: "eax" ((long)head), "bl" (0x7F), "c" (n)
: "bl", "cx" );
+#endif
}
static
inline void llatch(void *head, int n)
{
+ blatch(head, n);
+#if 0
__asm__("\t clc\n"
"1:\n"
"\t andl %%ebx, (%%eax)\n"
@@ -119,6 +128,7 @@ inline void llatch(void *head, int n)
:
: "eax" ((long)head), "ebx" (0x7F7F7F7F), "c" (n>>2)
: "ebx", "cx" );
+#endif
}
static inline u_int TextAddress(u_int x, u_int y)
@@ -159,33 +169,33 @@ void TextDeleteChar(int n)
addr = TextAddress(con.x, con.y);
dx = dInfo.glineByte - con.x - n;
- bmove(textBuff + addr, textBuff + addr + n, dx);
- bmove(attrBuff + addr, attrBuff + addr + n, dx);
- bmove(flagBuff + addr, flagBuff + addr + n, dx);
+ memcpy(textBuff + addr, textBuff + addr + n, dx);
+ memcpy(attrBuff + addr, attrBuff + addr + n, dx);
+ memcpy(flagBuff + addr, flagBuff + addr + n, dx);
+
blatch(flagBuff + addr, dx);
addr = TextAddress(dInfo.glineByte - n, con.y);
- bzero2(textBuff + addr, n);
- bzero2(attrBuff + addr, n);
- bzero2(flagBuff + addr, n);
+ bzero(textBuff + addr, n);
+ bzero(attrBuff + addr, n);
+ bzero(flagBuff + addr, n);
}
void TextInsertChar(int n)
{
u_int addr, dx;
- addr = TextAddress(dInfo.txmax, con.y);
- dx = dInfo.glineByte - con.x - n;
- brmove(textBuff + addr, textBuff + addr - n, dx);
- brmove(attrBuff + addr, attrBuff + addr - n, dx);
- brmove(flagBuff + addr, flagBuff + addr - n, dx);
-
addr = TextAddress(con.x, con.y);
+ dx = dInfo.txmax - con.x - n;
+ memmove(textBuff + addr + n, textBuff + addr, dx);
+ memmove(attrBuff + addr + n, attrBuff + addr, dx);
+ memmove(flagBuff + addr + n, flagBuff + addr, dx);
+
blatch(flagBuff + addr + n, dx);
- bzero2(textBuff + addr, n);
- bzero2(attrBuff + addr, n);
- bzero2(flagBuff + addr, n);
+ bzero(textBuff + addr, n);
+ bzero(attrBuff + addr, n);
+ bzero(flagBuff + addr, n);
}
void TextRefresh(void)
@@ -253,8 +263,7 @@ void TextRefresh(void)
vInfo.set_cursor_address(&cInfo, con.x, con.y);
ShowCursor(&cInfo, TRUE);
busy = FALSE;
- if (release)
- LeaveVC(SIGUSR1);
+ if (release) LeaveVC(SIGUSR1);
}
static struct winsize text_win;
@@ -368,14 +377,14 @@ static
textHead -= textSize;
len = textSize - oldhead;
if (textHead) {
- lzero(textBuff, textHead);
- lzero(attrBuff, textHead);
- lzero(flagBuff, textHead);
+ bzero(textBuff, textHead);
+ bzero(attrBuff, textHead);
+ bzero(flagBuff, textHead);
}
} else len = textHead - oldhead;
- lzero(textBuff + oldhead, len);
- lzero(attrBuff + oldhead, len);
- lzero(flagBuff + oldhead, len);
+ bzero(textBuff + oldhead, len);
+ bzero(attrBuff + oldhead, len);
+ bzero(flagBuff + oldhead, len);
}
static
@@ -388,15 +397,15 @@ static
if (textHead < 0) {
textHead += textSize;
if (oldhead) {
- lzero(textBuff, oldhead);
- lzero(attrBuff, oldhead);
- lzero(flagBuff, oldhead);
+ bzero(textBuff, oldhead);
+ bzero(attrBuff, oldhead);
+ bzero(flagBuff, oldhead);
}
len = textSize - textHead;
} else len = oldhead - textHead;
- lzero(textBuff + textHead, len);
- lzero(attrBuff + textHead, len);
- lzero(flagBuff + textHead, len);
+ bzero(textBuff + textHead, len);
+ bzero(attrBuff + textHead, len);
+ bzero(flagBuff + textHead, len);
}
void TextWput(u_char ch1, u_char ch2)
@@ -429,14 +438,14 @@ void TextClearAll(void)
for (y = 0; y <= con.ymax; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
}
#else
- lzero(textBuff, textSize);
- lzero(attrBuff, textSize);
+ bzero(textBuff, textSize);
+ bzero(attrBuff, textSize);
#endif
- lzero(flagBuff, textSize);
+ bzero(flagBuff, textSize);
#ifndef MINI_KON
mInfo.sw = 0;
#endif
@@ -461,9 +470,9 @@ void TextClearEol(u_char mode)
break;
}
addr = TextAddress(x, con.y);
- bzero2(textBuff + addr, len);
- bzero2(attrBuff + addr, len);
- bzero2(flagBuff + addr, len);/* needless to latch */
+ bzero(textBuff + addr, len);
+ bzero(attrBuff + addr, len);
+ bzero(flagBuff + addr, len);/* needless to latch */
}
void TextClearEos(u_char mode)
@@ -478,27 +487,27 @@ void TextClearEos(u_char mode)
case 1:
for (y = 0; y < con.y; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
+ bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
}
addr = TextAddress(0, con.y);
- bzero2(textBuff + addr, con.x);
- bzero2(attrBuff + addr, con.x);
- bzero2(flagBuff + addr, con.x);/* needless to latch */
+ bzero(textBuff + addr, con.x);
+ bzero(attrBuff + addr, con.x);
+ bzero(flagBuff + addr, con.x);/* needless to latch */
break;
default:
for (y = con.y + 1; y <= con.ymax; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
+ bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
}
addr = TextAddress(con.x, con.y);
len = dInfo.glineByte - con.x;
- bzero2(textBuff + addr, len);
- bzero2(attrBuff + addr, len);
- bzero2(flagBuff + addr, len);/* needless to latch */
+ bzero(textBuff + addr, len);
+ bzero(attrBuff + addr, len);
+ bzero(flagBuff + addr, len);/* needless to latch */
break;
}
}
@@ -510,9 +519,9 @@ static
for (y = top; y <= btm; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
+ bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
}
}
@@ -527,9 +536,9 @@ void TextMoveDown(int top, int btm, int line)
for (n = btm; n >= top + line; n --) {
dst = TextAddress(0, n);
src = TextAddress(0, n - line);
- lmove(textBuff + dst, textBuff + src, dInfo.glineByte);
- lmove(attrBuff + dst, attrBuff + src, dInfo.glineByte);
- lmove(flagBuff + dst, flagBuff + src, dInfo.glineByte);
+ memcpy(textBuff + dst, textBuff + src, dInfo.glineByte);
+ memcpy(attrBuff + dst, attrBuff + src, dInfo.glineByte);
+ memcpy(flagBuff + dst, flagBuff + src, dInfo.glineByte);
llatch(flagBuff + dst, dInfo.glineByte);
}
TextClearBand(top, top + line - 1);
@@ -546,9 +555,9 @@ void TextMoveUp(int top, int btm, int line)
for (n = top; n <= btm - line; n ++) {
dst = TextAddress(0, n);
src = TextAddress(0, n + line);
- lmove(textBuff + dst, textBuff + src, dInfo.glineByte);
- lmove(attrBuff + dst, attrBuff + src, dInfo.glineByte);
- lmove(flagBuff + dst, flagBuff + src, dInfo.glineByte);
+ memcpy(textBuff + dst, textBuff + src, dInfo.glineByte);
+ memcpy(attrBuff + dst, attrBuff + src, dInfo.glineByte);
+ memcpy(flagBuff + dst, flagBuff + src, dInfo.glineByte);
llatch(flagBuff + dst, dInfo.glineByte);
}
TextClearBand(btm - line + 1, btm);