Test programs to test a BBC VDU driver from BASIC ================================================= Cursor ------ Tests moving the cursor position left/right/down/up with VDU 8,9,10,11, moving to column 0 with VDU 13, moving to (0,0) with VDU 30, moving to an arbitary point with VDU 31,x,y, and clearing the screen and moving to (0,0) with VDU 12. As you move around the screen, POS and VPOS are displayed. If a text window is defined, the movement should be restricted to within the window, with (0,0) being the top lefthand corner of the window. VDU 13 must remain on the same line. VDU 31 and POS,VPOS must use (0,0) for the origin in the top left-hand corner. Some scrolling output systems that remember lines that have scrolled off the top of the screen have a limit to the number of lines where VDU 10 will work, and eventually cease to scroll downwards until a VDU 12 or a VDU 30. Some systems will not scroll upwards beyond the original VDU 30 or VDU 12 starting point. VDU 8 and 9 should wrap across the sides of the screen. Some systems do not wrap round, stopping at the edge of the screen. Colours ------- Displays sample text in foreground and background physical colours in various display modes. Press a key to step through screen modes. In display modes with 8 or more colours, the background should be the named and numbered colour, and the foreground should be the inverse of the named and numbered colour. The physical colours should be the closest match to RGB numbering, the closest match to the named colour. These are the colours that should be used on systems with no colour palette, or with the default palette selected where 8 or more colours are available. This test also tests VDU 22,n to select screen MODEs, and the bottom text should be in default colours selected with VDU 20. Displays with 256 or more colours, and teletext displays, are outside the scope of this test. Physical colour numbers, the parameter to COLOUR and VDU 17,n should be: +-+-+-+-+-+-+-+-+ |x|x|E|F|I|B|G|R| +-+-+-+-+-+-+-+-+ | | | | | | | +-Red | | | | | | +---Green | | | | | +-----Blue | | | | +-------Intensity or Flash | | | +---------Flash | | +-----------Extension 0 0-------------Select foreground colour 0 1-------------Extension 1 0-------------Select background colour 1 1-------------Select border colour where supported Extensions are implementation specific. For examples, the ZX Spectrum uses bit 5 and 6 to independantly select Flash/Bright and RGB, and ANSI drivers select underline and inverse. On systems where Bright is selectable, bit 3 is Intensity and bit 4 is Flash (eg ANSI, ZX Spectrum). On systems with Flash but no Bright, bit 3 is Flash (eg BBC). Should be: or: or: 00 01 02 03 04 05 06 07 <-- plain plain plain plain 08 09 10 11 12 13 14 15 <-- bright bright flash plain 16 17 18 19 20 21 22 23 <-- flashing plain plain plain 24 25 26 27 28 29 30 31 <-- bright and flashing bright flash plain BlackRedGrnYelBlueMagenCyanWhite On some systems background colours are different to the matching foreground colours. In particular, "dim yellow background" is often a mucky brown. On systems with Bright selectable (eg ANSI, ZX Spectrum), "Dim White" and "Bright Black" are types of grey, and colour 8 is often the same as "Black". The greyscale colours should be: 0:Black, 8:Dim Gray, 7:Bright Grey, 15:White Where COLOUR 192+n is supported, that sets the border colour to n. ColourGrid ---------- This displays all combinations of 16 background colours and 16 foreground colours. On a system where bright (or flashing) background and bright (or flashing) foreground are independently selectable, all 256 boxes will have different combinations of colours, and there will a single blank diagonal of identical colours. Where only the foreground brightness is selectable, or both foreground and background are bright together, there will also be a blank diagonal in the top-right and/or bottom-left quadrants. ColourNums ---------- Simply lists all 256 colours selected by COLOUR/VDU 17,n. Colours 0-31 should be foreground colours as listed by 'Colour', colours 128-191 should be background colours. Colours 64-127 are implementation extensions (for example, the ZX Spectrum allows RGB, Bright and Flash to be seperately selectable), and colours 192-255 select the border colour where supported - this will result in the border flickering 64 times as the colours are selected. CircleINT --------- Draws circles using integer arithmetic. Outline circles are drawn with PLOT 69 (plot absolute point), filled circles are drawn with MOVE (PLOT 4, move absolute) and DRAW (PLOT 5, draw absolute line). Only uses integer arithmetic, so will work if floating point has not been implemented. Graphics -------- Tests various graphics operations drawing shapes manually and with built-in PLOT functions. It cycles through MODEs 0 to 15, skipping MODE 3 and MODE 7, drawing: Triangles drawn with PLOT 85 Filled circles drawn with PLOT 85 (fill triangle) Filled circles drawn with PLOT 153 (fill circle) Outline circles drawn with PLOT 13 (draw absolute) Outline circles drawn with PLOT 145 (draw circle) Filled rectangles drawn with two PLOT 85 triangles Filled rectangles drawn with PLOT 101 (fill rectangle) Outline rectangles drawn with PLOT 13 (draw absolute) Requires RND() to be implemented. Manual circle drawing requires PI, SIN and COS, but only to set the initial constants, so they can be replaced with pre-calculated absolute numbers. Ellipse ------- Tests PLOT 197 and 205 ellipse drawing. Two ellipses tilted at 45 degrees should be drawn. Pixels ------ This tests that screen MODEs have the correct number of logical pixels to fit the physical dimensions. Each screen MODE should display text information centred near the top of the screen, and a crossed box should be drawn exactly along the edges of the screen. Uses POS and VPOS to determine the screen size. Spiral ------ Spiral also tests the physical-to-logical pixel mapping. A spiral should be drawn centred on the centre of the screen. It should be in multiple colours in screen MODEs with more than two colours. Palette ------- In each screen MODE, this draws a series of boxes in each logical colour, and then cycles through changing the palette through the 16 physical colours. Depending on the number of logical colours available, the boxes on the screen will be set to the named colours. OsbyteA0 -------- Tests calling OSBYTE &A0 to read the VDU variables. This is dependent on whether the host implements OSBYTE &A0. VDUList ------- Does the same as OsbyteA0, but using the BASIC function VDU(). This is dependent on the BASIC implementing VDU() and the host implementing the API that VDU() calls. VDU() would normally call OSBYTE &A0. ANSINums -------- Lists all 256 colours as with ColourList, but directly using the ANSI sequences that COLOUR translates to with an ANSI VDU driver. ANSIList -------- Lists all ANSI [m colour sequences, demonstrating what ANSI output the underlying display system implements.