Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/gnot/screen.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname gnot/screen.c 1990/03091
## diff -e /dev/null /n/bootesdump/1990/03091/sys/src/9/68020/screen.c
0a
#include	"u.h"
#include	"lib.h"
#include	"mem.h"
#include	"dat.h"
#include	"fns.h"
#include	"io.h"

#include	"gnot.h"

#define	MINX	8

extern	Font	defont0;

struct{
	Point	pos;
	int	bwid;
}out;

Bitmap	screen =
{
	(ulong*)(2*1024*1024|KZERO),	/* BUG */
	0,
	64,
	0,
	0, 0, 1024, 1024,
	0
};

void
screeninit(void)
{
	bitblt(&screen, Pt(0, 0), &screen, screen.rect, 0);
	out.pos.x = MINX;
	out.pos.y = 0;
	out.bwid = defont0.info[' '].width;
}

void
screenputc(int c)
{
	char buf[2];
	int nx;

	if(c == '\n'){
		out.pos.x = MINX;
		out.pos.y += defont0.height;
		if(out.pos.y > screen.rect.max.y-defont0.height)
			out.pos.y = screen.rect.min.y;
		bitblt(&screen, Pt(0, out.pos.y), &screen,
		    Rect(0, out.pos.y, screen.rect.max.x, out.pos.y+2*defont0.height), 0);
	}else if(c == '\t'){
		nx = out.pos.x + (8-(out.pos.x/out.bwid&7))*out.bwid;
		out.pos.x = nx;
		if(out.pos.x >= screen.rect.max.x)
			screenputc('\n');
	}else if(c == '\b'){
		if(out.pos.x >= out.bwid+MINX){
			out.pos.x -= out.bwid;
			screenputc(' ');
			out.pos.x -= out.bwid;
		}
	}else{
		if(out.pos.x >= screen.rect.max.x-out.bwid)
			screenputc('\n');
		buf[0] = c&0x7F;
		buf[1] = 0;
		out.pos = string(&screen, out.pos, &defont0, buf, S);
	}
}

/*
 * Register set for half the duart.  There are really two sets.
 */
struct Duart{
	uchar	mr1_2;		/* Mode Register Channels 1 & 2 */
	uchar	sr_csr;		/* Status Register/Clock Select Register */
	uchar	cmnd;		/* Command Register */
	uchar	data;		/* RX Holding / TX Holding Register */
	uchar	ipc_acr;	/* Input Port Change/Aux. Control Register */
	uchar	is_imr;		/* Interrupt Status/Interrupt Mask Register */
	uchar	ctur;		/* Counter/Timer Upper Register */
	uchar	ctlr;		/* Counter/Timer Lower Register */
};

enum{
	CHAR_ERR	=0x00,	/* MR1x - Mode Register 1 */
	EVEN_PAR	=0x00,
	ODD_PAR		=0x04,
	NO_PAR		=0x10,
	CBITS8		=0x03,
	CBITS7		=0x02,
	CBITS6		=0x01,
	CBITS5		=0x00,
	NORM_OP		=0x00,	/* MR2x - Mode Register 2 */
	TWOSTOPB	=0x0F,
	ONESTOPB	=0x07,
	ENB_RX		=0x01,	/* CRx - Command Register */
	DIS_RX		=0x02,
	ENB_TX		=0x04,
	DIS_TX		=0x08,
	RESET_MR 	=0x10,
	RESET_RCV  	=0x20,
	RESET_TRANS  	=0x30,
	RESET_ERR  	=0x40,
	RESET_BCH	=0x50,
	STRT_BRK	=0x60,
	STOP_BRK	=0x70,
	RCV_RDY		=0x01,	/* SRx - Channel Status Register */
	FIFOFULL	=0x02,
	XMT_RDY		=0x04,
	XMT_EMT		=0x08,
	OVR_ERR		=0x10,
	PAR_ERR		=0x20,
	FRM_ERR		=0x40,
	RCVD_BRK	=0x80,
	IM_IPC		=0x80,	/* IMRx/ISRx - Interrupt Mask/Interrupt Status */
	IM_DBB		=0x40,
	IM_RRDYB	=0x20,
	IM_XRDYB	=0x10,
	IM_CRDY		=0x08,
	IM_DBA		=0x04,
	IM_RRDYA	=0x02,
	IM_XRDYA	=0x01,
};

uchar keymap[]={
/*80*/	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,
	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x8e,	0x58,
/*90*/	0x90,	0x91,	0x92,	0x93,	0x94,	0x95,	0x96,	0x97,
	0x98,	0x99,	0x9a,	0x9b,	0x58,	0x58,	0x58,	0x58,
/*A0*/	0x58,	0xa1,	0xa2,	0xa3,	0xa4,	0xa5,	0xa6,	0xa7,
	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0xae,	0xaf,
/*B0*/	0xb0,	0xb1,	0xb2,	0xb3,	0xb4,	0xb5,	0x80,	0xb7,
	0xb8,	0xb9,	0x00,	0xbb,	0x1e,	0xbd,	0x60,	0x1f,
/*C0*/	0xc0,	0xc1,	0xc2,	0xc3,	0xc4,	0x58,	0xc6,	0x0d,
	0xc8,	0xc9,	0xca,	0xcb,	0xcc,	0xcd,	0xce,	0xcf,
/*D0*/	0x09,	0x08,	0xd2,	0xd3,	0xd4,	0xd5,	0xd6,	0xd7,
	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x7f,	0x58,
/*E0*/	0x58,	0x58,	0xe2,	0x1b,	0x0a,	0xe5,	0x58,	0x0d,
	0xe8,	0xe9,	0xea,	0xeb,	0xec,	0xed,	0xee,	0xef,
/*F0*/	0x09,	0x08,	0xb2,	0x1b,	0x0a,	0xf5,	0x81,	0x58,
	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x7f,	0xb2,
};

void
duartintr(void)
{
	int cause, status, c;
	Duart *duart;

	duart = DUARTREG;
	cause = duart->is_imr;
	/*
	 * I can guess your interrupt.
	 */
	/*
	 * Is it 1?
	 */
	if(cause & IM_RRDYA){		/* keyboard input */
		status = duart->sr_csr;
		c = duart->data;
		if(status & (FRM_ERR|OVR_ERR|PAR_ERR))
			duart->cmnd = RESET_ERR;
		if(c == 0x7F)
			c = 0xFF;	/* VIEW key (bizarre) */
		if(c & 0x80)
			c = keymap[c&0x7F];
		kbdchar(c);
	}
	/*
	 * Is it 2?
	 */
	if(cause & IM_RRDYB)		/* pen input */
		c = duart[1].data;
}

.
## diffname gnot/screen.c 1990/0320
## diff -e /n/bootesdump/1990/03091/sys/src/9/68020/screen.c /n/bootesdump/1990/0320/sys/src/9/68020/screen.c
21c
	(ulong*)((4*1024*1024-256*1024)|KZERO),	/* BUG */
.
## diffname gnot/screen.c 1990/0321
## diff -e /n/bootesdump/1990/0320/sys/src/9/68020/screen.c /n/bootesdump/1990/0321/sys/src/9/68020/screen.c
164,168c
		if(status & PAR_ERR) /* control word: caps lock (0x4) or repeat (0x10) */
			kbdrepeat((c&0x10) == 0);
		else{
			if(c == 0x7F)
				c = 0xFF;	/* VIEW key (bizarre) */
			if(c & 0x80)
				c = keymap[c&0x7F];
			kbdchar(c);
		}
.
## diffname gnot/screen.c 1990/0329
## diff -e /n/bootesdump/1990/0321/sys/src/9/68020/screen.c /n/bootesdump/1990/0329/sys/src/9/68020/screen.c
180d
178a
	/*
	 * Is it 4?
	 */
	if(cause & IM_XRDYB)
		duart[1].cmnd = DIS_TX;
	/*
	 * Is it 3?
	 */
	if(cause & IM_IPC)
		mousebuttons((~duart[0].ipc_acr) & 7);
.
145a
duartinit(void)
{
	Duart *duart;

	duart  =  DUARTREG;

	/*
	 * Keyboard
	 */
	duart[0].cmnd = RESET_RCV|DIS_TX|DIS_RX;
	duart[0].cmnd = RESET_TRANS;
	duart[0].cmnd = RESET_ERR;
	duart[0].cmnd = RESET_MR;
	duart[0].mr1_2 = CHAR_ERR|PAR_ENB|EVEN_PAR|CBITS8;
	duart[0].mr1_2 = NORM_OP|ONESTOPB;
	duart[0].sr_csr = BD4800;

	/*
	 * Pen
	 */
	duart[1].cmnd = RESET_RCV|DIS_TX|DIS_RX;
	duart[1].cmnd = RESET_TRANS;
	duart[1].cmnd = RESET_ERR;
	duart[1].cmnd = RESET_MR;
	duart[1].mr1_2 = CHAR_ERR|NO_PAR|CBITS8;
	duart[1].mr1_2 = NORM_OP|ONESTOPB;
	duart[1].sr_csr = BD2400;

	/*
	 * Output port
	 */
	duart[0].ipc_acr = 0xBF;	/* allow change	of state interrupt */
	duart[1].ip_opcr = 0x00;
	duart[1].scc_ropbc = 0xFF;	/* make sure the port is reset first */
	duart[1].scc_sopbc = 0x04;	/* dtr = 1, pp = 01 */
	duart[0].is_imr = IM_IPC|IM_RRDYB|IM_XRDYB|IM_RRDYA;
	duart[0].cmnd = ENB_TX|ENB_RX;	/* enable TX and RX last */
	duart[1].cmnd = ENB_TX|ENB_RX;

	/*
	 * Initialize keyboard
	 */
	while (!(duart[0].sr_csr & (XMT_EMT|XMT_RDY)))
		;
	duart[0].data = 0x02;
}

void
.
115a
	BD9600		=0xBB,
	BD4800		=0x99,
	BD2400		=0x88,
.
86a
	PAR_ENB		=0x00,
.
82a
#define	scc_ropbc ctlr		/* Stop Counter Command/Reset Output Port Bits Command */
.
81a
#define	scc_sopbc ctur		/* Start Counter Command/Set Output Port Bits Command */
.
80a
#define	ip_opcr	is_imr		/* Input Port/Output Port Configuration Register */
.
79a
#define	ivr	ivr		/* Interrupt Vector Register */
.
63c
		if(out.pos.x >= screen.r.max.x-out.bwid)
.
54c
		if(out.pos.x >= screen.r.max.x)
.
50c
		    Rect(0, out.pos.y, screen.r.max.x, out.pos.y+2*defont0.height), 0);
.
47,48c
		if(out.pos.y > screen.r.max.y-defont0.height)
			out.pos.y = screen.r.min.y;
.
32c
	duartinit();
	bitblt(&screen, Pt(0, 0), &screen, screen.r, 0);
.
18a
void	duartinit(void);

.
## diffname gnot/screen.c 1990/0330
## diff -e /n/bootesdump/1990/0329/sys/src/9/68020/screen.c /n/bootesdump/1990/0330/sys/src/9/68020/screen.c
214a
	/*
	 * Is it 0?
	 */
	if(cause & IM_CRDY){
		kproftimer(ur->pc);
		c = duart[1].scc_ropbc;
		duart[0].ctur = (Kptime)>>8;
		duart[0].ctlr = (Kptime)&255;
		c = duart[1].scc_sopbc;
		return;
	}
.
206a
	Duart *duart;
	char x;

	duart = DUARTREG;
	duart[0].ctur = (Kptime)>>8;
	duart[0].ctlr = (Kptime)&255;
	duart[0].is_imr = IM_IPC|IM_RRDYB|IM_XRDYB|IM_RRDYA|IM_CRDY;
	x = duart[1].scc_sopbc;
}

void
duartstoptimer(void)
{
	Duart *duart;
	char x;

	duart = DUARTREG;
	x = duart[1].scc_ropbc;
	duart[0].is_imr = IM_IPC|IM_RRDYB|IM_XRDYB|IM_RRDYA;
}

void
duartintr(Ureg *ur)
{
.
205c
duartstarttimer(void)
.
203a
enum{
	Kptime=200		/* about once per ms */
};
.
6a
#include	"ureg.h"
.
## diffname gnot/screen.c 1990/05313
## diff -e /n/bootesdump/1990/0330/sys/src/9/68020/screen.c /n/bootesdump/1990/05313/sys/src/9/68020/screen.c
283c
	 * Is it 4?
	 */
	if(cause & IM_XRDYA)
		duart[0].cmnd = DIS_TX;
	/*
	 * Is it 5?
.
281a
	}
.
280c
	if(cause & IM_XRDYB){
.
278c
	 * Is it 3?
.
189c
	duart[0].ipc_acr = 0xB7;	/* allow change	of state interrupt */
.
71c
		out.pos = string(&screen, out.pos, defont, buf, S);
.
35a
	/*
	 * Read HEX switch to set ldepth
	 */
	if(*(uchar*)MOUSE & (1<<4)){
		screen.ldepth = 1;
		defont = &defont1;
	}else
		defont = &defont0;
.
13a
extern	Font	defont1;
Font		*defont;
.
## diffname gnot/screen.c 1990/0629
## diff -e /n/bootesdump/1990/05313/sys/src/9/68020/screen.c /n/bootesdump/1990/0629/sys/src/9/68020/screen.c
290,292c
	if(cause & IM_XRDYB)		/* rs232 output */
		duartrs232intr();
.
286a
		if(status & (FRM_ERR|OVR_ERR|PAR_ERR))
			duart[1].cmnd = RESET_ERR;
		else
			rs232ichar(c);
	}
.
285c
	if(cause & IM_RRDYB){		/* rs232 input */
		status = duart[1].sr_csr;
.
242a
duartrs232intr(void)
{
	int c;
	Duart *duart;

	duart = DUARTREG;
	c = getrs232o();
	if(c == -1)
		duart[1].cmnd = DIS_TX;
	else
		duart[1].data = c;
}

void
duartstartrs232o(void)
{
	DUARTREG[1].cmnd = ENB_TX;
	duartrs232intr();
}

void
.
194c
	duart[1].sr_csr = BD9600;
.
186c
	 * RS232
.
## diffname gnot/screen.c 1990/0707
## diff -e /n/bootesdump/1990/0629/sys/src/9/68020/screen.c /n/bootesdump/1990/0707/sys/src/9/68020/screen.c
203c
	duart[0].is_imr = IM_IPC|IM_RRDYB|IM_XRDYB|IM_RRDYA|IM_XRDYA;
.
## diffname gnot/screen.c 1990/0709
## diff -e /n/bootesdump/1990/0707/sys/src/9/68020/screen.c /n/bootesdump/1990/0709/sys/src/9/68020/screen.c
278c
/*		kproftimer(ur->pc);/**/
.
## diffname gnot/screen.c 1990/0808
## diff -e /n/bootesdump/1990/0709/sys/src/9/68020/screen.c /n/bootesdump/1990/0808/sys/src/9/68020/screen.c
212a
}

void
duartbaud(int b)
{
	int x;
	Duart *duart;

	duart = DUARTREG;

	switch(b){
	case 38400:
		x = BD38400;
		break;
	case 19200:
		x = BD19200;
		break;
	case 9600:
		x = BD9600;
		break;
	case 4800:
		x = BD4800;
		break;
	case 2400:
		x = BD2400;
		break;
	case 1200:
		x = BD1200;
		break;
	case 300:
		x = BD300;
		break;
	default:
		error(0, Ebadarg);
	}
	if(x & 0x0100)
		duart[0].ipc_acr = duartacr |= 0x80;
	else
		duart[0].ipc_acr = duartacr &= ~0x80;
	duart[1].sr_csr = x;
.
199c
	duart[0].ipc_acr = duartacr = 0xB7;	/* allow change	of state interrupt */
.
135,137c
	BD38400		=0xCC|0x0000,
	BD19200		=0xCC|0x0100,
	BD9600		=0xBB|0x0000,
	BD4800		=0x99|0x0000,
	BD2400		=0x88|0x0000,
	BD1200		=0x66|0x0000,
	BD300		=0x44|0x0000,
.
22a
int	duartacr;
.
7a
#include	"errno.h"
.
## diffname gnot/screen.c 1990/08101
## diff -e /n/bootesdump/1990/0808/sys/src/9/68020/screen.c /n/bootesdump/1990/08101/sys/src/9/68020/screen.c
68,69c
		out.pos.x += (8-((out.pos.x-MINX)/out.bwid&7))*out.bwid;
.
## diffname gnot/screen.c 1990/0825
## diff -e /n/bootesdump/1990/08101/sys/src/9/68020/screen.c /n/bootesdump/1990/0825/sys/src/9/68020/screen.c
168c
/*F0*/	0x09,	0x08,	0xb2,	0x1b,	0x0d,	0xf5,	0x81,	0x58,
.
166c
/*E0*/	0x58,	0x58,	0xe2,	0x1b,	0x0d,	0xe5,	0x58,	0x0a,
.
162c
/*C0*/	0xc0,	0xc1,	0xc2,	0xc3,	0xc4,	0x58,	0xc6,	0x0a,
.
## diffname gnot/screen.c 1990/0830
## diff -e /n/bootesdump/1990/0825/sys/src/9/68020/screen.c /n/bootesdump/1990/0830/sys/src/9/68020/screen.c
284c
	duart[0].is_imr = duartimr &= ~IM_CRDY;
.
272c
	duart[0].is_imr = duartimr |= IM_CRDY;
.
259a
void
duartdtr(int val)
{
	Duart *duart = DUARTREG;
	if (val)
		duart[1].scc_ropbc=0x01;
	else
		duart[1].scc_sopbc=0x01;
}

void
duartbreak(int ms)
{
	static QLock brk;
	Duart *duart = DUARTREG;
	if (ms<=0 || ms >20000)
		error(0, Ebadarg);
	qlock(&brk);
	duart[0].is_imr = duartimr &= ~IM_XRDYB;
	duart[1].cmnd = STRT_BRK|ENB_TX;
	tsleep(&u->p->sleep, return0, 0, ms);
	duart[1].cmnd = STOP_BRK|ENB_TX;
	duart[0].is_imr = duartimr |= IM_XRDYB;
	qunlock(&brk);
}

.
226,227d
224c
	Duart *duart = DUARTREG;
.
219a
int
duartinputport(void)
{
	Duart *duart = DUARTREG;
	return duart[1].ip_opcr;
}
.
208c
	duart[0].is_imr = duartimr = IM_IPC|IM_RRDYB|IM_XRDYB|IM_RRDYA|IM_XRDYA;
.
24a
int	duartimr;
.
## diffname gnot/screen.c 1990/0902
## diff -e /n/bootesdump/1990/0830/sys/src/9/68020/screen.c /n/bootesdump/1990/0902/sys/src/9/68020/screen.c
83c
		out.pos = gstring(&screen, out.pos, defont, buf, S);
.
66c
		gbitblt(&screen, Pt(0, out.pos.y), &screen,
.
49c
	gbitblt(&screen, Pt(0, 0), &screen, screen.r, 0);
.
27c
GBitmap	screen =
.
14,16c
extern	GFont	defont0;
extern	GFont	defont1;
GFont		*defont;
.
10c
#include	<gnot.h>
.
## diffname gnot/screen.c 1990/0912
## diff -e /n/bootesdump/1990/0902/sys/src/9/68020/screen.c /n/bootesdump/1990/0912/sys/src/9/68020/screen.c
83c
		out.pos = gstring(&gscreen, out.pos, defont, buf, S);
.
79c
		if(out.pos.x >= gscreen.r.max.x-out.bwid)
.
70c
		if(out.pos.x >= gscreen.r.max.x)
.
64,67c
		if(out.pos.y > gscreen.r.max.y-defont0.height)
			out.pos.y = gscreen.r.min.y;
		gbitblt(&gscreen, Pt(0, out.pos.y), &gscreen,
		    Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), 0);
.
49c
	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0);
.
45c
		gscreen.ldepth = 1;
.
27c
GBitmap	gscreen =
.
9a
#include	<libg.h>
.
## diffname gnot/screen.c 1990/0914
## diff -e /n/bootesdump/1990/0912/sys/src/9/68020/screen.c /n/bootesdump/1990/0914/sys/src/9/68020/screen.c
84c
		out.pos = gbitbltstring(&gscreen, out.pos, defont, buf, S);
.
47,49c
	defont = &defont0;	/* save space; let bitblt do the conversion work */
.
45c
	if(*(uchar*)MOUSE & (1<<4))
.
16d
## diffname gnot/screen.c 1990/1004
## diff -e /n/bootesdump/1990/0914/sys/src/9/68020/screen.c /n/bootesdump/1990/1004/sys/src/9/68020/screen.c
352c
		if(kprofp)
			(*kprofp)(ur->pc);
.
290c
	Kptime=200
.
26a
void	(*kprofp)(ulong);

.
## diffname gnot/screen.c 1990/11211
## diff -e /n/bootesdump/1990/1004/sys/src/9/68020/screen.c /n/bootesdump/1990/11211/sys/src/9/68020/screen.c
281c
		error(Ebadarg);
.
256c
		error(Ebadarg);
.
## diffname gnot/screen.c 1990/1126
## diff -e /n/bootesdump/1990/11211/sys/src/9/68020/screen.c /n/bootesdump/1990/1126/sys/src/9/68020/screen.c
232a
	x = 0;		/* set */
.
## diffname gnot/screen.c 1991/0105
## diff -e /n/bootesdump/1990/1126/sys/src/9/68020/screen.c /n/bootesdump/1991/0105/sys/src/9/68020/screen.c
374,378c
			if(c == 0x7F)	/* VIEW key (bizarre) */
				c = 0xFF;
			if(c == 0xB6)	/* NUM PAD */
				kbdstate = 1;
			else{
				if(c & 0x80)
					c = keymap[c&0x7F];
				switch(kbdstate){
				case 1:
					k1 = c;
					kbdstate = 2;
					break;
				case 2:
					k2 = c;
					c = latin1(k1, k2);
					if(c == 0){
						kbdchar(k1);
						c = k2;
					}
					/* fall through */
				default:
					kbdstate = 0;
					kbdchar(c);
				}
			}
.
344a
	static int kbdstate, k1, k2;
.
339a
struct latin
{
	uchar	l;
	char	c[2];
}latintab[] = {
	'€',	"!!",	/* spanish initial ! */
	'€',	"c|",	/* cent */
	'€',	"c$",	/* cent */
	'€',	"l$",	/* pound sterling */
	'€',	"g$",	/* general currency */
	'€',	"y$",	/* yen */
	'€',	"j$",	/* yen */
	'€',	"||",	/* broken vertical bar */
	'€',	"SS",	/* section symbol */
	'€',	"\"\"",	/* dieresis */
	'€',	"cr",	/* copyright */
	'€',	"cO",	/* copyright */
	'€',	"sa",	/* super a, feminine ordinal */
	'€',	"<<",	/* left angle quotation */
	'€',	"no",	/* not sign, hooked overbar */
	'€',	"--",	/* soft hyphen */
	'€',	"rg",	/* registered trademark */
	'€',	"__",	/* macron */
	'€',	"s0",	/* degree (sup o) */
	'€',	"+-",	/* plus-minus */
	'€',	"s2",	/* sup 2 */
	'€',	"s3",	/* sup 3 */
	'€',	"''",	/* grave accent */
	'€',	"mu",	/* mu */
	'€',	"pg",	/* paragraph (pilcrow) */
	'€',	"..",	/* centered . */
	'€',	",,",	/* cedilla */
	'€',	"s1",	/* sup 1 */
	'€',	"so",	/* sup o */
	'€',	">>",	/* right angle quotation */
	'€',	"14",	/* 1/4 */
	'€',	"12",	/* 1/2 */
	'€',	"34",	/* 3/4 */
	'€',	"??",	/* spanish initial ? */
	'€',	"A`",	/* A grave */
	'€',	"A'",	/* A acute */
	'€',	"A^",	/* A circumflex */
	'€',	"A~",	/* A tilde */
	'€',	"A\"",	/* A dieresis */
	'€',	"A:",	/* A dieresis */
	'€',	"Ao",	/* A circle */
	'€',	"AO",	/* A circle */
	'€',	"Ae",	/* AE ligature */
	'€',	"AE",	/* AE ligature */
	'€',	"C,",	/* C cedilla */
	'€',	"E`",	/* E grave */
	'€',	"E'",	/* E acute */
	'€',	"E^",	/* E circumflex */
	'€',	"E\"",	/* E dieresis */
	'€',	"E:",	/* E dieresis */
	'€',	"I`",	/* I grave */
	'€',	"I'",	/* I acute */
	'€',	"I^",	/* I circumflex */
	'€',	"I\"",	/* I dieresis */
	'€',	"I:",	/* I dieresis */
	'€',	"D-",	/* Eth */
	'€',	"N~",	/* N tilde */
	'€',	"O`",	/* O grave */
	'€',	"O'",	/* O acute */
	'€',	"O^",	/* O circumflex */
	'€',	"O~",	/* O tilde */
	'€',	"O\"",	/* O dieresis */
	'€',	"O:",	/* O dieresis */
	'€',	"OE",	/* O dieresis */
	'€',	"Oe",	/* O dieresis */
	'€',	"xx",	/* times sign */
	'€',	"O/",	/* O slash */
	'€',	"U`",	/* U grave */
	'€',	"U'",	/* U acute */
	'€',	"U^",	/* U circumflex */
	'€',	"U\"",	/* U dieresis */
	'€',	"U:",	/* U dieresis */
	'€',	"UE",	/* U dieresis */
	'€',	"Ue",	/* U dieresis */
	'€',	"Y'",	/* Y acute */
	'€',	"P|",	/* Thorn */
	'€',	"Th",	/* Thorn */
	'€',	"TH",	/* Thorn */
	'€',	"ss",	/* sharp s */
	'€',	"a`",	/* a grave */
	'€',	"a'",	/* a acute */
	'€',	"a^",	/* a circumflex */
	'€',	"a~",	/* a tilde */
	'€',	"a\"",	/* a dieresis */
	'€',	"a:",	/* a dieresis */
	'€',	"ao",	/* a circle */
	'€',	"ae",	/* ae ligature */
	'€',	"c,",	/* c cedilla */
	'€',	"e`",	/* e grave */
	'€',	"e'",	/* e acute */
	'€',	"e^",	/* e circumflex */
	'€',	"e\"",	/* e dieresis */
	'€',	"e:",	/* e dieresis */
	'€',	"i`",	/* i grave */
	'€',	"i'",	/* i acute */
	'€',	"i^",	/* i circumflex */
	'€',	"i\"",	/* i dieresis */
	'€',	"i:",	/* i dieresis */
	'€',	"d-",	/* eth */
	'€',	"n~",	/* n tilde */
	'€',	"o`",	/* o grave */
	'€',	"o'",	/* o acute */
	'€',	"o^",	/* o circumflex */
	'€',	"o~",	/* o tilde */
	'€',	"o\"",	/* o dieresis */
	'€',	"o:",	/* o dieresis */
	'€',	"oe",	/* o dieresis */
	'€',	"-:",	/* divide sign */
	'€',	"o/",	/* o slash */
	'€',	"u`",	/* u grave */
	'€',	"u'",	/* u acute */
	'€',	"u^",	/* u circumflex */
	'€',	"u\"",	/* u dieresis */
	'€',	"u:",	/* u dieresis */
	'€',	"ue",	/* u dieresis */
	'€',	"y'",	/* y acute */
	'€',	"th",	/* thorn */
	'€',	"p|",	/* thorn */
	'€',	"y\"",	/* y dieresis */
	'€',	"y:",	/* y dieresis */
	0,	0,
};

int
latin1(int k1, int k2)
{
	int i;
	struct latin *l;

	for(l=latintab; l->l; l++)
		if(k1==l->c[0] && k2==l->c[1])
			return l->l;
	return 0;
}

.
## diffname gnot/screen.c 1991/0112
## diff -e /n/bootesdump/1991/0105/sys/src/9/68020/screen.c /n/bootesdump/1991/0112/sys/src/9/68020/screen.c
170c
	0x58,	0x58,	0x58,	0x58,	0x58,	0x58,	0x7f,	0x80,
.
161c
/*B0*/	0xb0,	0xb1,	0xb2,	0xb3,	0xb4,	0xb5,	0xb6,	0xb7,
.
## diffname gnot/screen.c 1991/0423
## diff -e /n/bootesdump/1991/0201/sys/src/9/68020/screen.c /n/bootesdump/1991/0423/sys/src/9/gnot/screen.c
551a
		cause = duart->is_imr;
.
545c
	while(cause & IM_RRDYB){	/* rs232 input */
.
373c
	'€',	"so",	/* sup o */
.
336,337c
	int s;
	Duart *duart;

	duart = DUARTREG;
	s = splduart();
	duart[1].cmnd = ENB_TX;
	if(duart[1].sr_csr & (XMT_RDY|XMT_EMT))
		duartrs232intr();
	splx(s);
.
233d
230c
	int x = 0;
.
## diffname gnot/screen.c 1991/0605
## diff -e /n/bootesdump/1991/0423/sys/src/9/gnot/screen.c /n/bootesdump/1991/0605/sys/src/9/gnot/screen.c
176,574c
	while(n-- > 0)
		screenputc(*s++);
.
174c
screenputs(char *s, int n)
.
87,172d
42d
23,28d
## diffname gnot/screen.c 1991/0706
## diff -e /n/bootesdump/1991/0605/sys/src/9/gnot/screen.c /n/bootesdump/1991/0706/sys/src/9/gnot/screen.c
85a

int
screenbits(void)
{
	if(*(uchar*)MOUSE & (1<<4))
		return 2;
	else
		return 1;
}

void
getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
{
	ulong ans;

	/*
	 * The gnot says 0 is white (max intensity)
	 */
	if(gscreen.ldepth == 0){
		if(p == 0)
				ans = ~0;
		else
				ans = 0;
	}else{
		switch(p){
		case 0:		ans = ~0;		break;
		case 1:		ans = 0xAAAAAAAA;	break;
		case 2:		ans = 0x55555555;	break;
		default:	ans = 0;		break;
	}
	*pr = *pg = *pb = ans;
}

int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
	return 0;	/* can't change mono screen colormap */
}

int
hwcursset(uchar *s, uchar *c, int ox, int oy)
{
	return 0;
}

int
hwcursmove(int x, int y)
{
	return 0;
}
.
## diffname gnot/screen.c 1991/0707
## diff -e /n/bootesdump/1991/0706/sys/src/9/gnot/screen.c /n/bootesdump/1991/0707/sys/src/9/gnot/screen.c
134a
}

void
mouseclock(void)	/* called spl6 */
{
	++mouse.clock;
}

void
mousetry(Ureg *ur)
{
	int s;

	if(mouse.clock && mouse.track && (ur->sr&SPL(7)) == 0 && canlock(&cursor)){
		s = spl1();
		mouseupdate(0);
		splx(s);
		unlock(&cursor);
		wakeup(&mouse.r);
	}
.
114a
		}
.
80a
gbitblt(GBitmap *d, Point p, GBitmap *s, Rectangle r, Fcode f)
{
	balubitblt(d, p, s, r, f);
}

void
.
79a
/* Use the balu version */
.
11a
#include	"mouse.h"
.
## diffname gnot/screen.c 1991/0708
## diff -e /n/bootesdump/1991/0707/sys/src/9/gnot/screen.c /n/bootesdump/1991/0708/sys/src/9/gnot/screen.c
79,85d
13a
/* gnot screen.h defines gbitblt to use balu; doesn't work here */
#undef gbitblt

.
12c
#include	"screen.h"
.
## diffname gnot/screen.c 1991/0710
## diff -e /n/bootesdump/1991/0708/sys/src/9/gnot/screen.c /n/bootesdump/1991/0710/sys/src/9/gnot/screen.c
63c
		kbitblt(&gscreen, Pt(0, out.pos.y), &gscreen,
.
46c
	kbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0);
.
14,16d
## diffname gnot/screen.c 1991/0809
## diff -e /n/bootesdump/1991/0710/sys/src/9/gnot/screen.c /n/bootesdump/1991/0809/sys/src/9/gnot/screen.c
85a
	unlock(&printq);
	splx(x);
.
83a
	int x;

	x = splhi();
	lock(&printq);
.
## diffname gnot/screen.c 1991/1222
## diff -e /n/bootesdump/1991/0809/sys/src/9/gnot/screen.c /n/bootesdump/1991/1222/sys/src/9/gnot/screen.c
77c
		out.pos = gstring(&gscreen, out.pos, defont, buf, S);
.
## diffname gnot/screen.c 1991/1225
## diff -e /n/bootesdump/1991/1222/sys/src/9/gnot/screen.c /n/bootesdump/1991/1225/sys/src/9/gnot/screen.c
79,91d
72,77c
		memmove(buf, s, i);
		buf[i] = 0;
		n -= i;
		s += i;
		if(r == '\n'){
			out.pos.x = MINX;
			out.pos.y += defont0.height;
			if(out.pos.y > gscreen.r.max.y-defont0.height)
				out.pos.y = gscreen.r.min.y;
			gbitblt(&gscreen, Pt(0, out.pos.y), &gscreen,
			    Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), 0);
		}else if(r == '\t'){
			out.pos.x += (8-((out.pos.x-MINX)/out.bwid&7))*out.bwid;
			if(out.pos.x >= gscreen.r.max.x)
				screenputs("\n", 1);
		}else if(r == '\b'){
			if(out.pos.x >= out.bwid+MINX){
				out.pos.x -= out.bwid;
				screenputs(" ", 1);
				out.pos.x -= out.bwid;
			}
		}else{
			if(out.pos.x >= gscreen.r.max.x-out.bwid)
				screenputs("\n", 1);
			out.pos = gstring(&gscreen, out.pos, defont, buf, S);
		}
.
55,70c
	while(n > 0){
		i = chartorune(&r, s);
		if(i == 0){
			s++;
			--n;
			continue;
.
52,53c
	Rune r;
	int i;
	char buf[4];
.
50c
screenputs(char *s, int n)
.
43c
	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0);
.
## diffname gnot/screen.c 1991/1228
## diff -e /n/bootesdump/1991/1225/sys/src/9/gnot/screen.c /n/bootesdump/1991/1228/sys/src/9/gnot/screen.c
89a
	unlock(&screenlock);
.
86c
				screenputnl();
.
81,82c
				gstring(&gscreen, out.pos, defont, " ", S);
.
77c
				screenputnl();
.
67,74c
		if(r == '\n')
			screenputnl();
		else if(r == '\t'){
.
55a
	lock(&screenlock);
.
49a
screenputnl(void)
{
	out.pos.x = MINX;
	out.pos.y += defont0.height;
	if(out.pos.y > gscreen.r.max.y-defont0.height)
		out.pos.y = gscreen.r.min.y;
	gbitblt(&gscreen, Pt(0, out.pos.y), &gscreen,
	    Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), 0);
}

void
.
23a
Lock	screenlock;

.
## diffname gnot/screen.c 1992/0111
## diff -e /n/bootesdump/1991/1228/sys/src/9/gnot/screen.c /n/bootesdump/1992/0111/sys/src/9/gnot/screen.c
8c
#include	"../port/error.h"
.
## diffname gnot/screen.c 1992/0208
## diff -e /n/bootesdump/1992/0111/sys/src/9/gnot/screen.c /n/bootesdump/1992/0208/sys/src/9/gnot/screen.c
95c
			out.pos = gsubfstring(&gscreen, out.pos, defont, buf, S);
.
90c
				gsubfstring(&gscreen, out.pos, defont, " ", S);
.
16,17c
extern	GSubfont	defont0;
GSubfont		*defont;
.
## diffname gnot/screen.c 1992/0209
## diff -e /n/bootesdump/1992/0208/sys/src/9/gnot/screen.c /n/bootesdump/1992/0209/sys/src/9/gnot/screen.c
10c
#include	<libng.h>
.
## diffname gnot/screen.c 1992/0211
## diff -e /n/bootesdump/1992/0209/sys/src/9/gnot/screen.c /n/bootesdump/1992/0211/sys/src/9/gnot/screen.c
10c
#include	<libg.h>
.
## diffname gnot/screen.c 1992/0321
## diff -e /n/bootesdump/1992/0211/sys/src/9/gnot/screen.c /n/bootesdump/1992/0321/sys/src/9/gnot/screen.c
2c
#include	"../port/lib.h"
.
## diffname gnot/screen.c 1992/0604
## diff -e /n/bootesdump/1992/0321/sys/src/9/gnot/screen.c /n/bootesdump/1992/0604/sys/src/9/gnot/screen.c
32c
	{ 0, 0, 1024, 1024, },
	{ 0, 0, 1024, 1024, },
.
## diffname gnot/screen.c 1992/0630
## diff -e /n/bootesdump/1992/0604/sys/src/9/gnot/screen.c /n/bootesdump/1992/0630/sys/src/9/gnot/screen.c
28c
	(ulong*)((1*1024*1024)|KZERO),	/* bootrom puts it here; changed by mmuinit */
.
## diffname gnot/screen.c 1992/0711
## diff -e /n/bootesdump/1992/0630/sys/src/9/gnot/screen.c /n/bootesdump/1992/0711/sys/src/9/gnot/screen.c
149a
	USED(x, y);
.
143a
	USED(s, c, ox, oy);
.
137a
	USED(p, r, g, b);
.
## diffname gnot/screen.c 1992/0914
## diff -e /n/bootesdump/1992/0711/sys/src/9/gnot/screen.c /n/bootesdump/1992/0914/sys/src/9/gnot/screen.c
70c
	if(getsr() & 0x0700){
		if(!canlock(&screenlock))
			return;	/* don't deadlock trying to print in interrupt */
	}else
		lock(&screenlock);
.
## diffname gnot/screen.c 1992/1012
## diff -e /n/bootesdump/1992/0914/sys/src/9/gnot/screen.c /n/bootesdump/1992/1012/sys/src/9/gnot/screen.c
24a
void	screenupdate(void);
.
18a

.
## diffname gnot/screen.c 1992/1020
## diff -e /n/bootesdump/1992/1012/sys/src/9/gnot/screen.c /n/bootesdump/1992/1020/sys/src/9/gnot/screen.c
180a

/* only 1 flavor mouse */
void
mousectl(char *x)
{
	USED(x);
}
.
## diffname gnot/screen.c 1992/1030
## diff -e /n/bootesdump/1992/1020/sys/src/9/gnot/screen.c /n/bootesdump/1992/1030/sys/src/9/gnot/screen.c
186a
}

void
screenupdate(Rectangle r)
{
	USED(r);
.
26d
## diffname gnot/screen.c 1992/1104
## diff -e /n/bootesdump/1992/1030/sys/src/9/gnot/screen.c /n/bootesdump/1992/1104/sys/src/9/gnot/screen.c
187,192d
## diffname gnot/screen.c 1993/0226
## diff -e /n/bootesdump/1992/1104/sys/src/9/gnot/screen.c /n/bootesdump/1993/0226/sys/src/9/gnot/screen.c
161,180d
## diffname gnot/screen.c 1993/0501 # deleted
## diff -e /n/bootesdump/1993/0226/sys/src/9/gnot/screen.c /n/fornaxdump/1993/0501/sys/src/brazil/gnot/screen.c
1,166d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].