12

I recently got my hands on a BBC Micro (model B), and been playing around with it as a hobby project.

I'm having some trouble with the graphics commands, and was wondering if anyone could point me in the right direction... I have written the following test program to draw a rectangle on the screen:

10 CLS
20 MODE 5
30 MOVE 0,0
40 PLOT 97,100,100

When I run this, the program completes but no rectangle is drawn (that I can see). I'm using a coaxial cable to connect to a CRT TV, but I don't believe the cursor is drawing off-screen because I've tried adjusting the X/Y values to check for this.

Have I made a mistake in my test program? Is there possibly a known hardware fault that I should check for?

seanhodges
  • 17,426
  • 15
  • 71
  • 93

1 Answers1

10

There's a simple explanation: PLOT 97 (draw rectangle) was not implemented on the original BBC Micro Model B - that used PLOT codes only up to 87. I'm not absolutely certain when PLOT 96-103 were introduced, it may have been the Model B+ or the BBC Master.

On a Model B you must draw the rectangle as two triangles (here in the centre of the screen):

   10 MODE 5
   20 MOVE 592,462
   30 PLOT 0,0,50
   40 PLOT 81,50,-50
   50 PLOT 81,0,50

Richard.

user1912647
  • 116
  • 1
  • 4
  • 1
    Perfect, exactly what I needed. I was using [Ben Ryves website](http://www.benryves.com/bin/bbcbasic/manual/Keyword_PLOT.htm) as a reference, I'll be more cautious of compatibility from now on. Thanks! – seanhodges May 07 '13 at 08:52
  • 1
    BBC Model B PLOT codes went up to 95. 88-95 are often forgotten, possibly because the typesetting of the original User Guide made them easy to miss. – arx Jul 11 '14 at 00:09