Jump to content
IGNORED

How to do graphics on TRS-80 level II BASIC


smartkitten26

Recommended Posts

How do you do graphics on level II basic?

It's been a long time since I messed with a TRS-80, but they technically don't have graphics - text only.

 

However, they do have a set of 64 special text characters, and each is a unique combination of a 2x3 grid of blocks.

 

Since the text display was 64x16, using these special text characters, you could get a 128x48 "graphics" display out of it.

 

IMO, it looked kind of crappy.

Link to comment
Share on other sites

 

 



How do you do graphics on level II basic?

It's been a long time since I messed with a TRS-80, but they technically don't have graphics - text only.

However, they do have a set of 64 special text characters, and each is a unique combination of a 2x3 grid of blocks.

Since the text display was 64x16, using these special text characters, you could get a 128x48 "graphics" display out of it.

IMO, it looked kind of crappy.


That's what I meant, could you tell me what command is used? Edited by smartkitten26
Link to comment
Share on other sites

How do you do graphics on level II basic?

It's been a long time since I messed with a TRS-80, but they technically don't have graphics - text only.

 

However, they do have a set of 64 special text characters, and each is a unique combination of a 2x3 grid of blocks.

 

Since the text display was 64x16, using these special text characters, you could get a 128x48 "graphics" display out of it.

 

IMO, it looked kind of crappy.

 

That's what I meant, So can you give me code to show me how to use them? it's OK if the code gets complicated, I know alot of BASIC, (and FORTRAN, but I don't think there's FORTRAN for the TRS-80) so I should be able to understand.

I don't remember how to do it. I'm sure sample code is easy enough to find, though.

Link to comment
Share on other sites

You should seek out a copy of the RPG "Quest For The Key Of Night Shade" (aka "Nightshade"), which used a mixed-mode text and graphics display and was written in BASIC (so you can crib from it). As a game, it's brutally difficult, but was award-winning in its time.

Edited by thegoldenband
Link to comment
Share on other sites

Try this link:

 

http://www.trs-80.com/wordpress/info-level-2-basic-language/#Graphics

 

That manual says there are set and reset functions to turn a pixel on or off, and a point function to get the status of a pixel. Underneath, they will still be using the character graphics, but it looks like this hides it from you. (But of course, will not be as efficient for changing large areas).

  • Like 1
Link to comment
Share on other sites

Try this link:

 

http://www.trs-80.co...guage/#Graphics

 

That manual says there are set and reset functions to turn a pixel on or off, and a point function to get the status of a pixel. Underneath, they will still be using the character graphics, but it looks like this hides it from you. (But of course, will not be as efficient for changing large areas).

 

Thanks for the link.

 

So something like this should let you draw?

 

10 CLS
20 Y=1
30 X=1
40 KEY$ = INKEY$
60 IF KEY$ = "W" THEN Y=Y-1
70 IF KEY$ = "S" THEN Y=Y+1
80 IF KEY$ = "A" THEN X=X-1
90 IF KEY$ = "D" THEN X=X+1
100 SET (X,Y)
110 IF KEY$ = "F" THEN CLS
120 GOTO 40
Edited by smartkitten26
Link to comment
Share on other sites

Well, this is certainly something I'm qualified to answer, since the L216K was my first computer.

 

The main way is by using the SET/RESET commands. This gives you 128 x 48 blocks. The POINT(X,Y) function will return whether a block has been set or not.

 

The fast way is to print the character codes that correspond to the blocks. Codes 128 to 191 will print all the various combinations of six blocks. PRINT CHR$(191) prints a character with all six blocks set. (FYI, 192 to 255 print a large number of spaces.) Even faster was when people would poke the graphics right into the string constants in a program, but those would get de-tokenized on listing and make the line un-editable.

 

Also, Microsoft's "Level III BASIC" added a LINE x1,y1-x2,y2 command, but that was cassette only. (I did hack up a version to overlay over Disk BASIC, but I don't remember whether I had to make a point of setting Memory Size or not. I still need to make a program to extract my TRSDOS .DMK image rips... I did a CoCo dumper yesterday.)

 

Of course, in assembly language you had nothing but the character codes to work with, and the graphics would be pretty darn fast.

Link to comment
Share on other sites

10 CLS
20 Y=1
30 X=1
40 KEY$ = INKEY$
60 IF KEY$ = "W" THEN Y=Y-1
70 IF KEY$ = "S" THEN Y=Y+1
80 IF KEY$ = "A" THEN X=X-1
90 IF KEY$ = "D" THEN X=X+1
100 SET (X,Y)
110 IF KEY$ = "F" THEN CLS
120 GOTO 40

WASD? You heathen! One of the nice things about that keyboard (before they broke it with the later M4 keyboards) was how nice it was to use the arrow keys with two hands in games, and your thumb on the spacebar. Let's see, left arrow is CHR$(8), right arrow is CHR$(9), down arrow is CHR$(10), and I think up arrow was probably CHR$(91), which was the remapped "^" in the original Model I chargen chip.

Link to comment
Share on other sites

 

10 CLS
20 Y=1
30 X=1
40 KEY$ = INKEY$
60 IF KEY$ = "W" THEN Y=Y-1
70 IF KEY$ = "S" THEN Y=Y+1
80 IF KEY$ = "A" THEN X=X-1
90 IF KEY$ = "D" THEN X=X+1
100 SET (X,Y)
110 IF KEY$ = "F" THEN CLS
120 GOTO 40

WASD? You heathen! One of the nice things about that keyboard (before they broke it with the later M4 keyboards) was how nice it was to use the arrow keys with two hands in games, and your thumb on the spacebar. Let's see, left arrow is CHR$(icon_cool.gif, right arrow is CHR$(9), down arrow is CHR$(10), and I think up arrow was probably CHR$(91), which was the remapped "^" in the original Model I chargen chip.

 

I don't actually have a TRS-80 to test anything on, but this should work better?

 

10 CLS
20 Y=1
30 X=1
40 KEY$ = INKEY$
60 IF KEY$ = CHR$(91) THEN Y=Y-1
70 IF KEY$ = CHR$(10) THEN Y=Y+1
80 IF KEY$ = CHR$( THEN X=X-1
90 IF KEY$ = CHR$(9) THEN X=X+1
100 SET (X,Y)
110 IF KEY$ = "F" THEN CLS
120 GOTO 40
Edited by smartkitten26
Link to comment
Share on other sites

Also, Microsoft's "Level III BASIC" added a LINE x1,y1-x2,y2 command, but that was cassette only. (I did hack up a version to overlay over Disk BASIC, but I don't remember whether I had to make a point of setting Memory Size or not. I still need to make a program to extract my TRSDOS .DMK image rips... I did a CoCo dumper yesterday.)

 

Was this with the stock TRS-80 Model III (etc.) hardware, or with the optional Hi Res board?

 

I have very fond memories of the Model III from school in the (very) early 1980s, but I don't recall having encountered Level III Basic. Shortly thereafer, I acquired a Coco and I have literally not touched a Model III since 1984.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...