/* >>:yamsys.h 4/2/83 * * Other Apple modem specific stuff is in yam5ap.c * * Note on update of 4/2/83: * Added support of Wcsmask. (JCM) * * Note on update of 1/22/83: * Added support of external modem connected to VERSAcard. * --JCM * * Notes on update of 12/17/82: * * Added support of PCPI Applicard to yam5ap.c. Just #define APPLICARD * in this file if you have that card instead of the Microsoft Softcard. * * For Softcard versions, fixed a nasty bug that caused received * characters to be lost occasionally. * See function apmout() in yam5ap.c for more details. * * Added KLUDGE212 code, to support simultaneous use of the Micromodem II * in slot 2 and a serial card, connected to an external 212A, in slot 1. * If KLUDGE212 is #defined, you switch to the 212 with the "b1200" * command, possibly after dialing with the Micromodem. * * -- JCM 12/17/82 -- * * Notes on update of 8/2/82: * * Added macros, etc. to make YAMAPPLE consistent with the new official * scheme. Also, to make the program look less formidable to those using * local consoles, changed the console I/O to use BIOS. The only * remaining console dependencies should be the Z19 25th line stuff, and * other defined ESC sequences. * * Note that the advice below regarding the origin for externals is no * longer generally accurate. Unless you define MYSYSTEM and get all * that YAM4 stuff, you can use CAF's recommended origin -- or even * reduce it by several hundred, hex. * * -- JCM 8/2/82 -- * * * Notes on the original release of YAM for the Apple II, 11/13/81: * * Features (and misfeatures) of YAM for the Apple with Micromodem II * * Supports autodial of any entry in YAMPHONE.T. Be warned that the * parsing is primitive -- every digit on the selected line is dialed. * (Don't suppose you'd believe me if I said that's for compatability * with MODEM7...) Anyway, don't put any numbers in the location name. * As a special case, put a line in YAMPHONE.T which just contains * "askme". Then typing "call askme" will cause a prompt for the * telephone number to dial. * * I've kludged the "b" (setbaud) command to provide an additional * function: "b300" and "b110" do what you'd expect, while "b0" * gets you into a menu to allow changing the * byte format (character size, stop bits, parity). * * Note that exiting YAM via "off" hangs up the phone. If you want to * exit and stay online, use ^C. When re-entering YAM, the initialization * routine tries to be smart about not bashing things if carrier is * present. * * The additional code in YAM5.C to support these functions requires that * you add 500 (hex) to the external origin suggested by CAF. E.g., if * he suggests using "-e 6200" you should use "-e 6700". * * NOTE WELL that use of inp() and outp() for memory mapped I/O * requires changes to the BDS libraries. One version of these changes * is documented in APBDSC.DQC, to be found on finer RCPM systems. * * -- Jeff Martin 11/13/81 -- * */ #include "a:bdscio.h" #include "a:hardware.h" /* files have single letter ext so pip yam?????.? gets all source but no crl */ /* #define APPLICARD /* uncomment this line if you have an Applicard */ */ #define HELPFILE "YAMHELP.T" #define PHONES "YAMPHONE.T" #define CPM #define BDSC #define USQ #define INITBAUD #define ANSWERBACK "" #define MOMCAL 800 #define KBMASK 0177 #define BRKKEY 000 #define ESCCAL 100 #define SECPBLK 8 /* 1k byte blocks on Apple 5" disk */ /* ********* following string must be in UPPER case ********* */ #define DISKS "AB" /* legal disks for default selection */ #define MAXUSER 15 /* maximum user number */ #define MMII /* type of modem port */ #define KLUDGE212 /* for MMII + 212 in printer slot via CCS7710 */ #define Z19 /* terminal type */ /* #define VIDEX /* terminal type */ */ #ifdef Z19 #define FLAVOR "Apple / H19 / Micromodem II YAM" #define STATLINE /* do special status line information */ #define TERMRESET "\033y1\033x9\033v" #define TERMREPLOT "\033E\033y1\033w" /* for replot - no 25th, no wrap */ #define TERMINIT "\033z" #endif #ifdef VIDEX /* Videx users should set their software table in the BIOS to the H19 codes. */ #define FLAVOR "Apple 80 Col. Bd. / Micromodem II YAM" #endif #ifdef MMII #define DEFBAUD 300 /* Use this default baud rate -- MMII can't read */ #define MMIICR2 0xE0A5 /* Modem (as opposed to ACIA) control/status port */ #define HOOKOFF 0x80 /* cr2 write functions */ #define MMSET 0x08 #define ORIGMODE 0x04 #define TXE 0x02 #define HISPEED 0x01 char cr1; /* Store last write to MMII cr1 */ char cr2; /* Store last write to MMII cr2 */ #endif #ifdef SMODEM /* ** Switches on Smartmodem 1200 should be set for Not Verbose (S2 down), ** Send Result Codes to Screen (S3 down), No Echo of Commands (S4 down) ** and Don't Auto-Answer (S5 down). All other switches as from the ** factory. Sorry, not for XYAM usage as it stands. If your system allows ** communication even if DSR is low you can also set switch 6 to allow you ** to detect loss of carrier. */ int nbaud; /* Smartmodem strings */ #define SMATTN "+++" /* get to command mode if not already there */ #define SMHUP "ATH\r" /* onhook command -loss of DTR or long brk works too */ #define SMDIAL "ATDT " /* prefix to sending the number - touchtone mode */ #define FLIP #define SMTOORG "ATD\r" /* offhook and wait for carrier in originate mode */ #define SMTOANS "ATA\r" /* offhook and turn on carrier in answer mode */ #define NRING 3 /* Number of rings before offhook in auto-ans mode */ #endif #define RESETACIA 0x03 /* cr1 write functions */ #define ACIAMODE 0x15 /* One start, 8 data, no parity, one stop */ #define SBREAK 0x60 /* Writing this to CR1 sends break */ #ifndef VERSACARD #define DPORT MDATA /* Use the bdscio.h definition */ #define SPORT MSTAT /* Use the bdscio.h definition */ #define MIREADY (inp(Sport)&MIMASK) /* value != 0 if char available */ #define MIREADYERROR /* rx data ready and error bits in same reg */ #define CDO (inp(Sport)&0x04) /* True if carrier dropped off */ #define MIREADYMASK MIMASK /* rx character available */ #define MIERRORMASK 0x30 /* rx error (framing or overrun) */ #define MICHAR (inp(Dport)) /* get char assuming miready */ #define MOREADY (inp(Sport)&MOMASK) /* modem ready to load next char */ #endif #ifdef VERSACARD #define SPORT 0xE0A4 #define DPORT 0xE0A5 #define MCPORT 0xE0AC #define MOPORT 0xE0AD #define MIREADY (inp(Sport)&MIMASK) /* value != 0 if char available */ #define MIREADYERROR /* rx data ready and error bits in same reg */ #define CDO FALSE /* True if carrier dropped off */ #define MIREADYMASK MIMASK /* rx character available */ #define MIERRORMASK 0x30 /* rx error (framing or overrun) */ #define MICHAR (inp(Dport)) /* get char assuming miready */ #define MOREADY (inp(Sport)&MOMASK) /* modem ready to load next char */ #endif #ifdef APPLICARD #define CLKMHZ 6 #define MODOUT(c) outp(Dport,c) #else /* * Turns out you can't reliably write to an ACIA from the SoftCard. * See apmout() for details... */ #define MODOUT(c) apmout(c) #define CLKMHZ 2 #endif #define IOTYPE unsigned /* Port declaration for memory mapped I/O */ char bios(); #define CIREADY bios(2, 0) #define CICHAR bios(3, 0) #define COREADY TRUE #define TTYOUT(c) bios(4, c) /* * It would be nice if Microsoft's BIOS for the Apple supported BIOS * function 15 (list device status) so the following wouldn't be needed */ #define PSTAT 0xE09E /* Status port for CCS serial printer interface */ #define PDATA 0xE09F #define POMASK 0x02 /* CCS serial printer interface output ready mask */ #define POREADY (inp(PSTAT)&POMASK) #define LPOUT(c) bios(5, c) #ifdef KLUDGE212 #define ALTMSTAT PSTAT #define ALTMDATA PDATA #define MMSLOT 2 #define ALTSLOT 1 #endif