Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ittatc!dcdwest!sdcsvax!sdcc6!ix742 From: ix742@sdcc6.UUCP (James Hayes) Newsgroups: net.micro.apple Subject: vt100 emulator (Part 3 of 3) (Hardware docs.) Message-ID: <2528@sdcc6.UUCP> Date: Mon, 14-Apr-86 05:44:43 EST Article-I.D.: sdcc6.2528 Posted: Mon Apr 14 05:44:43 1986 Date-Received: Thu, 17-Apr-86 04:22:21 EST Organization: UC San Diego EE/CS Department. Lines: 1215 Keywords: vt100 emulator Apple This is the "write-your-own-driver" documentation portion. Have fun. -----CUT-----CUT-----CUT-----CUT-----CUT-----CUT-----CUT----- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # driver.notes # This archive created: Mon Apr 14 01:10:59 1986 # By: James Hayes (UC San Diego EE/CS Department.) export PATH; PATH=/bin:$PATH echo shar: extracting "'driver.notes'" '(38017 characters)' if test -f 'driver.notes' then echo shar: will not over-write existing file "'driver.notes'" else sed 's/^XX//' << \SHAR_EOF > 'driver.notes' XX XX XX Terminal Program Applications Notes XX XX XX XX This document covers writing your own hardware drivers to work XX with the DCOM 3.21 vt100 emulator. XX XX Overview: XX XX The vt100 emulator is broken up into several modules: XX XX The standard (non hardware specific) modules: XX 1) The main terminal driver. (It uses all drivers) XX 2) The keyboard driver (Maps what you type to what gets XX sent.) XX 3) The control panel (The "set up", dailing, and modem XX menus) XX XX The non-standard (hardware specific) modules: XX 1) The video driver XX 2) The serial card driver XX 3) The modem personality (Defines dialing and on/off hook XX characteristics.) XX XX XX Each driver is allocated a segment of memory, and all the driver XX functions are handled through standardized entry points. XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX DCOM.MAIN: XX XX This is the main controller for the terminal emulator. It XX handles all aspects of the emulation. (Decoding, translating, XX and interpretation) XX XX It lives at $2000 and is allocated 4096 bytes for the program + XX any buffers it might need to perform its duties. XX XX Standardized calls to the main module: XX XX $2000 - Begin emulation. This initilizes all the hardware, XX clears the screen, and becomes a terminal. XX XX $2003 - Not presently used, BUT.. May be used to return when XX there is a need to exit for some reason. (To another XX program {e.g. BASIC} that can perform higher level XX functions such as saving buffers, files, etc.) XX XX $2006 - WARNING! WARNING! (Just a trick to get you to read this.) XX This routine is the HEART of the terminal program. This XX call polls the modem for a character, and if one exists, XX the character is stored in a queue. If the queue is near XX full, an X-OFF (Ctrl-S) is sent. When the queue empties, XX an X-ON (Ctrl-Q) is sent. This routine is used by all XX drivers to keep checking the modem. If you write a XX driver and any particular routine has a loop, BY ALL XX MEANS, call $2006 (STUFFBUF) every few milliseconds. XX XX $2009 - This call simulates the input of a character from the XX modem. (This might be used to "play-back" a terminal XX session stored on disk.) It is presently used to output XX characters to the screen from the control panel. XX XX $200C - This call clears the incomming character queue. This is XX used in the phone dialing routines, so the dialing XX commands aren't echoed back. XX XX Unless there are glaring bugs in the main driver, the source for XX the main driver should never have to be touched. (I know someone XX out there will make me eat my words. I just know it...) XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX Global variables used by the main program and all drivers: XX XX $2FF - This is the return flag. When you type @ from the XX set up menu, this flag gets set (to tell the main XX program that you want to exit) to $F0. If before XX you exited, you selected S, then the flag would by $FF XX indicating that you want to save all the defaults when XX you exit. XX XX $300 - Development flag. This is used during the course of XX debugging the program. Please do not use this for XX anything but testing purposes. I guess you can call it XX reserved. That has a nice ring to it... "reserved" XX XX $301 - MODEINS. This is the "insert character" mode flag. XX Real life vt100's have no clue as how to insert XX characters, so I gave my program the abaility to do XX so using standard ANSI (American National Standards XX institute) codes. Therefore, this emulator can also XX look like a vt125, vt220, and practically anything made XX by microterm and other companies. XX XX The insert mode is "on" when the high-bit is set. XX XX $302 - MODESCRL. This flag determines whether or not the XX emulator will scroll when a cursor movement (e.g. up, XX down, left, right) is going to go off the screen. Real XX vt100's don't have this flag, but it was included as XX part of the added ANSI control sequences mentioned XX above. XX XX The screen will scroll on cursor movements when the XX high bit is set. XX XX $303 - MODELFNL. MODE LineFeed->NewLine. When the high bit of XX this puppy is set, any linefeeds received will XX automatically be converted to "New line"s (CR+LF) XX sequences. XX XX $304 - MODECRNL. MODE Carriage Return->NewLine. When the high XX bit of this is set, any carriage returns that are XX received are mapped to "New line" (CR+LF) sequences. XX XX $305 - MODEWRAP. Wraparound mode. A high bit here indicates XX that incomming chartacters will not be truncated once XX they bang into the right edge of the screen. (I.E. any XX line longer than 80 columns will be wrapped.) XX XX $306 - MODEKEY. This mode determines whether your apple will XX let you know (via a click) everytime you type a key. XX XX If the high bit is set, it will do so. XX XX $307 - MODEECHO. When the high bit is set, anything typed will XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX be echoed to the screen (except escape sequences). XX XX $308 - MODEBACK. This is really misnamed. It contains the XX current background clear character. $20 for normal XX screen, and $A0 for reversed image screen. XX XX $309 - MODEDBL. High bit indicates that the emulator is in the XX "double wide" mode on the current line. When this XX happens, Each character takes up two character XX positions, (the character + space). The line is XX effectively 40 columns wide, and subsequent cursor XX positions will reflect a 40 column line. XX XX $30A - MODETOP. When in the double wide mode is set, there XX is another thing to worry about.. The double wide, XX double high mode. This flag takes care of that. When XX the high bit is not set, all is normal. BUT WHEN IT IS XX SET, it means that the emulator wants to display the XX lower portions of the letters. Since no Apple 80 column XX card today has the capability of double high letters XX mixed in with regular text, the lower portions of the XX letters are just converted to "--" which adds a nice XX accenting touch to the letters. XX XX $30B - MODECHR. This flag determines what character set the XX emulator is using. If the highbit is set, the emulator XX will use the substitute line drawing character set, if XX the 80 column card can handle it. XX XX $30C - MODEINV. As ususal "This flag bs bs bs bs" It controls XX the status of the character output. If the high bit is XX set, the screen driver will output inverted characters. XX BE CAREFUL TO NOTE THAT THE BACKGROUND CHOICE (MODEBACK) XX INVERTS THE ABOVE STATEMENT. XX XX $30D - MODEVT52. When this flag is set, the terminal will only XX respond to vt52 command strings. XX XX $30E - XOFF. When the high-bit of this flag is set, it means XX that the buffer is near full, and an X-OFF was sent. XX (When the buffer depletes, an X-ON will be sent.) XX XX $30F - CX. This is the current cursor position as known to all XX the routines. This is the formost authority of the X XX coordinate of the cursor. (0-79) XX XX $310 - CY. This is the current cursor position as known to all XX the routines. This is the formost authority of the Y XX coordinate of the cursor. (0-23) XX XX $311 - BLINK. This is the current cursor blink rate. 0=no XX blink, while 1 is fast and 9 is slow. XX XX $312 - SCRLTOP. This number represents the top of the current XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX scrolling region. (0-23). The scrolling region is XX the active text region. Usually it starts on line 0 XX and extends to line 23. Some programs however, like to XX use a smaller scrolling window, while using the rest XX of the screen for other data. Any data written to the XX screen will only appear in the scrolling region, so it XX will not affect the rest of the display. XX XX $313 - SCRLBOT. This is the bottom line of the scrolling XX region. (0-23) See above. XX XX $314 - MODEKAM. KAM is the ANSI term for Keyboard XX Applications Mode. When this mode is set (via the XX high bit) different vt100 keypad codes will be used XX instead of the standard codes that are normally used. XX (See real vt100 manual) XX XX $315 - MODECURS. This is used (why I don't know) to indicate XX that an alternate set of codes should be used when the XX arrow keys are hit. As usual, a high bit inticates that XX these alternate codes should be used. Please see a real XX vt100 manual for more information. XX XX $316 - G0MODE. This selects the character set used for the g0 XX character set. The high bit indicates the graphic XX character set. XX XX $317 - G1MODE. This selects the character set used for the g1 XX character set. The high bit indicates the graphic XX character set. XX XX $318 - MODEORIG. This is the ANSI related flag that tell the XX terminal that cursor positioning should be done with XX respect to the scrolling region's home position instead XX of the display's home position. XX XX $319 - GOG1TOg. G-Oh-G-1. High bit here indicates that the XX alternate character set (inverse or graphic) should be XX used. (See MODECHR and MODEINV for the specific set XX that we're looking for...) XX XX $31A - MSLOT. This contains the current slot of the serial XX card. (1-7), except 3 and 6 XX XX $31B - Unused. XX XX $31C - MODE. This is the state of the current command XX sequence parser. 0=No escape sequence in progress. XX 1=Escape sequence started. XX 2=wait for next. If "[" set mode 3, XX otherwise, interpret single letter XX escape code. XX 3= [ received, collect parameters XX and act on command wishes. XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX 4=Transparency mode, ANSI CRM. XX Control Representation Mode. All XX characters are sent to screen and XX no escape codes are interpreted. XX Must be reset via the R option on XX the setup menu. XX 5=vt52 escap sequence started, this XX current character will end the XX code sequence. XX 6=vt52 cursor positioning sequence XX is on it's way. read two characters XX in this mode and position the XX cursor. XX XX $31D - BAUD. Current serial card Baud Rate. 0=300 XX 1=1200, 2=2400 XX XX $31E - PARITY. Current serial card Pariry method. XX 7=None, 8=Even, 9=Odd, 10=Mark, 11=Space XX XX $31F - STOP. Current serial card stop bits setting. XX 3=8 bits, 1 stop 4=8 bits, 2 stop XX 5=7 bits, 1 stop 6=7 bits, 2 stop XX XX $320 - TABTABL. Starting at $320 and extending 79 bytes, is the XX image of the terminal's tabstops. 320=column 0. A high XX bit indicates a tab is set there. XX XX $380 - LNMODES. Starting at $380 and extending 23 bytes, is the XX image of the terminal's "line modes" Bit 7=1 when Double XX wide is selected for that particular line, Bit 6=1 when XX the line refers to the bottom half of the double wide XX characters. XX XX $8100 - This 255 byte area holds a copy of the terminals XX -$8200 defaults when the screen is saved. XX XX $8200 - Holds a copy of the terminal parameters when the save XX -$83FF cursor mode is selected. XX XX $8400 - Holds a memory image of the saved screen. You have XX -$9400 roughly 4K to play with here. Use it wisely. XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX DCOM.MODEM.xxxx: XX XX The DCOM modem driver lives at $4000 and is alloted 2048 bytes. XX DON'T Panic. The modem driver usually takes about 200 bytes. XX XX The established calling conventions: XX XX $4000 - Initialize the serial card/modem here. XX This should do the following: XX Reset the page 3 values of MODE, BAUD, and PARITY from XX the default table DCOM.MODEM.xxxx.D. XX Reset the AICA port on the card/modem. XX Hang up the phone (in cases when this is not XX a serial card but something like a XX Apple-Cat or Micro-Modem) XX XX $4003 - Sense the status of the serial card. It returns the XX carry set if something is waiting to be read in. XX XX $4006 - Get a character from the modem. (Use the above to make XX sure one is waiting. (The character will be put into XX the 6502 ACCUMULATOR) XX XX $4009 - Output a character on the modem. The character must be XX in the accumulator. No stripping of high bits is XX performed here. XX XX $400C - Change the transmission characteristics. The XX characteristic is in the accumulator: XX XX 0 = 300 Baud 3 = 8 data, 1 stop XX 1 = 1200 Baud 4 = 8 data, 2 stop XX 2 = 2400 Baud 5 = 7 data, 1 stop XX 6 = 7 data, 2 stop XX XX 7 = No parity XX 8 = Even parity XX 9 = Odd parity XX A = Mark parity XX B = Space parity XX XX XX $400F - Send a break "character" XX XX $4012 - Compatibility table; If a member of the table is $FF, XX then the equipment is capable of "doing it". The meaning of each XX entry coresponds to the above transmission characteristics. If XX an entry is $F0, then then this is the default mode for the card. XX If the member is $00 then the hardware is incapable of inheriting XX that characteristic. There is one capability in the table that is XX not listed above, index $C which is the break signal. The XX default table is the responsibility of the user to set. The XX modem's default parameter list is 13 bytes long and is overlayed XX at $4012. works. All in all, it should not be difficult to write XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX your own driver for your serial card. Please see also, the XX dialing personality module in upcoming pages. XX XX NOTES: XX XX Remember that the defaults are overlayed starting at $4012 XX for 13 bytes. Please choose the defaults carefully. Failure to XX understand that particular portion of the code and what it does XX and how it works can lead to months and months of dispair. XX XX Enough Warnings! XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX DCOM.SCREEN.xxxx: XX XX The screen driver lives at $5000 and is alloted 2048 bytes to do XX it's work. The kernel jumps are: XX XX $5000 - Initialize the screen. This should initialize any display XX INIT- hardware, soft-switches, etc. It should in no way clear XX SCRN the screen. XX XX $5003 - Zap the screen clean! Does not reset the cursor to the XX ZAP home position. XX XX $5006 - Clear the line number contained in the Y reg. XX CLRLINE XX XX $5009 - Move the line in the x-reg to the line in the y-reg. XX MOVELINE XX XX $500C - Store the contents of the accumulator to the screen XX STORE- location (x-reg,y-reg) This routine should not care what XX XY it gets fed. It should just deposit anything. XX XX $500F - Clear from the current cursor postion to the end of the XX CLEAR- line. XX EOL XX XX $5012 - Clear from the current cursor to the end of the screen. XX CLEAR- XX EOS XX XX $5015 - Scroll the screen up. (With respect to the scrolling XX SCROLL- window. XX UP XX XX $5018 - Scroll the screen down. (With respect to the scrolling XX SCROLL- region. XX DO XX XX $501B - HIDE the cursor from sight. This call is VITAL to the XX HCP health and well being of the terminal program. Follow XX this rule of thumb: BEFORE YOU DO ANYTHING TO THE XX SCREEN, REMOVE THE CURSOR, MUCK WITH THE SCREEN, AND PUT XX THE CURSOR BACK. This routine saves what ever was under XX the cursor in order to put it back. See SHOW routine XX below. XX XX $501E - Cycle the cursor blink counter through one cycle. If XX CCHECK counter reaches it's blink threshold, ("BLINK" times XX $100) then invert the cursor. This is done to get the XX damn thing to blink. XX XX $5021 - SHOW the cursor (After a remove) Opposite of $501B XX SCP XX XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX $5024 - Pickup the character from (x-reg,y-reg) and stuff it into XX PICKUP the accumulator. The screen remains unblemished. XX XX $5027 - Output the accumulator to the screen at the current XX CHOUT cursor location. Scroll if necessary, display as inverse XX if necessary, use doulbe wide double high modes. etc. XX XX $502A - Insert a line at the present cursor position and return XX INSERT- the cursor to the left edge. XX LN XX XX $502D - Delete a line at the present cursor position and return XX DELETE- the cursor to the left edge. XX LN XX XX $5030 - Clear from the beginning of the line to the cursor. XX CLEAR- (Inclusive) XX BLC XX XX $5033 - Clear from the home (0,0) position to the cursor. XX CLEAR- (Inclusive) XX HC XX XX $5036 - Delete the character under the cursor and move the XX DELT- rest of the line over one position. (Clears the last XX CHAR column on that line.) XX XX $5039 - Insert a blank under the cursor and move the rest of XX INST- the line over one position. XX CHAR XX XX $503C - Fill the screen with E's, (Video Alignment Pattern.) XX FILLE (invoked by #8) XX XX $503F - INVERT the whole screen. For example, white on black XX FIX- becomes black on white and vice versa. XX SCRN XX XX $5042 - Do a carriage return and a line feed. XX DOCR XX XX $5045 - Do a line feed. XX DOLF XX XX $5048 - Save the screen in memory. $8400-$9400 is reserved for XX SAVE- this. This also saves the video defaults so we can come XX SCRN back without damaging anything. XX XX $504B - Restore the screen from the memory save to by the above XX REST- routine. Also restore any video flags that might have XX SCRN been altered. XX XX $504E - Reset the line (make single width from double width) XX $5051 - Make Double (make double width from single width) XX XX XX XX XX XX XX XX XX Terminal Program Applications Notes XX XX XX XX NOTES FOR WRITING A SCREEN DRIVER: XX XX You DO NOT have to rewrite all the above routines! YEA! There XX are only a few that need to be adapted to your own hardware. XX XX They are: XX XX INITSCRN (for obvious reasons) XX CLRLINE XX MOVELINE (allows for scrolling) XX STOREXY (to put characters on the screen.) XX PICKUP (to get the character under the cursor) XX FIXSCRN (to invert the screen.) XX SAVESCRN (save the screen to memory) XX RESTSCRN (..and bring it back.) XX XX You see, all the other routines can use combinations of the above XX "CORE" routines. Even some of the core routines can use other XX core routines. For example: SAVESCRN can use PICKUP. It will be XX slow, but it will work. FIXSCRN can also use PICKUP. Again, it XX will be slower, but it will work. Restscrn can use STOREXY. As XX usual, it will be slower. MOVELINE can use PICKUP and STOREXY to XX do it's work. (THIS IS ONLY RECOMMENDED FOR TESTING PURPOSES. IT XX IS A DANGER TO SPEED CONCERNS TO LEAVE IT THAT WAY.) XX XX So you see, only a few routines need to be written. XX XX Since speed is so critical, the routines should never assume XX that the calling routine wants registers returned intact. So, XX don't keep pushing and popping stuff on and off the stack. That XX REALLY slows things down. XX XX During a scroll and "looping" routines, poll the "STUFFBUF" XX routine so characters coming into the computer get read and are XX not thrown away. I.E., after every CLRLINE, MOVELINE, etc. This XX will insure that characters will not be "dropped" because the XX program is not reading them fast enough. XX XX That about exhausts the Video Driver section... XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX DCOM.KEYBOARD.xxxx XX XX XX The Keyboard Interpreter lives at $6000 and is allotted a meager XX 1024 byte spread in the memory map. This is true. (It's really a XX small piece of code!) XX XX Anyway it does the following: XX XX $6000 - Interpret keyboard character in the accumulator and send. XX This will intercept open/closed apple commands and XX interpret them. XX XX $6003- This is the Key Table. This is a table of the ASCII XX $6033 representation of the special keys we want to redifine XX as vt100 keypad/function keys. For example: Q and q are XX defined to be the PF1 key... So Q and q would appear in XX this table as special characters that are to be XX intercepted when the open/close apple key is struk. How XX do we translate them? NEXT.... XX XX $6034- Key Dispatch Table. Here the key's special purpose is XX $6064 defined. The order in which the one byte definition XX appears is the same order that the one byte key code XX appears in the above Key Table. XX XX The one byte codes that are used are: XX XX 1 - vt100 UP arrow 9 - vt100 keypad 7 XX 2 - vt100 DOWN arrow 10 - vt100 keypad 8 XX 3 - vt100 RIGHT arrow 11 - vt100 keypad 9 XX 4 - vt100 LEFT arrow 12 - vt100 keypad - XX 5 - vt100 Pf1 13 - vt100 keypad 4 XX 6 - vt100 Pf2 14 - vt100 keypad 5 XX 7 - vt100 Pf3 15 - vt100 keypad 6 XX 8 - vt100 Pf4 16 - vt100 keypad , XX XX XX 17 - vt100 keypad 1 XX 18 - vt100 keypad 2 XX 19 - vt100 keypad 3 XX 20 - vt100 keypad XX 21 - vt100 keypad 0 XX 22 - vt100 keypad . XX 23 - vt100 BREAK KEY XX XX $6070- Translate table. The single byte translate table. Here XX $6090 is where the the function key is mapped to the character XX to send to the host. XX XX An example to clear up all this confusion: XX XX Let's say you type an open-apple W. "W" appears as the third XX element in the Key Table. So, look at the 3rd byte in the XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX Dispatch Table. It is 6 (meaning pf2), so look at the 6th XX element in the Translate table. Here we find that an S is to be XX sent. (So the sequence looks like "?S".) XX XX This wonderful method means that your own preferences in keys can XX be mapped into the program. XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX Modem Personality Description: XX XX DCOM.PERSONALITY.xxxx lives at $6800 and is alloted 1024 bytes. XX It controls the modem dialing aspects. XX XX $6800 - This byte contains the "ability" flag for the equipment's XX ability to dial the phone. It has these meanings: XX XX 0 - YES -- This equipment can dial the phone. XX 1 - NO -- This equipment is directly wired to its host XX and does not need a modem. XX 2 - NO -- The equipment is a modem but can't dial the XX phone XX 3 - YES -- The equipment is not a phone, but a hardwired XX network. It can "connect" to other machines. XX In this case, the menu asks for the machine XX name you want to connect to. XX XX $6801 - Dial/connect to the phone number/system name with the XX string of ASCII characters starting at $200. The string XX is terminated (as are the conventions) by a ZERO. There XX is a 40 character maximum. XX XX $6804 - Hangs up the phone. (If the modem/network is capable.) XX XX $6007 - Wait for carrier. (Return if detected, return if time XX runs out.) XX XX The control panel does all the controlling. These routines are XX used just to do the dirty work. XX XX (See the source code for a look at what it all means...) XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX The control panel: XX XX DCOM.CONTROL lives at $7000 and occupies 2048 bytes. This my XX change in the near future if things tend to get as large as they XX are starting to. Anyway, this is the simple part. XX XX $7000 - The set up menu XX $7003 - The serial card menu. XX $7006 - The dialing menu XX $7009 - Re-dial/connect to the last number/system XX dialed/connected to. XX $700C - Disconnect XX $700F - Print a message to the screen. (Low byte in x, high in y) XX XX Basically all these do is save the screen, do their bits of XX business on a fresh screen, and cover it up when finished. (Using XX the saved screen to restore everything.) There is really nothing XX to play with here unless you are curious and want to muck with XX the internal things. XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX XX XX The BASIC program: 'CONFIGURE TERMINAL' XX XX The CONFIGURE TERMINAL program is a very simple piece of code XX that just asks 4 or 5 questions and saves the results to a text XX file "CONFIG.TERM" XX XX The DATA statements in the program consist of all the possible XX screen, serial and 80-column cards. They are divided up by XX sections. Which look like this: XX XX xxx DATA TYPE-OF-DRIVER-WE-WANT-TO-INSTALL XX XX xxx DATA SHORT-NAME-OF-CARD XX xxx DATA DCOM.xxxx.xxxx (NAME OF DRIVER ON DISK) XX xxx DATA LONG NAME (USED WHEN LOADING THE TERMINAL) XX XX --- Repeat the above 3 data statements until all the cards of XX that catagory are exhausted. XX XX xxx DATA *,XX,XX (Indicates the end of a "card section") XX XX --- Start over with the name of the next type of driver to be XX installed. XX XX xxx DATA ** (indicates the end of the cards to be installed.) XX XX XX The file looks like this: XX XX DCOM.MAIN XX MAIN DRIVER XX DCOM.KEYBOARD.IIE XX KEYBOARD DRIVER XX DCOM.CONTROL XX CONTROL PANEL XX DCOM.SCREEN.xxxx XX NAME-OF-VIDEO-DRIVER XX DCOM.MODEM.xxxx XX NAME-OF-SERIAL-DRIVER XX DCOM.PERSONALITY.xxxx XX NAME-Of-DIALING PERSONALITY XX n <-- The slot number of the serial card. XX {EOF} XX XX The order of the modules within the file is not important. XX XX The 'HELLO' program just reads the file, and loads each named XX file while it prints its name on the screen. XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX XX XX Notes on writing your own drivers: XX XX 1) Video drivers should use the DCOM.SCREEN.DVISION as the XX "reference" driver. You should examine this driver carefully XX by printing it out first. XX XX 2) Serial card drivers should use the DCOM.MODEM.SSC (Super XX Serail Card) driver. This driver is pretty characteristic XX of a serial driver. Again print it out first. XX XX 3) Avoid using built in ROM as much as possible, as ROM usually XX contains very unwanted side-effects. XX XX 4) BEWARE of the Apple's wonder system of peripheral card XX expansion ROM. Some cards enable the $C800-$CFFF space but XX don't disable it until another card SPECIFICALLY REQUESTS that XX it be disabled. The standard Apple convention to disable the XX card occupying the space is to reference the $CFFF location. XX So, before you do anything to a peripheral card, read (or XX write) to $CFFF and then reference a memory location within XX the 256 byte ROM space on the card you want to talk to. If XX you don't do this STRANGE things may happen. XX XX 5) Don't make any assumptions about using registers. Do not save XX any registers because no routine assumes that they are saved. XX If ever a section of the terminal dies after adding a new XX chunk, just save the registers of the new chunk. If the XX program works after that, then I'll have to eat my words. XX The video driver has the saved/killed registers in a routine XX by routine format in the source listings. XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX Terminal Program applications notes: XX XX XX XX XX XX XX XX That's about it. I do think 18 some-odd pages of documentation XX is enough! I've done all the hand-holding I can do. You're on XX your own. XX XX Jim Hayes XX P.O. Box 221044 < Valid forever. XX University City, CA XX 92122-1044 XX XX (619) 450-9315 (213) 377-3001 XX XX ^^^^Phone-invalid after June '86 ^^^^Phone is reliable through XX SUMMER of '86 XX XX ARPA: hayes%wizard@UCSD.ARPA XX UUCP: [ihnp4, ucbvax]!sdcsvax!wizard!hayes XX XX XX IF ALL ELSE FAILS: XX XX Jim Hayes Mail Station: RS R1/C311 XX Hughes Aircraft (Radar Systems Group) XX P.O. BOX 92426 XX Los Angeles, CA XX 90009 XX XX (213) 648-4400 (<-- My secretary. Be nice to her or the boogie XX man will destroy your code...) XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX SHAR_EOF if test 38017 -ne "`wc -c < 'driver.notes'`" then echo shar: error transmitting "'driver.notes'" '(should have been 38017 characters)' fi fi # end of overwriting check # End of shell archive exit 0