TypaLot

Developer(s): William J. Pedersen
Date: 1984
Type: Program
Platform(s): TS 2068

TypaLot is a word processor that keeps text in a string array of 64-character lines. You write new text, list it, edit lines, wipe them, file the text to tape and load it back, and print it. Commands are single letters (Help, List, Load, File, Print, Wipe and others), and alternative keys such as the keyword keys LIST, LOAD and SAVE work too. Help pages explain each command.

Two versions are on the tape. The base TypaLot (©1984 The WIDJUP Co., by William J. Pedersen) loads a 768-byte rotated character set, Chars.CW, used for printing. TypaLot J1 (©1986) adds a printer-interface front end and loads a 2,048-byte block of characters and machine code, C&M/L.CJ. The J1 BASIC can also save and load long texts as a series of 16-line array files.

The BASIC programs came from TTSUC library disk L-43, a collection of Pedersen’s WIDJUP programs. The code files did not read from that disk and were taken from the WIDJUP issue of the UPDATE magazine disk. Two more variants on the L-43 disk, TypaLot GB and TypaLot C, are not included because their code files are missing.

Program Analysis

Structure

Both programs start at line 4008, which loads the code block and then shows the start-up screen. The text lives in Z$(); lines 5000–5009 of the base program can regenerate the rotated character set from the ROM font, writing it to 59904.

Notable Techniques

  • The rotated character set is built by reading each ROM character bit by bit into an 8×8 array and POKEing the rotated bytes.
  • TypaLot J1 uses variables such as z0, one and two in place of numeric literals to save memory.
  • J1’s line 7777 onward calculates window settings for the printer interface and prints the matching command string and POKEs.

Both programs came from a Larken disk and were converted to load from tape: the disk prefixes were removed from the save and code-load lines. They were tested in ZEsarUX: the start-up and help screens of both versions work.

Related Products

Word processing for the Gorilla Banana printer.
Word processing for the Olivetti PR2300 printer.
Word processor. Prints sideways on 2040 printer for 64-column format. Max file size is 320 lines.

Related Content

Image Gallery

Source Code

    1 ON ERR GO TO 500: GO TO e
  500 ON ERR RESET 
 1000 REM  TypaLot 
 1001 POKE 23607,60: LET Ln=1: LET Add=1021: LET List=1023: LET File=1026: LET Load=1037: LET Print=1043: LET Insert=1053: LET Delete=1055: LET Wipe=1057: LET Help=2079: LET Edit=1091: LET Copy=1096: LET Key=1098: LET Save=4000
 1002 LET J=Load: LET A=Add: LET L=List: LET K=L: LET F=File: LET S=F: LET P=Print: LET I=Insert: LET D=Delete: LET W=Wipe: LET X=W: LET H=Help: LET E=Edit: LET Z=Copy
 1003 CLS : PRINT ''"  TypaLot  is a word processing program for the TIMEX 2068/2040 computer/printer combination"''" You may write new text, then   file it and/or print it."''" You may load an existing file, update it, re-file and/or print it."''" Files are stored on tape."
 1004 PRINT ''" Do you wish to load an existingfile?": INPUT " Yes or No: ";W$: IF LEN W$ THEN IF W$(1)="Y" OR W$(1)="y" THEN GO TO Load
 1005 CLS : PRINT '" This program prints from a longstring array with several diff- erent options.  Three lines are required at the bottom of the   screen for 64 wide input."
 1006 PRINT '" The remaining 21 lines are     available for text, control and mapping.  Line numbers require  a line to themselves, perhaps   sharing it with status messages."''" You can enter 64 characters perline.  Double quotes are not re-quired.  Control characters can-not be used. Inverse won't work."''" UDG and graphics work but are  not rotated when printed.": GO SUB Key
 1007 PAUSE 0: CLS : PRINT " This word processing program isa simple one.  It does not have many of the features you would  expect of those running printersother than the TIMEX 2040."
 1008 PRINT '" It  prints out sideways on the 2040.  This allows you to print full width sub-pages of sixteen double spaced lines or thirty   two single spaced less readable lines."
 1009 PRINT '" Except for underlining, you cando everything you can do with a typewriter and a lot more."'" You can write, edit, and file  letters and other text records  for immediate printing and/or   recall at a later date.": GO SUB Key
 1010 PAUSE 0: CLS : PRINT '" There is no manual needed for  you to learn how to use this    word processer.  Normal, famil- iar BASIC commands are all that are required.  A HELP screen is provided.  Use  GOTO Help  to   see what services are available if you need a reminder."
 1011 PRINT FLASH 1;" There is one thing you will    need to remember without HELP.", FLASH 0'" To exit the writing routine, itis necessary to press CAPS SHIFTand 6 (down cursor) together."'" This is the only BREAK that    works when INPUT LINE has been  used to suppress the quote marksaround input and eliminate the  need to use double quotes in thetext input.": GO SUB Key: PAUSE 0
 1012 CLS : PRINT '" Up to 320 lines of 64 printablecharacters(including blanks) canbe accommodated; but if you do  not use them, the stored files  will be too large because they  contain lots of blank space."
 1013 PRINT '" This doesn't hurt if you have  tape and time to spare, but use fewer lines if you know how longyour text will be, but don't be too stingy."''" To center text, merely enter itand then input spaces in front  of it until it is split evenly  in two edit lines.": LET Lines=320
 1014 INPUT "320 line file? Yes or No:";W$: IF LEN W$ THEN IF W$(1)="N" OR W$(1)="n" THEN PRINT '" You have chosen to define your own file size.": GO TO 1016
 1015 PRINT '" The default file size applies.": GO TO 1018
 1016 ON ERR GO TO 1016: INPUT "How many lines? ";Lines: IF Lines>320 THEN PRINT '" More than 320 lines cannot be  assigned.  320 lines is assumed.": LET Lines=320
 1017 IF Lines<64 THEN PRINT '" Less than 64 lines is not wise.64 lines is assumed.": LET Lines=64
 1018 LET Lines=32*(1+INT ((Lines-1)/32)): PRINT '" Your file size is ";Lines;" lines."
 1019 ON ERR RESET : PAUSE 300
 1020 DIM Z$(Lines+1,64): LET Z$(1,1)="`": LET Ln=2: CLS : PRINT AT 9,0;"  Start entering your text, up   to 64 characters per line."''" (Use down cursor to exit.)"''"LINE"
 1021 REM  Add, A(NEW) 
 1022 LET B=6+Ln-2*INT (Ln/2): PRINT PAPER B;Ln-1;"  WARNING! Last line.             Edit before using." AND Ln=Lines+1,,: ON ERR GO TO 1065: INPUT LINE Z$(Ln): ON ERR RESET : PRINT PAPER B;Z$(Ln): LET Ln=Ln+1: GO TO A
 1023 REM  List, L(LIST) 
 1024 POKE 23607,60: INPUT "Show from what line? ";B
 1025 CLS : FOR u=B+1 TO Ln-1: PRINT PAPER 6+u-2*INT (u/2);u-1,,Z$(u): NEXT u: GO TO A
 1026 REM  File, F, S(SAVE) 
 1027 CLS : PRINT '"  Your text file will be stored  after you give it a name."'"  The name you use need not be   restricted to alpha-numeric     characters.  All special char-  acters are permitted, such as   ] # & / * ` etc., and embedded  blanks.  A maximum length of    ten characters is permitted."
 1028 PRINT '"  Confidential files can be"'" encrypted, but you will have    to add your own code/decode"'" routines."''"  Each file is labeled with the  name, length, and lines used."'"  You might add encryption key,  class code, etc. to the label.": GO SUB Key
 1029 PAUSE 0: CLS : PRINT '''"  Check your program locator to  be sure you do not overwrite    any other records."''"  Write down the name you give   it and the starting and ending  locations.  Always allow a few  seconds between records."
 1030 IF Z$(1,1)="`" THEN INPUT "FILE CREATION DATE? "; LINE D$: LET Z$(1)="": LET Z$(1,20 TO 32)=D$: INPUT "Your FILENAME? "; LINE X$: LET X$=X$+"          ": LET X$=X$( TO 10): LET Z$(1, TO 10)=X$
 1031 LET Z$(1,15-LEN STR$ (Ln-2) TO 18)=STR$ (Ln-2)+"/"+STR$ Lines
 1032 CLS : PRINT AT 11,0;"SAVING FILENAME ";X$'',"DATE ";D$
 1033 PRINT ,"FILESIZE=";Lines',Ln-2;" lines used."
 1034 SAVE  X$ DATA Z$(): PRINT ''Z$(1);" has been filed.": PAUSE 360: GO TO H
 1037 REM  Load 
 1038 CLS : PRINT ''"  Position the tape to desired   file.  Start tape and press     any key."''"  If file not found, BREAK and   GO TO Help.": PAUSE 0: PRINT ''"  File is being loaded.": DIM Z$(1): LOAD "" DATA Z$()
 1039 GO SUB 1060: PRINT AT 19,3; FLASH 1;" STOP RECORDER "
 1040 ON ERR GO TO 1042
 1041 LET X$=Z$(1, TO 10): LET Ln=VAL Z$(1,12 TO 14)+2: LET Lines=VAL Z$(1,16 TO 18)
 1042 ON ERR RESET : PAUSE 360: LET B=0: GO TO K+2
 1043 REM  Print, P(PRINT) 
 1044 POKE 23607,60: LET B=INT ((Ln+13)/16): LET W1=INT ((Ln+29)/32)
 1045 CLS : PRINT '"  Double line spacing generates  ";B;" subsheet"+("s" AND B>1);" of output; single"'" spacing ";W1;"."''"  Each subsheet is 32 lines of   64 characters, between columns  of colons which mark the edges  of a standard 8 1/2 x 11 inch   sheet of letter paper."  
 1046 PRINT '"  The 2040 normally prints 10    characters and 8 lines/inch.    In this case, it effectively    prints 8 characters and 10      lines/inch."''"  Three subsheets gives 48/96    lines of text, nicely filling   one full letter page.": GO SUB Key
 1047 PAUSE 0: CLS : LET Step=16: PRINT AT 12,2;"Though it is not recommended,  do you want single spacing?": INPUT "Yes or No: "; LINE W$: IF LEN W$ THEN IF W$="Y" OR W$="y" THEN LET B=W1: LET Step=32
 1048 LPRINT Z$(1): POKE 23607,233
 1049 FOR u=0 TO Step*(B-1) STEP Step: LPRINT ":::::::::::::::::::::::::::::::: "'
 1050 FOR v=1 TO 64: LET H$=""
 1051 FOR g=Step+1 TO 2 STEP -1: LET H$=H$+(" " AND Step=16)+Z$(u+g,v): NEXT g: LPRINT H$: NEXT v: LPRINT '': NEXT u: LPRINT "::::::::::::::::::::::::::::::::"''''
 1052 POKE 23607,60: CLS : PRINT '''''"Job Complete.": STOP : GO TO 1048
 1053 REM  Insert, I(IN) 
 1054 INPUT "Insert after line? ";u: FOR v=Ln+1 TO u+2 STEP -1: LET Z$(v+1)=Z$(v): NEXT v: LET Z$(u+2)="": LET Ln=Ln+1: GO TO 1095
 1055 REM  Delete, D 
 1056 INPUT "Delete line? ";u: FOR v=u+2 TO Ln+2: LET Z$(v-1)=Z$(v): NEXT v: LET Ln=Ln-1: LET u=u-1: GO TO 1095
 1057 REM  Clear, C, X(CLEAR) 
 1058 CLS : PRINT AT 10,0;" You have called for starting   over.  Just in case you didn't  intend to, this verification hasbeen provided."''" Press  CONT  and  ENTER  to    verify."
 1059 STOP : LET Ln=1: DIM Z$(64,64): CLS : GO TO 1003
 1060 REM  File label recovery 
 1061 PRINT INK 2'"Filename: ";Z$(1, TO 10)'"Creation date: ";Z$(1,20 TO 32)'"Lines used/File size = ";Z$(1,12 TO 19)
 1064 RETURN 
 1065 IF PEEK 23739=3 THEN PRINT #1;"To continue, store this file andcreate another.  Press any key, then CONT to file.": ON ERR RESET : PAUSE 0: STOP : GO TO f
 1066 ON ERR RESET : STOP : GO TO h
 1091 REM  Edit, E 
 1092 INPUT "Edit Which Line? ";u
 1093 PRINT INK 2;u,,Z$(u+1): INPUT LINE Z$(u+1)
 1094 PRINT PAPER (6+u-2*INT (u/2));u,,Z$(u+1): INPUT "Edit Another Line?"'" Yes or No: "; LINE W$: IF LEN W$ THEN IF W$="Y" OR W$="y" THEN GO TO E
 1095 LET B=u-(4 AND u>=4): GO TO K+2
 1096 REM  Copy, C, Z(COPY) 
 1097 FOR u=1 TO Ln: LPRINT Z$(u): NEXT u: STOP 
 1098 REM  $ Key 
 1099 PRINT AT 21,5;" Press any key. ": RETURN 
 2079 REM  Help, H 
 2080 CLS : POKE 23607,60: PRINT '" HELP    page  1 "''" The available services are: "''"Help   This service",''"List   Display any part of text",''"Load   Load a new text file from cassette tape",,''"File   Save your named and dated text file to cassette tape",
 2081 PRINT ''"Print  Print text file to TIMEX  sinclair 2040 printer",''"Wipe   Erase and start over",: GO SUB Key
 2083 PAUSE 0: CLS : PRINT '" HELP    page  2 "''" Available services (Cont) "'
 2084 PRINT '"Insert Insert a blank line",''"Delete Delete any line",''"Edit   Revise any lines",''"Add    Continue writing",'
 2085 PRINT ''" Operations: "''" To use any of these services:"''"    GOTO  (Service)  ENTER ": GO SUB Key
 2086 PAUSE 0: CLS : PRINT '" HELP    page  3 "''" Operations (Cont) "''" Operations can only be called  when the program is halted.     This may require breaking out ofprogram execution."' FLASH 1'" When writing, the only BREAK   that works is:  CAPS SHIFT   6  (down cursor).  Remember this!",'
 2087 PRINT '" Do not use inverse video nor   color commands, when writing."''" To exit this HELP service, use  CAPS SHIFT   BREAK  ."
 2088 GO SUB Key
 2089 PAUSE 0: CLS : PRINT '" HELP    page  4 "''"WIDJUP Cassette"'"T50WDS84B TypaLot     $12.50"''"*1984 The WIDJUP Co."'"By William J. Pedersen"'"All rights reserved."
 2090 PRINT '"Conveniences: Alternate keying."'" Help   or H"'" List   or L or K(LIST)"'" Load        or J(LOAD)"'" File   or F or S(SAVE)"'" Print       or P(PRINT)"'" Wipe   or W or X(CLEAR)"'" Insert or I"'" Delete or D"'" Edit   or E or 1(EDIT)"'" Add    or A"
 2091 GO SUB Key: PAUSE 0: GO TO H
 4000 REM  Save 
 4001 CLS : PRINT AT 5,5; FLASH 1;" SAVING ""TypaLot"" "
 4002 DIM Z$(2,64): LET Ln=2
 4004 SAVE "TypaL.BW" LINE 4008
 4005 PRINT AT 5,0; OVER 1; FLASH 0,,AT 7,5; FLASH 1;" SAVING "" Characters "" ": SAVE "Chars.CW" CODE 59904,768
 4006 PRINT AT 7,0; OVER 1; FLASH 0,,AT 9,5;" Program has been saved.";AT 14,8; FLASH 1;" STOP RECORDER "
 4007 STOP : GO TO Save
 4008 REM  Load Characters 
 4009 PRINT '""" Characters "" are being loaded."
 4010 LOAD "Chars.CW" CODE 59904,768
 4011 PRINT AT 14,8; FLASH 1;" STOP RECORDER ": GO SUB Key: PAUSE 0: GO TO 1000
 5000 REM  Generate Characters 
 5001 PAPER 7: INK 0: BORDER 4: CLS : PRINT '" The rotated character set is   being generated."''"  Please stand by."''
 5002 FOR u=0 TO 95: DIM Z(8,8)
 5003 FOR v=0 TO 7: LET Byte=PEEK (8*u+v+15616)
 5004 FOR g=0 TO 7: LET B=INT (Byte/2)
 5005 IF Byte>2*B THEN LET z(8-g,8-v)=1
 5006 LET Byte=B: NEXT g: NEXT v
 5007 PRINT PAPER 5;CHR$ (32+u)+" ";: FOR g=1 TO 8: LET B=0: FOR q=1 TO 8: LET B=2*B+z(g,q): NEXT q: POKE 8*u+g+59903,B: NEXT g
 5008 NEXT u
 5009 POKE 23607,233: PRINT ': FOR v=32 TO 127: PRINT CHR$ v+" ";: NEXT v: POKE 23607,60: STOP

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.