[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: virtual consoles
Kristoffer Lawson writes:
> > >
> > > I do that. That only changes the main console. All the other consoles
> > > have white backgrounds. When I try to run the program on any of the other
> > > consoles it works for the moment, but when I switch to another one, and
> > > then back I have a white background again.. It might be something
> > > funny with the black program of course.. I coded it quickly with GFA.
> > > Used to work fine ;)
> >
> > you flip bit 0 of the first rgb word, right? looks like you hit a
> > bug there, it should copy that even for mono mode.
>
> I just did my black.tos program quickly with GFA's vsetcolor routine.
> That worked great for everything till I installed the vcon program.
well here's the fix (i hope :)
and some experimental patches for (still limited) light/italic support,
thanx to Steffen Ries <str@gondolin.nasim.cube.net>. see Makefile...
Index: README
@@ -178,7 +178,7 @@
2. loadable fonts. there are some new ioctls to load char bitmaps
and keyboard translations for chars >= 0x80, and there is a small
example program that uses these to load raw bitmap files or monospaced
-GDOS (bitmap) fonts of the `right' size. run ttyvfont --h for a
+GDOS (pixel) fonts of the `right' size. run ttyvfont --h for a
help screen... (and improve it if you like, send me the diffs.)
3. and now for something completely different...
Index: screen.c
@@ -403,11 +403,17 @@
dbaselow = s->vbaselow;
linewidth = s->vlinewidth;
hscroll = s->vhscroll;
- shiftmd = s->mode;
- color0 = s->colours[0];
- color1 = s->colours[1];
- color2 = s->colours[2];
- color3 = s->colours[3];
+ if (s->mode != rez_vt) {
+ shiftmd = s->mode;
+ color0 = s->colours[0];
+ color1 = s->colours[1];
+ color2 = s->colours[2];
+ color3 = s->colours[3];
+ }
+#ifdef VTONEPLANE
+ else if (rez_vt < 2)
+ color1 = s->colours[1];
+#endif
intson (sr);
s->saved = 0;
}
Index: README
@@ -1,5 +1,5 @@
From nox Sun Jan 15 19:53:14 1995
-Subject: virtual console(s) (v0.7)
+Subject: virtual console(s) (v0.8)
From: Juergen Lock <nox@jelal.hb.north.de>
here is something you've all been waiting for... virtual terminals
@@ -8,8 +8,9 @@
use up to 10 shells/whatever without magnifying glasses or 19" screens
run GEM on the console, top on ttyv1 and gdb' a GEM program from ttyv2...
send MiNTs debug output to another terminal than the debugged program
- run cu at 19200 bps (or 38400 on modem2) and actually use the speed,
-goodbye crawling GEM terminal emulations...
+ run cu, rlogin-over-ppp, etc. at 19200 bps (or 38400 on modem2)
+and actually use the speed, no more crawling GEM terminal windows
+eating up all your CPU!
when some stupid program hangs and MiNT is still alive just switch to
another terminal and send the thing a signal. (ever heared of vp/ix?
oops, wrong CPU...)
@@ -128,19 +129,27 @@
different cursors for (elvis) command/input/replace mode... stv52c is
the same for programs that use scancodes instead of escape sequences
(like the TOS/MiNT elvis before 1.7, with MiNT 1.7 understands both).
-oh and scancodes don't work over serial lines btw...
+oh and scancodes are not portable btw, they cannot work over sockets
+or serial lines which means on hosts you cu' or telnet/rlogin to
+stv52c is useless. and if you have something that still hasn't heared
+of TERM or termcap yet but is hardcoded for vt100 try running it in
+a `screen' session (-> man screen, you can also install it locally
+on the MiNT box and then do the rlogin/whatever.)
also depending on the video mode lines and columns can differ, if you
-have programs that don't know about TIOCGWINSZ/SIGWINCH adjust the
-numbers after li# and co#, for example on a falcon with VGA screen
-ttyv1..9 have 30 lines -> li#30. there are also programs that don't
-look in termcap but check environment variables LINES and COLUMNS...
-and there are probably still old ones that only look in linea, they
-will always get the size of the console. one last special case is for
-those GEM terminal windows accessed as /dev/console instead of thru ptys,
-because of them ioctl TIOCGWINSZ now returns `size unknown' i.e. ws_row
-and ws_col == 0 for ttyv0 (console) if its xconout vector changed since
-startup. (btw are there more programs besides Gemini that still do this?)
+have programs that don't know about TIOCGWINSZ/SIGWINCH, (or hosts that
+don't i.e. *sigh* SYSV :) adjust the numbers after li# and co#, for
+example on a falcon with VGA screen ttyv1..9 have 30 lines -> li#30.
+there are also programs that don't look in termcap but check environment
+variables LINES and COLUMNS (also on SYSV...?) and there are probably
+still old TOS binaries around that only look in linea, they will always
+get the size of the console. (and usually be CPU hogs too because of
+TOS polling and single-byte IO so thats not the only reason to get
+rid of them.) one last special case is for those GEM terminal windows
+accessed as /dev/console instead of thru ptys, because of them ioctl
+TIOCGWINSZ now returns `size unknown' i.e. ws_row and ws_col == 0
+for ttyv0 (console) if its xconout vector changed since startup.
+(does Gemini know ptys now? some time ago it didn't...)
to switch between terminals just hit alt-fkey, f10 is the console. you
might have to hold down the alt key a little longer sometimes until the
@@ -210,10 +219,10 @@
(hey you can even shut down a mac cleanly, or look at X...)
and thats still not it. said multitos beta no longer polls everything
-but instead it has a race condition that now makes short evnt_timer
-calls often `hang' for > 3 min, especially with MiNT >1.08...
-if this hits you the easiest cure is to get the latest MH-MiNT 1.12,
-it has a kludge in select() that hacks around this GEM bug itself.
+but instead it has a race condition that now makes short evnt_timer calls
+often `hang' for > 3 min, especially with MiNT >1.08... if this hits you
+the easiest cure is to get the latest MH-MiNT 1.12 (aka FreeMiNT by now),
+it has a kludge in select() that hacks around this GEM bug in the kernel.
(what your still waiting for a new multitos release from atari!?
forget it!) and the built-in GEM in at least TOS 1.(0)4 sometimes
apparently `forgets' to initialize pointers in (M)allocated memory i.e.
Index: daemon.c
@@ -1,5 +1,5 @@
/*
- * virtual terminals for MiNT, v0.7 (beta)
+ * virtual terminals for MiNT, v0.8 (beta)
*
* ttyv1..9 are fast hardware-scrolling text-terminals, ttyv0 is the
* original console and may still be used for graphic display and GEM.
Index: Makefile
@@ -2,10 +2,13 @@
CC = gcc # edit asm{}s or make them external .s if you try another one...
+# testing...
+DVLIGHT = -DV_LIGHT
+
# debug:
#CFLAGS = -g -mshort -O2 -Wall
#LFLAGS = -g -mshort
-CFLAGS = -mshort -mpcrel -O2 -Wall -fomit-frame-pointer
+CFLAGS = -mshort -mpcrel -O2 -Wall -fomit-frame-pointer $(DVLIGHT)
LFLAGS = -mshort
LIBS = -liio16
Index: paint.c
@@ -274,6 +274,10 @@
}
if (v->flags & FBOLD)
c += 0x100;
+#ifdef V_LIGHT
+ if (v->flags & FITALIC)
+ c += 0x200;
+#endif /* V_LIGHT */
if (v->fontdata != lastfontdata) {
setup_chartab(v);
lastfontdata = v->fontdata;
@@ -398,12 +402,19 @@
char *place;
{
char *data;
+#ifndef V_LIGHT
char d, doinverse, dounderline;
+#else
+ char d, doinverse, dounderline, dodim;
+#endif /* V_LIGHT */
long vplanesiz;
doinverse = (v->flags & FINVERSE) ? 0xff : 0;
doinverse ^= (d = V_BGMASK(v)[0]);
vplanesiz = v->planesiz;
+#ifdef V_LIGHT
+ dodim = (v->flags & FDIM) ? 0xff : 0;
+#endif /* V_LIGHT */
if (c == ' ' && !(v->flags & FUNDERLINE)) {
d = doinverse;
@@ -411,6 +422,10 @@
}
if (v->flags & FBOLD)
c += 0x100;
+#ifdef V_LIGHT
+ if (v->flags & FITALIC)
+ c += 0x200;
+#endif /* V_LIGHT */
if (v->fontdata != lastfontdata) {
setup_chartab(v);
lastfontdata = v->fontdata;
@@ -418,8 +433,7 @@
data = chartab[c];
dounderline = (v->flags & FUNDERLINE) ? 0xff : 0;
- if (d == V_FGMASK(v)[0])
- {
+ if (d == V_FGMASK(v)[0]) {
space:
/* fgcol and bgcol are the same -- easy */
*place = d;
@@ -455,8 +469,11 @@
*place = d;
place += vplanesiz;
*place = d;
- }
- else if (!doinverse) {
+#ifndef V_LIGHT
+ } else if (!doinverse) {
+#else
+ } else if (!doinverse && !dodim) {
+#endif /* V_LIGHT */
/* line 1 */
d = *data++;
*place = d;
@@ -540,7 +557,11 @@
/* line 16 */
d = *data;
*place = d | dounderline;
+#ifndef V_LIGHT
} else {
+#else
+ } else if (doinverse && !dodim) {
+#endif /* V_LIGHT */
/* line 1 */
d = ~*data++;
*place = d;
@@ -579,7 +600,7 @@
/* line 8 */
d = ~*data++;
if (v->cheight == 8) {
- *place = d | dounderline;
+ *place = d & ~dounderline;
return;
}
*place = d;
@@ -622,9 +643,180 @@
place += vplanesiz;
/* line 16 */
- d = ~*data;
- *place = d | dounderline;
+ d = ~(*data | dounderline);
+ *place = d;
+#ifdef V_LIGHT
+ } else if (!doinverse && dodim) {
+ /* line 1 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 2 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 3 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 4 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 5 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 6 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 7 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 8 */
+ d = *data++ & 0x55;
+ if (v->cheight == 8) {
+ *place = d | (dounderline & 0x55);
+ return;
+ }
+ *place = d;
+
+ place += vplanesiz;
+
+ /* line 9 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 10 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 11 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 12 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 13 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 14 */
+ d = *data++ & 0x55;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 15 */
+ d = *data++ & 0xaa;
+ *place = d;
+ place += vplanesiz;
+
+ /* line 16 */
+ d = (*data | dounderline) & 0x55;
+ *place = d;
+ } else {
+ /* line 1 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 2 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 3 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 4 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 5 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 6 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 7 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 8 */
+ d = ~(*data++ & 0x55);
+ if (v->cheight == 8) {
+ *place = d & ~(dounderline & 0x55);
+ return;
+ }
+ *place = d;
+
+ place += vplanesiz;
+
+ /* line 9 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 10 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 11 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 12 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 13 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 14 */
+ d = ~(*data++ & 0x55);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 15 */
+ d = ~(*data++ & 0xaa);
+ *place = d;
+ place += vplanesiz;
+
+ /* line 16 */
+ d = ~((*data | dounderline) & 0x55);
+ *place = d;
+#endif /* V_LIGHT */
}
+
}
/*
Index: vtdev.c
@@ -39,7 +39,11 @@
#define SCNSIZE(v) ( (((long)v->maxy + hardscroll + 2)) * v->linelen )
SCREEN *v00, v0x[N_VT-1];
+#ifndef V_LIGHT
char *chartab[256*2];
+#else
+char *chartab[256*4];
+#endif /* V_LIGHT */
short hardscroll;
long scrnsize;
char *rowoff;
@@ -212,7 +216,11 @@
{
int i, j;
char *data, *foo;
+#ifndef V_LIGHT
static char chardata[256*16*2];
+#else
+ static char chardata[256*16*4];
+#endif /* V_LIGHT */
#ifndef FORCE1PLANE
if (v->cheight == 8 && V_USEDPLANES(v) == 2) {
@@ -237,10 +245,37 @@
data += v->form_width;
}
}
+#ifdef V_LIGHT
+ for (i = 0; i < 256; i++) {
+ chartab[i+0x200] = foo; /* italic */
+ data = v->fontdata + i;
+ for (j = 0; j < v->cheight; j++) {
+ unsigned char d = *data;
+ int skew = j / SKEW - v->cheight/(2*SKEW);
+
+ d = skew < 0 ? d >> -skew : d << skew;
+ *foo++ = d;
+ data += v->form_width;
+ }
+ }
+ for (i = 0; i < 256; i++) {
+ chartab[i+0x300] = foo; /* bold-italic */
+ data = v->fontdata + i;
+ for (j = 0; j < v->cheight; j++) {
+ unsigned char d = *data;
+ int skew = j / SKEW - v->cheight/(2*SKEW);
+
+ d = skew < 0 ? d >> -skew : d << skew;
+ d |= d >> 1;
+ *foo++ = d;
+ data += v->form_width;
+ }
+ }
+#endif /* V_LIGHT */
} else if ((v->cheight == 16 || v->cheight == 8) &&
V_USEDPLANES(v) == 1) {
vpaint = paint816m;
-#endif
+#endif /* ndef FORCE1PLANE */
foo = &chardata[0];
for (i = 0; i < 256; i++) {
chartab[i] = foo;
@@ -251,11 +286,41 @@
}
}
for (i = 0; i < 256; i++) {
+#ifndef V_LIGHT
chartab[i+256] = foo;
+#else
+ chartab[i+0x100] = foo;
+ data = v->fontdata + i;
+ for (j = 0; j < v->cheight; j++) {
+ unsigned char d = *data;
+
+ d |= d >> 1;
+ *foo++ = d;
+ data += v->form_width;
+ }
+ }
+ for (i = 0; i < 256; i++) {
+ chartab[i+0x200] = foo; /* italic */
data = v->fontdata + i;
for (j = 0; j < v->cheight; j++) {
unsigned char d = *data;
+ int skew = j / SKEW - v->cheight/(2*SKEW);
+ d = skew < 0 ? d >> -skew : d << skew;
+ *foo++ = d;
+ data += v->form_width;
+ }
+ }
+ for (i = 0; i < 256; i++) {
+ chartab[i+0x300] = foo; /* bold-italic */
+#endif /* V_LIGHT */
+ data = v->fontdata + i;
+ for (j = 0; j < v->cheight; j++) {
+ unsigned char d = *data;
+#ifdef V_LIGHT
+ int skew = j / SKEW - v->cheight/(2*SKEW);
+ d = skew < 0 ? d >> -skew : d << skew;
+#endif /* V_LIGHT */
d |= d >> 1;
*foo++ = d;
data += v->form_width;
@@ -766,6 +831,10 @@
{
v->flags |= ((c & 0x10) ? FINVERSE : 0)|
((c & 0x8) ? FUNDERLINE : 0)|
+#ifdef V_LIGHT
+ ((c & 0x4) ? FITALIC : 0)|
+ ((c & 0x2) ? FDIM : 0)|
+#endif /* V_LIGHT */
((c & 0x1) ? FBOLD : 0);
*V_STATE(v) = normal_putch;
}
@@ -778,6 +847,10 @@
{
v->flags &= ~(((c & 0x10) ? FINVERSE : 0)|
((c & 0x8) ? FUNDERLINE : 0)|
+#ifdef V_LIGHT
+ ((c & 0x4) ? FITALIC : 0)|
+ ((c & 0x2) ? FDIM : 0)|
+#endif /* V_LIGHT */
((c & 0x1) ? FBOLD : 0));
*V_STATE(v) = normal_putch;
}
Index: vtdev.h
@@ -105,8 +105,12 @@
short form_width; /* # bytes/scanline in font data */
short xpixel;
char *fontoff; /* pointer to font offset table */
+#ifndef V_LIGHT
char flags; /* e.g. cursor on/off */
char reserved;
+#else
+ short flags; /* e.g. cursor on/off */
+#endif /* V_LIGHT */
short ypixel;
short width; /* length of a screen scan line */
short planes; /* number of planes on screen */
@@ -122,6 +126,11 @@
#define FUNDERLINE 0x20 /* EXTENSION: underline text */
#define CURS_UPD 0x40 /* cursor update flag */
#define FBOLD 0x80 /* EXTENSION: boldface */
+#ifdef V_LIGHT
+#define FDIM 0x100 /* EXTENSION: light face */
+#define FITALIC 0x200 /* EXTENSION: italic face */
+#define SKEW 4 /* skew-factor for italic face */
+#endif /* V_LIGHT */
/* possible flags for cursor shape */
#define CURS_STEADY 0x01 /* flashing off */
@@ -188,7 +197,11 @@
extern long pgrp;
extern short hardscroll, leaving, os_version;
extern SCREEN *v00, v0x[], *current;
+#ifndef V_LIGHT
extern char *chartab[256*2];
+#else
+extern char *chartab[256*4];
+#endif /* V_LIGHT */
extern long scrnsize;
extern char *rowoff;
#ifndef FORCE1PLANE
Index: Makefile
@@ -2,7 +2,8 @@
CC = gcc # edit asm{}s or make them external .s if you try another one...
-# testing...
+# experimental light/italic support... might not work on console
+# (unless -DVT00XCON), won't yet work with char cells != 8x8 or 8x16
DVLIGHT = -DV_LIGHT
# debug:
Index: paint.c
@@ -36,7 +36,7 @@
#ifndef FORCE1PLANE
if (vpaint == paint816m) {
#endif
- if (V_CSHAPE(v) == CURS_BLOCK) {
+ if (V_CSHAPE(v) == CS_BLOCK) {
/* block cursor */
*place = ~*place;
place += vplanesiz;
@@ -88,7 +88,7 @@
#ifndef FORCE1PLANE
}
if (vpaint == paint8c) {
- if (V_CSHAPE(v) == CURS_BLOCK) {
+ if (V_CSHAPE(v) == CS_BLOCK) {
/* block cursor */
*place = ~*place;
place[2] = ~place[2];
@@ -129,7 +129,7 @@
vplanes = V_USEDPLANES(v);
vplanes += vplanes;
- if (V_CSHAPE(v) == CURS_BLOCK) {
+ if (V_CSHAPE(v) == CS_BLOCK) {
/* block cursor */
for (j = v->cheight; j > 0; --j) {
char *q = place;
Index: vtdev.c
@@ -810,7 +810,7 @@
SCREEN *v;
int c;
{
- if (c & 1) {
+ if (c & CS_STEADY) {
v->flags &= ~CURS_FLASH;
--c;
} else {
Index: vtdev.h
@@ -105,12 +105,7 @@
short form_width; /* # bytes/scanline in font data */
short xpixel;
char *fontoff; /* pointer to font offset table */
-#ifndef V_LIGHT
- char flags; /* e.g. cursor on/off */
- char reserved;
-#else
short flags; /* e.g. cursor on/off */
-#endif /* V_LIGHT */
short ypixel;
short width; /* length of a screen scan line */
short planes; /* number of planes on screen */
@@ -118,24 +113,24 @@
} SCREEN;
/* possible flags for cursor state, etc. */
-#define CURS_FLASH 0x01 /* cursor flashing */
-#define CURS_FSTATE 0x02 /* cursor in flash state */
-#define CURS_ON 0x04 /* cursor on */
-#define FWRAP 0x08 /* wrap cursor at end of line */
-#define FINVERSE 0x10 /* invert text */
-#define FUNDERLINE 0x20 /* EXTENSION: underline text */
-#define CURS_UPD 0x40 /* cursor update flag */
-#define FBOLD 0x80 /* EXTENSION: boldface */
+#define CURS_FLASH 0x0100 /* cursor flashing */
+#define CURS_FSTATE 0x0200 /* cursor in flash state */
+#define CURS_ON 0x0400 /* cursor on */
+#define FWRAP 0x0800 /* wrap cursor at end of line */
+#define FINVERSE 0x1000 /* invert text */
+#define FUNDERLINE 0x2000 /* EXTENSION: underline text */
+#define CURS_UPD 0x4000 /* cursor update flag */
+#define FBOLD 0x8000 /* EXTENSION: boldface */
#ifdef V_LIGHT
-#define FDIM 0x100 /* EXTENSION: light face */
-#define FITALIC 0x200 /* EXTENSION: italic face */
+#define FDIM 0x01 /* EXTENSION: light face */
+#define FITALIC 0x02 /* EXTENSION: italic face */
#define SKEW 4 /* skew-factor for italic face */
#endif /* V_LIGHT */
/* possible flags for cursor shape */
-#define CURS_STEADY 0x01 /* flashing off */
-#define CURS_UNDERLINE 0x00 /* underline cursor */
-#define CURS_BLOCK 0x02 /* block cursor */
+#define CS_STEADY 0x01 /* flashing off */
+#define CS_UNDERLINE 0x00 /* underline cursor */
+#define CS_BLOCK 0x02 /* block cursor */
#define base (*((char **)0x44eL))
@@ -175,7 +170,7 @@
#define V_STATE(x) ((x) == v00 ? &v00state : &(x)->v.t.state)
#define V_FGMASK(x) ((x) == v00 ? fgmask : (x)->v.t.fgmask)
#define V_BGMASK(x) ((x) == v00 ? bgmask : (x)->v.t.bgmask)
-#define V_CSHAPE(x) ((x) == v00 ? CURS_BLOCK : (x)->v.t.cshape)
+#define V_CSHAPE(x) ((x) == v00 ? CS_BLOCK : (x)->v.t.cshape)
#define V_USEDPLANES(x) ((x) == v00 ? (x)->planes : (x)->v.t.usedplanes)
#define V_FGFF(x) ((x) == v00 ? &fgff : &(x)->v.t.fgff)
#define V_BG00(x) ((x) == v00 ? &bg00 : &(x)->v.t.bg00)