⍝ # TITORPOINT VISUAL TEXT DISPLAY SYSTEM
⍝
⍝ TITORPOINT IS A SIMPLE INTERACTIVE SYSTEM FOR DISPLAYING AND
⍝ EDITING SCREENS OF TEXT. (THINK LESS AND ED ON UNIX SYSTEMS,
⍝ BUT WITH TITORPOINT YOU EDIT EACH SCREEN SEPARATELY.)
⍝
⍝ TITORPOINT HAS BEEN DESIGNED FOR USE WITH IBM 5100 PORTABLE
⍝ COMPUTERS EQUIPPED WITH APL LANGUAGE SUPPORT AND AT LEAST
⍝ 32 KB OF RAM. THE IBM 5100 HAS A 64×16 DISPLAY, BUT OWING TO
⍝ LIMITATIONS ON HOW YOU CAN PRINT TEXT IN APL, TITORPOINT
⍝ TRADES IN 64×15 TEXT SCREENS.
⍝
⍝ ## INSTALLATION
⍝
⍝ TO LOAD TITORPOINT INTO YOUR IBM 5100 (RUNNING APL), TYPE IN
⍝ THE REMAINDER OF THIS FILE BY HAND, SUBSTITUTING UNDERLINED
⍝ CHARACTERS FOR ANY lowercase LETTERS YOU ENCOUNTER. (THE IBM
⍝ 5100 HAS NO LOWERCASE LATIN CHARACTERS, AS YOU MAY HAVE
⍝ GUESSED BY THE ENTHUSIASM OF THIS DOCUMENTATION; MEANWHILE,
⍝ UNICODE LACKS SINGLE-CODEPOINT UNDERLINED CHARACTERS.)
⍝
⍝ ALTERNATIVELY, EMAIL [email protected] FOR INSTRUCTIONS ON
⍝ WHERE TO SEND A DC 300 TAPE CARTRIDGE WITH RETURN POSTAGE. A
⍝ DC 6150 CARTRIDGE MAY ALSO WORK. TAPE CARTRIDGES MUST BE IN
⍝ GOOD WORKING CONDITION.
⍝
⍝ ## USAGE
⍝
⍝ TO START TITORPOINT, RUN 'PRESO'. IF YOU HAVE ALREADY CREATED
⍝ TEXT SCREENS IN YOUR WORKSPACE, TITORPOINT WILL RESUME
⍝ WORKING WITH THOSE. OTHERWISE TITORPOINT WILL INITIALISE
⍝ ITSELF WITH A SINGLE BLANK SCREEN.
⍝
⍝ TITORPOINT STARTS IN DISPLAY MODE, WHERE IT PAGES THROUGH
⍝ EXISTING SCREENS OF TEXT. AFTER EACH SCREEN, PRESS EXECUTE TO
⍝ MOVE TO THE NEXT SCREEN, OR TYPE ← AND PRESS EXECUTE TO MOVE
⍝ TO THE PREVIOUS ONE. OTHER COMMAND CHARACTERS AVAILABLE ARE:
⍝
⍝ - D: RE-DISPLAY THE CURRENT SCREEN.
⍝ - #: SHOW THE CURRENT SCREEN NUMBER.
⍝ - J: JUMP TO A DIFFERENT SCREEN NUMBER.
⍝ - e: EDIT THE CURRENT SCREEN.
⍝ - d: DELETE THE CURRENT SCREEN.
⍝ - i: INSERT A BLANK SCREEN BEFORE THE CURRENT SCREEN.
⍝ - a: INSERT A BLANK SCREEN AFTER THE CURRENT SCREEN.
⍝ - Q: QUIT TITORPOINT.
⍝ - q: QUIT TITORPOINT AND CLEAN UP TEMPORARY VARIABLES.
⍝ - ?: LIST COMMAND CHARACTERS.
⍝
⍝ NOTE THAT QUITTING TITORPOINT WITH Q MEANS THAT WHEN YOU
⍝ RESTART TITORPOINT, IT WILL RESUME WORKING IN THE SAME PLACE
⍝ WHERE YOU LEFT OFF. IF YOU QUIT WITH q, TITORPOINT WILL
⍝ RESUME AT SCREEN 1.
⍝
⍝ THE e COMMAND PLACES TITORPOINT INTO EDIT MODE FOR THE,
⍝ CURRENT TEXT SCREEN, WHICH GREETS YOU WITH A '>:' PROMPT.
⍝ HERE YOU ENTER A COMMAND CHARACTER FOLLOWED OPTIONALLY BY
⍝ NUMBERS IDENTIFYING THE ROWS (OR COLUMNS) TO WHICH THE
⍝ COMMAND APPLIES, COUNTING UP FROM 1. WITHOUT NUMBERS, THE
⍝ COMMAND IS ASSUMED TO APPLY TO ALL ROWS (OR COLUMNS). COMMAND
⍝ CHARACTERS ARE:
⍝
⍝ - P: PRINT SPECIFIED LINES.
⍝ - E: EDIT SPECIFIED LINES, ONE BY ONE. WHEN YOU EDIT A
⍝ LINE, ITS ORIGINAL CONTENTS ARE PRINTED ABOVE THE APL
⍝ EDIT AREA, SO YOU CAN USE THE KEYPAD ARROWS TO BRING
⍝ THOSE CONTENTS DOWN TO THE EDIT AREA AND CHANGE THEM.
⍝ ENTER A COMPLETELY EMPTY LINE TO CANCEL THIS COMMAND.
⍝ - C: COPY A LINE. REQUIRES YOU TO SPECIFY AT LEAST TWO LINE
⍝ NUMBERS. TEXT FROM THE FIRST LINE YOU SPECIFY WILL BE
⍝ COPIED TO ALL SPECIFIED LINES. BEWARE THAT SPECIFYING
⍝ NO LINE NUMBERS IS THE SAME AS SPECIFYING LINE NUMBERS
⍝ 1, 2, 3... 15.
⍝ - R: ROLL TEXT IN SPECIFIED LINES. WILL QUERY YOU FOR HOW
⍝ MANY COLUMNS YOU'D LIKE TO ROLL THE TEXT.
⍝ - Z: CLEAR ALL TEXT IN SPECIFIED LINES. BEWARE THAT
⍝ SPECIFYING NO LINE NUMBERS IS THE SAME AS SPECIFYING
⍝ ALL LINE NUMBERS!
⍝ - c: LIKE C, BUT OPERATES ON COLUMNS.
⍝ - r: LIKE R, BUT OPERATES ON COLUMNS.
⍝ - z: LIKE Z, BUT OPERATES ON COLUMNS.
⍝ - B: DRAW A CHARACTER-ART BOX. ANY ARGUMENTS ARE IGNORED.
⍝ - G: LIKE P, BUT BEFORE PRINTING, THE SCREEN TEXT IS
⍝ SUPERIMPOSED ON A GRID WITH LINES ON EVERY FIFTH ROW
⍝ AND COLUMN.
⍝ - Q: LEAVE EDIT MODE. NOTE THAT THE IBM 5100 WILL TAKE
⍝ AROUND A MINUTE FOR DISPLAY MODE TO BE READY AGAIN.
⍝ - ?: LIST COMMAND CHARACTERS.
⍝
⍝ ## THEORY OF OPERATION
⍝
⍝ TITORPOINT STORES SCREEN DATA AS PAIRS OF VARIABLES WITHIN
⍝ THE CURRENT WORKSPACE. THE FIRST SCREEN IS KEPT IN VARIABLES
⍝ I1 AND T1, THE SECOND IN I2 AND T2, AND SO ON. EACH PAIR
⍝ INTENDS TO BE A LIGHTLY COMPRESSED REPRESENTATION OF THE
⍝ SCREEN: FOR SCREEN ×, T× IS ALL OF THE TEXT DATA WITH LONG
⍝ RUNS OF SPACES OMITTED, AND I× INDICATES WHERE PORTIONS OF
⍝ THE TEXT DATA APPEARS IN THE UNCOMPRESSED SCREEN.
⍝
⍝ TITORPOINT KEEPS TEMPORARY STATE IN THREE GLOBAL VARIABLES:
⍝
⍝ - n: THE TOTAL NUMBER OF SCREENS IN THE WORKSPACE.
⍝ - k: THE NUMBER OF THE CURRENT SCREEN.
⍝ - t: A 3×960 TEXT ARRAY; T[1;] IS THE UNCOMPRESSED TEXT OF
⍝ SCREEN k-1, T[2;] IS THE TEXT OF SCREEN k, and T[3;]
⍝ IS THE TEXT OF SCREEN k+1. ADJACENT SCREENS ARE
⍝ 'PRE-DECOMPRESSED' IN THIS WAY FOR A BETTER PAGING
⍝ EXPERIENCE.
⍝
⍝ ## NOBODY OWNS TITORPOINT
⍝
⍝ THIS PROGRAM AND ANY SUPPORTING PROGRAMS, SOFTWARE LIBRARIES,
⍝ AND DOCUMENTATION DISTRIBUTED ALONGSIDE IT ARE RELEASED INTO
⍝ THE PUBLIC DOMAIN WITHOUT ANY WARRANTY. SEE THE LICENSE FILE
⍝ FOR DETAILS.
⍝
⍝ ## ACKNOWLEDGEMENTS
⍝
⍝ GRATEFUL THANKS TO
⍝
⍝ - BITSAVERS.ORG AS USUAL, FOR ARCHIVED IBM 5100 TECHNICAL
⍝ DOCUMENTATION.
⍝ - YOUTUBE USER 'CONVERGENT MIGHTYFRAME', FOR VIDEOS ON HOW
⍝ TO REFURBISH DC 300 TAPE CARTRIDGES.
⍝
⍝ ## WHO, WHERE, WHEN
⍝
⍝ TOM STEPLETON, LONDON, 2019-10-26
∇ PRESO
[1] ⍝ TITORPOINT DISPLAY SYSTEM
[2] prINI 'PATIENCE...'
[3] UI1:⎕←(⍕k),'/',⍕n
[4] ⍞←t[2;]
[5] UI2:→UI2+'D# ←Jedia?Qq'⍳¯1↑' ',⍞
[6] →UI1
[7] →UI2,0⍴⎕←(⍕k),'/',⍕n
[8] →UI2,0⍴prGO 1,0⍴⍞←t[3;],0⍴⎕←(⍕n⌊k+1),'/',⍕n
[9] →UI2,0⍴prGO ¯1,0⍴⍞←t[1;],0⍴⎕←(⍕1⌈k-1),'/',⍕n
[10] →UI2,0⍴⎕←(⍕prINI k←1⌈n⌊⎕,0⍴⎕←'PAGE?'),'/',⍕n
[11] →UI1,0⍴k iS t[2;]←EDIT t[2;]
[12] →UI2,0⍴⎕←(⍕k),'/',⍕n←prINI n prDEL k
[13] →UI2,0⍴⎕←(⍕k),'/',⍕n←prINI n prINS k
[14] →UI2,0⍴⎕←(⍕k),'/',⍕n←prINI n prINS k←k+1
[15] →UI2,0⍴(⎕←''),⍞←prHLP
[16] →0
[17] →0,0⍴⎕EX 3 1 ⍴'nkt'
[18] →UI2,0⍴⎕←'NO.'
∇
∇ T←EDIT TIN;C;A;a
[1] ⍝ TITORPOINT PAGE EDITOR
[2] T← 15 64⍴TIN[⍳960⌊⍴TIN],(0⌈960-⍴TIN)⍴' '
[3] UI:⍞←'>:'
[4] C←2↓⍞
[5] →UI×⍳0=⍴C
[6] A←15 edI 1↓C
[7] a←64 edI 1↓C
[8] →JMP+'PECRZcrzBG?Q'⍳1↑C
[9] JMP:
[10] →UI,0⍴T←T edPRT A
[11] →UI,0⍴T←T edEDT A
[12] →UI,0⍴T←T edCPY A
[13] →UI,0⍴T←T edROL A
[14] →UI,0⍴T←T edZAP A
[15] →UI,0⍴T←⍉(⍉T) edCPY A
[16] →UI,0⍴T←⍉(⍉T) edROL A
[17] →UI,0⍴T←⍉(⍉T) edZAP A
[18] →UI,0⍴T←edBOX T
[19] →UI,0⍴T←T edGPT A
[20] →UI,0⍴(⎕←''),⍞←edHLP
[21] →DONE
[22] →UI
[23] DONE:T←,T
∇
∇ M←N prDEL L
[1] ⍝ FOR PRESO: DELETE PAGE K
[2] M←N
[3] MOV:→OUT×⍳M≥N
[4] ⍎'I',(⍕M),'←I',⍕M+1
[5] ⍎'T',(⍕M),'←T',⍕M+1
[6] M←M+1
[7] →MOV
[8] OUT:M←N-1
[9] K←⎕EX 'I',⍕N
[10] K←⎕EX 'T',⍕N
∇
∇ T←prEXP K
[1] ⍝ FOR PRESO: eXPANDO PAGE K
[2] T←960⍴' '
[3] →0×⍳n<1
[4] K←1⌈n⌊K
[5] T←⍎'I',(⍕K),' eXPANDO T',⍕K
∇
∇ K←prGO D
[1] ⍝ FOR PRESO: PAGE FORWARD (D>0) OR BACK (D<0)
[2] K←k+D
[3] →0×⍳0=D←×D
[4] →0×⍳(1>K)∨n<K
[5] k←K
[6] t←D⊖t
[7] t[2+D;]←prEXP k+D
∇
∇ o←prINI O
[1] ⍝ FOR PRESO: INITIALISE GLOBAL STATE IF NEEDED
[2] o←O
[3] A:→B×⍳1⌊n←prNUM
[4] prNEW n←1
[5] B:→C×⍳2=⎕NC 'k'
[6] k←1
[7] C:k←1⌈k←n⌊(,k)[1]
[8] t← 3 960 ⍴(prEXP k-1),(prEXP k),prEXP k+1
∇
∇ M←N prINS K
[1] ⍝ FOR PRESO: INSERT A PAGE BEFORE PAGE K
[2] M←N
[3] MOV:→OUT×⍳M<K
[4] ⍎'I',(⍕M+1),'←I',⍕M
[5] ⍎'T',(⍕M+1),'←T',⍕M
[6] M←M-1
[7] →MOV
[8] OUT:M←N+1
[9] prNEW K
∇
∇ prNEW K
[1] ⍝ FOR PRESO: CREATE/CLEAR PAGE K
[2] ⍎'I',(⍕K),'←2 0⍴0'
[3] ⍎'T',(⍕K),'←0⍴'''''
∇
∇ prNUM K
[1] ⍝ FOR PRESO: COUNT HOW MANY PAGES ARE DEFINED
[2] N←⎕IO-1
[3] INC:N←N+1
[4] →INC×⍳1⌊⎕NC 'I',⍕N
[5] N←N-1
∇
∇ N prSWP K;T;I
[1] ⍝ FOR PRESO: SWAP PAGES N AND K
[2] N←⍕N
[3] K←⍕K
[4] T←⍎'T',K
[5] I←⍎'I',K
[6] ⍎'T',K,'←T',N
[7] ⍎'I',K,'←I',N
[8] ⍎'T',N,'←T'
[9] ⍎'I',N,'←I'
∇
∇ T←edBOX TIN;TL;BR;C;CQ
[1] ⍝ FOR EDIT: DRAW A BOX WITH A USER-SPECIFIED SHAPE
[2] T←TIN
[3] UI:⎕←'TOP LEFT CORNER? (ROWS,COLS)'
[4] TL←qUERYRC
[5] ⎕←'BOTTOM RIGHT CORNER? (ROWS,COLS)'
[6] BR←qUERYRC
[7] →UI×⍳∨/BR<TL
[8] C←'¯∣_∣∣∣∣∣'
[9] ⎕←'BOX CHARACTERS? (TOP,RIGHT,BOTTOM,LEFT,TL,TR,BR,BL)'
[10] ⍞←C
[11] CQ←⍞
[12] C[⍳8⌊⍴CQ]←CQ[⍳8⌊⍴CQ]
[13] T[TL[1];TL[2]+0,⍳BR[2]-TL[2]]←C[1]
[14] T[TL[1]+0,⍳BR[1]-TL[1];BR[2]]←C[2]
[15] T[BR[1];TL[2]+0,⍳BR[2]-TL[2]]←C[3]
[16] T[TL[1]+0,⍳BR[1]-TL[1];TL[2]]←C[4]
[17] T[TL[1];TL[2]]←C[5]
[18] T[TL[1];BR[2]]←C[6]
[19] T[BR[1];BR[2]]←C[7]
[20] T[BR[1];TL[2]]←C[8]
∇
∇ T←TIN edCPY I
[1] ⍝ FOR EDIT: COPY LINE 1↑I to LINES 1↓I
[2] T←TIN
[3] →0×⍳2>⍴I
[4] T[1↓I;]←((¯1+⍴I),1↓⍴T)⍴T[1↑I;]
∇
∇ T←TIN edEDT I;K;IN
[1] ⍝ FOR EDIT: EDIT SPECIFIED LINES I
[2] K←0
[3] T←TIN
[4] LOOP:→0×⍳(⍴I)<K←K+1
[5] ⎕←T[I[K];]
[6] IN←⍞
[7] →0×⍳0=⍴IN
[8] T[I[K];]←IN[⍳64⌊⍴IN],(0⌈64-⍴IN)⍴' '
[9] →LOOP
∇
∇ T←TIN edGPT I;MAV
[1] ⍝ FOR EDIT: PRINT SPECIFIED LINES I ON A 5×5 GRID
[2] T←TIN
[3] MAV←⎕AV
[4] MAV[MAV⍳' ']←'∘'
[5] MAV[¯1+(⍳26)+MAV⍳'A']←⎕AV[¯1+(⍳26)+⎕AV⍳'A']
[6] TIN[5 10 ;]←MAV[⎕AV⍳TIN[5 10 ;]]
[7] TIN[;5×⍳12]←MAV[⎕AV⍳TIN[;5×⍳12]]
[8] MAV←TIN edPRT I
∇
∇ J←K edI I
[1] ⍝ FOR EDIT: COMMAND ARGUMENTS TO NUMBERS; EMPTY MEANS ⍳K
[2] J←1⌈K⌊((-K)×K≠⍴I←⍎I,',⍳K')↓I
∇
∇ T←TIN edPRT I
[1] ⍝ FOR EDIT: PRINT SPECIFIED LINES I
[2] ⍞←(T←TIN)[I;]
[3] →0×⍳15>⍴I
[4] I←⍞
∇
∇ T←TIN edROL I;R
[1] ⍝ FOR EDIT: ROLL LINES I TO QUERIED SPECIFICATIONS
[2] T←TIN
[3] UI:⎕←'HOW FAR TO ROLL ',(⍕⍴I),' ROWS/COLS?'
[4] →UI×⍳∼(⍴R←,⎕)∈1,⍴I
[5] T[I;]←R⌽T[I;]
∇
∇ T←TIN edZAP I
[1] ⍝ FOR EDIT: CLEAR SPECIFIED LINES I
[2] T←TIN
[3] T[I;]←' '
∇
∇ T←I eXPANDO Z;R;P;IR
[1] ⍝ UNSQUEEZE A SQUEEZED TEXT (E.G. AS SAVED BY iS)
[2] ⍝ ARGS: Z, T WITH RUNS OF BLANKS REMOVED
[3] ⍝ I, THE RESULT OF gETRUNS ON T
[4] ⍝ OUT: T, A TEXT UNSQUEEZED INTO 15 SCREEN LINES
[5] T←960⍴' '
[6] P←R←0
[7] LOOP:→0×⍳(1↓⍴I)<R←R+1
[8] IR←⍳I[2;R]
[9] T[I[1;R]+IR]←Z[P+IR]
[10] P←P+I[2;R]
[11] →LOOP
∇
∇ I←gETRUNS M;S;E
[1] ⍝ IDENTIFY 'RUNS' (CONTIGUOUS 1S) IN BINARY VECTORS
[2] ⍝ ARGS: M, A BINARY VECTOR
[3] ⍝ OUT: I, A 2×? MATRIX. I[1;K] IS THE INDEX OF THE KTH RUN
[4] ⍝ MINUS 1, I[2;K] IS THE LENGTH OF THE KTH RUN
[5] S←¯1+(0⌈M-¯1↓0,M)/⍳⍴M
[6] E←((0⌈M-1↓M,0)/⍳⍴M)-S
[7] I←S,[0.5] E
∇
∇ I←gETMASK T
[1] ⍝ GET BINARY MASK FOR TEXT (ALLOWS ONE BLANK BETWEEN WORDS)
[2] ⍝ ARGS: T, A TEXT STRING
[3] ⍝ OUT: M, A MASK FOR WORD RUNS
[4] M←' '≠T
[5] M←(M∨1↓M,0)∧M∨¯1↓0,M
∇
∇ I←N iS T;M
[1] ⍝ SAVE A SQUEEZED TEXT TO GLOBAL VARIABLES
[2] ⍝ ARGS: T, A TEXT STRING; N, A NON-NEGATIVE NUMBER
[3] ⍝ SETS: T<N>, THE TEXT WITH RUNS OF BLANKS REMOVED
[4] ⍝ I<N>, THE RESULT OF gETRUNS ON T
[5] ⍝ OUT: IGNORE
[6] M←gETMASK T
[7] i←gETRUNS M
[8] ⍎'T',(⍕N),'←M/T'
[9] I←0⍴⍎'I',(⍕N),'←I'
∇
∇ RC←qUERYRC
[1] ⍝ GET A SCREEN COORDINATE FROM THE USER
[2] ⍝ OUT: RC, A 2-VECTOR, 1≤RC[1]≤15, 1≤RC[2]≤64
[3] UI:RC←,⎕
[4] →UI×⍳2≠⍴RC
[5] →UI×⍳∼∧/(0 0 <RC)∧ 15 64 ≥RC
∇
prHLP←' )NEXT ←)PREV D)ISPLAY i)NSERT a)PPEND e)DIT d)ELETE #)POSITION J)UMP ?)HELP Q)UIT Q)UIT+'
edHLP←'P)RINT E)DIT C)OPY R)OLL Z)AP c)OPYV r)OLLV z)APV B)OX G)RIDPRINT ?)HELP Q)UIT'
-
Notifications
You must be signed in to change notification settings - Fork 0
A VISUAL TEXT DISPLAY SYSTEM FOR THE IBM 5100 PORTABLE COMPUTER
License
stepleton/TITORPOINT
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A VISUAL TEXT DISPLAY SYSTEM FOR THE IBM 5100 PORTABLE COMPUTER
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published