问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/16334274/bbc-basic-cannot-plot-rectangle-on-screen