/* Rountines to Get and Set the Character Table (20_Jan_84) * -------------------------------------------------------- */ # include "su2hdr.h" /* Offsets in ch_tab * ----------------- */ # define CBAUDOFF 0 /* Console baud rate byte in ch_tab */ # define PBAUDOFF 1 /* Printer baud rate byte in ch_tab */ # define REVISION 9 /* Bios revision byte (clevel) in ch_tab */ # define CFLAG 3 /* CFlag byte copy in ch_tab */ /* Bit definitions for the CFlag byte * ---------------------------------- */ # define HARDBIT (1 << 4) /* Printer hardware handshaking */ # define CENTBIT (1 << 5) /* centronics is list device flag */ /* Compatibility Definitions * ------------------------- */ # define CPMPLUS 0x31 /* Current version of CP/M */ # define MD11 0x14 /* Current revision of Cbios */ /* Move the char table into the external array: ch_tab. (20_Jan_84) * ---------------------------------------------------------------- * Check CP/M Rev. and BIOS compatbility. */ char ch_tab[]; load_sys () { extern char ch_tab[]; if (cpm(GETVER) < CPMPLUS) { fatal ("Wrong version of CP/M.\r\nThis copy of SETUP requires CP/M Plus.\r\n$"); } gt_tab(); if (ch_tab[REVISION] < MD11) { fatal ("Wrong revison of CP/M.\r\nThis copy of SETUP requires CP/M Plus revison 1.4 or greater.\r\n$"); } } /* read the settings from ch_tab (20_Jan_84) * ----------------------------------------- */ readsettings () { extern char ch_tab[]; cbaud = ch_tab [CBAUDOFF] % NBAUD; pbaud = ch_tab [PBAUDOFF] % NBAUD; if (ch_tab [CFLAG] & CENTBIT) ptype = CENTRONICS; else ptype = SERIAL; if (ch_tab [CFLAG] & HARDBIT) protocol = HARDHAND; else protocol = XONXOFF; } /* write the settings to ch_tab (20_Jan_84) * ----------------------------------------- */ writesettings () { extern char ch_tab[]; ch_tab [CBAUDOFF] = cbaud; ch_tab [PBAUDOFF] = pbaud; ch_tab [CFLAG] &= ~(CENTBIT | HARDBIT); if (protocol == HARDHAND) ch_tab [CFLAG] |= HARDBIT; if (ptype == CENTRONICS) ch_tab [CFLAG] |= CENTBIT; } /* Set bios to new values (20_Jan_84) *----------------------------------- */ softset () { extern char ch_tab[]; writesettings (); /*update ch_tab */ pt_tab (); /* put ch_tab back into the bios */ setctc (); /* call the bios to have appropriate settings made */ } hardset () { } fatal (a) char *a; { prs (a); exit (NO); }