ATARI CX85 KEYPAD HANDLER (TEXTPRO 5.20X/BCALC)¢ By Frank Walters¢ ¢ JOYSTICK PORT 1: TEXTPRO KEYPAD KEYS¢ JOYSTICK PORT 2: BCALC KEYPAD KEYS¢ ¢ TPKEY is a Page Six routine to read the ATARI CX85 keypad from joystick¢ port 1 or port 2 while using other programs that do not use Page 6 ($0600¢ or 1536 decimal). It uses 154 bytes of memory ($0600-$0699) and utilizes¢ vertical blank interrupt (VBI) to read the keypad without interfering¢ with program in use. Plug CX85 keypad into joystick port 1 or port 2,¢ depending on which set of key translation tables you want to use.¢ ¢ TPKEY includes a DISABLE function to shut off the vertical blank (VBI)¢ routine but retaining the handler in page six for re-installing it from¢ memory. More about this later.¢ ¢ THE ACTUAL HANDLERS:¢ ¢ The ARC package includes 4 usable handlers for the CX85 Keypad. Each¢ supports 2 key translation TABLES: Port_1 and Port_2.¢ ¢ TPKEY.BAS - BASIC program to install TPKEY handler and make USR call to¢ execute it, making the keypad active.¢ ¢ TPKEY.COM - ML binary load handler file, exact same handler as the BASIC¢ program. Both TPKEY files support TEXTPRO (especially v.5.20x) in¢ joystick port 1. BCALC.COM, a spreadsheet program from Analog Computing,¢ is supported by port 2.¢ ¢ TPKEYDEF.COM - Same as above except key TABLE for port 2 has the DEFAULT¢ keys on the CX85 keypad. ESC, NO, DELETE, YES, etc. Port 1 is TEXTPRO.¢ ¢ KEYBAS.COM - Has 2 different key TABLES. Port 1 supports BASIC DATA lines¢ and Port 2 has math functions (+, -, /, *).¢ ¢ SORTING OUT THE DIFFERENT HANDLERS AND TABLES:¢ ¢ The ARC packet includes a full description of the key translation tables¢ in separate text files. Each prints on a single page so you don't have to¢ hunt through this long document to find what the keys do on your selected¢ handler. Just print the .TXT file with the same filename as your handler¢ and you have all you need to use the keypad right away. e.g. For¢ KEYBAS.COM tables, print KEYBAS.TXT.¢ ¢ HOW TO USE THE HANDLERS:¢ ¢ BASIC users can RUN "D:TPKEY.BAS at the READY prompt. The handler will be¢ installed and your CX85 keypad will be activated. Plug it into port 1 and¢ press each of the keys to see what you get. It should be what TPKEY.TXT¢ claims it is. SHIFT_CTRL keys will not print on the screen and do not¢ have a keyclick. They are sometimes called "SoftKeys" and are used by¢ some programs such as TextPRO to do certain functions, such as page-up¢ and page-down in the editor.¢ ¢ The "COM" handlers can be loaded from DOS by binary load [L] on ATARI¢ DOS, MyDOS, TOP-DOS or from Command Processor with Spartados and DOS-XL¢ users. They can also be loaded via batch file with Spartados or Command¢ File with TOP-DOS. However, do NOT append another program to the .COM¢ file since it uses a RUN address, not an INIT address.¢ ¢ CAUTION: SPARTADOS users must also turn off both Time/Date line with "TD¢ OFF" and keyboard buffer with "KEY OFF". Both routines may interfere with¢ the TPKEY handler VBI routine. TPKEY.BAS works with any DOS, but must¢ also have "KEY OFF" with Spartados.¢ ¢ Once the .COM file is loaded, it activates the keypad. Try it. You may¢ then binary load another program, such as TextPRO or BCALC, to use in¢ conjunction with the keypad. Or you can go to BASIC and run a BASIC¢ program with the keypad. It will continue operating until you turn off¢ the computer, press SYSTEM RESET or disable the VBI with the CONSOLE¢ keys.¢ ¢ CAUTION: DO NOT PRESS SYSTEM RESET, (WARM START), WITH THE KEYPAD HANDLER¢ INSTALLED. Some addresses have been changed by the Keypad handler and¢ lock-up is possible if you use SYSTEM RESET and try to enable the handler¢ afterwards.¢ ¢ Exception: BCALC changes the WARMST vector to the DOS vector, so a SYSTEM¢ RESET does not actually occur. Rather it just exits to DOS, but without¢ restoring the byte at $0600. No problem. See below.¢ ¢ DISABLING KEYPAD HANDLER:¢ ¢ The CX85 handlers use a vertical blank interrupt routine (VBI). Once you¢ start a VBI it continues running even after you quit whatever program you¢ used with the keypad. After you are done using the keypad. IT WILL AFFECT¢ A JOYSTICK PLUGGED INTO EITHER PORT. You can deactivate the TPKEY VBI¢ routine, but retain it in Page Six memory for use later.¢ ¢ START+SELECT+OPTION = DISABLE KEYPAD (Hold all 3 keys at the same time)¢ ¢ Since both TextPRO and BCALC use CONSOLE keys, I did not want to disable¢ the keypad with one key, such as START or OPTION, for example. You don't¢ have to hit all three console keys at the same time. Just hold down each¢ one, in turn, until all three are pressed. You'll find the keypad no¢ longer responds. START+SELECT+OPTION restores the original VBI vector¢ prior to installing the keypad handler.¢ ¢ RE-ENABLE: The disable routine restores the first byte of the routine at¢ 1536 ($0600) and resets all VBI addresses to the original O/S values. You¢ can re-enable the keypad again from BASIC with A=USR(1536) or from DOS by¢ Run @ Addr $0601 (NOT $0600). With DUP.SYS type DOS (MyDos, TOP-DOS,¢ Atari DOS), use item [M] from menu.¢ ¢ M <Return>¢ $601 <Return>¢ ¢ The keypad should work again in either joystick port 1 or 2. Try it.¢ I hope you find this program useful and, if not, at least informative.¢ ¢ MODIFYING TPKEY HANDLER TABLES:¢ ¢ MODIFY.DOC is a separate text file which explains modifications you can¢ make to the key tables in the BASIC and MAC/65 SRC files. For those who¢ do not wish to tackle modifications, TPKEY.DOC is sufficient for your¢ needs.¢ _________________________________¢ Frank Walters, Sysop - 09/22/97¢ T.A.C.O. Bell BBS - since 1985¢ Panama City, FL¢ Baud: 300 to 2400¢ Duplex: Full¢ Translation: ATARI (REQUIRED to register)¢ HOURS: 4PM to 11PM CENTRAL TIME¢ Phone: 1-850-785-2333¢ Software: TACOBELL-XE custom Basic-XE BBS written by Sysop.¢ Hardware: 130XE, 1mb MIO, 3/Happy 1050, 1/XF551 360k, USR Courier 2400¢ Official TextPRO Support BBS¢ _________________________________¢