The TRS-80 had very rudimentary graphics. Little rectangles could be displayed to a maximum of 128 squots (square dots) across by 48 down, always beginning with row 0.
Squots could be put onto the screen with the SET(X,Y) command, removed with the RESET(X, Y) command, and checked for on/off status with the POINT (X, Y) command.
However, using SET/RESET was the slowest way to manipulate graphics and to do anything approximating gaming one would need another method.
In addition to the SET/RESET to control each squot,the TRS-80 had a character set which would include a 2 x 3 squot matrix. These characters, from 128 through 191, ran the gamut from completely off/black (128) to completely on (191), and everything in between.
The 2 x 3 matrix running from 128 to 191 was actually an 8-bit binary representation of a 7 bit number “1xxxxxxx” so if you wanted the top two squots it would be “10000011″, the middle 2 squots would be “10001100″, etc. The actual CHR$(xx) representations appear below on this page.
But there’s more!! While you could use PRINT and PRINT@ to put those CHR$(xxx) matrices on the screen (putting up 6 squots at once), you could also pack them into strings and move those strings around. This is called “String Packing” and is virtually identical to the packing technique used in embedding machine language routines in BASIC programs. String Packing is explained below.
Once run, the routine is called by a simple X=USR(0) command.
|