#include #include #include /* row five */ #define VS 0xb03c #define OFSD 960 /* ten rows */ #define MAXR 2400 int ofs = 0; int skip_esc = 0; mputchar(int ch) { if (skip_esc) { if (ch >= 'a' && ch <= 'z') skip_esc = 0; return; } if (ofs >= MAXR) { int i; movedata(VS, 160, VS, 0, MAXR-160); for (i=0; i<160; i+=2) poke(VS, MAXR-160+i, 0x0720); ofs -= 160; } switch (ch) { case 0x1b: skip_esc = 1; break; case '\n': ofs += 160; break; case '\r': ofs -= ofs % 160; break; case '\b': ofs -= 2; break; case '\a': bell(); break; default: poke(VS, ofs, 0x0700 | (ch & 0xff)); ofs += 2; break; } outportb(0x3b4, 15); outportb(0x3b5, (ofs+OFSD)/2); outportb(0x3b4, 14); outportb(0x3b5, (ofs+OFSD)/512); } void mputs(char *s) { while (*s) mputchar(*s++); } main(int argc, char **argv) { int save_rows = peek(0x40, 0x4a); int save_cols = peekb(0x40, 0x84); poke(0x40, 0x4a, 80); pokeb(0x40, 0x84, MAXR/160-1); for (ofs=0; ofs 1) spawnvp(P_WAIT, argv[1], argv+1); else spawnlp(P_WAIT, "command", "command", 0); for (ofs=0; ofs<158; ofs+=2) { poke(VS-10, ofs, 0x07c4); poke(VS, ofs+MAXR, 0x07c4); } poke(0x40, 0x4a, save_rows); pokeb(0x40, 0x84, save_cols); mscisr_uninit(); }