TI Tricks And Tips
Michael A Covington
Here are 13 ways to get more out of your TI-99/4A and Extended BASIC.
Here is a collection of handy hints for TI-99/4A programmers.
1. You can get white characters on a black screen, for the duration of a program run, by executing statements such as:
10 FOR J = 1 TO 14 20 CALL COLOR (J, 16, 1) 30 NEXT I 40 CALL SCREEN (2)
The results look rather good on a color TV, but bad on a black-and-white set, because scan lines break each letter up into separate dots. (The most readable black-and-white display is obtained by executing a CALL SCREEN(15), making the screen gray while leaving the characters black.)
2. In both TI BASIC and Extended BASIC, you can use * for the logical operator AND and + for OR. For instance, the statement IF (X = 0) + (Y = 0) THEN 1500 means "if X = 0 or Y = 0 then go to line 1500." The parentheses are essential to show that you don't want to add 0 to Y. Extended BASIC allows you to use the alternative notation IF X = 0 OR Y = 0 THEN 1500.
3. In Extended BASIC, but not in TI BASIC, pressing any key while a program is being LISTed temporarily halts the listing; pressing any key then causes the listing to resume. In each case the key must be held down for half a second or so in order to get any response.
4. If you RESEQUENCE a program that contains references to nonexistent lines, those references will be changed to references to line 32767. For instance, if you have a GO TO 500 and there isn't a line 500, a RES command will change that statement to GO TO 32767.
5. In Extended BASIC, the command RUN "CS1" loads a program from the cassette drive and immediately runs it. It is equivalent to OLD CS1 followed by RUN. With a disk drive and Extended BASIC, you can use RUN "DSK1. filename", where filename is the name of the program on disk that you want to LOAD and RUN.
6. TI BASIC gives you 608 more bytes of available memory than Extended BASIC. However, you can usually write your program more compactly in Extended BASIC, so the difference is of little practical consequence.
7. Built-in subprograms that require integer arguments, such as CALL HCHAR, CALL VCHAR, CALL SOUND, and the CHR$ function, will in fact accept numbers that are not integers. The argument is rounded to the nearest integer before being used, so that for instance CHR$(10.8) is the same as CHR$(11). CHR$(10.4) would be equivalent to CHR$(10).
8. In TI BASIC, you can include multiple colons (for example, :::::) in PRINT statements to produce multiple line skips. A TI BASIC program using this feature which is loaded from disk or cassette under Extended BASIC will run correctly, but you cannot type multiple colons while in Extended BASIC unless you want them to be taken as statement separators (::). Put spaces between the colons, as in PRINT A :: B rather than PRINT A :: B, and they will work correctly.
9. In Extended BASIC, you cannot have more than four sprites visible on the same line at the same time; additional sprites will be temporarily invisible. The problem is worse with double-size sprites (CALL MAGNIFY(3) or (4)), since then only part of the sprite generally disappears, distorting its appearance.
10. When you execute a CALL SPRITE statement, the sprite will sometimes momentarily pop into existence at a random screen location and then jump to the location that you specified. To prevent this, create the sprite with a color of 1 (transparent) and then alter its color with a CALL COLOR statement.
11. The loss of resolution on the screen that occurs with certain color combinations is inherent in the way color is encoded onto the video signal and does not represent a defect in the TV set or modulator. For greatest sharpness, use black on gray or cyan.
12. The TI-99 sound generator will produce frequencies from 110 to 44733 hertz (cycles per second), well above the limit of human hearing. However, the response of the sound section of most TV sets falls off markedly above 2000 (or, at best, above 10,000) hertz. This means that you cannot, as is sometimes suggested, use the TI-99 to test the upper frequency limit of your hearing. It also means that tones above 2000 HZ—still well within the range of human hearing—will sound markedly different on different TV sets.
13. If you want to transmit lines of more than 80 characters to the printer, open it as "RS232.CR" (or "PIO.CR") rather than "RS232" (or "PIO"). You must still end your line of output (by executing a PRINT statement that does not end in a comma or semicolon) before more than 80 characters have been transmitted, but doing so will not cause the printer to start a new line; the printer will stay on the same line until you explicitly transmit a carriage return, CHR$(13), and a line feed, CHR$(10).
This is particularly useful when you are using a dot-matrix printer in graphics mode, using each character code for a single vertical row of dots and putting hundreds of them on a line.