SETYPE

See all articles from T-S Horizons n13

SETYPE is an economical way to put a little variety into your choice of type on your TS 2068 by creating three additional type styles.

Type samples: I like "Bold", My wife likes "Modern", My son likes "Italics"
Type samples: I like "Bold", My wife likes "Modern", My son likes "Italics"
************SETYPE**************
8999>STOP
9323 POKE 23607,60: RETURN
9324 LET typ=2: POKE 23618,110: POKE 23619,36: POKE 23620,2
9325 LET typ=1: POKE 23618,110: POKE 23619,36: POKE 23620,2
9326 LET typ=0: RANDOMIZE USR (torg*256+2-typ): POKE 23607,torg-4: RETURN
9977 REM SETYPE by RRRuegg
9978 REM Public domain program
9979 REM *********************
9980 POKE 23562,1: LET torg=255: CLEAR (256*torg-769): LET torg=255: LET reg=9323: LET bld=9324: LET mod=9325: LET ital=9326: LET REG=9323: LET BLD=9324: LET MOD=9325: LET ITAL=9326
9981 FOR i=0 TO 79: READ k: POKE (i+256*torg),k: NEXT i
9982 DATA 0,0,121,203,39,203,39,50,21,255,33,0,61,17,0,torg-3
9983 DATA 1,0,3,126,24,48,203,63,24,44,230,112,24,37,121,230,7,203,39,50,40,255,126,24,30,24,28,24,16,24,14,24,14,24,20,24,18,24,2,203,63,203,63,24,10,203,39,203,39,24,4,183,203,39,182,18,35,19,11,120,177,32,196,201
9984 RESTORE 9982: BORDER 6: PAPER 6: INK 9: CLS : POKE 23607,60
9985 PRINT AT 0,1;"SETYPE offers you a choice of";TAB 8;"four type styles"''TAB 12;"Regular"''
9986 GO SUB bld
9987 PRINT TAB 12;"Bold"''
9988 GO SUB mod
9989 PRINT TAB 12;"Modern"''
9990 GO SUB ital
9991 PRINT TAB 12;"Italics"''
9992 GO SUB reg
9993 PRINT TAB 4;"To choose your type style";TAB 4;"after leaving this screen"'';TAB 6;"Press GOSUB REG";TAB 9;"or GOSUB BLD";TAB 9;"or GOSUB MOD";TAB 9;"or GOSUB ITAL"''TAB 2;"Press C to copy this screen"''TAB 2;"Press any other key to exit"
9994 IF INKEY$="" THEN GO TO 9994
9995 IF INKEY$="C" OR INKEY$="c" THEN COPY
9996 CLS : PAUSE 30
9997 PRINT AT 0,0;"SAVE TO TAPE"; FLASH 1;"?": IF INKEY$="" THEN GO TO 9997
9998 IF INKEY$="y" OR INKEY$="Y" THEN SAVE "SETYPE" LINE 9980
9999 CLS

Beyond economy and compactness, SETYPE offers some other advantages. Single letter variables are reserved for the programs with which you use it; and you do not need to leave the display screen on which you are working to change type styles. If you do want to make some changes, the core of the program is in lines 9981 to 9983.

As written, SETYPE should be quite serviceable. It is conceivable, however, that you may wish to use it with a program that employs machine code that overlaps the SETYPE machine code in the memory. If you must move the SETYPE code, you may do so quite simply by changing the value of the variable “torg” in line 9980.

SETYPE pokes 80 bytes of machine code into the RAM beginning at address (256*torg). This code, when executed, creates a new set of ASCII characters, codes 32 to 127 inclusive, and places it in a block of 768 bytes located immediately below the poked-in code.

Normally SETYPE will occupy the RAM addresses 64512 to 65359. Changing “torg” from 255 to, say 244, would then move SETYPE to RAM addresses 61696 to 62543.

Many happy RETURNS.

TSH

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