diff --git a/sys/pdpuba/sbd.c b/sys/pdpuba/sbd.c index f7376025..3a0899f0 100644 --- a/sys/pdpuba/sbd.c +++ b/sys/pdpuba/sbd.c @@ -7,11 +7,13 @@ #define NSBD 1 /* - * Default status register 0760010 + * Default status register 0760040 * Default vector 0270 (PRI 4) */ -struct sbddevice *sbd = (struct sbddevice *)0760010; +#define dev_t int + +struct sbddevice *sbd = (struct sbddevice *)0760040; sbdattach(addr, unit) struct sbddevice *addr; @@ -25,6 +27,26 @@ sbdopen(dev, flag) dev_t dev; short flag; { + static int cmd[] = { + 22, /* 22 bytes / 11 words */ + (0 << 9) | SBD_FCPIX, + (0 << 9) | SBD_FCRUB, + (2 << 9) | SBD_FCALP, + 0300, /* x coord */ + 0300, /* y coord */ + 06, /* 6 characters */ + "eh", + "ll", + "!o", + -1 + }; + + /* we can probably ignore bits above 16 i think? */ + unsigned int addr = (unsigned int)cmd; + + sbd->hahl = 0000376 & addr; + sbd->hahr = 0177400 & addr; + sbd->hcsr = 0; return 0; } diff --git a/sys/pdpuba/sbd.h b/sys/pdpuba/sbd.h index b2d99f22..fc4e68f2 100644 --- a/sys/pdpuba/sbd.h +++ b/sys/pdpuba/sbd.h @@ -24,17 +24,30 @@ */ struct sbddevice { - char hcsr; /* Cmd and Status Register */ + char hinv; /* Interrupt Vector */ char u0; /* Unused */ - char hahr; /* Host Address High */ + char hcsr; /* Cmd and Status Register */ char u1; /* Unused */ - char hahl; /* Host Address Low */ + char hahr; /* Host Address High */ char u2; /* Unused */ + char hahl; /* Host Address Low */ + char u3; /* Unused */ }; +/* SBD Register Bitmasks */ #define SBD_INTEN_HCSR 0200 /* _ I _ _ _ _ _ _ */ #define SBD_READY_HCSR 0400 /* R _ _ _ _ _ _ _ */ #define SBD_HADDR_HCSR 0077 /* _ _ A A A A A A */ #define SBD_HADDR_HAHR 0377 /* A A A A A A A A */ #define SBD_HADDR_HAHL 0376 /* A A A A A A A _ */ #define SBD_ABORT_HAHL 0001 /* _ _ _ _ _ _ _ Q */ + +/* SBD Function Codes */ +#define SBD_FCRUB 0006 /* Erase rectangle */ +#define SBD_FCPIX 0014 /* Display pixel graphics area */ +#define SBD_FCVEC 0027 /* Draw vector */ +#define SBD_FCCIR 0032 /* Draw circle */ +#define SBD_FCALP 0035 /* Display text on pixel area */ +#define SBD_FCWIB 0046 /* Write image block */ +#define SBD_FCRIB 0047 /* Read image block */ +