/* * cbinst - cbios install program for * Morrow Designs micro decision * * Lenny Edmondson * for Morrow Designs * * 1982 * * Micro decision utilities * * * BIOS patcher * * */ # include "term.h" # define DRIVEB 1 char drive = DRIVEB, /* drive on which the BIOS is found */ *biosbuf = NULL, c = 0, ndrives = 0, *sep1, /* separate terminal installation messages */ *sep2; unsigned term = 0; /* the index number of the terminal */ patch () { char b [BIOSSIZE]; biosbuf = b; /* asign space for the BIOS buffer */ biosread (); fixbios (); bioswrite (); doauto (); } getterm () { static unsigned char c, ok; for (;;) { menu (); put ("\n\t\tSelect your terminal: "); for (;;) { c = getchul (); if ( islower (c) && c - 'A' >= nterm && toupper (c) - 'A' < nterm ) { c = toupper (c); } c -= 'A'; /* zero - origin */ if (c >= nterm) /* out of range */ { prs ("\b \b"); continue; } put ("\n\n\t\t"); put (terminal[c].name); put (" selected. OK (Y/N) ? "); ok = getch (); put ("\n\n"); if (ok == 'y') { static char **m; m = terminal[c].message; if (m) { put (*m); } else { put (sep1); put (sep2); } put (" OK (Y/N) ? "); if (getch () != 'y') break; term = c; * (char *) 9 = terminal[c].level; return; } else { break; } } } } menu () { INTERN l; static UCOUNT n, nitem, nrow, r, c, i; static struct terminal t; /* * count the items */ put ("\n\nTERMINAL SELECTION MENU\n\n"); nitem = nterm; nrow = (nitem - 1) / NCOL + 1; for (r = 0; r < nrow; r++) /* for each row */ { i = r; /* i is the item number */ for (c = 0; c < NCOL; c++, i += nrow) { if (i >= nitem) /* no more this line */ break; cputc (i + 'A'); cputc (' '); put (terminal[i].name); /* * pad with spaces on the right */ if (c != NCOL - 1) /* not last col. */ { l = WIDTH / NCOL - lenstr (terminal[i].name) - 2; for (; l > 0; l--) { cputc (' '); } } } put ("\n"); } }