Stickwriter

Type
Utility
Category
Joystick-operated word processor (assistive communication)
Author
Bill Lukeroth
Published in
Antic, March 1986 (Vol. 4, No. 11)
Year
1986
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC, joystick (or a head-pointer or similar switch device wired as one); optional printer; optional S.A.M. speech software with the S.A.M. Handler from Antic, February 1985
A GRAPHICS 0 menu with columns of common words (DID, ALL, COLD, AM, DRINK, BATHROOM...), the alphabet and digits, commands such as CLEAR SCREEN, BACKSPACE, PRINT, ERASE MEMORY, DELETE WORD, RING BELL and VOICE, and directions at the bottom

About the program

"Computers can be a great boon to those who can communicate with the world via the keyboard. But what of those who are physically unable to type?" Bill Lukeroth, a technical writer from the San Francisco Bay Area, wrote Stickwriter when his father faced brain surgery and was warned that he might lose the use of his hands. In the end his father didn't need it, and Lukeroth offered it to Antic readers "in the hope that it will be useful to others". He suggested that a head harness or similar device could be built to stand in for the joystick for someone who couldn't use one.

The whole program is driven by one joystick and its button. The top of the screen holds a vocabulary of everyday words (I'M, HAPPY, DRINK, BATHROOM, MEDICINE, PLEASE, THANKS…), the alphabet and the digits. Below them are the commands, and below those a text window where the message builds up.

Typing it in

The listing is plain apart from the inverse first letters of the commands ({inv}…{/inv}: press the Atari key before and after). Those inverse letters are what the program looks for when you select a command. In line 920 the sixth "word" is deliberately a single blank space. The magazine printed TYPO II codes.

How to use it

Move the cursor to the first letter of a word and press the button. The word appears in the text window and the cursor jumps back to its home position. A space is added after each word, but not after single letters, so when you spell out a word, select the blank at the home position to finish it. Point at the middle of a word to get just the end of it: the "h" in THERE gives "here".

Commands (point at the inverse letter):

  • PRINT sends everything since the last ERASE MEMORY to the printer.
  • CLEAR SCREEN clears the text window but keeps the text in memory. ERASE MEMORY really clears it.
  • BACKSPACE and DELETE WORD remove the last character or word.
  • RING BELL sounds a ten-second siren "to summon help".
  • VOICE speaks the text through S.A.M. To use it, install the S.A.M. Handler first and remove the REM from line 840, which sends the text to the V: device.

To make your own vocabulary, edit the DATA in lines 870–940. Keep exactly 12 words per line, and adjust the column positions in line 880 so that the words don't overlap.

How it works

  • Reading the screen. When you press the button, line 560 uses LOCATE at the cursor position (read from locations 84 and 85) to find which character you're pointing at. As the article notes, LOCATE on the text screen has the side effect of erasing the character it reads, so line 600 prints it back.
  • Safety. Line 90 disables the BREAK key, line 170 disables the keyboard, and lines 950–1020 trap errors so that a mistaken press can't crash the program and leave the user stranded.
  • Line 180 hides the menu while it's drawn by setting the text colour to the background colour.

Changes from the published listing

One change, so the program also runs under Altirra BASIC, the free replacement BASIC built into many emulators. Altirra BASIC adds commands called ERR, MOVE, so it rejected the published lines that use those words as the start of a variable name. The variable is renamed everywhere in the program. The new name is the same length, so the memory layout is unchanged and the program behaves exactly as published on genuine Atari BASIC. If you type it in from the magazine, the original names work fine on a real Atari.

Published Now Lines
ERR ERX 960, 970, 990
MOVE MOVX 410, 420, 430, 470, 500, 510

Listing

10 REM STICK WRITER
20 REM BY BILL LUKEROTH
30 REM (c) 1985, ANTIC PUBLISHING
40 GOSUB 1030:REM SET UP PROGRAM
50 GOTO 170
60 STOP
70 POKE 752,1:RETURN :REM CURSOR OFF
80 POKE 752,0:RETURN :REM CURSOR ON
90 POKE 16,112:POKE 53774,112:RETURN :REM DISABLE BREAK KEY
100 POSITION 2,19:FOR L=1 TO 189:? " ";:NEXT L:RETURN :REM CLEAR SCREEN
110 IF LEN(MAIN$)<=1 THEN 130
120 MAIN$=MAIN$(1,LEN(MAIN$)-1)
130 RETURN
140 IF LEN(TEMP$)<=1 THEN 160
150 TEMP$=TEMP$(1,LEN(TEMP$)-1)
160 RETURN
170 GRAPHICS 0:GOSUB 90:OPEN #1,4,0,"K:"
180 GOSUB 70:POKE 709,PEEK(710):REM TURN OFF CURSOR, SET CHARACTER COLOR TO BACKGROUND COLOR
190 FOR L=1 TO 6:READ COL:ARY(L)=COL:NEXT L:REM PRINT WORD SCREEN
200 FOR L=1 TO 6
210 FOR L2=0 TO 11:READ WORD$:POSITION ARY(L),L2:? WORD$:NEXT L2
220 NEXT L
230 FOR L=65 TO 82:? CHR$(L);" ";:NEXT L:?
240 FOR L=83 TO 90:? CHR$(L);" ";:NEXT L
250 FOR L=48 TO 57:? CHR$(L);" ";:NEXT L:?
260 FOR L=1 TO 18:? PUNC$(L,L);" ";:NEXT L:?
270 ? "{inv}C{/inv}LEAR SCREEN  {inv}B{/inv}ACKSPACE    {inv}P{/inv}RINT"
280 ? "{inv}E{/inv}RASE MEMORY  {inv}D{/inv}ELETE WORD  {inv}R{/inv}ING BELL"
290 ? "{inv}V{/inv}OICE         {inv}Q{/inv}UIT"
300 FOR L=1 TO 38:? "{CTRL-R}";:NEXT L
310 ? "{inv}DIRECTIONS:use the joystick to move   the cursor to the desired word,then   press the joystick button.{/inv}"
320 ? "{inv}TO START:press the joystick button.{/inv}"
330 POKE 709,154:REM MAKE CHARACTERS VISIBLE
340 IF STRIG(0)=1 THEN 340
350 WORD=0
360 CLOSE #2:GOSUB 100:TEMP$="":FLAG1=0
370 POSITION 19,5:GOSUB 80:? " ";:REM JOYSTICK ROUTINE
380 OLDWORD=WORD:WORD=0:PAUSE=0:IF FLAG1=1 THEN 410
390 IF LEN(MAIN$)<4000-200 THEN 410
400 POKE 710,48:POSITION 2,18:? "{inv}MEMORY CRITICAL.ERASE,PRINT OR QUIT. {/inv}":POSITION 19,5:? " ";:FLAG1=1
410 MOVX=STICK(0):POKE 77,0:REM DISABLE ATTRACT MODE
420 IF MOVX=15 THEN 540
430 IF INT(MOVX/2)<>MOVX/2 THEN 470
440 IF PEEK(84)=0 THEN POKE 84,18
450 ? "{UP}";
460 GOTO 500
470 IF MOVX=11 OR MOVX=7 THEN 500
480 IF PEEK(84)=17 THEN POKE 84,23
490 ? "{DOWN}";
500 IF MOVX>8 AND MOVX<12 THEN ? "{LEFT}";
510 IF MOVX>4 AND MOVX<8 THEN ? "{RIGHT}";
520 PAUSE=PAUSE+1:IF PAUSE>16 THEN PAUSE=16
530 FOR L=0 TO PAUSE:NEXT L:REM SLOW DOWN CURSOR
540 IF STRIG(0)=0 THEN 560
550 GOTO 410
560 WORD=WORD+1:LOCATE PEEK(85),PEEK(84),P
570 PIX$=CHR$(P):IF P<123 THEN 680:REM CURSOR OVER INVERSE CHARACTER
580 SCRN$=CHR$(P-128)
590 IF LEN(MAIN$)=4000 THEN 410:REM MEMORY FULL, ACCEPT ERASE, PRINT OR QUIT
600 ? CHR$(126);:? SCRN$;:REM BACKSPACE, REPRINT LETTER
610 MAIN$(LEN(MAIN$)+1)=SCRN$
620 TEMP$(LEN(TEMP$)+1)=PIX$
630 IF SCRN$<>" " THEN 560
640 IF WORD=2 THEN GOSUB 110:GOSUB 140:GOTO 650:REM DELETE BLANK SPACE AFTER SINGLE LETTERS
650 IF LEN(TEMP$)>151 THEN TEMP$=TEMP$(LEN(TEMP$)-112,LEN(TEMP$)):GOSUB 100
660 POSITION 2,19:? TEMP$:REM PRINT WORD IN WINDOW
670 GOTO 370
680 IF PIX$="Q" THEN 860:REM COMMAND ROUTINE
690 IF PIX$="E" THEN MAIN$="":GOTO 360
700 IF PIX$<>"P" THEN 750
710 OPEN #2,8,0,"P:"
720 ? #2,MAIN$
730 CLOSE #2
740 GOTO 360
750 IF LEN(MAIN$)=4000 THEN 360
760 IF PIX$="C" THEN 360
770 IF PIX$<>"R" THEN 800
780 FOR XX=1 TO 8:SOUND 0,47,10,15:FOR YY=1 TO 75:NEXT YY:SOUND 0,64,10,15:FOR YY=1 TO 75:NEXT YY:NEXT XX
790 SOUND 0,0,0,0:GOTO 370
800 IF PIX$="B" THEN GOSUB 110:GOSUB 140:GOSUB 100:WORD=WORD-1:GOTO 660
810 IF PIX$<>"D" THEN 840
820 FOR L=1 TO OLDWORD:GOSUB 110:GOSUB 140:NEXT L
830 GOSUB 100:GOTO 660
840 REM POKE 8208,100:CLOSE#2:OPEN #2,8,0,"V:":?#2;MAIN$:CLOSE#2
850 GOTO 360
860 CLOSE #1:GRAPHICS 0:END
870 REM DATA FOR WORD SCREEN
880 DATA 2,8,13,19,23,30
890 DATA DID,HAVE,HOW,I'M,LET,THAT,WAS,WILL,WHO,WHAT,WHY,WHEN
900 DATA ALL,ARE,CAN,EAT,GET,HER,HIS,OUR,SEE,THE,YES,YOU
910 DATA COLD,FOOD,HOME,MUST,NEED,SEEN,SICK,PLAY,SOME,TOO,YOUR,WORK
920 DATA AM,AT,DO,HI,IS, ,IT,ME,MY,NO,TO,WE
930 DATA DRINK,HAPPY,LET'S,LOVE,ROOM,SLEEP,TELL,THERE,THEIR,THINK,TIME,WHERE
940 DATA BATHROOM,DOES,GO,GOING,GOOD,HOT,MEDICINE,NOT,NOW,PLEASE,THANKS,THIS
950 ? CHR$(253);:GOSUB 100:REM ERRORS
960 ERX=PEEK(195):ERRLN=PEEK(187)*256+PEEK(186)
970 IF ERX<>138 THEN 990
980 POSITION 2,19:? "{inv}PRINTER ERROR.CHECK PRINTER AND CABLE.{/inv}":GOTO 1000
990 POSITION 2,19:? "{inv}ERROR {/inv}";ERX;"{inv} AT LINE {/inv}";ERRLN
1000 ? "{inv}PRESS JOYSTICK BUTTON TO CONTINUE.{/inv}"
1010 IF STRIG(0)=1 THEN 1010
1020 CLOSE #2:TRAP 950:GOSUB 100:GOTO 660
1030 TRAP 950
1040 DIM WORD$(8),MAIN$(4000),PUNC$(18),ARY(6),PIX$(1),SCRN$(1),TEMP$(175)
1050 PUNC$=",;:.!?'#()&$%*+-/="
1060 GRAPHICS 2+16:POKE 708,0:POKE 710,132:POKE 712,30:POKE 65,0:POKE 731,1
1070 ? #6:? #6;"   {inv}STICK{/inv} {inv}WRITER{/inv}":? #6:? #6:? #6
1080 ? #6;"        BY":? #6:? #6:? #6;"   BILL LUKEROTH"
1090 FOR TITLE=1 TO 30:IF STRIG(0)=0 THEN POP :GOTO 1140
1100 FOR L0=1 TO 50:NEXT L0:IF S=0 THEN S=10:GOTO 1120
1110 S=0
1120 SETCOLOR 2,8,S
1130 NEXT TITLE
1140 RETURN

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: STIKWRIT.BAS.

Credits