Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top