qarnos wrote:So I assume you are generating the dither patterns dynamically? 128 would seem like too much to store statically.
There are only 16 discrete dither patterns, so I'm just using the static image above (generated by Photoshop's pattern dithering tool).
Dwedit wrote:A "PLOT 205" command sounds really obscure. Like the kind of thing you'd need a manual right in front of you to program with. Maybe add extra commands, like "ELIPSE"?
This one bothers me too, but as far as I'm aware the current BASIC helper libraries also rely on memorising numeric codes for each command (through necessity, not design). However, I cannot modify the BBC BASIC language (and add new keyword). I can add new star commands (*ELLIPSE) as these are intended to be executed by the OS, but no numeric parsing is available for these.
Fortunately, there is a pattern to the
numbers used; the two least significant bits define the colour (0=none, 1=foreground, 2=inverse, 3=background), bit 2 specifies whether the passed coordinates are absolute (1) or relative to the last point (0) and the remaining five bits define the type of shape.
There's nothing to stop you from doing this, either:
Code: Select all
DEF PROC_ellipse(cx,cy,rx,ry)
MOVE cx,cy
PLOT 0,rx,0
PLOT 201,0,ry
ENDPROC
On the keyword list ("CATALOG" replacement) I was intending on adding help for the PLOT statement that would let you select the mode you wished (type of shape, coordinate system, colour) and it would generate the code for you.
I've done some work on improving the console (it stores a bitmap of the area under the cursor so moving the cursor around no longer destroys graphics or inverted text - before it was just storing the character under each cell and repainting) and graphics code in general. I've added some code to emulate some of the useful features of the
BBC Micro VDU, such as the ability to define the graphics viewport.
"VDU" sends data directly to the output device; an argument that is followed by a comma is sent as a byte and one that is followed by a semicolon is sent as a word. VDU 24,<left>;<top>;<right>;<bottom>; is used in the above example to define a graphics "window" with a 10 pixel border around it. (VDU 26 resets it). The background colour is set to 32 (25%) to make the effect of this statement more obvious.
Yes, that's more arcane number codes to memorise.
EDIT: Added a couple of new screenshots to demonstrate bitwise operations when plotting.
![Image](http://benryves.com/bin/bbcbasic/2008.06.23.03.gif)