[ Go to Stephen's Entry Page ]

[ TI99/4a Articles index |   TI Book front page |    TI Resources Page |   PC99 Programs |   TI*MES 20 |   TI*MES 22 and 23 ]

contact - please use subject="pc99 page" to avoid spam trap!

Jump to:
What program is (disk file) for?   || Caring for magnetic tapes   || Basic: Number correct to N places

Unreadable Display Variable 80 files   || Debugging Ed/As file ASSM2

Basic with PRK/Stats- Enhanced Basic Part 2- CALLS: L,P,H,G,S

This web page contains the text of articles for owners of the TI-99/4a from Issue 21 of TI*MES. It is of use to users of the TI-99/4a emulators.

Items from TI*MES Issue 21, July 1988

The first item reported was the first AGM held at Derby on 28th May 1988. Three of the initial committee members had left already. Fortunately there were in place "members without portfolio" so that Alan Rutherford took over as Treasurer, Tim Anderson took over as Cassette Librarian. Peter Walker added Communications to his duties. New job titles allocated were Print and Distribution to Alan Bailey, Publications librarian to Bryan Cloud, and Module Librarian to Edward Shaw. One new committee member- Christine Bennett who took on Publicity Officer.

Three members reported to have died during the year were Ian Martin, John Roe and Ron Johnson.

Ron Johnson

Dear Editor,
Obituary
I feel I would like to inform you of the death of one of your subscribers, Mr. R.W. Johnson of Berkshire, who was aged 62. I find my brother has been a subscriber to your magazine for quite a long time. He was an enthusiastic user of his Texas equipment, also a very clever mathematician.

Modules on cassette tape

I am writing to you so you can pass this on to other members who are not lucky enough to have a Disc Drive. I only have Extended Basic, 32K expansion and Mini Memory.
I wrote to Maurice Rymill to ask for machine code programs on cassette because all good programs are on disc which I haven't got. Maurice put me in touch with Stephen Shaw who told me that he could load Disc programs on to tape. He sent me a list of programs that might work on tape, using Extended Basic plus 32k expansion. I wrote back to Stephen, and in a couple of days he sent me a LOADER-LOAD program, which you need in order to load machine code programs, plus two games programs.

I loaded the LOADER-LOAD program into the computer, then loaded Star Trek. This had to be done in three parts, but was no problem. The game started straight away, no waiting as with Basic programs. Defender loaded the same and worked first time.

Star Trek is an 18k program, Defender is slightly smaller. There are over fifty programs on the list Stephen sent me, all in machine code. If you have Editor-Assembler module you can load even faster without using the LOADER-LOAD program.

Mr K.F.Hughes, Bristol

Historic Note- I had forgotten all about this. I don't think anyone else followed this up, including Mr Hughes. The games referenced were former TI modules, by this time treated as "abandonware" and freely circulating on disk.

Debugging Editor Assembler ASSM2

TI EDITOR ASSEMBLER BUG:
If you wish to use PIO as an output device for a LIST using the EdAs module, you have to put a full stop after it to make it work - eg PIO. - due to an error in the supplied ASSM2 file.

The error lies in the DSRLNK routine which the assembler uses - it does not use the same routine that YOUR programs call! The assembler internally uses a modified VSBR routine which returns data to R0 instead of the usual R1, but whoever wrote the internal DSRLNK forgot this!

Consequently, the assembler looks at R1, and the program uses an incorrect name length when scanning for the device name! Adding the period causes the routine to exit, and "catches" the error.

Want to fix it? If you still have the original ASSM2 file, use a sector editor look for the code 04 20 AA BE 00 00 D1 C1. It is usually in the 8th sector of the file.
Change that last C1 into a C0 and the Assembler will work as it is supposed to! No need to add a full stop after PIO now!

Courtesy Danny Michael (Dump and Neatlist author), SHOALS 99ERS

Go to top of page

The text from Rambles below has been taken directly from a TI99/4a DV80 file and has not been subject to the problems of OCRing! RAMBLES July 1988
by Stephen Shaw. STOCKPORT, Cheshire, UK

Basic: Rounding numbers to N places

CORRECT TO N PLACES....
Rounding is easy- just use:.
  RESULT=INT(NUMBER+0.5)
But if you want to display a number correct to a certain number of digits? A little more difficult but not impossible..
The GENERAL format is:

   RESULT=INT(NUMBER * P+0.5)/P
Where P=the power of ten of the number of places to be rounded. Thats easy isn't it? To round to two places,
P=100  
  which is ten squared or
           ( 10^2 )

The general format will only work for positive numbers. For numbers which may be either negative or positive, the formula becomes:.
RESULT=INT(ABS(NUMBER)*P+0.5
)*SGN(NUMBER)

Here us a tiny utility sub program for you- for TI BASIC just remove the first and last lines and GOSUB instead.
... 100 SUB PLACES(NUMBER,PLACE
S,RESULT)
110 P=EXP(PLACES*LOG(10))
120 RESULT=INT(ABS(NUMBER)*P
+0.5)/P*SGN(NUMBER)
130 SUBEND

Now to find out what 2.3456 rounded to 3 places is you would use: 1 CALL PLACES(2.3456,3,RESULT)
2 PRINT "Result:":RESULT
3 STOP

Machine Code on Tape

MAURICE E T SWINNEN of Mid Atlantic 99ers. 1986.
============== .
MACHINE CODE FROM TAPE:.
Did you know that CALL INIT:: CALL LOAD("CS1") works! Of course first you have to transfer those DF80 files from disk to cassette. And some of the lines may need shortening (you do remember that cassette data files don't use 80 byte records!)- dropping off the checksum is a good start there!.
  eg from ..9BD3A87F131F   0001
          ..5A47F196F      0002
          ..A127F1BFF      0003
  shorten to:
          ..9BD3A8F        0001
          ..5A4F           0002
          ..A12F           0003
-eg remove the 7 tag and the next four characters. Leave the final F.

Read each record from disk and transfer the first 64 characters to tape- you will need to note how many lines are to be transferred or use the EOF finction. The tape file is saved as DISPLAY,FIXED 64. .
You will also need to know the starting name to LINK to. Then of course, there is the TIME element. Take a look at how many lines your average DF80 file has... a 54 line file, loaded from tape, takes 6 minutes. Now work out how long it is going to take to transfer SUPER DEMON ATTACK this way... and WHERE are you going to find a cassette THAT long!.

Just one more capability the TI99/4A has that has not been documented. Now we have the FUNLWEB LOAD program, tape owners can find it much easier to load machine code into their 32k rams using memory image files. Much faster. Editor Assembler module owners can just use the LOAD PROGRAM FILE option and indicate CS1. - it really was clever of TI - the ONLY loader that TI supplied to enable cassette owners to load machine code into expansion ram, and it is sold on a high priced package- module, huge manual, and two disks. Thanks to George Meldrum, TIsHUG. May 1988.

Go to top of page

Load DSK1.load when program BREAKs

SOURCE CODE. Author and original publication not known..
Assemble this little utility into a non-compressed DF80 file and you can load it into XB with a CALL LOAD. Then it will auto-boot "DSK1.LOAD" whenever a running XB program breaks for ANY reason - a little more powerful than ON BREAK NEXT. Try it!

         DEF CHECK
CHECK MOVB @>8344,@>8344  * >8344 IS 0 IF XB NOT IN RUN MODE
       JEQ  NORUN
       B    *R11           * EVERYTHING OK SO RETURN ELSE:

NORUN  CLR  @>83C4         * TURN THIS ROUTINE OFF (ISR HOOK)
       LI   R1,>6372       * XB GROM START
                             * MAY NOT WORK WITH SOME XB VERSIONS
       MOVB R1,@>9C02      * WRITES >63 TO GROM WRITE ADDRESS REGISTER
       SWPB R1
       MOVB R1,@>9C02      * WRITE >72 TO GROM WRITE ADDRESS REGISTER
       B    @>006A         * EXECUTE XB
       AORG >83C4
       DATA CHECK          * PLACE THIS ROUTINES ADDRESS AT >83C4
       END
.

"We do not know what is going on in England. we know the Queen is still kicking and alive (God save Her!), but we are afraid the TI-99/4A is dead there." Huh? Written by Paolo Bagnaresi, Milan, Italy, in August 1986, to Ottawa, Canada. Guess our reputation hasn't got to Italy just yet then!.

INFOCOM adventures are not all FULLY logical- there is a RANDOM element in some of them which means that sometimes you die and sometimes you live... and an interesting command to type in to your INFOCOM adventures is $VE try it! There is a #RAND command in Lurking Horror, which expects a number before/after it, not sure what it does but I think it may determine the path when you come to a random choice. HITCHHIKER has a total vocabulary of 969 words- have you found them all yet? KILL ADAMS? Some odd commands, purpose unknown include XYXXY and ZZMGCK - the latter may just be an end of file dummy. SUSPENDED has a vocabulary of 680 words, but you can complete it with just 35, that's real overkill!.

Display Variable 80 files you can't open

DV80 FILES TI WRITER CAN'T READ:.
Any time you see a Display Variable 80 file on a disk, it is always a good idea to take a look at it with TI Writer, as there is a good chance it is either documentation or source code-which may contain documentation. In almost every case a DV80 file should load with TI Writer, whatever is in it, text or data or anything..
However, there are a few text files coming out of Europe that you CANNOT load with our version of TI Writer- our European friends are using a different and incompatible version of TI Writer, VERSION 2.0. If their text files are saved to disk with PF there is no problem, but using SF adds tab information.

In order to produce those odd European characters, printers use ASCII codes outside the usual range of Vn 1 of TI Writer, so Vn 2 was modified to accept them, and the tab info had to be modified as well. And as their tab data is outside the capabilities of our version to handle, the result is a console lock up. Curing the problem was difficult, until our membership secretary dealt with it....
In the April 88 issue of EAR99'ers newsletter, he presented a program to amend the tabs on a Vn 1 TI Writer file- largely to demonstrate the way the tabs are saved. What was interesting was that by appending a new tab set, the original set is "replaced". If it works for version one, why not try appending a version one tab set onto the end of a version two file?.
It works! The following routine is a much modified form of his program. If you cant load any DV80 file, amend it with this trifle and try again!.

 100 REM MAKE VN 2 TI WRITER 
     FILE ACCEPTIBLE TO VN 1 
     based on an idea by     
     Peter Walker. UK. 1988. 
 110 DISPLAY AT(2,2)ERASE ALL
 :"INPUT NAME OF FILE TO BE":
 "MODIFIED:"                 
 120 DISPLAY AT(6,2):"DSK1." 
 130 ACCEPT AT(6,5)SIZE(-12):
 FILE$ :: FILE$="DSK"&FILE$  
 140 OPEN #1:FILE$,DISPLAY,VA
 RIABLE 80,APPEND            
 150 A$=CHR$(128)&CHR$(134)&C
 HR$(128)&CHR$(212)&RPT$(CHR$
 (213),16)&CHR$(128)&CHR$(136
 )                           
 160 PRINT #1:A$             
 170 CLOSE #1 :: PRINT "DONE"
 180 END                     

Go to top of page

PR BASE HINTS:.
Sorting and so on are based on an ASCII STRING and everything works according to the ASCII values of the characters. Thus while 4 comes after 2, 22 will come before 4. Use leading zeroes on numbers you are sorting by- then you will correctly find the sort as 02,04,22..
Selective Indexing search works on your input UP TO the first space, so that "good day" will only work on "good". To use the whole thing, you must insert a question mark, thus "good?day"..
PLEASE will someone write tutorials for us for PRBASE and CFS!.

Caring for cassette tapes

CASSETTE CARE:.
The Manchester Central Library have published an excellent leaflet on care of cassettes and cassette players, which is highly relevent to Cassette Users. I have extracted the juicy bits for you....
MUSTS:.
1. CLEAN your recorder regularly- if you use a "wet cassette" you must still clean separately the capstan and pinchwheel, as these special cleaning cassettes only clean the heads properly. See notes later!.
2. Keep cassettes in cases, away from heat and magnetic fields and damp..
3. Before putting a cassette in the machine, rotate a spool with your finger to make the tape fully taut..
4. Never use C120's and for best results stick to C60s or shorter. C120s are very likely to stretch and snap, and even C90s may come apart quite quickly. The thinner tapes are more likely to snarl up your machines..
5. Cassettes are not hammers. Observe care..
.
Detail:.
A cassette tape is a VERY thin thing, coated with an even thinner oxide coating, and even under the best conditions, the best tape will shed its coating little by little... onto the surfaces of your recorder, where they stick and begin to scratch your tapes and even more coating comes off.....
The PINCHWHEEL is the larger rubber-like wheel which rotates pulling the tape onto the take up spool, while the CAPSTAN is the thin metal wheel which presses the tape against the pinchwheel. If you dont clean these properly, tape is liable to snarl up in your player. The only way to clean them is with COTTON BUDS, dipped in special head cleaning fluid or meths. Some alcohols may be suitaable but NOT isopropyl alcohol, widely used for cleaning disk drives!, as isopropyl alcohol can cause uneven swelling in the pinchwheels..
Clean the heads to avoid undue wear, and losses of audio quality (dullness) which may stop the player being computer compatible..

CLEAN EVERY 10 HOURS PLAYING TIME. .
If you use a head cleaning tape, discard it after ten uses, after that it just spreads dirt around..
Tape heads become magnetised over a period of time- as the tape passes over them, the heads gradually build up a magnetic charge from the tape. This could produce increased background hiss, and might eventually result in tapes becoming partly (and irrevocably!) erased while being played. Demagnetise your heads AT LEAST once a year. Special cassette-shaped devices can be bought and are safest to use. .
(With thanks to Manchester City Council-Cultural Services)

ADDITIONAL: The material used on all magnetic tapes (cassettes and VHS videotapes) is very unhappy with any contact with water. If you keep the tape quite dry throughout its life, it can last for decades. However just half an hour in high humidity (a damp room in a charity shop or a market stall in the rain) and after the tape has dried out, chemical processes will be in process, and sooner (from 6 months to 2 years or so depending on the coating) rather than later the coating will begin to smell of vinegar and become really sticky. Do everything you can to keep your tapes dry at all times.

==========.
ATARISOFT BUG:.
In case you just find one, the early Atarisoft modules for the TI99/4A do not all work properly in SOME consoles. Atari downloaded the "large character set" from grom 0, but used a direct address instead of the indexed address, and yep, some consoles are 4 bits out on the direct address. It means those characters look kinda Japanese....
=====.
MILTON BRADLEY BUG (and others):.
Some MB games intended to use speech have a bit of a problem when loaded from disk dumps into the 32k ram. The delay in testing for speech is just not long enough (see EdAs manual pages 349/350), so sometimes the games will fail to identify that you have a speech synth, and give no speech. .
====== .
TI FORTH DEBUG.
The following corrections have just surfaced from Ottawa- passed on without testing. Change a COPY of your Master Disk!.
Screen 58 line 10 to read:.
VDPMDE @ 4 < IF SMTN 80 0 VFILL 300 ' SATR ! ENDIF.
Screens 53,54,54 line 1 should end SETVDP2..
Screen 59 line 9 change 00FF to OOFE
.

Go to top of page

What IS that disk file?

WHAT'S IN A FILE?.
Disks for the TI can have a number of different file types, which can serve several different purposes. How can you tell which is which? In some cases, you are reduced to trial and error! But the following notes may help:.
.
PROGRAM FORMAT:.
Unwisely named, as not all PROGRAM files are programs. This type of file is better described as MEMORY IMAGE- just a byte by byte image of a particular area of memory in the computer, which MAY be a program in basic or machine code, or some kind of data- graphics, adventure data and so on..
FUNLWEB will identify basic and most machine code images for you- use SD from TI Writer, and once the directory is on screen press the equals (=) key. The right hand column will now be marked BA or EA as appropriate. Other memory image files can be identified as follows:.
File name ends in _P or _C: A picture to load with TI Artist or MAX/RLE.
File is 54 sectors long: MAY be a picture to load with Graphx or MAX/RLE.
File is 25 sectors but doesn't end in _P or _C: MAY be graphics for CERT99.
File is 8 sectors: May be a graphics screen for Fractal Explorer.
File names are identical except for last letter:

Type 1:
INVADERS
INVADERT
INVADERU
Ed/As Option 5
Machine Code program

OR

TYPE 2:
INVADERS
INVADERS1
INVADERS2
Gram Kracker
Machine Code program.

If you place the files on a blank new disk, and inspect the header (first 3 bytes) on Sector 22, with a sector editor, as supplied with Funlweb, you may also determine:
TUNNELS OF DOOM: 0406 0504 0400
Scott Adams Adventures: 2020 2020 2020
Module ram required: If third byte is >8000 or >7000
If the first byte is 0000 you MAY be dealing with graphics such as a CHARA1 file or a GRAPHX picture.
On standard E/A Option 5 files, where there is more than one file, eg INV1,INV2 and so on, the first byte on the LAST file is >0000 while all preceding files have a first byte of >FFFE (Gram Kracker files are >FF05,>FF06 etc).
***
DISPLAY VARIABLE 80
Almost all DV80 files can be loaded into TI Writer for inspection. If they won't load they may have been prepared with the European version of TI Writer, just use the little utility program given elsewhere in this issue to force them to load!
DV80 files are most commonly:
TEXT- documentation.
SOURCE CODE - which may contain instructions!
GRAPHICS:
Files ending _I,_F,_S are for TI ARTIST.
5 sector and 2 sector files MAY be for Picasso.
Files may be RLE graphics.
***
DISPLAY FIXED 80:
Usually used for machine code object files, to load with XB or EA modules.
Can also be loaded into TI Writer for inspection.
36 and 68 sector files MAY be fonts for THE PRINTERS APPRENTICE.
***
DISPLAY FIXED 128:
Used for RLE GRAPHICS.
MAY be ARCHIVED files which need unpacking.
Could be a special format machine code file requiring a special loader.
***
INTERNAL FIXED 128:
Used for JOYPAINT FONTS.
Also used for COMPRESSED ARCHIVED files which need uncompressing.
***
DISPLAY VARIABLE 163:
Used for Extended Basic MERGE files.
type MERGE DSK1.FILENAME.
***
DISPLAY FIXED 254 is used for Draw a Bit graphics.
***
INTERNAL VARIABLE 254 is used for:
LONG Extended Basic programs.(Use OLD DSK1.FILENAME as usual)
Data for Creative Filing System
Data for TRIO SINGS program.
Data for CSGD- watch for file names ending in /CH and /GR etc.
***
DISPLAY FIXED 255:
Used for INFOCOM data files, usually GAME1 and GAME2.
Used for Super Disk Cataloguer data files.

That will give you a start anyway!

Go to top of page

Rambles continues

This section has been OCRd from the magazine, involving quite a bit of retyping, in common with most of these articles.

Enhanced Basic Part 2

ENHANCED BASIC (Part Two) - CALL L, CALL P, CALL H, CALL G

Or what You Can Do when you have the Personal Record Keeping or Statistics modules inserted into your console, or, if you have loaded the modules from disk image files, if your console thinks they are inserted...

Last issue we dealt with the really easy bit, the equivalent calls to ACCEPT or DISPLAY data.

This issue we shall dive into the mysteries of CALL L (load), CALL P (partition), CALL H (header), and CALL G (getput).

The best way to introduce these perhaps is with a working program, then in the next issue we can get down to a little more detail!

Program first, then discussion. This program will use an already created PRK data file, and in the TI Basic environment will read that data and display it on the screen. It will demonstrate several of the calls in a fairly simple manner, so you can get used to the idea of using PRK data in a Basic program.

If you have a disk system, first free up memory by typing:

CALL FILES(1)  
NEW 
before you load and run this program.

As this program occupies some VDP memory, you may find that a few PRK data files will be too long to load. Try deleting some records to make the data fit.

Remarks will be in lower case between the program lines

BEFORE LOADING THE PROGRAM you must allocate an area of VDP memory for the data, by using the partition command, in command mode, thus: CALL P(10900) NEW Now load the following program and run it:
   first 1oad the prk file from disk or cassette
100 CALL L("CS1",Y)
   or call L("dsk1.fi1ename",y) as you wish now to check to see if the file is loaded
110 IF Y=0 THEN 500
   no there was an error else carry on as follows how many fields in each record? lets find out
120 CALL H(1,5,0,F)
   where f will return number of fields
130 CALL CLEAR
140 CALL D(1,1,28,"# OF FIELDS:"&STR$(F))
   then we need to know how many records there are in the data file- think of a record as a page.
150 CALL H(1,6,0,R)
160 CALL D(2,1,28,"# OF RECORDS:"&STR$(R))
   now let's loop through each record and display it on the screen
170 FOR RCD=1 TO R
   taking each field in turn
180 FOR FLD=1 TO F
   but does the field contain a number or a string? let's find out:
190 CALL H(1,10,FLD,TYPE)
200 IF TYPE=1 then 240
   as type is 0, data is a number get the data from field FLD of record RCD:
210 CALL G(1,RCD,FLD,Z,RD)
   and print the result on screen:
220 CALL D(2+FLD,1,28,RD)
   and jump over string section
230 GOTO 260
   this is the string section:
240 CALL G(1,RCD,FLD,Z,RD$)
250 CALL D(2+FLD,1,28,RD$)
   that's one field dealt with, on to the next:
260 NEXT FLD
   and now all fields in the record are on screen let's give the record number and pause
270 CALL D(23,18,10,"RECORD:"&STR$(RCD))
280 CALL D(24,1,28,"PRESS ENTER FOR NEXT")
290 CALL A(24,28,1,RC,RV$)
   and on to the next record
300 NEXT RCD
310 PRINT "NO MORE"
320 GOTO 320
500 CALL CLEAR
510 PRINT "LOAD ERROR"
520 GOTO 520
530 END

CALL P sets aside an area of memory for the data to be stored in, and must of course be sufficient to hold the data, but for Basic use, we must also have enough room for our Basic program. After using CALL FILES(1), disk users have a maximum of 12768 bytes of VDP RAM free to split between Basic program and data area, while cassette users have 13820 bytes available (see how much memory a disk system eats up). By using 10900 for our data, we have left even disk users with at least 1868 bytes for our little program!

CALL L just loads the data file into the partitioned area, the return variable following the device/file name is a 0 (zero) if an error occurs, for instance, the file is not on the disk, the data is too large for the partition, or other I/O errors. The device/filename may be a string variable if you wish, e.g. CALL L(A$,A)

CALL H deals with the "header" information- the database specification you create when using PRK/Stats what sort of data is held in each field and what name have we given the field?

Looking more closely at the usages in the listing above - there are many other uses-
CALL H(1,5,0,F)
CALL H(1,6,0,R)
CALL H(1,10,FLD,TYPE)

The first digit (1) is a READ instruction. We would use a 0 to write.

The second digit (above we have used 5, 6 or 10) is the header item number obtained from the header data:
Where 5 is the number of fields per record,
Where 6 is the number of records
Where 10 is the type of field, indicated by a value placed in the final variable (TYPE here) and if it returns a 1 the field is a string, a 2 indicates an integer, 3 a decimal number, and 4 a number in scientific notation. The fourth digit is a variable placed in or obtained from the Header data.

There are another eleven header items to cover at some point, and also the writing of data.

CALL G deals with the actual data we have stored, and as used in the listing above, (there are other uses...):
CALL G(1,RCD,FLD,Z,RD)
CELL G(1,RCD,FLD,Z,RD$)
The first item (1) is a READ instruction, with 0 used to write.
The second and third items identify the record and field number that we are going to read/write, while the final item is the variable that the contents of that particular record/field will be placed in for us to use.
Note that we must use a string variable for characters.

That fourth item (Z) is a numeric variable, which can be used to indicate blank field. It takes a value of 0 if data is found, and 1 if data is missing (that is, not entered).

When using CALL G to WRITE, the fourth parameter as above is not used, you just go on to the value you are writing, for instance:
CALL G(0,RCD,FLD,"STRING INPUT")

That fully covers CALL G, apart from a sample of how to write.

CALL S will Save the data area to cassette/ disk, very easily indeed: CALL S(DEVICE$,VARIABLE) with the variable again indicating success or failure, as with CALL L.

Go to top of page


[ TI Book front page   |    TI Resources Page   |   PC99 Review    |   PC99 Programs ]