(by Dave Edson) One of our simplest, fastest, funnest, all machine code arcade games. Raindrops and an incredibe variety of other things come falling down on your head. Use the Joysticks to Catch'em. It's a BALL! — and a flying saucer! — and a Flying Y!— and so on. TRS 80 COLOR. $19.95.


The compiler allows you to write your programs in easy BASIC and then automatically generates a machine code equivalent that runs 50 to 150 times faster. It does have some limitations. It takes at least 8k of RAM to run the compiler and it does only support a subset of BASIC— about 20 commands including FOR, NEXT, END, GOSUB, GOTO, IF, THEN, RETURN, END, PRINT, STOP, USR (X), PEEK, POKE, *,/,+, -, > , < ,=, VARIABLE NAMES A-Z, SUBSCRIPTED VARIABLES, and INTEGER NUMBERS FORM 0-64K. TINY COMPILER is written in BASIC. It generates native, relocatable 6502 or 6809 code. It comes with a 20-page manual and can be modified or augmented by the user. $24.95 on tape or disk for OSI, TRS-80 Color, or VIC.

Please specify system on all orders is only a partial list of what we carry. We have a lot of other games (particularly for the programs, blank tapes and disks and hardware. Send $1.00 for our complete catalog.

AARDVARK-80 2352 S. Commerce, Walled Lake, Ml 48088 (313) 669-3110

Phone Orders Accepted 8:00 a.m. to 4:00 p.m. EST. Mon.-Fri.

character in FL$ matching the INKEY$ character, or a zero if there is no match) will return a one! This would cause an undesired exit if the FOR loop ran from zero to zero. That's why we need to run J from two to two. This means that we must fill the first spot in our "filter" FL$ with a dummy character (in our case, an "X") since a "find" in the first position would return a one, which would not cause an exit.

The next step is to fashion an input routine which will accept and store more than one keypress. We will set up a subroutine which allows LN keypresses, chosen from a string, FL$, of acceptable ones: FOR 1=1 TO LN:

The output is stored in the string OT$, which must be initialized to have length at least LN. The reason for the use of the MID$ technique is to avoid the generation of "garbage" strings which are associated with string concatenation. The loop on K is a little extra feature. It causes the INKEY$ buffer to be reset so that holding down a key will cause it to repeat. If you're troubled by keybounce, you might want to put in a delay loop.

As an interesting application of the above techniques, let's examine a short routine to change the usual TRS-80

keyboard into the super-efficient Dvorak keyboard. In Listing 1, we have a one-line program which "encrypts" the keyboard so that the display is the improved alternate to the usual "QWERTY" keyboard designed by Dvorak in the 1930s.

After clearing sufficient string space, we set up the translation string D$ of 122 characters. Then we insert the two control characters we will recognize: CHR$(8) for backspace, and CHR$(13) for ENTER. Then, we turn on the cursor with PRINT CHR$(14);. The loop is on J as it goes from zero to one, with a step of zero. The step of zero means that NEXT never increments J, and the only way we can exit from the loop is via the BREAK key. The command in the loop just prints CHR$(0) (the first character in D$) if there is no keypress. In this case, it is a do-nothing command. If there is a keypress, we pick out the character in D$ corresponding to the ASCII value of the keypress. This translates to the Dvorak keyboard.

The reason for the use of INKEY$+CHR$(1) is due to a peculiarity of the ASC function. The function gives an error when its argument is the null string. Since " " -f CHR$(1) is just the same as CHR$(1), the ASC function on the concatenation just returns one, which prints CHR$(0), since the first character in D$ is CHR$(0). Because the ASC function returns the ASCII value of the first character of its string argument, no harm is done by tacking on the CHR$(0) when INKEY$ is not null.

Let's try to exploit the "filter" idea further. We will filter the keyboard so that only selected keypresses are recognized. These will be filtered (as in the Dvorak example above) before being printed on the screen. (This might be useful for a situation where the operator types in a password and the filter changes the screen display for security.) We will also provide for a filter on the characters delivered to the output string in case they need to be encrypted or changed for RS-232 or printer output. Assume that we have predefined filter strings FKBD$, FSCR$, CODE$, and FOTPT$.

Consider the following routine: FOR 1=1 TO LN :FOR J=1 TO 1



As in the Dvorak example, we adjust FKBD$ so that the element in the Jth position is nonzero only if J=ASCII (INKEY$) where INKEY$ results from an acceptable keypress. A nonzero value of J causes an exit from the loop and we print the corresponding (possibly coded) value of FSCR$, then store the value (possibly coded with a different code) in FOTPT$.

Let's put the above ideas to work in a multipurpose input program. In Listing 2, we have a routine which will define an "input area" on the screen, with graphics blocks, and will accept only certain characters depending on the value of the flag string SS$. Clear 500 bytes for string input, then initialize the length of the


NEW! PowerDOT allows you to create HI-RESOLUTION screen prints on EPSON (Graftrax and Graftax+), C.ltoh PROWriter, and Radio Shack LP 8 printers without ANY hardware additions or modifications to your TRS-80! You can draw directly on your screen which is a "picture window" of a much larger drawing area, therefore allowing you plenty of room to work. You are only limited by memory size and your imagination! Great for designers, architects, engineers, etc. Model I or III disk version only. Works on all current operating systems. $49.95 $2.50 shipping (U.S./Canada)

* 24 11 500 Stemmons Fwy.

Dallas, Texas 75229 To order call toll free 1-800-527-7432 For product information (214)484-2976 Micronet 70130, 203

Products from Breeze/QSD, Inc

Apparat, Inc.

4401 So. Tamarac Parkway, Denver, CO 80237 (303) 741-1778

0 0

Post a comment