~kris/9p

9hist

5fb1b09c0ef1912b96a9aa24e5a4e769a42b1e48 — David du Colombier 25 years ago 6a587f5
Plan 9 from Bell Labs 2001-05-26
3 files changed, 20 insertions(+), 12 deletions(-)

M bitsy/devuda1341.c
M bitsy/screen.h
M port/devaudio.c
M bitsy/devuda1341.c => bitsy/devuda1341.c +16 -12
@@ 99,7 99,7 @@ enum

	Fmono		= 1,
	Fin			= 2,
	Fout		= 4,
	Fout			= 4,

	Aclosed		= 0,
	Aread,


@@ 115,10 115,10 @@ enum
	Nvol,

	Bufsize		= 4* 1024,	/* 46 ms each */
	Nbuf		= 10,		/* 1.5 seconds total */
	Nbuf			= 10,			/* 1.5 seconds total */

	Speed		= 44100,
	Ncmd		= 50,		/* max volume command words */
	Ncmd		= 50,			/* max volume command words */
};

enum {


@@ 137,13 137,13 @@ enum {

/* Format */
enum {
	LSB16 = 1 << 1,
	LSB18 = 2 << 1,
	LSB20 = 3 << 1,
	MSB = 4 << 1,
	MSB16 = 5 << 1,
	MSB18 = 6 << 1,
	MSB20 = 7 << 1,
	LSB16 =	1 << 1,
	LSB18 =	2 << 1,
	LSB20 =	3 << 1,
	MSB =	4 << 1,
	MSB16 =	5 << 1,
	MSB18 =	6 << 1,
	MSB20 =	7 << 1,
};

Dirtab


@@ 1064,7 1064,7 @@ audioclose(Chan *c)
static long
audioread(Chan *c, void *v, long n, vlong off)
{
	int liv, riv, lov, rov;
	int liv, riv, lov, rov, nsendb, nbufs;
	long m, n0;
	char buf[300];
	int j;


@@ 1126,8 1126,12 @@ audioread(Chan *c, void *v, long n, vlong off)
		return readstr(offset, p, n, buf);

	case Qspeed:
		s = &audio.o;
		nbufs = s->filling - s->current;
		if (nbufs < 0) nbufs = Nbuf + nbufs;
		nsendb = (nbufs - 1) * bufsize + s->current->nbytes;
		buf[0] = '\0';
		snprint(buf, sizeof(buf), "speed %d\ndmasize %d\n", rate, bufsize);
		snprint(buf, sizeof(buf), "speed %d\ndmasize %d\nsendbytes %d\n", rate, bufsize, nsendb);
		return readstr(offset, p, n, buf);

	case Qvolume:

M bitsy/screen.h => bitsy/screen.h +1 -0
@@ 9,3 9,4 @@ struct Cursorinfo {

extern void	blankscreen(int);
extern void	flushmemscreen(Rectangle);
extern uchar*	attachscreen(Rectangle*, ulong*, int*, int*, int*);

M port/devaudio.c => port/devaudio.c +3 -0
@@ 144,6 144,7 @@ sbcmd(int val)
		s = inb(blaster.wstatus);
		if((s & 0x80) == 0) {
			outb(blaster.write, val);
			delay(1);
			return 0;
		}
	}


@@ 189,7 190,9 @@ mxcmd(int addr, int val)
{

	outb(blaster.mixaddr, addr);
	delay(1);
	outb(blaster.mixdata, val);
	delay(1);
	return 1;
}